@prettier/plugin-php 0.21.0 → 0.22.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,17 +1,16 @@
1
1
  {
2
2
  "name": "@prettier/plugin-php",
3
- "version": "0.21.0",
3
+ "version": "0.22.1",
4
4
  "description": "Prettier PHP Plugin",
5
5
  "repository": "prettier/prettier-php",
6
6
  "author": "Lucas Azzola <@azz>",
7
7
  "license": "MIT",
8
- "type": "module",
9
8
  "unpkg": "./standalone.js",
10
9
  "browser": "./standalone.js",
11
10
  "exports": {
12
11
  ".": {
13
12
  "browser": "./standalone.js",
14
- "default": "./src/index.js"
13
+ "default": "./src/index.mjs"
15
14
  },
16
15
  "./standalone": "./standalone.js",
17
16
  "./package.json": "./package.json"
@@ -21,31 +20,31 @@
21
20
  "standalone.js"
22
21
  ],
23
22
  "dependencies": {
24
- "linguist-languages": "^7.21.0",
23
+ "linguist-languages": "^7.27.0",
25
24
  "mem": "^9.0.2",
26
25
  "php-parser": "^3.1.5"
27
26
  },
28
27
  "devDependencies": {
29
- "@babel/preset-env": "^7.22.14",
30
- "@rollup/plugin-alias": "^5.0.0",
28
+ "@babel/preset-env": "^7.23.6",
29
+ "@rollup/plugin-alias": "^5.1.0",
31
30
  "@rollup/plugin-babel": "^6.0.3",
32
- "@rollup/plugin-commonjs": "^25.0.4",
33
- "@rollup/plugin-inject": "^5.0.3",
34
- "@rollup/plugin-json": "^6.0.0",
31
+ "@rollup/plugin-commonjs": "^25.0.7",
32
+ "@rollup/plugin-inject": "^5.0.5",
33
+ "@rollup/plugin-json": "^6.1.0",
35
34
  "@rollup/plugin-node-resolve": "^15.2.1",
36
- "@rollup/plugin-replace": "^5.0.2",
35
+ "@rollup/plugin-replace": "^5.0.5",
37
36
  "@rollup/plugin-terser": "^0.4.3",
38
37
  "c8": "^8.0.1",
39
38
  "cross-env": "^7.0.2",
40
- "eslint": "8.51.0",
41
- "eslint-config-prettier": "9.0.0",
42
- "eslint-plugin-import": "2.28.1",
43
- "eslint-plugin-jest": "27.4.2",
39
+ "eslint": "8.56.0",
40
+ "eslint-config-prettier": "9.1.0",
41
+ "eslint-plugin-import": "2.29.1",
42
+ "eslint-plugin-jest": "27.6.0",
44
43
  "eslint-plugin-prettier": "5.0.1",
45
44
  "eslint-plugin-prettier-doc": "^1.1.0",
46
45
  "jest": "29.7.0",
47
46
  "jest-environment-jsdom": "29.7.0",
48
- "jest-light-runner": "^0.5.1",
47
+ "jest-light-runner": "^0.6.0",
49
48
  "jest-snapshot-serializer-raw": "^2.0.0",
50
49
  "prettier": "^3.0.1",
51
50
  "rollup": "^3.28.1",
@@ -65,8 +64,8 @@
65
64
  "test:node": "jest",
66
65
  "test:standalone": "yarn run build && cross-env RUN_STANDALONE_TESTS=true yarn jest",
67
66
  "prepublishOnly": "yarn test",
68
- "prettier": "prettier --plugin=src/index.js --parser=php",
69
- "build": "rollup --config build/rollup.config.js",
67
+ "prettier": "prettier --plugin=src/index.mjs --parser=php",
68
+ "build": "rollup --config build/rollup.config.mjs",
70
69
  "debug": "node --inspect-brk node_modules/.bin/jest --runInBand"
71
70
  },
72
71
  "c8": {
@@ -1,4 +1,4 @@
1
- import { printNumber, normalizeMagicMethodName } from "./util.js";
1
+ import { printNumber, normalizeMagicMethodName } from "./util.mjs";
2
2
 
3
3
  const ignoredProperties = new Set([
4
4
  "loc",
@@ -1,6 +1,6 @@
1
1
  import { util as prettierUtil, doc } from "prettier";
2
- import { isLookupNode } from "./util.js";
3
- import { locStart, locEnd } from "./loc.js";
2
+ import { isLookupNode } from "./util.mjs";
3
+ import { locStart, locEnd } from "./loc.mjs";
4
4
 
5
5
  const {
6
6
  addLeadingComment,
@@ -830,7 +830,7 @@ function printComment(path, options) {
830
830
  return options.printer.printComment(path, options);
831
831
  }
832
832
 
833
- // https://github.com/prettier/prettier/blob/master/src/main/comments.js#L440
833
+ // https://github.com/prettier/prettier/blob/6bff776efd0951b7812818d02d1cae3fda184737/src/main/comments/print.js#L119
834
834
  function printDanglingComments(path, options, sameIndent, filter) {
835
835
  const parts = [];
836
836
  const node = path.getValue();
@@ -3,10 +3,10 @@ import {
3
3
  LINGUIST_LANGUAGES_PHP,
4
4
  LINGUIST_LANGUAGES_HTML_PHP,
5
5
  } from "./linguist-languages.cjs";
6
- import parse from "./parser.js";
7
- import print from "./printer.js";
8
- import clean from "./clean.js";
9
- import options from "./options.js";
6
+ import parse from "./parser.mjs";
7
+ import print from "./printer.mjs";
8
+ import clean from "./clean.mjs";
9
+ import options from "./options.mjs";
10
10
  import {
11
11
  handleOwnLineComment,
12
12
  handleEndOfLineComment,
@@ -14,9 +14,9 @@ import {
14
14
  getCommentChildNodes,
15
15
  canAttachComment,
16
16
  isBlockComment,
17
- } from "./comments.js";
18
- import { hasPragma, insertPragma } from "./pragma.js";
19
- import { locStart, locEnd } from "./loc.js";
17
+ } from "./comments.mjs";
18
+ import { hasPragma, insertPragma } from "./pragma.mjs";
19
+ import { locStart, locEnd } from "./loc.mjs";
20
20
 
21
21
  const { join, hardline } = doc.builders;
22
22
 
@@ -1,4 +1,4 @@
1
- import { getPrecedence, shouldFlatten, isBitwiseOperator } from "./util.js";
1
+ import { getPrecedence, shouldFlatten, isBitwiseOperator } from "./util.mjs";
2
2
 
3
3
  function needsParens(path) {
4
4
  const { parent } = path;
@@ -1,5 +1,5 @@
1
1
  import memoize from "mem";
2
- import parse from "./parser.js";
2
+ import parse from "./parser.mjs";
3
3
 
4
4
  const reHasPragma = /@prettier|@format/;
5
5
 
@@ -7,9 +7,9 @@ import {
7
7
  printComments,
8
8
  isBlockComment,
9
9
  hasLeadingOwnLineComment,
10
- } from "./comments.js";
11
- import pathNeedsParens from "./needs-parens.js";
12
- import { locStart, locEnd } from "./loc.js";
10
+ } from "./comments.mjs";
11
+ import pathNeedsParens from "./needs-parens.mjs";
12
+ import { locStart, locEnd } from "./loc.mjs";
13
13
 
14
14
  import {
15
15
  getLast,
@@ -36,7 +36,7 @@ import {
36
36
  getAncestorNode,
37
37
  isReferenceLikeNode,
38
38
  normalizeMagicMethodName,
39
- } from "./util.js";
39
+ } from "./util.mjs";
40
40
 
41
41
  const {
42
42
  breakParent,
@@ -1204,10 +1204,6 @@ function printClass(path, options, print) {
1204
1204
  const attrs = printAttrs(path, options, print, { inline: isAnonymousClass });
1205
1205
  const declaration = isAnonymousClass ? [] : [...attrs];
1206
1206
 
1207
- if (node.isReadonly) {
1208
- declaration.push("readonly ");
1209
- }
1210
-
1211
1207
  if (node.isFinal) {
1212
1208
  declaration.push("final ");
1213
1209
  }
@@ -1216,6 +1212,10 @@ function printClass(path, options, print) {
1216
1212
  declaration.push("abstract ");
1217
1213
  }
1218
1214
 
1215
+ if (node.isReadonly) {
1216
+ declaration.push("readonly ");
1217
+ }
1218
+
1219
1219
  // `new` print `class` keyword with arguments
1220
1220
  declaration.push(isAnonymousClass ? "" : node.kind);
1221
1221
 
@@ -1753,7 +1753,7 @@ function printNode(path, options, print) {
1753
1753
  if (node.value) {
1754
1754
  return group([
1755
1755
  name,
1756
- // see handleFunctionParameter() in ./comments.js - since there's
1756
+ // see handleFunctionParameter() in ./comments.mjs - since there's
1757
1757
  // no node to attach comments that fall in between the parameter name
1758
1758
  // and value, we store them as dangling comments
1759
1759
  hasDanglingComments(node) ? " " : "",
@@ -1,5 +1,5 @@
1
1
  import { util as prettierUtil } from "prettier";
2
- import { locStart } from "./loc.js";
2
+ import { locStart } from "./loc.mjs";
3
3
 
4
4
  const { hasNewline, skipEverythingButNewLine, skipNewline } = prettierUtil;
5
5
 
package/standalone.js CHANGED
@@ -1 +1 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("prettier/standalone")):"function"==typeof define&&define.amd?define(["exports","prettier/standalone"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).prettierPlugins=t.prettierPlugins||{},t.prettierPlugins.php={}),t.prettier)}(this,(function(t,e){"use strict";var s="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function i(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var n={name:"PHP",type:"programming",tmScope:"text.html.php",aceMode:"php",codemirrorMode:"php",codemirrorMimeType:"application/x-httpd-php",color:"#4F5D95",extensions:[".php",".aw",".ctp",".fcgi",".inc",".php3",".php4",".php5",".phps",".phpt"],filenames:[".php",".php_cs",".php_cs.dist","Phakefile"],interpreters:["php"],aliases:["inc"],languageId:272},r={name:"HTML+PHP",type:"markup",color:"#4f5d95",tmScope:"text.html.php",group:"HTML",extensions:[".phtml"],aceMode:"php",codemirrorMode:"php",codemirrorMimeType:"application/x-httpd-php",languageId:151},o={exports:{}},h={attributeIndex:0,attributeListDepth:{},matchST_ATTRIBUTE:function(){let t=this.input();if(this.is_WHITESPACE()){do{t=this.input()}while(this.is_WHITESPACE());return this.unput(1),null}switch(t){case"]":return 0===this.attributeListDepth[this.attributeIndex]?(delete this.attributeListDepth[this.attributeIndex],this.attributeIndex--,this.popState()):this.attributeListDepth[this.attributeIndex]--,"]";case"(":case")":case":":case"=":case"|":case"&":case"^":case"-":case"+":case"*":case"%":case"~":case"<":case">":case"!":case".":return this.consume_TOKEN();case"[":return this.attributeListDepth[this.attributeIndex]++,"[";case",":return",";case'"':return this.ST_DOUBLE_QUOTES();case"'":return this.T_CONSTANT_ENCAPSED_STRING();case"/":return"/"===this._input[this.offset]?this.T_COMMENT():"*"===this._input[this.offset]?(this.input(),this.T_DOC_COMMENT()):this.consume_TOKEN()}if(this.is_LABEL_START()||"\\"===t){for(;this.offset<this.size;){const t=this.input();if(!this.is_LABEL()&&"\\"!==t){t&&this.unput(1);break}}return this.T_STRING()}if(this.is_NUM())return this.consume_NUM();throw new Error(`Bad terminal sequence "${t}" at line ${this.yylineno} (offset ${this.offset})`)}};var a={consume_NUM:function(){let t=this.yytext[0],e="."===t;if("0"===t)if(t=this.input(),"x"===t||"X"===t){if(t=this.input(),"_"!==t&&this.is_HEX())return this.consume_HNUM();this.unput(t?2:1)}else if("b"===t||"B"===t){if(t=this.input(),"_"!==t&&"0"===t||"1"===t)return this.consume_BNUM();this.unput(t?2:1)}else if("o"===t||"O"===t){if(t=this.input(),"_"!==t&&this.is_OCTAL())return this.consume_ONUM();this.unput(t?2:1)}else this.is_NUM()||t&&this.unput(1);for(;this.offset<this.size;){const s=t;if(t=this.input(),"_"===t){if("_"===s){this.unput(2);break}if("."===s){this.unput(1);break}if("e"===s||"E"===s){this.unput(2);break}}else{if("."===t){if(e){this.unput(1);break}if("_"===s){this.unput(2);break}e=!0;continue}if("e"===t||"E"===t){if("_"===s){this.unput(1);break}let e=2;if(t=this.input(),"+"!==t&&"-"!==t||(e=3,t=this.input()),this.is_NUM_START())return this.consume_LNUM(),this.tok.T_DNUMBER;this.unput(t?e:e-1);break}}if(!this.is_NUM()){t&&this.unput(1);break}}return e?this.tok.T_DNUMBER:this.yytext.length<9||this.yytext.length<10||10==this.yytext.length&&this.yytext<"2147483648"?this.tok.T_LNUMBER:this.tok.T_DNUMBER},consume_HNUM:function(){for(;this.offset<this.size;){const t=this.input();if(!this.is_HEX()){t&&this.unput(1);break}}return this.tok.T_LNUMBER},consume_LNUM:function(){for(;this.offset<this.size;){const t=this.input();if(!this.is_NUM()){t&&this.unput(1);break}}return this.tok.T_LNUMBER},consume_BNUM:function(){let t;for(;this.offset<this.size;)if(t=this.input(),"0"!==t&&"1"!==t&&"_"!==t){t&&this.unput(1);break}return this.tok.T_LNUMBER},consume_ONUM:function(){for(;this.offset<this.size;){const t=this.input();if(!this.is_OCTAL()){t&&this.unput(1);break}}return this.tok.T_LNUMBER}},c={matchST_LOOKING_FOR_PROPERTY:function(){let t=this.input();if("-"===t){if(t=this.input(),">"===t)return this.tok.T_OBJECT_OPERATOR;t&&this.unput(1)}else{if(this.is_WHITESPACE())return this.tok.T_WHITESPACE;if(this.is_LABEL_START())return this.consume_LABEL(),this.popState(),this.tok.T_STRING}return this.popState(),t&&this.unput(1),!1},matchST_LOOKING_FOR_VARNAME:function(){let t=this.input();if(this.popState(),this.begin("ST_IN_SCRIPTING"),this.is_LABEL_START()){if(this.consume_LABEL(),t=this.input(),"["===t||"}"===t)return this.unput(1),this.tok.T_STRING_VARNAME;this.unput(this.yytext.length)}else t&&this.unput(1);return!1},matchST_VAR_OFFSET:function(){const t=this.input();if(this.is_NUM_START())return this.consume_NUM(),this.tok.T_NUM_STRING;if("]"===t)return this.popState(),"]";if("$"===t){if(this.input(),this.is_LABEL_START())return this.consume_LABEL(),this.tok.T_VARIABLE;throw new Error("Unexpected terminal")}if(this.is_LABEL_START())return this.consume_LABEL(),this.tok.T_STRING;if(this.is_WHITESPACE()||"\\"===t||"'"===t||"#"===t)return this.tok.T_ENCAPSED_AND_WHITESPACE;if("["===t||"{"===t||"}"===t||'"'===t||"`"===t||this.is_TOKEN())return t;throw new Error("Unexpected terminal")}},l={matchST_IN_SCRIPTING:function(){let t=this.input();switch(t){case" ":case"\t":case"\n":case"\r":case"\r\n":return this.T_WHITESPACE();case"#":return this.version>=800&&"["===this._input[this.offset]?(this.input(),this.attributeListDepth[++this.attributeIndex]=0,this.begin("ST_ATTRIBUTE"),this.tok.T_ATTRIBUTE):this.T_COMMENT();case"/":return"/"===this._input[this.offset]?this.T_COMMENT():"*"===this._input[this.offset]?(this.input(),this.T_DOC_COMMENT()):this.consume_TOKEN();case"'":return this.T_CONSTANT_ENCAPSED_STRING();case'"':return this.ST_DOUBLE_QUOTES();case"`":return this.begin("ST_BACKQUOTE"),"`";case"?":if(!this.aspTagMode&&this.tryMatch(">")){this.input();const t=this._input[this.offset];return"\n"!==t&&"\r"!==t||this.input(),this.conditionStack.length>1&&this.begin("INITIAL"),this.tok.T_CLOSE_TAG}return this.consume_TOKEN();case"%":return this.aspTagMode&&">"===this._input[this.offset]?(this.input(),t=this._input[this.offset],"\n"!==t&&"\r"!==t||this.input(),this.aspTagMode=!1,this.conditionStack.length>1&&this.begin("INITIAL"),this.tok.T_CLOSE_TAG):this.consume_TOKEN();case"{":return this.begin("ST_IN_SCRIPTING"),"{";case"}":return this.conditionStack.length>2&&this.popState(),"}";default:if("."===t){if(t=this.input(),this.is_NUM_START())return this.consume_NUM();t&&this.unput(1)}if(this.is_NUM_START())return this.consume_NUM();if(this.is_LABEL_START())return this.consume_LABEL().T_STRING();if(this.is_TOKEN())return this.consume_TOKEN()}throw new Error('Bad terminal sequence "'+t+'" at line '+this.yylineno+" (offset "+this.offset+")")},T_WHITESPACE:function(){for(;this.offset<this.size;){const t=this.input();if(" "!==t&&"\t"!==t&&"\n"!==t&&"\r"!==t){t&&this.unput(1);break}}return this.tok.T_WHITESPACE}};const u=["\n","\r"],_=["\n","\r",";"],p=_.concat(["\t"," ",",","]",")","/","=","!"]);var d={T_CONSTANT_ENCAPSED_STRING:function(){let t;for(;this.offset<this.size;)if(t=this.input(),"\\"==t)this.input();else if("'"==t)break;return this.tok.T_CONSTANT_ENCAPSED_STRING},is_HEREDOC:function(){const t=this.offset;if("<"===this._input[this.offset-1]&&"<"===this._input[this.offset]&&"<"===this._input[this.offset+1]){if(this.offset+=3,this.is_TABSPACE())for(;this.offset<this.size&&(this.offset++,this.is_TABSPACE()););let e=this._input[this.offset-1];if("'"===e||'"'===e?this.offset++:e=null,this.is_LABEL_START()){let s=this.offset-1;for(;this.offset<this.size&&(this.offset++,this.is_LABEL()););const i=this._input.substring(s,this.offset-1);if((!e||e===this._input[this.offset-1])&&(e&&this.offset++,u.includes(this._input[this.offset-1])))return this.heredoc_label.label=i,this.heredoc_label.length=i.length,this.heredoc_label.finished=!1,s=this.offset-t,this.offset=t,this.consume(s),"'"===e?this.begin("ST_NOWDOC"):this.begin("ST_HEREDOC"),this.prematch_ENDOFDOC(),this.tok.T_START_HEREDOC}}return this.offset=t,!1},ST_DOUBLE_QUOTES:function(){let t;for(;this.offset<this.size;)if(t=this.input(),"\\"==t)this.input();else{if('"'==t)break;if("$"==t){if(t=this.input(),"{"==t||this.is_LABEL_START()){this.unput(2);break}t&&this.unput(1)}else if("{"==t){if(t=this.input(),"$"==t){this.unput(2);break}t&&this.unput(1)}}if('"'==t)return this.tok.T_CONSTANT_ENCAPSED_STRING;{let t=1;return"b"!==this.yytext[0]&&"B"!==this.yytext[0]||(t=2),this.yytext.length>2&&this.appendToken(this.tok.T_ENCAPSED_AND_WHITESPACE,this.yytext.length-t),this.unput(this.yytext.length-t),this.begin("ST_DOUBLE_QUOTES"),this.yytext}},isDOC_MATCH:function(t,e){const s=this._input[t-2];if(!u.includes(s))return!1;let i=!1,n=!1,r=0,o=this._input[t-1];if(this.version>=703){for(;"\t"===o||" "===o;)" "===o?i=!0:"\t"===o&&(n=!0),o=this._input[t+r],r++;if(t+=r,u.includes(this._input[t-1]))return!1}if(this._input.substring(t-1,t-1+this.heredoc_label.length)===this.heredoc_label.label){const s=this._input[t-1+this.heredoc_label.length];if((this.version>=703?p:_).includes(s)){if(e){if(this.consume(r),i&&n)throw new Error("Parse error: mixing spaces and tabs in ending marker at line "+this.yylineno+" (offset "+this.offset+")")}else this.heredoc_label.indentation=r,this.heredoc_label.indentation_uses_spaces=i,this.heredoc_label.first_encaps_node=!0;return!0}}return!1},prematch_ENDOFDOC:function(){this.heredoc_label.indentation_uses_spaces=!1,this.heredoc_label.indentation=0,this.heredoc_label.first_encaps_node=!0;let t=this.offset+1;for(;t<this._input.length;){if(this.isDOC_MATCH(t,!1))return;if(!u.includes(this._input[t-1]))for(;!u.includes(this._input[t++])&&t<this._input.length;);t++}},matchST_NOWDOC:function(){if(this.isDOC_MATCH(this.offset,!0))return this.consume(this.heredoc_label.length),this.popState(),this.tok.T_END_HEREDOC;let t=this._input[this.offset-1];for(;this.offset<this.size;)if(u.includes(t)){if(t=this.input(),this.isDOC_MATCH(this.offset,!0))return this.unput(1).popState(),this.appendToken(this.tok.T_END_HEREDOC,this.heredoc_label.length),this.tok.T_ENCAPSED_AND_WHITESPACE}else t=this.input();return this.tok.T_ENCAPSED_AND_WHITESPACE},matchST_HEREDOC:function(){let t=this.input();if(this.isDOC_MATCH(this.offset,!0))return this.consume(this.heredoc_label.length-1),this.popState(),this.tok.T_END_HEREDOC;for(;this.offset<this.size;)if("\\"===t&&(t=this.input(),u.includes(t)||(t=this.input())),u.includes(t)){if(t=this.input(),this.isDOC_MATCH(this.offset,!0))return this.unput(1).popState(),this.appendToken(this.tok.T_END_HEREDOC,this.heredoc_label.length),this.tok.T_ENCAPSED_AND_WHITESPACE}else if("$"===t){if(t=this.input(),"{"===t)return this.begin("ST_LOOKING_FOR_VARNAME"),this.yytext.length>2?(this.appendToken(this.tok.T_DOLLAR_OPEN_CURLY_BRACES,2),this.unput(2),this.tok.T_ENCAPSED_AND_WHITESPACE):this.tok.T_DOLLAR_OPEN_CURLY_BRACES;if(this.is_LABEL_START()){const t=this.offset,e=this.consume_VARIABLE();return this.yytext.length>this.offset-t+2?(this.appendToken(e,this.offset-t+2),this.unput(this.offset-t+2),this.tok.T_ENCAPSED_AND_WHITESPACE):e}}else if("{"===t){if(t=this.input(),"$"===t)return this.begin("ST_IN_SCRIPTING"),this.yytext.length>2?(this.appendToken(this.tok.T_CURLY_OPEN,1),this.unput(2),this.tok.T_ENCAPSED_AND_WHITESPACE):(this.unput(1),this.tok.T_CURLY_OPEN)}else t=this.input();return this.tok.T_ENCAPSED_AND_WHITESPACE},consume_VARIABLE:function(){this.consume_LABEL();const t=this.input();if("["==t)return this.unput(1),this.begin("ST_VAR_OFFSET"),this.tok.T_VARIABLE;if("-"===t){if(">"===this.input())return this.input(),this.is_LABEL_START()&&this.begin("ST_LOOKING_FOR_PROPERTY"),this.unput(3),this.tok.T_VARIABLE;this.unput(2)}else t&&this.unput(1);return this.tok.T_VARIABLE},matchST_BACKQUOTE:function(){let t=this.input();if("$"===t){if(t=this.input(),"{"===t)return this.begin("ST_LOOKING_FOR_VARNAME"),this.tok.T_DOLLAR_OPEN_CURLY_BRACES;if(this.is_LABEL_START()){return this.consume_VARIABLE()}}else if("{"===t){if("$"===this._input[this.offset])return this.begin("ST_IN_SCRIPTING"),this.tok.T_CURLY_OPEN}else if("`"===t)return this.popState(),"`";for(;this.offset<this.size;){if("\\"===t)this.input();else{if("`"===t){this.unput(1),this.popState(),this.appendToken("`",1);break}if("$"===t){if(t=this.input(),"{"===t)return this.begin("ST_LOOKING_FOR_VARNAME"),this.yytext.length>2?(this.appendToken(this.tok.T_DOLLAR_OPEN_CURLY_BRACES,2),this.unput(2),this.tok.T_ENCAPSED_AND_WHITESPACE):this.tok.T_DOLLAR_OPEN_CURLY_BRACES;if(this.is_LABEL_START()){const t=this.offset,e=this.consume_VARIABLE();return this.yytext.length>this.offset-t+2?(this.appendToken(e,this.offset-t+2),this.unput(this.offset-t+2),this.tok.T_ENCAPSED_AND_WHITESPACE):e}continue}if("{"===t){if(t=this.input(),"$"===t)return this.begin("ST_IN_SCRIPTING"),this.yytext.length>2?(this.appendToken(this.tok.T_CURLY_OPEN,1),this.unput(2),this.tok.T_ENCAPSED_AND_WHITESPACE):(this.unput(1),this.tok.T_CURLY_OPEN);continue}}t=this.input()}return this.tok.T_ENCAPSED_AND_WHITESPACE},matchST_DOUBLE_QUOTES:function(){let t=this.input();if("$"===t){if(t=this.input(),"{"===t)return this.begin("ST_LOOKING_FOR_VARNAME"),this.tok.T_DOLLAR_OPEN_CURLY_BRACES;if(this.is_LABEL_START()){return this.consume_VARIABLE()}}else if("{"===t){if("$"===this._input[this.offset])return this.begin("ST_IN_SCRIPTING"),this.tok.T_CURLY_OPEN}else if('"'===t)return this.popState(),'"';for(;this.offset<this.size;){if("\\"===t)this.input();else{if('"'===t){this.unput(1),this.popState(),this.appendToken('"',1);break}if("$"===t){if(t=this.input(),"{"===t)return this.begin("ST_LOOKING_FOR_VARNAME"),this.yytext.length>2?(this.appendToken(this.tok.T_DOLLAR_OPEN_CURLY_BRACES,2),this.unput(2),this.tok.T_ENCAPSED_AND_WHITESPACE):this.tok.T_DOLLAR_OPEN_CURLY_BRACES;if(this.is_LABEL_START()){const t=this.offset,e=this.consume_VARIABLE();return this.yytext.length>this.offset-t+2?(this.appendToken(e,this.offset-t+2),this.unput(this.offset-t+2),this.tok.T_ENCAPSED_AND_WHITESPACE):e}t&&this.unput(1)}else if("{"===t){if(t=this.input(),"$"===t)return this.begin("ST_IN_SCRIPTING"),this.yytext.length>2?(this.appendToken(this.tok.T_CURLY_OPEN,1),this.unput(2),this.tok.T_ENCAPSED_AND_WHITESPACE):(this.unput(1),this.tok.T_CURLY_OPEN);t&&this.unput(1)}}t=this.input()}return this.tok.T_ENCAPSED_AND_WHITESPACE}};var f={is_NUM:function(){const t=this._input.charCodeAt(this.offset-1);return t>47&&t<58||95===t},is_NUM_START:function(){const t=this._input.charCodeAt(this.offset-1);return t>47&&t<58},is_LABEL:function(){const t=this._input.charCodeAt(this.offset-1);return t>96&&t<123||t>64&&t<91||95===t||t>47&&t<58||t>126},is_LABEL_START:function(){const t=this._input.charCodeAt(this.offset-1);return t>64&&t<91||(t>96&&t<123||(95===t||t>126))},consume_LABEL:function(){for(;this.offset<this.size;){const t=this.input();if(!this.is_LABEL()){t&&this.unput(1);break}}return this},is_TOKEN:function(){const t=this._input[this.offset-1];return-1!==";:,.\\[]()|^&+-/*=%!~$<>?@".indexOf(t)},is_WHITESPACE:function(){const t=this._input[this.offset-1];return" "===t||"\t"===t||"\n"===t||"\r"===t},is_TABSPACE:function(){const t=this._input[this.offset-1];return" "===t||"\t"===t},consume_TABSPACE:function(){for(;this.offset<this.size;){const t=this.input();if(!this.is_TABSPACE()){t&&this.unput(1);break}}return this},is_HEX:function(){const t=this._input.charCodeAt(this.offset-1);return t>47&&t<58||(t>64&&t<71||(t>96&&t<103||95===t))},is_OCTAL:function(){const t=this._input.charCodeAt(this.offset-1);return t>47&&t<56||95===t}};const k=function(t){this.engine=t,this.tok=this.engine.tokens.names,this.EOF=1,this.debug=!1,this.all_tokens=!0,this.comment_tokens=!1,this.mode_eval=!1,this.asp_tags=!1,this.short_tags=!1,this.version=801,this.yyprevcol=0,this.keywords={__class__:this.tok.T_CLASS_C,__trait__:this.tok.T_TRAIT_C,__function__:this.tok.T_FUNC_C,__method__:this.tok.T_METHOD_C,__line__:this.tok.T_LINE,__file__:this.tok.T_FILE,__dir__:this.tok.T_DIR,__namespace__:this.tok.T_NS_C,exit:this.tok.T_EXIT,die:this.tok.T_EXIT,function:this.tok.T_FUNCTION,const:this.tok.T_CONST,return:this.tok.T_RETURN,try:this.tok.T_TRY,catch:this.tok.T_CATCH,finally:this.tok.T_FINALLY,throw:this.tok.T_THROW,if:this.tok.T_IF,elseif:this.tok.T_ELSEIF,endif:this.tok.T_ENDIF,else:this.tok.T_ELSE,while:this.tok.T_WHILE,endwhile:this.tok.T_ENDWHILE,do:this.tok.T_DO,for:this.tok.T_FOR,endfor:this.tok.T_ENDFOR,foreach:this.tok.T_FOREACH,endforeach:this.tok.T_ENDFOREACH,declare:this.tok.T_DECLARE,enddeclare:this.tok.T_ENDDECLARE,instanceof:this.tok.T_INSTANCEOF,as:this.tok.T_AS,switch:this.tok.T_SWITCH,endswitch:this.tok.T_ENDSWITCH,case:this.tok.T_CASE,default:this.tok.T_DEFAULT,break:this.tok.T_BREAK,continue:this.tok.T_CONTINUE,goto:this.tok.T_GOTO,echo:this.tok.T_ECHO,print:this.tok.T_PRINT,class:this.tok.T_CLASS,interface:this.tok.T_INTERFACE,trait:this.tok.T_TRAIT,enum:this.tok.T_ENUM,extends:this.tok.T_EXTENDS,implements:this.tok.T_IMPLEMENTS,new:this.tok.T_NEW,clone:this.tok.T_CLONE,var:this.tok.T_VAR,eval:this.tok.T_EVAL,include:this.tok.T_INCLUDE,include_once:this.tok.T_INCLUDE_ONCE,require:this.tok.T_REQUIRE,require_once:this.tok.T_REQUIRE_ONCE,namespace:this.tok.T_NAMESPACE,use:this.tok.T_USE,insteadof:this.tok.T_INSTEADOF,global:this.tok.T_GLOBAL,isset:this.tok.T_ISSET,empty:this.tok.T_EMPTY,__halt_compiler:this.tok.T_HALT_COMPILER,static:this.tok.T_STATIC,abstract:this.tok.T_ABSTRACT,final:this.tok.T_FINAL,private:this.tok.T_PRIVATE,protected:this.tok.T_PROTECTED,public:this.tok.T_PUBLIC,unset:this.tok.T_UNSET,list:this.tok.T_LIST,array:this.tok.T_ARRAY,callable:this.tok.T_CALLABLE,or:this.tok.T_LOGICAL_OR,and:this.tok.T_LOGICAL_AND,xor:this.tok.T_LOGICAL_XOR,match:this.tok.T_MATCH,readonly:this.tok.T_READ_ONLY},this.castKeywords={int:this.tok.T_INT_CAST,integer:this.tok.T_INT_CAST,real:this.tok.T_DOUBLE_CAST,double:this.tok.T_DOUBLE_CAST,float:this.tok.T_DOUBLE_CAST,string:this.tok.T_STRING_CAST,binary:this.tok.T_STRING_CAST,array:this.tok.T_ARRAY_CAST,object:this.tok.T_OBJECT_CAST,bool:this.tok.T_BOOL_CAST,boolean:this.tok.T_BOOL_CAST,unset:this.tok.T_UNSET_CAST}};k.prototype.setInput=function(t){return this._input=t,this.size=t.length,this.yylineno=1,this.offset=0,this.yyprevcol=0,this.yytext="",this.yylloc={first_offset:0,first_line:1,first_column:0,prev_offset:0,prev_line:1,prev_column:0,last_line:1,last_column:0},this.tokens=[],this.version>703?this.keywords.fn=this.tok.T_FN:delete this.keywords.fn,this.done=this.offset>=this.size,!this.all_tokens&&this.mode_eval?(this.conditionStack=["INITIAL"],this.begin("ST_IN_SCRIPTING")):(this.conditionStack=[],this.begin("INITIAL")),this.heredoc_label={label:"",length:0,indentation:0,indentation_uses_spaces:!1,finished:!1,first_encaps_node:!1,toString:function(){this.label}},this},k.prototype.input=function(){const t=this._input[this.offset];return t?(this.yytext+=t,this.offset++,"\r"===t&&"\n"===this._input[this.offset]&&(this.yytext+="\n",this.offset++),"\n"===t||"\r"===t?(this.yylloc.last_line=++this.yylineno,this.yyprevcol=this.yylloc.last_column,this.yylloc.last_column=0):this.yylloc.last_column++,t):""},k.prototype.unput=function(t){if(1===t)this.offset--,"\n"===this._input[this.offset]&&"\r"===this._input[this.offset-1]&&(this.offset--,t++),"\r"===this._input[this.offset]||"\n"===this._input[this.offset]?(this.yylloc.last_line--,this.yylineno--,this.yylloc.last_column=this.yyprevcol):this.yylloc.last_column--,this.yytext=this.yytext.substring(0,this.yytext.length-t);else if(t>0)if(this.offset-=t,t<this.yytext.length){this.yytext=this.yytext.substring(0,this.yytext.length-t),this.yylloc.last_line=this.yylloc.first_line,this.yylloc.last_column=this.yyprevcol=this.yylloc.first_column;for(let t=0;t<this.yytext.length;t++){let e=this.yytext[t];"\r"===e?(e=this.yytext[++t],this.yyprevcol=this.yylloc.last_column,this.yylloc.last_line++,this.yylloc.last_column=0,"\n"!==e&&("\r"===e?this.yylloc.last_line++:this.yylloc.last_column++)):"\n"===e?(this.yyprevcol=this.yylloc.last_column,this.yylloc.last_line++,this.yylloc.last_column=0):this.yylloc.last_column++}this.yylineno=this.yylloc.last_line}else this.yytext="",this.yylloc.last_line=this.yylineno=this.yylloc.first_line,this.yylloc.last_column=this.yylloc.first_column;return this},k.prototype.tryMatch=function(t){return t===this.ahead(t.length)},k.prototype.tryMatchCaseless=function(t){return t===this.ahead(t.length).toLowerCase()},k.prototype.ahead=function(t){let e=this._input.substring(this.offset,this.offset+t);return"\r"===e[e.length-1]&&"\n"===this._input[this.offset+t+1]&&(e+="\n"),e},k.prototype.consume=function(t){for(let e=0;e<t;e++){const t=this._input[this.offset];if(!t)break;this.yytext+=t,this.offset++,"\r"===t&&"\n"===this._input[this.offset]&&(this.yytext+="\n",this.offset++,e++),"\n"===t||"\r"===t?(this.yylloc.last_line=++this.yylineno,this.yyprevcol=this.yylloc.last_column,this.yylloc.last_column=0):this.yylloc.last_column++}return this},k.prototype.getState=function(){return{yytext:this.yytext,offset:this.offset,yylineno:this.yylineno,yyprevcol:this.yyprevcol,yylloc:{first_offset:this.yylloc.first_offset,first_line:this.yylloc.first_line,first_column:this.yylloc.first_column,last_line:this.yylloc.last_line,last_column:this.yylloc.last_column},heredoc_label:this.heredoc_label}},k.prototype.setState=function(t){return this.yytext=t.yytext,this.offset=t.offset,this.yylineno=t.yylineno,this.yyprevcol=t.yyprevcol,this.yylloc=t.yylloc,t.heredoc_label&&(this.heredoc_label=t.heredoc_label),this},k.prototype.appendToken=function(t,e){return this.tokens.push([t,e]),this},k.prototype.lex=function(){this.yylloc.prev_offset=this.offset,this.yylloc.prev_line=this.yylloc.last_line,this.yylloc.prev_column=this.yylloc.last_column;let t=this.next()||this.lex();if(!this.all_tokens){for(;t===this.tok.T_WHITESPACE||!this.comment_tokens&&(t===this.tok.T_COMMENT||t===this.tok.T_DOC_COMMENT)||t===this.tok.T_OPEN_TAG;)t=this.next()||this.lex();if(t==this.tok.T_OPEN_TAG_WITH_ECHO)return this.tok.T_ECHO;if(t===this.tok.T_CLOSE_TAG)return";"}return this.yylloc.prev_offset||(this.yylloc.prev_offset=this.yylloc.first_offset,this.yylloc.prev_line=this.yylloc.first_line,this.yylloc.prev_column=this.yylloc.first_column),t},k.prototype.begin=function(t){if(this.conditionStack.push(t),this.curCondition=t,this.stateCb=this["match"+t],"function"!=typeof this.stateCb)throw new Error('Undefined condition state "'+t+'"');return this},k.prototype.popState=function(){const t=this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0];if(this.curCondition=this.conditionStack[this.conditionStack.length-1],this.stateCb=this["match"+this.curCondition],"function"!=typeof this.stateCb)throw new Error('Undefined condition state "'+this.curCondition+'"');return t},k.prototype.next=function(){let t;if(this._input||(this.done=!0),this.yylloc.first_offset=this.offset,this.yylloc.first_line=this.yylloc.last_line,this.yylloc.first_column=this.yylloc.last_column,this.yytext="",this.done)return this.yylloc.prev_offset=this.yylloc.first_offset,this.yylloc.prev_line=this.yylloc.first_line,this.yylloc.prev_column=this.yylloc.first_column,this.EOF;if(this.tokens.length>0?(t=this.tokens.shift(),"object"==typeof t[1]?this.setState(t[1]):this.consume(t[1]),t=t[0]):t=this.stateCb.apply(this,[]),this.offset>=this.size&&0===this.tokens.length&&(this.done=!0),this.debug){let e=t;e="number"==typeof e?this.engine.tokens.values[e]:'"'+e+'"';const s=new Error(e+"\tfrom "+this.yylloc.first_line+","+this.yylloc.first_column+"\t - to "+this.yylloc.last_line+","+this.yylloc.last_column+'\t"'+this.yytext+'"');console.error(s.stack)}return t},[h,{T_COMMENT:function(){for(;this.offset<this.size;){const t=this.input();if("\n"===t||"\r"===t)return this.tok.T_COMMENT;if("?"===t&&!this.aspTagMode&&">"===this._input[this.offset])return this.unput(1),this.tok.T_COMMENT;if("%"===t&&this.aspTagMode&&">"===this._input[this.offset])return this.unput(1),this.tok.T_COMMENT}return this.tok.T_COMMENT},T_DOC_COMMENT:function(){let t=this.input(),e=this.tok.T_COMMENT;if("*"===t){if(t=this.input(),this.is_WHITESPACE()&&(e=this.tok.T_DOC_COMMENT),"/"===t)return e;this.unput(1)}for(;this.offset<this.size;)if(t=this.input(),"*"===t&&"/"===this._input[this.offset]){this.input();break}return e}},{nextINITIAL:function(){return this.conditionStack.length>1&&"INITIAL"===this.conditionStack[this.conditionStack.length-1]?this.popState():this.begin("ST_IN_SCRIPTING"),this},matchINITIAL:function(){for(;this.offset<this.size;){let t=this.input();if("<"==t)if(t=this.ahead(1),"?"==t){if(this.tryMatch("?=")){this.unput(1).appendToken(this.tok.T_OPEN_TAG_WITH_ECHO,3).nextINITIAL();break}if(this.tryMatchCaseless("?php")&&(t=this._input[this.offset+4]," "===t||"\t"===t||"\n"===t||"\r"===t)){this.unput(1).appendToken(this.tok.T_OPEN_TAG,6).nextINITIAL();break}if(this.short_tags){this.unput(1).appendToken(this.tok.T_OPEN_TAG,2).nextINITIAL();break}}else if(this.asp_tags&&"%"==t){if(this.tryMatch("%=")){this.aspTagMode=!0,this.unput(1).appendToken(this.tok.T_OPEN_TAG_WITH_ECHO,3).nextINITIAL();break}this.aspTagMode=!0,this.unput(1).appendToken(this.tok.T_OPEN_TAG,2).nextINITIAL();break}}return this.yytext.length>0&&this.tok.T_INLINE_HTML}},a,c,l,d,{T_STRING:function(){const t=this.yytext.toLowerCase();let e=this.keywords[t];if("number"!=typeof e)if("yield"===t)this.version>=700&&this.tryMatch(" from")?(this.consume(5),e=this.tok.T_YIELD_FROM):e=this.tok.T_YIELD;else if(e=this.tok.T_STRING,"b"===t||"B"===t){const t=this.input();if('"'===t)return this.ST_DOUBLE_QUOTES();if("'"===t)return this.T_CONSTANT_ENCAPSED_STRING();t&&this.unput(1)}if(e===this.tok.T_ENUM){if(this.version<801)return this.tok.T_STRING;const t=this.offset;let e=this.input();for(;" "==e;)e=this.input();let s=!1;if(this.is_LABEL_START()){for(;this.is_LABEL();)e+=this.input();const t=e.slice(0,-1).toLowerCase();s="extends"!==t&&"implements"!==t}return this.unput(this.offset-t),s?this.tok.T_ENUM:this.tok.T_STRING}if(this.offset<this.size&&e!==this.tok.T_YIELD_FROM){let s=this.input();if("\\"===s){e="namespace"===t?this.tok.T_NAME_RELATIVE:this.tok.T_NAME_QUALIFIED;do{if("{"===this._input[this.offset]){this.input();break}this.consume_LABEL(),s=this.input()}while("\\"===s)}s&&this.unput(1)}return e},consume_TOKEN:function(){const t=this._input[this.offset-1],e=this.tokenTerminals[t];return e?e.apply(this,[]):this.yytext},tokenTerminals:{$:function(){return this.offset++,this.is_LABEL_START()?(this.offset--,this.consume_LABEL(),this.tok.T_VARIABLE):(this.offset--,"$")},"-":function(){const t=this._input[this.offset];return">"===t?(this.begin("ST_LOOKING_FOR_PROPERTY").input(),this.tok.T_OBJECT_OPERATOR):"-"===t?(this.input(),this.tok.T_DEC):"="===t?(this.input(),this.tok.T_MINUS_EQUAL):"-"},"\\":function(){if(this.offset<this.size){if(this.input(),this.is_LABEL_START()){let t;do{if("{"===this._input[this.offset]){this.input();break}this.consume_LABEL(),t=this.input()}while("\\"===t);return this.unput(1),this.tok.T_NAME_FULLY_QUALIFIED}this.unput(1)}return this.tok.T_NS_SEPARATOR},"/":function(){return"="===this._input[this.offset]?(this.input(),this.tok.T_DIV_EQUAL):"/"},":":function(){return":"===this._input[this.offset]?(this.input(),this.tok.T_DOUBLE_COLON):":"},"(":function(){const t=this.offset;if(this.input(),this.is_TABSPACE()&&this.consume_TABSPACE().input(),this.is_LABEL_START()){const t=this.yytext.length;this.consume_LABEL();const e=this.yytext.substring(t-1).toLowerCase(),s=this.castKeywords[e];if("number"==typeof s&&(this.input(),this.is_TABSPACE()&&this.consume_TABSPACE().input(),")"===this._input[this.offset-1]))return s}return this.unput(this.offset-t),"("},"=":function(){const t=this._input[this.offset];return">"===t?(this.input(),this.tok.T_DOUBLE_ARROW):"="===t?"="===this._input[this.offset+1]?(this.consume(2),this.tok.T_IS_IDENTICAL):(this.input(),this.tok.T_IS_EQUAL):"="},"+":function(){const t=this._input[this.offset];return"+"===t?(this.input(),this.tok.T_INC):"="===t?(this.input(),this.tok.T_PLUS_EQUAL):"+"},"!":function(){return"="===this._input[this.offset]?"="===this._input[this.offset+1]?(this.consume(2),this.tok.T_IS_NOT_IDENTICAL):(this.input(),this.tok.T_IS_NOT_EQUAL):"!"},"?":function(){return this.version>=700&&"?"===this._input[this.offset]?this.version>=704&&"="===this._input[this.offset+1]?(this.consume(2),this.tok.T_COALESCE_EQUAL):(this.input(),this.tok.T_COALESCE):this.version>=800&&"-"===this._input[this.offset]&&">"===this._input[this.offset+1]?(this.consume(2),this.tok.T_NULLSAFE_OBJECT_OPERATOR):"?"},"<":function(){let t=this._input[this.offset];return"<"===t?(t=this._input[this.offset+1],"="===t?(this.consume(2),this.tok.T_SL_EQUAL):"<"===t&&this.is_HEREDOC()?this.tok.T_START_HEREDOC:(this.input(),this.tok.T_SL)):"="===t?(this.input(),this.version>=700&&">"===this._input[this.offset]?(this.input(),this.tok.T_SPACESHIP):this.tok.T_IS_SMALLER_OR_EQUAL):">"===t?(this.input(),this.tok.T_IS_NOT_EQUAL):"<"},">":function(){let t=this._input[this.offset];return"="===t?(this.input(),this.tok.T_IS_GREATER_OR_EQUAL):">"===t?(t=this._input[this.offset+1],"="===t?(this.consume(2),this.tok.T_SR_EQUAL):(this.input(),this.tok.T_SR)):">"},"*":function(){const t=this._input[this.offset];return"="===t?(this.input(),this.tok.T_MUL_EQUAL):"*"===t?(this.input(),"="===this._input[this.offset]?(this.input(),this.tok.T_POW_EQUAL):this.tok.T_POW):"*"},".":function(){const t=this._input[this.offset];return"="===t?(this.input(),this.tok.T_CONCAT_EQUAL):"."===t&&"."===this._input[this.offset+1]?(this.consume(2),this.tok.T_ELLIPSIS):"."},"%":function(){return"="===this._input[this.offset]?(this.input(),this.tok.T_MOD_EQUAL):"%"},"&":function(){const t=this._input[this.offset];return"="===t?(this.input(),this.tok.T_AND_EQUAL):"&"===t?(this.input(),this.tok.T_BOOLEAN_AND):"&"},"|":function(){const t=this._input[this.offset];return"="===t?(this.input(),this.tok.T_OR_EQUAL):"|"===t?(this.input(),this.tok.T_BOOLEAN_OR):"|"},"^":function(){return"="===this._input[this.offset]?(this.input(),this.tok.T_XOR_EQUAL):"^"}}},f].forEach((function(t){for(const e in t)k.prototype[e]=t[e]}));var T=k;var x=function(t,e,s){this.line=t,this.column=e,this.offset=s},E={read_expr:function(t){const e=this.node();if("@"===this.token)return t||(t=this.next().read_expr()),e("silent",t);if(t||(t=this.read_expr_item()),"|"===this.token)return e("bin","|",t,this.next().read_expr());if("&"===this.token)return e("bin","&",t,this.next().read_expr());if("^"===this.token)return e("bin","^",t,this.next().read_expr());if("."===this.token)return e("bin",".",t,this.next().read_expr());if("+"===this.token)return e("bin","+",t,this.next().read_expr());if("-"===this.token)return e("bin","-",t,this.next().read_expr());if("*"===this.token)return e("bin","*",t,this.next().read_expr());if("/"===this.token)return e("bin","/",t,this.next().read_expr());if("%"===this.token)return e("bin","%",t,this.next().read_expr());if(this.token===this.tok.T_POW)return e("bin","**",t,this.next().read_expr());if(this.token===this.tok.T_SL)return e("bin","<<",t,this.next().read_expr());if(this.token===this.tok.T_SR)return e("bin",">>",t,this.next().read_expr());if(this.token===this.tok.T_BOOLEAN_OR)return e("bin","||",t,this.next().read_expr());if(this.token===this.tok.T_LOGICAL_OR)return e("bin","or",t,this.next().read_expr());if(this.token===this.tok.T_BOOLEAN_AND)return e("bin","&&",t,this.next().read_expr());if(this.token===this.tok.T_LOGICAL_AND)return e("bin","and",t,this.next().read_expr());if(this.token===this.tok.T_LOGICAL_XOR)return e("bin","xor",t,this.next().read_expr());if(this.token===this.tok.T_IS_IDENTICAL)return e("bin","===",t,this.next().read_expr());if(this.token===this.tok.T_IS_NOT_IDENTICAL)return e("bin","!==",t,this.next().read_expr());if(this.token===this.tok.T_IS_EQUAL)return e("bin","==",t,this.next().read_expr());if(this.token===this.tok.T_IS_NOT_EQUAL)return e("bin","!=",t,this.next().read_expr());if("<"===this.token)return e("bin","<",t,this.next().read_expr());if(">"===this.token)return e("bin",">",t,this.next().read_expr());if(this.token===this.tok.T_IS_SMALLER_OR_EQUAL)return e("bin","<=",t,this.next().read_expr());if(this.token===this.tok.T_IS_GREATER_OR_EQUAL)return e("bin",">=",t,this.next().read_expr());if(this.token===this.tok.T_SPACESHIP)return e("bin","<=>",t,this.next().read_expr());if(this.token===this.tok.T_INSTANCEOF&&(t=e("bin","instanceof",t,this.next().read_class_name_reference()),";"!==this.token&&this.token!==this.tok.T_INLINE_HTML&&this.token!==this.EOF&&(t=this.read_expr(t))),this.token===this.tok.T_COALESCE)return e("bin","??",t,this.next().read_expr());if("?"===this.token){let s=null;return":"!==this.next().token&&(s=this.read_expr()),this.expect(":")&&this.next(),e("retif",t,s,this.read_expr())}return e.destroy(t),t},read_expr_cast:function(t){return this.node("cast")(t,this.text(),this.next().read_expr())},read_isset_variable:function(){return this.read_expr()},read_isset_variables:function(){return this.read_function_list(this.read_isset_variable,",")},read_internal_functions_in_yacc:function(){let t=null;switch(this.token){case this.tok.T_ISSET:{t=this.node("isset"),this.next().expect("(")&&this.next();const e=this.read_isset_variables();this.expect(")")&&this.next(),t=t(e)}break;case this.tok.T_EMPTY:{t=this.node("empty"),this.next().expect("(")&&this.next();const e=this.read_expr();this.expect(")")&&this.next(),t=t(e)}break;case this.tok.T_INCLUDE:t=this.node("include")(!1,!1,this.next().read_expr());break;case this.tok.T_INCLUDE_ONCE:t=this.node("include")(!0,!1,this.next().read_expr());break;case this.tok.T_EVAL:{t=this.node("eval"),this.next().expect("(")&&this.next();const e=this.read_expr();this.expect(")")&&this.next(),t=t(e)}break;case this.tok.T_REQUIRE:t=this.node("include")(!1,!0,this.next().read_expr());break;case this.tok.T_REQUIRE_ONCE:t=this.node("include")(!0,!0,this.next().read_expr())}return t},read_optional_expr:function(t){return this.token!==t?this.read_expr():null},read_exit_expr:function(){let t=null;return"("===this.token&&(this.next(),t=this.read_optional_expr(")"),this.expect(")")&&this.next()),t},read_expr_item:function(){let t,e,s=[];if("+"===this.token)return this.node("unary")("+",this.next().read_expr());if("-"===this.token)return this.node("unary")("-",this.next().read_expr());if("!"===this.token)return this.node("unary")("!",this.next().read_expr());if("~"===this.token)return this.node("unary")("~",this.next().read_expr());if("("===this.token)return e=this.next().read_expr(),e.parenthesizedExpression=!0,this.expect(")")&&this.next(),this.handleDereferencable(e);if("`"===this.token)return this.read_encapsed_string("`");if(this.token===this.tok.T_LIST){let e=null;const s=this.innerList;t=this.node("list"),s||(e=this.node("assign")),this.next().expect("(")&&this.next(),this.innerList||(this.innerList=!0);const i=this.read_array_pair_list(!1);this.expect(")")&&this.next();let n=!1;for(let t=0;t<i.length;t++)if(null!==i[t]&&"noop"!==i[t].kind){n=!0;break}return n||this.raiseError("Fatal Error : Cannot use empty list on line "+this.lexer.yylloc.first_line),s?t(i,!1):(this.innerList=!1,this.expect("=")?e(t(i,!1),this.next().read_expr(),"="):t(i,!1))}if(this.token===this.tok.T_ATTRIBUTE&&(s=this.read_attr_list()),this.token===this.tok.T_CLONE)return this.node("clone")(this.next().read_expr());switch(this.token){case this.tok.T_INC:return this.node("pre")("+",this.next().read_variable(!1,!1));case this.tok.T_DEC:return this.node("pre")("-",this.next().read_variable(!1,!1));case this.tok.T_NEW:return this.read_new_expr();case this.tok.T_ISSET:case this.tok.T_EMPTY:case this.tok.T_INCLUDE:case this.tok.T_INCLUDE_ONCE:case this.tok.T_EVAL:case this.tok.T_REQUIRE:case this.tok.T_REQUIRE_ONCE:return this.read_internal_functions_in_yacc();case this.tok.T_MATCH:return this.read_match_expression();case this.tok.T_INT_CAST:return this.read_expr_cast("int");case this.tok.T_DOUBLE_CAST:return this.read_expr_cast("float");case this.tok.T_STRING_CAST:return this.read_expr_cast(-1!==this.text().indexOf("binary")?"binary":"string");case this.tok.T_ARRAY_CAST:return this.read_expr_cast("array");case this.tok.T_OBJECT_CAST:return this.read_expr_cast("object");case this.tok.T_BOOL_CAST:return this.read_expr_cast("bool");case this.tok.T_UNSET_CAST:return this.read_expr_cast("unset");case this.tok.T_THROW:this.version<800&&this.raiseError("PHP 8+ is required to use throw as an expression");return this.node("throw")(this.next().read_expr());case this.tok.T_EXIT:{const e="die"===this.lexer.yytext.toLowerCase();t=this.node("exit"),this.next();return t(this.read_exit_expr(),e)}case this.tok.T_PRINT:return this.node("print")(this.next().read_expr());case this.tok.T_YIELD:{let e=null,s=null;return t=this.node("yield"),this.next().is("EXPR")&&(e=this.read_expr(),this.token===this.tok.T_DOUBLE_ARROW&&(s=e,e=this.next().read_expr())),t(e,s)}case this.tok.T_YIELD_FROM:return t=this.node("yieldfrom"),e=this.next().read_expr(),t(e);case this.tok.T_FN:case this.tok.T_FUNCTION:return this.read_inline_function(void 0,s);case this.tok.T_STATIC:{const t=[this.token,this.lexer.getState()];if(this.next(),this.token===this.tok.T_FUNCTION||this.version>=704&&this.token===this.tok.T_FN)return this.read_inline_function([0,1,0],s);this.lexer.tokens.push(t),this.next()}}if(this.is("VARIABLE")){t=this.node(),e=this.read_variable(!1,!1);const s="identifier"===e.kind||"staticlookup"===e.kind&&"identifier"===e.offset.kind;switch(this.token){case"=":return s&&this.error("VARIABLE"),"&"==this.next().token?this.read_assignref(t,e):t("assign",e,this.read_expr(),"=");case this.tok.T_PLUS_EQUAL:return s&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"+=");case this.tok.T_MINUS_EQUAL:return s&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"-=");case this.tok.T_MUL_EQUAL:return s&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"*=");case this.tok.T_POW_EQUAL:return s&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"**=");case this.tok.T_DIV_EQUAL:return s&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"/=");case this.tok.T_CONCAT_EQUAL:return s&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),".=");case this.tok.T_MOD_EQUAL:return s&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"%=");case this.tok.T_AND_EQUAL:return s&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"&=");case this.tok.T_OR_EQUAL:return s&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"|=");case this.tok.T_XOR_EQUAL:return s&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"^=");case this.tok.T_SL_EQUAL:return s&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"<<=");case this.tok.T_SR_EQUAL:return s&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),">>=");case this.tok.T_COALESCE_EQUAL:return s&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"??=");case this.tok.T_INC:return s&&this.error("VARIABLE"),this.next(),t("post","+",e);case this.tok.T_DEC:return s&&this.error("VARIABLE"),this.next(),t("post","-",e);default:t.destroy(e)}}else{if(this.is("SCALAR")){if(t=this.node(),e=this.read_scalar(),"array"===e.kind&&e.shortForm&&"="===this.token){const s=this.convertToList(e);e.loc&&(s.loc=e.loc);return t("assign",s,this.next().read_expr(),"=")}return t.destroy(e),this.handleDereferencable(e)}this.error("EXPR"),this.next()}return e},convertToList:function(t){const e=t.items.map((t=>(t.value&&"array"===t.value.kind&&t.value.shortForm&&(t.value=this.convertToList(t.value)),t))),s=this.node("list")(e,!0);return t.loc&&(s.loc=t.loc),t.leadingComments&&(s.leadingComments=t.leadingComments),t.trailingComments&&(s.trailingComments=t.trailingComments),s},read_assignref:function(t,e){let s;return this.next(),this.token===this.tok.T_NEW?(this.version>=700&&this.error(),s=this.read_new_expr()):s=this.read_variable(!1,!1),t("assignref",e,s)},read_inline_function:function(t,e){if(this.token===this.tok.T_FUNCTION){const s=this.read_function(!0,t,e);return s.attrGroups=e,s}!this.version>=704&&this.raiseError("Arrow Functions are not allowed");const s=this.node("arrowfunc");this.expect(this.tok.T_FN)&&this.next();const i=this.is_reference();this.expect("(")&&this.next();const n=this.read_parameter_list();this.expect(")")&&this.next();let r=!1,o=null;":"===this.token&&("?"===this.next().token&&(r=!0,this.next()),o=this.read_types()),this.expect(this.tok.T_DOUBLE_ARROW)&&this.next();const h=s(n,i,this.read_expr(),o,r,!!t);return h.attrGroups=e,h},read_match_expression:function(){const t=this.node("match");this.expect(this.tok.T_MATCH)&&this.next(),this.version<800&&this.raiseError("Match statements are not allowed before PHP 8");let e=null,s=[];return this.expect("(")&&this.next(),e=this.read_expr(),this.expect(")")&&this.next(),this.expect("{")&&this.next(),s=this.read_match_arms(),this.expect("}")&&this.next(),t(e,s)},read_match_arms:function(){return this.read_list((()=>this.read_match_arm()),",",!0)},read_match_arm:function(){if("}"!==this.token)return this.node("matcharm")(this.read_match_arm_conds(),this.read_expr())},read_match_arm_conds:function(){let t=[];if(this.token===this.tok.T_DEFAULT)t=null,this.next();else for(t.push(this.read_expr());","===this.token;){if(this.next(),this.token===this.tok.T_DOUBLE_ARROW)return this.next(),t;t.push(this.read_expr())}return this.expect(this.tok.T_DOUBLE_ARROW)&&this.next(),t},read_attribute(){const t=this.text();let e=[];return this.next(),"("===this.token&&(e=this.read_argument_list()),this.node("attribute")(t,e)},read_attr_list(){const t=[];if(this.token===this.tok.T_ATTRIBUTE)do{const e=this.node("attrgroup")([]);for(this.next(),e.attrs.push(this.read_attribute());","===this.token;)this.next(),"]"!==this.token&&e.attrs.push(this.read_attribute());t.push(e),this.expect("]"),this.next()}while(this.token===this.tok.T_ATTRIBUTE);return t},read_new_expr:function(){const t=this.node("new");this.expect(this.tok.T_NEW)&&this.next();let e=[];if("("===this.token){this.next();const s=this.read_expr();return this.expect(")"),this.next(),"("===this.token&&(e=this.read_argument_list()),t(s,e)}const s=this.read_attr_list();if(this.token===this.tok.T_CLASS){const i=this.node("class");"("===this.next().token&&(e=this.read_argument_list());const n=this.read_extends_from(),r=this.read_implements_list();let o=null;this.expect("{")&&(o=this.next().read_class_body(!0,!1));const h=i(null,n,r,o,[0,0,0]);return h.attrGroups=s,t(h,e)}let i=this.read_new_class_name();for(;"["===this.token;){const t=this.node("offsetlookup"),e=this.next().read_encaps_var_offset();this.expect("]")&&this.next(),i=t(i,e)}return"("===this.token&&(e=this.read_argument_list()),t(i,e)},read_new_class_name:function(){if(this.token===this.tok.T_NS_SEPARATOR||this.token===this.tok.T_NAME_RELATIVE||this.token===this.tok.T_NAME_QUALIFIED||this.token===this.tok.T_NAME_FULLY_QUALIFIED||this.token===this.tok.T_STRING||this.token===this.tok.T_NAMESPACE){let t=this.read_namespace_name(!0);return this.token===this.tok.T_DOUBLE_COLON&&(t=this.read_static_getter(t)),t}if(this.is("VARIABLE"))return this.read_variable(!0,!1);this.expect([this.tok.T_STRING,"VARIABLE"])},handleDereferencable:function(t){for(;this.token!==this.EOF;)if(this.token===this.tok.T_OBJECT_OPERATOR||this.token===this.tok.T_DOUBLE_COLON)t=this.recursive_variable_chain_scan(t,!1,!1,!0);else if(this.token===this.tok.T_CURLY_OPEN||"["===this.token)t=this.read_dereferencable(t);else{if("("!==this.token)return t;t=this.node("call")(t,this.read_argument_list())}return t}},m={is_reference:function(){return"&"===this.token&&(this.next(),!0)},is_variadic:function(){return this.token===this.tok.T_ELLIPSIS&&(this.next(),!0)},read_function:function(t,e,s,i){const n=this.read_function_declaration(t?1:e?2:0,e&&1===e[1],s||[],i);return e&&1==e[2]?(n.parseFlags(e),this.expect(";")&&this.next()):(this.expect("{")&&(n.body=this.read_code_block(!1),n.loc&&n.body.loc&&(n.loc.end=n.body.loc.end)),!t&&e&&n.parseFlags(e)),n},read_function_declaration:function(t,e,s,i){let n="function";1===t?n="closure":2===t&&(n="method");const r=this.node(n);this.expect(this.tok.T_FUNCTION)&&this.next();const o=this.is_reference();let h=!1,a=[],c=null,l=!1;if(1!==t){const e=this.node("identifier");2===t?this.version>=700?this.token===this.tok.T_STRING||this.is("IDENTIFIER")?(h=this.text(),this.next()):this.version<704&&this.error("IDENTIFIER"):this.token===this.tok.T_STRING?(h=this.text(),this.next()):this.error("IDENTIFIER"):this.version>=700?this.token===this.tok.T_STRING?(h=this.text(),this.next()):this.version>=704?this.expect("(")||this.next():(this.error(this.tok.T_STRING),this.next()):(this.expect(this.tok.T_STRING)&&(h=this.text()),this.next()),h=e(h)}this.expect("(")&&this.next();const u=this.read_parameter_list("__construct"===h.name);this.expect(")")&&this.next(),1===t&&(a=this.read_lexical_vars()),":"===this.token&&("?"===this.next().token&&(l=!0,this.next()),c=this.read_types());const _=t=>(t.attrGroups=s||[],i&&t.loc&&(t.loc.start=i,t.loc.source&&(t.loc.source=this.lexer._input.substr(t.loc.start.offset,t.loc.end.offset-t.loc.start.offset))),t);return _(1===t?r(u,o,a,c,l,e):r(h,u,o,c,l))},read_lexical_vars:function(){let t=[];return this.token===this.tok.T_USE&&(this.next(),this.expect("(")&&this.next(),t=this.read_lexical_var_list(),this.expect(")")&&this.next()),t},read_list_with_dangling_comma:function(t){const e=[];for(;this.token!=this.EOF;){if(e.push(t()),","!=this.token){if(")"==this.token)break;this.error([",",")"]);break}if(this.next(),this.version>=800&&")"===this.token)return e}return e},read_lexical_var_list:function(){return this.read_list_with_dangling_comma(this.read_lexical_var.bind(this))},read_lexical_var:function(){if("&"===this.token)return this.read_byref(this.read_lexical_var.bind(this));const t=this.node("variable");this.expect(this.tok.T_VARIABLE);const e=this.text().substring(1);return this.next(),t(e,!1)},read_parameter_list:function(t){if(")"!==this.token){let e=!1;return this.read_list_with_dangling_comma(function(){const s=this.read_parameter(t);return s&&(e&&this.raiseError("Unexpected parameter after a variadic parameter"),s.variadic&&(e=!0)),s}.bind(this),",")}return[]},read_parameter:function(t){const e=this.node("parameter");let s=null,i=null,n=null,r=!1,o=!1,h=[];this.token===this.tok.T_ATTRIBUTE&&(h=this.read_attr_list()),this.version>=801&&this.token===this.tok.T_READ_ONLY&&(t?(this.next(),o=!0):this.raiseError("readonly properties can be used only on class constructor"));const a=this.read_promoted();!o&&this.version>=801&&this.token===this.tok.T_READ_ONLY&&(t?(this.next(),o=!0):this.raiseError("readonly properties can be used only on class constructor")),"?"===this.token&&(this.next(),r=!0),n=this.read_types(),r&&!n&&this.raiseError("Expecting a type definition combined with nullable operator");const c=this.is_reference(),l=this.is_variadic();if(this.expect(this.tok.T_VARIABLE)){s=this.node("identifier");const t=this.text().substring(1);this.next(),s=s(t)}"="==this.token&&(i=this.next().read_expr());const u=e(s,n,i,c,l,o,r,a);return h&&(u.attrGroups=h),u},read_types(){const t="unset",e="union",s="intersection",i=[];let n=t;const r=this.read_type();if(!r)return null;for(i.push(r);"|"===this.token||this.version>=801&&"&"===this.token;){const r=this.peek();if(r===this.tok.T_ELLIPSIS||r===this.tok.T_VARIABLE)break;n===t?n="|"===this.token?e:s:(n===e&&"|"!==this.token||n===s&&"&"!==this.token)&&this.raiseError('Unexpect token "'+this.token+'", "|" and "&" can not be mixed'),this.next(),i.push(this.read_type())}return 1===i.length?i[0]:n===s?this.node("intersectiontype")(i):this.node("uniontype")(i)},read_promoted(){return this.token===this.tok.T_PUBLIC?(this.next(),1):this.token===this.tok.T_PROTECTED?(this.next(),2):this.token===this.tok.T_PRIVATE?(this.next(),4):0},read_argument_list:function(){let t=[];return this.expect("(")&&this.next(),this.version>=801&&this.token===this.tok.T_ELLIPSIS&&")"===this.peek()?(t.push(this.node("variadicplaceholder")()),this.next()):")"!==this.token&&(t=this.read_non_empty_argument_list()),this.expect(")")&&this.next(),t},read_non_empty_argument_list:function(){let t=!1;return this.read_function_list(function(){const e=this.read_argument();if(e){const s="variadic"===e.kind;t&&!s&&this.raiseError("Unexpected non-variadic argument after a variadic argument"),s&&(t=!0)}return e}.bind(this),",")},read_argument:function(){if(this.token===this.tok.T_ELLIPSIS)return this.node("variadic")(this.next().read_expr());if(this.token===this.tok.T_STRING||Object.values(this.lexer.keywords).includes(this.token)){if(":"===this.peek())return this.version<800&&this.raiseError("PHP 8+ is required to use named arguments"),this.node("namedargument")(this.text(),this.next().next().read_expr())}return this.read_expr()},read_type:function(){const t=this.node();if(this.token===this.tok.T_ARRAY||this.token===this.tok.T_CALLABLE){const e=this.text();return this.next(),t("typereference",e.toLowerCase(),e)}if(this.token===this.tok.T_NAME_RELATIVE||this.token===this.tok.T_NAME_QUALIFIED||this.token===this.tok.T_NAME_FULLY_QUALIFIED||this.token===this.tok.T_STRING||this.token===this.tok.T_STATIC){const e=this.text(),s=[this.token,this.lexer.getState()];return this.next(),this.token!==this.tok.T_NS_SEPARATOR&&this.ast.typereference.types.indexOf(e.toLowerCase())>-1?t("typereference",e.toLowerCase(),e):(this.lexer.tokens.push(s),this.next(),t.destroy(),this.read_namespace_name())}return t.destroy(),null}};const y={"\\":"\\",$:"$",n:"\n",r:"\r",t:"\t",f:String.fromCharCode(12),v:String.fromCharCode(11),e:String.fromCharCode(27)};var A={resolve_special_chars:function(t,e){return e?t.replace(/\\"/,'"').replace(/\\([\\$nrtfve]|[xX][0-9a-fA-F]{1,2}|[0-7]{1,3}|u{([0-9a-fA-F]+)})/g,((t,e,s)=>y[e]?y[e]:"x"===e[0]||"X"===e[0]?String.fromCodePoint(parseInt(e.substr(1),16)):"u"===e[0]?String.fromCodePoint(parseInt(s,16)):String.fromCodePoint(parseInt(e,8)))):t.replace(/\\\\/g,"\\").replace(/\\'/g,"'")},remove_heredoc_leading_whitespace_chars:function(t,e,s,i){if(0===e)return t;this.check_heredoc_indentation_level(t,e,s,i);const n=s?" ":"\t",r=new RegExp(`\\n${n}{${e}}`,"g"),o=new RegExp(`^${n}{${e}}`);return i&&(t=t.replace(o,"")),t.replace(r,"\n")},check_heredoc_indentation_level:function(t,e,s,i){const n=t.length;let r=0,o=0,h=!0;const a=s?" ":"\t";let c=!1;if(!i){if(r=t.indexOf("\n"),-1===r)return;r++}for(;r<n;)h?t[r]===a?o++:c=!0:h=!1,"\n"!==t[r]&&c&&o<e?this.raiseError(`Invalid body indentation level (expecting an indentation at least ${e})`):c=!1,"\n"===t[r]&&(h=!0,o=0),r++},read_dereferencable_scalar:function(){let t=null;switch(this.token){case this.tok.T_CONSTANT_ENCAPSED_STRING:{let e=this.node("string");const s=this.text();let i=0;"b"!==s[0]&&"B"!==s[0]||(i=1);const n='"'===s[i];this.next();e=e(n,this.resolve_special_chars(s.substring(i+1,s.length-1),n),1===i,s),t=this.token===this.tok.T_DOUBLE_COLON?this.read_static_getter(e):e}break;case this.tok.T_ARRAY:case"[":t=this.read_array()}return t},read_scalar:function(){if(this.is("T_MAGIC_CONST"))return this.get_magic_constant();{let t,e;switch(this.token){case this.tok.T_LNUMBER:case this.tok.T_DNUMBER:{const e=this.node("number");return t=this.text(),this.next(),e(t,null)}case this.tok.T_START_HEREDOC:if("ST_NOWDOC"===this.lexer.curCondition){const s=this.lexer.yylloc.first_offset;e=this.node("nowdoc"),t=this.next().text(),this.lexer.heredoc_label.indentation>0&&(t=t.substring(0,t.length-this.lexer.heredoc_label.indentation));const i=t[t.length-1];"\n"===i?t="\r"===t[t.length-2]?t.substring(0,t.length-2):t.substring(0,t.length-1):"\r"===i&&(t=t.substring(0,t.length-1)),this.expect(this.tok.T_ENCAPSED_AND_WHITESPACE)&&this.next(),this.expect(this.tok.T_END_HEREDOC)&&this.next();const n=this.lexer._input.substring(s,this.lexer.yylloc.first_offset);return e=e(this.remove_heredoc_leading_whitespace_chars(t,this.lexer.heredoc_label.indentation,this.lexer.heredoc_label.indentation_uses_spaces,this.lexer.heredoc_label.first_encaps_node),n,this.lexer.heredoc_label.label),this.lexer.heredoc_label.finished=!0,e}return this.read_encapsed_string(this.tok.T_END_HEREDOC);case'"':return this.read_encapsed_string('"');case'b"':case'B"':return this.read_encapsed_string('"',!0);case this.tok.T_CONSTANT_ENCAPSED_STRING:case this.tok.T_ARRAY:case"[":return this.read_dereferencable_scalar();default:{const t=this.error("SCALAR");return this.next(),t}}}},read_dereferencable:function(t){let e,s;const i=this.node("offsetlookup");return"["===this.token?(s=this.next().read_expr(),this.expect("]")&&this.next(),e=i(t,s)):this.token===this.tok.T_DOLLAR_OPEN_CURLY_BRACES&&(s=this.read_encapsed_string_item(!1),e=i(t,s)),e},read_encapsed_string_item:function(t){const e=this.node("encapsedpart");let s,i,n,r=null,o=!1,h=this.node();if(this.token===this.tok.T_ENCAPSED_AND_WHITESPACE){const e=this.text();this.next(),h=h("string",!1,this.version>=703&&!this.lexer.heredoc_label.finished?this.remove_heredoc_leading_whitespace_chars(this.resolve_special_chars(e,t),this.lexer.heredoc_label.indentation,this.lexer.heredoc_label.indentation_uses_spaces,this.lexer.heredoc_label.first_encaps_node):e,!1,e)}else if(this.token===this.tok.T_DOLLAR_OPEN_CURLY_BRACES){if(r="simple",o=!0,n=null,this.next().token===this.tok.T_STRING_VARNAME){n=this.node("variable");const t=this.text();this.next(),h.destroy(),"["===this.token?(n=n(t,!1),i=this.node("offsetlookup"),s=this.next().read_expr(),this.expect("]")&&this.next(),h=i(n,s)):h=n(t,!1)}else h=h("variable",this.read_expr(),!1);this.expect("}")&&this.next()}else if(this.token===this.tok.T_CURLY_OPEN)r="complex",h.destroy(),h=this.next().read_variable(!1,!1),this.expect("}")&&this.next();else if(this.token===this.tok.T_VARIABLE){if(r="simple",h.destroy(),h=this.read_simple_variable(),"["===this.token&&(i=this.node("offsetlookup"),s=this.next().read_encaps_var_offset(),this.expect("]")&&this.next(),h=i(h,s)),this.token===this.tok.T_OBJECT_OPERATOR){i=this.node("propertylookup"),this.next().expect(this.tok.T_STRING);const t=this.node("identifier");n=this.text(),this.next(),h=i(h,t(n))}}else{this.expect(this.tok.T_ENCAPSED_AND_WHITESPACE);const t=this.text();this.next(),h.destroy(),h=h("string",!1,t,!1,t)}return this.lexer.heredoc_label.first_encaps_node=!1,e(h,r,o)},read_encapsed_string:function(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const s=this.lexer.yylloc.first_offset;let i=this.node("encapsed");this.next();const n=this.lexer.yylloc.prev_offset-(e?1:0),r=[];let o=null;for(o="`"===t?this.ast.encapsed.TYPE_SHELL:'"'===t?this.ast.encapsed.TYPE_STRING:this.ast.encapsed.TYPE_HEREDOC;this.token!==t&&this.token!==this.EOF;)r.push(this.read_encapsed_string_item(!0));if(r.length>0&&"encapsedpart"===r[r.length-1].kind&&"string"===r[r.length-1].expression.kind){const t=r[r.length-1].expression,e=t.value[t.value.length-1];"\n"===e?"\r"===t.value[t.value.length-2]?t.value=t.value.substring(0,t.value.length-2):t.value=t.value.substring(0,t.value.length-1):"\r"===e&&(t.value=t.value.substring(0,t.value.length-1))}this.expect(t)&&this.next();return i=i(r,this.lexer._input.substring("heredoc"===o?s:n-1,this.lexer.yylloc.first_offset),o),t===this.tok.T_END_HEREDOC&&(i.label=this.lexer.heredoc_label.label,this.lexer.heredoc_label.finished=!0),i},get_magic_constant:function(){const t=this.node("magic"),e=this.text();return this.next(),t(e.toUpperCase(),e)}},N={read_top_statements:function(){let t=[];for(;this.token!==this.EOF&&"}"!==this.token;){const e=this.read_top_statement();e&&(Array.isArray(e)?t=t.concat(e):t.push(e))}return t},read_top_statement:function(){let t=[];switch(this.token===this.tok.T_ATTRIBUTE&&(t=this.read_attr_list()),this.token){case this.tok.T_FUNCTION:return this.read_function(!1,!1,t);case this.tok.T_ABSTRACT:case this.tok.T_FINAL:case this.tok.T_READ_ONLY:case this.tok.T_CLASS:return this.read_class_declaration_statement(t);case this.tok.T_INTERFACE:return this.read_interface_declaration_statement(t);case this.tok.T_TRAIT:return this.read_trait_declaration_statement();case this.tok.T_ENUM:return this.read_enum_declaration_statement(t);case this.tok.T_USE:return this.read_use_statement();case this.tok.T_CONST:{const t=this.node("constantstatement"),e=this.next().read_const_list();return this.expectEndOfStatement(),t(null,e)}case this.tok.T_NAMESPACE:return this.read_namespace();case this.tok.T_HALT_COMPILER:{const t=this.node("halt");return this.next().expect("(")&&this.next(),this.expect(")")&&this.next(),this.expect(";"),this.lexer.done=!0,t(this.lexer._input.substring(this.lexer.offset))}default:return this.read_statement()}},read_inner_statements:function(){let t=[];for(;this.token!=this.EOF&&"}"!==this.token;){const e=this.read_inner_statement();e&&(Array.isArray(e)?t=t.concat(e):t.push(e))}return t},read_const_list:function(){return this.read_list((function(){this.expect(this.tok.T_STRING);const t=this.node("constant");let e=this.node("identifier");const s=this.text();return this.next(),e=e(s),this.expect("=")?t(e,this.next().read_expr()):t(e,null)}),",",!1)},read_declare_list:function(){const t=[];for(;this.token!=this.EOF&&")"!==this.token;){this.expect(this.tok.T_STRING);const e=this.node("declaredirective");let s=this.node("identifier");const i=this.text();this.next(),s=s(i);let n=null;if(this.expect("=")&&(n=this.next().read_expr()),t.push(e(s,n)),","!==this.token)break;this.next()}return t},read_inner_statement:function(){let t=[];switch(this.token===this.tok.T_ATTRIBUTE&&(t=this.read_attr_list()),this.token){case this.tok.T_FUNCTION:{const e=this.read_function(!1,!1);return e.attrGroups=t,e}case this.tok.T_ABSTRACT:case this.tok.T_FINAL:case this.tok.T_CLASS:return this.read_class_declaration_statement();case this.tok.T_INTERFACE:return this.read_interface_declaration_statement();case this.tok.T_TRAIT:return this.read_trait_declaration_statement();case this.tok.T_ENUM:return this.read_enum_declaration_statement();case this.tok.T_HALT_COMPILER:{this.raiseError("__HALT_COMPILER() can only be used from the outermost scope");let t=this.node("halt");return this.next().expect("(")&&this.next(),this.expect(")")&&this.next(),t=t(this.lexer._input.substring(this.lexer.offset)),this.expect(";")&&this.next(),t}default:return this.read_statement()}},read_statement:function(){switch(this.token){case"{":return this.read_code_block(!1);case this.tok.T_IF:return this.read_if();case this.tok.T_SWITCH:return this.read_switch();case this.tok.T_FOR:return this.read_for();case this.tok.T_FOREACH:return this.read_foreach();case this.tok.T_WHILE:return this.read_while();case this.tok.T_DO:return this.read_do();case this.tok.T_COMMENT:return this.read_comment();case this.tok.T_DOC_COMMENT:return this.read_doc_comment();case this.tok.T_RETURN:{const t=this.node("return");this.next();const e=this.read_optional_expr(";");return this.expectEndOfStatement(),t(e)}case this.tok.T_BREAK:case this.tok.T_CONTINUE:{const t=this.node(this.token===this.tok.T_CONTINUE?"continue":"break");this.next();const e=this.read_optional_expr(";");return this.expectEndOfStatement(),t(e)}case this.tok.T_GLOBAL:{const t=this.node("global"),e=this.next().read_list(this.read_simple_variable,",");return this.expectEndOfStatement(),t(e)}case this.tok.T_STATIC:{const t=[this.token,this.lexer.getState()],e=this.node();if(this.next().token===this.tok.T_DOUBLE_COLON){this.lexer.tokens.push(t);const s=this.next().read_expr();return this.expectEndOfStatement(s),e("expressionstatement",s)}if(this.token===this.tok.T_FUNCTION)return this.read_function(!0,[0,1,0]);const s=this.read_variable_declarations();return this.expectEndOfStatement(),e("static",s)}case this.tok.T_ECHO:{const t=this.node("echo"),e=this.text(),s="<?="===e||"<%="===e,i=this.next().read_function_list(this.read_expr,",");return this.expectEndOfStatement(),t(i,s)}case this.tok.T_INLINE_HTML:{const t=this.text();let e=this.lexer.yylloc.first_offset>0?this.lexer._input[this.lexer.yylloc.first_offset-1]:null;const s="\r"===e||"\n"===e;s&&"\n"===e&&this.lexer.yylloc.first_offset>1&&"\r"===this.lexer._input[this.lexer.yylloc.first_offset-2]&&(e="\r\n");const i=this.node("inline");return this.next(),i(t,s?e+t:t)}case this.tok.T_UNSET:{const t=this.node("unset");this.next().expect("(")&&this.next();const e=this.read_function_list(this.read_variable,",");return this.expect(")")&&this.next(),this.expect(";")&&this.next(),t(e)}case this.tok.T_DECLARE:{const t=this.node("declare"),e=[];let s;this.next().expect("(")&&this.next();const i=this.read_declare_list();if(this.expect(")")&&this.next(),":"===this.token){for(this.next();this.token!=this.EOF&&this.token!==this.tok.T_ENDDECLARE;)e.push(this.read_top_statement());0===e.length&&this.extractDoc&&this._docs.length>this._docIndex&&e.push(this.node("noop")()),this.expect(this.tok.T_ENDDECLARE)&&this.next(),this.expectEndOfStatement(),s=this.ast.declare.MODE_SHORT}else if("{"===this.token){for(this.next();this.token!=this.EOF&&"}"!==this.token;)e.push(this.read_top_statement());0===e.length&&this.extractDoc&&this._docs.length>this._docIndex&&e.push(this.node("noop")()),this.expect("}")&&this.next(),s=this.ast.declare.MODE_BLOCK}else this.expect(";")&&this.next(),s=this.ast.declare.MODE_NONE;return t(i,e,s)}case this.tok.T_TRY:return this.read_try();case this.tok.T_THROW:{const t=this.node("throw"),e=this.next().read_expr();return this.expectEndOfStatement(),t(e)}case";":return this.next(),null;case this.tok.T_STRING:{const t=this.node(),e=[this.token,this.lexer.getState()],s=this.text();let i=this.node("identifier");if(":"===this.next().token)return i=i(s),this.next(),t("label",i);i.destroy(),t.destroy(),this.lexer.tokens.push(e);const n=this.node("expressionstatement"),r=this.next().read_expr();return this.expectEndOfStatement(r),n(r)}case this.tok.T_GOTO:{const t=this.node("goto");let e=null;if(this.next().expect(this.tok.T_STRING)){e=this.node("identifier");const t=this.text();this.next(),e=e(t),this.expectEndOfStatement()}return t(e)}default:{const t=this.node("expressionstatement"),e=this.read_expr();return this.expectEndOfStatement(e),t(e)}}},read_code_block:function(t){const e=this.node("block");this.expect("{")&&this.next();const s=t?this.read_top_statements():this.read_inner_statements();return 0===s.length&&this.extractDoc&&this._docs.length>this._docIndex&&s.push(this.node("noop")()),this.expect("}")&&this.next(),e(null,s)}},g={read_variable:function(t,e){let s;if("&"===this.token)return this.read_byref(this.read_variable.bind(this,t,e));if(this.is([this.tok.T_VARIABLE,"$"]))s=this.read_reference_variable(e);else if(this.is([this.tok.T_NS_SEPARATOR,this.tok.T_STRING,this.tok.T_NAME_RELATIVE,this.tok.T_NAME_QUALIFIED,this.tok.T_NAME_FULLY_QUALIFIED,this.tok.T_NAMESPACE])){s=this.node();const t=this.read_namespace_name();if(this.token!=this.tok.T_DOUBLE_COLON&&"("!=this.token&&-1===["parentreference","selfreference"].indexOf(t.kind)){const e=t.name.toLowerCase();"true"===e?s=t.destroy(s("boolean",!0,t.name)):"false"===e?s=t.destroy(s("boolean",!1,t.name)):"null"===e?s=t.destroy(s("nullkeyword",t.name)):(s.destroy(t),s=t)}else s.destroy(t),s=t}else if(this.token===this.tok.T_STATIC){s=this.node("staticreference");const t=this.text();this.next(),s=s(t)}else this.expect("VARIABLE");return this.token===this.tok.T_DOUBLE_COLON&&(s=this.read_static_getter(s,e)),this.recursive_variable_chain_scan(s,t,e)},read_static_getter:function(t,e){const s=this.node("staticlookup");let i,n;return this.next().is([this.tok.T_VARIABLE,"$"])?i=this.read_reference_variable(e):this.token===this.tok.T_STRING||this.token===this.tok.T_CLASS||this.version>=700&&this.is("IDENTIFIER")?(i=this.node("identifier"),n=this.text(),this.next(),i=i(n)):"{"===this.token?(i=this.node("literal"),n=this.next().read_expr(),this.expect("}")&&this.next(),i=i("literal",n,null),this.expect("(")):(this.error([this.tok.T_VARIABLE,this.tok.T_STRING]),i=this.node("identifier"),n=this.text(),this.next(),i=i(n)),s(t,i)},read_what:function(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=null,s=null;switch(this.next().token){case this.tok.T_STRING:e=this.node("identifier"),s=this.text(),this.next(),e=e(s),t&&this.token===this.tok.T_OBJECT_OPERATOR&&this.error();break;case this.tok.T_VARIABLE:e=this.node("variable"),s=this.text().substring(1),this.next(),e=e(s,!1);break;case"$":e=this.node(),this.next().expect(["$","{",this.tok.T_VARIABLE]),"{"===this.token?(s=this.next().read_expr(),this.expect("}")&&this.next(),e=e("variable",s,!0)):(s=this.read_expr(),e=e("variable",s,!1));break;case"{":e=this.node("encapsedpart"),s=this.next().read_expr(),this.expect("}")&&this.next(),e=e(s,"complex",!1);break;default:this.error([this.tok.T_STRING,this.tok.T_VARIABLE,"$","{"]),e=this.node("identifier"),s=this.text(),this.next(),e=e(s)}return e},recursive_variable_chain_scan:function(t,e,s){let i,n;t:for(;this.token!=this.EOF;)switch(this.token){case"(":if(e)return t;t=this.node("call")(t,this.read_argument_list());break;case"[":case"{":{const e="["===this.token;if(i=this.node("offsetlookup"),this.next(),n=!1,s)n=this.read_encaps_var_offset(),this.expect(e?"]":"}")&&this.next();else{(e?"]"!==this.token:"}"!==this.token)?(n=this.read_expr(),this.expect(e?"]":"}")&&this.next()):this.next()}t=i(t,n);break}case this.tok.T_DOUBLE_COLON:"staticlookup"===t.kind&&"identifier"===t.offset.kind&&this.error(),i=this.node("staticlookup"),t=i(t,this.read_what(!0));break;case this.tok.T_OBJECT_OPERATOR:i=this.node("propertylookup"),t=i(t,this.read_what());break;case this.tok.T_NULLSAFE_OBJECT_OPERATOR:i=this.node("nullsafepropertylookup"),t=i(t,this.read_what());break;default:break t}return t},read_encaps_var_offset:function(){let t=this.node();if(this.token===this.tok.T_STRING){const e=this.text();this.next(),t=t("identifier",e)}else if(this.token===this.tok.T_NUM_STRING){const e=this.text();this.next(),t=t("number",e,null)}else if("-"===this.token){this.next();const e=-1*this.text();this.expect(this.tok.T_NUM_STRING)&&this.next(),t=t("number",e,null)}else if(this.token===this.tok.T_VARIABLE){const e=this.text().substring(1);this.next(),t=t("variable",e,!1)}else{this.expect([this.tok.T_STRING,this.tok.T_NUM_STRING,"-",this.tok.T_VARIABLE]);const e=this.text();this.next(),t=t("identifier",e)}return t},read_reference_variable:function(t){let e,s=this.read_simple_variable();for(;this.token!=this.EOF;){const i=this.node();if("{"!=this.token||t){i.destroy();break}e=this.next().read_expr(),this.expect("}")&&this.next(),s=i("offsetlookup",s,e)}return s},read_simple_variable:function(){let t,e=this.node("variable");if(this.expect([this.tok.T_VARIABLE,"$"])&&this.token===this.tok.T_VARIABLE)t=this.text().substring(1),this.next(),e=e(t,!1);else switch("$"===this.token&&this.next(),this.token){case"{":{const t=this.next().read_expr();this.expect("}")&&this.next(),e=e(t,!0);break}case"$":e=e(this.read_simple_variable(),!1);break;case this.tok.T_VARIABLE:{t=this.text().substring(1);const s=this.node("variable");this.next(),e=e(s(t,!1),!1);break}default:this.error(["{","$",this.tok.T_VARIABLE]),t=this.text(),this.next(),e=e(t,!1)}return e}};const L=x;function b(t){return"."!=t&&","!=t&&!isNaN(parseFloat(t))&&isFinite(t)}const I=function(t,e){this.lexer=t,this.ast=e,this.tok=t.tok,this.EOF=t.EOF,this.token=null,this.prev=null,this.debug=!1,this.version=801,this.extractDoc=!1,this.extractTokens=!1,this.suppressErrors=!1;const s=function(t){return[t,null]};this.entries={IDENTIFIER:new Map([this.tok.T_ABSTRACT,this.tok.T_ARRAY,this.tok.T_AS,this.tok.T_BREAK,this.tok.T_CALLABLE,this.tok.T_CASE,this.tok.T_CATCH,this.tok.T_CLASS,this.tok.T_CLASS_C,this.tok.T_CLONE,this.tok.T_CONST,this.tok.T_CONTINUE,this.tok.T_DECLARE,this.tok.T_DEFAULT,this.tok.T_DIR,this.tok.T_DO,this.tok.T_ECHO,this.tok.T_ELSE,this.tok.T_ELSEIF,this.tok.T_EMPTY,this.tok.T_ENDDECLARE,this.tok.T_ENDFOR,this.tok.T_ENDFOREACH,this.tok.T_ENDIF,this.tok.T_ENDSWITCH,this.tok.T_ENDWHILE,this.tok.T_ENUM,this.tok.T_EVAL,this.tok.T_EXIT,this.tok.T_EXTENDS,this.tok.T_FILE,this.tok.T_FINAL,this.tok.T_FINALLY,this.tok.T_FN,this.tok.T_FOR,this.tok.T_FOREACH,this.tok.T_FUNC_C,this.tok.T_FUNCTION,this.tok.T_GLOBAL,this.tok.T_GOTO,this.tok.T_IF,this.tok.T_IMPLEMENTS,this.tok.T_INCLUDE,this.tok.T_INCLUDE_ONCE,this.tok.T_INSTANCEOF,this.tok.T_INSTEADOF,this.tok.T_INTERFACE,this.tok.T_ISSET,this.tok.T_LINE,this.tok.T_LIST,this.tok.T_LOGICAL_AND,this.tok.T_LOGICAL_OR,this.tok.T_LOGICAL_XOR,this.tok.T_MATCH,this.tok.T_METHOD_C,this.tok.T_NAMESPACE,this.tok.T_NEW,this.tok.T_NS_C,this.tok.T_PRINT,this.tok.T_PRIVATE,this.tok.T_PROTECTED,this.tok.T_PUBLIC,this.tok.T_READ_ONLY,this.tok.T_REQUIRE,this.tok.T_REQUIRE_ONCE,this.tok.T_RETURN,this.tok.T_STATIC,this.tok.T_SWITCH,this.tok.T_THROW,this.tok.T_TRAIT,this.tok.T_TRY,this.tok.T_UNSET,this.tok.T_USE,this.tok.T_VAR,this.tok.T_WHILE,this.tok.T_YIELD].map(s)),VARIABLE:new Map([this.tok.T_VARIABLE,"$","&",this.tok.T_STRING,this.tok.T_NAME_RELATIVE,this.tok.T_NAME_QUALIFIED,this.tok.T_NAME_FULLY_QUALIFIED,this.tok.T_NAMESPACE,this.tok.T_STATIC].map(s)),SCALAR:new Map([this.tok.T_CONSTANT_ENCAPSED_STRING,this.tok.T_START_HEREDOC,this.tok.T_LNUMBER,this.tok.T_DNUMBER,this.tok.T_ARRAY,"[",this.tok.T_CLASS_C,this.tok.T_TRAIT_C,this.tok.T_FUNC_C,this.tok.T_METHOD_C,this.tok.T_LINE,this.tok.T_FILE,this.tok.T_DIR,this.tok.T_NS_C,'"','b"','B"',"-",this.tok.T_NS_SEPARATOR].map(s)),T_MAGIC_CONST:new Map([this.tok.T_CLASS_C,this.tok.T_TRAIT_C,this.tok.T_FUNC_C,this.tok.T_METHOD_C,this.tok.T_LINE,this.tok.T_FILE,this.tok.T_DIR,this.tok.T_NS_C].map(s)),T_MEMBER_FLAGS:new Map([this.tok.T_PUBLIC,this.tok.T_PRIVATE,this.tok.T_PROTECTED,this.tok.T_STATIC,this.tok.T_ABSTRACT,this.tok.T_FINAL].map(s)),EOS:new Map([";",this.EOF,this.tok.T_INLINE_HTML].map(s)),EXPR:new Map(["@","-","+","!","~","(","`",this.tok.T_LIST,this.tok.T_CLONE,this.tok.T_INC,this.tok.T_DEC,this.tok.T_NEW,this.tok.T_ISSET,this.tok.T_EMPTY,this.tok.T_MATCH,this.tok.T_INCLUDE,this.tok.T_INCLUDE_ONCE,this.tok.T_REQUIRE,this.tok.T_REQUIRE_ONCE,this.tok.T_EVAL,this.tok.T_INT_CAST,this.tok.T_DOUBLE_CAST,this.tok.T_STRING_CAST,this.tok.T_ARRAY_CAST,this.tok.T_OBJECT_CAST,this.tok.T_BOOL_CAST,this.tok.T_UNSET_CAST,this.tok.T_EXIT,this.tok.T_PRINT,this.tok.T_YIELD,this.tok.T_STATIC,this.tok.T_FUNCTION,this.tok.T_FN,this.tok.T_VARIABLE,"$",this.tok.T_NS_SEPARATOR,this.tok.T_STRING,this.tok.T_NAME_RELATIVE,this.tok.T_NAME_QUALIFIED,this.tok.T_NAME_FULLY_QUALIFIED,this.tok.T_STRING,this.tok.T_CONSTANT_ENCAPSED_STRING,this.tok.T_START_HEREDOC,this.tok.T_LNUMBER,this.tok.T_DNUMBER,this.tok.T_ARRAY,"[",this.tok.T_CLASS_C,this.tok.T_TRAIT_C,this.tok.T_FUNC_C,this.tok.T_METHOD_C,this.tok.T_LINE,this.tok.T_FILE,this.tok.T_DIR,this.tok.T_NS_C,'"','b"','B"',"-",this.tok.T_NS_SEPARATOR].map(s))}};I.prototype.getTokenName=function(t){return b(t)?t==this.EOF?"the end of file (EOF)":this.lexer.engine.tokens.values[t]:"'"+t+"'"},I.prototype.parse=function(t,e){this._errors=[],this.filename=e||"eval",this.currentNamespace=[""],this.extractDoc?this._docs=[]:this._docs=null,this.extractTokens?this._tokens=[]:this._tokens=null,this._docIndex=0,this._lastNode=null,this.lexer.setInput(t),this.lexer.all_tokens=this.extractTokens,this.lexer.comment_tokens=this.extractDoc,this.length=this.lexer._input.length,this.innerList=!1,this.innerListForm=!1;const s=this.node("program"),i=[];for(this.next();this.token!=this.EOF;)i.push(this.read_start());0===i.length&&this.extractDoc&&this._docs.length>this._docIndex&&i.push(this.node("noop")()),this.prev=[this.lexer.yylloc.last_line,this.lexer.yylloc.last_column,this.lexer.offset];const n=s(i,this._errors,this._docs,this._tokens);if(this.debug){const t=this.ast.checkNodes();if(t.length>0)throw t.forEach((function(t){t.position&&console.log("Node at line "+t.position.line+", column "+t.position.column),console.log(t.stack.join("\n"))})),new Error("Some nodes are not closed")}return n},I.prototype.raiseError=function(t,e,s,i){if(t+=" on line "+this.lexer.yylloc.first_line,!this.suppressErrors){const e=new SyntaxError(t,this.filename,this.lexer.yylloc.first_line);throw e.lineNumber=this.lexer.yylloc.first_line,e.fileName=this.filename,e.columnNumber=this.lexer.yylloc.first_column,e}const n=this.ast.prepare("error",null,this)(t,i,this.lexer.yylloc.first_line,s);return this._errors.push(n),n},I.prototype.error=function(t){let e="Parse Error : syntax error",s=this.getTokenName(this.token),i="";if(this.token!==this.EOF){if(b(this.token)){let t=this.text();t.length>10&&(t=t.substring(0,7)+"..."),s="'"+t+"' ("+s+")"}e+=", unexpected "+s}return t&&!Array.isArray(t)&&((b(t)||1===t.length)&&(i=", expecting "+this.getTokenName(t)),e+=i),this.raiseError(e,i,t,s)},I.prototype.position=function(){return new L(this.lexer.yylloc.first_line,this.lexer.yylloc.first_column,this.lexer.yylloc.first_offset)},I.prototype.node=function(t){if(this.extractDoc){let e=null;this._docIndex<this._docs.length&&(e=this._docs.slice(this._docIndex),this._docIndex=this._docs.length,this.debug&&(console.log(new Error("Append docs on "+t)),console.log(e)));const s=this.ast.prepare(t,e,this);return s.postBuild=function(t){if(this._docIndex<this._docs.length)if(this._lastNode){const t=this.prev[2];let e=this._docIndex;for(;e<this._docs.length&&!(this._docs[e].offset>t);e++);e>this._docIndex&&(this._lastNode.setTrailingComments(this._docs.slice(this._docIndex,e)),this._docIndex=e)}else this.token===this.EOF&&(t.setTrailingComments(this._docs.slice(this._docIndex)),this._docIndex=this._docs.length);this._lastNode=t}.bind(this),s}return this.ast.prepare(t,null,this)},I.prototype.expectEndOfStatement=function(t){if(";"===this.token)t&&";"===this.lexer.yytext&&t.includeToken(this);else if(this.token!==this.tok.T_INLINE_HTML&&this.token!==this.EOF)return this.error(";"),!1;return this.next(),!0};const C=["parser.next","parser.node","parser.showlog"];I.prototype.showlog=function(){const t=(new Error).stack.split("\n");let e;for(let s=2;s<t.length;s++){e=t[s].trim();let i=!1;for(let t=0;t<C.length;t++)if(e.substring(3,3+C[t].length)===C[t]){i=!0;break}if(!i)break}return console.log("Line "+this.lexer.yylloc.first_line+" : "+this.getTokenName(this.token)+">"+this.lexer.yytext+"< @--\x3e"+e),this},I.prototype.expect=function(t){if(Array.isArray(t)){if(-1===t.indexOf(this.token))return this.error(t),!1}else if(this.token!=t)return this.error(t),!1;return!0},I.prototype.text=function(){return this.lexer.yytext},I.prototype.next=function(){if(";"===this.token&&";"!==this.lexer.yytext||(this.prev=[this.lexer.yylloc.last_line,this.lexer.yylloc.last_column,this.lexer.offset]),this.lex(),this.debug&&this.showlog(),this.extractDoc)for(;this.token===this.tok.T_COMMENT||this.token===this.tok.T_DOC_COMMENT;)this.token===this.tok.T_COMMENT?this._docs.push(this.read_comment()):this._docs.push(this.read_doc_comment());return this},I.prototype.peek=function(){const t=this.lexer.getState(),e=this.lexer.lex();return this.lexer.setState(t),e},I.prototype.lex=function(){if(this.extractTokens)do{if(this.token=this.lexer.lex()||this.EOF,this.token===this.EOF)return this;let t=this.lexer.yytext;if(t=Object.prototype.hasOwnProperty.call(this.lexer.engine.tokens.values,this.token)?[this.lexer.engine.tokens.values[this.token],t,this.lexer.yylloc.first_line,this.lexer.yylloc.first_offset,this.lexer.offset]:[null,t,this.lexer.yylloc.first_line,this.lexer.yylloc.first_offset,this.lexer.offset],this._tokens.push(t),this.token===this.tok.T_CLOSE_TAG)return this.token=";",this;if(this.token===this.tok.T_OPEN_TAG_WITH_ECHO)return this.token=this.tok.T_ECHO,this}while(this.token===this.tok.T_WHITESPACE||!this.extractDoc&&(this.token===this.tok.T_COMMENT||this.token===this.tok.T_DOC_COMMENT)||this.token===this.tok.T_OPEN_TAG);else this.token=this.lexer.lex()||this.EOF;return this},I.prototype.is=function(t){return Array.isArray(t)?-1!==t.indexOf(this.token):this.entries[t].has(this.token)},[{read_array:function(){let t=null,e=!1;const s=this.node("array");this.token===this.tok.T_ARRAY?(this.next().expect("("),t=")"):(e=!0,t="]");let i=[];return this.next().token!==t&&(i=this.read_array_pair_list(e)),this.expect(t),this.next(),s(e,i)},read_array_pair_list:function(t){const e=this;return this.read_list((function(){return e.read_array_pair(t)}),",",!0)},read_array_pair:function(t){if(!t&&")"===this.token||t&&"]"===this.token)return;if(","===this.token)return this.node("noop")();const e=this.node("entry");let s=null,i=null,n=!1,r=!1;if("&"===this.token)this.next(),n=!0,i=this.read_variable(!0,!1);else if(this.token===this.tok.T_ELLIPSIS&&this.version>=704)this.next(),"&"===this.token&&this.error(),r=!0,i=this.read_expr();else{const t=this.read_expr();this.token===this.tok.T_DOUBLE_ARROW?(this.next(),s=t,"&"===this.token?(this.next(),n=!0,i=this.read_variable(!0,!1)):i=this.read_expr()):i=t}return e(s,i,n,r)}},{read_class_declaration_statement:function(t){const e=this.node("class"),s=this.read_class_modifiers();if(this.token!==this.tok.T_CLASS)return this.error(this.tok.T_CLASS),this.next(),null;this.next().expect(this.tok.T_STRING);let i=this.node("identifier");const n=this.text();this.next(),i=i(n);const r=this.read_extends_from(),o=this.read_implements_list();this.expect("{");const h=e(i,r,o,this.next().read_class_body(!0,!1),s);return t&&(h.attrGroups=t),h},read_class_modifiers:function(){const t=this.read_class_modifier({readonly:0,final_or_abstract:0});return[0,0,t.final_or_abstract,t.readonly]},read_class_modifier:function(t){return this.token===this.tok.T_READ_ONLY?(this.next(),t.readonly=1,t=this.read_class_modifier(t)):0===t.final_or_abstract&&this.token===this.tok.T_ABSTRACT?(this.next(),t.final_or_abstract=1,t=this.read_class_modifier(t)):0===t.final_or_abstract&&this.token===this.tok.T_FINAL&&(this.next(),t.final_or_abstract=2,t=this.read_class_modifier(t)),t},read_class_body:function(t,e){let s=[],i=[];for(;this.token!==this.EOF&&"}"!==this.token;){if(this.token===this.tok.T_COMMENT){s.push(this.read_comment());continue}if(this.token===this.tok.T_DOC_COMMENT){s.push(this.read_doc_comment());continue}if(this.token===this.tok.T_USE){s=s.concat(this.read_trait_use_statement());continue}if(e&&this.token===this.tok.T_CASE){const t=this.read_enum_case();this.expect(";")&&this.next(),s=s.concat(t);continue}this.token===this.tok.T_ATTRIBUTE&&(i=this.read_attr_list());const n=this.position(),r=this.read_member_flags(!1);if(this.token!==this.tok.T_CONST)if(t&&this.token===this.tok.T_VAR&&(this.next().expect(this.tok.T_VARIABLE),r[0]=null,r[1]=0),this.token===this.tok.T_FUNCTION)s.push(this.read_function(!1,r,i,n)),i=[];else if(t&&(this.token===this.tok.T_VARIABLE||this.version>=801&&this.token===this.tok.T_READ_ONLY||this.version>=704&&("?"===this.token||this.token===this.tok.T_ARRAY||this.token===this.tok.T_CALLABLE||this.token===this.tok.T_NAMESPACE||this.token===this.tok.T_NAME_FULLY_QUALIFIED||this.token===this.tok.T_NAME_QUALIFIED||this.token===this.tok.T_NAME_RELATIVE||this.token===this.tok.T_NS_SEPARATOR||this.token===this.tok.T_STRING))){const t=this.read_variable_list(r,i);i=[],this.expect(";"),this.next(),s=s.concat(t)}else this.error([this.tok.T_CONST,...t?[this.tok.T_VARIABLE]:[],...e?[this.tok.T_CASE]:[],this.tok.T_FUNCTION]),this.next();else{const t=this.read_constant_list(r,i);this.expect(";")&&this.next(),s=s.concat(t)}}return this.expect("}"),this.next(),s},read_variable_list:function(t,e){const s=this.node("propertystatement"),i=this.read_list((function(){const t=this.node("property");let s=!1;this.token===this.tok.T_READ_ONLY&&(s=!0,this.next());const[i,n]=this.read_optional_type();this.expect(this.tok.T_VARIABLE);let r=this.node("identifier");const o=this.text().substring(1);return this.next(),r=r(o),";"===this.token||","===this.token?t(r,null,s,i,n,e||[]):"="===this.token?t(r,this.next().read_expr(),s,i,n,e||[]):(this.expect([",",";","="]),t(r,null,i,n,e||[]))}),",");return s(null,i,t)},read_constant_list:function(t,e){this.expect(this.tok.T_CONST)&&this.next();const s=this.node("classconstant"),i=this.read_list((function(){const t=this.node("constant");let e=null,s=null;if(this.token===this.tok.T_STRING||this.version>=700&&this.is("IDENTIFIER")){e=this.node("identifier");const t=this.text();this.next(),e=e(t)}else this.expect("IDENTIFIER");return this.expect("=")&&(s=this.next().read_expr()),t(e,s)}),",");return s(null,i,t,e||[])},read_member_flags:function(t){const e=[-1,-1,-1];if(this.is("T_MEMBER_FLAGS")){let s=0,i=0;do{switch(this.token){case this.tok.T_PUBLIC:s=0,i=0;break;case this.tok.T_PROTECTED:s=0,i=1;break;case this.tok.T_PRIVATE:s=0,i=2;break;case this.tok.T_STATIC:s=1,i=1;break;case this.tok.T_ABSTRACT:s=2,i=1;break;case this.tok.T_FINAL:s=2,i=2}t&&(0==s&&2==i?(this.expect([this.tok.T_PUBLIC,this.tok.T_PROTECTED]),i=-1):2==s&&1==i&&(this.error(),i=-1)),-1!==e[s]?this.error():-1!==i&&(e[s]=i)}while(this.next().is("T_MEMBER_FLAGS"))}return-1==e[1]&&(e[1]=0),-1==e[2]&&(e[2]=0),e},read_optional_type:function(){let t=!1;"?"===this.token&&(t=!0,this.next());let e=this.read_types();if(t&&!e&&this.raiseError("Expecting a type definition combined with nullable operator"),!t&&!e)return[!1,null];if("|"===this.token){e=[e];do{this.next();const t=this.read_type();if(!t){this.raiseError("Expecting a type definition");break}e.push(t)}while("|"===this.token)}return[t,e]},read_interface_declaration_statement:function(t){const e=this.node("interface");if(this.token!==this.tok.T_INTERFACE)return this.error(this.tok.T_INTERFACE),this.next(),null;this.next().expect(this.tok.T_STRING);let s=this.node("identifier");const i=this.text();this.next(),s=s(i);const n=this.read_interface_extends_list();this.expect("{");return e(s,n,this.next().read_interface_body(),t||[])},read_interface_body:function(){let t=[],e=[];for(;this.token!==this.EOF&&"}"!==this.token;){if(this.token===this.tok.T_COMMENT){t.push(this.read_comment());continue}if(this.token===this.tok.T_DOC_COMMENT){t.push(this.read_doc_comment());continue}const s=this.position();e=this.read_attr_list();const i=this.read_member_flags(!0);if(this.token==this.tok.T_CONST){const s=this.read_constant_list(i,e);this.expect(";")&&this.next(),t=t.concat(s),e=[]}else if(this.token===this.tok.T_FUNCTION){const n=this.read_function_declaration(2,i,e,s);n.parseFlags(i),t.push(n),this.expect(";")&&this.next(),e=[]}else this.error([this.tok.T_CONST,this.tok.T_FUNCTION]),this.next()}return this.expect("}")&&this.next(),t},read_trait_declaration_statement:function(){const t=this.node("trait");if(this.token!==this.tok.T_TRAIT)return this.error(this.tok.T_TRAIT),this.next(),null;this.next().expect(this.tok.T_STRING);let e=this.node("identifier");const s=this.text();this.next(),e=e(s),this.expect("{");return t(e,this.next().read_class_body(!0,!1))},read_trait_use_statement:function(){const t=this.node("traituse");this.expect(this.tok.T_USE)&&this.next();const e=[this.read_namespace_name()];let s=null;for(;","===this.token;)e.push(this.next().read_namespace_name());if("{"===this.token){for(s=[];this.next().token!==this.EOF&&"}"!==this.token;)s.push(this.read_trait_use_alias()),this.expect(";");this.expect("}")&&this.next()}else this.expect(";")&&this.next();return t(e,s)},read_trait_use_alias:function(){const t=this.node();let e,s=null;if(this.is("IDENTIFIER")){e=this.node("identifier");const t=this.text();this.next(),e=e(t)}else if(e=this.read_namespace_name(),this.token===this.tok.T_DOUBLE_COLON)if(this.next(),this.token===this.tok.T_STRING||this.version>=700&&this.is("IDENTIFIER")){s=e,e=this.node("identifier");const t=this.text();this.next(),e=e(t)}else this.expect(this.tok.T_STRING);else e=e.name;if(this.token===this.tok.T_INSTEADOF)return t("traitprecedence",s,e,this.next().read_name_list());if(this.token===this.tok.T_AS){let i=null,n=null;if(this.next().is("T_MEMBER_FLAGS")&&(i=this.read_member_flags()),this.token===this.tok.T_STRING||this.version>=700&&this.is("IDENTIFIER")){n=this.node("identifier");const t=this.text();this.next(),n=n(t)}else!1===i&&this.expect(this.tok.T_STRING);return t("traitalias",s,e,n,i)}return this.expect([this.tok.T_AS,this.tok.T_INSTEADOF]),t("traitalias",s,e,null,null)}},{read_comment:function(){const t=this.text();let e=this.ast.prepare("/*"===t.substring(0,2)?"commentblock":"commentline",null,this);const s=this.lexer.yylloc.first_offset,i=this.prev;return this.prev=[this.lexer.yylloc.last_line,this.lexer.yylloc.last_column,this.lexer.offset],this.lex(),e=e(t),e.offset=s,this.prev=i,e},read_doc_comment:function(){let t=this.ast.prepare("commentblock",null,this);const e=this.lexer.yylloc.first_offset,s=this.text(),i=this.prev;return this.prev=[this.lexer.yylloc.last_line,this.lexer.yylloc.last_column,this.lexer.offset],this.lex(),t=t(s),t.offset=e,this.prev=i,t}},E,{read_enum_declaration_statement:function(t){const e=this.node("enum");if(!this.expect(this.tok.T_ENUM))return null;this.next().expect(this.tok.T_STRING);let s=this.node("identifier");const i=this.text();this.next(),s=s(i);const n=this.read_enum_value_type(),r=this.read_implements_list();this.expect("{");const o=e(s,n,r,this.next().read_class_body(!1,!0));return t&&(o.attrGroups=t),o},read_enum_value_type:function(){return":"===this.token?this.next().read_namespace_name():null},read_enum_case:function(){this.expect(this.tok.T_CASE);const t=this.node("enumcase");let e=this.node("identifier");const s=this.next().text();this.next(),e=e(s);const i="="===this.token?this.next().read_expr():null;return this.expect(";"),t(e,i)}},m,{read_if:function(){const t=this.node("if"),e=this.next().read_if_expr();let s=null,i=null,n=!1;if(":"===this.token){n=!0,this.next(),s=this.node("block");const t=[];for(;this.token!==this.EOF&&this.token!==this.tok.T_ENDIF;){if(this.token===this.tok.T_ELSEIF){i=this.read_elseif_short();break}if(this.token===this.tok.T_ELSE){i=this.read_else_short();break}t.push(this.read_inner_statement())}s=s(null,t),this.expect(this.tok.T_ENDIF)&&this.next(),this.expectEndOfStatement()}else s=this.read_statement(),this.token===this.tok.T_ELSEIF?i=this.read_if():this.token===this.tok.T_ELSE&&(i=this.next().read_statement());return t(e,s,i,n)},read_if_expr:function(){this.expect("(")&&this.next();const t=this.read_expr();return this.expect(")")&&this.next(),t},read_elseif_short:function(){let t=null;const e=this.node("if"),s=this.next().read_if_expr();this.expect(":")&&this.next();const i=this.node("block"),n=[];for(;this.token!=this.EOF&&this.token!==this.tok.T_ENDIF;){if(this.token===this.tok.T_ELSEIF){t=this.read_elseif_short();break}if(this.token===this.tok.T_ELSE){t=this.read_else_short();break}n.push(this.read_inner_statement())}return e(s,i(null,n),t,!0)},read_else_short:function(){this.next().expect(":")&&this.next();const t=this.node("block"),e=[];for(;this.token!=this.EOF&&this.token!==this.tok.T_ENDIF;)e.push(this.read_inner_statement());return t(null,e)}},{read_while:function(){const t=this.node("while");this.expect(this.tok.T_WHILE)&&this.next();let e=null,s=null,i=!1;return this.expect("(")&&this.next(),e=this.read_expr(),this.expect(")")&&this.next(),":"===this.token?(i=!0,s=this.read_short_form(this.tok.T_ENDWHILE)):s=this.read_statement(),t(e,s,i)},read_do:function(){const t=this.node("do");this.expect(this.tok.T_DO)&&this.next();let e=null,s=null;return s=this.read_statement(),this.expect(this.tok.T_WHILE)&&(this.next().expect("(")&&this.next(),e=this.read_expr(),this.expect(")")&&this.next(),this.expect(";")&&this.next()),t(e,s)},read_for:function(){const t=this.node("for");this.expect(this.tok.T_FOR)&&this.next();let e=[],s=[],i=[],n=null,r=!1;return this.expect("(")&&this.next(),";"!==this.token?(e=this.read_list(this.read_expr,","),this.expect(";")&&this.next()):this.next(),";"!==this.token?(s=this.read_list(this.read_expr,","),this.expect(";")&&this.next()):this.next(),")"!==this.token?(i=this.read_list(this.read_expr,","),this.expect(")")&&this.next()):this.next(),":"===this.token?(r=!0,n=this.read_short_form(this.tok.T_ENDFOR)):n=this.read_statement(),t(e,s,i,n,r)},read_foreach:function(){const t=this.node("foreach");this.expect(this.tok.T_FOREACH)&&this.next();let e=null,s=null,i=null,n=null,r=!1;return this.expect("(")&&this.next(),e=this.read_expr(),this.expect(this.tok.T_AS)&&(this.next(),i=this.read_foreach_variable(),this.token===this.tok.T_DOUBLE_ARROW&&(s=i,i=this.next().read_foreach_variable())),s&&"list"===s.kind&&this.raiseError("Fatal Error : Cannot use list as key element"),this.expect(")")&&this.next(),":"===this.token?(r=!0,n=this.read_short_form(this.tok.T_ENDFOREACH)):n=this.read_statement(),t(e,s,i,n,r)},read_foreach_variable:function(){if(this.token===this.tok.T_LIST||"["===this.token){const t="["===this.token,e=this.node("list");this.next(),!t&&this.expect("(")&&this.next();const s=this.read_array_pair_list(t);return this.expect(t?"]":")")&&this.next(),e(s,t)}return this.read_variable(!1,!1)}},{read_start:function(){return this.token==this.tok.T_NAMESPACE?this.read_namespace():this.read_top_statement()}},{read_namespace:function(){const t=this.node("namespace");let e,s;return this.expect(this.tok.T_NAMESPACE)&&this.next(),s="{"===this.token?{name:[""]}:this.read_namespace_name(),this.currentNamespace=s,";"===this.token?(this.currentNamespace=s,e=this.next().read_top_statements(),this.expect(this.EOF),t(s.name,e,!1)):"{"===this.token?(this.currentNamespace=s,e=this.next().read_top_statements(),this.expect("}")&&this.next(),0===e.length&&this.extractDoc&&this._docs.length>this._docIndex&&e.push(this.node("noop")()),t(s.name,e,!0)):(this.error(["{",";"]),this.currentNamespace=s,e=this.read_top_statements(),this.expect(this.EOF),t(s,e,!1))},read_namespace_name:function(t){const e=this.node();let s,i=this.text();switch(this.token){case this.tok.T_NAME_RELATIVE:s=this.ast.name.RELATIVE_NAME,i=i.replace(/^namespace\\/,"");break;case this.tok.T_NAME_QUALIFIED:s=this.ast.name.QUALIFIED_NAME;break;case this.tok.T_NAME_FULLY_QUALIFIED:s=this.ast.name.FULL_QUALIFIED_NAME;break;default:if(s=this.ast.name.UNQUALIFIED_NAME,!this.expect(this.tok.T_STRING))return e("name","",this.ast.name.FULL_QUALIFIED_NAME)}if(this.next(),t||"("!==this.token){if("parent"===i.toLowerCase())return e("parentreference",i);if("self"===i.toLowerCase())return e("selfreference",i)}return e("name",i,s)},read_use_statement:function(){let t=this.node("usegroup"),e=[],s=null;this.expect(this.tok.T_USE)&&this.next();const i=this.read_use_type();return e.push(this.read_use_declaration(!1)),","===this.token?e=e.concat(this.next().read_use_declarations(!1)):"{"===this.token&&(s=e[0].name,e=this.next().read_use_declarations(null===i),this.expect("}")&&this.next()),t=t(s,i,e),this.expect(";")&&this.next(),t},read_class_name_reference:function(){return this.read_variable(!0,!1)},read_use_declaration:function(t){const e=this.node("useitem");let s=null;t&&(s=this.read_use_type());const i=this.read_namespace_name(),n=this.read_use_alias();return e(i.name,n,s)},read_use_declarations:function(t){const e=[this.read_use_declaration(t)];for(;","===this.token;){if(this.next(),t){if(this.token!==this.tok.T_NAME_RELATIVE&&this.token!==this.tok.T_NAME_QUALIFIED&&this.token!==this.tok.T_NAME_FULLY_QUALIFIED&&this.token!==this.tok.T_FUNCTION&&this.token!==this.tok.T_CONST&&this.token!==this.tok.T_STRING)break}else if(this.token!==this.tok.T_NAME_RELATIVE&&this.token!==this.tok.T_NAME_QUALIFIED&&this.token!==this.tok.T_NAME_FULLY_QUALIFIED&&this.token!==this.tok.T_STRING&&this.token!==this.tok.T_NS_SEPARATOR)break;e.push(this.read_use_declaration(t))}return e},read_use_alias:function(){let t=null;if(this.token===this.tok.T_AS&&this.next().expect(this.tok.T_STRING)){const e=this.node("identifier"),s=this.text();this.next(),t=e(s)}return t},read_use_type:function(){return this.token===this.tok.T_FUNCTION?(this.next(),this.ast.useitem.TYPE_FUNCTION):this.token===this.tok.T_CONST?(this.next(),this.ast.useitem.TYPE_CONST):null}},A,N,{read_switch:function(){const t=this.node("switch");this.expect(this.tok.T_SWITCH)&&this.next(),this.expect("(")&&this.next();const e=this.read_expr();this.expect(")")&&this.next();const s=":"===this.token;return t(e,this.read_switch_case_list(),s)},read_switch_case_list:function(){let t=null;const e=this.node("block"),s=[];for("{"===this.token?t="}":":"===this.token?t=this.tok.T_ENDSWITCH:this.expect(["{",":"]),this.next(),";"===this.token&&this.next();this.token!==this.EOF&&this.token!==t;)s.push(this.read_case_list(t));return 0===s.length&&this.extractDoc&&this._docs.length>this._docIndex&&s.push(this.node("noop")()),this.expect(t)&&this.next(),t===this.tok.T_ENDSWITCH&&this.expectEndOfStatement(),e(null,s)},read_case_list:function(t){const e=this.node("case");let s=null;this.token===this.tok.T_CASE?s=this.next().read_expr():this.token===this.tok.T_DEFAULT?this.next():this.expect([this.tok.T_CASE,this.tok.T_DEFAULT]),this.expect([":",";"])&&this.next();const i=this.node("block"),n=[];for(;this.token!==this.EOF&&this.token!==t&&this.token!==this.tok.T_CASE&&this.token!==this.tok.T_DEFAULT;)n.push(this.read_inner_statement());return e(s,i(null,n))}},{read_try:function(){this.expect(this.tok.T_TRY);const t=this.node("try");let e=null;const s=[],i=this.next().read_statement();for(;this.token===this.tok.T_CATCH;){const t=this.node("catch");this.next().expect("(")&&this.next();const e=this.read_list(this.read_namespace_name,"|",!1);let i=null;(this.version<800||this.token===this.tok.T_VARIABLE)&&(i=this.read_variable(!0,!1)),this.expect(")"),s.push(t(this.next().read_statement(),e,i))}return this.token===this.tok.T_FINALLY&&(e=this.next().read_statement()),t(i,s,e)}},{read_short_form:function(t){const e=this.node("block"),s=[];for(this.expect(":")&&this.next();this.token!=this.EOF&&this.token!==t;)s.push(this.read_inner_statement());return 0===s.length&&this.extractDoc&&this._docs.length>this._docIndex&&s.push(this.node("noop")()),this.expect(t)&&this.next(),this.expectEndOfStatement(),e(null,s)},read_function_list:function(t,e){const s=[];do{if(this.token==e&&this.version>=703&&s.length>0){s.push(this.node("noop")());break}if(s.push(t.apply(this,[])),this.token!=e)break;if(")"==this.next().token&&this.version>=703)break}while(this.token!=this.EOF);return s},read_list:function(t,e,s){const i=[];if(this.token==e&&(s&&i.push("function"==typeof t?this.node("noop")():null),this.next()),"function"==typeof t)do{const s=t.apply(this,[]);if(s&&i.push(s),this.token!=e)break}while(this.next().token!=this.EOF);else{if(!this.expect(t))return[];for(i.push(this.text());this.next().token!=this.EOF&&this.token==e&&this.next().token==t;)i.push(this.text())}return i},read_name_list:function(){return this.read_list(this.read_namespace_name,",",!1)},read_byref:function(t){let e=this.node("byref");this.next(),e=e(null);const s=t();return s&&(this.ast.swapLocations(s,e,s,this),s.byref=!0),s},read_variable_declarations:function(){return this.read_list((function(){const t=this.node("staticvariable");let e=this.node("variable");if(this.expect(this.tok.T_VARIABLE)){const t=this.text().substring(1);this.next(),e=e(t,!1)}else e=e("#ERR",!1);return"="===this.token?t(e,this.next().read_expr()):e}),",")},read_extends_from:function(){return this.token===this.tok.T_EXTENDS?this.next().read_namespace_name():null},read_interface_extends_list:function(){return this.token===this.tok.T_EXTENDS?this.next().read_name_list():null},read_implements_list:function(){return this.token===this.tok.T_IMPLEMENTS?this.next().read_name_list():null}},g].forEach((function(t){for(const e in t){if(Object.prototype.hasOwnProperty.call(I.prototype,e))throw new Error("Function "+e+" is already defined - collision");I.prototype[e]=t[e]}}));var S=I;const O={T_HALT_COMPILER:101,T_USE:102,T_ENCAPSED_AND_WHITESPACE:103,T_OBJECT_OPERATOR:104,T_STRING:105,T_DOLLAR_OPEN_CURLY_BRACES:106,T_STRING_VARNAME:107,T_CURLY_OPEN:108,T_NUM_STRING:109,T_ISSET:110,T_EMPTY:111,T_INCLUDE:112,T_INCLUDE_ONCE:113,T_EVAL:114,T_REQUIRE:115,T_REQUIRE_ONCE:116,T_NAMESPACE:117,T_NS_SEPARATOR:118,T_AS:119,T_IF:120,T_ENDIF:121,T_WHILE:122,T_DO:123,T_FOR:124,T_SWITCH:125,T_BREAK:126,T_CONTINUE:127,T_RETURN:128,T_GLOBAL:129,T_STATIC:130,T_ECHO:131,T_INLINE_HTML:132,T_UNSET:133,T_FOREACH:134,T_DECLARE:135,T_TRY:136,T_THROW:137,T_GOTO:138,T_FINALLY:139,T_CATCH:140,T_ENDDECLARE:141,T_LIST:142,T_CLONE:143,T_PLUS_EQUAL:144,T_MINUS_EQUAL:145,T_MUL_EQUAL:146,T_DIV_EQUAL:147,T_CONCAT_EQUAL:148,T_MOD_EQUAL:149,T_AND_EQUAL:150,T_OR_EQUAL:151,T_XOR_EQUAL:152,T_SL_EQUAL:153,T_SR_EQUAL:154,T_INC:155,T_DEC:156,T_BOOLEAN_OR:157,T_BOOLEAN_AND:158,T_LOGICAL_OR:159,T_LOGICAL_AND:160,T_LOGICAL_XOR:161,T_SL:162,T_SR:163,T_IS_IDENTICAL:164,T_IS_NOT_IDENTICAL:165,T_IS_EQUAL:166,T_IS_NOT_EQUAL:167,T_IS_SMALLER_OR_EQUAL:168,T_IS_GREATER_OR_EQUAL:169,T_INSTANCEOF:170,T_INT_CAST:171,T_DOUBLE_CAST:172,T_STRING_CAST:173,T_ARRAY_CAST:174,T_OBJECT_CAST:175,T_BOOL_CAST:176,T_UNSET_CAST:177,T_EXIT:178,T_PRINT:179,T_YIELD:180,T_YIELD_FROM:181,T_FUNCTION:182,T_DOUBLE_ARROW:183,T_DOUBLE_COLON:184,T_ARRAY:185,T_CALLABLE:186,T_CLASS:187,T_ABSTRACT:188,T_TRAIT:189,T_FINAL:190,T_EXTENDS:191,T_INTERFACE:192,T_IMPLEMENTS:193,T_VAR:194,T_PUBLIC:195,T_PROTECTED:196,T_PRIVATE:197,T_CONST:198,T_NEW:199,T_INSTEADOF:200,T_ELSEIF:201,T_ELSE:202,T_ENDSWITCH:203,T_CASE:204,T_DEFAULT:205,T_ENDFOR:206,T_ENDFOREACH:207,T_ENDWHILE:208,T_CONSTANT_ENCAPSED_STRING:209,T_LNUMBER:210,T_DNUMBER:211,T_LINE:212,T_FILE:213,T_DIR:214,T_TRAIT_C:215,T_METHOD_C:216,T_FUNC_C:217,T_NS_C:218,T_START_HEREDOC:219,T_END_HEREDOC:220,T_CLASS_C:221,T_VARIABLE:222,T_OPEN_TAG:223,T_OPEN_TAG_WITH_ECHO:224,T_CLOSE_TAG:225,T_WHITESPACE:226,T_COMMENT:227,T_DOC_COMMENT:228,T_ELLIPSIS:229,T_COALESCE:230,T_POW:231,T_POW_EQUAL:232,T_SPACESHIP:233,T_COALESCE_EQUAL:234,T_FN:235,T_NULLSAFE_OBJECT_OPERATOR:236,T_MATCH:237,T_ATTRIBUTE:238,T_ENUM:239,T_READ_ONLY:240,T_NAME_RELATIVE:241,T_NAME_QUALIFIED:242,T_NAME_FULLY_QUALIFIED:243},R={values:Object.entries(O).reduce(((t,e)=>{let[s,i]=e;return{...t,[i]:s}}),{}),names:O};var v=Object.freeze(R);var w=function(t,e,s){this.source=t,this.start=e,this.end=s};const D=function(t,e,s){this.kind=t,e&&(this.leadingComments=e),s&&(this.loc=s)};D.prototype.setTrailingComments=function(t){this.trailingComments=t},D.prototype.destroy=function(t){if(!t)throw new Error("Node already initialized, you must swap with another node");return this.leadingComments&&(t.leadingComments?t.leadingComments=Array.concat(this.leadingComments,t.leadingComments):t.leadingComments=this.leadingComments),this.trailingComments&&(t.trailingComments?t.trailingComments=Array.concat(this.trailingComments,t.trailingComments):t.trailingComments=this.trailingComments),t},D.prototype.includeToken=function(t){return this.loc&&(this.loc.end&&(this.loc.end.line=t.lexer.yylloc.last_line,this.loc.end.column=t.lexer.yylloc.last_column,this.loc.end.offset=t.lexer.offset),t.ast.withSource&&(this.loc.source=t.lexer._input.substring(this.loc.start.offset,t.lexer.offset))),this},D.extends=function(t,e){return e.prototype=Object.create(this.prototype),e.extends=this.extends,e.prototype.constructor=e,e.kind=t,e};var U=D;const P=U,F="expression";var M=P.extends(F,(function(t,e,s){P.apply(this,[t||F,e,s])}));const B=M,H="array";var G=B.extends(H,(function(t,e,s,i){B.apply(this,[H,s,i]),this.items=e,this.shortForm=t}));const V=M,Q="arrowfunc";var Y=V.extends(Q,(function(t,e,s,i,n,r,o,h){V.apply(this,[Q,o,h]),this.arguments=t,this.byref=e,this.body=s,this.type=i,this.nullable=n,this.isStatic=r||!1}));const W=M,$="assign";var j=W.extends($,(function(t,e,s,i,n){W.apply(this,[$,i,n]),this.left=t,this.right=e,this.operator=s}));const z=M,K="assignref";var X=z.extends(K,(function(t,e,s,i){z.apply(this,[K,s,i]),this.left=t,this.right=e}));const J=U,q="attribute";var Z=J.extends(q,(function(t,e,s,i){J.apply(this,[q,s,i]),this.name=t,this.args=e}));const tt=U,et="attrgroup";var st=tt.extends(et,(function(t,e,s){tt.apply(this,[et,e,s]),this.attrs=t||[]}));const it=M,nt="operation";var rt=it.extends(nt,(function(t,e,s){it.apply(this,[t||nt,e,s])}));const ot=rt;var ht=ot.extends("bin",(function(t,e,s,i,n){ot.apply(this,["bin",i,n]),this.type=t,this.left=e,this.right=s}));const at=U,ct="statement";var lt=at.extends(ct,(function(t,e,s){at.apply(this,[t||ct,e,s])}));const ut=lt,_t="block";var pt=ut.extends(_t,(function(t,e,s,i){ut.apply(this,[t||_t,s,i]),this.children=e.filter(Boolean)}));const dt=M,ft="literal";var kt=dt.extends(ft,(function(t,e,s,i,n){dt.apply(this,[t||ft,i,n]),this.value=e,s&&(this.raw=s)}));const Tt=kt,xt="boolean";var Et=Tt.extends(xt,(function(t,e,s,i){Tt.apply(this,[xt,t,e,s,i])}));const mt=lt,yt="break";var At=mt.extends(yt,(function(t,e,s){mt.apply(this,[yt,e,s]),this.level=t}));const Nt=M,gt="byref";var Lt=Nt.extends(gt,(function(t,e,s){Nt.apply(this,[gt,e,s]),this.what=t}));const bt=M,It="call";var Ct=bt.extends(It,(function(t,e,s,i){bt.apply(this,[It,s,i]),this.what=t,this.arguments=e}));const St=lt,Ot="case";var Rt=St.extends(Ot,(function(t,e,s,i){St.apply(this,[Ot,s,i]),this.test=t,this.body=e}));const vt=rt,wt="cast";var Dt=vt.extends(wt,(function(t,e,s,i,n){vt.apply(this,[wt,i,n]),this.type=t,this.raw=e,this.expr=s}));const Ut=lt,Pt="catch";var Ft=Ut.extends(Pt,(function(t,e,s,i,n){Ut.apply(this,[Pt,i,n]),this.body=t,this.what=e,this.variable=s}));const Mt=lt,Bt="declaration",Ht=Mt.extends(Bt,(function(t,e,s,i){Mt.apply(this,[t||Bt,s,i]),this.name=e}));Ht.prototype.parseFlags=function(t){this.isAbstract=1===t[2],this.isFinal=2===t[2],this.isReadonly=1===t[3],"class"!==this.kind&&(-1===t[0]?this.visibility="":null===t[0]?this.visibility=null:0===t[0]?this.visibility="public":1===t[0]?this.visibility="protected":2===t[0]&&(this.visibility="private"),this.isStatic=1===t[1])};var Gt=Ht;const Vt=Gt,Qt="class";var Yt=Vt.extends(Qt,(function(t,e,s,i,n,r,o){Vt.apply(this,[Qt,t,r,o]),this.isAnonymous=!t,this.extends=e,this.implements=s,this.body=i,this.attrGroups=[],this.parseFlags(n)}));const Wt=lt,$t="constantstatement";var jt=Wt.extends($t,(function(t,e,s,i){Wt.apply(this,[t||$t,s,i]),this.constants=e}));const zt=jt,Kt="classconstant",Xt=zt.extends(Kt,(function(t,e,s,i,n,r){zt.apply(this,[t||Kt,e,n,r]),this.parseFlags(s),this.attrGroups=i}));Xt.prototype.parseFlags=function(t){-1===t[0]?this.visibility="":null===t[0]?this.visibility=null:0===t[0]?this.visibility="public":1===t[0]?this.visibility="protected":2===t[0]&&(this.visibility="private"),this.final=2===t[2]};var Jt=Xt;const qt=M,Zt="clone";var te=qt.extends(Zt,(function(t,e,s){qt.apply(this,[Zt,e,s]),this.what=t}));const ee=M,se="closure";var ie=ee.extends(se,(function(t,e,s,i,n,r,o,h){ee.apply(this,[se,o,h]),this.uses=s,this.arguments=t,this.byref=e,this.type=i,this.nullable=n,this.isStatic=r||!1,this.body=null,this.attrGroups=[]}));const ne=U;var re=ne.extends("comment",(function(t,e,s,i){ne.apply(this,[t,s,i]),this.value=e}));const oe=re,he="commentblock";var ae=oe.extends(he,(function(t,e,s){oe.apply(this,[he,t,e,s])}));const ce=re,le="commentline";var ue=ce.extends(le,(function(t,e,s){ce.apply(this,[le,t,e,s])}));const _e=U,pe="constant";var de=_e.extends(pe,(function(t,e,s,i){_e.apply(this,[pe,s,i]),this.name=t,this.value=e}));const fe=lt,ke="continue";var Te=fe.extends(ke,(function(t,e,s){fe.apply(this,[ke,e,s]),this.level=t}));const xe=pt,Ee="declare",me=xe.extends(Ee,(function(t,e,s,i,n){xe.apply(this,[Ee,e,i,n]),this.directives=t,this.mode=s}));me.MODE_SHORT="short",me.MODE_BLOCK="block",me.MODE_NONE="none";var ye=me;const Ae=U,Ne="declaredirective";var ge=Ae.extends(Ne,(function(t,e,s,i){Ae.apply(this,[Ne,s,i]),this.key=t,this.value=e}));const Le=lt;var be=Le.extends("do",(function(t,e,s,i){Le.apply(this,["do",s,i]),this.test=t,this.body=e}));const Ie=lt,Ce="echo";var Se=Ie.extends(Ce,(function(t,e,s,i){Ie.apply(this,[Ce,s,i]),this.shortForm=e,this.expressions=t}));const Oe=M,Re="empty";var ve=Oe.extends(Re,(function(t,e,s){Oe.apply(this,[Re,e,s]),this.expression=t}));const we=kt,De="encapsed",Ue=we.extends(De,(function(t,e,s,i,n){we.apply(this,[De,t,e,i,n]),this.type=s}));Ue.TYPE_STRING="string",Ue.TYPE_SHELL="shell",Ue.TYPE_HEREDOC="heredoc",Ue.TYPE_OFFSET="offset";var Pe=Ue;const Fe=M,Me="encapsedpart";var Be=Fe.extends(Me,(function(t,e,s,i,n){Fe.apply(this,[Me,i,n]),this.expression=t,this.syntax=e,this.curly=s}));const He=M,Ge="entry";var Ve=He.extends(Ge,(function(t,e,s,i,n,r){He.apply(this,[Ge,n,r]),this.key=t,this.value=e,this.byRef=s,this.unpack=i}));const Qe=Gt,Ye="enum";var We=Qe.extends(Ye,(function(t,e,s,i,n,r){Qe.apply(this,[Ye,t,n,r]),this.valueType=e,this.implements=s,this.body=i,this.attrGroups=[]}));const $e=U,je="enumcase";var ze=$e.extends(je,(function(t,e,s,i){$e.apply(this,[je,s,i]),this.name=t,this.value=e}));const Ke=U,Xe="error";var Je=Ke.extends(Xe,(function(t,e,s,i,n,r){Ke.apply(this,[Xe,n,r]),this.message=t,this.token=e,this.line=s,this.expected=i}));const qe=M,Ze="eval";var ts=qe.extends(Ze,(function(t,e,s){qe.apply(this,[Ze,e,s]),this.source=t}));const es=M,ss="exit";var is=es.extends(ss,(function(t,e,s,i){es.apply(this,[ss,s,i]),this.expression=t,this.useDie=e}));const ns=lt,rs="expressionstatement";var os=ns.extends(rs,(function(t,e,s){ns.apply(this,[rs,e,s]),this.expression=t}));const hs=lt;var as=hs.extends("for",(function(t,e,s,i,n,r,o){hs.apply(this,["for",r,o]),this.init=t,this.test=e,this.increment=s,this.shortForm=n,this.body=i}));const cs=lt,ls="foreach";var us=cs.extends(ls,(function(t,e,s,i,n,r,o){cs.apply(this,[ls,r,o]),this.source=t,this.key=e,this.value=s,this.shortForm=n,this.body=i}));const _s=Gt,ps="function";var ds=_s.extends(ps,(function(t,e,s,i,n,r,o){_s.apply(this,[ps,t,r,o]),this.arguments=e,this.byref=s,this.type=i,this.nullable=n,this.body=null,this.attrGroups=[]}));const fs=lt,ks="global";var Ts=fs.extends(ks,(function(t,e,s){fs.apply(this,[ks,e,s]),this.items=t}));const xs=lt,Es="goto";var ms=xs.extends(Es,(function(t,e,s){xs.apply(this,[Es,e,s]),this.label=t}));const ys=lt,As="halt";var Ns=ys.extends(As,(function(t,e,s){ys.apply(this,[As,e,s]),this.after=t}));const gs=U,Ls="identifier",bs=gs.extends(Ls,(function(t,e,s){gs.apply(this,[Ls,e,s]),this.name=t}));var Is=bs;const Cs=lt;var Ss=Cs.extends("if",(function(t,e,s,i,n,r){Cs.apply(this,["if",n,r]),this.test=t,this.body=e,this.alternate=s,this.shortForm=i}));const Os=M,Rs="include";var vs=Os.extends(Rs,(function(t,e,s,i,n){Os.apply(this,[Rs,i,n]),this.once=t,this.require=e,this.target=s}));const ws=kt,Ds="inline";var Us=ws.extends(Ds,(function(t,e,s,i){ws.apply(this,[Ds,t,e,s,i])}));const Ps=Gt,Fs="interface";var Ms=Ps.extends(Fs,(function(t,e,s,i,n,r){Ps.apply(this,[Fs,t,n,r]),this.extends=e,this.body=s,this.attrGroups=i}));const Bs=Gt,Hs="intersectiontype";var Gs=Bs.extends(Hs,(function(t,e,s){Bs.apply(this,[Hs,null,e,s]),this.types=t}));const Vs=M,Qs="isset";var Ys=Vs.extends(Qs,(function(t,e,s){Vs.apply(this,[Qs,e,s]),this.variables=t}));const Ws=lt,$s="label";var js=Ws.extends($s,(function(t,e,s){Ws.apply(this,[$s,e,s]),this.name=t}));const zs=M,Ks="list";var Xs=zs.extends(Ks,(function(t,e,s,i){zs.apply(this,[Ks,s,i]),this.items=t,this.shortForm=e}));const Js=M,qs="lookup";var Zs=Js.extends(qs,(function(t,e,s,i,n){Js.apply(this,[t||qs,i,n]),this.what=e,this.offset=s}));const ti=kt,ei="magic";var si=ti.extends(ei,(function(t,e,s,i){ti.apply(this,[ei,t,e,s,i])}));const ii=M,ni="match";var ri=ii.extends(ni,(function(t,e,s,i){ii.apply(this,[ni,s,i]),this.cond=t,this.arms=e}));const oi=M,hi="matcharm";var ai=oi.extends(hi,(function(t,e,s,i){oi.apply(this,[hi,s,i]),this.conds=t,this.body=e}));const ci=ds,li="method";var ui=ci.extends(li,(function(){ci.apply(this,arguments),this.kind=li}));const _i=U,pi="reference",di=_i.extends(pi,(function(t,e,s){_i.apply(this,[t||pi,e,s])}));var fi=di;const ki=fi,Ti="name",xi=ki.extends(Ti,(function(t,e,s,i){ki.apply(this,[Ti,s,i]),this.name=t.replace(/\\$/,""),this.resolution=e}));xi.UNQUALIFIED_NAME="uqn",xi.QUALIFIED_NAME="qn",xi.FULL_QUALIFIED_NAME="fqn",xi.RELATIVE_NAME="rn";var Ei=xi;const mi=pt,yi="namespace";var Ai=mi.extends(yi,(function(t,e,s,i,n){mi.apply(this,[yi,e,i,n]),this.name=t,this.withBrackets=s||!1}));const Ni=M,gi="namedargument";var Li=Ni.extends(gi,(function(t,e,s,i){Ni.apply(this,[gi,s,i]),this.name=t,this.value=e}));const bi=M;var Ii=bi.extends("new",(function(t,e,s,i){bi.apply(this,["new",s,i]),this.what=t,this.arguments=e}));const Ci=U,Si="noop";var Oi=Ci.extends(Si,(function(t,e){Ci.apply(this,[Si,t,e])}));const Ri=kt,vi="nowdoc";var wi=Ri.extends(vi,(function(t,e,s,i,n){Ri.apply(this,[vi,t,e,i,n]),this.label=s}));const Di=U,Ui="nullkeyword";var Pi=Di.extends(Ui,(function(t,e,s){Di.apply(this,[Ui,e,s]),this.raw=t}));const Fi=Zs,Mi="nullsafepropertylookup";var Bi=Fi.extends(Mi,(function(t,e,s,i){Fi.apply(this,[Mi,t,e,s,i])}));const Hi=kt,Gi="number";var Vi=Hi.extends(Gi,(function(t,e,s,i){Hi.apply(this,[Gi,t,e,s,i])}));const Qi=Zs,Yi="offsetlookup";var Wi=Qi.extends(Yi,(function(t,e,s,i){Qi.apply(this,[Yi,t,e,s,i])}));const $i=Gt,ji="parameter";var zi=$i.extends(ji,(function(t,e,s,i,n,r,o,h,a,c){$i.apply(this,[ji,t,a,c]),this.value=s,this.type=e,this.byref=i,this.variadic=n,this.readonly=r,this.nullable=o,this.flags=h||0,this.attrGroups=[]}));const Ki=fi,Xi="parentreference",Ji=Ki.extends(Xi,(function(t,e,s){Ki.apply(this,[Xi,e,s]),this.raw=t}));var qi=Ji;const Zi=rt,tn="post";var en=Zi.extends(tn,(function(t,e,s,i){Zi.apply(this,[tn,s,i]),this.type=t,this.what=e}));const sn=rt;var nn=sn.extends("pre",(function(t,e,s,i){sn.apply(this,["pre",s,i]),this.type=t,this.what=e}));const rn=M,on="print";var hn=rn.extends(on,(function(t,e,s){rn.apply(this,[on,e,s]),this.expression=t}));const an=pt,cn="program";var ln=an.extends(cn,(function(t,e,s,i,n,r){an.apply(this,[cn,t,n,r]),this.errors=e,s&&(this.comments=s),i&&(this.tokens=i)}));const un=lt,_n="property";var pn=un.extends(_n,(function(t,e,s,i,n,r,o,h){un.apply(this,[_n,o,h]),this.name=t,this.value=e,this.readonly=s,this.nullable=i,this.type=n,this.attrGroups=r}));const dn=Zs,fn="propertylookup";var kn=dn.extends(fn,(function(t,e,s,i){dn.apply(this,[fn,t,e,s,i])}));const Tn=lt,xn="propertystatement",En=Tn.extends(xn,(function(t,e,s,i,n){Tn.apply(this,[xn,i,n]),this.properties=e,this.parseFlags(s)}));En.prototype.parseFlags=function(t){-1===t[0]?this.visibility="":null===t[0]?this.visibility=null:0===t[0]?this.visibility="public":1===t[0]?this.visibility="protected":2===t[0]&&(this.visibility="private"),this.isStatic=1===t[1]};var mn=En;const yn=M,An="retif";var Nn=yn.extends(An,(function(t,e,s,i,n){yn.apply(this,[An,i,n]),this.test=t,this.trueExpr=e,this.falseExpr=s}));const gn=lt,Ln="return";var bn=gn.extends(Ln,(function(t,e,s){gn.apply(this,[Ln,e,s]),this.expr=t}));const In=fi,Cn="selfreference",Sn=In.extends(Cn,(function(t,e,s){In.apply(this,[Cn,e,s]),this.raw=t}));var On=Sn;const Rn=M,vn="silent";var wn=Rn.extends(vn,(function(t,e,s){Rn.apply(this,[vn,e,s]),this.expr=t}));const Dn=lt,Un="static";var Pn=Dn.extends(Un,(function(t,e,s){Dn.apply(this,[Un,e,s]),this.variables=t}));const Fn=U,Mn="staticvariable";var Bn=Fn.extends(Mn,(function(t,e,s,i){Fn.apply(this,[Mn,s,i]),this.variable=t,this.defaultValue=e}));const Hn=Zs,Gn="staticlookup";var Vn=Hn.extends(Gn,(function(t,e,s,i){Hn.apply(this,[Gn,t,e,s,i])}));const Qn=fi,Yn="staticreference",Wn=Qn.extends(Yn,(function(t,e,s){Qn.apply(this,[Yn,e,s]),this.raw=t}));var $n=Wn;const jn=kt,zn="string";var Kn=jn.extends(zn,(function(t,e,s,i,n,r){jn.apply(this,[zn,e,i,n,r]),this.unicode=s,this.isDoubleQuote=t}));const Xn=lt,Jn="switch";var qn=Xn.extends(Jn,(function(t,e,s,i,n){Xn.apply(this,[Jn,i,n]),this.test=t,this.body=e,this.shortForm=s}));const Zn=lt,tr="throw";var er=Zn.extends(tr,(function(t,e,s){Zn.apply(this,[tr,e,s]),this.what=t}));const sr=Gt,ir="trait";var nr=sr.extends(ir,(function(t,e,s,i){sr.apply(this,[ir,t,s,i]),this.body=e}));const rr=U,or="traitalias";var hr=rr.extends(or,(function(t,e,s,i,n,r){rr.apply(this,[or,n,r]),this.trait=t,this.method=e,this.as=s,this.visibility="",i&&(0===i[0]?this.visibility="public":1===i[0]?this.visibility="protected":2===i[0]&&(this.visibility="private"))}));const ar=U,cr="traitprecedence";var lr=ar.extends(cr,(function(t,e,s,i,n){ar.apply(this,[cr,i,n]),this.trait=t,this.method=e,this.instead=s}));const ur=U,_r="traituse";var pr=ur.extends(_r,(function(t,e,s,i){ur.apply(this,[_r,s,i]),this.traits=t,this.adaptations=e}));const dr=lt;var fr=dr.extends("try",(function(t,e,s,i,n){dr.apply(this,["try",i,n]),this.body=t,this.catches=e,this.always=s}));const kr=fi,Tr="typereference",xr=kr.extends(Tr,(function(t,e,s,i){kr.apply(this,[Tr,s,i]),this.name=t,this.raw=e}));xr.types=["int","float","string","bool","object","array","callable","iterable","void","static"];var Er=xr;const mr=rt,yr="unary";var Ar=mr.extends(yr,(function(t,e,s,i){mr.apply(this,[yr,s,i]),this.type=t,this.what=e}));const Nr=Gt,gr="uniontype";var Lr=Nr.extends(gr,(function(t,e,s){Nr.apply(this,[gr,null,e,s]),this.types=t}));const br=lt,Ir="unset";var Cr=br.extends(Ir,(function(t,e,s){br.apply(this,[Ir,e,s]),this.variables=t}));const Sr=lt,Or="usegroup";var Rr=Sr.extends(Or,(function(t,e,s,i,n){Sr.apply(this,[Or,i,n]),this.name=t,this.type=e,this.items=s}));const vr=lt,wr="useitem",Dr=vr.extends(wr,(function(t,e,s,i,n){vr.apply(this,[wr,i,n]),this.name=t,this.alias=e,this.type=s}));Dr.TYPE_CONST="const",Dr.TYPE_FUNCTION="function";var Ur=Dr;const Pr=M,Fr="variable";var Mr=Pr.extends(Fr,(function(t,e,s,i){Pr.apply(this,[Fr,s,i]),this.name=t,this.curly=e||!1}));const Br=M,Hr="variadic";var Gr=Br.extends(Hr,(function(t,e,s){Br.apply(this,[Hr,e,s]),this.what=t}));const Vr=U,Qr="variadicplaceholder";var Yr=Vr.extends(Qr,(function(t,e){Vr.apply(this,[Qr,t,e])}));const Wr=lt,$r="while";var jr=Wr.extends($r,(function(t,e,s,i,n){Wr.apply(this,[$r,i,n]),this.test=t,this.body=e,this.shortForm=s}));const zr=M,Kr="yield";var Xr=zr.extends(Kr,(function(t,e,s,i){zr.apply(this,[Kr,s,i]),this.value=t,this.key=e}));const Jr=M,qr="yieldfrom";var Zr=Jr.extends(qr,(function(t,e,s){Jr.apply(this,[qr,e,s]),this.value=t}));const to=w,eo=x,so=function(t,e){this.withPositions=t,this.withSource=e};so.precedence={},[["or"],["xor"],["and"],["="],["?"],["??"],["||"],["&&"],["|"],["^"],["&"],["==","!=","===","!==","<=>"],["<","<=",">",">="],["<<",">>"],["+","-","."],["*","/","%"],["!"],["instanceof"],["cast","silent"],["**"]].forEach((function(t,e){t.forEach((function(t){so.precedence[t]=e+1}))})),so.prototype.isRightAssociative=function(t){return"**"===t||"??"===t},so.prototype.swapLocations=function(t,e,s,i){this.withPositions&&(t.loc.start=e.loc.start,t.loc.end=s.loc.end,this.withSource&&(t.loc.source=i.lexer._input.substring(t.loc.start.offset,t.loc.end.offset)))},so.prototype.resolveLocations=function(t,e,s,i){this.withPositions&&(t.loc.start.offset>e.loc.start.offset&&(t.loc.start=e.loc.start),t.loc.end.offset<s.loc.end.offset&&(t.loc.end=s.loc.end),this.withSource&&(t.loc.source=i.lexer._input.substring(t.loc.start.offset,t.loc.end.offset)))},so.prototype.resolvePrecedence=function(t,e){let s,i,n;return"call"===t.kind?this.resolveLocations(t,t.what,t,e):"propertylookup"===t.kind||"staticlookup"===t.kind||"offsetlookup"===t.kind&&t.offset?this.resolveLocations(t,t.what,t.offset,e):"bin"===t.kind?t.right&&!t.right.parenthesizedExpression&&("bin"===t.right.kind?(i=so.precedence[t.type],n=so.precedence[t.right.type],i&&n&&n<=i&&(t.type!==t.right.type||!this.isRightAssociative(t.type))&&(s=t.right,t.right=t.right.left,this.swapLocations(t,t.left,t.right,e),s.left=this.resolvePrecedence(t,e),this.swapLocations(s,s.left,s.right,e),t=s)):"retif"===t.right.kind&&(i=so.precedence[t.type],n=so.precedence["?"],i&&n&&n<=i&&(s=t.right,t.right=t.right.test,this.swapLocations(t,t.left,t.right,e),s.test=this.resolvePrecedence(t,e),this.swapLocations(s,s.test,s.falseExpr,e),t=s))):"silent"!==t.kind&&"cast"!==t.kind||!t.expr||t.expr.parenthesizedExpression?"unary"===t.kind?t.what&&!t.what.parenthesizedExpression&&("bin"===t.what.kind?(s=t.what,t.what=t.what.left,this.swapLocations(t,t,t.what,e),s.left=this.resolvePrecedence(t,e),this.swapLocations(s,s.left,s.right,e),t=s):"retif"===t.what.kind&&(s=t.what,t.what=t.what.test,this.swapLocations(t,t,t.what,e),s.test=this.resolvePrecedence(t,e),this.swapLocations(s,s.test,s.falseExpr,e),t=s)):"retif"===t.kind?t.falseExpr&&"retif"===t.falseExpr.kind&&!t.falseExpr.parenthesizedExpression&&(s=t.falseExpr,t.falseExpr=s.test,this.swapLocations(t,t.test,t.falseExpr,e),s.test=this.resolvePrecedence(t,e),this.swapLocations(s,s.test,s.falseExpr,e),t=s):"assign"===t.kind?t.right&&"bin"===t.right.kind&&!t.right.parenthesizedExpression&&(i=so.precedence["="],n=so.precedence[t.right.type],i&&n&&n<i&&(s=t.right,t.right=t.right.left,s.left=t,this.swapLocations(s,s.left,t.right,e),t=s)):"expressionstatement"===t.kind&&this.swapLocations(t,t.expression,t,e):"bin"===t.expr.kind?(s=t.expr,t.expr=t.expr.left,this.swapLocations(t,t,t.expr,e),s.left=this.resolvePrecedence(t,e),this.swapLocations(s,s.left,s.right,e),t=s):"retif"===t.expr.kind&&(s=t.expr,t.expr=t.expr.test,this.swapLocations(t,t,t.expr,e),s.test=this.resolvePrecedence(t,e),this.swapLocations(s,s.test,s.falseExpr,e),t=s),t},so.prototype.prepare=function(t,e,s){let i=null;(this.withPositions||this.withSource)&&(i=s.position());const n=this,r=function(){let o=null;const h=Array.prototype.slice.call(arguments);if(h.push(e),n.withPositions||n.withSource){let t=null;n.withSource&&(t=s.lexer._input.substring(i.offset,s.prev[2])),o=new to(t,i,new eo(s.prev[0],s.prev[1],s.prev[2])),h.push(o)}t||(t=h.shift());const a=n[t];if("function"!=typeof a)throw new Error('Undefined node "'+t+'"');const c=Object.create(a.prototype);return a.apply(c,h),r.instance=c,r.trailingComments&&(c.trailingComments=r.trailingComments),"function"==typeof r.postBuild&&r.postBuild(c),s.debug&&delete n.stack[r.stackUid],n.resolvePrecedence(c,s)};return s.debug&&(this.stack||(this.stack={},this.stackUid=1),this.stack[++this.stackUid]={position:i,stack:(new Error).stack.split("\n").slice(3,5)},r.stackUid=this.stackUid),r.setTrailingComments=function(t){r.instance?r.instance.setTrailingComments(t):r.trailingComments=t},r.destroy=function(t){e&&(t?t.leadingComments?t.leadingComments=e.concat(t.leadingComments):t.leadingComments=e:s._docIndex=s._docs.length-e.length),s.debug&&delete n.stack[r.stackUid]},r},so.prototype.checkNodes=function(){const t=[];for(const e in this.stack)Object.prototype.hasOwnProperty.call(this.stack,e)&&(this.stack[e].key=e,t.push(this.stack[e]));return this.stack={},t},[G,Y,j,X,Z,st,ht,pt,Et,At,Lt,Ct,Rt,Dt,Ft,Yt,Jt,te,ie,re,ae,ue,de,jt,Te,Gt,ye,ge,be,Se,ve,Pe,Be,Ve,We,ze,Je,ts,is,M,os,as,us,ds,Ts,ms,Ns,Is,Ss,vs,Us,Ms,Gs,Ys,js,Xs,kt,Zs,si,ri,ai,ui,Ei,Ai,Li,Ii,U,Oi,wi,Pi,Bi,Vi,Wi,rt,zi,qi,en,nn,hn,ln,pn,kn,mn,fi,Nn,bn,On,wn,lt,Pn,Bn,Vn,$n,Kn,qn,er,nr,hr,lr,pr,fr,Er,Ar,Lr,Cr,Rr,Ur,Mr,Gr,Yr,jr,Xr,Zr].forEach((function(t){so.prototype[t.kind]=t}));const io=T,no=S,ro=v,oo=so;function ho(t,e){const s=Object.keys(t);let i=s.length;for(;i--;){const n=s[i],r=t[n];null===r?delete e[n]:"function"==typeof r?e[n]=r.bind(e):Array.isArray(r)?e[n]=Array.isArray(e[n])?e[n].concat(r):r:e[n]="object"==typeof r&&"object"==typeof e[n]?ho(r,e[n]):r}return e}const ao=function(t){if("function"==typeof this)return new this(t);if(this.tokens=ro,this.lexer=new io(this),this.ast=new oo,this.parser=new no(this.lexer,this.ast),t&&"object"==typeof t){if(t.parser&&(t.lexer||(t.lexer={}),t.parser.version)){if("string"==typeof t.parser.version){let e=t.parser.version.split(".");if(e=100*parseInt(e[0])+parseInt(e[1]),isNaN(e))throw new Error("Bad version number : "+t.parser.version);t.parser.version=e}else if("number"!=typeof t.parser.version)throw new Error("Expecting a number for version");if(t.parser.version<500||t.parser.version>900)throw new Error("Can only handle versions between 5.x to 8.x")}ho(t,this),this.lexer.version=this.parser.version}},co=function(t){return"function"==typeof t.write?t.toString():t};ao.create=function(t){return new ao(t)},ao.parseEval=function(t,e){return new ao(e).parseEval(t)},ao.prototype.parseEval=function(t){return this.lexer.mode_eval=!0,this.lexer.all_tokens=!1,t=co(t),this.parser.parse(t,"eval")},ao.parseCode=function(t,e,s){"object"!=typeof e||s||(s=e,e="unknown");return new ao(s).parseCode(t,e)},ao.prototype.parseCode=function(t,e){return this.lexer.mode_eval=!1,this.lexer.all_tokens=!1,t=co(t),this.parser.parse(t,e)},ao.tokenGetAll=function(t,e){return new ao(e).tokenGetAll(t)},ao.prototype.tokenGetAll=function(t){this.lexer.mode_eval=!1,this.lexer.all_tokens=!0,t=co(t);const e=this.lexer.EOF,s=this.tokens.values;this.lexer.setInput(t);let i=this.lexer.lex()||e;const n=[];for(;i!=e;){let t=this.lexer.yytext;Object.prototype.hasOwnProperty.call(s,i)&&(t=[s[i],t,this.lexer.yylloc.first_line]),n.push(t),i=this.lexer.lex()||e}return n},o.exports=ao,o.exports.tokens=ro,o.exports.lexer=io,o.exports.AST=oo,o.exports.parser=no,o.exports.combine=ho,o.exports.Engine=ao,o.exports.default=ao;var lo=i(o.exports);function uo(t,e){const s=e&&"markdown"===e.parentParser;if(!t&&s)return"";t=t.replace(/\?>\n<\?/g,"?>\n___PSEUDO_INLINE_PLACEHOLDER___<?");const i=new lo({parser:{extractDoc:!0},ast:{withPositions:!0,withSource:!0}}),n=-1!==t.indexOf("<?php"),r=s&&!n;let o;try{o=r?i.parseEval(t):i.parseCode(t)}catch(t){throw t instanceof SyntaxError&&"lineNumber"in t&&(t.loc={start:{line:t.lineNumber,column:t.columnNumber}},delete t.lineNumber,delete t.columnNumber),t}return o.extra={parseAsEval:r},o.comments.forEach((t=>{"\n"===t.value[t.value.length-1]&&(t.value=t.value.slice(0,-1),t.loc.end.offset=t.loc.end.offset-1)})),o}const _o=t=>e=>e.loc?.[t]?.offset,po=_o("start"),fo=_o("end"),{hasNewline:ko,skipEverythingButNewLine:To,skipNewline:xo}=e.util;function Eo(t){return t.toLowerCase().replace(/^([+-]?[\d.]+e)(?:\+|(-))?0*(\d)/,"$1$2$3").replace(/^([+-]?[\d.]+)e[+-]?0+$/,"$1").replace(/^([+-])?\./,"$10.").replace(/(\.\d+?)0+(?=e|$)/,"$1").replace(/\.(?=e)/,"")}const mo=new Map([["or"],["xor"],["and"],["=","+=","-=","*=","**=","/=",".=","%=","&=","|=","^=","<<=",">>="],["??"],["||"],["&&"],["|"],["^"],["&"],["==","===","!=","!==","<>","<=>"],["<",">","<=",">="],[">>","<<"],["+","-","."],["*","/","%"],["!"],["instanceof"],["++","--","~"],["**"]].flatMap(((t,e)=>t.map((t=>[t,e])))));function yo(t){return mo.get(t)}const Ao=["==","!=","===","!==","<>","<=>"],No=["*","/","%"],go=[">>","<<"];function Lo(t,e){return yo(e)===yo(t)&&("**"!==t&&((!Ao.includes(t)||!Ao.includes(e))&&(!("%"===e&&No.includes(t)||"%"===t&&No.includes(e))&&((e===t||!No.includes(e)||!No.includes(t))&&(!go.includes(t)||!go.includes(e))))))}function bo(t){const e=t.children||t.body||t.adaptations;return Array.isArray(e)?e:null}function Io(t){return t.length>0?t[t.length-1]:null}function Co(t){const{node:e}=t;if("program"===e.kind){const t=bo(e);return!(!t||0===t.length)&&"inline"===t[0].kind}if("switch"===e.kind){if(!e.body)return!1;const t=bo(e.body);if(0===t.length)return!1;const[s]=t;if(!s.body)return!1;const i=bo(s.body);return 0!==i.length&&"inline"===i[0].kind}const s=function(t){let{body:e}=t;return e?("block"===e.kind&&(e=e.children),e[0]):null}(e);return!!s&&"inline"===s.kind}function So(t){return"nowdoc"===t.kind||"encapsed"===t.kind&&"heredoc"===t.type}function Oo(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const s=t.getNode(e),i=t.getNode(e+1),n=t.getNode(e+2);if(!i)return!1;if(n&&["call","new","echo"].includes(n.kind)&&!["call","array"].includes(i.kind)||"parameter"===i.kind){const t=n.arguments.length-1;return n.arguments.indexOf(i)!==t}if(n&&"for"===n.kind){const t=n.init.indexOf(i);if(-1!==t)return t!==n.init.length-1;const e=n.test.indexOf(i);if(-1!==e)return e!==n.test.length-1;const s=n.increment.indexOf(i);if(-1!==s)return s!==n.increment.length-1}if("bin"===i.kind)return i.left===s||Oo(t,e+1);if("case"===i.kind&&i.test===s)return!0;if("staticvariable"===i.kind){const t=n.variables.length-1;return n.variables.indexOf(i)!==t}if("entry"===i.kind){if(i.key===s)return!0;const t=n.items.length-1;return n.items.indexOf(i)!==t}if(["call","new"].includes(i.kind)){const t=i.arguments.length-1;return i.arguments.indexOf(s)!==t}if("echo"===i.kind){const t=i.expressions.length-1;return i.expressions.indexOf(s)!==t}if("array"===i.kind){const t=i.items.length-1;return i.items.indexOf(s)!==t}return"retif"===i.kind&&Oo(t,e+1)}function Ro(t){const e=t.replace(/^\\/,"");return-1!==e.indexOf("\\")?e:t}function vo(t){return t.comments&&t.comments.some((t=>!t.leading&&!t.trailing))}function wo(t){return"propertylookup"===t.kind||"nullsafepropertylookup"===t.kind||"staticlookup"===t.kind||"offsetlookup"===t.kind}function Do(t){const{node:e}=t;return!["try","catch"].includes(e.kind)&&Co(t)}function Uo(t){const{node:e}=t;if(["try","catch"].includes(e.kind))return!0;if("switch"===e.kind){const t=bo(e.body);if(0===t.length)return!0;const s=Io(t);if(!s.body)return!0;const i=bo(s.body);return 0===i.length||"inline"!==i[0].kind}return!Co(t)}function Po(t){return["program","declare","namespace"].includes(t.kind)}function Fo(t){return["name","parentreference","selfreference","staticreference"].includes(t.kind)}function Mo(t){return"bin"===t.kind&&["||","&&"].includes(t.type)?"logical":t.kind}function Bo(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"body";const{node:s}=t;return s[e]&&s[e].children&&0===s[e].children.length&&(!s[e].comments||0===s[e].comments.length)}function Ho(t,e){let s=po(e);return s=To(t,s),s=xo(t,s),ko(t,s)}function Go(t){return"nowdoc"===t.kind||"encapsed"===t.kind&&"heredoc"===t.type||"entry"===t.kind&&("nowdoc"===t.value.kind||"encapsed"===t.value.kind&&"heredoc"===t.value.type)}function Vo(t,e){const s=function(t,e){const s=[].concat(e);let i,n=-1;for(;i=t.getParentNode(++n);)if(-1!==s.indexOf(i.kind))return n;return-1}(t,e);return-1===s?null:t.getParentNode(s)}const Qo=new Map(["__construct","__destruct","__call","__callStatic","__get","__set","__isset","__unset","__sleep","__wakeup","__toString","__invoke","__set_state","__clone","__debugInfo"].map((t=>[t.toLowerCase(),t])));function Yo(t){const e=t.toLowerCase();return Qo.has(e)?Qo.get(e):t}const{addLeadingComment:Wo,addDanglingComment:$o,addTrailingComment:jo,skipNewline:zo,hasNewline:Ko,hasNewlineInRange:Xo,getNextNonSpaceNonCommentCharacterIndex:Jo,isNextLineEmpty:qo,isPreviousLineEmpty:Zo}=e.util,{join:th,indent:eh,hardline:sh,cursor:ih,lineSuffix:nh,breakParent:rh}=e.doc.builders;function oh(t,e){const{children:s}=t;0===s.length?$o(t,e):Wo(s[0],e)}function hh(t,e){"block"===t.kind?oh(t,e):Wo(t,e)}function ah(t,e,s,i,n){const r=Jo(t,fo(n)),o=t.charAt(r);return e&&"identifier"===e.kind&&s&&("function"===s.kind||"method"===s.kind)&&")"===o?(jo(s,n),!0):!(!s||"function"!==s.kind&&"method"!==s.kind||!i||"block"!==i.kind)&&(oh(i,n),!0)}function ch(t,e,s,i,n){if(!s||"if"!==s.kind||!i)return!1;const r=Jo(t,fo(n));return")"===t.charAt(r)?(jo(e,n),!0):e===s.body&&i===s.alternate?($o(s,n),!0):"if"===i.kind?(hh(i.body,n),!0):s.body===i&&(Wo(i,n),!0)}function lh(t,e,s){if(t&&["class","interface","trait"].includes(t.kind)){if(t.__parent_new_arguments?.includes(e))return!1;if(e&&t.extends)if(Array.isArray(t.extends)){if(t.extends.some((t=>{if(e&&e===t)return $o(e,s),!0})))return!0}else if(e===t.extends)return $o(e,s),!0;if(e&&t.implements&&t.implements.some((t=>{if(e&&e===t)return $o(e,s),!0})))return!0;if(!(t.body&&t.body.length>0))return $o(t,s),!0}return!!(e&&"class"===e.kind&&e.isAnonymous&&e.leadingComments&&"commentblock"===s.kind)}function uh(t,e,s,i){if(e&&("function"===e.kind||"method"===e.kind)){let s=0;for(let t=0;t<e.arguments.length;t++)s=fo(e.arguments[t])>s?fo(e.arguments[t]):s;const n=e.body&&po(i)>s&&fo(i)<po(e.body),r=Jo(t,fo(i));if(e.type&&n&&")"!==t.charAt(r))return fo(i)<po(e.type)?($o(e.type,i),!0):(jo(e.type,i),!0)}return!1}function _h(t,e,s,i,n){return!(!s||!["function","method","parameter"].includes(s.kind))&&("typereference"===e.kind&&"identifier"===i.kind&&(jo(e,n),!0))}function ph(t,e){return!(!t||!["label","goto"].includes(t.kind))&&(jo(t,e),!0)}function dh(t,e,s,i){return s&&"inline"===s.kind?(s.leadingComments||(s.leadingComments=[]),s.leadingComments.includes(i)||s.leadingComments.push(i),!0):!(t||s||!e||"inline"!==e.kind)&&($o(e,i),!0)}function fh(t,e,s){return!(!t||"try"!==t.kind||!e)&&("block"===e.kind?(oh(e,s),!0):"try"===e.kind?(hh(e.always,s),!0):"catch"===e.kind&&(hh(e.body,s),!0))}function kh(t,e,s,i){return s||e||!t||"namespace"!==t.kind||t.withBrackets?!(e||!t||"namespace"!==t.kind||t.withBrackets)&&($o(t,i),!0):(jo(t,i),!0)}function Th(t,e,s,i){return!(!t||"declare"!==t.kind)&&((!e||"noop"!==e.kind)&&(s&&t.directives[0]!==s?!(!s||!e)&&(Wo(s,i),!0):("none"===t.mode?jo(t,i):$o(t,i),!0)))}function xh(t,e,s,i,n){if(!s||"while"!==s.kind||!i)return!1;const r=Jo(t,fo(n));return")"===t.charAt(r)?(jo(e,n),!0):"block"===i.kind&&(oh(i,n),!0)}function Eh(t,e){return t.node.printed=!0,e.printer.printComment(t,e)}function mh(t,e,s,i){const n=[],r=t.getValue();return r&&r.comments?(t.each((()=>{const s=t.node;!s||s.leading||s.trailing||i&&!i(s)||n.push(Eh(t,e))}),"comments"),0===n.length?"":s?th(sh,n):eh([sh,th(sh,n)])):""}function yh(t){return t.comments&&t.comments.some((t=>t.leading))}function Ah(t){return t.comments&&t.comments.some((t=>t.trailing))}function Nh(t,e){const s=[];return t.forEach(((t,i,n)=>{t.printed=!0;const r=n.length===i+1;s.push(t.value),r||s.push(sh),qo(e.originalText,fo(t))&&!r&&s.push(sh)})),s}function gh(t){return"commentblock"===t.kind}function Lh(t,e,s){const{node:i}=t;return i&&i===e.cursorNode?[ih,s,ih]:s}function bh(t,e,s,i){const{node:n}=t,r=e(t),o=n&&n.comments;if(!o||0===o.length)return Lh(t,s,r);const h=[],a=[i?";":"",r];return t.each((e=>{let{node:i}=e;const{leading:n,trailing:r}=i;if(n){const e=function(t,e,s){const i=Eh(t,s);if(!i)return"";const n=t.node;return s.printer.isBlockComment&&s.printer.isBlockComment(n)?[i,Ko(s.originalText,fo(n))?sh:" "]:[i,sh]}(t,0,s);if(!e)return;h.push(e);const n=s.originalText;Ko(n,zo(n,fo(i)))&&h.push(sh)}else r&&a.push(function(t,e,s){const i=Eh(t,s);if(!i)return"";const n=t.node,r=s.printer.isBlockComment&&s.printer.isBlockComment(n);if(Ko(s.originalText,po(n),{backwards:!0})){const t=Zo(s.originalText,po(n));return nh([sh,t?sh:"",i])}return r?[" ",i]:[nh([" ",i]),r?"":rh]}(t,0,s))}),"comments"),Lh(t,s,h.concat(a))}function Ih(t){const{parent:e}=t;if(!e)return!1;const{key:s,node:i}=t;if(["program","expressionstatement","namespace","declare","block","include","print","return","echo"].includes(e.kind))return!1;switch(i.kind){case"pre":case"post":if("unary"===e.kind)return"pre"===i.kind&&("+"===i.type&&"+"===e.type||"-"===i.type&&"-"===e.type);case"unary":switch(e.kind){case"unary":return i.type===e.type&&("+"===i.type||"-"===i.type);case"propertylookup":case"nullsafepropertylookup":case"staticlookup":case"offsetlookup":case"call":return"what"===s;case"bin":return"**"===e.type&&"left"===s;default:return!1}case"bin":switch(e.kind){case"assign":case"retif":return["and","xor","or"].includes(i.type);case"silent":case"cast":return i.parenthesizedExpression;case"pre":case"post":case"unary":return!0;case"call":case"propertylookup":case"nullsafepropertylookup":case"staticlookup":case"offsetlookup":return"what"===s;case"bin":{const t=e.type,r=yo(t),o=i.type,h=yo(o);return r>h||("||"===t&&"&&"===o||(r===h&&"right"===s||(r===h&&!Lo(t,o)||(r<h&&"%"===o?"+"===t||"-"===t:!(!go[n=t]&&"|"!==n&&"^"!==n&&"&"!==n)))))}default:return!1}case"propertylookup":case"nullsafepropertylookup":case"staticlookup":return"call"===e.kind&&("what"===s&&i.parenthesizedExpression);case"clone":case"new":switch(e.kind){case"propertylookup":case"nullsafepropertylookup":case"staticlookup":case"offsetlookup":case"call":return"what"===s;default:return!1}case"yield":switch(e.kind){case"propertylookup":case"nullsafepropertylookup":case"staticlookup":case"offsetlookup":case"call":return"what"===s;case"retif":return"test"===s;default:return!(!i.key&&!i.value)}case"assign":return("for"!==e.kind||!e.init.includes(i)&&!e.increment.includes(i))&&("assign"!==e.kind&&("static"!==e.kind&&(!["if","do","while","foreach","switch"].includes(e.kind)&&("silent"!==e.kind&&"call"!==e.kind))));case"retif":switch(e.kind){case"cast":return!0;case"unary":case"bin":case"retif":return!("test"===s&&!e.trueExpr);case"propertylookup":case"nullsafepropertylookup":case"staticlookup":case"offsetlookup":case"call":return"what"===s;default:return!1}case"closure":switch(e.kind){case"call":return"what"===s;case"propertylookup":case"nullsafepropertylookup":return!0;default:return!1}case"silence":case"cast":return i.parenthesizedExpression;case"string":case"array":switch(e.kind){case"propertylookup":case"nullsafepropertylookup":case"staticlookup":case"offsetlookup":case"call":return(!["string","array"].includes(i.kind)||"offsetlookup"!==e.kind)&&"what"===s;default:return!1}case"print":case"include":return"bin"===e.kind}var n;return!1}const{breakParent:Ch,join:Sh,line:Oh,lineSuffix:Rh,group:vh,conditionalGroup:wh,indent:Dh,dedent:Uh,ifBreak:Ph,hardline:Fh,softline:Mh,literalline:Bh,align:Hh,dedentToRoot:Gh}=e.doc.builders,{willBreak:Vh}=e.doc.utils,{isNextLineEmptyAfterIndex:Qh,hasNewline:Yh,hasNewlineInRange:Wh,getNextNonSpaceNonCommentCharacterIndex:$h,isNextLineEmpty:jh,isPreviousLineEmpty:zh}=e.util;function Kh(t,e){return parseFloat(t)>=parseFloat(e)}function Xh(t,e){return!!t.trailingCommaPHP&&Kh(t.phpVersion,e)}function Jh(t){return"1tbs"!==t.braceStyle}function qh(t,e,s){return[arguments.length>3&&void 0!==arguments[3]&&arguments[3]?"?":"","->",s("offset")]}function Zh(t,e,s){return qh(t,e,s,!0)}function ta(t,e,s){const{node:i}=t,n=!["variable","identifier"].includes(i.offset.kind);return["::",n?"{":"",s("offset"),n?"}":""]}function ea(t,e,s){const{node:i}=t,n=i.offset&&"number"===i.offset.kind||Vo(t,"encapsed");return["[",i.offset?vh([Dh([n?"":Mh,s("offset")]),n?"":Mh]):"","]"]}function sa(t){return"array"===t.kind&&(t.items.length>0||t.comments)||"function"===t.kind||"method"===t.kind||"closure"===t.kind}function ia(t,e,s){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"arguments";const n=t.node[i];if(0===n.length)return["(",mh(t,e,!0),")"];let r=!1,o=!1;const h=t.map((t=>{let{node:i,isLast:n,isFirst:h}=t;const a=[s()];return n||(jh(e.originalText,fo(i))?(h&&(o=!0),r=!0,a.push(",",Fh,Fh)):a.push(",",Oh)),a}),i),{node:a}=t,c=Io(n),l=Xh(e,"7.3")&&["call","new","unset","isset"].includes(a.kind)||Xh(e,"8.0")&&["function","closure","method","arrowfunc","attribute"].includes(a.kind)?Dh([c&&Go(c)?Fh:"",","]):"";const u=function(t){if(2!==t.length)return!1;const[e,s]=t;return!(e.comments&&e.comments.length||"function"!==e.kind&&"method"!==e.kind&&"closure"!==e.kind||"retif"===s.kind||sa(s))}(n),_=function(t){const e=Io(t),s=(i=t).length>1?i[i.length-2]:null;var i;return!yh(e)&&!Ah(e)&&sa(e)&&(!s||s.kind!==e.kind)}(n);if(u||_){const e=(u?h.slice(1).some(Vh):h.slice(0,-1).some(Vh))||r;let n;t.each((t=>{let{isLast:e,isFirst:i}=t;u&&i&&(n=[s([],{expandFirstArg:!0}),h.length>1?",":"",o?Fh:Oh,o?Fh:"",h.slice(1)]),_&&e&&(n=[...h.slice(0,-1),s([],{expandLastArg:!0})])}),i);const a=h.some(Vh),c=["(",...n,")"];return[a?Ch:"",wh([a?Ph(vh(["(",Dh([Oh,...h]),l,Oh,")"],{shouldBreak:!0}),c):c,u?["(",vh(n[0],{shouldBreak:!0}),...n.slice(1),")"]:["(",...h.slice(0,-1),vh(Io(n),{shouldBreak:!0}),")"],vh(["(",Dh([Oh,...h]),Ph(l),Oh,")"],{shouldBreak:!0})],{shouldBreak:e})]}return vh(["(",Dh([Mh,...h]),Ph(l),Mh,")"],{shouldBreak:h.some(Vh)||r})}function na(t){return"array"===t.kind&&0!==t.items.length}function ra(t){return"array"===t.right.kind&&0!==t.right.items.length}function oa(t,e,s,i,n){let r=[];const{node:o}=t;if("bin"===o.kind){Lo(o.type,o.left.type)?r=r.concat(t.call((()=>oa(t,e,s,!0,n)),"left")):r.push(e("left"));const h=ra(o)?[o.type," ",e("right")]:[o.type,Oh,e("right")],{parent:a}=t,c=!(n&&["||","&&"].includes(o.type))&&Mo(a)!==Mo(o)&&Mo(o.left)!==Mo(o)&&Mo(o.right)!==Mo(o),l=So(o.left)||"bin"===o.left.kind&&So(o.left.right);r.push(l?"":" ",c?vh(h):h),i&&o.comments&&(r=bh(t,(()=>r),s))}else r.push(e());return r}function ha(t,e,s){const{node:i}=t;switch(i.kind){case"propertylookup":return qh(t,e,s);case"nullsafepropertylookup":return Zh(t,e,s);case"staticlookup":return ta(t,0,s);case"offsetlookup":return ea(t,0,s);default:throw new Error(`Have not implemented lookup kind ${i.kind} yet.`)}}function aa(t){let{opening:e=!0}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("heredoc"===t.type)return e?`<<<${t.label}`:t.label;const s={string:'"',shell:"`"};if(s[t.type])return s[t.type];throw new Error(`Unimplemented encapsed type ${t.type}`)}function ca(t,e,s){const i=[];let n=[];return t.each((t=>{let{node:r}=t;i.push(n),i.push(vh(s())),n=[",",Oh],r&&jh(e.originalText,fo(r))&&n.push(Mh)}),"items"),i}function la(t,e,s){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"children";const{node:n,parent:r}=t;let o=-1;const h=[],a=[];t.map((()=>{const{node:i,next:c,isFirst:l,isLast:u,index:_}=t,p="inline"===i.kind,d=s(),f=!u&&!p&&(c&&"case"===c.kind?!Co(t):c&&"inline"!==c.kind);let k=[d,f?Fh:"",f&&jh(e.originalText,fo(i))?Fh:""];const T="block"===n.kind&&r&&["function","closure","method","try","catch"].includes(r.kind);let x=T&&l?"":" ";if(p||!p&&u&&o>=0){const e=o;p&&(o=_);if(p&&!l||!p&&u){const s=(p?e:o)+1,r=u&&!p?_+1:_,h=t.siblings[p?e:o],c=h?function(t){const e=t.split("\n").pop();return e.length-e.trimLeft().length+1}(h.raw):"",l=r-s>1,d=l?T&&!h||Po(n)&&0===s?"":Fh:"",f=l&&"halt"!==i.kind?T&&u?"":Fh:"";l&&(x=""),a.push({start:s,end:r,alignment:c,before:d,after:f})}}if(p){const s=c&&"echo"===c.kind&&c.shortForm?"<?=":"<?php",r=i.leadingComments&&i.leadingComments.length?[l&&"namespace"!==n.kind&&!T?"<?php":"","namespace"!==n.kind&&T?"":Fh,Nh(i.leadingComments,e),Fh,"?>"]:Po(n)&&l&&"namespace"!==n.kind?"":[x,"?>"],o=t.getNode(_+1),h=o&&o.children&&o.children.length;k=[r,k,i.comments&&i.comments.length?[s,Fh,h?Nh(i.comments,e):"",Fh]:Po(n)&&u?"":[s," "]]}h.push(k)}),i);const c=function(t,e){if(0===e.length)return t;let s=0;return e.reduce(((e,i)=>{const{start:n,end:r,alignment:o,before:h,after:a}=i,c=[h||"",...t.slice(n,r),a||""],l=e.concat(t.slice(s,n),o?Gh(vh(Hh(new Array(o).join(" "),c))):vh(c),r===t.length-1?t.slice(r):"");return s=r,l}),[])}(h,a);if("program"===n.kind&&!n.extra.parseAsEval){const t=[],[s]=n.children;if(!s||"inline"!==s.kind){const i=e.originalText.trim().match(/^<\?(php|=)(\s+)?\S/),r=[i&&i[2]&&i[2].includes("\n")?[Fh,i[2].split("\n").length>2?Fh:""]:" ",n.comments?Nh(n.comments,e):""],o=s&&"echo"===s.kind&&s.shortForm;t.push([o?"<?=":"<?php",r])}t.push(c);if(/\?>\n?$/.test(e.originalText)){const s=Io(n.children),i=s?[Wh(e.originalText.trimEnd(),fo(s),fo(n))?"inline"===s.kind&&s.comments&&s.comments.length?"":Fh:" ",jh(e.originalText,fo(s))?Fh:""]:n.comments?Fh:"";t.push(Rh([i,"?>"]))}return t}return c}function ua(t,e,s,i){return t.map((t=>{let{node:i,isLast:n}=t;const r=[];return r.push(s()),n||(r.push(Fh),jh(e.originalText,fo(i))&&r.push(Fh)),r}),i)}function _a(t,e,s){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"extends",n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:" ",r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:" ";const o=t.node[i],h=vo(o)?[Fh,t.call((()=>mh(t,e,!0)),i),Fh]:n,a=Array.isArray(o)?vh(Sh(",",t.map((i=>{let{node:n}=i;const o=s();return vo(n)?[Fh,mh(t,e,!0),Fh,o]:[r,o]}),i))):[r,s(i)];return Dh([h,i,Vh(h)?Dh(a):a])}function pa(t,e,s){let{inline:i=!1}=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const n=[];return t.node.attrGroups?(t.each((()=>{const r=["#["];!i&&n.length>0&&n.push(Fh),r.push(Mh),t.each((()=>{const i=t.node;r.length>2&&r.push(",",Oh);const n=[i.name];i.args.length>0&&n.push(ia(t,e,s,"args")),r.push(vh(n))}),"attrs"),n.push(vh([Dh(r),Ph(Xh(e,"8.0")?",":""),Mh,"]",i?Ph(Mh," "):""]))}),"attrGroups"),0===n.length?[]:[...n,i?"":Fh]):[]}function da(t,e,s){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"body";const{node:n}=t;if(!n[i])return";";const r=s(i);return[n.shortForm?":":" {",Dh("block"!==n[i].kind||n[i].children&&n[i].children.length>0||n[i].comments&&n[i].comments.length>0?[Do(t)?"switch"===n.kind?" ":"":Fh,r]:""),"if"===n.kind&&"body"===i?"":[Uo(t)?Fh:"",n.shortForm?["end",n.kind,";"]:"}"]]}function fa(t,e,s,i,n,r,o){if(!i)return e;const h=Ta(t,i,n,r,o);return vh([e,s,h])}function ka(t){return!!wo(t)&&(!("variable"!==t.what.kind&&!Fo(t.what))||ka(t.what))}function Ta(t,e,s,i,n){const r=i?"&":"";if(function(t,e){return e.comments&&e.comments.some((e=>e.leading&&Ko(t,fo(e))))}(n.originalText,e))return Dh([Fh,r,s]);const o="cast"===e.kind?e.expr:e;return"bin"===o.kind&&!ra(o)||"retif"===o.kind&&(!o.trueExpr&&!na(o.falseExpr)||"bin"===o.test.kind&&!ra(o.test))||("variable"===t.kind||"string"===t.kind||wo(t))&&("string"===o.kind&&!xa(o)||ka(o))?vh(Dh([Oh,r,s])):[" ",r,s]}function xa(t){return t.raw.includes("\n")}function Ea(t,e){return("string"===t.kind||"encapsed"===t.kind&&("string"===t.type||"shell"===t.type))&&xa(t)&&!Yh(e,po(t),{backwards:!0})}function ma(t,e,s){return vh(t.map((t=>{let{isFirst:i}=t;return i?[e()]:[s,e()]}),"types"))}const ya=new Set(["loc","range","raw","comments","leadingComments","trailingComments","parenthesizedExpression","parent","prev","start","end","tokens","errors","extra"]);function Aa(t,e){if("string"===t.kind&&delete e.isDoubleQuote,["array","list"].includes(t.kind)&&delete e.shortForm,"inline"===t.kind){if(t.value.includes("___PSEUDO_INLINE_PLACEHOLDER___"))return null;e.value=e.value.replace(/\n/g,"")}if(("continue"===t.kind||"break"===t.kind)&&t.level){const{level:t}=e;"number"===t.kind&&(e.level="1"===t.value?null:t)}if("block"===t.kind&&1===t.children.length&&"block"===t.children[0].kind)for(;"block"===e.children[0].kind;)e.children=e.children[0].children;"number"===t.kind&&(e.value=Eo(t.value));if(["foreach","for","if","while","do"].includes(t.kind)&&(t.body&&"block"!==t.body.kind?e.body={kind:"block",children:[e.body]}:e.body=e.body?e.body:null,t.alternate&&"block"!==t.alternate.kind?e.alternate={kind:"block",children:[e.alternate]}:e.alternate=e.alternate?e.alternate:null),"usegroup"===t.kind&&"string"==typeof t.name&&(e.name=e.name.replace(/^\\/,"")),"useitem"===t.kind&&(e.name=e.name.replace(/^\\/,"")),"method"===t.kind&&"identifier"===t.name.kind&&(e.name.name=Yo(e.name.name)),"noop"===t.kind)return null}Aa.ignoredProperties=ya;const Na="PHP";var ga={phpVersion:{since:"0.13.0",category:Na,type:"choice",default:"7.0",description:"Minimum target PHP version.",choices:[{value:"5.0"},{value:"5.1"},{value:"5.2"},{value:"5.3"},{value:"5.4"},{value:"5.5"},{value:"5.6"},{value:"7.0"},{value:"7.1"},{value:"7.2"},{value:"7.3"},{value:"7.4"},{value:"8.0"},{value:"8.1"},{value:"8.2"}]},trailingCommaPHP:{since:"0.0.0",category:Na,type:"boolean",default:!0,description:"Print trailing commas wherever possible when multi-line."},braceStyle:{since:"0.10.0",category:Na,type:"choice",default:"per-cs",description:"Print one space or newline for code blocks (classes and functions).",choices:[{value:"psr-2",description:"(deprecated) Use per-cs"},{value:"per-cs",description:"Use the PER Coding Style brace style."},{value:"1tbs",description:"Use 1tbs brace style."}]}};const La=(t,e,s,i)=>{if("length"===s||"prototype"===s)return;if("arguments"===s||"caller"===s)return;const n=Object.getOwnPropertyDescriptor(t,s),r=Object.getOwnPropertyDescriptor(e,s);!ba(n,r)&&i||Object.defineProperty(t,s,r)},ba=function(t,e){return void 0===t||t.configurable||t.writable===e.writable&&t.enumerable===e.enumerable&&t.configurable===e.configurable&&(t.writable||t.value===e.value)},Ia=(t,e)=>{const s=Object.getPrototypeOf(e);s!==Object.getPrototypeOf(t)&&Object.setPrototypeOf(t,s)},Ca=(t,e)=>`/* Wrapped ${t}*/\n${e}`,Sa=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),Oa=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),Ra=(t,e,s)=>{const i=""===s?"":`with ${s.trim()}() `,n=Ca.bind(null,i,e.toString());Object.defineProperty(n,"name",Oa),Object.defineProperty(t,"toString",{...Sa,value:n})};var va={exports:{}},wa=()=>{const t={};return t.promise=new Promise(((e,s)=>{t.resolve=e,t.reject=s})),t};!function(t,e){var i=s&&s.__awaiter||function(t,e,s,i){return new(s||(s=Promise))((function(n,r){function o(t){try{a(i.next(t))}catch(t){r(t)}}function h(t){try{a(i.throw(t))}catch(t){r(t)}}function a(t){t.done?n(t.value):new s((function(e){e(t.value)})).then(o,h)}a((i=i.apply(t,e||[])).next())}))},n=s&&s.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const r=n(wa);function o(t){let e,s,n,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"maxAge";const h=()=>i(this,void 0,void 0,(function*(){if(void 0!==e)return;const h=h=>i(this,void 0,void 0,(function*(){n=r.default();const i=h[1][o]-Date.now();return i<=0?(t.delete(h[0]),void n.resolve()):(e=h[0],s=setTimeout((()=>{t.delete(h[0]),n&&n.resolve()}),i),"function"==typeof s.unref&&s.unref(),n.promise)}));try{for(const e of t)yield h(e)}catch(t){}e=void 0})),a=t.set.bind(t);return t.set=(i,r)=>{t.has(i)&&t.delete(i);const o=a(i,r);return e&&e===i&&(e=void 0,void 0!==s&&(clearTimeout(s),s=void 0),void 0!==n&&(n.reject(void 0),n=void 0)),h(),o},h(),t}e.default=o,t.exports=o,t.exports.default=o}(va,va.exports);var Da=i(va.exports);const Ua=new WeakMap;const Pa=/@prettier|@format/,Fa=function(t){let{cacheKey:e,cache:s=new Map,maxAge:i}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};"number"==typeof i&&Da(s);const n=function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];const h=e?e(r):r[0],a=s.get(h);if(a)return a.data;const c=t.apply(this,r);return s.set(h,{data:c,maxAge:i?Date.now()+i:Number.POSITIVE_INFINITY}),c};return function(t,e){let{ignoreNonConfigurable:s=!1}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{name:i}=t;for(const i of Reflect.ownKeys(e))La(t,e,i,s);Ia(t,e),Ra(t,e,i)}(n,t,{ignoreNonConfigurable:!0}),Ua.set(n,s),n}((t=>{const e=uo(t),[s]=e.children,[i]=e.comments.filter((t=>"commentblock"===t.kind));if(s&&i&&i.loc.start.line<s.loc.start.line)return i}));const{join:Ma,hardline:Ba}=e.doc.builders;function Ha(t,e){let{extend:s,override:i}=e;const n={};for(const e in t){n["languageId"===e?"linguistLanguageId":e]=t[e]}if(s)for(const t in s)n[t]=(n[t]||[]).concat(s[t]);for(const t in i)n[t]=i[t];return n}const Ga=[Ha(n,{override:{parsers:["php"],vscodeLanguageIds:["php"]}}),Ha(r,{override:{parsers:["php"],vscodeLanguageIds:["php"]}})],Va={php:{parse:uo,astFormat:"php",locStart:po,locEnd:fo,hasPragma:function(t){if(!Pa.test(t))return!1;const e=Fa(t);if(e){const{value:t}=e;return Pa.test(t)}return!1}}},Qa=new Set(["kind","loc","errors","extra","comments","leadingComments","enclosingNode","precedingNode","followingNode"]);const Ya={php:{print:function(t,e,s){const{node:i}=t;if("string"==typeof i)return i;const n=function(t,e,s){const{node:i}=t;switch(i.kind){case"program":return vh([la(t,e,s),mh(t,e,!0,(t=>!t.printed))]);case"expressionstatement":return s("expression");case"block":return[la(t,e,s),mh(t,e,!0)];case"declare":{const n=t=>Sh(", ",t.map(s,"directives"));return["block","short"].includes(i.mode)?["declare(",n(t),")","block"===i.mode?" {":":",i.children.length>0?Dh([Fh,la(t,e,s)]):"",mh(t,e),Fh,"block"===i.mode?"}":"enddeclare;"]:["declare(",n(t),")","inline"===t.next?.kind?"":";"]}case"declaredirective":return[s("key"),"=",s("value")];case"namespace":return["namespace ",i.name&&"string"==typeof i.name?[i.name,i.withBrackets?" ":""]:"",i.withBrackets?"{":";",vo(i)?[" ",mh(t,e,!0)]:"",i.children.length>0?i.withBrackets?Dh([Fh,la(t,e,s)]):["inline"===i.children[0].kind?"":[Fh,Ho(e.originalText,i)?Fh:""],la(t,e,s)]:"",i.withBrackets?[Fh,"}"]:""];case"usegroup":return vh(["use ",i.type?[i.type," "]:"",Dh([i.name?[Ro(i.name),"\\{",Mh]:"",Sh([",",Oh],t.map(s,"items"))]),i.name?[Ph(Xh(e,"7.2")?",":""),Mh,"}"]:""]);case"useitem":return[i.type?[i.type," "]:"",Ro(i.name),vo(i)?[" ",mh(t,e,!0)]:"",i.alias?[" as ",s("alias")]:""];case"class":case"enum":case"interface":case"trait":return function(t,e,s){const{node:i}=t,n="class"===i.kind&&i.isAnonymous,r=pa(t,e,s,{inline:n}),o=n?[]:[...r];i.isReadonly&&o.push("readonly ");i.isFinal&&o.push("final ");i.isAbstract&&o.push("abstract ");o.push(n?"":i.kind),i.name&&o.push(" ",s("name"));"enum"===i.kind&&i.valueType&&o.push(": ",s("valueType"));i.extends&&i.implements?o.push(wh([[_a(t,e,s,"extends"),_a(t,e,s,"implements")],[_a(t,e,s,"extends"),_a(t,e,s,"implements"," ",Fh)],[_a(t,e,s,"extends",Fh," "),_a(t,e,s,"implements",Fh,i.implements.length>1?Fh:" ")]],{shouldBreak:vo(i.extends)})):(i.extends&&o.push(wh([_a(t,e,s,"extends"),_a(t,e,s,"extends"," ",Fh),_a(t,e,s,"extends",Fh,i.extends.length>1?Fh:" ")])),i.implements&&o.push(wh([_a(t,e,s,"implements"),_a(t,e,s,"implements"," ",Fh),_a(t,e,s,"implements",Fh,i.implements.length>1?Fh:" ")])));const h=vh([vh(o),Jh(e)?n?Oh:Fh:" "]),a=i.body&&0===i.body.length&&!vo(i),c=["{",Dh([a?"":Fh,ua(t,e,s,"body")]),mh(t,e,!0),n&&a?Mh:Fh,"}"];return[h,c]}(t,e,s);case"traitprecedence":return[s("trait"),"::",s("method")," insteadof ",Sh(", ",t.map(s,"instead"))];case"traitalias":return[i.trait?[s("trait"),"::"]:"",i.method?s("method"):""," as ",Sh(" ",[...i.visibility?[i.visibility]:[],...i.as?[s("as")]:[]])];case"traituse":return vh(["use ",Dh(vh(Sh([",",Oh],t.map(s,"traits")))),i.adaptations?[" {",i.adaptations.length>0?[Dh([Fh,ua(t,e,s,"adaptations")]),Fh]:vo(i)?[Oh,mh(t,e,!0),Oh]:"","}"]:""]);case"function":case"closure":case"method":return function(t,e,s){const{node:i}=t,n=pa(t,e,s,{inline:"closure"===i.kind}),r=[];i.isFinal&&r.push("final ");i.isAbstract&&r.push("abstract ");i.visibility&&r.push(i.visibility," ");i.isStatic&&r.push("static ");r.push("function "),i.byref&&r.push("&");i.name&&r.push(s("name"));r.push(ia(t,e,s)),i.uses&&i.uses.length>0&&r.push(vh([" use ",ia(t,e,s,"uses")]));i.type&&r.push([": ",vo(i.type)?[t.call((()=>mh(t,e,!0)),"type")," "]:"",i.nullable?"?":"",s("type")]);const o=r;if(!i.body)return[...n,o];const h="closure"===i.kind,a=["{",Dh([Bo(t)?"":Fh,s("body")]),h&&Bo(t)?"":Fh,"}"];if(h)return[...n,o," ",a];if(0===i.arguments.length)return[...n,o,Jh(e)?Fh:" ",a];const c=r.some(Vh);if(c)return[o," ",a];return[...n,wh([[o,Jh(e)?Fh:" ",a],[o," ",a]])]}(t,e,s);case"arrowfunc":return[i.parenthesizedExpression?"(":"",...pa(t,e,s,{inline:!0}),i.isStatic?"static ":"","fn",ia(t,e,s),i.type?[": ",i.nullable?"?":"",s("type")]:""," => ",s("body"),i.parenthesizedExpression?")":""];case"parameter":{let n="";1===i.flags?n="public ":2===i.flags?n="protected ":4===i.flags&&(n="private ");const r=[...pa(t,e,s,{inline:!0}),n,i.readonly?"readonly ":"",i.nullable?"?":"",i.type?[s("type")," "]:"",i.byref?"&":"",i.variadic?"...":"","$",s("name")];return i.value?vh([r,vo(i)?" ":"",mh(t,e,!0)," =",Ta(i.name,i.value,s("value"),!1,e)]):r}case"variadic":return["...",s("what")];case"property":return vh([i.readonly?"readonly ":"",i.type?[i.nullable?"?":"",s("type")," "]:"","$",s("name"),i.value?[" =",Ta(i.name,i.value,s("value"),!1,e)]:""]);case"propertystatement":{const n=[];t.each((()=>{n.push(...pa(t,e,s))}),"properties");const r=t.map(s,"properties"),o=i.properties.some((t=>t.value));let h;1!==r.length||i.properties[0].comments?r.length>0&&(h=Dh(r[0])):[h]=r;const a=i.visibility||null===i.visibility;return vh([...n,a?[null===i.visibility?"var":i.visibility,""]:"",i.isStatic?[a?" ":"","static"]:"",h?[" ",h]:"",Dh(r.slice(1).map((t=>[",",o?Fh:Oh,t])))])}case"if":{const n=[],r=da(t,e,s,"body"),o=vh(["if (",vh([Dh([Mh,s("test")]),Mh]),")",r]);if(n.push(o,Co(t)||!i.body?"":Fh),i.alternate){n.push(i.shortForm?"":"} ");const r=Ah(i.body)&&i.body.comments.some((t=>t.trailing&&!gh(t)))||function(t){if(!t.comments)return!1;const e=Io(t.comments.filter((t=>!t.leading&&!t.trailing)));return e&&!gh(e)}(i),o=!r;n.push(o?"":Fh),vo(i)&&n.push(jh(e.originalText,fo(i.body))?Fh:"",mh(t,e,!0),r?Fh:" "),n.push("else",vh("if"===i.alternate.kind?s("alternate"):da(t,e,s,"alternate")))}else n.push(i.body?i.shortForm?"endif;":"}":"");return n}case"do":return["do",da(t,e,s,"body")," while (",vh([Dh([Mh,s("test")]),Mh]),")"];case"while":case"switch":return vh([i.kind," (",vh([Dh([Mh,s("test")]),Mh]),")",da(t,e,s,"body")]);case"for":{const n=da(t,e,s,"body"),r=mh(t,e,!0),o=r?[r,Mh]:"";return i.init.length||i.test.length||i.increment.length?[o,vh(["for (",vh([Dh([Mh,vh(Sh([",",Oh],t.map(s,"init"))),";",Oh,vh(Sh([",",Oh],t.map(s,"test"))),";",Oh,vh(Sh([",",Oh],t.map(s,"increment")))]),Mh]),")",n])]:[o,vh(["for (;;)",n])]}case"foreach":{const n=da(t,e,s,"body"),r=mh(t,e,!0);return[r?[r,Mh]:"",vh(["foreach (",vh([Dh([Mh,s("source"),Oh,"as ",vh(i.key?Dh(Sh([" =>",Oh],[s("key"),s("value")])):s("value"))]),Mh]),")",n])]}case"try":{const n=[];return n.push("try",da(t,e,s,"body")),i.catches&&n.push(t.map(s,"catches")),i.always&&n.push(" finally",da(t,e,s,"always")),n}case"catch":return[" catch",i.what?[" (",Sh(" | ",t.map(s,"what")),i.variable?[" ",s("variable")]:"",")"]:"",da(t,e,s,"body")];case"case":return[i.test?["case ",i.test.comments?Dh(s("test")):s("test"),":"]:"default:",i.body&&i.body.children&&i.body.children.length?Dh([Co(t)?"":Fh,s("body")]):""];case"break":case"continue":return i.level&&("number"===i.level.kind&&"1"!==i.level.value)?[`${i.kind} `,s("level")]:i.kind;case"call":return 1===i.arguments.length&&Ea(i.arguments[0],e.originalText)?[s("what"),"(",Sh(", ",t.map(s,"arguments")),")"]:wo(i.what)?function(t,e,s){const i=[];function n(t){const{originalText:s}=e,i=$h(s,fo(t));return")"===s.charAt(i)?Qh(s,i+1,e):jh(s,fo(t))}function r(t){const{node:o}=t;if("call"!==o.kind||!wo(o.what)&&"call"!==o.what.kind)if(wo(o)){let n=null;n="propertylookup"===o.kind?qh(t,e,s):"nullsafepropertylookup"===o.kind?Zh(t,e,s):"staticlookup"===o.kind?ta(t,e,s):ea(t,e,s),i.unshift({node:o,needsParens:Ih(t),printed:bh(t,(()=>n),e)}),t.call((t=>r(t)),"what")}else i.unshift({node:o,printed:s()});else i.unshift({node:o,printed:[bh(t,(()=>ia(t,e,s)),e),n(o)?Fh:""]}),t.call((t=>r(t)),"what")}const{node:o}=t;i.unshift({node:o,printed:ia(t,e,s)}),t.call((t=>r(t)),"what");for(let t=0;t<i.length;++t)"call"===i[t].node.kind&&i[t-1]&&["propertylookup","nullsafepropertylookup","staticlookup"].includes(i[t-1].node.kind)&&i[t-1].needsParens&&(i[0].printed=["(",i[0].printed],i[t-1].printed=[i[t-1].printed,")"]);const h=[];let a=[i[0]],c=1;for(;c<i.length&&("call"===i[c].node.kind||wo(i[c].node)&&i[c].node.offset&&"number"===i[c].node.offset.kind);++c)a.push(i[c]);if("call"!==i[0].node.kind)for(;c+1<i.length&&(wo(i[c].node)&&wo(i[c+1].node));++c)a.push(i[c]);h.push(a),a=[];let l=!1;for(;c<i.length;++c){if(l&&wo(i[c].node)){if("offsetlookup"===i[c].node.kind&&i[c].node.offset&&"number"===i[c].node.offset.kind){a.push(i[c]);continue}h.push(a),a=[],l=!1}"call"===i[c].node.kind&&(l=!0),a.push(i[c]),i[c].node.comments&&Ah(i[c].node)&&(h.push(a),a=[],l=!1)}a.length>0&&h.push(a);function u(t){const s=t[1].length&&"offsetlookup"===t[1][0].node.kind;if(1===t[0].length){const e=t[0][0].node;return"variable"===e.kind&&("this"===e.name||_&&i(e.name))||Fo(e)}function i(t){return t.length<e.tabWidth}const n=Io(t[0]).node;return wo(n)&&("identifier"===n.offset.kind||"variable"===n.offset.kind)&&s}const _="expressionstatement"===t.parent.kind,p=h.length>=2&&!h[1][0].node.comments&&u(h);function d(t){const e=[];for(let s=0;s<t.length;s++)t[s+1]&&t[s+1].needsParens?(e.push("(",t[s].printed,t[s+1].printed,")"),s++):e.push(t[s].printed);return e}function f(t){return 0===t.length?"":Dh(vh([Fh,Sh(Fh,t.map(d))]))}const k=h.map(d),T=k,x=p?3:2,E=h.slice(0,x).flat(),m=E.slice(1,-1).some((t=>yh(t.node)))||E.slice(0,-1).some((t=>Ah(t.node)))||h[x]&&yh(h[x][0].node),y=Vo(t,"encapsed");if(h.length<=x&&!m||y)return vh(T);const A=Io(p?h.slice(1,2)[0]:h[0]).node,N="call"!==A.kind&&n(A),g=[d(h[0]),p?h.slice(1,2).map(d):"",N?Fh:"",f(h.slice(p?2:1))],L=i.filter((t=>"call"===t.node.kind)).length;if(m||L>=3||k.slice(0,-1).some(Vh))return vh(g);return[Vh(T)||N?Ch:"",wh([T,g])]}(t,e,s):[s("what"),ia(t,e,s)];case"new":{const n=i.what&&"class"===i.what.kind&&i.what.isAnonymous;if(!n&&1===i.arguments.length&&Ea(i.arguments[0],e.originalText))return["new ",...t.call(pa,"what"),s("what"),"(",Sh(", ",t.map(s,"arguments")),")"];const r=[];if(r.push("new "),n)r.push(i.what.leadingComments&&"commentblock"===i.what.leadingComments[0].kind?[Nh(i.what.leadingComments,e)," "]:"",...t.call((()=>pa(t,e,s,{inline:!0})),"what"),"class",i.arguments.length>0?[" ",ia(t,e,s)]:"",vh(s("what")));else{const n=["call","offsetlookup"].includes(i.what.kind),o=[n?"(":"",s("what"),n?")":"",ia(t,e,s)];r.push(yh(i.what)?Dh(o):o)}return r}case"clone":return["clone ",i.what.comments?Dh(s("what")):s("what")];case"propertylookup":case"nullsafepropertylookup":case"staticlookup":case"offsetlookup":{const{parent:n}=t;let r,o=0;do{r=t.getParentNode(o),o++}while(r&&wo(r));const h=Vo(t,"encapsed")||r&&("new"===r.kind||"assign"===r.kind&&"variable"!==r.left.kind)||"offsetlookup"===i.kind||(Fo(i.what)||"variable"===i.what.kind)&&["identifier","variable","encapsedpart"].includes(i.offset.kind)&&n&&!wo(n);return[s("what"),h?ha(t,e,s):vh(Dh([Mh,ha(t,e,s)]))]}case"exit":return vh([i.useDie?"die":"exit","(",i.expression?Ea(i.expression,e.originalText)?s("expression"):[Dh([Mh,s("expression")]),Mh]:mh(t,e),")"]);case"global":return vh(["global ",Dh(Sh([",",Oh],t.map(s,"items")))]);case"include":return[i.require?"require":"include",i.once?"_once":""," ",i.target.comments?Dh(s("target")):s("target")];case"label":return[s("name"),":"];case"goto":return["goto ",s("label")];case"throw":return["throw ",i.what.comments?Dh(s("what")):s("what")];case"silent":return["@",s("expr")];case"halt":return[vo(i)?[mh(t,e,!0),Fh]:"","__halt_compiler();",i.after];case"eval":return vh(["eval(",Ea(i.source,e.originalText)?s("source"):[Dh([Mh,s("source")]),Mh],")"]);case"echo":{const e=t.map(s,"expressions");let n;return 1!==e.length||i.expressions[0].comments?e.length>0&&(n=So(i.expressions[0])||i.expressions[0].comments?Dh(e[0]):Uh(e[0])):[n]=e,vh([i.shortForm?"":"echo ",n||"",Dh(e.slice(1).map((t=>[",",Oh,t])))])}case"print":return["print ",i.expression.comments?Dh(s("expression")):s("expression")];case"return":{const n=[];if(n.push("return"),i.expr){const t=s("expr");n.push(" ",i.expr.comments?Dh(t):t)}return vo(i)&&n.push(" ",mh(t,e,!0)),n}case"isset":case"unset":return vh([i.kind,ia(t,e,s,"variables")]);case"empty":return vh(["empty(",Dh([Mh,s("expression")]),Mh,")"]);case"variable":{const{parent:e,grandparent:n}=t,r="assign"===e.kind?"":i.byref?"&":"",o="encapsedpart"===e.kind&&"simple"===e.syntax&&e.curly||n&&"offsetlookup"===e.kind&&"encapsedpart"===n.kind&&"simple"===n.syntax&&n.curly?"":"$",h=i.curly?"{":"",a=i.curly?"}":"";return[r,o,h,s("name"),a]}case"constantstatement":case"classconstant":{const n=pa(t,e,s),r=t.map(s,"constants");let o;return 1!==r.length||i.constants[0].comments?r.length>0&&(o=Dh(r[0])):[o]=r,vh([...n,i.final?"final ":"",i.visibility?[i.visibility," "]:"","const",o?[" ",o]:"",Dh(r.slice(1).map((t=>[",",Fh,t])))])}case"constant":return fa(i.name,s("name")," =",i.value,s("value"),!1,e);case"static":{const e=t.map(s,"variables"),n=i.variables.some((t=>t.defaultValue));let r;return 1!==e.length||i.variables[0].comments?e.length>0&&(r=Dh(e[0])):[r]=e,vh(["static",r?[" ",r]:"",Dh(e.slice(1).map((t=>[",",n?Fh:Oh,t])))])}case"staticvariable":return fa(i.variable,s("variable")," =",i.defaultValue,s("defaultValue"),!1,e);case"list":case"array":{const n="array"===i.kind&&Kh(e.phpVersion,"5.4")||"list"===i.kind&&(i.shortForm||Kh(e.phpVersion,"7.1")),r=n?"[":[i.kind,"("],o=n?"]":")";if(0===i.items.length)return vo(i)?vh([r,mh(t,e),Mh,o]):[r,o];const h=Io(i.items),a=h&&"noop"===h.kind,[c]=i.items.filter((t=>"noop"!==t.kind)).sort(((t,e)=>po(t)-po(e))),l=!(!c||!c.key)&&c&&Wh(e.originalText,po(i),po(c));return vh([r,Dh([Mh,ca(t,e,s)]),a?",":"",Ph(!a&&Xh(e,"5.0")?[h&&Go(h)?Fh:"",","]:""),mh(t,e,!0),Mh,o],{shouldBreak:l})}case"entry":{const t=i.byRef?"&":"",n=i.unpack?"...":"";return i.key?fa(i.key,s("key")," =>",i.value,s("value"),t,e):[t,n,s("value")]}case"yield":{const t=[i.key?[s("key")," => "]:"",s("value")];return["yield",i.key||i.value?" ":"",i.value&&i.value.comments?Dh(t):t]}case"yieldfrom":return["yield from ",i.value.comments?Dh(s("value")):s("value")];case"unary":return[i.type,s("what")];case"pre":return[i.type+i.type,s("what")];case"post":return[s("what"),i.type+i.type];case"cast":return["(",i.type,") ",i.expr.comments?Dh(s("expr")):s("expr")];case"assignref":case"assign":{const t="assignref"===i.kind;return fa(i.left,s("left"),[" ",t?"=":i.operator],i.right,s("right"),t,e)}case"bin":{const{parent:n,grandparent:r}=t,o=i!==n.body&&("if"===n.kind||"while"===n.kind||"switch"===n.kind||"do"===n.kind),h=oa(t,s,e,!1,o);if(o)return h;if("unary"===n.kind||wo(n)&&"offsetlookup"!==n.kind)return vh([Dh([Mh,...h]),Mh]);const a=i!==n.body&&"for"===n.kind||"retif"===n.kind&&r&&"return"!==r.kind,c=["assign","property","constant","staticvariable","entry"].includes(n.kind),l="bin"===i.left.kind&&Lo(i.type,i.left.type);if(a||ra(i)&&!l||!ra(i)&&c)return vh(h);const u=h.slice(1);return vh([h.length>0?h[0]:"",Dh(u)])}case"retif":{const e=[],{parent:n}=t;let r,o=0;do{r=t.getParentNode(o),o++}while(r&&"retif"===r.kind);const h=r||n,a="bin"===i.falseExpr.kind?Dh(s("falseExpr")):s("falseExpr"),c=[i.trueExpr?Oh:" ","?",i.trueExpr?[" ","bin"===i.trueExpr.kind?Dh(s("trueExpr")):s("trueExpr"),Oh]:"",":",i.trueExpr?[" ",a]:[na(i.falseExpr)?" ":Oh,a]];e.push(c);const l=t=>n===h?vh(t):t,u=t.grandparent,_="cast"===n.kind&&u?u:n,p=["propertylookup","nullsafepropertylookup","staticlookup"].includes(_.kind),d=s("test");if(!i.trueExpr){const t=[d,"bin"===_.kind||["print","echo","return","include"].includes(h.kind)?Dh(e):e];return"call"===_.kind&&_.what===i||"unary"===_.kind||wo(_)&&"offsetlookup"!==_.kind?vh([Dh([Mh,t]),Mh]):l(t)}return l(["retif"===i.test.kind?Dh(d):d,Dh(e),p?Mh:""])}case"boolean":return i.value?"true":"false";case"number":return Eo(i.value);case"string":{const{parent:s}=t;if("encapsedpart"===s.kind){const s=t.grandparent;let n=0;const r=Kh(e.phpVersion,"7.3");let o=Bh;if("heredoc"===s.type){o=r?Fh:Bh;const t=s.raw.split("\n");n=t[t.length-1].search(/\S/),-1===n&&(n=t[t.length-2].search(/\S/))}return Sh(o,i.raw.split("\n").map(((t,e)=>e>0||0===i.loc.start.column?t.substring(n):t)))}const n=function(t,e){if(t.isDoubleQuote===e.singleQuote){const e=t.raw.slice("b"===t.raw[0]?2:1,-1).match(/\\([$nrtfve]|[xX][0-9a-fA-F]{1,2}|[0-7]{1,3}|u{([0-9a-fA-F]+)})|\r?\n|'|"|\$/);return t.isDoubleQuote?e:!e}return t.isDoubleQuote}(i,e)?'"':"'";let r=i.raw;return"b"===i.raw[0]&&(r=r.slice(1)),['"',"'"].includes(r[0])&&(r=r.substr(1)),['"',"'"].includes(r[r.length-1])&&(r=r.substr(0,r.length-1)),["b"===i.raw[0]?"b":"",n,Sh(Bh,r.split("\n")),n]}case"intersectiontype":return ma(t,s,"&");case"uniontype":return ma(t,s,"|");case"encapsedpart":{const t="simple"===i.syntax&&i.curly||"complex"===i.syntax?[i.curly?"$":"","{"]:"",e="simple"===i.syntax&&i.curly||"complex"===i.syntax?"}":"";return[t,s("expression"),e]}case"encapsed":switch(i.type){case"string":case"shell":case"heredoc":{const n=Kh(e.phpVersion,"7.3")?Fh:Bh;return[aa(i),"heredoc"===i.type?n:"",...t.map(s,"value"),aa(i,{opening:!1}),"heredoc"===i.type&&Oo(t)?Fh:""]}default:throw new Error(`Have not implemented kind ${i.type} yet.`)}case"inline":return Sh(Bh,i.raw.replace("___PSEUDO_INLINE_PLACEHOLDER___","").split("\n"));case"magic":return i.value;case"nowdoc":{const s=Kh(e.phpVersion,"7.3")?Fh:Bh;return["<<<'",i.label,"'",s,Sh(s,i.value.split("\n")),s,i.label,Oo(t)?Fh:""]}case"name":return["rn"===i.resolution?"namespace\\":"",i.name];case"literal":return s("value");case"parentreference":return"parent";case"selfreference":return"self";case"staticreference":return"static";case"typereference":return i.name;case"nullkeyword":return"null";case"identifier":{const{parent:e}=t;return"method"===e.kind&&(i.name=Yo(i.name)),s("name")}case"match":{const i=t.map((()=>{const i=t.node,n=yh(i)?[Nh(i.leadingComments,e),Fh]:[],r=!t.isLast||e.trailingCommaPHP?",":"",o=Ah(i)?[" ",Nh(i.comments.filter((t=>t.trailing)),e)]:[],h=null===i.conds?"default":t.map((t=>{let{isFirst:e}=t;return[",",Oh,s()].slice(e?2:0)}),"conds"),a=s("body"),c=!t.isFirst&&zh(e.originalText,po(i))?Fh:"";return["",Fh,c,...n,vh([vh([h,Dh(Oh)]),"=> ",a,r,...o])].slice(t.isFirst?1:0)}),"arms");return vh(["match (",vh([Dh([Mh,s("cond")]),Mh]),") {",vh(Dh([...i]))," ",Mh,"}"])}case"noop":return i.comments?Nh(i.comments,e):"";case"namedargument":return[i.name,": ",s("value")];case"enumcase":return vh(["case ",s("name"),i.value?[" =",Ta(i.name,i.value,s("value"),!1,e)]:""]);case"variadicplaceholder":return"...";default:throw new Error(`Have not implemented kind '${i.kind}' yet.`)}}(t,e,s),r=[],o=Ih(t);return o&&r.unshift("("),r.push(n),o&&r.push(")"),function(t){const{node:e,parent:s}=t;if(!s)return!1;if(["for","foreach","while","do","if","switch"].includes(s.kind)&&"block"!==e.kind&&"if"!==e.kind&&(s.body===e||s.alternate===e))return!0;if(!function(t){return["block","program","namespace","class","enum","interface","trait","traituse","declare"].includes(t.kind)}(s))return!1;if("echo"===e.kind&&e.shortForm)return!1;if("traituse"===e.kind)return!e.adaptations;if("method"===e.kind&&e.isAbstract)return!0;if("method"===e.kind){const{parent:e}=t;if(e&&"interface"===e.kind)return!0}return["expressionstatement","do","usegroup","classconstant","propertystatement","traitprecedence","traitalias","goto","constantstatement","enumcase","global","static","echo","unset","return","break","continue","throw"].includes(e.kind)}(t)&&r.push(";"),function(t){const{node:e}=t,s="program"===e.kind,i=e.children&&Io(e.children);if(!s)return!1;if(i&&["halt","inline"].includes(i.kind))return!1;if(i&&("declare"===i.kind||"namespace"===i.kind)){const t=i.children.length>0&&Io(i.children);if(t&&["halt","inline"].includes(t.kind))return!1}return!0}(t)&&r.push(Fh),r},getVisitorKeys:function(t,e){return Object.keys(t).filter((t=>!e.has(t)&&!Qa.has(t)))},insertPragma:function(t){const e=Fa(t);if(e){const{start:{offset:s},end:{offset:i}}=e.loc,n=t.substring(0,s),r=t.substring(i);return`${n}${function(t){let e=t.split("\n");if(1===e.length){const[,t]=/\/*\*\*(.*)\*\//.exec(e[0]);e=["/**",` * ${t.trim()}`," */"]}const s=e.findIndex((t=>/@\S/.test(t)))||1;return e.splice(s,0," * @format"),e.join("\n")}(e.value)}${r}`}const s="<?php";return t.startsWith(s)?`${t.substring(0,5)}\n/** \n * @format \n */\n${t.substring(5)}`:t},massageAstNode:Aa,getCommentChildNodes:function(t){if("new"===t.kind&&"class"===t.what.kind)return t.what.__parent_new_arguments=[...t.arguments],[t.what]},canAttachComment:function(t){return t.kind&&"commentblock"!==t.kind&&"commentline"!==t.kind},isBlockComment:gh,handleComments:{ownLine:function(t,e,s){const{precedingNode:i,enclosingNode:n,followingNode:r}=t;return ah(e,i,n,r,t)||function(t,e,s){if(t&&wo(t)&&e&&["identifier","variable","encapsed"].includes(e.kind))return Wo(t,s),!0;return!1}(n,r,t)||ch(e,i,n,r,t)||xh(e,i,n,r,t)||fh(n,r,t)||lh(n,r,t)||_h(e,i,n,r,t)||uh(e,n,r,t)||function(t,e,s,i){if(!s&&t&&("for"===t.kind||"foreach"===t.kind))return t.body&&"block"!==t.body.kind?Wo(s,i):Wo(t,i),!0;return!1}(n,0,r,t)||dh(n,i,r,t)||Th(n,i,r,t)},endOfLine:function(t,e,s){const{precedingNode:i,enclosingNode:n,followingNode:r}=t;return function(t,e,s,i,n){if(!e&&!i&&s&&"array"===s.kind)return jo(s,n),!0;return!1}(0,i,n,r,t)||function(t,e,s,i,n){if(s&&"return"===s.kind&&!s.expr)return jo(s,n),!0;return!1}(0,0,n,0,t)||ah(e,i,n,r,t)||function(t,e,s,i,n){const r=e&&!Xo(n,fo(e),po(i));if((!e||!r)&&t&&"retif"===t.kind&&s)return Wo(s,i),!0;return!1}(n,i,r,t,e)||ch(e,i,n,r,t)||xh(e,i,n,r,t)||fh(n,r,t)||lh(n,r,t)||_h(e,i,n,r,t)||uh(e,n,r,t)||function(t,e){if(t&&"entry"===t.kind)return Wo(t,e),!0;return!1}(n,t)||function(t,e,s){if(e&&"call"===e.kind&&t&&e.what===t&&e.arguments.length>0)return Wo(e.arguments[0],s),!0;return!1}(i,n,t)||function(t,e,s){if(t&&"assign"===t.kind&&e){const i=t.loc.start.offset+t.loc.source.indexOf("=");if(s.loc.start.offset>i)return Wo(e,s),!0}return!1}(n,r,t)||dh(n,i,r,t)||kh(n,i,r,t)||Th(n,i,r,t)||ph(n,t)},remaining:function(t,e,s){const{precedingNode:i,enclosingNode:n,followingNode:r}=t;return ch(e,i,n,r,t)||xh(e,i,n,r,t)||function(t,e,s){const i=Jo(t,fo(s));if(")"!==t.charAt(i))return!1;if(e&&("function"===e.kind||"closure"===e.kind||"method"===e.kind||"call"===e.kind||"new"===e.kind)&&0===e.arguments.length)return $o(e,s),!0;return!1}(e,n,t)||lh(n,r,t)||function(t,e,s){if(t&&"traituse"===t.kind&&t.adaptations&&!t.adaptations.length)return $o(t,s),!0;return!1}(n,0,t)||_h(e,i,n,r,t)||uh(e,n,r,t)||ph(n,t)||function(t,e,s,i){if(e&&"halt"===e.kind)return $o(e,i),!0;if(t&&"halt"===t.kind)return $o(t,i),!0;return!1}(i,n,0,t)||function(t,e){if(t&&("continue"===t.kind||"break"===t.kind)&&!t.label)return jo(t,e),!0;return!1}(n,t)||dh(n,i,r,t)||kh(n,i,r,t)}},willPrintOwnComments(t){const{node:e}=t;return e&&"noop"===e.kind},printComment(t){const e=t.node;switch(e.kind){case"commentblock":{if(!e.value.includes("\n"))return e.value;const t=e.value.split("\n");return t.slice(1,t.length-1).every((t=>"*"===t.trim()[0]))?Ma(Ba,t.map(((e,s)=>(s>0?" ":"")+(s<t.length-1?e.trim():e.trimLeft())))):e.value}case"commentline":return e.value.trimRight();default:throw new Error(`Not a comment: ${JSON.stringify(e)}`)}},hasPrettierIgnore(t){const e=t=>t.value.includes("prettier-ignore")&&!t.value.includes("prettier-ignore-start")&&!t.value.includes("prettier-ignore-end"),{node:s,parent:i}=t;return s&&"classconstant"!==s.kind&&s.comments&&s.comments.length>0&&s.comments.some(e)||s&&"constant"===s.kind&&i&&"classconstant"===i.kind&&i.comments&&i.comments.length>0&&i.comments.some(e)}}};t.defaultOptions={tabWidth:4},t.languages=Ga,t.options=ga,t.parsers=Va,t.printers=Ya}));
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("prettier/standalone")):"function"==typeof define&&define.amd?define(["exports","prettier/standalone"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).prettierPlugins=t.prettierPlugins||{},t.prettierPlugins.php={}),t.prettier)}(this,(function(t,e){"use strict";var s="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function i(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var n={name:"PHP",type:"programming",tmScope:"text.html.php",aceMode:"php",codemirrorMode:"php",codemirrorMimeType:"application/x-httpd-php",color:"#4F5D95",extensions:[".php",".aw",".ctp",".fcgi",".inc",".php3",".php4",".php5",".phps",".phpt"],filenames:[".php",".php_cs",".php_cs.dist","Phakefile"],interpreters:["php"],aliases:["inc"],languageId:272},r={name:"HTML+PHP",type:"markup",color:"#4f5d95",tmScope:"text.html.php",group:"HTML",extensions:[".phtml"],aceMode:"php",codemirrorMode:"php",codemirrorMimeType:"application/x-httpd-php",languageId:151},o={exports:{}},h={attributeIndex:0,attributeListDepth:{},matchST_ATTRIBUTE:function(){let t=this.input();if(this.is_WHITESPACE()){do{t=this.input()}while(this.is_WHITESPACE());return this.unput(1),null}switch(t){case"]":return 0===this.attributeListDepth[this.attributeIndex]?(delete this.attributeListDepth[this.attributeIndex],this.attributeIndex--,this.popState()):this.attributeListDepth[this.attributeIndex]--,"]";case"(":case")":case":":case"=":case"|":case"&":case"^":case"-":case"+":case"*":case"%":case"~":case"<":case">":case"!":case".":return this.consume_TOKEN();case"[":return this.attributeListDepth[this.attributeIndex]++,"[";case",":return",";case'"':return this.ST_DOUBLE_QUOTES();case"'":return this.T_CONSTANT_ENCAPSED_STRING();case"/":return"/"===this._input[this.offset]?this.T_COMMENT():"*"===this._input[this.offset]?(this.input(),this.T_DOC_COMMENT()):this.consume_TOKEN()}if(this.is_LABEL_START()||"\\"===t){for(;this.offset<this.size;){const t=this.input();if(!this.is_LABEL()&&"\\"!==t){t&&this.unput(1);break}}return this.T_STRING()}if(this.is_NUM())return this.consume_NUM();throw new Error(`Bad terminal sequence "${t}" at line ${this.yylineno} (offset ${this.offset})`)}};var a={consume_NUM:function(){let t=this.yytext[0],e="."===t;if("0"===t)if(t=this.input(),"x"===t||"X"===t){if(t=this.input(),"_"!==t&&this.is_HEX())return this.consume_HNUM();this.unput(t?2:1)}else if("b"===t||"B"===t){if(t=this.input(),"_"!==t&&"0"===t||"1"===t)return this.consume_BNUM();this.unput(t?2:1)}else if("o"===t||"O"===t){if(t=this.input(),"_"!==t&&this.is_OCTAL())return this.consume_ONUM();this.unput(t?2:1)}else this.is_NUM()||t&&this.unput(1);for(;this.offset<this.size;){const s=t;if(t=this.input(),"_"===t){if("_"===s){this.unput(2);break}if("."===s){this.unput(1);break}if("e"===s||"E"===s){this.unput(2);break}}else{if("."===t){if(e){this.unput(1);break}if("_"===s){this.unput(2);break}e=!0;continue}if("e"===t||"E"===t){if("_"===s){this.unput(1);break}let e=2;if(t=this.input(),"+"!==t&&"-"!==t||(e=3,t=this.input()),this.is_NUM_START())return this.consume_LNUM(),this.tok.T_DNUMBER;this.unput(t?e:e-1);break}}if(!this.is_NUM()){t&&this.unput(1);break}}return e?this.tok.T_DNUMBER:this.yytext.length<9||this.yytext.length<10||10==this.yytext.length&&this.yytext<"2147483648"?this.tok.T_LNUMBER:this.tok.T_DNUMBER},consume_HNUM:function(){for(;this.offset<this.size;){const t=this.input();if(!this.is_HEX()){t&&this.unput(1);break}}return this.tok.T_LNUMBER},consume_LNUM:function(){for(;this.offset<this.size;){const t=this.input();if(!this.is_NUM()){t&&this.unput(1);break}}return this.tok.T_LNUMBER},consume_BNUM:function(){let t;for(;this.offset<this.size;)if(t=this.input(),"0"!==t&&"1"!==t&&"_"!==t){t&&this.unput(1);break}return this.tok.T_LNUMBER},consume_ONUM:function(){for(;this.offset<this.size;){const t=this.input();if(!this.is_OCTAL()){t&&this.unput(1);break}}return this.tok.T_LNUMBER}},c={matchST_LOOKING_FOR_PROPERTY:function(){let t=this.input();if("-"===t){if(t=this.input(),">"===t)return this.tok.T_OBJECT_OPERATOR;t&&this.unput(1)}else{if(this.is_WHITESPACE())return this.tok.T_WHITESPACE;if(this.is_LABEL_START())return this.consume_LABEL(),this.popState(),this.tok.T_STRING}return this.popState(),t&&this.unput(1),!1},matchST_LOOKING_FOR_VARNAME:function(){let t=this.input();if(this.popState(),this.begin("ST_IN_SCRIPTING"),this.is_LABEL_START()){if(this.consume_LABEL(),t=this.input(),"["===t||"}"===t)return this.unput(1),this.tok.T_STRING_VARNAME;this.unput(this.yytext.length)}else t&&this.unput(1);return!1},matchST_VAR_OFFSET:function(){const t=this.input();if(this.is_NUM_START())return this.consume_NUM(),this.tok.T_NUM_STRING;if("]"===t)return this.popState(),"]";if("$"===t){if(this.input(),this.is_LABEL_START())return this.consume_LABEL(),this.tok.T_VARIABLE;throw new Error("Unexpected terminal")}if(this.is_LABEL_START())return this.consume_LABEL(),this.tok.T_STRING;if(this.is_WHITESPACE()||"\\"===t||"'"===t||"#"===t)return this.tok.T_ENCAPSED_AND_WHITESPACE;if("["===t||"{"===t||"}"===t||'"'===t||"`"===t||this.is_TOKEN())return t;throw new Error("Unexpected terminal")}},l={matchST_IN_SCRIPTING:function(){let t=this.input();switch(t){case" ":case"\t":case"\n":case"\r":case"\r\n":return this.T_WHITESPACE();case"#":return this.version>=800&&"["===this._input[this.offset]?(this.input(),this.attributeListDepth[++this.attributeIndex]=0,this.begin("ST_ATTRIBUTE"),this.tok.T_ATTRIBUTE):this.T_COMMENT();case"/":return"/"===this._input[this.offset]?this.T_COMMENT():"*"===this._input[this.offset]?(this.input(),this.T_DOC_COMMENT()):this.consume_TOKEN();case"'":return this.T_CONSTANT_ENCAPSED_STRING();case'"':return this.ST_DOUBLE_QUOTES();case"`":return this.begin("ST_BACKQUOTE"),"`";case"?":if(!this.aspTagMode&&this.tryMatch(">")){this.input();const t=this._input[this.offset];return"\n"!==t&&"\r"!==t||this.input(),this.conditionStack.length>1&&this.begin("INITIAL"),this.tok.T_CLOSE_TAG}return this.consume_TOKEN();case"%":return this.aspTagMode&&">"===this._input[this.offset]?(this.input(),t=this._input[this.offset],"\n"!==t&&"\r"!==t||this.input(),this.aspTagMode=!1,this.conditionStack.length>1&&this.begin("INITIAL"),this.tok.T_CLOSE_TAG):this.consume_TOKEN();case"{":return this.begin("ST_IN_SCRIPTING"),"{";case"}":return this.conditionStack.length>2&&this.popState(),"}";default:if("."===t){if(t=this.input(),this.is_NUM_START())return this.consume_NUM();t&&this.unput(1)}if(this.is_NUM_START())return this.consume_NUM();if(this.is_LABEL_START())return this.consume_LABEL().T_STRING();if(this.is_TOKEN())return this.consume_TOKEN()}throw new Error('Bad terminal sequence "'+t+'" at line '+this.yylineno+" (offset "+this.offset+")")},T_WHITESPACE:function(){for(;this.offset<this.size;){const t=this.input();if(" "!==t&&"\t"!==t&&"\n"!==t&&"\r"!==t){t&&this.unput(1);break}}return this.tok.T_WHITESPACE}};const u=["\n","\r"],_=["\n","\r",";"],p=_.concat(["\t"," ",",","]",")","/","=","!"]);var d={T_CONSTANT_ENCAPSED_STRING:function(){let t;for(;this.offset<this.size;)if(t=this.input(),"\\"==t)this.input();else if("'"==t)break;return this.tok.T_CONSTANT_ENCAPSED_STRING},is_HEREDOC:function(){const t=this.offset;if("<"===this._input[this.offset-1]&&"<"===this._input[this.offset]&&"<"===this._input[this.offset+1]){if(this.offset+=3,this.is_TABSPACE())for(;this.offset<this.size&&(this.offset++,this.is_TABSPACE()););let e=this._input[this.offset-1];if("'"===e||'"'===e?this.offset++:e=null,this.is_LABEL_START()){let s=this.offset-1;for(;this.offset<this.size&&(this.offset++,this.is_LABEL()););const i=this._input.substring(s,this.offset-1);if((!e||e===this._input[this.offset-1])&&(e&&this.offset++,u.includes(this._input[this.offset-1])))return this.heredoc_label.label=i,this.heredoc_label.length=i.length,this.heredoc_label.finished=!1,s=this.offset-t,this.offset=t,this.consume(s),"'"===e?this.begin("ST_NOWDOC"):this.begin("ST_HEREDOC"),this.prematch_ENDOFDOC(),this.tok.T_START_HEREDOC}}return this.offset=t,!1},ST_DOUBLE_QUOTES:function(){let t;for(;this.offset<this.size;)if(t=this.input(),"\\"==t)this.input();else{if('"'==t)break;if("$"==t){if(t=this.input(),"{"==t||this.is_LABEL_START()){this.unput(2);break}t&&this.unput(1)}else if("{"==t){if(t=this.input(),"$"==t){this.unput(2);break}t&&this.unput(1)}}if('"'==t)return this.tok.T_CONSTANT_ENCAPSED_STRING;{let t=1;return"b"!==this.yytext[0]&&"B"!==this.yytext[0]||(t=2),this.yytext.length>2&&this.appendToken(this.tok.T_ENCAPSED_AND_WHITESPACE,this.yytext.length-t),this.unput(this.yytext.length-t),this.begin("ST_DOUBLE_QUOTES"),this.yytext}},isDOC_MATCH:function(t,e){const s=this._input[t-2];if(!u.includes(s))return!1;let i=!1,n=!1,r=0,o=this._input[t-1];if(this.version>=703){for(;"\t"===o||" "===o;)" "===o?i=!0:"\t"===o&&(n=!0),o=this._input[t+r],r++;if(t+=r,u.includes(this._input[t-1]))return!1}if(this._input.substring(t-1,t-1+this.heredoc_label.length)===this.heredoc_label.label){const s=this._input[t-1+this.heredoc_label.length];if((this.version>=703?p:_).includes(s)){if(e){if(this.consume(r),i&&n)throw new Error("Parse error: mixing spaces and tabs in ending marker at line "+this.yylineno+" (offset "+this.offset+")")}else this.heredoc_label.indentation=r,this.heredoc_label.indentation_uses_spaces=i,this.heredoc_label.first_encaps_node=!0;return!0}}return!1},prematch_ENDOFDOC:function(){this.heredoc_label.indentation_uses_spaces=!1,this.heredoc_label.indentation=0,this.heredoc_label.first_encaps_node=!0;let t=this.offset+1;for(;t<this._input.length;){if(this.isDOC_MATCH(t,!1))return;if(!u.includes(this._input[t-1]))for(;!u.includes(this._input[t++])&&t<this._input.length;);t++}},matchST_NOWDOC:function(){if(this.isDOC_MATCH(this.offset,!0))return this.consume(this.heredoc_label.length),this.popState(),this.tok.T_END_HEREDOC;let t=this._input[this.offset-1];for(;this.offset<this.size;)if(u.includes(t)){if(t=this.input(),this.isDOC_MATCH(this.offset,!0))return this.unput(1).popState(),this.appendToken(this.tok.T_END_HEREDOC,this.heredoc_label.length),this.tok.T_ENCAPSED_AND_WHITESPACE}else t=this.input();return this.tok.T_ENCAPSED_AND_WHITESPACE},matchST_HEREDOC:function(){let t=this.input();if(this.isDOC_MATCH(this.offset,!0))return this.consume(this.heredoc_label.length-1),this.popState(),this.tok.T_END_HEREDOC;for(;this.offset<this.size;)if("\\"===t&&(t=this.input(),u.includes(t)||(t=this.input())),u.includes(t)){if(t=this.input(),this.isDOC_MATCH(this.offset,!0))return this.unput(1).popState(),this.appendToken(this.tok.T_END_HEREDOC,this.heredoc_label.length),this.tok.T_ENCAPSED_AND_WHITESPACE}else if("$"===t){if(t=this.input(),"{"===t)return this.begin("ST_LOOKING_FOR_VARNAME"),this.yytext.length>2?(this.appendToken(this.tok.T_DOLLAR_OPEN_CURLY_BRACES,2),this.unput(2),this.tok.T_ENCAPSED_AND_WHITESPACE):this.tok.T_DOLLAR_OPEN_CURLY_BRACES;if(this.is_LABEL_START()){const t=this.offset,e=this.consume_VARIABLE();return this.yytext.length>this.offset-t+2?(this.appendToken(e,this.offset-t+2),this.unput(this.offset-t+2),this.tok.T_ENCAPSED_AND_WHITESPACE):e}}else if("{"===t){if(t=this.input(),"$"===t)return this.begin("ST_IN_SCRIPTING"),this.yytext.length>2?(this.appendToken(this.tok.T_CURLY_OPEN,1),this.unput(2),this.tok.T_ENCAPSED_AND_WHITESPACE):(this.unput(1),this.tok.T_CURLY_OPEN)}else t=this.input();return this.tok.T_ENCAPSED_AND_WHITESPACE},consume_VARIABLE:function(){this.consume_LABEL();const t=this.input();if("["==t)return this.unput(1),this.begin("ST_VAR_OFFSET"),this.tok.T_VARIABLE;if("-"===t){if(">"===this.input())return this.input(),this.is_LABEL_START()&&this.begin("ST_LOOKING_FOR_PROPERTY"),this.unput(3),this.tok.T_VARIABLE;this.unput(2)}else t&&this.unput(1);return this.tok.T_VARIABLE},matchST_BACKQUOTE:function(){let t=this.input();if("$"===t){if(t=this.input(),"{"===t)return this.begin("ST_LOOKING_FOR_VARNAME"),this.tok.T_DOLLAR_OPEN_CURLY_BRACES;if(this.is_LABEL_START()){return this.consume_VARIABLE()}}else if("{"===t){if("$"===this._input[this.offset])return this.begin("ST_IN_SCRIPTING"),this.tok.T_CURLY_OPEN}else if("`"===t)return this.popState(),"`";for(;this.offset<this.size;){if("\\"===t)this.input();else{if("`"===t){this.unput(1),this.popState(),this.appendToken("`",1);break}if("$"===t){if(t=this.input(),"{"===t)return this.begin("ST_LOOKING_FOR_VARNAME"),this.yytext.length>2?(this.appendToken(this.tok.T_DOLLAR_OPEN_CURLY_BRACES,2),this.unput(2),this.tok.T_ENCAPSED_AND_WHITESPACE):this.tok.T_DOLLAR_OPEN_CURLY_BRACES;if(this.is_LABEL_START()){const t=this.offset,e=this.consume_VARIABLE();return this.yytext.length>this.offset-t+2?(this.appendToken(e,this.offset-t+2),this.unput(this.offset-t+2),this.tok.T_ENCAPSED_AND_WHITESPACE):e}continue}if("{"===t){if(t=this.input(),"$"===t)return this.begin("ST_IN_SCRIPTING"),this.yytext.length>2?(this.appendToken(this.tok.T_CURLY_OPEN,1),this.unput(2),this.tok.T_ENCAPSED_AND_WHITESPACE):(this.unput(1),this.tok.T_CURLY_OPEN);continue}}t=this.input()}return this.tok.T_ENCAPSED_AND_WHITESPACE},matchST_DOUBLE_QUOTES:function(){let t=this.input();if("$"===t){if(t=this.input(),"{"===t)return this.begin("ST_LOOKING_FOR_VARNAME"),this.tok.T_DOLLAR_OPEN_CURLY_BRACES;if(this.is_LABEL_START()){return this.consume_VARIABLE()}}else if("{"===t){if("$"===this._input[this.offset])return this.begin("ST_IN_SCRIPTING"),this.tok.T_CURLY_OPEN}else if('"'===t)return this.popState(),'"';for(;this.offset<this.size;){if("\\"===t)this.input();else{if('"'===t){this.unput(1),this.popState(),this.appendToken('"',1);break}if("$"===t){if(t=this.input(),"{"===t)return this.begin("ST_LOOKING_FOR_VARNAME"),this.yytext.length>2?(this.appendToken(this.tok.T_DOLLAR_OPEN_CURLY_BRACES,2),this.unput(2),this.tok.T_ENCAPSED_AND_WHITESPACE):this.tok.T_DOLLAR_OPEN_CURLY_BRACES;if(this.is_LABEL_START()){const t=this.offset,e=this.consume_VARIABLE();return this.yytext.length>this.offset-t+2?(this.appendToken(e,this.offset-t+2),this.unput(this.offset-t+2),this.tok.T_ENCAPSED_AND_WHITESPACE):e}t&&this.unput(1)}else if("{"===t){if(t=this.input(),"$"===t)return this.begin("ST_IN_SCRIPTING"),this.yytext.length>2?(this.appendToken(this.tok.T_CURLY_OPEN,1),this.unput(2),this.tok.T_ENCAPSED_AND_WHITESPACE):(this.unput(1),this.tok.T_CURLY_OPEN);t&&this.unput(1)}}t=this.input()}return this.tok.T_ENCAPSED_AND_WHITESPACE}};var f={is_NUM:function(){const t=this._input.charCodeAt(this.offset-1);return t>47&&t<58||95===t},is_NUM_START:function(){const t=this._input.charCodeAt(this.offset-1);return t>47&&t<58},is_LABEL:function(){const t=this._input.charCodeAt(this.offset-1);return t>96&&t<123||t>64&&t<91||95===t||t>47&&t<58||t>126},is_LABEL_START:function(){const t=this._input.charCodeAt(this.offset-1);return t>64&&t<91||(t>96&&t<123||(95===t||t>126))},consume_LABEL:function(){for(;this.offset<this.size;){const t=this.input();if(!this.is_LABEL()){t&&this.unput(1);break}}return this},is_TOKEN:function(){const t=this._input[this.offset-1];return-1!==";:,.\\[]()|^&+-/*=%!~$<>?@".indexOf(t)},is_WHITESPACE:function(){const t=this._input[this.offset-1];return" "===t||"\t"===t||"\n"===t||"\r"===t},is_TABSPACE:function(){const t=this._input[this.offset-1];return" "===t||"\t"===t},consume_TABSPACE:function(){for(;this.offset<this.size;){const t=this.input();if(!this.is_TABSPACE()){t&&this.unput(1);break}}return this},is_HEX:function(){const t=this._input.charCodeAt(this.offset-1);return t>47&&t<58||(t>64&&t<71||(t>96&&t<103||95===t))},is_OCTAL:function(){const t=this._input.charCodeAt(this.offset-1);return t>47&&t<56||95===t}};const k=function(t){this.engine=t,this.tok=this.engine.tokens.names,this.EOF=1,this.debug=!1,this.all_tokens=!0,this.comment_tokens=!1,this.mode_eval=!1,this.asp_tags=!1,this.short_tags=!1,this.version=801,this.yyprevcol=0,this.keywords={__class__:this.tok.T_CLASS_C,__trait__:this.tok.T_TRAIT_C,__function__:this.tok.T_FUNC_C,__method__:this.tok.T_METHOD_C,__line__:this.tok.T_LINE,__file__:this.tok.T_FILE,__dir__:this.tok.T_DIR,__namespace__:this.tok.T_NS_C,exit:this.tok.T_EXIT,die:this.tok.T_EXIT,function:this.tok.T_FUNCTION,const:this.tok.T_CONST,return:this.tok.T_RETURN,try:this.tok.T_TRY,catch:this.tok.T_CATCH,finally:this.tok.T_FINALLY,throw:this.tok.T_THROW,if:this.tok.T_IF,elseif:this.tok.T_ELSEIF,endif:this.tok.T_ENDIF,else:this.tok.T_ELSE,while:this.tok.T_WHILE,endwhile:this.tok.T_ENDWHILE,do:this.tok.T_DO,for:this.tok.T_FOR,endfor:this.tok.T_ENDFOR,foreach:this.tok.T_FOREACH,endforeach:this.tok.T_ENDFOREACH,declare:this.tok.T_DECLARE,enddeclare:this.tok.T_ENDDECLARE,instanceof:this.tok.T_INSTANCEOF,as:this.tok.T_AS,switch:this.tok.T_SWITCH,endswitch:this.tok.T_ENDSWITCH,case:this.tok.T_CASE,default:this.tok.T_DEFAULT,break:this.tok.T_BREAK,continue:this.tok.T_CONTINUE,goto:this.tok.T_GOTO,echo:this.tok.T_ECHO,print:this.tok.T_PRINT,class:this.tok.T_CLASS,interface:this.tok.T_INTERFACE,trait:this.tok.T_TRAIT,enum:this.tok.T_ENUM,extends:this.tok.T_EXTENDS,implements:this.tok.T_IMPLEMENTS,new:this.tok.T_NEW,clone:this.tok.T_CLONE,var:this.tok.T_VAR,eval:this.tok.T_EVAL,include:this.tok.T_INCLUDE,include_once:this.tok.T_INCLUDE_ONCE,require:this.tok.T_REQUIRE,require_once:this.tok.T_REQUIRE_ONCE,namespace:this.tok.T_NAMESPACE,use:this.tok.T_USE,insteadof:this.tok.T_INSTEADOF,global:this.tok.T_GLOBAL,isset:this.tok.T_ISSET,empty:this.tok.T_EMPTY,__halt_compiler:this.tok.T_HALT_COMPILER,static:this.tok.T_STATIC,abstract:this.tok.T_ABSTRACT,final:this.tok.T_FINAL,private:this.tok.T_PRIVATE,protected:this.tok.T_PROTECTED,public:this.tok.T_PUBLIC,unset:this.tok.T_UNSET,list:this.tok.T_LIST,array:this.tok.T_ARRAY,callable:this.tok.T_CALLABLE,or:this.tok.T_LOGICAL_OR,and:this.tok.T_LOGICAL_AND,xor:this.tok.T_LOGICAL_XOR,match:this.tok.T_MATCH,readonly:this.tok.T_READ_ONLY},this.castKeywords={int:this.tok.T_INT_CAST,integer:this.tok.T_INT_CAST,real:this.tok.T_DOUBLE_CAST,double:this.tok.T_DOUBLE_CAST,float:this.tok.T_DOUBLE_CAST,string:this.tok.T_STRING_CAST,binary:this.tok.T_STRING_CAST,array:this.tok.T_ARRAY_CAST,object:this.tok.T_OBJECT_CAST,bool:this.tok.T_BOOL_CAST,boolean:this.tok.T_BOOL_CAST,unset:this.tok.T_UNSET_CAST}};k.prototype.setInput=function(t){return this._input=t,this.size=t.length,this.yylineno=1,this.offset=0,this.yyprevcol=0,this.yytext="",this.yylloc={first_offset:0,first_line:1,first_column:0,prev_offset:0,prev_line:1,prev_column:0,last_line:1,last_column:0},this.tokens=[],this.version>703?this.keywords.fn=this.tok.T_FN:delete this.keywords.fn,this.done=this.offset>=this.size,!this.all_tokens&&this.mode_eval?(this.conditionStack=["INITIAL"],this.begin("ST_IN_SCRIPTING")):(this.conditionStack=[],this.begin("INITIAL")),this.heredoc_label={label:"",length:0,indentation:0,indentation_uses_spaces:!1,finished:!1,first_encaps_node:!1,toString:function(){this.label}},this},k.prototype.input=function(){const t=this._input[this.offset];return t?(this.yytext+=t,this.offset++,"\r"===t&&"\n"===this._input[this.offset]&&(this.yytext+="\n",this.offset++),"\n"===t||"\r"===t?(this.yylloc.last_line=++this.yylineno,this.yyprevcol=this.yylloc.last_column,this.yylloc.last_column=0):this.yylloc.last_column++,t):""},k.prototype.unput=function(t){if(1===t)this.offset--,"\n"===this._input[this.offset]&&"\r"===this._input[this.offset-1]&&(this.offset--,t++),"\r"===this._input[this.offset]||"\n"===this._input[this.offset]?(this.yylloc.last_line--,this.yylineno--,this.yylloc.last_column=this.yyprevcol):this.yylloc.last_column--,this.yytext=this.yytext.substring(0,this.yytext.length-t);else if(t>0)if(this.offset-=t,t<this.yytext.length){this.yytext=this.yytext.substring(0,this.yytext.length-t),this.yylloc.last_line=this.yylloc.first_line,this.yylloc.last_column=this.yyprevcol=this.yylloc.first_column;for(let t=0;t<this.yytext.length;t++){let e=this.yytext[t];"\r"===e?(e=this.yytext[++t],this.yyprevcol=this.yylloc.last_column,this.yylloc.last_line++,this.yylloc.last_column=0,"\n"!==e&&("\r"===e?this.yylloc.last_line++:this.yylloc.last_column++)):"\n"===e?(this.yyprevcol=this.yylloc.last_column,this.yylloc.last_line++,this.yylloc.last_column=0):this.yylloc.last_column++}this.yylineno=this.yylloc.last_line}else this.yytext="",this.yylloc.last_line=this.yylineno=this.yylloc.first_line,this.yylloc.last_column=this.yylloc.first_column;return this},k.prototype.tryMatch=function(t){return t===this.ahead(t.length)},k.prototype.tryMatchCaseless=function(t){return t===this.ahead(t.length).toLowerCase()},k.prototype.ahead=function(t){let e=this._input.substring(this.offset,this.offset+t);return"\r"===e[e.length-1]&&"\n"===this._input[this.offset+t+1]&&(e+="\n"),e},k.prototype.consume=function(t){for(let e=0;e<t;e++){const t=this._input[this.offset];if(!t)break;this.yytext+=t,this.offset++,"\r"===t&&"\n"===this._input[this.offset]&&(this.yytext+="\n",this.offset++,e++),"\n"===t||"\r"===t?(this.yylloc.last_line=++this.yylineno,this.yyprevcol=this.yylloc.last_column,this.yylloc.last_column=0):this.yylloc.last_column++}return this},k.prototype.getState=function(){return{yytext:this.yytext,offset:this.offset,yylineno:this.yylineno,yyprevcol:this.yyprevcol,yylloc:{first_offset:this.yylloc.first_offset,first_line:this.yylloc.first_line,first_column:this.yylloc.first_column,last_line:this.yylloc.last_line,last_column:this.yylloc.last_column},heredoc_label:this.heredoc_label}},k.prototype.setState=function(t){return this.yytext=t.yytext,this.offset=t.offset,this.yylineno=t.yylineno,this.yyprevcol=t.yyprevcol,this.yylloc=t.yylloc,t.heredoc_label&&(this.heredoc_label=t.heredoc_label),this},k.prototype.appendToken=function(t,e){return this.tokens.push([t,e]),this},k.prototype.lex=function(){this.yylloc.prev_offset=this.offset,this.yylloc.prev_line=this.yylloc.last_line,this.yylloc.prev_column=this.yylloc.last_column;let t=this.next()||this.lex();if(!this.all_tokens){for(;t===this.tok.T_WHITESPACE||!this.comment_tokens&&(t===this.tok.T_COMMENT||t===this.tok.T_DOC_COMMENT)||t===this.tok.T_OPEN_TAG;)t=this.next()||this.lex();if(t==this.tok.T_OPEN_TAG_WITH_ECHO)return this.tok.T_ECHO;if(t===this.tok.T_CLOSE_TAG)return";"}return this.yylloc.prev_offset||(this.yylloc.prev_offset=this.yylloc.first_offset,this.yylloc.prev_line=this.yylloc.first_line,this.yylloc.prev_column=this.yylloc.first_column),t},k.prototype.begin=function(t){if(this.conditionStack.push(t),this.curCondition=t,this.stateCb=this["match"+t],"function"!=typeof this.stateCb)throw new Error('Undefined condition state "'+t+'"');return this},k.prototype.popState=function(){const t=this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0];if(this.curCondition=this.conditionStack[this.conditionStack.length-1],this.stateCb=this["match"+this.curCondition],"function"!=typeof this.stateCb)throw new Error('Undefined condition state "'+this.curCondition+'"');return t},k.prototype.next=function(){let t;if(this._input||(this.done=!0),this.yylloc.first_offset=this.offset,this.yylloc.first_line=this.yylloc.last_line,this.yylloc.first_column=this.yylloc.last_column,this.yytext="",this.done)return this.yylloc.prev_offset=this.yylloc.first_offset,this.yylloc.prev_line=this.yylloc.first_line,this.yylloc.prev_column=this.yylloc.first_column,this.EOF;if(this.tokens.length>0?(t=this.tokens.shift(),"object"==typeof t[1]?this.setState(t[1]):this.consume(t[1]),t=t[0]):t=this.stateCb.apply(this,[]),this.offset>=this.size&&0===this.tokens.length&&(this.done=!0),this.debug){let e=t;e="number"==typeof e?this.engine.tokens.values[e]:'"'+e+'"';const s=new Error(e+"\tfrom "+this.yylloc.first_line+","+this.yylloc.first_column+"\t - to "+this.yylloc.last_line+","+this.yylloc.last_column+'\t"'+this.yytext+'"');console.error(s.stack)}return t},[h,{T_COMMENT:function(){for(;this.offset<this.size;){const t=this.input();if("\n"===t||"\r"===t)return this.tok.T_COMMENT;if("?"===t&&!this.aspTagMode&&">"===this._input[this.offset])return this.unput(1),this.tok.T_COMMENT;if("%"===t&&this.aspTagMode&&">"===this._input[this.offset])return this.unput(1),this.tok.T_COMMENT}return this.tok.T_COMMENT},T_DOC_COMMENT:function(){let t=this.input(),e=this.tok.T_COMMENT;if("*"===t){if(t=this.input(),this.is_WHITESPACE()&&(e=this.tok.T_DOC_COMMENT),"/"===t)return e;this.unput(1)}for(;this.offset<this.size;)if(t=this.input(),"*"===t&&"/"===this._input[this.offset]){this.input();break}return e}},{nextINITIAL:function(){return this.conditionStack.length>1&&"INITIAL"===this.conditionStack[this.conditionStack.length-1]?this.popState():this.begin("ST_IN_SCRIPTING"),this},matchINITIAL:function(){for(;this.offset<this.size;){let t=this.input();if("<"==t)if(t=this.ahead(1),"?"==t){if(this.tryMatch("?=")){this.unput(1).appendToken(this.tok.T_OPEN_TAG_WITH_ECHO,3).nextINITIAL();break}if(this.tryMatchCaseless("?php")&&(t=this._input[this.offset+4]," "===t||"\t"===t||"\n"===t||"\r"===t)){this.unput(1).appendToken(this.tok.T_OPEN_TAG,6).nextINITIAL();break}if(this.short_tags){this.unput(1).appendToken(this.tok.T_OPEN_TAG,2).nextINITIAL();break}}else if(this.asp_tags&&"%"==t){if(this.tryMatch("%=")){this.aspTagMode=!0,this.unput(1).appendToken(this.tok.T_OPEN_TAG_WITH_ECHO,3).nextINITIAL();break}this.aspTagMode=!0,this.unput(1).appendToken(this.tok.T_OPEN_TAG,2).nextINITIAL();break}}return this.yytext.length>0&&this.tok.T_INLINE_HTML}},a,c,l,d,{T_STRING:function(){const t=this.yytext.toLowerCase();let e=this.keywords[t];if("number"!=typeof e)if("yield"===t)this.version>=700&&this.tryMatch(" from")?(this.consume(5),e=this.tok.T_YIELD_FROM):e=this.tok.T_YIELD;else if(e=this.tok.T_STRING,"b"===t||"B"===t){const t=this.input();if('"'===t)return this.ST_DOUBLE_QUOTES();if("'"===t)return this.T_CONSTANT_ENCAPSED_STRING();t&&this.unput(1)}if(e===this.tok.T_ENUM){if(this.version<801)return this.tok.T_STRING;const t=this.offset;let e=this.input();for(;" "==e;)e=this.input();let s=!1;if(this.is_LABEL_START()){for(;this.is_LABEL();)e+=this.input();const t=e.slice(0,-1).toLowerCase();s="extends"!==t&&"implements"!==t}return this.unput(this.offset-t),s?this.tok.T_ENUM:this.tok.T_STRING}if(this.offset<this.size&&e!==this.tok.T_YIELD_FROM){let s=this.input();if("\\"===s){e="namespace"===t?this.tok.T_NAME_RELATIVE:this.tok.T_NAME_QUALIFIED;do{if("{"===this._input[this.offset]){this.input();break}this.consume_LABEL(),s=this.input()}while("\\"===s)}s&&this.unput(1)}return e},consume_TOKEN:function(){const t=this._input[this.offset-1],e=this.tokenTerminals[t];return e?e.apply(this,[]):this.yytext},tokenTerminals:{$:function(){return this.offset++,this.is_LABEL_START()?(this.offset--,this.consume_LABEL(),this.tok.T_VARIABLE):(this.offset--,"$")},"-":function(){const t=this._input[this.offset];return">"===t?(this.begin("ST_LOOKING_FOR_PROPERTY").input(),this.tok.T_OBJECT_OPERATOR):"-"===t?(this.input(),this.tok.T_DEC):"="===t?(this.input(),this.tok.T_MINUS_EQUAL):"-"},"\\":function(){if(this.offset<this.size){if(this.input(),this.is_LABEL_START()){let t;do{if("{"===this._input[this.offset]){this.input();break}this.consume_LABEL(),t=this.input()}while("\\"===t);return this.unput(1),this.tok.T_NAME_FULLY_QUALIFIED}this.unput(1)}return this.tok.T_NS_SEPARATOR},"/":function(){return"="===this._input[this.offset]?(this.input(),this.tok.T_DIV_EQUAL):"/"},":":function(){return":"===this._input[this.offset]?(this.input(),this.tok.T_DOUBLE_COLON):":"},"(":function(){const t=this.offset;if(this.input(),this.is_TABSPACE()&&this.consume_TABSPACE().input(),this.is_LABEL_START()){const t=this.yytext.length;this.consume_LABEL();const e=this.yytext.substring(t-1).toLowerCase(),s=this.castKeywords[e];if("number"==typeof s&&(this.input(),this.is_TABSPACE()&&this.consume_TABSPACE().input(),")"===this._input[this.offset-1]))return s}return this.unput(this.offset-t),"("},"=":function(){const t=this._input[this.offset];return">"===t?(this.input(),this.tok.T_DOUBLE_ARROW):"="===t?"="===this._input[this.offset+1]?(this.consume(2),this.tok.T_IS_IDENTICAL):(this.input(),this.tok.T_IS_EQUAL):"="},"+":function(){const t=this._input[this.offset];return"+"===t?(this.input(),this.tok.T_INC):"="===t?(this.input(),this.tok.T_PLUS_EQUAL):"+"},"!":function(){return"="===this._input[this.offset]?"="===this._input[this.offset+1]?(this.consume(2),this.tok.T_IS_NOT_IDENTICAL):(this.input(),this.tok.T_IS_NOT_EQUAL):"!"},"?":function(){return this.version>=700&&"?"===this._input[this.offset]?this.version>=704&&"="===this._input[this.offset+1]?(this.consume(2),this.tok.T_COALESCE_EQUAL):(this.input(),this.tok.T_COALESCE):this.version>=800&&"-"===this._input[this.offset]&&">"===this._input[this.offset+1]?(this.consume(2),this.tok.T_NULLSAFE_OBJECT_OPERATOR):"?"},"<":function(){let t=this._input[this.offset];return"<"===t?(t=this._input[this.offset+1],"="===t?(this.consume(2),this.tok.T_SL_EQUAL):"<"===t&&this.is_HEREDOC()?this.tok.T_START_HEREDOC:(this.input(),this.tok.T_SL)):"="===t?(this.input(),this.version>=700&&">"===this._input[this.offset]?(this.input(),this.tok.T_SPACESHIP):this.tok.T_IS_SMALLER_OR_EQUAL):">"===t?(this.input(),this.tok.T_IS_NOT_EQUAL):"<"},">":function(){let t=this._input[this.offset];return"="===t?(this.input(),this.tok.T_IS_GREATER_OR_EQUAL):">"===t?(t=this._input[this.offset+1],"="===t?(this.consume(2),this.tok.T_SR_EQUAL):(this.input(),this.tok.T_SR)):">"},"*":function(){const t=this._input[this.offset];return"="===t?(this.input(),this.tok.T_MUL_EQUAL):"*"===t?(this.input(),"="===this._input[this.offset]?(this.input(),this.tok.T_POW_EQUAL):this.tok.T_POW):"*"},".":function(){const t=this._input[this.offset];return"="===t?(this.input(),this.tok.T_CONCAT_EQUAL):"."===t&&"."===this._input[this.offset+1]?(this.consume(2),this.tok.T_ELLIPSIS):"."},"%":function(){return"="===this._input[this.offset]?(this.input(),this.tok.T_MOD_EQUAL):"%"},"&":function(){const t=this._input[this.offset];return"="===t?(this.input(),this.tok.T_AND_EQUAL):"&"===t?(this.input(),this.tok.T_BOOLEAN_AND):"&"},"|":function(){const t=this._input[this.offset];return"="===t?(this.input(),this.tok.T_OR_EQUAL):"|"===t?(this.input(),this.tok.T_BOOLEAN_OR):"|"},"^":function(){return"="===this._input[this.offset]?(this.input(),this.tok.T_XOR_EQUAL):"^"}}},f].forEach((function(t){for(const e in t)k.prototype[e]=t[e]}));var T=k;var x=function(t,e,s){this.line=t,this.column=e,this.offset=s},E={read_expr:function(t){const e=this.node();if("@"===this.token)return t||(t=this.next().read_expr()),e("silent",t);if(t||(t=this.read_expr_item()),"|"===this.token)return e("bin","|",t,this.next().read_expr());if("&"===this.token)return e("bin","&",t,this.next().read_expr());if("^"===this.token)return e("bin","^",t,this.next().read_expr());if("."===this.token)return e("bin",".",t,this.next().read_expr());if("+"===this.token)return e("bin","+",t,this.next().read_expr());if("-"===this.token)return e("bin","-",t,this.next().read_expr());if("*"===this.token)return e("bin","*",t,this.next().read_expr());if("/"===this.token)return e("bin","/",t,this.next().read_expr());if("%"===this.token)return e("bin","%",t,this.next().read_expr());if(this.token===this.tok.T_POW)return e("bin","**",t,this.next().read_expr());if(this.token===this.tok.T_SL)return e("bin","<<",t,this.next().read_expr());if(this.token===this.tok.T_SR)return e("bin",">>",t,this.next().read_expr());if(this.token===this.tok.T_BOOLEAN_OR)return e("bin","||",t,this.next().read_expr());if(this.token===this.tok.T_LOGICAL_OR)return e("bin","or",t,this.next().read_expr());if(this.token===this.tok.T_BOOLEAN_AND)return e("bin","&&",t,this.next().read_expr());if(this.token===this.tok.T_LOGICAL_AND)return e("bin","and",t,this.next().read_expr());if(this.token===this.tok.T_LOGICAL_XOR)return e("bin","xor",t,this.next().read_expr());if(this.token===this.tok.T_IS_IDENTICAL)return e("bin","===",t,this.next().read_expr());if(this.token===this.tok.T_IS_NOT_IDENTICAL)return e("bin","!==",t,this.next().read_expr());if(this.token===this.tok.T_IS_EQUAL)return e("bin","==",t,this.next().read_expr());if(this.token===this.tok.T_IS_NOT_EQUAL)return e("bin","!=",t,this.next().read_expr());if("<"===this.token)return e("bin","<",t,this.next().read_expr());if(">"===this.token)return e("bin",">",t,this.next().read_expr());if(this.token===this.tok.T_IS_SMALLER_OR_EQUAL)return e("bin","<=",t,this.next().read_expr());if(this.token===this.tok.T_IS_GREATER_OR_EQUAL)return e("bin",">=",t,this.next().read_expr());if(this.token===this.tok.T_SPACESHIP)return e("bin","<=>",t,this.next().read_expr());if(this.token===this.tok.T_INSTANCEOF&&(t=e("bin","instanceof",t,this.next().read_class_name_reference()),";"!==this.token&&this.token!==this.tok.T_INLINE_HTML&&this.token!==this.EOF&&(t=this.read_expr(t))),this.token===this.tok.T_COALESCE)return e("bin","??",t,this.next().read_expr());if("?"===this.token){let s=null;return":"!==this.next().token&&(s=this.read_expr()),this.expect(":")&&this.next(),e("retif",t,s,this.read_expr())}return e.destroy(t),t},read_expr_cast:function(t){return this.node("cast")(t,this.text(),this.next().read_expr())},read_isset_variable:function(){return this.read_expr()},read_isset_variables:function(){return this.read_function_list(this.read_isset_variable,",")},read_internal_functions_in_yacc:function(){let t=null;switch(this.token){case this.tok.T_ISSET:{t=this.node("isset"),this.next().expect("(")&&this.next();const e=this.read_isset_variables();this.expect(")")&&this.next(),t=t(e)}break;case this.tok.T_EMPTY:{t=this.node("empty"),this.next().expect("(")&&this.next();const e=this.read_expr();this.expect(")")&&this.next(),t=t(e)}break;case this.tok.T_INCLUDE:t=this.node("include")(!1,!1,this.next().read_expr());break;case this.tok.T_INCLUDE_ONCE:t=this.node("include")(!0,!1,this.next().read_expr());break;case this.tok.T_EVAL:{t=this.node("eval"),this.next().expect("(")&&this.next();const e=this.read_expr();this.expect(")")&&this.next(),t=t(e)}break;case this.tok.T_REQUIRE:t=this.node("include")(!1,!0,this.next().read_expr());break;case this.tok.T_REQUIRE_ONCE:t=this.node("include")(!0,!0,this.next().read_expr())}return t},read_optional_expr:function(t){return this.token!==t?this.read_expr():null},read_exit_expr:function(){let t=null;return"("===this.token&&(this.next(),t=this.read_optional_expr(")"),this.expect(")")&&this.next()),t},read_expr_item:function(){let t,e,s=[];if("+"===this.token)return this.node("unary")("+",this.next().read_expr());if("-"===this.token)return this.node("unary")("-",this.next().read_expr());if("!"===this.token)return this.node("unary")("!",this.next().read_expr());if("~"===this.token)return this.node("unary")("~",this.next().read_expr());if("("===this.token)return e=this.next().read_expr(),e.parenthesizedExpression=!0,this.expect(")")&&this.next(),this.handleDereferencable(e);if("`"===this.token)return this.read_encapsed_string("`");if(this.token===this.tok.T_LIST){let e=null;const s=this.innerList;t=this.node("list"),s||(e=this.node("assign")),this.next().expect("(")&&this.next(),this.innerList||(this.innerList=!0);const i=this.read_array_pair_list(!1);this.expect(")")&&this.next();let n=!1;for(let t=0;t<i.length;t++)if(null!==i[t]&&"noop"!==i[t].kind){n=!0;break}return n||this.raiseError("Fatal Error : Cannot use empty list on line "+this.lexer.yylloc.first_line),s?t(i,!1):(this.innerList=!1,this.expect("=")?e(t(i,!1),this.next().read_expr(),"="):t(i,!1))}if(this.token===this.tok.T_ATTRIBUTE&&(s=this.read_attr_list()),this.token===this.tok.T_CLONE)return this.node("clone")(this.next().read_expr());switch(this.token){case this.tok.T_INC:return this.node("pre")("+",this.next().read_variable(!1,!1));case this.tok.T_DEC:return this.node("pre")("-",this.next().read_variable(!1,!1));case this.tok.T_NEW:return this.read_new_expr();case this.tok.T_ISSET:case this.tok.T_EMPTY:case this.tok.T_INCLUDE:case this.tok.T_INCLUDE_ONCE:case this.tok.T_EVAL:case this.tok.T_REQUIRE:case this.tok.T_REQUIRE_ONCE:return this.read_internal_functions_in_yacc();case this.tok.T_MATCH:return this.read_match_expression();case this.tok.T_INT_CAST:return this.read_expr_cast("int");case this.tok.T_DOUBLE_CAST:return this.read_expr_cast("float");case this.tok.T_STRING_CAST:return this.read_expr_cast(-1!==this.text().indexOf("binary")?"binary":"string");case this.tok.T_ARRAY_CAST:return this.read_expr_cast("array");case this.tok.T_OBJECT_CAST:return this.read_expr_cast("object");case this.tok.T_BOOL_CAST:return this.read_expr_cast("bool");case this.tok.T_UNSET_CAST:return this.read_expr_cast("unset");case this.tok.T_THROW:this.version<800&&this.raiseError("PHP 8+ is required to use throw as an expression");return this.node("throw")(this.next().read_expr());case this.tok.T_EXIT:{const e="die"===this.lexer.yytext.toLowerCase();t=this.node("exit"),this.next();return t(this.read_exit_expr(),e)}case this.tok.T_PRINT:return this.node("print")(this.next().read_expr());case this.tok.T_YIELD:{let e=null,s=null;return t=this.node("yield"),this.next().is("EXPR")&&(e=this.read_expr(),this.token===this.tok.T_DOUBLE_ARROW&&(s=e,e=this.next().read_expr())),t(e,s)}case this.tok.T_YIELD_FROM:return t=this.node("yieldfrom"),e=this.next().read_expr(),t(e);case this.tok.T_FN:case this.tok.T_FUNCTION:return this.read_inline_function(void 0,s);case this.tok.T_STATIC:{const t=[this.token,this.lexer.getState()];if(this.next(),this.token===this.tok.T_FUNCTION||this.version>=704&&this.token===this.tok.T_FN)return this.read_inline_function([0,1,0],s);this.lexer.tokens.push(t),this.next()}}if(this.is("VARIABLE")){t=this.node(),e=this.read_variable(!1,!1);const s="identifier"===e.kind||"staticlookup"===e.kind&&"identifier"===e.offset.kind;switch(this.token){case"=":return s&&this.error("VARIABLE"),"&"==this.next().token?this.read_assignref(t,e):t("assign",e,this.read_expr(),"=");case this.tok.T_PLUS_EQUAL:return s&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"+=");case this.tok.T_MINUS_EQUAL:return s&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"-=");case this.tok.T_MUL_EQUAL:return s&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"*=");case this.tok.T_POW_EQUAL:return s&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"**=");case this.tok.T_DIV_EQUAL:return s&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"/=");case this.tok.T_CONCAT_EQUAL:return s&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),".=");case this.tok.T_MOD_EQUAL:return s&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"%=");case this.tok.T_AND_EQUAL:return s&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"&=");case this.tok.T_OR_EQUAL:return s&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"|=");case this.tok.T_XOR_EQUAL:return s&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"^=");case this.tok.T_SL_EQUAL:return s&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"<<=");case this.tok.T_SR_EQUAL:return s&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),">>=");case this.tok.T_COALESCE_EQUAL:return s&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"??=");case this.tok.T_INC:return s&&this.error("VARIABLE"),this.next(),t("post","+",e);case this.tok.T_DEC:return s&&this.error("VARIABLE"),this.next(),t("post","-",e);default:t.destroy(e)}}else{if(this.is("SCALAR")){if(t=this.node(),e=this.read_scalar(),"array"===e.kind&&e.shortForm&&"="===this.token){const s=this.convertToList(e);e.loc&&(s.loc=e.loc);return t("assign",s,this.next().read_expr(),"=")}return t.destroy(e),this.handleDereferencable(e)}this.error("EXPR"),this.next()}return e},convertToList:function(t){const e=t.items.map((t=>(t.value&&"array"===t.value.kind&&t.value.shortForm&&(t.value=this.convertToList(t.value)),t))),s=this.node("list")(e,!0);return t.loc&&(s.loc=t.loc),t.leadingComments&&(s.leadingComments=t.leadingComments),t.trailingComments&&(s.trailingComments=t.trailingComments),s},read_assignref:function(t,e){let s;return this.next(),this.token===this.tok.T_NEW?(this.version>=700&&this.error(),s=this.read_new_expr()):s=this.read_variable(!1,!1),t("assignref",e,s)},read_inline_function:function(t,e){if(this.token===this.tok.T_FUNCTION){const s=this.read_function(!0,t,e);return s.attrGroups=e,s}!this.version>=704&&this.raiseError("Arrow Functions are not allowed");const s=this.node("arrowfunc");this.expect(this.tok.T_FN)&&this.next();const i=this.is_reference();this.expect("(")&&this.next();const n=this.read_parameter_list();this.expect(")")&&this.next();let r=!1,o=null;":"===this.token&&("?"===this.next().token&&(r=!0,this.next()),o=this.read_types()),this.expect(this.tok.T_DOUBLE_ARROW)&&this.next();const h=s(n,i,this.read_expr(),o,r,!!t);return h.attrGroups=e,h},read_match_expression:function(){const t=this.node("match");this.expect(this.tok.T_MATCH)&&this.next(),this.version<800&&this.raiseError("Match statements are not allowed before PHP 8");let e=null,s=[];return this.expect("(")&&this.next(),e=this.read_expr(),this.expect(")")&&this.next(),this.expect("{")&&this.next(),s=this.read_match_arms(),this.expect("}")&&this.next(),t(e,s)},read_match_arms:function(){return this.read_list((()=>this.read_match_arm()),",",!0)},read_match_arm:function(){if("}"!==this.token)return this.node("matcharm")(this.read_match_arm_conds(),this.read_expr())},read_match_arm_conds:function(){let t=[];if(this.token===this.tok.T_DEFAULT)t=null,this.next();else for(t.push(this.read_expr());","===this.token;){if(this.next(),this.token===this.tok.T_DOUBLE_ARROW)return this.next(),t;t.push(this.read_expr())}return this.expect(this.tok.T_DOUBLE_ARROW)&&this.next(),t},read_attribute(){const t=this.text();let e=[];return this.next(),"("===this.token&&(e=this.read_argument_list()),this.node("attribute")(t,e)},read_attr_list(){const t=[];if(this.token===this.tok.T_ATTRIBUTE)do{const e=this.node("attrgroup")([]);for(this.next(),e.attrs.push(this.read_attribute());","===this.token;)this.next(),"]"!==this.token&&e.attrs.push(this.read_attribute());t.push(e),this.expect("]"),this.next()}while(this.token===this.tok.T_ATTRIBUTE);return t},read_new_expr:function(){const t=this.node("new");this.expect(this.tok.T_NEW)&&this.next();let e=[];if("("===this.token){this.next();const s=this.read_expr();return this.expect(")"),this.next(),"("===this.token&&(e=this.read_argument_list()),t(s,e)}const s=this.read_attr_list();if(this.token===this.tok.T_CLASS){const i=this.node("class");"("===this.next().token&&(e=this.read_argument_list());const n=this.read_extends_from(),r=this.read_implements_list();let o=null;this.expect("{")&&(o=this.next().read_class_body(!0,!1));const h=i(null,n,r,o,[0,0,0]);return h.attrGroups=s,t(h,e)}let i=this.read_new_class_name();for(;"["===this.token;){const t=this.node("offsetlookup"),e=this.next().read_encaps_var_offset();this.expect("]")&&this.next(),i=t(i,e)}return"("===this.token&&(e=this.read_argument_list()),t(i,e)},read_new_class_name:function(){if(this.token===this.tok.T_NS_SEPARATOR||this.token===this.tok.T_NAME_RELATIVE||this.token===this.tok.T_NAME_QUALIFIED||this.token===this.tok.T_NAME_FULLY_QUALIFIED||this.token===this.tok.T_STRING||this.token===this.tok.T_NAMESPACE){let t=this.read_namespace_name(!0);return this.token===this.tok.T_DOUBLE_COLON&&(t=this.read_static_getter(t)),t}if(this.is("VARIABLE"))return this.read_variable(!0,!1);this.expect([this.tok.T_STRING,"VARIABLE"])},handleDereferencable:function(t){for(;this.token!==this.EOF;)if(this.token===this.tok.T_OBJECT_OPERATOR||this.token===this.tok.T_DOUBLE_COLON)t=this.recursive_variable_chain_scan(t,!1,!1,!0);else if(this.token===this.tok.T_CURLY_OPEN||"["===this.token)t=this.read_dereferencable(t);else{if("("!==this.token)return t;t=this.node("call")(t,this.read_argument_list())}return t}},m={is_reference:function(){return"&"===this.token&&(this.next(),!0)},is_variadic:function(){return this.token===this.tok.T_ELLIPSIS&&(this.next(),!0)},read_function:function(t,e,s,i){const n=this.read_function_declaration(t?1:e?2:0,e&&1===e[1],s||[],i);return e&&1==e[2]?(n.parseFlags(e),this.expect(";")&&this.next()):(this.expect("{")&&(n.body=this.read_code_block(!1),n.loc&&n.body.loc&&(n.loc.end=n.body.loc.end)),!t&&e&&n.parseFlags(e)),n},read_function_declaration:function(t,e,s,i){let n="function";1===t?n="closure":2===t&&(n="method");const r=this.node(n);this.expect(this.tok.T_FUNCTION)&&this.next();const o=this.is_reference();let h=!1,a=[],c=null,l=!1;if(1!==t){const e=this.node("identifier");2===t?this.version>=700?this.token===this.tok.T_STRING||this.is("IDENTIFIER")?(h=this.text(),this.next()):this.version<704&&this.error("IDENTIFIER"):this.token===this.tok.T_STRING?(h=this.text(),this.next()):this.error("IDENTIFIER"):this.version>=700?this.token===this.tok.T_STRING?(h=this.text(),this.next()):this.version>=704?this.expect("(")||this.next():(this.error(this.tok.T_STRING),this.next()):(this.expect(this.tok.T_STRING)&&(h=this.text()),this.next()),h=e(h)}this.expect("(")&&this.next();const u=this.read_parameter_list("__construct"===h.name);this.expect(")")&&this.next(),1===t&&(a=this.read_lexical_vars()),":"===this.token&&("?"===this.next().token&&(l=!0,this.next()),c=this.read_types());const _=t=>(t.attrGroups=s||[],i&&t.loc&&(t.loc.start=i,t.loc.source&&(t.loc.source=this.lexer._input.substr(t.loc.start.offset,t.loc.end.offset-t.loc.start.offset))),t);return _(1===t?r(u,o,a,c,l,e):r(h,u,o,c,l))},read_lexical_vars:function(){let t=[];return this.token===this.tok.T_USE&&(this.next(),this.expect("(")&&this.next(),t=this.read_lexical_var_list(),this.expect(")")&&this.next()),t},read_list_with_dangling_comma:function(t){const e=[];for(;this.token!=this.EOF;){if(e.push(t()),","!=this.token){if(")"==this.token)break;this.error([",",")"]);break}if(this.next(),this.version>=800&&")"===this.token)return e}return e},read_lexical_var_list:function(){return this.read_list_with_dangling_comma(this.read_lexical_var.bind(this))},read_lexical_var:function(){if("&"===this.token)return this.read_byref(this.read_lexical_var.bind(this));const t=this.node("variable");this.expect(this.tok.T_VARIABLE);const e=this.text().substring(1);return this.next(),t(e,!1)},read_parameter_list:function(t){if(")"!==this.token){let e=!1;return this.read_list_with_dangling_comma(function(){const s=this.read_parameter(t);return s&&(e&&this.raiseError("Unexpected parameter after a variadic parameter"),s.variadic&&(e=!0)),s}.bind(this),",")}return[]},read_parameter:function(t){const e=this.node("parameter");let s=null,i=null,n=null,r=!1,o=!1,h=[];this.token===this.tok.T_ATTRIBUTE&&(h=this.read_attr_list()),this.version>=801&&this.token===this.tok.T_READ_ONLY&&(t?(this.next(),o=!0):this.raiseError("readonly properties can be used only on class constructor"));const a=this.read_promoted();!o&&this.version>=801&&this.token===this.tok.T_READ_ONLY&&(t?(this.next(),o=!0):this.raiseError("readonly properties can be used only on class constructor")),"?"===this.token&&(this.next(),r=!0),n=this.read_types(),r&&!n&&this.raiseError("Expecting a type definition combined with nullable operator");const c=this.is_reference(),l=this.is_variadic();if(this.expect(this.tok.T_VARIABLE)){s=this.node("identifier");const t=this.text().substring(1);this.next(),s=s(t)}"="==this.token&&(i=this.next().read_expr());const u=e(s,n,i,c,l,o,r,a);return h&&(u.attrGroups=h),u},read_types(){const t="unset",e="union",s="intersection",i=[];let n=t;const r=this.read_type();if(!r)return null;for(i.push(r);"|"===this.token||this.version>=801&&"&"===this.token;){const r=this.peek();if(r===this.tok.T_ELLIPSIS||r===this.tok.T_VARIABLE)break;n===t?n="|"===this.token?e:s:(n===e&&"|"!==this.token||n===s&&"&"!==this.token)&&this.raiseError('Unexpect token "'+this.token+'", "|" and "&" can not be mixed'),this.next(),i.push(this.read_type())}return 1===i.length?i[0]:n===s?this.node("intersectiontype")(i):this.node("uniontype")(i)},read_promoted(){return this.token===this.tok.T_PUBLIC?(this.next(),1):this.token===this.tok.T_PROTECTED?(this.next(),2):this.token===this.tok.T_PRIVATE?(this.next(),4):0},read_argument_list:function(){let t=[];return this.expect("(")&&this.next(),this.version>=801&&this.token===this.tok.T_ELLIPSIS&&")"===this.peek()?(t.push(this.node("variadicplaceholder")()),this.next()):")"!==this.token&&(t=this.read_non_empty_argument_list()),this.expect(")")&&this.next(),t},read_non_empty_argument_list:function(){let t=!1;return this.read_function_list(function(){const e=this.read_argument();if(e){const s="variadic"===e.kind;t&&!s&&this.raiseError("Unexpected non-variadic argument after a variadic argument"),s&&(t=!0)}return e}.bind(this),",")},read_argument:function(){if(this.token===this.tok.T_ELLIPSIS)return this.node("variadic")(this.next().read_expr());if(this.token===this.tok.T_STRING||Object.values(this.lexer.keywords).includes(this.token)){if(":"===this.peek())return this.version<800&&this.raiseError("PHP 8+ is required to use named arguments"),this.node("namedargument")(this.text(),this.next().next().read_expr())}return this.read_expr()},read_type:function(){const t=this.node();if(this.token===this.tok.T_ARRAY||this.token===this.tok.T_CALLABLE){const e=this.text();return this.next(),t("typereference",e.toLowerCase(),e)}if(this.token===this.tok.T_NAME_RELATIVE||this.token===this.tok.T_NAME_QUALIFIED||this.token===this.tok.T_NAME_FULLY_QUALIFIED||this.token===this.tok.T_STRING||this.token===this.tok.T_STATIC){const e=this.text(),s=[this.token,this.lexer.getState()];return this.next(),this.token!==this.tok.T_NS_SEPARATOR&&this.ast.typereference.types.indexOf(e.toLowerCase())>-1?t("typereference",e.toLowerCase(),e):(this.lexer.tokens.push(s),this.next(),t.destroy(),this.read_namespace_name())}return t.destroy(),null}};const y={"\\":"\\",$:"$",n:"\n",r:"\r",t:"\t",f:String.fromCharCode(12),v:String.fromCharCode(11),e:String.fromCharCode(27)};var A={resolve_special_chars:function(t,e){return e?t.replace(/\\"/,'"').replace(/\\([\\$nrtfve]|[xX][0-9a-fA-F]{1,2}|[0-7]{1,3}|u{([0-9a-fA-F]+)})/g,((t,e,s)=>y[e]?y[e]:"x"===e[0]||"X"===e[0]?String.fromCodePoint(parseInt(e.substr(1),16)):"u"===e[0]?String.fromCodePoint(parseInt(s,16)):String.fromCodePoint(parseInt(e,8)))):t.replace(/\\\\/g,"\\").replace(/\\'/g,"'")},remove_heredoc_leading_whitespace_chars:function(t,e,s,i){if(0===e)return t;this.check_heredoc_indentation_level(t,e,s,i);const n=s?" ":"\t",r=new RegExp(`\\n${n}{${e}}`,"g"),o=new RegExp(`^${n}{${e}}`);return i&&(t=t.replace(o,"")),t.replace(r,"\n")},check_heredoc_indentation_level:function(t,e,s,i){const n=t.length;let r=0,o=0,h=!0;const a=s?" ":"\t";let c=!1;if(!i){if(r=t.indexOf("\n"),-1===r)return;r++}for(;r<n;)h?t[r]===a?o++:c=!0:h=!1,"\n"!==t[r]&&c&&o<e?this.raiseError(`Invalid body indentation level (expecting an indentation at least ${e})`):c=!1,"\n"===t[r]&&(h=!0,o=0),r++},read_dereferencable_scalar:function(){let t=null;switch(this.token){case this.tok.T_CONSTANT_ENCAPSED_STRING:{let e=this.node("string");const s=this.text();let i=0;"b"!==s[0]&&"B"!==s[0]||(i=1);const n='"'===s[i];this.next();e=e(n,this.resolve_special_chars(s.substring(i+1,s.length-1),n),1===i,s),t=this.token===this.tok.T_DOUBLE_COLON?this.read_static_getter(e):e}break;case this.tok.T_ARRAY:case"[":t=this.read_array()}return t},read_scalar:function(){if(this.is("T_MAGIC_CONST"))return this.get_magic_constant();{let t,e;switch(this.token){case this.tok.T_LNUMBER:case this.tok.T_DNUMBER:{const e=this.node("number");return t=this.text(),this.next(),e(t,null)}case this.tok.T_START_HEREDOC:if("ST_NOWDOC"===this.lexer.curCondition){const s=this.lexer.yylloc.first_offset;e=this.node("nowdoc"),t=this.next().text(),this.lexer.heredoc_label.indentation>0&&(t=t.substring(0,t.length-this.lexer.heredoc_label.indentation));const i=t[t.length-1];"\n"===i?t="\r"===t[t.length-2]?t.substring(0,t.length-2):t.substring(0,t.length-1):"\r"===i&&(t=t.substring(0,t.length-1)),this.expect(this.tok.T_ENCAPSED_AND_WHITESPACE)&&this.next(),this.expect(this.tok.T_END_HEREDOC)&&this.next();const n=this.lexer._input.substring(s,this.lexer.yylloc.first_offset);return e=e(this.remove_heredoc_leading_whitespace_chars(t,this.lexer.heredoc_label.indentation,this.lexer.heredoc_label.indentation_uses_spaces,this.lexer.heredoc_label.first_encaps_node),n,this.lexer.heredoc_label.label),this.lexer.heredoc_label.finished=!0,e}return this.read_encapsed_string(this.tok.T_END_HEREDOC);case'"':return this.read_encapsed_string('"');case'b"':case'B"':return this.read_encapsed_string('"',!0);case this.tok.T_CONSTANT_ENCAPSED_STRING:case this.tok.T_ARRAY:case"[":return this.read_dereferencable_scalar();default:{const t=this.error("SCALAR");return this.next(),t}}}},read_dereferencable:function(t){let e,s;const i=this.node("offsetlookup");return"["===this.token?(s=this.next().read_expr(),this.expect("]")&&this.next(),e=i(t,s)):this.token===this.tok.T_DOLLAR_OPEN_CURLY_BRACES&&(s=this.read_encapsed_string_item(!1),e=i(t,s)),e},read_encapsed_string_item:function(t){const e=this.node("encapsedpart");let s,i,n,r=null,o=!1,h=this.node();if(this.token===this.tok.T_ENCAPSED_AND_WHITESPACE){const e=this.text();this.next(),h=h("string",!1,this.version>=703&&!this.lexer.heredoc_label.finished?this.remove_heredoc_leading_whitespace_chars(this.resolve_special_chars(e,t),this.lexer.heredoc_label.indentation,this.lexer.heredoc_label.indentation_uses_spaces,this.lexer.heredoc_label.first_encaps_node):e,!1,e)}else if(this.token===this.tok.T_DOLLAR_OPEN_CURLY_BRACES){if(r="simple",o=!0,n=null,this.next().token===this.tok.T_STRING_VARNAME){n=this.node("variable");const t=this.text();this.next(),h.destroy(),"["===this.token?(n=n(t,!1),i=this.node("offsetlookup"),s=this.next().read_expr(),this.expect("]")&&this.next(),h=i(n,s)):h=n(t,!1)}else h=h("variable",this.read_expr(),!1);this.expect("}")&&this.next()}else if(this.token===this.tok.T_CURLY_OPEN)r="complex",h.destroy(),h=this.next().read_variable(!1,!1),this.expect("}")&&this.next();else if(this.token===this.tok.T_VARIABLE){if(r="simple",h.destroy(),h=this.read_simple_variable(),"["===this.token&&(i=this.node("offsetlookup"),s=this.next().read_encaps_var_offset(),this.expect("]")&&this.next(),h=i(h,s)),this.token===this.tok.T_OBJECT_OPERATOR){i=this.node("propertylookup"),this.next().expect(this.tok.T_STRING);const t=this.node("identifier");n=this.text(),this.next(),h=i(h,t(n))}}else{this.expect(this.tok.T_ENCAPSED_AND_WHITESPACE);const t=this.text();this.next(),h.destroy(),h=h("string",!1,t,!1,t)}return this.lexer.heredoc_label.first_encaps_node=!1,e(h,r,o)},read_encapsed_string:function(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const s=this.lexer.yylloc.first_offset;let i=this.node("encapsed");this.next();const n=this.lexer.yylloc.prev_offset-(e?1:0),r=[];let o=null;for(o="`"===t?this.ast.encapsed.TYPE_SHELL:'"'===t?this.ast.encapsed.TYPE_STRING:this.ast.encapsed.TYPE_HEREDOC;this.token!==t&&this.token!==this.EOF;)r.push(this.read_encapsed_string_item(!0));if(r.length>0&&"encapsedpart"===r[r.length-1].kind&&"string"===r[r.length-1].expression.kind){const t=r[r.length-1].expression,e=t.value[t.value.length-1];"\n"===e?"\r"===t.value[t.value.length-2]?t.value=t.value.substring(0,t.value.length-2):t.value=t.value.substring(0,t.value.length-1):"\r"===e&&(t.value=t.value.substring(0,t.value.length-1))}this.expect(t)&&this.next();return i=i(r,this.lexer._input.substring("heredoc"===o?s:n-1,this.lexer.yylloc.first_offset),o),t===this.tok.T_END_HEREDOC&&(i.label=this.lexer.heredoc_label.label,this.lexer.heredoc_label.finished=!0),i},get_magic_constant:function(){const t=this.node("magic"),e=this.text();return this.next(),t(e.toUpperCase(),e)}},N={read_top_statements:function(){let t=[];for(;this.token!==this.EOF&&"}"!==this.token;){const e=this.read_top_statement();e&&(Array.isArray(e)?t=t.concat(e):t.push(e))}return t},read_top_statement:function(){let t=[];switch(this.token===this.tok.T_ATTRIBUTE&&(t=this.read_attr_list()),this.token){case this.tok.T_FUNCTION:return this.read_function(!1,!1,t);case this.tok.T_ABSTRACT:case this.tok.T_FINAL:case this.tok.T_READ_ONLY:case this.tok.T_CLASS:return this.read_class_declaration_statement(t);case this.tok.T_INTERFACE:return this.read_interface_declaration_statement(t);case this.tok.T_TRAIT:return this.read_trait_declaration_statement();case this.tok.T_ENUM:return this.read_enum_declaration_statement(t);case this.tok.T_USE:return this.read_use_statement();case this.tok.T_CONST:{const t=this.node("constantstatement"),e=this.next().read_const_list();return this.expectEndOfStatement(),t(null,e)}case this.tok.T_NAMESPACE:return this.read_namespace();case this.tok.T_HALT_COMPILER:{const t=this.node("halt");return this.next().expect("(")&&this.next(),this.expect(")")&&this.next(),this.expect(";"),this.lexer.done=!0,t(this.lexer._input.substring(this.lexer.offset))}default:return this.read_statement()}},read_inner_statements:function(){let t=[];for(;this.token!=this.EOF&&"}"!==this.token;){const e=this.read_inner_statement();e&&(Array.isArray(e)?t=t.concat(e):t.push(e))}return t},read_const_list:function(){return this.read_list((function(){this.expect(this.tok.T_STRING);const t=this.node("constant");let e=this.node("identifier");const s=this.text();return this.next(),e=e(s),this.expect("=")?t(e,this.next().read_expr()):t(e,null)}),",",!1)},read_declare_list:function(){const t=[];for(;this.token!=this.EOF&&")"!==this.token;){this.expect(this.tok.T_STRING);const e=this.node("declaredirective");let s=this.node("identifier");const i=this.text();this.next(),s=s(i);let n=null;if(this.expect("=")&&(n=this.next().read_expr()),t.push(e(s,n)),","!==this.token)break;this.next()}return t},read_inner_statement:function(){let t=[];switch(this.token===this.tok.T_ATTRIBUTE&&(t=this.read_attr_list()),this.token){case this.tok.T_FUNCTION:{const e=this.read_function(!1,!1);return e.attrGroups=t,e}case this.tok.T_ABSTRACT:case this.tok.T_FINAL:case this.tok.T_CLASS:return this.read_class_declaration_statement();case this.tok.T_INTERFACE:return this.read_interface_declaration_statement();case this.tok.T_TRAIT:return this.read_trait_declaration_statement();case this.tok.T_ENUM:return this.read_enum_declaration_statement();case this.tok.T_HALT_COMPILER:{this.raiseError("__HALT_COMPILER() can only be used from the outermost scope");let t=this.node("halt");return this.next().expect("(")&&this.next(),this.expect(")")&&this.next(),t=t(this.lexer._input.substring(this.lexer.offset)),this.expect(";")&&this.next(),t}default:return this.read_statement()}},read_statement:function(){switch(this.token){case"{":return this.read_code_block(!1);case this.tok.T_IF:return this.read_if();case this.tok.T_SWITCH:return this.read_switch();case this.tok.T_FOR:return this.read_for();case this.tok.T_FOREACH:return this.read_foreach();case this.tok.T_WHILE:return this.read_while();case this.tok.T_DO:return this.read_do();case this.tok.T_COMMENT:return this.read_comment();case this.tok.T_DOC_COMMENT:return this.read_doc_comment();case this.tok.T_RETURN:{const t=this.node("return");this.next();const e=this.read_optional_expr(";");return this.expectEndOfStatement(),t(e)}case this.tok.T_BREAK:case this.tok.T_CONTINUE:{const t=this.node(this.token===this.tok.T_CONTINUE?"continue":"break");this.next();const e=this.read_optional_expr(";");return this.expectEndOfStatement(),t(e)}case this.tok.T_GLOBAL:{const t=this.node("global"),e=this.next().read_list(this.read_simple_variable,",");return this.expectEndOfStatement(),t(e)}case this.tok.T_STATIC:{const t=[this.token,this.lexer.getState()],e=this.node();if(this.next().token===this.tok.T_DOUBLE_COLON){this.lexer.tokens.push(t);const s=this.next().read_expr();return this.expectEndOfStatement(s),e("expressionstatement",s)}if(this.token===this.tok.T_FUNCTION)return this.read_function(!0,[0,1,0]);const s=this.read_variable_declarations();return this.expectEndOfStatement(),e("static",s)}case this.tok.T_ECHO:{const t=this.node("echo"),e=this.text(),s="<?="===e||"<%="===e,i=this.next().read_function_list(this.read_expr,",");return this.expectEndOfStatement(),t(i,s)}case this.tok.T_INLINE_HTML:{const t=this.text();let e=this.lexer.yylloc.first_offset>0?this.lexer._input[this.lexer.yylloc.first_offset-1]:null;const s="\r"===e||"\n"===e;s&&"\n"===e&&this.lexer.yylloc.first_offset>1&&"\r"===this.lexer._input[this.lexer.yylloc.first_offset-2]&&(e="\r\n");const i=this.node("inline");return this.next(),i(t,s?e+t:t)}case this.tok.T_UNSET:{const t=this.node("unset");this.next().expect("(")&&this.next();const e=this.read_function_list(this.read_variable,",");return this.expect(")")&&this.next(),this.expect(";")&&this.next(),t(e)}case this.tok.T_DECLARE:{const t=this.node("declare"),e=[];let s;this.next().expect("(")&&this.next();const i=this.read_declare_list();if(this.expect(")")&&this.next(),":"===this.token){for(this.next();this.token!=this.EOF&&this.token!==this.tok.T_ENDDECLARE;)e.push(this.read_top_statement());0===e.length&&this.extractDoc&&this._docs.length>this._docIndex&&e.push(this.node("noop")()),this.expect(this.tok.T_ENDDECLARE)&&this.next(),this.expectEndOfStatement(),s=this.ast.declare.MODE_SHORT}else if("{"===this.token){for(this.next();this.token!=this.EOF&&"}"!==this.token;)e.push(this.read_top_statement());0===e.length&&this.extractDoc&&this._docs.length>this._docIndex&&e.push(this.node("noop")()),this.expect("}")&&this.next(),s=this.ast.declare.MODE_BLOCK}else this.expect(";")&&this.next(),s=this.ast.declare.MODE_NONE;return t(i,e,s)}case this.tok.T_TRY:return this.read_try();case this.tok.T_THROW:{const t=this.node("throw"),e=this.next().read_expr();return this.expectEndOfStatement(),t(e)}case";":return this.next(),null;case this.tok.T_STRING:{const t=this.node(),e=[this.token,this.lexer.getState()],s=this.text();let i=this.node("identifier");if(":"===this.next().token)return i=i(s),this.next(),t("label",i);i.destroy(),t.destroy(),this.lexer.tokens.push(e);const n=this.node("expressionstatement"),r=this.next().read_expr();return this.expectEndOfStatement(r),n(r)}case this.tok.T_GOTO:{const t=this.node("goto");let e=null;if(this.next().expect(this.tok.T_STRING)){e=this.node("identifier");const t=this.text();this.next(),e=e(t),this.expectEndOfStatement()}return t(e)}default:{const t=this.node("expressionstatement"),e=this.read_expr();return this.expectEndOfStatement(e),t(e)}}},read_code_block:function(t){const e=this.node("block");this.expect("{")&&this.next();const s=t?this.read_top_statements():this.read_inner_statements();return 0===s.length&&this.extractDoc&&this._docs.length>this._docIndex&&s.push(this.node("noop")()),this.expect("}")&&this.next(),e(null,s)}},g={read_variable:function(t,e){let s;if("&"===this.token)return this.read_byref(this.read_variable.bind(this,t,e));if(this.is([this.tok.T_VARIABLE,"$"]))s=this.read_reference_variable(e);else if(this.is([this.tok.T_NS_SEPARATOR,this.tok.T_STRING,this.tok.T_NAME_RELATIVE,this.tok.T_NAME_QUALIFIED,this.tok.T_NAME_FULLY_QUALIFIED,this.tok.T_NAMESPACE])){s=this.node();const t=this.read_namespace_name();if(this.token!=this.tok.T_DOUBLE_COLON&&"("!=this.token&&-1===["parentreference","selfreference"].indexOf(t.kind)){const e=t.name.toLowerCase();"true"===e?s=t.destroy(s("boolean",!0,t.name)):"false"===e?s=t.destroy(s("boolean",!1,t.name)):"null"===e?s=t.destroy(s("nullkeyword",t.name)):(s.destroy(t),s=t)}else s.destroy(t),s=t}else if(this.token===this.tok.T_STATIC){s=this.node("staticreference");const t=this.text();this.next(),s=s(t)}else this.expect("VARIABLE");return this.token===this.tok.T_DOUBLE_COLON&&(s=this.read_static_getter(s,e)),this.recursive_variable_chain_scan(s,t,e)},read_static_getter:function(t,e){const s=this.node("staticlookup");let i,n;return this.next().is([this.tok.T_VARIABLE,"$"])?i=this.read_reference_variable(e):this.token===this.tok.T_STRING||this.token===this.tok.T_CLASS||this.version>=700&&this.is("IDENTIFIER")?(i=this.node("identifier"),n=this.text(),this.next(),i=i(n)):"{"===this.token?(i=this.node("literal"),n=this.next().read_expr(),this.expect("}")&&this.next(),i=i("literal",n,null),this.expect("(")):(this.error([this.tok.T_VARIABLE,this.tok.T_STRING]),i=this.node("identifier"),n=this.text(),this.next(),i=i(n)),s(t,i)},read_what:function(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=null,s=null;switch(this.next().token){case this.tok.T_STRING:e=this.node("identifier"),s=this.text(),this.next(),e=e(s),t&&this.token===this.tok.T_OBJECT_OPERATOR&&this.error();break;case this.tok.T_VARIABLE:e=this.node("variable"),s=this.text().substring(1),this.next(),e=e(s,!1);break;case"$":e=this.node(),this.next().expect(["$","{",this.tok.T_VARIABLE]),"{"===this.token?(s=this.next().read_expr(),this.expect("}")&&this.next(),e=e("variable",s,!0)):(s=this.read_expr(),e=e("variable",s,!1));break;case"{":e=this.node("encapsedpart"),s=this.next().read_expr(),this.expect("}")&&this.next(),e=e(s,"complex",!1);break;default:this.error([this.tok.T_STRING,this.tok.T_VARIABLE,"$","{"]),e=this.node("identifier"),s=this.text(),this.next(),e=e(s)}return e},recursive_variable_chain_scan:function(t,e,s){let i,n;t:for(;this.token!=this.EOF;)switch(this.token){case"(":if(e)return t;t=this.node("call")(t,this.read_argument_list());break;case"[":case"{":{const e="["===this.token;if(i=this.node("offsetlookup"),this.next(),n=!1,s)n=this.read_encaps_var_offset(),this.expect(e?"]":"}")&&this.next();else{(e?"]"!==this.token:"}"!==this.token)?(n=this.read_expr(),this.expect(e?"]":"}")&&this.next()):this.next()}t=i(t,n);break}case this.tok.T_DOUBLE_COLON:"staticlookup"===t.kind&&"identifier"===t.offset.kind&&this.error(),i=this.node("staticlookup"),t=i(t,this.read_what(!0));break;case this.tok.T_OBJECT_OPERATOR:i=this.node("propertylookup"),t=i(t,this.read_what());break;case this.tok.T_NULLSAFE_OBJECT_OPERATOR:i=this.node("nullsafepropertylookup"),t=i(t,this.read_what());break;default:break t}return t},read_encaps_var_offset:function(){let t=this.node();if(this.token===this.tok.T_STRING){const e=this.text();this.next(),t=t("identifier",e)}else if(this.token===this.tok.T_NUM_STRING){const e=this.text();this.next(),t=t("number",e,null)}else if("-"===this.token){this.next();const e=-1*this.text();this.expect(this.tok.T_NUM_STRING)&&this.next(),t=t("number",e,null)}else if(this.token===this.tok.T_VARIABLE){const e=this.text().substring(1);this.next(),t=t("variable",e,!1)}else{this.expect([this.tok.T_STRING,this.tok.T_NUM_STRING,"-",this.tok.T_VARIABLE]);const e=this.text();this.next(),t=t("identifier",e)}return t},read_reference_variable:function(t){let e,s=this.read_simple_variable();for(;this.token!=this.EOF;){const i=this.node();if("{"!=this.token||t){i.destroy();break}e=this.next().read_expr(),this.expect("}")&&this.next(),s=i("offsetlookup",s,e)}return s},read_simple_variable:function(){let t,e=this.node("variable");if(this.expect([this.tok.T_VARIABLE,"$"])&&this.token===this.tok.T_VARIABLE)t=this.text().substring(1),this.next(),e=e(t,!1);else switch("$"===this.token&&this.next(),this.token){case"{":{const t=this.next().read_expr();this.expect("}")&&this.next(),e=e(t,!0);break}case"$":e=e(this.read_simple_variable(),!1);break;case this.tok.T_VARIABLE:{t=this.text().substring(1);const s=this.node("variable");this.next(),e=e(s(t,!1),!1);break}default:this.error(["{","$",this.tok.T_VARIABLE]),t=this.text(),this.next(),e=e(t,!1)}return e}};const L=x;function b(t){return"."!=t&&","!=t&&!isNaN(parseFloat(t))&&isFinite(t)}const I=function(t,e){this.lexer=t,this.ast=e,this.tok=t.tok,this.EOF=t.EOF,this.token=null,this.prev=null,this.debug=!1,this.version=801,this.extractDoc=!1,this.extractTokens=!1,this.suppressErrors=!1;const s=function(t){return[t,null]};this.entries={IDENTIFIER:new Map([this.tok.T_ABSTRACT,this.tok.T_ARRAY,this.tok.T_AS,this.tok.T_BREAK,this.tok.T_CALLABLE,this.tok.T_CASE,this.tok.T_CATCH,this.tok.T_CLASS,this.tok.T_CLASS_C,this.tok.T_CLONE,this.tok.T_CONST,this.tok.T_CONTINUE,this.tok.T_DECLARE,this.tok.T_DEFAULT,this.tok.T_DIR,this.tok.T_DO,this.tok.T_ECHO,this.tok.T_ELSE,this.tok.T_ELSEIF,this.tok.T_EMPTY,this.tok.T_ENDDECLARE,this.tok.T_ENDFOR,this.tok.T_ENDFOREACH,this.tok.T_ENDIF,this.tok.T_ENDSWITCH,this.tok.T_ENDWHILE,this.tok.T_ENUM,this.tok.T_EVAL,this.tok.T_EXIT,this.tok.T_EXTENDS,this.tok.T_FILE,this.tok.T_FINAL,this.tok.T_FINALLY,this.tok.T_FN,this.tok.T_FOR,this.tok.T_FOREACH,this.tok.T_FUNC_C,this.tok.T_FUNCTION,this.tok.T_GLOBAL,this.tok.T_GOTO,this.tok.T_IF,this.tok.T_IMPLEMENTS,this.tok.T_INCLUDE,this.tok.T_INCLUDE_ONCE,this.tok.T_INSTANCEOF,this.tok.T_INSTEADOF,this.tok.T_INTERFACE,this.tok.T_ISSET,this.tok.T_LINE,this.tok.T_LIST,this.tok.T_LOGICAL_AND,this.tok.T_LOGICAL_OR,this.tok.T_LOGICAL_XOR,this.tok.T_MATCH,this.tok.T_METHOD_C,this.tok.T_NAMESPACE,this.tok.T_NEW,this.tok.T_NS_C,this.tok.T_PRINT,this.tok.T_PRIVATE,this.tok.T_PROTECTED,this.tok.T_PUBLIC,this.tok.T_READ_ONLY,this.tok.T_REQUIRE,this.tok.T_REQUIRE_ONCE,this.tok.T_RETURN,this.tok.T_STATIC,this.tok.T_SWITCH,this.tok.T_THROW,this.tok.T_TRAIT,this.tok.T_TRY,this.tok.T_UNSET,this.tok.T_USE,this.tok.T_VAR,this.tok.T_WHILE,this.tok.T_YIELD].map(s)),VARIABLE:new Map([this.tok.T_VARIABLE,"$","&",this.tok.T_STRING,this.tok.T_NAME_RELATIVE,this.tok.T_NAME_QUALIFIED,this.tok.T_NAME_FULLY_QUALIFIED,this.tok.T_NAMESPACE,this.tok.T_STATIC].map(s)),SCALAR:new Map([this.tok.T_CONSTANT_ENCAPSED_STRING,this.tok.T_START_HEREDOC,this.tok.T_LNUMBER,this.tok.T_DNUMBER,this.tok.T_ARRAY,"[",this.tok.T_CLASS_C,this.tok.T_TRAIT_C,this.tok.T_FUNC_C,this.tok.T_METHOD_C,this.tok.T_LINE,this.tok.T_FILE,this.tok.T_DIR,this.tok.T_NS_C,'"','b"','B"',"-",this.tok.T_NS_SEPARATOR].map(s)),T_MAGIC_CONST:new Map([this.tok.T_CLASS_C,this.tok.T_TRAIT_C,this.tok.T_FUNC_C,this.tok.T_METHOD_C,this.tok.T_LINE,this.tok.T_FILE,this.tok.T_DIR,this.tok.T_NS_C].map(s)),T_MEMBER_FLAGS:new Map([this.tok.T_PUBLIC,this.tok.T_PRIVATE,this.tok.T_PROTECTED,this.tok.T_STATIC,this.tok.T_ABSTRACT,this.tok.T_FINAL].map(s)),EOS:new Map([";",this.EOF,this.tok.T_INLINE_HTML].map(s)),EXPR:new Map(["@","-","+","!","~","(","`",this.tok.T_LIST,this.tok.T_CLONE,this.tok.T_INC,this.tok.T_DEC,this.tok.T_NEW,this.tok.T_ISSET,this.tok.T_EMPTY,this.tok.T_MATCH,this.tok.T_INCLUDE,this.tok.T_INCLUDE_ONCE,this.tok.T_REQUIRE,this.tok.T_REQUIRE_ONCE,this.tok.T_EVAL,this.tok.T_INT_CAST,this.tok.T_DOUBLE_CAST,this.tok.T_STRING_CAST,this.tok.T_ARRAY_CAST,this.tok.T_OBJECT_CAST,this.tok.T_BOOL_CAST,this.tok.T_UNSET_CAST,this.tok.T_EXIT,this.tok.T_PRINT,this.tok.T_YIELD,this.tok.T_STATIC,this.tok.T_FUNCTION,this.tok.T_FN,this.tok.T_VARIABLE,"$",this.tok.T_NS_SEPARATOR,this.tok.T_STRING,this.tok.T_NAME_RELATIVE,this.tok.T_NAME_QUALIFIED,this.tok.T_NAME_FULLY_QUALIFIED,this.tok.T_STRING,this.tok.T_CONSTANT_ENCAPSED_STRING,this.tok.T_START_HEREDOC,this.tok.T_LNUMBER,this.tok.T_DNUMBER,this.tok.T_ARRAY,"[",this.tok.T_CLASS_C,this.tok.T_TRAIT_C,this.tok.T_FUNC_C,this.tok.T_METHOD_C,this.tok.T_LINE,this.tok.T_FILE,this.tok.T_DIR,this.tok.T_NS_C,'"','b"','B"',"-",this.tok.T_NS_SEPARATOR].map(s))}};I.prototype.getTokenName=function(t){return b(t)?t==this.EOF?"the end of file (EOF)":this.lexer.engine.tokens.values[t]:"'"+t+"'"},I.prototype.parse=function(t,e){this._errors=[],this.filename=e||"eval",this.currentNamespace=[""],this.extractDoc?this._docs=[]:this._docs=null,this.extractTokens?this._tokens=[]:this._tokens=null,this._docIndex=0,this._lastNode=null,this.lexer.setInput(t),this.lexer.all_tokens=this.extractTokens,this.lexer.comment_tokens=this.extractDoc,this.length=this.lexer._input.length,this.innerList=!1,this.innerListForm=!1;const s=this.node("program"),i=[];for(this.next();this.token!=this.EOF;)i.push(this.read_start());0===i.length&&this.extractDoc&&this._docs.length>this._docIndex&&i.push(this.node("noop")()),this.prev=[this.lexer.yylloc.last_line,this.lexer.yylloc.last_column,this.lexer.offset];const n=s(i,this._errors,this._docs,this._tokens);if(this.debug){const t=this.ast.checkNodes();if(t.length>0)throw t.forEach((function(t){t.position&&console.log("Node at line "+t.position.line+", column "+t.position.column),console.log(t.stack.join("\n"))})),new Error("Some nodes are not closed")}return n},I.prototype.raiseError=function(t,e,s,i){if(t+=" on line "+this.lexer.yylloc.first_line,!this.suppressErrors){const e=new SyntaxError(t,this.filename,this.lexer.yylloc.first_line);throw e.lineNumber=this.lexer.yylloc.first_line,e.fileName=this.filename,e.columnNumber=this.lexer.yylloc.first_column,e}const n=this.ast.prepare("error",null,this)(t,i,this.lexer.yylloc.first_line,s);return this._errors.push(n),n},I.prototype.error=function(t){let e="Parse Error : syntax error",s=this.getTokenName(this.token),i="";if(this.token!==this.EOF){if(b(this.token)){let t=this.text();t.length>10&&(t=t.substring(0,7)+"..."),s="'"+t+"' ("+s+")"}e+=", unexpected "+s}return t&&!Array.isArray(t)&&((b(t)||1===t.length)&&(i=", expecting "+this.getTokenName(t)),e+=i),this.raiseError(e,i,t,s)},I.prototype.position=function(){return new L(this.lexer.yylloc.first_line,this.lexer.yylloc.first_column,this.lexer.yylloc.first_offset)},I.prototype.node=function(t){if(this.extractDoc){let e=null;this._docIndex<this._docs.length&&(e=this._docs.slice(this._docIndex),this._docIndex=this._docs.length,this.debug&&(console.log(new Error("Append docs on "+t)),console.log(e)));const s=this.ast.prepare(t,e,this);return s.postBuild=function(t){if(this._docIndex<this._docs.length)if(this._lastNode){const t=this.prev[2];let e=this._docIndex;for(;e<this._docs.length&&!(this._docs[e].offset>t);e++);e>this._docIndex&&(this._lastNode.setTrailingComments(this._docs.slice(this._docIndex,e)),this._docIndex=e)}else this.token===this.EOF&&(t.setTrailingComments(this._docs.slice(this._docIndex)),this._docIndex=this._docs.length);this._lastNode=t}.bind(this),s}return this.ast.prepare(t,null,this)},I.prototype.expectEndOfStatement=function(t){if(";"===this.token)t&&";"===this.lexer.yytext&&t.includeToken(this);else if(this.token!==this.tok.T_INLINE_HTML&&this.token!==this.EOF)return this.error(";"),!1;return this.next(),!0};const C=["parser.next","parser.node","parser.showlog"];I.prototype.showlog=function(){const t=(new Error).stack.split("\n");let e;for(let s=2;s<t.length;s++){e=t[s].trim();let i=!1;for(let t=0;t<C.length;t++)if(e.substring(3,3+C[t].length)===C[t]){i=!0;break}if(!i)break}return console.log("Line "+this.lexer.yylloc.first_line+" : "+this.getTokenName(this.token)+">"+this.lexer.yytext+"< @--\x3e"+e),this},I.prototype.expect=function(t){if(Array.isArray(t)){if(-1===t.indexOf(this.token))return this.error(t),!1}else if(this.token!=t)return this.error(t),!1;return!0},I.prototype.text=function(){return this.lexer.yytext},I.prototype.next=function(){if(";"===this.token&&";"!==this.lexer.yytext||(this.prev=[this.lexer.yylloc.last_line,this.lexer.yylloc.last_column,this.lexer.offset]),this.lex(),this.debug&&this.showlog(),this.extractDoc)for(;this.token===this.tok.T_COMMENT||this.token===this.tok.T_DOC_COMMENT;)this.token===this.tok.T_COMMENT?this._docs.push(this.read_comment()):this._docs.push(this.read_doc_comment());return this},I.prototype.peek=function(){const t=this.lexer.getState(),e=this.lexer.lex();return this.lexer.setState(t),e},I.prototype.lex=function(){if(this.extractTokens)do{if(this.token=this.lexer.lex()||this.EOF,this.token===this.EOF)return this;let t=this.lexer.yytext;if(t=Object.prototype.hasOwnProperty.call(this.lexer.engine.tokens.values,this.token)?[this.lexer.engine.tokens.values[this.token],t,this.lexer.yylloc.first_line,this.lexer.yylloc.first_offset,this.lexer.offset]:[null,t,this.lexer.yylloc.first_line,this.lexer.yylloc.first_offset,this.lexer.offset],this._tokens.push(t),this.token===this.tok.T_CLOSE_TAG)return this.token=";",this;if(this.token===this.tok.T_OPEN_TAG_WITH_ECHO)return this.token=this.tok.T_ECHO,this}while(this.token===this.tok.T_WHITESPACE||!this.extractDoc&&(this.token===this.tok.T_COMMENT||this.token===this.tok.T_DOC_COMMENT)||this.token===this.tok.T_OPEN_TAG);else this.token=this.lexer.lex()||this.EOF;return this},I.prototype.is=function(t){return Array.isArray(t)?-1!==t.indexOf(this.token):this.entries[t].has(this.token)},[{read_array:function(){let t=null,e=!1;const s=this.node("array");this.token===this.tok.T_ARRAY?(this.next().expect("("),t=")"):(e=!0,t="]");let i=[];return this.next().token!==t&&(i=this.read_array_pair_list(e)),this.expect(t),this.next(),s(e,i)},read_array_pair_list:function(t){const e=this;return this.read_list((function(){return e.read_array_pair(t)}),",",!0)},read_array_pair:function(t){if(!t&&")"===this.token||t&&"]"===this.token)return;if(","===this.token)return this.node("noop")();const e=this.node("entry");let s=null,i=null,n=!1,r=!1;if("&"===this.token)this.next(),n=!0,i=this.read_variable(!0,!1);else if(this.token===this.tok.T_ELLIPSIS&&this.version>=704)this.next(),"&"===this.token&&this.error(),r=!0,i=this.read_expr();else{const t=this.read_expr();this.token===this.tok.T_DOUBLE_ARROW?(this.next(),s=t,"&"===this.token?(this.next(),n=!0,i=this.read_variable(!0,!1)):i=this.read_expr()):i=t}return e(s,i,n,r)}},{read_class_declaration_statement:function(t){const e=this.node("class"),s=this.read_class_modifiers();if(this.token!==this.tok.T_CLASS)return this.error(this.tok.T_CLASS),this.next(),null;this.next().expect(this.tok.T_STRING);let i=this.node("identifier");const n=this.text();this.next(),i=i(n);const r=this.read_extends_from(),o=this.read_implements_list();this.expect("{");const h=e(i,r,o,this.next().read_class_body(!0,!1),s);return t&&(h.attrGroups=t),h},read_class_modifiers:function(){const t=this.read_class_modifier({readonly:0,final_or_abstract:0});return[0,0,t.final_or_abstract,t.readonly]},read_class_modifier:function(t){return this.token===this.tok.T_READ_ONLY?(this.next(),t.readonly=1,t=this.read_class_modifier(t)):0===t.final_or_abstract&&this.token===this.tok.T_ABSTRACT?(this.next(),t.final_or_abstract=1,t=this.read_class_modifier(t)):0===t.final_or_abstract&&this.token===this.tok.T_FINAL&&(this.next(),t.final_or_abstract=2,t=this.read_class_modifier(t)),t},read_class_body:function(t,e){let s=[],i=[];for(;this.token!==this.EOF&&"}"!==this.token;){if(this.token===this.tok.T_COMMENT){s.push(this.read_comment());continue}if(this.token===this.tok.T_DOC_COMMENT){s.push(this.read_doc_comment());continue}if(this.token===this.tok.T_USE){s=s.concat(this.read_trait_use_statement());continue}if(e&&this.token===this.tok.T_CASE){const t=this.read_enum_case();this.expect(";")&&this.next(),s=s.concat(t);continue}this.token===this.tok.T_ATTRIBUTE&&(i=this.read_attr_list());const n=this.position(),r=this.read_member_flags(!1);if(this.token!==this.tok.T_CONST)if(t&&this.token===this.tok.T_VAR&&(this.next().expect(this.tok.T_VARIABLE),r[0]=null,r[1]=0),this.token===this.tok.T_FUNCTION)s.push(this.read_function(!1,r,i,n)),i=[];else if(t&&(this.token===this.tok.T_VARIABLE||this.version>=801&&this.token===this.tok.T_READ_ONLY||this.version>=704&&("?"===this.token||this.token===this.tok.T_ARRAY||this.token===this.tok.T_CALLABLE||this.token===this.tok.T_NAMESPACE||this.token===this.tok.T_NAME_FULLY_QUALIFIED||this.token===this.tok.T_NAME_QUALIFIED||this.token===this.tok.T_NAME_RELATIVE||this.token===this.tok.T_NS_SEPARATOR||this.token===this.tok.T_STRING))){const t=this.read_variable_list(r,i);i=[],this.expect(";"),this.next(),s=s.concat(t)}else this.error([this.tok.T_CONST,...t?[this.tok.T_VARIABLE]:[],...e?[this.tok.T_CASE]:[],this.tok.T_FUNCTION]),this.next();else{const t=this.read_constant_list(r,i);this.expect(";")&&this.next(),s=s.concat(t)}}return this.expect("}"),this.next(),s},read_variable_list:function(t,e){const s=this.node("propertystatement"),i=this.read_list((function(){const t=this.node("property");let s=!1;this.token===this.tok.T_READ_ONLY&&(s=!0,this.next());const[i,n]=this.read_optional_type();this.expect(this.tok.T_VARIABLE);let r=this.node("identifier");const o=this.text().substring(1);return this.next(),r=r(o),";"===this.token||","===this.token?t(r,null,s,i,n,e||[]):"="===this.token?t(r,this.next().read_expr(),s,i,n,e||[]):(this.expect([",",";","="]),t(r,null,i,n,e||[]))}),",");return s(null,i,t)},read_constant_list:function(t,e){this.expect(this.tok.T_CONST)&&this.next();const s=this.node("classconstant"),i=this.read_list((function(){const t=this.node("constant");let e=null,s=null;if(this.token===this.tok.T_STRING||this.version>=700&&this.is("IDENTIFIER")){e=this.node("identifier");const t=this.text();this.next(),e=e(t)}else this.expect("IDENTIFIER");return this.expect("=")&&(s=this.next().read_expr()),t(e,s)}),",");return s(null,i,t,e||[])},read_member_flags:function(t){const e=[-1,-1,-1];if(this.is("T_MEMBER_FLAGS")){let s=0,i=0;do{switch(this.token){case this.tok.T_PUBLIC:s=0,i=0;break;case this.tok.T_PROTECTED:s=0,i=1;break;case this.tok.T_PRIVATE:s=0,i=2;break;case this.tok.T_STATIC:s=1,i=1;break;case this.tok.T_ABSTRACT:s=2,i=1;break;case this.tok.T_FINAL:s=2,i=2}t&&(0==s&&2==i?(this.expect([this.tok.T_PUBLIC,this.tok.T_PROTECTED]),i=-1):2==s&&1==i&&(this.error(),i=-1)),-1!==e[s]?this.error():-1!==i&&(e[s]=i)}while(this.next().is("T_MEMBER_FLAGS"))}return-1==e[1]&&(e[1]=0),-1==e[2]&&(e[2]=0),e},read_optional_type:function(){let t=!1;"?"===this.token&&(t=!0,this.next());let e=this.read_types();if(t&&!e&&this.raiseError("Expecting a type definition combined with nullable operator"),!t&&!e)return[!1,null];if("|"===this.token){e=[e];do{this.next();const t=this.read_type();if(!t){this.raiseError("Expecting a type definition");break}e.push(t)}while("|"===this.token)}return[t,e]},read_interface_declaration_statement:function(t){const e=this.node("interface");if(this.token!==this.tok.T_INTERFACE)return this.error(this.tok.T_INTERFACE),this.next(),null;this.next().expect(this.tok.T_STRING);let s=this.node("identifier");const i=this.text();this.next(),s=s(i);const n=this.read_interface_extends_list();this.expect("{");return e(s,n,this.next().read_interface_body(),t||[])},read_interface_body:function(){let t=[],e=[];for(;this.token!==this.EOF&&"}"!==this.token;){if(this.token===this.tok.T_COMMENT){t.push(this.read_comment());continue}if(this.token===this.tok.T_DOC_COMMENT){t.push(this.read_doc_comment());continue}const s=this.position();e=this.read_attr_list();const i=this.read_member_flags(!0);if(this.token==this.tok.T_CONST){const s=this.read_constant_list(i,e);this.expect(";")&&this.next(),t=t.concat(s),e=[]}else if(this.token===this.tok.T_FUNCTION){const n=this.read_function_declaration(2,i,e,s);n.parseFlags(i),t.push(n),this.expect(";")&&this.next(),e=[]}else this.error([this.tok.T_CONST,this.tok.T_FUNCTION]),this.next()}return this.expect("}")&&this.next(),t},read_trait_declaration_statement:function(){const t=this.node("trait");if(this.token!==this.tok.T_TRAIT)return this.error(this.tok.T_TRAIT),this.next(),null;this.next().expect(this.tok.T_STRING);let e=this.node("identifier");const s=this.text();this.next(),e=e(s),this.expect("{");return t(e,this.next().read_class_body(!0,!1))},read_trait_use_statement:function(){const t=this.node("traituse");this.expect(this.tok.T_USE)&&this.next();const e=[this.read_namespace_name()];let s=null;for(;","===this.token;)e.push(this.next().read_namespace_name());if("{"===this.token){for(s=[];this.next().token!==this.EOF&&"}"!==this.token;)s.push(this.read_trait_use_alias()),this.expect(";");this.expect("}")&&this.next()}else this.expect(";")&&this.next();return t(e,s)},read_trait_use_alias:function(){const t=this.node();let e,s=null;if(this.is("IDENTIFIER")){e=this.node("identifier");const t=this.text();this.next(),e=e(t)}else if(e=this.read_namespace_name(),this.token===this.tok.T_DOUBLE_COLON)if(this.next(),this.token===this.tok.T_STRING||this.version>=700&&this.is("IDENTIFIER")){s=e,e=this.node("identifier");const t=this.text();this.next(),e=e(t)}else this.expect(this.tok.T_STRING);else e=e.name;if(this.token===this.tok.T_INSTEADOF)return t("traitprecedence",s,e,this.next().read_name_list());if(this.token===this.tok.T_AS){let i=null,n=null;if(this.next().is("T_MEMBER_FLAGS")&&(i=this.read_member_flags()),this.token===this.tok.T_STRING||this.version>=700&&this.is("IDENTIFIER")){n=this.node("identifier");const t=this.text();this.next(),n=n(t)}else!1===i&&this.expect(this.tok.T_STRING);return t("traitalias",s,e,n,i)}return this.expect([this.tok.T_AS,this.tok.T_INSTEADOF]),t("traitalias",s,e,null,null)}},{read_comment:function(){const t=this.text();let e=this.ast.prepare("/*"===t.substring(0,2)?"commentblock":"commentline",null,this);const s=this.lexer.yylloc.first_offset,i=this.prev;return this.prev=[this.lexer.yylloc.last_line,this.lexer.yylloc.last_column,this.lexer.offset],this.lex(),e=e(t),e.offset=s,this.prev=i,e},read_doc_comment:function(){let t=this.ast.prepare("commentblock",null,this);const e=this.lexer.yylloc.first_offset,s=this.text(),i=this.prev;return this.prev=[this.lexer.yylloc.last_line,this.lexer.yylloc.last_column,this.lexer.offset],this.lex(),t=t(s),t.offset=e,this.prev=i,t}},E,{read_enum_declaration_statement:function(t){const e=this.node("enum");if(!this.expect(this.tok.T_ENUM))return null;this.next().expect(this.tok.T_STRING);let s=this.node("identifier");const i=this.text();this.next(),s=s(i);const n=this.read_enum_value_type(),r=this.read_implements_list();this.expect("{");const o=e(s,n,r,this.next().read_class_body(!1,!0));return t&&(o.attrGroups=t),o},read_enum_value_type:function(){return":"===this.token?this.next().read_namespace_name():null},read_enum_case:function(){this.expect(this.tok.T_CASE);const t=this.node("enumcase");let e=this.node("identifier");const s=this.next().text();this.next(),e=e(s);const i="="===this.token?this.next().read_expr():null;return this.expect(";"),t(e,i)}},m,{read_if:function(){const t=this.node("if"),e=this.next().read_if_expr();let s=null,i=null,n=!1;if(":"===this.token){n=!0,this.next(),s=this.node("block");const t=[];for(;this.token!==this.EOF&&this.token!==this.tok.T_ENDIF;){if(this.token===this.tok.T_ELSEIF){i=this.read_elseif_short();break}if(this.token===this.tok.T_ELSE){i=this.read_else_short();break}t.push(this.read_inner_statement())}s=s(null,t),this.expect(this.tok.T_ENDIF)&&this.next(),this.expectEndOfStatement()}else s=this.read_statement(),this.token===this.tok.T_ELSEIF?i=this.read_if():this.token===this.tok.T_ELSE&&(i=this.next().read_statement());return t(e,s,i,n)},read_if_expr:function(){this.expect("(")&&this.next();const t=this.read_expr();return this.expect(")")&&this.next(),t},read_elseif_short:function(){let t=null;const e=this.node("if"),s=this.next().read_if_expr();this.expect(":")&&this.next();const i=this.node("block"),n=[];for(;this.token!=this.EOF&&this.token!==this.tok.T_ENDIF;){if(this.token===this.tok.T_ELSEIF){t=this.read_elseif_short();break}if(this.token===this.tok.T_ELSE){t=this.read_else_short();break}n.push(this.read_inner_statement())}return e(s,i(null,n),t,!0)},read_else_short:function(){this.next().expect(":")&&this.next();const t=this.node("block"),e=[];for(;this.token!=this.EOF&&this.token!==this.tok.T_ENDIF;)e.push(this.read_inner_statement());return t(null,e)}},{read_while:function(){const t=this.node("while");this.expect(this.tok.T_WHILE)&&this.next();let e=null,s=null,i=!1;return this.expect("(")&&this.next(),e=this.read_expr(),this.expect(")")&&this.next(),":"===this.token?(i=!0,s=this.read_short_form(this.tok.T_ENDWHILE)):s=this.read_statement(),t(e,s,i)},read_do:function(){const t=this.node("do");this.expect(this.tok.T_DO)&&this.next();let e=null,s=null;return s=this.read_statement(),this.expect(this.tok.T_WHILE)&&(this.next().expect("(")&&this.next(),e=this.read_expr(),this.expect(")")&&this.next(),this.expect(";")&&this.next()),t(e,s)},read_for:function(){const t=this.node("for");this.expect(this.tok.T_FOR)&&this.next();let e=[],s=[],i=[],n=null,r=!1;return this.expect("(")&&this.next(),";"!==this.token?(e=this.read_list(this.read_expr,","),this.expect(";")&&this.next()):this.next(),";"!==this.token?(s=this.read_list(this.read_expr,","),this.expect(";")&&this.next()):this.next(),")"!==this.token?(i=this.read_list(this.read_expr,","),this.expect(")")&&this.next()):this.next(),":"===this.token?(r=!0,n=this.read_short_form(this.tok.T_ENDFOR)):n=this.read_statement(),t(e,s,i,n,r)},read_foreach:function(){const t=this.node("foreach");this.expect(this.tok.T_FOREACH)&&this.next();let e=null,s=null,i=null,n=null,r=!1;return this.expect("(")&&this.next(),e=this.read_expr(),this.expect(this.tok.T_AS)&&(this.next(),i=this.read_foreach_variable(),this.token===this.tok.T_DOUBLE_ARROW&&(s=i,i=this.next().read_foreach_variable())),s&&"list"===s.kind&&this.raiseError("Fatal Error : Cannot use list as key element"),this.expect(")")&&this.next(),":"===this.token?(r=!0,n=this.read_short_form(this.tok.T_ENDFOREACH)):n=this.read_statement(),t(e,s,i,n,r)},read_foreach_variable:function(){if(this.token===this.tok.T_LIST||"["===this.token){const t="["===this.token,e=this.node("list");this.next(),!t&&this.expect("(")&&this.next();const s=this.read_array_pair_list(t);return this.expect(t?"]":")")&&this.next(),e(s,t)}return this.read_variable(!1,!1)}},{read_start:function(){return this.token==this.tok.T_NAMESPACE?this.read_namespace():this.read_top_statement()}},{read_namespace:function(){const t=this.node("namespace");let e,s;return this.expect(this.tok.T_NAMESPACE)&&this.next(),s="{"===this.token?{name:[""]}:this.read_namespace_name(),this.currentNamespace=s,";"===this.token?(this.currentNamespace=s,e=this.next().read_top_statements(),this.expect(this.EOF),t(s.name,e,!1)):"{"===this.token?(this.currentNamespace=s,e=this.next().read_top_statements(),this.expect("}")&&this.next(),0===e.length&&this.extractDoc&&this._docs.length>this._docIndex&&e.push(this.node("noop")()),t(s.name,e,!0)):(this.error(["{",";"]),this.currentNamespace=s,e=this.read_top_statements(),this.expect(this.EOF),t(s,e,!1))},read_namespace_name:function(t){const e=this.node();let s,i=this.text();switch(this.token){case this.tok.T_NAME_RELATIVE:s=this.ast.name.RELATIVE_NAME,i=i.replace(/^namespace\\/,"");break;case this.tok.T_NAME_QUALIFIED:s=this.ast.name.QUALIFIED_NAME;break;case this.tok.T_NAME_FULLY_QUALIFIED:s=this.ast.name.FULL_QUALIFIED_NAME;break;default:if(s=this.ast.name.UNQUALIFIED_NAME,!this.expect(this.tok.T_STRING))return e("name","",this.ast.name.FULL_QUALIFIED_NAME)}if(this.next(),t||"("!==this.token){if("parent"===i.toLowerCase())return e("parentreference",i);if("self"===i.toLowerCase())return e("selfreference",i)}return e("name",i,s)},read_use_statement:function(){let t=this.node("usegroup"),e=[],s=null;this.expect(this.tok.T_USE)&&this.next();const i=this.read_use_type();return e.push(this.read_use_declaration(!1)),","===this.token?e=e.concat(this.next().read_use_declarations(!1)):"{"===this.token&&(s=e[0].name,e=this.next().read_use_declarations(null===i),this.expect("}")&&this.next()),t=t(s,i,e),this.expect(";")&&this.next(),t},read_class_name_reference:function(){return this.read_variable(!0,!1)},read_use_declaration:function(t){const e=this.node("useitem");let s=null;t&&(s=this.read_use_type());const i=this.read_namespace_name(),n=this.read_use_alias();return e(i.name,n,s)},read_use_declarations:function(t){const e=[this.read_use_declaration(t)];for(;","===this.token;){if(this.next(),t){if(this.token!==this.tok.T_NAME_RELATIVE&&this.token!==this.tok.T_NAME_QUALIFIED&&this.token!==this.tok.T_NAME_FULLY_QUALIFIED&&this.token!==this.tok.T_FUNCTION&&this.token!==this.tok.T_CONST&&this.token!==this.tok.T_STRING)break}else if(this.token!==this.tok.T_NAME_RELATIVE&&this.token!==this.tok.T_NAME_QUALIFIED&&this.token!==this.tok.T_NAME_FULLY_QUALIFIED&&this.token!==this.tok.T_STRING&&this.token!==this.tok.T_NS_SEPARATOR)break;e.push(this.read_use_declaration(t))}return e},read_use_alias:function(){let t=null;if(this.token===this.tok.T_AS&&this.next().expect(this.tok.T_STRING)){const e=this.node("identifier"),s=this.text();this.next(),t=e(s)}return t},read_use_type:function(){return this.token===this.tok.T_FUNCTION?(this.next(),this.ast.useitem.TYPE_FUNCTION):this.token===this.tok.T_CONST?(this.next(),this.ast.useitem.TYPE_CONST):null}},A,N,{read_switch:function(){const t=this.node("switch");this.expect(this.tok.T_SWITCH)&&this.next(),this.expect("(")&&this.next();const e=this.read_expr();this.expect(")")&&this.next();const s=":"===this.token;return t(e,this.read_switch_case_list(),s)},read_switch_case_list:function(){let t=null;const e=this.node("block"),s=[];for("{"===this.token?t="}":":"===this.token?t=this.tok.T_ENDSWITCH:this.expect(["{",":"]),this.next(),";"===this.token&&this.next();this.token!==this.EOF&&this.token!==t;)s.push(this.read_case_list(t));return 0===s.length&&this.extractDoc&&this._docs.length>this._docIndex&&s.push(this.node("noop")()),this.expect(t)&&this.next(),t===this.tok.T_ENDSWITCH&&this.expectEndOfStatement(),e(null,s)},read_case_list:function(t){const e=this.node("case");let s=null;this.token===this.tok.T_CASE?s=this.next().read_expr():this.token===this.tok.T_DEFAULT?this.next():this.expect([this.tok.T_CASE,this.tok.T_DEFAULT]),this.expect([":",";"])&&this.next();const i=this.node("block"),n=[];for(;this.token!==this.EOF&&this.token!==t&&this.token!==this.tok.T_CASE&&this.token!==this.tok.T_DEFAULT;)n.push(this.read_inner_statement());return e(s,i(null,n))}},{read_try:function(){this.expect(this.tok.T_TRY);const t=this.node("try");let e=null;const s=[],i=this.next().read_statement();for(;this.token===this.tok.T_CATCH;){const t=this.node("catch");this.next().expect("(")&&this.next();const e=this.read_list(this.read_namespace_name,"|",!1);let i=null;(this.version<800||this.token===this.tok.T_VARIABLE)&&(i=this.read_variable(!0,!1)),this.expect(")"),s.push(t(this.next().read_statement(),e,i))}return this.token===this.tok.T_FINALLY&&(e=this.next().read_statement()),t(i,s,e)}},{read_short_form:function(t){const e=this.node("block"),s=[];for(this.expect(":")&&this.next();this.token!=this.EOF&&this.token!==t;)s.push(this.read_inner_statement());return 0===s.length&&this.extractDoc&&this._docs.length>this._docIndex&&s.push(this.node("noop")()),this.expect(t)&&this.next(),this.expectEndOfStatement(),e(null,s)},read_function_list:function(t,e){const s=[];do{if(this.token==e&&this.version>=703&&s.length>0){s.push(this.node("noop")());break}if(s.push(t.apply(this,[])),this.token!=e)break;if(")"==this.next().token&&this.version>=703)break}while(this.token!=this.EOF);return s},read_list:function(t,e,s){const i=[];if(this.token==e&&(s&&i.push("function"==typeof t?this.node("noop")():null),this.next()),"function"==typeof t)do{const s=t.apply(this,[]);if(s&&i.push(s),this.token!=e)break}while(this.next().token!=this.EOF);else{if(!this.expect(t))return[];for(i.push(this.text());this.next().token!=this.EOF&&this.token==e&&this.next().token==t;)i.push(this.text())}return i},read_name_list:function(){return this.read_list(this.read_namespace_name,",",!1)},read_byref:function(t){let e=this.node("byref");this.next(),e=e(null);const s=t();return s&&(this.ast.swapLocations(s,e,s,this),s.byref=!0),s},read_variable_declarations:function(){return this.read_list((function(){const t=this.node("staticvariable");let e=this.node("variable");if(this.expect(this.tok.T_VARIABLE)){const t=this.text().substring(1);this.next(),e=e(t,!1)}else e=e("#ERR",!1);return"="===this.token?t(e,this.next().read_expr()):e}),",")},read_extends_from:function(){return this.token===this.tok.T_EXTENDS?this.next().read_namespace_name():null},read_interface_extends_list:function(){return this.token===this.tok.T_EXTENDS?this.next().read_name_list():null},read_implements_list:function(){return this.token===this.tok.T_IMPLEMENTS?this.next().read_name_list():null}},g].forEach((function(t){for(const e in t){if(Object.prototype.hasOwnProperty.call(I.prototype,e))throw new Error("Function "+e+" is already defined - collision");I.prototype[e]=t[e]}}));var S=I;const O={T_HALT_COMPILER:101,T_USE:102,T_ENCAPSED_AND_WHITESPACE:103,T_OBJECT_OPERATOR:104,T_STRING:105,T_DOLLAR_OPEN_CURLY_BRACES:106,T_STRING_VARNAME:107,T_CURLY_OPEN:108,T_NUM_STRING:109,T_ISSET:110,T_EMPTY:111,T_INCLUDE:112,T_INCLUDE_ONCE:113,T_EVAL:114,T_REQUIRE:115,T_REQUIRE_ONCE:116,T_NAMESPACE:117,T_NS_SEPARATOR:118,T_AS:119,T_IF:120,T_ENDIF:121,T_WHILE:122,T_DO:123,T_FOR:124,T_SWITCH:125,T_BREAK:126,T_CONTINUE:127,T_RETURN:128,T_GLOBAL:129,T_STATIC:130,T_ECHO:131,T_INLINE_HTML:132,T_UNSET:133,T_FOREACH:134,T_DECLARE:135,T_TRY:136,T_THROW:137,T_GOTO:138,T_FINALLY:139,T_CATCH:140,T_ENDDECLARE:141,T_LIST:142,T_CLONE:143,T_PLUS_EQUAL:144,T_MINUS_EQUAL:145,T_MUL_EQUAL:146,T_DIV_EQUAL:147,T_CONCAT_EQUAL:148,T_MOD_EQUAL:149,T_AND_EQUAL:150,T_OR_EQUAL:151,T_XOR_EQUAL:152,T_SL_EQUAL:153,T_SR_EQUAL:154,T_INC:155,T_DEC:156,T_BOOLEAN_OR:157,T_BOOLEAN_AND:158,T_LOGICAL_OR:159,T_LOGICAL_AND:160,T_LOGICAL_XOR:161,T_SL:162,T_SR:163,T_IS_IDENTICAL:164,T_IS_NOT_IDENTICAL:165,T_IS_EQUAL:166,T_IS_NOT_EQUAL:167,T_IS_SMALLER_OR_EQUAL:168,T_IS_GREATER_OR_EQUAL:169,T_INSTANCEOF:170,T_INT_CAST:171,T_DOUBLE_CAST:172,T_STRING_CAST:173,T_ARRAY_CAST:174,T_OBJECT_CAST:175,T_BOOL_CAST:176,T_UNSET_CAST:177,T_EXIT:178,T_PRINT:179,T_YIELD:180,T_YIELD_FROM:181,T_FUNCTION:182,T_DOUBLE_ARROW:183,T_DOUBLE_COLON:184,T_ARRAY:185,T_CALLABLE:186,T_CLASS:187,T_ABSTRACT:188,T_TRAIT:189,T_FINAL:190,T_EXTENDS:191,T_INTERFACE:192,T_IMPLEMENTS:193,T_VAR:194,T_PUBLIC:195,T_PROTECTED:196,T_PRIVATE:197,T_CONST:198,T_NEW:199,T_INSTEADOF:200,T_ELSEIF:201,T_ELSE:202,T_ENDSWITCH:203,T_CASE:204,T_DEFAULT:205,T_ENDFOR:206,T_ENDFOREACH:207,T_ENDWHILE:208,T_CONSTANT_ENCAPSED_STRING:209,T_LNUMBER:210,T_DNUMBER:211,T_LINE:212,T_FILE:213,T_DIR:214,T_TRAIT_C:215,T_METHOD_C:216,T_FUNC_C:217,T_NS_C:218,T_START_HEREDOC:219,T_END_HEREDOC:220,T_CLASS_C:221,T_VARIABLE:222,T_OPEN_TAG:223,T_OPEN_TAG_WITH_ECHO:224,T_CLOSE_TAG:225,T_WHITESPACE:226,T_COMMENT:227,T_DOC_COMMENT:228,T_ELLIPSIS:229,T_COALESCE:230,T_POW:231,T_POW_EQUAL:232,T_SPACESHIP:233,T_COALESCE_EQUAL:234,T_FN:235,T_NULLSAFE_OBJECT_OPERATOR:236,T_MATCH:237,T_ATTRIBUTE:238,T_ENUM:239,T_READ_ONLY:240,T_NAME_RELATIVE:241,T_NAME_QUALIFIED:242,T_NAME_FULLY_QUALIFIED:243},R={values:Object.entries(O).reduce(((t,e)=>{let[s,i]=e;return{...t,[i]:s}}),{}),names:O};var v=Object.freeze(R);var w=function(t,e,s){this.source=t,this.start=e,this.end=s};const D=function(t,e,s){this.kind=t,e&&(this.leadingComments=e),s&&(this.loc=s)};D.prototype.setTrailingComments=function(t){this.trailingComments=t},D.prototype.destroy=function(t){if(!t)throw new Error("Node already initialized, you must swap with another node");return this.leadingComments&&(t.leadingComments?t.leadingComments=Array.concat(this.leadingComments,t.leadingComments):t.leadingComments=this.leadingComments),this.trailingComments&&(t.trailingComments?t.trailingComments=Array.concat(this.trailingComments,t.trailingComments):t.trailingComments=this.trailingComments),t},D.prototype.includeToken=function(t){return this.loc&&(this.loc.end&&(this.loc.end.line=t.lexer.yylloc.last_line,this.loc.end.column=t.lexer.yylloc.last_column,this.loc.end.offset=t.lexer.offset),t.ast.withSource&&(this.loc.source=t.lexer._input.substring(this.loc.start.offset,t.lexer.offset))),this},D.extends=function(t,e){return e.prototype=Object.create(this.prototype),e.extends=this.extends,e.prototype.constructor=e,e.kind=t,e};var U=D;const P=U,F="expression";var M=P.extends(F,(function(t,e,s){P.apply(this,[t||F,e,s])}));const B=M,H="array";var G=B.extends(H,(function(t,e,s,i){B.apply(this,[H,s,i]),this.items=e,this.shortForm=t}));const V=M,Q="arrowfunc";var Y=V.extends(Q,(function(t,e,s,i,n,r,o,h){V.apply(this,[Q,o,h]),this.arguments=t,this.byref=e,this.body=s,this.type=i,this.nullable=n,this.isStatic=r||!1}));const W=M,$="assign";var j=W.extends($,(function(t,e,s,i,n){W.apply(this,[$,i,n]),this.left=t,this.right=e,this.operator=s}));const z=M,K="assignref";var X=z.extends(K,(function(t,e,s,i){z.apply(this,[K,s,i]),this.left=t,this.right=e}));const J=U,q="attribute";var Z=J.extends(q,(function(t,e,s,i){J.apply(this,[q,s,i]),this.name=t,this.args=e}));const tt=U,et="attrgroup";var st=tt.extends(et,(function(t,e,s){tt.apply(this,[et,e,s]),this.attrs=t||[]}));const it=M,nt="operation";var rt=it.extends(nt,(function(t,e,s){it.apply(this,[t||nt,e,s])}));const ot=rt;var ht=ot.extends("bin",(function(t,e,s,i,n){ot.apply(this,["bin",i,n]),this.type=t,this.left=e,this.right=s}));const at=U,ct="statement";var lt=at.extends(ct,(function(t,e,s){at.apply(this,[t||ct,e,s])}));const ut=lt,_t="block";var pt=ut.extends(_t,(function(t,e,s,i){ut.apply(this,[t||_t,s,i]),this.children=e.filter(Boolean)}));const dt=M,ft="literal";var kt=dt.extends(ft,(function(t,e,s,i,n){dt.apply(this,[t||ft,i,n]),this.value=e,s&&(this.raw=s)}));const Tt=kt,xt="boolean";var Et=Tt.extends(xt,(function(t,e,s,i){Tt.apply(this,[xt,t,e,s,i])}));const mt=lt,yt="break";var At=mt.extends(yt,(function(t,e,s){mt.apply(this,[yt,e,s]),this.level=t}));const Nt=M,gt="byref";var Lt=Nt.extends(gt,(function(t,e,s){Nt.apply(this,[gt,e,s]),this.what=t}));const bt=M,It="call";var Ct=bt.extends(It,(function(t,e,s,i){bt.apply(this,[It,s,i]),this.what=t,this.arguments=e}));const St=lt,Ot="case";var Rt=St.extends(Ot,(function(t,e,s,i){St.apply(this,[Ot,s,i]),this.test=t,this.body=e}));const vt=rt,wt="cast";var Dt=vt.extends(wt,(function(t,e,s,i,n){vt.apply(this,[wt,i,n]),this.type=t,this.raw=e,this.expr=s}));const Ut=lt,Pt="catch";var Ft=Ut.extends(Pt,(function(t,e,s,i,n){Ut.apply(this,[Pt,i,n]),this.body=t,this.what=e,this.variable=s}));const Mt=lt,Bt="declaration",Ht=Mt.extends(Bt,(function(t,e,s,i){Mt.apply(this,[t||Bt,s,i]),this.name=e}));Ht.prototype.parseFlags=function(t){this.isAbstract=1===t[2],this.isFinal=2===t[2],this.isReadonly=1===t[3],"class"!==this.kind&&(-1===t[0]?this.visibility="":null===t[0]?this.visibility=null:0===t[0]?this.visibility="public":1===t[0]?this.visibility="protected":2===t[0]&&(this.visibility="private"),this.isStatic=1===t[1])};var Gt=Ht;const Vt=Gt,Qt="class";var Yt=Vt.extends(Qt,(function(t,e,s,i,n,r,o){Vt.apply(this,[Qt,t,r,o]),this.isAnonymous=!t,this.extends=e,this.implements=s,this.body=i,this.attrGroups=[],this.parseFlags(n)}));const Wt=lt,$t="constantstatement";var jt=Wt.extends($t,(function(t,e,s,i){Wt.apply(this,[t||$t,s,i]),this.constants=e}));const zt=jt,Kt="classconstant",Xt=zt.extends(Kt,(function(t,e,s,i,n,r){zt.apply(this,[t||Kt,e,n,r]),this.parseFlags(s),this.attrGroups=i}));Xt.prototype.parseFlags=function(t){-1===t[0]?this.visibility="":null===t[0]?this.visibility=null:0===t[0]?this.visibility="public":1===t[0]?this.visibility="protected":2===t[0]&&(this.visibility="private"),this.final=2===t[2]};var Jt=Xt;const qt=M,Zt="clone";var te=qt.extends(Zt,(function(t,e,s){qt.apply(this,[Zt,e,s]),this.what=t}));const ee=M,se="closure";var ie=ee.extends(se,(function(t,e,s,i,n,r,o,h){ee.apply(this,[se,o,h]),this.uses=s,this.arguments=t,this.byref=e,this.type=i,this.nullable=n,this.isStatic=r||!1,this.body=null,this.attrGroups=[]}));const ne=U;var re=ne.extends("comment",(function(t,e,s,i){ne.apply(this,[t,s,i]),this.value=e}));const oe=re,he="commentblock";var ae=oe.extends(he,(function(t,e,s){oe.apply(this,[he,t,e,s])}));const ce=re,le="commentline";var ue=ce.extends(le,(function(t,e,s){ce.apply(this,[le,t,e,s])}));const _e=U,pe="constant";var de=_e.extends(pe,(function(t,e,s,i){_e.apply(this,[pe,s,i]),this.name=t,this.value=e}));const fe=lt,ke="continue";var Te=fe.extends(ke,(function(t,e,s){fe.apply(this,[ke,e,s]),this.level=t}));const xe=pt,Ee="declare",me=xe.extends(Ee,(function(t,e,s,i,n){xe.apply(this,[Ee,e,i,n]),this.directives=t,this.mode=s}));me.MODE_SHORT="short",me.MODE_BLOCK="block",me.MODE_NONE="none";var ye=me;const Ae=U,Ne="declaredirective";var ge=Ae.extends(Ne,(function(t,e,s,i){Ae.apply(this,[Ne,s,i]),this.key=t,this.value=e}));const Le=lt;var be=Le.extends("do",(function(t,e,s,i){Le.apply(this,["do",s,i]),this.test=t,this.body=e}));const Ie=lt,Ce="echo";var Se=Ie.extends(Ce,(function(t,e,s,i){Ie.apply(this,[Ce,s,i]),this.shortForm=e,this.expressions=t}));const Oe=M,Re="empty";var ve=Oe.extends(Re,(function(t,e,s){Oe.apply(this,[Re,e,s]),this.expression=t}));const we=kt,De="encapsed",Ue=we.extends(De,(function(t,e,s,i,n){we.apply(this,[De,t,e,i,n]),this.type=s}));Ue.TYPE_STRING="string",Ue.TYPE_SHELL="shell",Ue.TYPE_HEREDOC="heredoc",Ue.TYPE_OFFSET="offset";var Pe=Ue;const Fe=M,Me="encapsedpart";var Be=Fe.extends(Me,(function(t,e,s,i,n){Fe.apply(this,[Me,i,n]),this.expression=t,this.syntax=e,this.curly=s}));const He=M,Ge="entry";var Ve=He.extends(Ge,(function(t,e,s,i,n,r){He.apply(this,[Ge,n,r]),this.key=t,this.value=e,this.byRef=s,this.unpack=i}));const Qe=Gt,Ye="enum";var We=Qe.extends(Ye,(function(t,e,s,i,n,r){Qe.apply(this,[Ye,t,n,r]),this.valueType=e,this.implements=s,this.body=i,this.attrGroups=[]}));const $e=U,je="enumcase";var ze=$e.extends(je,(function(t,e,s,i){$e.apply(this,[je,s,i]),this.name=t,this.value=e}));const Ke=U,Xe="error";var Je=Ke.extends(Xe,(function(t,e,s,i,n,r){Ke.apply(this,[Xe,n,r]),this.message=t,this.token=e,this.line=s,this.expected=i}));const qe=M,Ze="eval";var ts=qe.extends(Ze,(function(t,e,s){qe.apply(this,[Ze,e,s]),this.source=t}));const es=M,ss="exit";var is=es.extends(ss,(function(t,e,s,i){es.apply(this,[ss,s,i]),this.expression=t,this.useDie=e}));const ns=lt,rs="expressionstatement";var os=ns.extends(rs,(function(t,e,s){ns.apply(this,[rs,e,s]),this.expression=t}));const hs=lt;var as=hs.extends("for",(function(t,e,s,i,n,r,o){hs.apply(this,["for",r,o]),this.init=t,this.test=e,this.increment=s,this.shortForm=n,this.body=i}));const cs=lt,ls="foreach";var us=cs.extends(ls,(function(t,e,s,i,n,r,o){cs.apply(this,[ls,r,o]),this.source=t,this.key=e,this.value=s,this.shortForm=n,this.body=i}));const _s=Gt,ps="function";var ds=_s.extends(ps,(function(t,e,s,i,n,r,o){_s.apply(this,[ps,t,r,o]),this.arguments=e,this.byref=s,this.type=i,this.nullable=n,this.body=null,this.attrGroups=[]}));const fs=lt,ks="global";var Ts=fs.extends(ks,(function(t,e,s){fs.apply(this,[ks,e,s]),this.items=t}));const xs=lt,Es="goto";var ms=xs.extends(Es,(function(t,e,s){xs.apply(this,[Es,e,s]),this.label=t}));const ys=lt,As="halt";var Ns=ys.extends(As,(function(t,e,s){ys.apply(this,[As,e,s]),this.after=t}));const gs=U,Ls="identifier",bs=gs.extends(Ls,(function(t,e,s){gs.apply(this,[Ls,e,s]),this.name=t}));var Is=bs;const Cs=lt;var Ss=Cs.extends("if",(function(t,e,s,i,n,r){Cs.apply(this,["if",n,r]),this.test=t,this.body=e,this.alternate=s,this.shortForm=i}));const Os=M,Rs="include";var vs=Os.extends(Rs,(function(t,e,s,i,n){Os.apply(this,[Rs,i,n]),this.once=t,this.require=e,this.target=s}));const ws=kt,Ds="inline";var Us=ws.extends(Ds,(function(t,e,s,i){ws.apply(this,[Ds,t,e,s,i])}));const Ps=Gt,Fs="interface";var Ms=Ps.extends(Fs,(function(t,e,s,i,n,r){Ps.apply(this,[Fs,t,n,r]),this.extends=e,this.body=s,this.attrGroups=i}));const Bs=Gt,Hs="intersectiontype";var Gs=Bs.extends(Hs,(function(t,e,s){Bs.apply(this,[Hs,null,e,s]),this.types=t}));const Vs=M,Qs="isset";var Ys=Vs.extends(Qs,(function(t,e,s){Vs.apply(this,[Qs,e,s]),this.variables=t}));const Ws=lt,$s="label";var js=Ws.extends($s,(function(t,e,s){Ws.apply(this,[$s,e,s]),this.name=t}));const zs=M,Ks="list";var Xs=zs.extends(Ks,(function(t,e,s,i){zs.apply(this,[Ks,s,i]),this.items=t,this.shortForm=e}));const Js=M,qs="lookup";var Zs=Js.extends(qs,(function(t,e,s,i,n){Js.apply(this,[t||qs,i,n]),this.what=e,this.offset=s}));const ti=kt,ei="magic";var si=ti.extends(ei,(function(t,e,s,i){ti.apply(this,[ei,t,e,s,i])}));const ii=M,ni="match";var ri=ii.extends(ni,(function(t,e,s,i){ii.apply(this,[ni,s,i]),this.cond=t,this.arms=e}));const oi=M,hi="matcharm";var ai=oi.extends(hi,(function(t,e,s,i){oi.apply(this,[hi,s,i]),this.conds=t,this.body=e}));const ci=ds,li="method";var ui=ci.extends(li,(function(){ci.apply(this,arguments),this.kind=li}));const _i=U,pi="reference",di=_i.extends(pi,(function(t,e,s){_i.apply(this,[t||pi,e,s])}));var fi=di;const ki=fi,Ti="name",xi=ki.extends(Ti,(function(t,e,s,i){ki.apply(this,[Ti,s,i]),this.name=t.replace(/\\$/,""),this.resolution=e}));xi.UNQUALIFIED_NAME="uqn",xi.QUALIFIED_NAME="qn",xi.FULL_QUALIFIED_NAME="fqn",xi.RELATIVE_NAME="rn";var Ei=xi;const mi=pt,yi="namespace";var Ai=mi.extends(yi,(function(t,e,s,i,n){mi.apply(this,[yi,e,i,n]),this.name=t,this.withBrackets=s||!1}));const Ni=M,gi="namedargument";var Li=Ni.extends(gi,(function(t,e,s,i){Ni.apply(this,[gi,s,i]),this.name=t,this.value=e}));const bi=M;var Ii=bi.extends("new",(function(t,e,s,i){bi.apply(this,["new",s,i]),this.what=t,this.arguments=e}));const Ci=U,Si="noop";var Oi=Ci.extends(Si,(function(t,e){Ci.apply(this,[Si,t,e])}));const Ri=kt,vi="nowdoc";var wi=Ri.extends(vi,(function(t,e,s,i,n){Ri.apply(this,[vi,t,e,i,n]),this.label=s}));const Di=U,Ui="nullkeyword";var Pi=Di.extends(Ui,(function(t,e,s){Di.apply(this,[Ui,e,s]),this.raw=t}));const Fi=Zs,Mi="nullsafepropertylookup";var Bi=Fi.extends(Mi,(function(t,e,s,i){Fi.apply(this,[Mi,t,e,s,i])}));const Hi=kt,Gi="number";var Vi=Hi.extends(Gi,(function(t,e,s,i){Hi.apply(this,[Gi,t,e,s,i])}));const Qi=Zs,Yi="offsetlookup";var Wi=Qi.extends(Yi,(function(t,e,s,i){Qi.apply(this,[Yi,t,e,s,i])}));const $i=Gt,ji="parameter";var zi=$i.extends(ji,(function(t,e,s,i,n,r,o,h,a,c){$i.apply(this,[ji,t,a,c]),this.value=s,this.type=e,this.byref=i,this.variadic=n,this.readonly=r,this.nullable=o,this.flags=h||0,this.attrGroups=[]}));const Ki=fi,Xi="parentreference",Ji=Ki.extends(Xi,(function(t,e,s){Ki.apply(this,[Xi,e,s]),this.raw=t}));var qi=Ji;const Zi=rt,tn="post";var en=Zi.extends(tn,(function(t,e,s,i){Zi.apply(this,[tn,s,i]),this.type=t,this.what=e}));const sn=rt;var nn=sn.extends("pre",(function(t,e,s,i){sn.apply(this,["pre",s,i]),this.type=t,this.what=e}));const rn=M,on="print";var hn=rn.extends(on,(function(t,e,s){rn.apply(this,[on,e,s]),this.expression=t}));const an=pt,cn="program";var ln=an.extends(cn,(function(t,e,s,i,n,r){an.apply(this,[cn,t,n,r]),this.errors=e,s&&(this.comments=s),i&&(this.tokens=i)}));const un=lt,_n="property";var pn=un.extends(_n,(function(t,e,s,i,n,r,o,h){un.apply(this,[_n,o,h]),this.name=t,this.value=e,this.readonly=s,this.nullable=i,this.type=n,this.attrGroups=r}));const dn=Zs,fn="propertylookup";var kn=dn.extends(fn,(function(t,e,s,i){dn.apply(this,[fn,t,e,s,i])}));const Tn=lt,xn="propertystatement",En=Tn.extends(xn,(function(t,e,s,i,n){Tn.apply(this,[xn,i,n]),this.properties=e,this.parseFlags(s)}));En.prototype.parseFlags=function(t){-1===t[0]?this.visibility="":null===t[0]?this.visibility=null:0===t[0]?this.visibility="public":1===t[0]?this.visibility="protected":2===t[0]&&(this.visibility="private"),this.isStatic=1===t[1]};var mn=En;const yn=M,An="retif";var Nn=yn.extends(An,(function(t,e,s,i,n){yn.apply(this,[An,i,n]),this.test=t,this.trueExpr=e,this.falseExpr=s}));const gn=lt,Ln="return";var bn=gn.extends(Ln,(function(t,e,s){gn.apply(this,[Ln,e,s]),this.expr=t}));const In=fi,Cn="selfreference",Sn=In.extends(Cn,(function(t,e,s){In.apply(this,[Cn,e,s]),this.raw=t}));var On=Sn;const Rn=M,vn="silent";var wn=Rn.extends(vn,(function(t,e,s){Rn.apply(this,[vn,e,s]),this.expr=t}));const Dn=lt,Un="static";var Pn=Dn.extends(Un,(function(t,e,s){Dn.apply(this,[Un,e,s]),this.variables=t}));const Fn=U,Mn="staticvariable";var Bn=Fn.extends(Mn,(function(t,e,s,i){Fn.apply(this,[Mn,s,i]),this.variable=t,this.defaultValue=e}));const Hn=Zs,Gn="staticlookup";var Vn=Hn.extends(Gn,(function(t,e,s,i){Hn.apply(this,[Gn,t,e,s,i])}));const Qn=fi,Yn="staticreference",Wn=Qn.extends(Yn,(function(t,e,s){Qn.apply(this,[Yn,e,s]),this.raw=t}));var $n=Wn;const jn=kt,zn="string";var Kn=jn.extends(zn,(function(t,e,s,i,n,r){jn.apply(this,[zn,e,i,n,r]),this.unicode=s,this.isDoubleQuote=t}));const Xn=lt,Jn="switch";var qn=Xn.extends(Jn,(function(t,e,s,i,n){Xn.apply(this,[Jn,i,n]),this.test=t,this.body=e,this.shortForm=s}));const Zn=lt,tr="throw";var er=Zn.extends(tr,(function(t,e,s){Zn.apply(this,[tr,e,s]),this.what=t}));const sr=Gt,ir="trait";var nr=sr.extends(ir,(function(t,e,s,i){sr.apply(this,[ir,t,s,i]),this.body=e}));const rr=U,or="traitalias";var hr=rr.extends(or,(function(t,e,s,i,n,r){rr.apply(this,[or,n,r]),this.trait=t,this.method=e,this.as=s,this.visibility="",i&&(0===i[0]?this.visibility="public":1===i[0]?this.visibility="protected":2===i[0]&&(this.visibility="private"))}));const ar=U,cr="traitprecedence";var lr=ar.extends(cr,(function(t,e,s,i,n){ar.apply(this,[cr,i,n]),this.trait=t,this.method=e,this.instead=s}));const ur=U,_r="traituse";var pr=ur.extends(_r,(function(t,e,s,i){ur.apply(this,[_r,s,i]),this.traits=t,this.adaptations=e}));const dr=lt;var fr=dr.extends("try",(function(t,e,s,i,n){dr.apply(this,["try",i,n]),this.body=t,this.catches=e,this.always=s}));const kr=fi,Tr="typereference",xr=kr.extends(Tr,(function(t,e,s,i){kr.apply(this,[Tr,s,i]),this.name=t,this.raw=e}));xr.types=["int","float","string","bool","object","array","callable","iterable","void","static"];var Er=xr;const mr=rt,yr="unary";var Ar=mr.extends(yr,(function(t,e,s,i){mr.apply(this,[yr,s,i]),this.type=t,this.what=e}));const Nr=Gt,gr="uniontype";var Lr=Nr.extends(gr,(function(t,e,s){Nr.apply(this,[gr,null,e,s]),this.types=t}));const br=lt,Ir="unset";var Cr=br.extends(Ir,(function(t,e,s){br.apply(this,[Ir,e,s]),this.variables=t}));const Sr=lt,Or="usegroup";var Rr=Sr.extends(Or,(function(t,e,s,i,n){Sr.apply(this,[Or,i,n]),this.name=t,this.type=e,this.items=s}));const vr=lt,wr="useitem",Dr=vr.extends(wr,(function(t,e,s,i,n){vr.apply(this,[wr,i,n]),this.name=t,this.alias=e,this.type=s}));Dr.TYPE_CONST="const",Dr.TYPE_FUNCTION="function";var Ur=Dr;const Pr=M,Fr="variable";var Mr=Pr.extends(Fr,(function(t,e,s,i){Pr.apply(this,[Fr,s,i]),this.name=t,this.curly=e||!1}));const Br=M,Hr="variadic";var Gr=Br.extends(Hr,(function(t,e,s){Br.apply(this,[Hr,e,s]),this.what=t}));const Vr=U,Qr="variadicplaceholder";var Yr=Vr.extends(Qr,(function(t,e){Vr.apply(this,[Qr,t,e])}));const Wr=lt,$r="while";var jr=Wr.extends($r,(function(t,e,s,i,n){Wr.apply(this,[$r,i,n]),this.test=t,this.body=e,this.shortForm=s}));const zr=M,Kr="yield";var Xr=zr.extends(Kr,(function(t,e,s,i){zr.apply(this,[Kr,s,i]),this.value=t,this.key=e}));const Jr=M,qr="yieldfrom";var Zr=Jr.extends(qr,(function(t,e,s){Jr.apply(this,[qr,e,s]),this.value=t}));const to=w,eo=x,so=function(t,e){this.withPositions=t,this.withSource=e};so.precedence={},[["or"],["xor"],["and"],["="],["?"],["??"],["||"],["&&"],["|"],["^"],["&"],["==","!=","===","!==","<=>"],["<","<=",">",">="],["<<",">>"],["+","-","."],["*","/","%"],["!"],["instanceof"],["cast","silent"],["**"]].forEach((function(t,e){t.forEach((function(t){so.precedence[t]=e+1}))})),so.prototype.isRightAssociative=function(t){return"**"===t||"??"===t},so.prototype.swapLocations=function(t,e,s,i){this.withPositions&&(t.loc.start=e.loc.start,t.loc.end=s.loc.end,this.withSource&&(t.loc.source=i.lexer._input.substring(t.loc.start.offset,t.loc.end.offset)))},so.prototype.resolveLocations=function(t,e,s,i){this.withPositions&&(t.loc.start.offset>e.loc.start.offset&&(t.loc.start=e.loc.start),t.loc.end.offset<s.loc.end.offset&&(t.loc.end=s.loc.end),this.withSource&&(t.loc.source=i.lexer._input.substring(t.loc.start.offset,t.loc.end.offset)))},so.prototype.resolvePrecedence=function(t,e){let s,i,n;return"call"===t.kind?this.resolveLocations(t,t.what,t,e):"propertylookup"===t.kind||"staticlookup"===t.kind||"offsetlookup"===t.kind&&t.offset?this.resolveLocations(t,t.what,t.offset,e):"bin"===t.kind?t.right&&!t.right.parenthesizedExpression&&("bin"===t.right.kind?(i=so.precedence[t.type],n=so.precedence[t.right.type],i&&n&&n<=i&&(t.type!==t.right.type||!this.isRightAssociative(t.type))&&(s=t.right,t.right=t.right.left,this.swapLocations(t,t.left,t.right,e),s.left=this.resolvePrecedence(t,e),this.swapLocations(s,s.left,s.right,e),t=s)):"retif"===t.right.kind&&(i=so.precedence[t.type],n=so.precedence["?"],i&&n&&n<=i&&(s=t.right,t.right=t.right.test,this.swapLocations(t,t.left,t.right,e),s.test=this.resolvePrecedence(t,e),this.swapLocations(s,s.test,s.falseExpr,e),t=s))):"silent"!==t.kind&&"cast"!==t.kind||!t.expr||t.expr.parenthesizedExpression?"unary"===t.kind?t.what&&!t.what.parenthesizedExpression&&("bin"===t.what.kind?(s=t.what,t.what=t.what.left,this.swapLocations(t,t,t.what,e),s.left=this.resolvePrecedence(t,e),this.swapLocations(s,s.left,s.right,e),t=s):"retif"===t.what.kind&&(s=t.what,t.what=t.what.test,this.swapLocations(t,t,t.what,e),s.test=this.resolvePrecedence(t,e),this.swapLocations(s,s.test,s.falseExpr,e),t=s)):"retif"===t.kind?t.falseExpr&&"retif"===t.falseExpr.kind&&!t.falseExpr.parenthesizedExpression&&(s=t.falseExpr,t.falseExpr=s.test,this.swapLocations(t,t.test,t.falseExpr,e),s.test=this.resolvePrecedence(t,e),this.swapLocations(s,s.test,s.falseExpr,e),t=s):"assign"===t.kind?t.right&&"bin"===t.right.kind&&!t.right.parenthesizedExpression&&(i=so.precedence["="],n=so.precedence[t.right.type],i&&n&&n<i&&(s=t.right,t.right=t.right.left,s.left=t,this.swapLocations(s,s.left,t.right,e),t=s)):"expressionstatement"===t.kind&&this.swapLocations(t,t.expression,t,e):"bin"===t.expr.kind?(s=t.expr,t.expr=t.expr.left,this.swapLocations(t,t,t.expr,e),s.left=this.resolvePrecedence(t,e),this.swapLocations(s,s.left,s.right,e),t=s):"retif"===t.expr.kind&&(s=t.expr,t.expr=t.expr.test,this.swapLocations(t,t,t.expr,e),s.test=this.resolvePrecedence(t,e),this.swapLocations(s,s.test,s.falseExpr,e),t=s),t},so.prototype.prepare=function(t,e,s){let i=null;(this.withPositions||this.withSource)&&(i=s.position());const n=this,r=function(){let o=null;const h=Array.prototype.slice.call(arguments);if(h.push(e),n.withPositions||n.withSource){let t=null;n.withSource&&(t=s.lexer._input.substring(i.offset,s.prev[2])),o=new to(t,i,new eo(s.prev[0],s.prev[1],s.prev[2])),h.push(o)}t||(t=h.shift());const a=n[t];if("function"!=typeof a)throw new Error('Undefined node "'+t+'"');const c=Object.create(a.prototype);return a.apply(c,h),r.instance=c,r.trailingComments&&(c.trailingComments=r.trailingComments),"function"==typeof r.postBuild&&r.postBuild(c),s.debug&&delete n.stack[r.stackUid],n.resolvePrecedence(c,s)};return s.debug&&(this.stack||(this.stack={},this.stackUid=1),this.stack[++this.stackUid]={position:i,stack:(new Error).stack.split("\n").slice(3,5)},r.stackUid=this.stackUid),r.setTrailingComments=function(t){r.instance?r.instance.setTrailingComments(t):r.trailingComments=t},r.destroy=function(t){e&&(t?t.leadingComments?t.leadingComments=e.concat(t.leadingComments):t.leadingComments=e:s._docIndex=s._docs.length-e.length),s.debug&&delete n.stack[r.stackUid]},r},so.prototype.checkNodes=function(){const t=[];for(const e in this.stack)Object.prototype.hasOwnProperty.call(this.stack,e)&&(this.stack[e].key=e,t.push(this.stack[e]));return this.stack={},t},[G,Y,j,X,Z,st,ht,pt,Et,At,Lt,Ct,Rt,Dt,Ft,Yt,Jt,te,ie,re,ae,ue,de,jt,Te,Gt,ye,ge,be,Se,ve,Pe,Be,Ve,We,ze,Je,ts,is,M,os,as,us,ds,Ts,ms,Ns,Is,Ss,vs,Us,Ms,Gs,Ys,js,Xs,kt,Zs,si,ri,ai,ui,Ei,Ai,Li,Ii,U,Oi,wi,Pi,Bi,Vi,Wi,rt,zi,qi,en,nn,hn,ln,pn,kn,mn,fi,Nn,bn,On,wn,lt,Pn,Bn,Vn,$n,Kn,qn,er,nr,hr,lr,pr,fr,Er,Ar,Lr,Cr,Rr,Ur,Mr,Gr,Yr,jr,Xr,Zr].forEach((function(t){so.prototype[t.kind]=t}));const io=T,no=S,ro=v,oo=so;function ho(t,e){const s=Object.keys(t);let i=s.length;for(;i--;){const n=s[i],r=t[n];null===r?delete e[n]:"function"==typeof r?e[n]=r.bind(e):Array.isArray(r)?e[n]=Array.isArray(e[n])?e[n].concat(r):r:e[n]="object"==typeof r&&"object"==typeof e[n]?ho(r,e[n]):r}return e}const ao=function(t){if("function"==typeof this)return new this(t);if(this.tokens=ro,this.lexer=new io(this),this.ast=new oo,this.parser=new no(this.lexer,this.ast),t&&"object"==typeof t){if(t.parser&&(t.lexer||(t.lexer={}),t.parser.version)){if("string"==typeof t.parser.version){let e=t.parser.version.split(".");if(e=100*parseInt(e[0])+parseInt(e[1]),isNaN(e))throw new Error("Bad version number : "+t.parser.version);t.parser.version=e}else if("number"!=typeof t.parser.version)throw new Error("Expecting a number for version");if(t.parser.version<500||t.parser.version>900)throw new Error("Can only handle versions between 5.x to 8.x")}ho(t,this),this.lexer.version=this.parser.version}},co=function(t){return"function"==typeof t.write?t.toString():t};ao.create=function(t){return new ao(t)},ao.parseEval=function(t,e){return new ao(e).parseEval(t)},ao.prototype.parseEval=function(t){return this.lexer.mode_eval=!0,this.lexer.all_tokens=!1,t=co(t),this.parser.parse(t,"eval")},ao.parseCode=function(t,e,s){"object"!=typeof e||s||(s=e,e="unknown");return new ao(s).parseCode(t,e)},ao.prototype.parseCode=function(t,e){return this.lexer.mode_eval=!1,this.lexer.all_tokens=!1,t=co(t),this.parser.parse(t,e)},ao.tokenGetAll=function(t,e){return new ao(e).tokenGetAll(t)},ao.prototype.tokenGetAll=function(t){this.lexer.mode_eval=!1,this.lexer.all_tokens=!0,t=co(t);const e=this.lexer.EOF,s=this.tokens.values;this.lexer.setInput(t);let i=this.lexer.lex()||e;const n=[];for(;i!=e;){let t=this.lexer.yytext;Object.prototype.hasOwnProperty.call(s,i)&&(t=[s[i],t,this.lexer.yylloc.first_line]),n.push(t),i=this.lexer.lex()||e}return n},o.exports=ao,o.exports.tokens=ro,o.exports.lexer=io,o.exports.AST=oo,o.exports.parser=no,o.exports.combine=ho,o.exports.Engine=ao,o.exports.default=ao;var lo=i(o.exports);function uo(t,e){const s=e&&"markdown"===e.parentParser;if(!t&&s)return"";t=t.replace(/\?>\n<\?/g,"?>\n___PSEUDO_INLINE_PLACEHOLDER___<?");const i=new lo({parser:{extractDoc:!0},ast:{withPositions:!0,withSource:!0}}),n=-1!==t.indexOf("<?php"),r=s&&!n;let o;try{o=r?i.parseEval(t):i.parseCode(t)}catch(t){throw t instanceof SyntaxError&&"lineNumber"in t&&(t.loc={start:{line:t.lineNumber,column:t.columnNumber}},delete t.lineNumber,delete t.columnNumber),t}return o.extra={parseAsEval:r},o.comments.forEach((t=>{"\n"===t.value[t.value.length-1]&&(t.value=t.value.slice(0,-1),t.loc.end.offset=t.loc.end.offset-1)})),o}const _o=t=>e=>e.loc?.[t]?.offset,po=_o("start"),fo=_o("end"),{hasNewline:ko,skipEverythingButNewLine:To,skipNewline:xo}=e.util;function Eo(t){return t.toLowerCase().replace(/^([+-]?[\d.]+e)(?:\+|(-))?0*(\d)/,"$1$2$3").replace(/^([+-]?[\d.]+)e[+-]?0+$/,"$1").replace(/^([+-])?\./,"$10.").replace(/(\.\d+?)0+(?=e|$)/,"$1").replace(/\.(?=e)/,"")}const mo=new Map([["or"],["xor"],["and"],["=","+=","-=","*=","**=","/=",".=","%=","&=","|=","^=","<<=",">>="],["??"],["||"],["&&"],["|"],["^"],["&"],["==","===","!=","!==","<>","<=>"],["<",">","<=",">="],[">>","<<"],["+","-","."],["*","/","%"],["!"],["instanceof"],["++","--","~"],["**"]].flatMap(((t,e)=>t.map((t=>[t,e])))));function yo(t){return mo.get(t)}const Ao=["==","!=","===","!==","<>","<=>"],No=["*","/","%"],go=[">>","<<"];function Lo(t,e){return yo(e)===yo(t)&&("**"!==t&&((!Ao.includes(t)||!Ao.includes(e))&&(!("%"===e&&No.includes(t)||"%"===t&&No.includes(e))&&((e===t||!No.includes(e)||!No.includes(t))&&(!go.includes(t)||!go.includes(e))))))}function bo(t){const e=t.children||t.body||t.adaptations;return Array.isArray(e)?e:null}function Io(t){return t.length>0?t[t.length-1]:null}function Co(t){const{node:e}=t;if("program"===e.kind){const t=bo(e);return!(!t||0===t.length)&&"inline"===t[0].kind}if("switch"===e.kind){if(!e.body)return!1;const t=bo(e.body);if(0===t.length)return!1;const[s]=t;if(!s.body)return!1;const i=bo(s.body);return 0!==i.length&&"inline"===i[0].kind}const s=function(t){let{body:e}=t;return e?("block"===e.kind&&(e=e.children),e[0]):null}(e);return!!s&&"inline"===s.kind}function So(t){return"nowdoc"===t.kind||"encapsed"===t.kind&&"heredoc"===t.type}function Oo(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const s=t.getNode(e),i=t.getNode(e+1),n=t.getNode(e+2);if(!i)return!1;if(n&&["call","new","echo"].includes(n.kind)&&!["call","array"].includes(i.kind)||"parameter"===i.kind){const t=n.arguments.length-1;return n.arguments.indexOf(i)!==t}if(n&&"for"===n.kind){const t=n.init.indexOf(i);if(-1!==t)return t!==n.init.length-1;const e=n.test.indexOf(i);if(-1!==e)return e!==n.test.length-1;const s=n.increment.indexOf(i);if(-1!==s)return s!==n.increment.length-1}if("bin"===i.kind)return i.left===s||Oo(t,e+1);if("case"===i.kind&&i.test===s)return!0;if("staticvariable"===i.kind){const t=n.variables.length-1;return n.variables.indexOf(i)!==t}if("entry"===i.kind){if(i.key===s)return!0;const t=n.items.length-1;return n.items.indexOf(i)!==t}if(["call","new"].includes(i.kind)){const t=i.arguments.length-1;return i.arguments.indexOf(s)!==t}if("echo"===i.kind){const t=i.expressions.length-1;return i.expressions.indexOf(s)!==t}if("array"===i.kind){const t=i.items.length-1;return i.items.indexOf(s)!==t}return"retif"===i.kind&&Oo(t,e+1)}function Ro(t){const e=t.replace(/^\\/,"");return-1!==e.indexOf("\\")?e:t}function vo(t){return t.comments&&t.comments.some((t=>!t.leading&&!t.trailing))}function wo(t){return"propertylookup"===t.kind||"nullsafepropertylookup"===t.kind||"staticlookup"===t.kind||"offsetlookup"===t.kind}function Do(t){const{node:e}=t;return!["try","catch"].includes(e.kind)&&Co(t)}function Uo(t){const{node:e}=t;if(["try","catch"].includes(e.kind))return!0;if("switch"===e.kind){const t=bo(e.body);if(0===t.length)return!0;const s=Io(t);if(!s.body)return!0;const i=bo(s.body);return 0===i.length||"inline"!==i[0].kind}return!Co(t)}function Po(t){return["program","declare","namespace"].includes(t.kind)}function Fo(t){return["name","parentreference","selfreference","staticreference"].includes(t.kind)}function Mo(t){return"bin"===t.kind&&["||","&&"].includes(t.type)?"logical":t.kind}function Bo(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"body";const{node:s}=t;return s[e]&&s[e].children&&0===s[e].children.length&&(!s[e].comments||0===s[e].comments.length)}function Ho(t,e){let s=po(e);return s=To(t,s),s=xo(t,s),ko(t,s)}function Go(t){return"nowdoc"===t.kind||"encapsed"===t.kind&&"heredoc"===t.type||"entry"===t.kind&&("nowdoc"===t.value.kind||"encapsed"===t.value.kind&&"heredoc"===t.value.type)}function Vo(t,e){const s=function(t,e){const s=[].concat(e);let i,n=-1;for(;i=t.getParentNode(++n);)if(-1!==s.indexOf(i.kind))return n;return-1}(t,e);return-1===s?null:t.getParentNode(s)}const Qo=new Map(["__construct","__destruct","__call","__callStatic","__get","__set","__isset","__unset","__sleep","__wakeup","__toString","__invoke","__set_state","__clone","__debugInfo"].map((t=>[t.toLowerCase(),t])));function Yo(t){const e=t.toLowerCase();return Qo.has(e)?Qo.get(e):t}const{addLeadingComment:Wo,addDanglingComment:$o,addTrailingComment:jo,skipNewline:zo,hasNewline:Ko,hasNewlineInRange:Xo,getNextNonSpaceNonCommentCharacterIndex:Jo,isNextLineEmpty:qo,isPreviousLineEmpty:Zo}=e.util,{join:th,indent:eh,hardline:sh,cursor:ih,lineSuffix:nh,breakParent:rh}=e.doc.builders;function oh(t,e){const{children:s}=t;0===s.length?$o(t,e):Wo(s[0],e)}function hh(t,e){"block"===t.kind?oh(t,e):Wo(t,e)}function ah(t,e,s,i,n){const r=Jo(t,fo(n)),o=t.charAt(r);return e&&"identifier"===e.kind&&s&&("function"===s.kind||"method"===s.kind)&&")"===o?(jo(s,n),!0):!(!s||"function"!==s.kind&&"method"!==s.kind||!i||"block"!==i.kind)&&(oh(i,n),!0)}function ch(t,e,s,i,n){if(!s||"if"!==s.kind||!i)return!1;const r=Jo(t,fo(n));return")"===t.charAt(r)?(jo(e,n),!0):e===s.body&&i===s.alternate?($o(s,n),!0):"if"===i.kind?(hh(i.body,n),!0):s.body===i&&(Wo(i,n),!0)}function lh(t,e,s){if(t&&["class","interface","trait"].includes(t.kind)){if(t.__parent_new_arguments?.includes(e))return!1;if(e&&t.extends)if(Array.isArray(t.extends)){if(t.extends.some((t=>{if(e&&e===t)return $o(e,s),!0})))return!0}else if(e===t.extends)return $o(e,s),!0;if(e&&t.implements&&t.implements.some((t=>{if(e&&e===t)return $o(e,s),!0})))return!0;if(!(t.body&&t.body.length>0))return $o(t,s),!0}return!!(e&&"class"===e.kind&&e.isAnonymous&&e.leadingComments&&"commentblock"===s.kind)}function uh(t,e,s,i){if(e&&("function"===e.kind||"method"===e.kind)){let s=0;for(let t=0;t<e.arguments.length;t++)s=fo(e.arguments[t])>s?fo(e.arguments[t]):s;const n=e.body&&po(i)>s&&fo(i)<po(e.body),r=Jo(t,fo(i));if(e.type&&n&&")"!==t.charAt(r))return fo(i)<po(e.type)?($o(e.type,i),!0):(jo(e.type,i),!0)}return!1}function _h(t,e,s,i,n){return!(!s||!["function","method","parameter"].includes(s.kind))&&("typereference"===e.kind&&"identifier"===i.kind&&(jo(e,n),!0))}function ph(t,e){return!(!t||!["label","goto"].includes(t.kind))&&(jo(t,e),!0)}function dh(t,e,s,i){return s&&"inline"===s.kind?(s.leadingComments||(s.leadingComments=[]),s.leadingComments.includes(i)||s.leadingComments.push(i),!0):!(t||s||!e||"inline"!==e.kind)&&($o(e,i),!0)}function fh(t,e,s){return!(!t||"try"!==t.kind||!e)&&("block"===e.kind?(oh(e,s),!0):"try"===e.kind?(hh(e.always,s),!0):"catch"===e.kind&&(hh(e.body,s),!0))}function kh(t,e,s,i){return s||e||!t||"namespace"!==t.kind||t.withBrackets?!(e||!t||"namespace"!==t.kind||t.withBrackets)&&($o(t,i),!0):(jo(t,i),!0)}function Th(t,e,s,i){return!(!t||"declare"!==t.kind)&&((!e||"noop"!==e.kind)&&(s&&t.directives[0]!==s?!(!s||!e)&&(Wo(s,i),!0):("none"===t.mode?jo(t,i):$o(t,i),!0)))}function xh(t,e,s,i,n){if(!s||"while"!==s.kind||!i)return!1;const r=Jo(t,fo(n));return")"===t.charAt(r)?(jo(e,n),!0):"block"===i.kind&&(oh(i,n),!0)}function Eh(t,e){return t.node.printed=!0,e.printer.printComment(t,e)}function mh(t,e,s,i){const n=[],r=t.getValue();return r&&r.comments?(t.each((()=>{const s=t.node;!s||s.leading||s.trailing||i&&!i(s)||n.push(Eh(t,e))}),"comments"),0===n.length?"":s?th(sh,n):eh([sh,th(sh,n)])):""}function yh(t){return t.comments&&t.comments.some((t=>t.leading))}function Ah(t){return t.comments&&t.comments.some((t=>t.trailing))}function Nh(t,e){const s=[];return t.forEach(((t,i,n)=>{t.printed=!0;const r=n.length===i+1;s.push(t.value),r||s.push(sh),qo(e.originalText,fo(t))&&!r&&s.push(sh)})),s}function gh(t){return"commentblock"===t.kind}function Lh(t,e,s){const{node:i}=t;return i&&i===e.cursorNode?[ih,s,ih]:s}function bh(t,e,s,i){const{node:n}=t,r=e(t),o=n&&n.comments;if(!o||0===o.length)return Lh(t,s,r);const h=[],a=[i?";":"",r];return t.each((e=>{let{node:i}=e;const{leading:n,trailing:r}=i;if(n){const e=function(t,e,s){const i=Eh(t,s);if(!i)return"";const n=t.node;return s.printer.isBlockComment&&s.printer.isBlockComment(n)?[i,Ko(s.originalText,fo(n))?sh:" "]:[i,sh]}(t,0,s);if(!e)return;h.push(e);const n=s.originalText;Ko(n,zo(n,fo(i)))&&h.push(sh)}else r&&a.push(function(t,e,s){const i=Eh(t,s);if(!i)return"";const n=t.node,r=s.printer.isBlockComment&&s.printer.isBlockComment(n);if(Ko(s.originalText,po(n),{backwards:!0})){const t=Zo(s.originalText,po(n));return nh([sh,t?sh:"",i])}return r?[" ",i]:[nh([" ",i]),r?"":rh]}(t,0,s))}),"comments"),Lh(t,s,h.concat(a))}function Ih(t){const{parent:e}=t;if(!e)return!1;const{key:s,node:i}=t;if(["program","expressionstatement","namespace","declare","block","include","print","return","echo"].includes(e.kind))return!1;switch(i.kind){case"pre":case"post":if("unary"===e.kind)return"pre"===i.kind&&("+"===i.type&&"+"===e.type||"-"===i.type&&"-"===e.type);case"unary":switch(e.kind){case"unary":return i.type===e.type&&("+"===i.type||"-"===i.type);case"propertylookup":case"nullsafepropertylookup":case"staticlookup":case"offsetlookup":case"call":return"what"===s;case"bin":return"**"===e.type&&"left"===s;default:return!1}case"bin":switch(e.kind){case"assign":case"retif":return["and","xor","or"].includes(i.type);case"silent":case"cast":return i.parenthesizedExpression;case"pre":case"post":case"unary":return!0;case"call":case"propertylookup":case"nullsafepropertylookup":case"staticlookup":case"offsetlookup":return"what"===s;case"bin":{const t=e.type,r=yo(t),o=i.type,h=yo(o);return r>h||("||"===t&&"&&"===o||(r===h&&"right"===s||(r===h&&!Lo(t,o)||(r<h&&"%"===o?"+"===t||"-"===t:!(!go[n=t]&&"|"!==n&&"^"!==n&&"&"!==n)))))}default:return!1}case"propertylookup":case"nullsafepropertylookup":case"staticlookup":return"call"===e.kind&&("what"===s&&i.parenthesizedExpression);case"clone":case"new":switch(e.kind){case"propertylookup":case"nullsafepropertylookup":case"staticlookup":case"offsetlookup":case"call":return"what"===s;default:return!1}case"yield":switch(e.kind){case"propertylookup":case"nullsafepropertylookup":case"staticlookup":case"offsetlookup":case"call":return"what"===s;case"retif":return"test"===s;default:return!(!i.key&&!i.value)}case"assign":return("for"!==e.kind||!e.init.includes(i)&&!e.increment.includes(i))&&("assign"!==e.kind&&("static"!==e.kind&&(!["if","do","while","foreach","switch"].includes(e.kind)&&("silent"!==e.kind&&"call"!==e.kind))));case"retif":switch(e.kind){case"cast":return!0;case"unary":case"bin":case"retif":return!("test"===s&&!e.trueExpr);case"propertylookup":case"nullsafepropertylookup":case"staticlookup":case"offsetlookup":case"call":return"what"===s;default:return!1}case"closure":switch(e.kind){case"call":return"what"===s;case"propertylookup":case"nullsafepropertylookup":return!0;default:return!1}case"silence":case"cast":return i.parenthesizedExpression;case"string":case"array":switch(e.kind){case"propertylookup":case"nullsafepropertylookup":case"staticlookup":case"offsetlookup":case"call":return(!["string","array"].includes(i.kind)||"offsetlookup"!==e.kind)&&"what"===s;default:return!1}case"print":case"include":return"bin"===e.kind}var n;return!1}const{breakParent:Ch,join:Sh,line:Oh,lineSuffix:Rh,group:vh,conditionalGroup:wh,indent:Dh,dedent:Uh,ifBreak:Ph,hardline:Fh,softline:Mh,literalline:Bh,align:Hh,dedentToRoot:Gh}=e.doc.builders,{willBreak:Vh}=e.doc.utils,{isNextLineEmptyAfterIndex:Qh,hasNewline:Yh,hasNewlineInRange:Wh,getNextNonSpaceNonCommentCharacterIndex:$h,isNextLineEmpty:jh,isPreviousLineEmpty:zh}=e.util;function Kh(t,e){return parseFloat(t)>=parseFloat(e)}function Xh(t,e){return!!t.trailingCommaPHP&&Kh(t.phpVersion,e)}function Jh(t){return"1tbs"!==t.braceStyle}function qh(t,e,s){return[arguments.length>3&&void 0!==arguments[3]&&arguments[3]?"?":"","->",s("offset")]}function Zh(t,e,s){return qh(t,e,s,!0)}function ta(t,e,s){const{node:i}=t,n=!["variable","identifier"].includes(i.offset.kind);return["::",n?"{":"",s("offset"),n?"}":""]}function ea(t,e,s){const{node:i}=t,n=i.offset&&"number"===i.offset.kind||Vo(t,"encapsed");return["[",i.offset?vh([Dh([n?"":Mh,s("offset")]),n?"":Mh]):"","]"]}function sa(t){return"array"===t.kind&&(t.items.length>0||t.comments)||"function"===t.kind||"method"===t.kind||"closure"===t.kind}function ia(t,e,s){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"arguments";const n=t.node[i];if(0===n.length)return["(",mh(t,e,!0),")"];let r=!1,o=!1;const h=t.map((t=>{let{node:i,isLast:n,isFirst:h}=t;const a=[s()];return n||(jh(e.originalText,fo(i))?(h&&(o=!0),r=!0,a.push(",",Fh,Fh)):a.push(",",Oh)),a}),i),{node:a}=t,c=Io(n),l=Xh(e,"7.3")&&["call","new","unset","isset"].includes(a.kind)||Xh(e,"8.0")&&["function","closure","method","arrowfunc","attribute"].includes(a.kind)?Dh([c&&Go(c)?Fh:"",","]):"";const u=function(t){if(2!==t.length)return!1;const[e,s]=t;return!(e.comments&&e.comments.length||"function"!==e.kind&&"method"!==e.kind&&"closure"!==e.kind||"retif"===s.kind||sa(s))}(n),_=function(t){const e=Io(t),s=(i=t).length>1?i[i.length-2]:null;var i;return!yh(e)&&!Ah(e)&&sa(e)&&(!s||s.kind!==e.kind)}(n);if(u||_){const e=(u?h.slice(1).some(Vh):h.slice(0,-1).some(Vh))||r;let n;t.each((t=>{let{isLast:e,isFirst:i}=t;u&&i&&(n=[s([],{expandFirstArg:!0}),h.length>1?",":"",o?Fh:Oh,o?Fh:"",h.slice(1)]),_&&e&&(n=[...h.slice(0,-1),s([],{expandLastArg:!0})])}),i);const a=h.some(Vh),c=["(",...n,")"];return[a?Ch:"",wh([a?Ph(vh(["(",Dh([Oh,...h]),l,Oh,")"],{shouldBreak:!0}),c):c,u?["(",vh(n[0],{shouldBreak:!0}),...n.slice(1),")"]:["(",...h.slice(0,-1),vh(Io(n),{shouldBreak:!0}),")"],vh(["(",Dh([Oh,...h]),Ph(l),Oh,")"],{shouldBreak:!0})],{shouldBreak:e})]}return vh(["(",Dh([Mh,...h]),Ph(l),Mh,")"],{shouldBreak:h.some(Vh)||r})}function na(t){return"array"===t.kind&&0!==t.items.length}function ra(t){return"array"===t.right.kind&&0!==t.right.items.length}function oa(t,e,s,i,n){let r=[];const{node:o}=t;if("bin"===o.kind){Lo(o.type,o.left.type)?r=r.concat(t.call((()=>oa(t,e,s,!0,n)),"left")):r.push(e("left"));const h=ra(o)?[o.type," ",e("right")]:[o.type,Oh,e("right")],{parent:a}=t,c=!(n&&["||","&&"].includes(o.type))&&Mo(a)!==Mo(o)&&Mo(o.left)!==Mo(o)&&Mo(o.right)!==Mo(o),l=So(o.left)||"bin"===o.left.kind&&So(o.left.right);r.push(l?"":" ",c?vh(h):h),i&&o.comments&&(r=bh(t,(()=>r),s))}else r.push(e());return r}function ha(t,e,s){const{node:i}=t;switch(i.kind){case"propertylookup":return qh(t,e,s);case"nullsafepropertylookup":return Zh(t,e,s);case"staticlookup":return ta(t,0,s);case"offsetlookup":return ea(t,0,s);default:throw new Error(`Have not implemented lookup kind ${i.kind} yet.`)}}function aa(t){let{opening:e=!0}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("heredoc"===t.type)return e?`<<<${t.label}`:t.label;const s={string:'"',shell:"`"};if(s[t.type])return s[t.type];throw new Error(`Unimplemented encapsed type ${t.type}`)}function ca(t,e,s){const i=[];let n=[];return t.each((t=>{let{node:r}=t;i.push(n),i.push(vh(s())),n=[",",Oh],r&&jh(e.originalText,fo(r))&&n.push(Mh)}),"items"),i}function la(t,e,s){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"children";const{node:n,parent:r}=t;let o=-1;const h=[],a=[];t.map((()=>{const{node:i,next:c,isFirst:l,isLast:u,index:_}=t,p="inline"===i.kind,d=s(),f=!u&&!p&&(c&&"case"===c.kind?!Co(t):c&&"inline"!==c.kind);let k=[d,f?Fh:"",f&&jh(e.originalText,fo(i))?Fh:""];const T="block"===n.kind&&r&&["function","closure","method","try","catch"].includes(r.kind);let x=T&&l?"":" ";if(p||!p&&u&&o>=0){const e=o;p&&(o=_);if(p&&!l||!p&&u){const s=(p?e:o)+1,r=u&&!p?_+1:_,h=t.siblings[p?e:o],c=h?function(t){const e=t.split("\n").pop();return e.length-e.trimLeft().length+1}(h.raw):"",l=r-s>1,d=l?T&&!h||Po(n)&&0===s?"":Fh:"",f=l&&"halt"!==i.kind?T&&u?"":Fh:"";l&&(x=""),a.push({start:s,end:r,alignment:c,before:d,after:f})}}if(p){const s=c&&"echo"===c.kind&&c.shortForm?"<?=":"<?php",r=i.leadingComments&&i.leadingComments.length?[l&&"namespace"!==n.kind&&!T?"<?php":"","namespace"!==n.kind&&T?"":Fh,Nh(i.leadingComments,e),Fh,"?>"]:Po(n)&&l&&"namespace"!==n.kind?"":[x,"?>"],o=t.getNode(_+1),h=o&&o.children&&o.children.length;k=[r,k,i.comments&&i.comments.length?[s,Fh,h?Nh(i.comments,e):"",Fh]:Po(n)&&u?"":[s," "]]}h.push(k)}),i);const c=function(t,e){if(0===e.length)return t;let s=0;return e.reduce(((e,i)=>{const{start:n,end:r,alignment:o,before:h,after:a}=i,c=[h||"",...t.slice(n,r),a||""],l=e.concat(t.slice(s,n),o?Gh(vh(Hh(new Array(o).join(" "),c))):vh(c),r===t.length-1?t.slice(r):"");return s=r,l}),[])}(h,a);if("program"===n.kind&&!n.extra.parseAsEval){const t=[],[s]=n.children;if(!s||"inline"!==s.kind){const i=e.originalText.trim().match(/^<\?(php|=)(\s+)?\S/),r=[i&&i[2]&&i[2].includes("\n")?[Fh,i[2].split("\n").length>2?Fh:""]:" ",n.comments?Nh(n.comments,e):""],o=s&&"echo"===s.kind&&s.shortForm;t.push([o?"<?=":"<?php",r])}t.push(c);if(/\?>\n?$/.test(e.originalText)){const s=Io(n.children),i=s?[Wh(e.originalText.trimEnd(),fo(s),fo(n))?"inline"===s.kind&&s.comments&&s.comments.length?"":Fh:" ",jh(e.originalText,fo(s))?Fh:""]:n.comments?Fh:"";t.push(Rh([i,"?>"]))}return t}return c}function ua(t,e,s,i){return t.map((t=>{let{node:i,isLast:n}=t;const r=[];return r.push(s()),n||(r.push(Fh),jh(e.originalText,fo(i))&&r.push(Fh)),r}),i)}function _a(t,e,s){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"extends",n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:" ",r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:" ";const o=t.node[i],h=vo(o)?[Fh,t.call((()=>mh(t,e,!0)),i),Fh]:n,a=Array.isArray(o)?vh(Sh(",",t.map((i=>{let{node:n}=i;const o=s();return vo(n)?[Fh,mh(t,e,!0),Fh,o]:[r,o]}),i))):[r,s(i)];return Dh([h,i,Vh(h)?Dh(a):a])}function pa(t,e,s){let{inline:i=!1}=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const n=[];return t.node.attrGroups?(t.each((()=>{const r=["#["];!i&&n.length>0&&n.push(Fh),r.push(Mh),t.each((()=>{const i=t.node;r.length>2&&r.push(",",Oh);const n=[i.name];i.args.length>0&&n.push(ia(t,e,s,"args")),r.push(vh(n))}),"attrs"),n.push(vh([Dh(r),Ph(Xh(e,"8.0")?",":""),Mh,"]",i?Ph(Mh," "):""]))}),"attrGroups"),0===n.length?[]:[...n,i?"":Fh]):[]}function da(t,e,s){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"body";const{node:n}=t;if(!n[i])return";";const r=s(i);return[n.shortForm?":":" {",Dh("block"!==n[i].kind||n[i].children&&n[i].children.length>0||n[i].comments&&n[i].comments.length>0?[Do(t)?"switch"===n.kind?" ":"":Fh,r]:""),"if"===n.kind&&"body"===i?"":[Uo(t)?Fh:"",n.shortForm?["end",n.kind,";"]:"}"]]}function fa(t,e,s,i,n,r,o){if(!i)return e;const h=Ta(t,i,n,r,o);return vh([e,s,h])}function ka(t){return!!wo(t)&&(!("variable"!==t.what.kind&&!Fo(t.what))||ka(t.what))}function Ta(t,e,s,i,n){const r=i?"&":"";if(function(t,e){return e.comments&&e.comments.some((e=>e.leading&&Ko(t,fo(e))))}(n.originalText,e))return Dh([Fh,r,s]);const o="cast"===e.kind?e.expr:e;return"bin"===o.kind&&!ra(o)||"retif"===o.kind&&(!o.trueExpr&&!na(o.falseExpr)||"bin"===o.test.kind&&!ra(o.test))||("variable"===t.kind||"string"===t.kind||wo(t))&&("string"===o.kind&&!xa(o)||ka(o))?vh(Dh([Oh,r,s])):[" ",r,s]}function xa(t){return t.raw.includes("\n")}function Ea(t,e){return("string"===t.kind||"encapsed"===t.kind&&("string"===t.type||"shell"===t.type))&&xa(t)&&!Yh(e,po(t),{backwards:!0})}function ma(t,e,s){return vh(t.map((t=>{let{isFirst:i}=t;return i?[e()]:[s,e()]}),"types"))}const ya=new Set(["loc","range","raw","comments","leadingComments","trailingComments","parenthesizedExpression","parent","prev","start","end","tokens","errors","extra"]);function Aa(t,e){if("string"===t.kind&&delete e.isDoubleQuote,["array","list"].includes(t.kind)&&delete e.shortForm,"inline"===t.kind){if(t.value.includes("___PSEUDO_INLINE_PLACEHOLDER___"))return null;e.value=e.value.replace(/\n/g,"")}if(("continue"===t.kind||"break"===t.kind)&&t.level){const{level:t}=e;"number"===t.kind&&(e.level="1"===t.value?null:t)}if("block"===t.kind&&1===t.children.length&&"block"===t.children[0].kind)for(;"block"===e.children[0].kind;)e.children=e.children[0].children;"number"===t.kind&&(e.value=Eo(t.value));if(["foreach","for","if","while","do"].includes(t.kind)&&(t.body&&"block"!==t.body.kind?e.body={kind:"block",children:[e.body]}:e.body=e.body?e.body:null,t.alternate&&"block"!==t.alternate.kind?e.alternate={kind:"block",children:[e.alternate]}:e.alternate=e.alternate?e.alternate:null),"usegroup"===t.kind&&"string"==typeof t.name&&(e.name=e.name.replace(/^\\/,"")),"useitem"===t.kind&&(e.name=e.name.replace(/^\\/,"")),"method"===t.kind&&"identifier"===t.name.kind&&(e.name.name=Yo(e.name.name)),"noop"===t.kind)return null}Aa.ignoredProperties=ya;const Na="PHP";var ga={phpVersion:{since:"0.13.0",category:Na,type:"choice",default:"7.0",description:"Minimum target PHP version.",choices:[{value:"5.0"},{value:"5.1"},{value:"5.2"},{value:"5.3"},{value:"5.4"},{value:"5.5"},{value:"5.6"},{value:"7.0"},{value:"7.1"},{value:"7.2"},{value:"7.3"},{value:"7.4"},{value:"8.0"},{value:"8.1"},{value:"8.2"}]},trailingCommaPHP:{since:"0.0.0",category:Na,type:"boolean",default:!0,description:"Print trailing commas wherever possible when multi-line."},braceStyle:{since:"0.10.0",category:Na,type:"choice",default:"per-cs",description:"Print one space or newline for code blocks (classes and functions).",choices:[{value:"psr-2",description:"(deprecated) Use per-cs"},{value:"per-cs",description:"Use the PER Coding Style brace style."},{value:"1tbs",description:"Use 1tbs brace style."}]}};const La=(t,e,s,i)=>{if("length"===s||"prototype"===s)return;if("arguments"===s||"caller"===s)return;const n=Object.getOwnPropertyDescriptor(t,s),r=Object.getOwnPropertyDescriptor(e,s);!ba(n,r)&&i||Object.defineProperty(t,s,r)},ba=function(t,e){return void 0===t||t.configurable||t.writable===e.writable&&t.enumerable===e.enumerable&&t.configurable===e.configurable&&(t.writable||t.value===e.value)},Ia=(t,e)=>{const s=Object.getPrototypeOf(e);s!==Object.getPrototypeOf(t)&&Object.setPrototypeOf(t,s)},Ca=(t,e)=>`/* Wrapped ${t}*/\n${e}`,Sa=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),Oa=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),Ra=(t,e,s)=>{const i=""===s?"":`with ${s.trim()}() `,n=Ca.bind(null,i,e.toString());Object.defineProperty(n,"name",Oa),Object.defineProperty(t,"toString",{...Sa,value:n})};var va={exports:{}},wa=()=>{const t={};return t.promise=new Promise(((e,s)=>{t.resolve=e,t.reject=s})),t};!function(t,e){var i=s&&s.__awaiter||function(t,e,s,i){return new(s||(s=Promise))((function(n,r){function o(t){try{a(i.next(t))}catch(t){r(t)}}function h(t){try{a(i.throw(t))}catch(t){r(t)}}function a(t){t.done?n(t.value):new s((function(e){e(t.value)})).then(o,h)}a((i=i.apply(t,e||[])).next())}))},n=s&&s.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const r=n(wa);function o(t){let e,s,n,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"maxAge";const h=()=>i(this,void 0,void 0,(function*(){if(void 0!==e)return;const h=h=>i(this,void 0,void 0,(function*(){n=r.default();const i=h[1][o]-Date.now();return i<=0?(t.delete(h[0]),void n.resolve()):(e=h[0],s=setTimeout((()=>{t.delete(h[0]),n&&n.resolve()}),i),"function"==typeof s.unref&&s.unref(),n.promise)}));try{for(const e of t)yield h(e)}catch(t){}e=void 0})),a=t.set.bind(t);return t.set=(i,r)=>{t.has(i)&&t.delete(i);const o=a(i,r);return e&&e===i&&(e=void 0,void 0!==s&&(clearTimeout(s),s=void 0),void 0!==n&&(n.reject(void 0),n=void 0)),h(),o},h(),t}e.default=o,t.exports=o,t.exports.default=o}(va,va.exports);var Da=i(va.exports);const Ua=new WeakMap;const Pa=/@prettier|@format/,Fa=function(t){let{cacheKey:e,cache:s=new Map,maxAge:i}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};"number"==typeof i&&Da(s);const n=function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];const h=e?e(r):r[0],a=s.get(h);if(a)return a.data;const c=t.apply(this,r);return s.set(h,{data:c,maxAge:i?Date.now()+i:Number.POSITIVE_INFINITY}),c};return function(t,e){let{ignoreNonConfigurable:s=!1}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{name:i}=t;for(const i of Reflect.ownKeys(e))La(t,e,i,s);Ia(t,e),Ra(t,e,i)}(n,t,{ignoreNonConfigurable:!0}),Ua.set(n,s),n}((t=>{const e=uo(t),[s]=e.children,[i]=e.comments.filter((t=>"commentblock"===t.kind));if(s&&i&&i.loc.start.line<s.loc.start.line)return i}));const{join:Ma,hardline:Ba}=e.doc.builders;function Ha(t,e){let{extend:s,override:i}=e;const n={};for(const e in t){n["languageId"===e?"linguistLanguageId":e]=t[e]}if(s)for(const t in s)n[t]=(n[t]||[]).concat(s[t]);for(const t in i)n[t]=i[t];return n}const Ga=[Ha(n,{override:{parsers:["php"],vscodeLanguageIds:["php"]}}),Ha(r,{override:{parsers:["php"],vscodeLanguageIds:["php"]}})],Va={php:{parse:uo,astFormat:"php",locStart:po,locEnd:fo,hasPragma:function(t){if(!Pa.test(t))return!1;const e=Fa(t);if(e){const{value:t}=e;return Pa.test(t)}return!1}}},Qa=new Set(["kind","loc","errors","extra","comments","leadingComments","enclosingNode","precedingNode","followingNode"]);const Ya={php:{print:function(t,e,s){const{node:i}=t;if("string"==typeof i)return i;const n=function(t,e,s){const{node:i}=t;switch(i.kind){case"program":return vh([la(t,e,s),mh(t,e,!0,(t=>!t.printed))]);case"expressionstatement":return s("expression");case"block":return[la(t,e,s),mh(t,e,!0)];case"declare":{const n=t=>Sh(", ",t.map(s,"directives"));return["block","short"].includes(i.mode)?["declare(",n(t),")","block"===i.mode?" {":":",i.children.length>0?Dh([Fh,la(t,e,s)]):"",mh(t,e),Fh,"block"===i.mode?"}":"enddeclare;"]:["declare(",n(t),")","inline"===t.next?.kind?"":";"]}case"declaredirective":return[s("key"),"=",s("value")];case"namespace":return["namespace ",i.name&&"string"==typeof i.name?[i.name,i.withBrackets?" ":""]:"",i.withBrackets?"{":";",vo(i)?[" ",mh(t,e,!0)]:"",i.children.length>0?i.withBrackets?Dh([Fh,la(t,e,s)]):["inline"===i.children[0].kind?"":[Fh,Ho(e.originalText,i)?Fh:""],la(t,e,s)]:"",i.withBrackets?[Fh,"}"]:""];case"usegroup":return vh(["use ",i.type?[i.type," "]:"",Dh([i.name?[Ro(i.name),"\\{",Mh]:"",Sh([",",Oh],t.map(s,"items"))]),i.name?[Ph(Xh(e,"7.2")?",":""),Mh,"}"]:""]);case"useitem":return[i.type?[i.type," "]:"",Ro(i.name),vo(i)?[" ",mh(t,e,!0)]:"",i.alias?[" as ",s("alias")]:""];case"class":case"enum":case"interface":case"trait":return function(t,e,s){const{node:i}=t,n="class"===i.kind&&i.isAnonymous,r=pa(t,e,s,{inline:n}),o=n?[]:[...r];i.isFinal&&o.push("final ");i.isAbstract&&o.push("abstract ");i.isReadonly&&o.push("readonly ");o.push(n?"":i.kind),i.name&&o.push(" ",s("name"));"enum"===i.kind&&i.valueType&&o.push(": ",s("valueType"));i.extends&&i.implements?o.push(wh([[_a(t,e,s,"extends"),_a(t,e,s,"implements")],[_a(t,e,s,"extends"),_a(t,e,s,"implements"," ",Fh)],[_a(t,e,s,"extends",Fh," "),_a(t,e,s,"implements",Fh,i.implements.length>1?Fh:" ")]],{shouldBreak:vo(i.extends)})):(i.extends&&o.push(wh([_a(t,e,s,"extends"),_a(t,e,s,"extends"," ",Fh),_a(t,e,s,"extends",Fh,i.extends.length>1?Fh:" ")])),i.implements&&o.push(wh([_a(t,e,s,"implements"),_a(t,e,s,"implements"," ",Fh),_a(t,e,s,"implements",Fh,i.implements.length>1?Fh:" ")])));const h=vh([vh(o),Jh(e)?n?Oh:Fh:" "]),a=i.body&&0===i.body.length&&!vo(i),c=["{",Dh([a?"":Fh,ua(t,e,s,"body")]),mh(t,e,!0),n&&a?Mh:Fh,"}"];return[h,c]}(t,e,s);case"traitprecedence":return[s("trait"),"::",s("method")," insteadof ",Sh(", ",t.map(s,"instead"))];case"traitalias":return[i.trait?[s("trait"),"::"]:"",i.method?s("method"):""," as ",Sh(" ",[...i.visibility?[i.visibility]:[],...i.as?[s("as")]:[]])];case"traituse":return vh(["use ",Dh(vh(Sh([",",Oh],t.map(s,"traits")))),i.adaptations?[" {",i.adaptations.length>0?[Dh([Fh,ua(t,e,s,"adaptations")]),Fh]:vo(i)?[Oh,mh(t,e,!0),Oh]:"","}"]:""]);case"function":case"closure":case"method":return function(t,e,s){const{node:i}=t,n=pa(t,e,s,{inline:"closure"===i.kind}),r=[];i.isFinal&&r.push("final ");i.isAbstract&&r.push("abstract ");i.visibility&&r.push(i.visibility," ");i.isStatic&&r.push("static ");r.push("function "),i.byref&&r.push("&");i.name&&r.push(s("name"));r.push(ia(t,e,s)),i.uses&&i.uses.length>0&&r.push(vh([" use ",ia(t,e,s,"uses")]));i.type&&r.push([": ",vo(i.type)?[t.call((()=>mh(t,e,!0)),"type")," "]:"",i.nullable?"?":"",s("type")]);const o=r;if(!i.body)return[...n,o];const h="closure"===i.kind,a=["{",Dh([Bo(t)?"":Fh,s("body")]),h&&Bo(t)?"":Fh,"}"];if(h)return[...n,o," ",a];if(0===i.arguments.length)return[...n,o,Jh(e)?Fh:" ",a];const c=r.some(Vh);if(c)return[o," ",a];return[...n,wh([[o,Jh(e)?Fh:" ",a],[o," ",a]])]}(t,e,s);case"arrowfunc":return[i.parenthesizedExpression?"(":"",...pa(t,e,s,{inline:!0}),i.isStatic?"static ":"","fn",ia(t,e,s),i.type?[": ",i.nullable?"?":"",s("type")]:""," => ",s("body"),i.parenthesizedExpression?")":""];case"parameter":{let n="";1===i.flags?n="public ":2===i.flags?n="protected ":4===i.flags&&(n="private ");const r=[...pa(t,e,s,{inline:!0}),n,i.readonly?"readonly ":"",i.nullable?"?":"",i.type?[s("type")," "]:"",i.byref?"&":"",i.variadic?"...":"","$",s("name")];return i.value?vh([r,vo(i)?" ":"",mh(t,e,!0)," =",Ta(i.name,i.value,s("value"),!1,e)]):r}case"variadic":return["...",s("what")];case"property":return vh([i.readonly?"readonly ":"",i.type?[i.nullable?"?":"",s("type")," "]:"","$",s("name"),i.value?[" =",Ta(i.name,i.value,s("value"),!1,e)]:""]);case"propertystatement":{const n=[];t.each((()=>{n.push(...pa(t,e,s))}),"properties");const r=t.map(s,"properties"),o=i.properties.some((t=>t.value));let h;1!==r.length||i.properties[0].comments?r.length>0&&(h=Dh(r[0])):[h]=r;const a=i.visibility||null===i.visibility;return vh([...n,a?[null===i.visibility?"var":i.visibility,""]:"",i.isStatic?[a?" ":"","static"]:"",h?[" ",h]:"",Dh(r.slice(1).map((t=>[",",o?Fh:Oh,t])))])}case"if":{const n=[],r=da(t,e,s,"body"),o=vh(["if (",vh([Dh([Mh,s("test")]),Mh]),")",r]);if(n.push(o,Co(t)||!i.body?"":Fh),i.alternate){n.push(i.shortForm?"":"} ");const r=Ah(i.body)&&i.body.comments.some((t=>t.trailing&&!gh(t)))||function(t){if(!t.comments)return!1;const e=Io(t.comments.filter((t=>!t.leading&&!t.trailing)));return e&&!gh(e)}(i),o=!r;n.push(o?"":Fh),vo(i)&&n.push(jh(e.originalText,fo(i.body))?Fh:"",mh(t,e,!0),r?Fh:" "),n.push("else",vh("if"===i.alternate.kind?s("alternate"):da(t,e,s,"alternate")))}else n.push(i.body?i.shortForm?"endif;":"}":"");return n}case"do":return["do",da(t,e,s,"body")," while (",vh([Dh([Mh,s("test")]),Mh]),")"];case"while":case"switch":return vh([i.kind," (",vh([Dh([Mh,s("test")]),Mh]),")",da(t,e,s,"body")]);case"for":{const n=da(t,e,s,"body"),r=mh(t,e,!0),o=r?[r,Mh]:"";return i.init.length||i.test.length||i.increment.length?[o,vh(["for (",vh([Dh([Mh,vh(Sh([",",Oh],t.map(s,"init"))),";",Oh,vh(Sh([",",Oh],t.map(s,"test"))),";",Oh,vh(Sh([",",Oh],t.map(s,"increment")))]),Mh]),")",n])]:[o,vh(["for (;;)",n])]}case"foreach":{const n=da(t,e,s,"body"),r=mh(t,e,!0);return[r?[r,Mh]:"",vh(["foreach (",vh([Dh([Mh,s("source"),Oh,"as ",vh(i.key?Dh(Sh([" =>",Oh],[s("key"),s("value")])):s("value"))]),Mh]),")",n])]}case"try":{const n=[];return n.push("try",da(t,e,s,"body")),i.catches&&n.push(t.map(s,"catches")),i.always&&n.push(" finally",da(t,e,s,"always")),n}case"catch":return[" catch",i.what?[" (",Sh(" | ",t.map(s,"what")),i.variable?[" ",s("variable")]:"",")"]:"",da(t,e,s,"body")];case"case":return[i.test?["case ",i.test.comments?Dh(s("test")):s("test"),":"]:"default:",i.body&&i.body.children&&i.body.children.length?Dh([Co(t)?"":Fh,s("body")]):""];case"break":case"continue":return i.level&&("number"===i.level.kind&&"1"!==i.level.value)?[`${i.kind} `,s("level")]:i.kind;case"call":return 1===i.arguments.length&&Ea(i.arguments[0],e.originalText)?[s("what"),"(",Sh(", ",t.map(s,"arguments")),")"]:wo(i.what)?function(t,e,s){const i=[];function n(t){const{originalText:s}=e,i=$h(s,fo(t));return")"===s.charAt(i)?Qh(s,i+1,e):jh(s,fo(t))}function r(t){const{node:o}=t;if("call"!==o.kind||!wo(o.what)&&"call"!==o.what.kind)if(wo(o)){let n=null;n="propertylookup"===o.kind?qh(t,e,s):"nullsafepropertylookup"===o.kind?Zh(t,e,s):"staticlookup"===o.kind?ta(t,e,s):ea(t,e,s),i.unshift({node:o,needsParens:Ih(t),printed:bh(t,(()=>n),e)}),t.call((t=>r(t)),"what")}else i.unshift({node:o,printed:s()});else i.unshift({node:o,printed:[bh(t,(()=>ia(t,e,s)),e),n(o)?Fh:""]}),t.call((t=>r(t)),"what")}const{node:o}=t;i.unshift({node:o,printed:ia(t,e,s)}),t.call((t=>r(t)),"what");for(let t=0;t<i.length;++t)"call"===i[t].node.kind&&i[t-1]&&["propertylookup","nullsafepropertylookup","staticlookup"].includes(i[t-1].node.kind)&&i[t-1].needsParens&&(i[0].printed=["(",i[0].printed],i[t-1].printed=[i[t-1].printed,")"]);const h=[];let a=[i[0]],c=1;for(;c<i.length&&("call"===i[c].node.kind||wo(i[c].node)&&i[c].node.offset&&"number"===i[c].node.offset.kind);++c)a.push(i[c]);if("call"!==i[0].node.kind)for(;c+1<i.length&&(wo(i[c].node)&&wo(i[c+1].node));++c)a.push(i[c]);h.push(a),a=[];let l=!1;for(;c<i.length;++c){if(l&&wo(i[c].node)){if("offsetlookup"===i[c].node.kind&&i[c].node.offset&&"number"===i[c].node.offset.kind){a.push(i[c]);continue}h.push(a),a=[],l=!1}"call"===i[c].node.kind&&(l=!0),a.push(i[c]),i[c].node.comments&&Ah(i[c].node)&&(h.push(a),a=[],l=!1)}a.length>0&&h.push(a);function u(t){const s=t[1].length&&"offsetlookup"===t[1][0].node.kind;if(1===t[0].length){const e=t[0][0].node;return"variable"===e.kind&&("this"===e.name||_&&i(e.name))||Fo(e)}function i(t){return t.length<e.tabWidth}const n=Io(t[0]).node;return wo(n)&&("identifier"===n.offset.kind||"variable"===n.offset.kind)&&s}const _="expressionstatement"===t.parent.kind,p=h.length>=2&&!h[1][0].node.comments&&u(h);function d(t){const e=[];for(let s=0;s<t.length;s++)t[s+1]&&t[s+1].needsParens?(e.push("(",t[s].printed,t[s+1].printed,")"),s++):e.push(t[s].printed);return e}function f(t){return 0===t.length?"":Dh(vh([Fh,Sh(Fh,t.map(d))]))}const k=h.map(d),T=k,x=p?3:2,E=h.slice(0,x).flat(),m=E.slice(1,-1).some((t=>yh(t.node)))||E.slice(0,-1).some((t=>Ah(t.node)))||h[x]&&yh(h[x][0].node),y=Vo(t,"encapsed");if(h.length<=x&&!m||y)return vh(T);const A=Io(p?h.slice(1,2)[0]:h[0]).node,N="call"!==A.kind&&n(A),g=[d(h[0]),p?h.slice(1,2).map(d):"",N?Fh:"",f(h.slice(p?2:1))],L=i.filter((t=>"call"===t.node.kind)).length;if(m||L>=3||k.slice(0,-1).some(Vh))return vh(g);return[Vh(T)||N?Ch:"",wh([T,g])]}(t,e,s):[s("what"),ia(t,e,s)];case"new":{const n=i.what&&"class"===i.what.kind&&i.what.isAnonymous;if(!n&&1===i.arguments.length&&Ea(i.arguments[0],e.originalText))return["new ",...t.call(pa,"what"),s("what"),"(",Sh(", ",t.map(s,"arguments")),")"];const r=[];if(r.push("new "),n)r.push(i.what.leadingComments&&"commentblock"===i.what.leadingComments[0].kind?[Nh(i.what.leadingComments,e)," "]:"",...t.call((()=>pa(t,e,s,{inline:!0})),"what"),"class",i.arguments.length>0?[" ",ia(t,e,s)]:"",vh(s("what")));else{const n=["call","offsetlookup"].includes(i.what.kind),o=[n?"(":"",s("what"),n?")":"",ia(t,e,s)];r.push(yh(i.what)?Dh(o):o)}return r}case"clone":return["clone ",i.what.comments?Dh(s("what")):s("what")];case"propertylookup":case"nullsafepropertylookup":case"staticlookup":case"offsetlookup":{const{parent:n}=t;let r,o=0;do{r=t.getParentNode(o),o++}while(r&&wo(r));const h=Vo(t,"encapsed")||r&&("new"===r.kind||"assign"===r.kind&&"variable"!==r.left.kind)||"offsetlookup"===i.kind||(Fo(i.what)||"variable"===i.what.kind)&&["identifier","variable","encapsedpart"].includes(i.offset.kind)&&n&&!wo(n);return[s("what"),h?ha(t,e,s):vh(Dh([Mh,ha(t,e,s)]))]}case"exit":return vh([i.useDie?"die":"exit","(",i.expression?Ea(i.expression,e.originalText)?s("expression"):[Dh([Mh,s("expression")]),Mh]:mh(t,e),")"]);case"global":return vh(["global ",Dh(Sh([",",Oh],t.map(s,"items")))]);case"include":return[i.require?"require":"include",i.once?"_once":""," ",i.target.comments?Dh(s("target")):s("target")];case"label":return[s("name"),":"];case"goto":return["goto ",s("label")];case"throw":return["throw ",i.what.comments?Dh(s("what")):s("what")];case"silent":return["@",s("expr")];case"halt":return[vo(i)?[mh(t,e,!0),Fh]:"","__halt_compiler();",i.after];case"eval":return vh(["eval(",Ea(i.source,e.originalText)?s("source"):[Dh([Mh,s("source")]),Mh],")"]);case"echo":{const e=t.map(s,"expressions");let n;return 1!==e.length||i.expressions[0].comments?e.length>0&&(n=So(i.expressions[0])||i.expressions[0].comments?Dh(e[0]):Uh(e[0])):[n]=e,vh([i.shortForm?"":"echo ",n||"",Dh(e.slice(1).map((t=>[",",Oh,t])))])}case"print":return["print ",i.expression.comments?Dh(s("expression")):s("expression")];case"return":{const n=[];if(n.push("return"),i.expr){const t=s("expr");n.push(" ",i.expr.comments?Dh(t):t)}return vo(i)&&n.push(" ",mh(t,e,!0)),n}case"isset":case"unset":return vh([i.kind,ia(t,e,s,"variables")]);case"empty":return vh(["empty(",Dh([Mh,s("expression")]),Mh,")"]);case"variable":{const{parent:e,grandparent:n}=t,r="assign"===e.kind?"":i.byref?"&":"",o="encapsedpart"===e.kind&&"simple"===e.syntax&&e.curly||n&&"offsetlookup"===e.kind&&"encapsedpart"===n.kind&&"simple"===n.syntax&&n.curly?"":"$",h=i.curly?"{":"",a=i.curly?"}":"";return[r,o,h,s("name"),a]}case"constantstatement":case"classconstant":{const n=pa(t,e,s),r=t.map(s,"constants");let o;return 1!==r.length||i.constants[0].comments?r.length>0&&(o=Dh(r[0])):[o]=r,vh([...n,i.final?"final ":"",i.visibility?[i.visibility," "]:"","const",o?[" ",o]:"",Dh(r.slice(1).map((t=>[",",Fh,t])))])}case"constant":return fa(i.name,s("name")," =",i.value,s("value"),!1,e);case"static":{const e=t.map(s,"variables"),n=i.variables.some((t=>t.defaultValue));let r;return 1!==e.length||i.variables[0].comments?e.length>0&&(r=Dh(e[0])):[r]=e,vh(["static",r?[" ",r]:"",Dh(e.slice(1).map((t=>[",",n?Fh:Oh,t])))])}case"staticvariable":return fa(i.variable,s("variable")," =",i.defaultValue,s("defaultValue"),!1,e);case"list":case"array":{const n="array"===i.kind&&Kh(e.phpVersion,"5.4")||"list"===i.kind&&(i.shortForm||Kh(e.phpVersion,"7.1")),r=n?"[":[i.kind,"("],o=n?"]":")";if(0===i.items.length)return vo(i)?vh([r,mh(t,e),Mh,o]):[r,o];const h=Io(i.items),a=h&&"noop"===h.kind,[c]=i.items.filter((t=>"noop"!==t.kind)).sort(((t,e)=>po(t)-po(e))),l=!(!c||!c.key)&&c&&Wh(e.originalText,po(i),po(c));return vh([r,Dh([Mh,ca(t,e,s)]),a?",":"",Ph(!a&&Xh(e,"5.0")?[h&&Go(h)?Fh:"",","]:""),mh(t,e,!0),Mh,o],{shouldBreak:l})}case"entry":{const t=i.byRef?"&":"",n=i.unpack?"...":"";return i.key?fa(i.key,s("key")," =>",i.value,s("value"),t,e):[t,n,s("value")]}case"yield":{const t=[i.key?[s("key")," => "]:"",s("value")];return["yield",i.key||i.value?" ":"",i.value&&i.value.comments?Dh(t):t]}case"yieldfrom":return["yield from ",i.value.comments?Dh(s("value")):s("value")];case"unary":return[i.type,s("what")];case"pre":return[i.type+i.type,s("what")];case"post":return[s("what"),i.type+i.type];case"cast":return["(",i.type,") ",i.expr.comments?Dh(s("expr")):s("expr")];case"assignref":case"assign":{const t="assignref"===i.kind;return fa(i.left,s("left"),[" ",t?"=":i.operator],i.right,s("right"),t,e)}case"bin":{const{parent:n,grandparent:r}=t,o=i!==n.body&&("if"===n.kind||"while"===n.kind||"switch"===n.kind||"do"===n.kind),h=oa(t,s,e,!1,o);if(o)return h;if("unary"===n.kind||wo(n)&&"offsetlookup"!==n.kind)return vh([Dh([Mh,...h]),Mh]);const a=i!==n.body&&"for"===n.kind||"retif"===n.kind&&r&&"return"!==r.kind,c=["assign","property","constant","staticvariable","entry"].includes(n.kind),l="bin"===i.left.kind&&Lo(i.type,i.left.type);if(a||ra(i)&&!l||!ra(i)&&c)return vh(h);const u=h.slice(1);return vh([h.length>0?h[0]:"",Dh(u)])}case"retif":{const e=[],{parent:n}=t;let r,o=0;do{r=t.getParentNode(o),o++}while(r&&"retif"===r.kind);const h=r||n,a="bin"===i.falseExpr.kind?Dh(s("falseExpr")):s("falseExpr"),c=[i.trueExpr?Oh:" ","?",i.trueExpr?[" ","bin"===i.trueExpr.kind?Dh(s("trueExpr")):s("trueExpr"),Oh]:"",":",i.trueExpr?[" ",a]:[na(i.falseExpr)?" ":Oh,a]];e.push(c);const l=t=>n===h?vh(t):t,u=t.grandparent,_="cast"===n.kind&&u?u:n,p=["propertylookup","nullsafepropertylookup","staticlookup"].includes(_.kind),d=s("test");if(!i.trueExpr){const t=[d,"bin"===_.kind||["print","echo","return","include"].includes(h.kind)?Dh(e):e];return"call"===_.kind&&_.what===i||"unary"===_.kind||wo(_)&&"offsetlookup"!==_.kind?vh([Dh([Mh,t]),Mh]):l(t)}return l(["retif"===i.test.kind?Dh(d):d,Dh(e),p?Mh:""])}case"boolean":return i.value?"true":"false";case"number":return Eo(i.value);case"string":{const{parent:s}=t;if("encapsedpart"===s.kind){const s=t.grandparent;let n=0;const r=Kh(e.phpVersion,"7.3");let o=Bh;if("heredoc"===s.type){o=r?Fh:Bh;const t=s.raw.split("\n");n=t[t.length-1].search(/\S/),-1===n&&(n=t[t.length-2].search(/\S/))}return Sh(o,i.raw.split("\n").map(((t,e)=>e>0||0===i.loc.start.column?t.substring(n):t)))}const n=function(t,e){if(t.isDoubleQuote===e.singleQuote){const e=t.raw.slice("b"===t.raw[0]?2:1,-1).match(/\\([$nrtfve]|[xX][0-9a-fA-F]{1,2}|[0-7]{1,3}|u{([0-9a-fA-F]+)})|\r?\n|'|"|\$/);return t.isDoubleQuote?e:!e}return t.isDoubleQuote}(i,e)?'"':"'";let r=i.raw;return"b"===i.raw[0]&&(r=r.slice(1)),['"',"'"].includes(r[0])&&(r=r.substr(1)),['"',"'"].includes(r[r.length-1])&&(r=r.substr(0,r.length-1)),["b"===i.raw[0]?"b":"",n,Sh(Bh,r.split("\n")),n]}case"intersectiontype":return ma(t,s,"&");case"uniontype":return ma(t,s,"|");case"encapsedpart":{const t="simple"===i.syntax&&i.curly||"complex"===i.syntax?[i.curly?"$":"","{"]:"",e="simple"===i.syntax&&i.curly||"complex"===i.syntax?"}":"";return[t,s("expression"),e]}case"encapsed":switch(i.type){case"string":case"shell":case"heredoc":{const n=Kh(e.phpVersion,"7.3")?Fh:Bh;return[aa(i),"heredoc"===i.type?n:"",...t.map(s,"value"),aa(i,{opening:!1}),"heredoc"===i.type&&Oo(t)?Fh:""]}default:throw new Error(`Have not implemented kind ${i.type} yet.`)}case"inline":return Sh(Bh,i.raw.replace("___PSEUDO_INLINE_PLACEHOLDER___","").split("\n"));case"magic":return i.value;case"nowdoc":{const s=Kh(e.phpVersion,"7.3")?Fh:Bh;return["<<<'",i.label,"'",s,Sh(s,i.value.split("\n")),s,i.label,Oo(t)?Fh:""]}case"name":return["rn"===i.resolution?"namespace\\":"",i.name];case"literal":return s("value");case"parentreference":return"parent";case"selfreference":return"self";case"staticreference":return"static";case"typereference":return i.name;case"nullkeyword":return"null";case"identifier":{const{parent:e}=t;return"method"===e.kind&&(i.name=Yo(i.name)),s("name")}case"match":{const i=t.map((()=>{const i=t.node,n=yh(i)?[Nh(i.leadingComments,e),Fh]:[],r=!t.isLast||e.trailingCommaPHP?",":"",o=Ah(i)?[" ",Nh(i.comments.filter((t=>t.trailing)),e)]:[],h=null===i.conds?"default":t.map((t=>{let{isFirst:e}=t;return[",",Oh,s()].slice(e?2:0)}),"conds"),a=s("body"),c=!t.isFirst&&zh(e.originalText,po(i))?Fh:"";return["",Fh,c,...n,vh([vh([h,Dh(Oh)]),"=> ",a,r,...o])].slice(t.isFirst?1:0)}),"arms");return vh(["match (",vh([Dh([Mh,s("cond")]),Mh]),") {",vh(Dh([...i]))," ",Mh,"}"])}case"noop":return i.comments?Nh(i.comments,e):"";case"namedargument":return[i.name,": ",s("value")];case"enumcase":return vh(["case ",s("name"),i.value?[" =",Ta(i.name,i.value,s("value"),!1,e)]:""]);case"variadicplaceholder":return"...";default:throw new Error(`Have not implemented kind '${i.kind}' yet.`)}}(t,e,s),r=[],o=Ih(t);return o&&r.unshift("("),r.push(n),o&&r.push(")"),function(t){const{node:e,parent:s}=t;if(!s)return!1;if(["for","foreach","while","do","if","switch"].includes(s.kind)&&"block"!==e.kind&&"if"!==e.kind&&(s.body===e||s.alternate===e))return!0;if(!function(t){return["block","program","namespace","class","enum","interface","trait","traituse","declare"].includes(t.kind)}(s))return!1;if("echo"===e.kind&&e.shortForm)return!1;if("traituse"===e.kind)return!e.adaptations;if("method"===e.kind&&e.isAbstract)return!0;if("method"===e.kind){const{parent:e}=t;if(e&&"interface"===e.kind)return!0}return["expressionstatement","do","usegroup","classconstant","propertystatement","traitprecedence","traitalias","goto","constantstatement","enumcase","global","static","echo","unset","return","break","continue","throw"].includes(e.kind)}(t)&&r.push(";"),function(t){const{node:e}=t,s="program"===e.kind,i=e.children&&Io(e.children);if(!s)return!1;if(i&&["halt","inline"].includes(i.kind))return!1;if(i&&("declare"===i.kind||"namespace"===i.kind)){const t=i.children.length>0&&Io(i.children);if(t&&["halt","inline"].includes(t.kind))return!1}return!0}(t)&&r.push(Fh),r},getVisitorKeys:function(t,e){return Object.keys(t).filter((t=>!e.has(t)&&!Qa.has(t)))},insertPragma:function(t){const e=Fa(t);if(e){const{start:{offset:s},end:{offset:i}}=e.loc,n=t.substring(0,s),r=t.substring(i);return`${n}${function(t){let e=t.split("\n");if(1===e.length){const[,t]=/\/*\*\*(.*)\*\//.exec(e[0]);e=["/**",` * ${t.trim()}`," */"]}const s=e.findIndex((t=>/@\S/.test(t)))||1;return e.splice(s,0," * @format"),e.join("\n")}(e.value)}${r}`}const s="<?php";return t.startsWith(s)?`${t.substring(0,5)}\n/** \n * @format \n */\n${t.substring(5)}`:t},massageAstNode:Aa,getCommentChildNodes:function(t){if("new"===t.kind&&"class"===t.what.kind)return t.what.__parent_new_arguments=[...t.arguments],[t.what]},canAttachComment:function(t){return t.kind&&"commentblock"!==t.kind&&"commentline"!==t.kind},isBlockComment:gh,handleComments:{ownLine:function(t,e,s){const{precedingNode:i,enclosingNode:n,followingNode:r}=t;return ah(e,i,n,r,t)||function(t,e,s){if(t&&wo(t)&&e&&["identifier","variable","encapsed"].includes(e.kind))return Wo(t,s),!0;return!1}(n,r,t)||ch(e,i,n,r,t)||xh(e,i,n,r,t)||fh(n,r,t)||lh(n,r,t)||_h(e,i,n,r,t)||uh(e,n,r,t)||function(t,e,s,i){if(!s&&t&&("for"===t.kind||"foreach"===t.kind))return t.body&&"block"!==t.body.kind?Wo(s,i):Wo(t,i),!0;return!1}(n,0,r,t)||dh(n,i,r,t)||Th(n,i,r,t)},endOfLine:function(t,e,s){const{precedingNode:i,enclosingNode:n,followingNode:r}=t;return function(t,e,s,i,n){if(!e&&!i&&s&&"array"===s.kind)return jo(s,n),!0;return!1}(0,i,n,r,t)||function(t,e,s,i,n){if(s&&"return"===s.kind&&!s.expr)return jo(s,n),!0;return!1}(0,0,n,0,t)||ah(e,i,n,r,t)||function(t,e,s,i,n){const r=e&&!Xo(n,fo(e),po(i));if((!e||!r)&&t&&"retif"===t.kind&&s)return Wo(s,i),!0;return!1}(n,i,r,t,e)||ch(e,i,n,r,t)||xh(e,i,n,r,t)||fh(n,r,t)||lh(n,r,t)||_h(e,i,n,r,t)||uh(e,n,r,t)||function(t,e){if(t&&"entry"===t.kind)return Wo(t,e),!0;return!1}(n,t)||function(t,e,s){if(e&&"call"===e.kind&&t&&e.what===t&&e.arguments.length>0)return Wo(e.arguments[0],s),!0;return!1}(i,n,t)||function(t,e,s){if(t&&"assign"===t.kind&&e){const i=t.loc.start.offset+t.loc.source.indexOf("=");if(s.loc.start.offset>i)return Wo(e,s),!0}return!1}(n,r,t)||dh(n,i,r,t)||kh(n,i,r,t)||Th(n,i,r,t)||ph(n,t)},remaining:function(t,e,s){const{precedingNode:i,enclosingNode:n,followingNode:r}=t;return ch(e,i,n,r,t)||xh(e,i,n,r,t)||function(t,e,s){const i=Jo(t,fo(s));if(")"!==t.charAt(i))return!1;if(e&&("function"===e.kind||"closure"===e.kind||"method"===e.kind||"call"===e.kind||"new"===e.kind)&&0===e.arguments.length)return $o(e,s),!0;return!1}(e,n,t)||lh(n,r,t)||function(t,e,s){if(t&&"traituse"===t.kind&&t.adaptations&&!t.adaptations.length)return $o(t,s),!0;return!1}(n,0,t)||_h(e,i,n,r,t)||uh(e,n,r,t)||ph(n,t)||function(t,e,s,i){if(e&&"halt"===e.kind)return $o(e,i),!0;if(t&&"halt"===t.kind)return $o(t,i),!0;return!1}(i,n,0,t)||function(t,e){if(t&&("continue"===t.kind||"break"===t.kind)&&!t.label)return jo(t,e),!0;return!1}(n,t)||dh(n,i,r,t)||kh(n,i,r,t)}},willPrintOwnComments(t){const{node:e}=t;return e&&"noop"===e.kind},printComment(t){const e=t.node;switch(e.kind){case"commentblock":{if(!e.value.includes("\n"))return e.value;const t=e.value.split("\n");return t.slice(1,t.length-1).every((t=>"*"===t.trim()[0]))?Ma(Ba,t.map(((e,s)=>(s>0?" ":"")+(s<t.length-1?e.trim():e.trimLeft())))):e.value}case"commentline":return e.value.trimRight();default:throw new Error(`Not a comment: ${JSON.stringify(e)}`)}},hasPrettierIgnore(t){const e=t=>t.value.includes("prettier-ignore")&&!t.value.includes("prettier-ignore-start")&&!t.value.includes("prettier-ignore-end"),{node:s,parent:i}=t;return s&&"classconstant"!==s.kind&&s.comments&&s.comments.length>0&&s.comments.some(e)||s&&"constant"===s.kind&&i&&"classconstant"===i.kind&&i.comments&&i.comments.length>0&&i.comments.some(e)}}};t.defaultOptions={tabWidth:4},t.languages=Ga,t.options=ga,t.parsers=Va,t.printers=Ya}));
File without changes
File without changes
File without changes