@prettier/plugin-php 0.19.6 → 0.19.7

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@prettier/plugin-php",
3
- "version": "0.19.6",
3
+ "version": "0.19.7",
4
4
  "description": "Prettier PHP Plugin",
5
5
  "repository": "prettier/prettier-php",
6
6
  "author": "Lucas Azzola <@azz>",
package/src/printer.js CHANGED
@@ -53,6 +53,7 @@ const {
53
53
  normalizeMagicMethodName,
54
54
  getNextNonSpaceNonCommentCharacterIndex,
55
55
  isNextLineEmpty,
56
+ isPreviousLineEmpty,
56
57
  } = require("./util");
57
58
 
58
59
  function isMinVersion(actualVersion, requiredVersion) {
@@ -2886,9 +2887,27 @@ function printNode(path, options, print) {
2886
2887
  return path.call(print, "name");
2887
2888
  }
2888
2889
  case "match": {
2890
+ const lastArmIndex = node.arms.length - 1;
2889
2891
  const arms = path.map((armPath, armIdx) => {
2892
+ const armNode = armPath.getValue();
2893
+
2894
+ const maybeLeadingComment = comments.hasLeadingComment(armNode)
2895
+ ? [comments.printComments(armNode.leadingComments, options), hardline]
2896
+ : [];
2897
+ const maybeTrailingComma =
2898
+ armIdx < lastArmIndex || options.trailingCommaPHP ? "," : "";
2899
+ const maybeTrailingComment = comments.hasTrailingComment(armNode)
2900
+ ? [
2901
+ " ",
2902
+ comments.printComments(
2903
+ armNode.comments.filter((c) => c.trailing),
2904
+ options
2905
+ ),
2906
+ ]
2907
+ : [];
2908
+
2890
2909
  const conds =
2891
- armPath.getValue().conds === null
2910
+ armNode.conds === null
2892
2911
  ? "default"
2893
2912
  : armPath.map(
2894
2913
  (condPath, condIdx) =>
@@ -2896,17 +2915,31 @@ function printNode(path, options, print) {
2896
2915
  "conds"
2897
2916
  );
2898
2917
  const body = armPath.call(print, "body");
2918
+ const maybeEmptyLineBetweenArms =
2919
+ armIdx > 0 &&
2920
+ isPreviousLineEmpty(options.originalText, armNode, options)
2921
+ ? hardline
2922
+ : "";
2923
+
2899
2924
  return [
2900
- ",",
2925
+ "",
2901
2926
  hardline,
2902
- group([group([conds, indent(line)]), "=> ", body]),
2927
+ maybeEmptyLineBetweenArms,
2928
+ ...maybeLeadingComment,
2929
+ group([
2930
+ group([conds, indent(line)]),
2931
+ "=> ",
2932
+ body,
2933
+ maybeTrailingComma,
2934
+ ...maybeTrailingComment,
2935
+ ]),
2903
2936
  ].slice(armIdx > 0 ? 0 : 1);
2904
2937
  }, "arms");
2905
2938
  return group([
2906
2939
  "match (",
2907
2940
  group([softline, indent(path.call(print, "cond")), softline]),
2908
2941
  ") {",
2909
- group(indent([...arms, options.trailingCommaPHP ? ifBreak(",") : ""])),
2942
+ group(indent([...arms])),
2910
2943
  " ",
2911
2944
  softline,
2912
2945
  "}",
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";function i(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var s=i(e),n={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 "'.concat(t,'" at line ').concat(this.yylineno," (offset ").concat(this.offset,")"))}};n.attributeIndex,n.attributeListDepth,n.matchST_ATTRIBUTE;var r={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}};r.T_COMMENT,r.T_DOC_COMMENT;var o={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}};o.nextINITIAL,o.matchINITIAL;var h={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 i=t;if(t=this.input(),"_"===t){if("_"===i){this.unput(2);break}if("."===i){this.unput(1);break}if("e"===i||"E"===i){this.unput(2);break}}else{if("."===t){if(e){this.unput(1);break}if("_"===i){this.unput(2);break}e=!0;continue}if("e"===t||"E"===t){if("_"===i){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}};h.consume_NUM,h.consume_HNUM,h.consume_LNUM,h.consume_BNUM,h.consume_ONUM;var a={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")}};a.matchST_LOOKING_FOR_PROPERTY,a.matchST_LOOKING_FOR_VARNAME,a.matchST_VAR_OFFSET;var c={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}};c.matchST_IN_SCRIPTING,c.T_WHITESPACE;const l=["\n","\r"],_=["\n","\r",";"],u=_.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 i=this.offset-1;for(;this.offset<this.size&&(this.offset++,this.is_LABEL()););const s=this._input.substring(i,this.offset-1);if((!e||e===this._input[this.offset-1])&&(e&&this.offset++,l.includes(this._input[this.offset-1])))return this.heredoc_label.label=s,this.heredoc_label.length=s.length,this.heredoc_label.finished=!1,i=this.offset-t,this.offset=t,this.consume(i),"'"===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 i=this._input[t-2];if(!l.includes(i))return!1;let s=!1,n=!1,r=0,o=this._input[t-1];if(this.version>=703){for(;"\t"===o||" "===o;)" "===o?s=!0:"\t"===o&&(n=!0),o=this._input[t+r],r++;if(t+=r,l.includes(this._input[t-1]))return!1}if(this._input.substring(t-1,t-1+this.heredoc_label.length)===this.heredoc_label.label){const i=this._input[t-1+this.heredoc_label.length];if((this.version>=703?u:_).includes(i)){if(e){if(this.consume(r),s&&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=s,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(!l.includes(this._input[t-1]))for(;!l.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(l.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(),l.includes(t)||(t=this.input())),l.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}};d.T_CONSTANT_ENCAPSED_STRING,d.is_HEREDOC,d.ST_DOUBLE_QUOTES,d.isDOC_MATCH,d.prematch_ENDOFDOC,d.matchST_NOWDOC,d.matchST_HEREDOC,d.consume_VARIABLE,d.matchST_BACKQUOTE,d.matchST_DOUBLE_QUOTES;var p={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 i=!1;if(this.is_LABEL_START()){for(;this.is_LABEL();)e+=this.input();const t=e.slice(0,-1).toLowerCase();i="extends"!==t&&"implements"!==t}return this.unput(this.offset-t),i?this.tok.T_ENUM:this.tok.T_STRING}if(this.offset<this.size&&e!==this.tok.T_YIELD_FROM){let i=this.input();if("\\"===i){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(),i=this.input()}while("\\"===i)}i&&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(),i=this.castKeywords[e];if("number"==typeof i&&(this.input(),this.is_TABSPACE()&&this.consume_TABSPACE().input(),")"===this._input[this.offset-1]))return i}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):"^"}}};p.T_STRING,p.consume_TOKEN,p.tokenTerminals;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}};f.is_NUM,f.is_NUM_START,f.is_LABEL,f.is_LABEL_START,f.consume_LABEL,f.is_TOKEN,f.is_WHITESPACE,f.is_TABSPACE,f.consume_TABSPACE,f.is_HEX,f.is_OCTAL;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 i=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(i.stack)}return t},[n,r,o,h,a,c,d,p,f].forEach((function(t){for(const e in t)k.prototype[e]=t[e]}));var T=k;var m=function(t,e,i){this.line=t,this.column=e,this.offset=i},x={read_array:function(){let t=null,e=!1;const i=this.node("array");this.token===this.tok.T_ARRAY?(this.next().expect("("),t=")"):(e=!0,t="]");let s=[];return this.next().token!==t&&(s=this.read_array_pair_list(e)),this.expect(t),this.next(),i(e,s)},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 i=null,s=null,n=!1,r=!1;if("&"===this.token)this.next(),n=!0,s=this.read_variable(!0,!1);else if(this.token===this.tok.T_ELLIPSIS&&this.version>=704)this.next(),"&"===this.token&&this.error(),r=!0,s=this.read_expr();else{const t=this.read_expr();this.token===this.tok.T_DOUBLE_ARROW?(this.next(),i=t,"&"===this.token?(this.next(),n=!0,s=this.read_variable(!0,!1)):s=this.read_expr()):s=t}return e(i,s,n,r)}};x.read_array,x.read_array_pair_list,x.read_array_pair;var E={read_class_declaration_statement:function(t){const e=this.node("class"),i=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 s=this.node("identifier");const n=this.text();this.next(),s=s(n);const r=this.read_extends_from(),o=this.read_implements_list();this.expect("{");const h=e(s,r,o,this.next().read_class_body(!0,!1),i);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 i=[],s=[];for(;this.token!==this.EOF&&"}"!==this.token;){if(this.token===this.tok.T_COMMENT){i.push(this.read_comment());continue}if(this.token===this.tok.T_DOC_COMMENT){i.push(this.read_doc_comment());continue}if(this.token===this.tok.T_USE){i=i.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(),i=i.concat(t);continue}this.token===this.tok.T_ATTRIBUTE&&(s=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)i.push(this.read_function(!1,r,s,n)),s=[];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,s);s=[],this.expect(";"),this.next(),i=i.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,s);this.expect(";")&&this.next(),i=i.concat(t)}}return this.expect("}"),this.next(),i},read_variable_list:function(t,e){const i=this.node("propertystatement"),s=this.read_list((function(){const t=this.node("property");let i=!1;this.token===this.tok.T_READ_ONLY&&(i=!0,this.next());const[s,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,i,s,n,e||[]):"="===this.token?t(r,this.next().read_expr(),i,s,n,e||[]):(this.expect([",",";","="]),t(r,null,s,n,e||[]))}),",");return i(null,s,t)},read_constant_list:function(t,e){this.expect(this.tok.T_CONST)&&this.next();const i=this.node("classconstant"),s=this.read_list((function(){const t=this.node("constant");let e=null,i=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("=")&&(i=this.next().read_expr()),t(e,i)}),",");return i(null,s,t,e||[])},read_member_flags:function(t){const e=[-1,-1,-1];if(this.is("T_MEMBER_FLAGS")){let i=0,s=0;do{switch(this.token){case this.tok.T_PUBLIC:i=0,s=0;break;case this.tok.T_PROTECTED:i=0,s=1;break;case this.tok.T_PRIVATE:i=0,s=2;break;case this.tok.T_STATIC:i=1,s=1;break;case this.tok.T_ABSTRACT:i=2,s=1;break;case this.tok.T_FINAL:i=2,s=2}t&&(0==i&&2==s?(this.expect([this.tok.T_PUBLIC,this.tok.T_PROTECTED]),s=-1):2==i&&1==s&&(this.error(),s=-1)),-1!==e[i]?this.error():-1!==s&&(e[i]=s)}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 i=this.node("identifier");const s=this.text();this.next(),i=i(s);const n=this.read_interface_extends_list();this.expect("{");return e(i,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 i=this.position();e=this.read_attr_list();const s=this.read_member_flags(!0);if(this.token==this.tok.T_CONST){const i=this.read_constant_list(s,e);this.expect(";")&&this.next(),t=t.concat(i),e=[]}else if(this.token===this.tok.T_FUNCTION){const n=this.read_function_declaration(2,s,e,i);n.parseFlags(s),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 i=this.text();this.next(),e=e(i),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 i=null;for(;","===this.token;)e.push(this.next().read_namespace_name());if("{"===this.token){for(i=[];this.next().token!==this.EOF&&"}"!==this.token;)i.push(this.read_trait_use_alias()),this.expect(";");this.expect("}")&&this.next()}else this.expect(";")&&this.next();return t(e,i)},read_trait_use_alias:function(){const t=this.node();let e,i=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")){i=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",i,e,this.next().read_name_list());if(this.token===this.tok.T_AS){let s=null,n=null;if(this.next().is("T_MEMBER_FLAGS")&&(s=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===s&&this.expect(this.tok.T_STRING);return t("traitalias",i,e,n,s)}return this.expect([this.tok.T_AS,this.tok.T_INSTEADOF]),t("traitalias",i,e,null,null)}};E.read_class_declaration_statement,E.read_class_modifiers,E.read_class_modifier,E.read_class_body,E.read_variable_list,E.read_constant_list,E.read_member_flags,E.read_optional_type,E.read_interface_declaration_statement,E.read_interface_body,E.read_trait_declaration_statement,E.read_trait_use_statement,E.read_trait_use_alias;var y={read_comment:function(){const t=this.text();let e=this.ast.prepare("/*"===t.substring(0,2)?"commentblock":"commentline",null,this);const i=this.lexer.yylloc.first_offset,s=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=i,this.prev=s,e},read_doc_comment:function(){let t=this.ast.prepare("commentblock",null,this);const e=this.lexer.yylloc.first_offset,i=this.text(),s=this.prev;return this.prev=[this.lexer.yylloc.last_line,this.lexer.yylloc.last_column,this.lexer.offset],this.lex(),t=t(i),t.offset=e,this.prev=s,t}};y.read_comment,y.read_doc_comment;var A={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 i=null;return":"!==this.next().token&&(i=this.read_expr()),this.expect(":")&&this.next(),e("retif",t,i,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,i=[];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 i=this.innerList;t=this.node("list"),i||(e=this.node("assign")),this.next().expect("(")&&this.next(),this.innerList||(this.innerList=!0);const s=this.read_array_pair_list(!1);this.expect(")")&&this.next();let n=!1;for(let t=0;t<s.length;t++)if(null!==s[t]&&"noop"!==s[t].kind){n=!0;break}return n||this.raiseError("Fatal Error : Cannot use empty list on line "+this.lexer.yylloc.first_line),i?t(s,!1):(this.innerList=!1,this.expect("=")?e(t(s,!1),this.next().read_expr(),"="):t(s,!1))}if(this.token===this.tok.T_ATTRIBUTE&&(i=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,i=null;return t=this.node("yield"),this.next().is("EXPR")&&(e=this.read_expr(),this.token===this.tok.T_DOUBLE_ARROW&&(i=e,e=this.next().read_expr())),t(e,i)}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,i);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],i);this.lexer.tokens.push(t),this.next()}}if(this.is("VARIABLE")){t=this.node(),e=this.read_variable(!1,!1);const i="identifier"===e.kind||"staticlookup"===e.kind&&"identifier"===e.offset.kind;switch(this.token){case"=":return i&&this.error("VARIABLE"),"&"==this.next().token?this.read_assignref(t,e):t("assign",e,this.read_expr(),"=");case this.tok.T_PLUS_EQUAL:return i&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"+=");case this.tok.T_MINUS_EQUAL:return i&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"-=");case this.tok.T_MUL_EQUAL:return i&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"*=");case this.tok.T_POW_EQUAL:return i&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"**=");case this.tok.T_DIV_EQUAL:return i&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"/=");case this.tok.T_CONCAT_EQUAL:return i&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),".=");case this.tok.T_MOD_EQUAL:return i&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"%=");case this.tok.T_AND_EQUAL:return i&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"&=");case this.tok.T_OR_EQUAL:return i&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"|=");case this.tok.T_XOR_EQUAL:return i&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"^=");case this.tok.T_SL_EQUAL:return i&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"<<=");case this.tok.T_SR_EQUAL:return i&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),">>=");case this.tok.T_COALESCE_EQUAL:return i&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"??=");case this.tok.T_INC:return i&&this.error("VARIABLE"),this.next(),t("post","+",e);case this.tok.T_DEC:return i&&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 i=this.convertToList(e);e.loc&&(i.loc=e.loc);return t("assign",i,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))),i=this.node("list")(e,!0);return t.loc&&(i.loc=t.loc),t.leadingComments&&(i.leadingComments=t.leadingComments),t.trailingComments&&(i.trailingComments=t.trailingComments),i},read_assignref:function(t,e){let i;return this.next(),this.token===this.tok.T_NEW?(this.version>=700&&this.error(),i=this.read_new_expr()):i=this.read_variable(!1,!1),t("assignref",e,i)},read_inline_function:function(t,e){if(this.token===this.tok.T_FUNCTION){const i=this.read_function(!0,t,e);return i.attrGroups=e,i}!this.version>=704&&this.raiseError("Arrow Functions are not allowed");const i=this.node("arrowfunc");this.expect(this.tok.T_FN)&&this.next();const s=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=i(n,s,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,i=[];return this.expect("(")&&this.next(),e=this.read_expr(),this.expect(")")&&this.next(),this.expect("{")&&this.next(),i=this.read_match_arms(),this.expect("}")&&this.next(),t(e,i)},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 i=this.read_expr();return this.expect(")"),this.next(),"("===this.token&&(e=this.read_argument_list()),t(i,e)}const i=this.read_attr_list();if(this.token===this.tok.T_CLASS){const s=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=s(null,n,r,o,[0,0,0]);return h.attrGroups=i,t(h,e)}let s=this.read_new_class_name();for(;"["===this.token;){const t=this.node("offsetlookup"),e=this.next().read_encaps_var_offset();this.expect("]")&&this.next(),s=t(s,e)}return"("===this.token&&(e=this.read_argument_list()),t(s,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}};A.read_expr,A.read_expr_cast,A.read_isset_variable,A.read_isset_variables,A.read_internal_functions_in_yacc,A.read_optional_expr,A.read_exit_expr,A.read_expr_item,A.convertToList,A.read_assignref,A.read_inline_function,A.read_match_expression,A.read_match_arms,A.read_match_arm,A.read_match_arm_conds,A.read_attribute,A.read_attr_list,A.read_new_expr,A.read_new_class_name,A.handleDereferencable;var g={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 i=this.node("identifier");const s=this.text();this.next(),i=i(s);const n=this.read_enum_value_type(),r=this.read_implements_list();this.expect("{");const o=e(i,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 i=this.next().text();this.next(),e=e(i);const s="="===this.token?this.next().read_expr():null;return this.expect(";"),t(e,s)}};g.read_enum_declaration_statement,g.read_enum_value_type,g.read_enum_case;var N={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,i,s){const n=this.read_function_declaration(t?1:e?2:0,e&&1===e[1],i||[],s);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,i,s){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 _=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 u=t=>(t.attrGroups=i||[],s&&t.loc&&(t.loc.start=s,t.loc.source&&(t.loc.source=this.lexer._input.substr(t.loc.start.offset,t.loc.end.offset-t.loc.start.offset))),t);return u(1===t?r(_,o,a,c,l,e):r(h,_,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 i=this.read_parameter(t);return i&&(e&&this.raiseError("Unexpected parameter after a variadic parameter"),i.variadic&&(e=!0)),i}.bind(this),",")}return[]},read_parameter:function(t){const e=this.node("parameter");let i=null,s=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)){i=this.node("identifier");const t=this.text().substring(1);this.next(),i=i(t)}"="==this.token&&(s=this.next().read_expr());const _=e(i,n,s,c,l,o,r,a);return h&&(_.attrGroups=h),_},read_types(){const t="unset",e="union",i="intersection",s=[];let n=t;const r=this.read_type();if(!r)return null;for(s.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:i:(n===e&&"|"!==this.token||n===i&&"&"!==this.token)&&this.raiseError('Unexpect token "'+this.token+'", "|" and "&" can not be mixed'),this.next(),s.push(this.read_type())}return 1===s.length?s[0]:n===i?this.node("intersectiontype")(s):this.node("uniontype")(s)},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 i="variadic"===e.kind;t&&!i&&this.raiseError("Unexpected non-variadic argument after a variadic argument"),i&&(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(),i=[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(i),this.next(),t.destroy(),this.read_namespace_name())}return t.destroy(),null}};N.is_reference,N.is_variadic,N.read_function,N.read_function_declaration,N.read_lexical_vars,N.read_list_with_dangling_comma,N.read_lexical_var_list,N.read_lexical_var,N.read_parameter_list,N.read_parameter,N.read_types,N.read_promoted,N.read_argument_list,N.read_non_empty_argument_list,N.read_argument,N.read_type;var C={read_if:function(){const t=this.node("if"),e=this.next().read_if_expr();let i=null,s=null,n=!1;if(":"===this.token){n=!0,this.next(),i=this.node("block");const t=[];for(;this.token!==this.EOF&&this.token!==this.tok.T_ENDIF;){if(this.token===this.tok.T_ELSEIF){s=this.read_elseif_short();break}if(this.token===this.tok.T_ELSE){s=this.read_else_short();break}t.push(this.read_inner_statement())}i=i(null,t),this.expect(this.tok.T_ENDIF)&&this.next(),this.expectEndOfStatement()}else i=this.read_statement(),this.token===this.tok.T_ELSEIF?s=this.read_if():this.token===this.tok.T_ELSE&&(s=this.next().read_statement());return t(e,i,s,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"),i=this.next().read_if_expr();this.expect(":")&&this.next();const s=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(i,s(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)}};C.read_if,C.read_if_expr,C.read_elseif_short,C.read_else_short;var L={read_while:function(){const t=this.node("while");this.expect(this.tok.T_WHILE)&&this.next();let e=null,i=null,s=!1;return this.expect("(")&&this.next(),e=this.read_expr(),this.expect(")")&&this.next(),":"===this.token?(s=!0,i=this.read_short_form(this.tok.T_ENDWHILE)):i=this.read_statement(),t(e,i,s)},read_do:function(){const t=this.node("do");this.expect(this.tok.T_DO)&&this.next();let e=null,i=null;return i=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,i)},read_for:function(){const t=this.node("for");this.expect(this.tok.T_FOR)&&this.next();let e=[],i=[],s=[],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?(i=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?(r=!0,n=this.read_short_form(this.tok.T_ENDFOR)):n=this.read_statement(),t(e,i,s,n,r)},read_foreach:function(){const t=this.node("foreach");this.expect(this.tok.T_FOREACH)&&this.next();let e=null,i=null,s=null,n=null,r=!1;return this.expect("(")&&this.next(),e=this.read_expr(),this.expect(this.tok.T_AS)&&(this.next(),s=this.read_foreach_variable(),this.token===this.tok.T_DOUBLE_ARROW&&(i=s,s=this.next().read_foreach_variable())),i&&"list"===i.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,i,s,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 i=this.read_array_pair_list(t);return this.expect(t?"]":")")&&this.next(),e(i,t)}return this.read_variable(!1,!1)}};L.read_while,L.read_do,L.read_for,L.read_foreach,L.read_foreach_variable;var b={read_start:function(){return this.token==this.tok.T_NAMESPACE?this.read_namespace():this.read_top_statement()}};b.read_start;var I={read_namespace:function(){const t=this.node("namespace");let e,i;return this.expect(this.tok.T_NAMESPACE)&&this.next(),i="{"===this.token?{name:[""]}:this.read_namespace_name(),this.currentNamespace=i,";"===this.token?(this.currentNamespace=i,e=this.next().read_top_statements(),this.expect(this.EOF),t(i.name,e,!1)):"{"===this.token?(this.currentNamespace=i,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(i.name,e,!0)):(this.error(["{",";"]),this.currentNamespace=i,e=this.read_top_statements(),this.expect(this.EOF),t(i,e,!1))},read_namespace_name:function(t){const e=this.node();let i,s=this.text();switch(this.token){case this.tok.T_NAME_RELATIVE:i=this.ast.name.RELATIVE_NAME,s=s.replace(/^namespace\\/,"");break;case this.tok.T_NAME_QUALIFIED:i=this.ast.name.QUALIFIED_NAME;break;case this.tok.T_NAME_FULLY_QUALIFIED:i=this.ast.name.FULL_QUALIFIED_NAME;break;default:if(i=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"===s.toLowerCase())return e("parentreference",s);if("self"===s.toLowerCase())return e("selfreference",s)}return e("name",s,i)},read_use_statement:function(){let t=this.node("usegroup"),e=[],i=null;this.expect(this.tok.T_USE)&&this.next();const s=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&&(i=e[0].name,e=this.next().read_use_declarations(null===s),this.expect("}")&&this.next()),t=t(i,s,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 i=null;t&&(i=this.read_use_type());const s=this.read_namespace_name(),n=this.read_use_alias();return e(s.name,n,i)},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"),i=this.text();this.next(),t=e(i)}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}};I.read_namespace,I.read_namespace_name,I.read_use_statement,I.read_class_name_reference,I.read_use_declaration,I.read_use_declarations,I.read_use_alias,I.read_use_type;const S={"\\":"\\",$:"$",n:"\n",r:"\r",t:"\t",f:String.fromCharCode(12),v:String.fromCharCode(11),e:String.fromCharCode(27)};var O={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,i)=>S[e]?S[e]:"x"===e[0]||"X"===e[0]?String.fromCodePoint(parseInt(e.substr(1),16)):"u"===e[0]?String.fromCodePoint(parseInt(i,16)):String.fromCodePoint(parseInt(e,8)))):t.replace(/\\\\/g,"\\").replace(/\\'/g,"'")},remove_heredoc_leading_whitespace_chars:function(t,e,i,s){if(0===e)return t;this.check_heredoc_indentation_level(t,e,i,s);const n=i?" ":"\t",r=new RegExp("\\n".concat(n,"{").concat(e,"}"),"g"),o=new RegExp("^".concat(n,"{").concat(e,"}"));return s&&(t=t.replace(o,"")),t.replace(r,"\n")},check_heredoc_indentation_level:function(t,e,i,s){const n=t.length;let r=0,o=0,h=!0;const a=i?" ":"\t";let c=!1;if(!s){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 ".concat(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 i=this.text();let s=0;"b"!==i[0]&&"B"!==i[0]||(s=1);const n='"'===i[s];this.next();e=e(n,this.resolve_special_chars(i.substring(s+1,i.length-1),n),1===s,i),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 i=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 s=t[t.length-1];"\n"===s?t="\r"===t[t.length-2]?t.substring(0,t.length-2):t.substring(0,t.length-1):"\r"===s&&(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(i,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,i;const s=this.node("offsetlookup");return"["===this.token?(i=this.next().read_expr(),this.expect("]")&&this.next(),e=s(t,i)):this.token===this.tok.T_DOLLAR_OPEN_CURLY_BRACES&&(i=this.read_encapsed_string_item(!1),e=s(t,i)),e},read_encapsed_string_item:function(t){const e=this.node("encapsedpart");let i,s,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),s=this.node("offsetlookup"),i=this.next().read_expr(),this.expect("]")&&this.next(),h=s(n,i)):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&&(s=this.node("offsetlookup"),i=this.next().read_encaps_var_offset(),this.expect("]")&&this.next(),h=s(h,i)),this.token===this.tok.T_OBJECT_OPERATOR){s=this.node("propertylookup"),this.next().expect(this.tok.T_STRING);const t=this.node("identifier");n=this.text(),this.next(),h=s(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 i=this.lexer.yylloc.first_offset;let s=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();const h=this.lexer._input.substring("heredoc"===o?i:n-1,this.lexer.yylloc.first_offset);return s=s(r,h,o),t===this.tok.T_END_HEREDOC&&(s.label=this.lexer.heredoc_label.label,this.lexer.heredoc_label.finished=!0),s},get_magic_constant:function(){const t=this.node("magic"),e=this.text();return this.next(),t(e.toUpperCase(),e)}};O.resolve_special_chars,O.remove_heredoc_leading_whitespace_chars,O.check_heredoc_indentation_level,O.read_dereferencable_scalar,O.read_scalar,O.read_dereferencable,O.read_encapsed_string_item,O.read_encapsed_string,O.get_magic_constant;var v={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 i=this.text();return this.next(),e=e(i),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 i=this.node("identifier");const s=this.text();this.next(),i=i(s);let n=null;if(this.expect("=")&&(n=this.next().read_expr()),t.push(e(i,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 i=this.next().read_expr();return this.expectEndOfStatement(i),e("expressionstatement",i)}if(this.token===this.tok.T_FUNCTION)return this.read_function(!0,[0,1,0]);const i=this.read_variable_declarations();return this.expectEndOfStatement(),e("static",i)}case this.tok.T_ECHO:{const t=this.node("echo"),e=this.text(),i="<?="===e||"<%="===e,s=this.next().read_function_list(this.read_expr,",");return this.expectEndOfStatement(),t(s,i)}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 i="\r"===e||"\n"===e;i&&"\n"===e&&this.lexer.yylloc.first_offset>1&&"\r"===this.lexer._input[this.lexer.yylloc.first_offset-2]&&(e="\r\n");const s=this.node("inline");return this.next(),s(t,i?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 i;this.next().expect("(")&&this.next();const s=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(),i=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(),i=this.ast.declare.MODE_BLOCK}else this.expect(";")&&this.next(),i=this.ast.declare.MODE_NONE;return t(s,e,i)}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()],i=this.text();let s=this.node("identifier");if(":"===this.next().token)return s=s(i),this.next(),t("label",s);s.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 i=t?this.read_top_statements():this.read_inner_statements();return 0===i.length&&this.extractDoc&&this._docs.length>this._docIndex&&i.push(this.node("noop")()),this.expect("}")&&this.next(),e(null,i)}};v.read_top_statements,v.read_top_statement,v.read_inner_statements,v.read_const_list,v.read_declare_list,v.read_inner_statement,v.read_statement,v.read_code_block;var R={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 i=":"===this.token;return t(e,this.read_switch_case_list(),i)},read_switch_case_list:function(){let t=null;const e=this.node("block"),i=[];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;)i.push(this.read_case_list(t));return 0===i.length&&this.extractDoc&&this._docs.length>this._docIndex&&i.push(this.node("noop")()),this.expect(t)&&this.next(),t===this.tok.T_ENDSWITCH&&this.expectEndOfStatement(),e(null,i)},read_case_list:function(t){const e=this.node("case");let i=null;this.token===this.tok.T_CASE?i=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 s=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(i,s(null,n))}};R.read_switch,R.read_switch_case_list,R.read_case_list;var w={read_try:function(){this.expect(this.tok.T_TRY);const t=this.node("try");let e=null;const i=[],s=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 s=null;(this.version<800||this.token===this.tok.T_VARIABLE)&&(s=this.read_variable(!0,!1)),this.expect(")"),i.push(t(this.next().read_statement(),e,s))}return this.token===this.tok.T_FINALLY&&(e=this.next().read_statement()),t(s,i,e)}};w.read_try;var D={read_short_form:function(t){const e=this.node("block"),i=[];for(this.expect(":")&&this.next();this.token!=this.EOF&&this.token!==t;)i.push(this.read_inner_statement());return 0===i.length&&this.extractDoc&&this._docs.length>this._docIndex&&i.push(this.node("noop")()),this.expect(t)&&this.next(),this.expectEndOfStatement(),e(null,i)},read_function_list:function(t,e){const i=[];do{if(this.token==e&&this.version>=703&&i.length>0){i.push(this.node("noop")());break}if(i.push(t.apply(this,[])),this.token!=e)break;if(")"==this.next().token&&this.version>=703)break}while(this.token!=this.EOF);return i},read_list:function(t,e,i){const s=[];if(this.token==e&&(i&&s.push("function"==typeof t?this.node("noop")():null),this.next()),"function"==typeof t)do{const i=t.apply(this,[]);if(i&&s.push(i),this.token!=e)break}while(this.next().token!=this.EOF);else{if(!this.expect(t))return[];for(s.push(this.text());this.next().token!=this.EOF&&this.token==e&&this.next().token==t;)s.push(this.text())}return s},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 i=t();return i&&(this.ast.swapLocations(i,e,i,this),i.byref=!0),i},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}};D.read_short_form,D.read_function_list,D.read_list,D.read_name_list,D.read_byref,D.read_variable_declarations,D.read_extends_from,D.read_interface_extends_list,D.read_implements_list;var P={read_variable:function(t,e){let i;if("&"===this.token)return this.read_byref(this.read_variable.bind(this,t,e));if(this.is([this.tok.T_VARIABLE,"$"]))i=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])){i=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?i=t.destroy(i("boolean",!0,t.name)):"false"===e?i=t.destroy(i("boolean",!1,t.name)):"null"===e?i=t.destroy(i("nullkeyword",t.name)):(i.destroy(t),i=t)}else i.destroy(t),i=t}else if(this.token===this.tok.T_STATIC){i=this.node("staticreference");const t=this.text();this.next(),i=i(t)}else this.expect("VARIABLE");return this.token===this.tok.T_DOUBLE_COLON&&(i=this.read_static_getter(i,e)),this.recursive_variable_chain_scan(i,t,e)},read_static_getter:function(t,e){const i=this.node("staticlookup");let s,n;return this.next().is([this.tok.T_VARIABLE,"$"])?s=this.read_reference_variable(e):this.token===this.tok.T_STRING||this.token===this.tok.T_CLASS||this.version>=700&&this.is("IDENTIFIER")?(s=this.node("identifier"),n=this.text(),this.next(),s=s(n)):"{"===this.token?(s=this.node("literal"),n=this.next().read_expr(),this.expect("}")&&this.next(),s=s("literal",n,null),this.expect("(")):(this.error([this.tok.T_VARIABLE,this.tok.T_STRING]),s=this.node("identifier"),n=this.text(),this.next(),s=s(n)),i(t,s)},read_what:function(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=null,i=null;switch(this.next().token){case this.tok.T_STRING:e=this.node("identifier"),i=this.text(),this.next(),e=e(i),t&&this.token===this.tok.T_OBJECT_OPERATOR&&this.error();break;case this.tok.T_VARIABLE:e=this.node("variable"),i=this.text().substring(1),this.next(),e=e(i,!1);break;case"$":e=this.node(),this.next().expect(["$","{",this.tok.T_VARIABLE]),"{"===this.token?(i=this.next().read_expr(),this.expect("}")&&this.next(),e=e("variable",i,!0)):(i=this.read_expr(),e=e("variable",i,!1));break;case"{":e=this.node("encapsedpart"),i=this.next().read_expr(),this.expect("}")&&this.next(),e=e(i,"complex",!1);break;default:this.error([this.tok.T_STRING,this.tok.T_VARIABLE,"$","{"]),e=this.node("identifier"),i=this.text(),this.next(),e=e(i)}return e},recursive_variable_chain_scan:function(t,e,i){let s,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(s=this.node("offsetlookup"),this.next(),n=!1,i)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=s(t,n);break}case this.tok.T_DOUBLE_COLON:"staticlookup"===t.kind&&"identifier"===t.offset.kind&&this.error(),s=this.node("staticlookup"),t=s(t,this.read_what(!0));break;case this.tok.T_OBJECT_OPERATOR:s=this.node("propertylookup"),t=s(t,this.read_what());break;case this.tok.T_NULLSAFE_OBJECT_OPERATOR:s=this.node("nullsafepropertylookup"),t=s(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,i=this.read_simple_variable();for(;this.token!=this.EOF;){const s=this.node();if("{"!=this.token||t){s.destroy();break}e=this.next().read_expr(),this.expect("}")&&this.next(),i=s("offsetlookup",i,e)}return i},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 i=this.node("variable");this.next(),e=e(i(t,!1),!1);break}default:this.error(["{","$",this.tok.T_VARIABLE]),t=this.text(),this.next(),e=e(t,!1)}return e}};function U(t){return"."!=t&&","!=t&&!isNaN(parseFloat(t))&&isFinite(t)}P.read_variable,P.read_static_getter,P.read_what,P.recursive_variable_chain_scan,P.read_encaps_var_offset,P.read_reference_variable,P.read_simple_variable;const M=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 i=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(i)),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(i)),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(i)),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(i)),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(i)),EOS:new Map([";",this.EOF,this.tok.T_INLINE_HTML].map(i)),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(i))}};M.prototype.getTokenName=function(t){return U(t)?t==this.EOF?"the end of file (EOF)":this.lexer.engine.tokens.values[t]:"'"+t+"'"},M.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 i=this.node("program"),s=[];for(this.next();this.token!=this.EOF;)s.push(this.read_start());0===s.length&&this.extractDoc&&this._docs.length>this._docIndex&&s.push(this.node("noop")()),this.prev=[this.lexer.yylloc.last_line,this.lexer.yylloc.last_column,this.lexer.offset];const n=i(s,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},M.prototype.raiseError=function(t,e,i,s){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,s,this.lexer.yylloc.first_line,i);return this._errors.push(n),n},M.prototype.error=function(t){let e="Parse Error : syntax error",i=this.getTokenName(this.token),s="";if(this.token!==this.EOF){if(U(this.token)){let t=this.text();t.length>10&&(t=t.substring(0,7)+"..."),i="'"+t+"' ("+i+")"}e+=", unexpected "+i}return t&&!Array.isArray(t)&&((U(t)||1===t.length)&&(s=", expecting "+this.getTokenName(t)),e+=s),this.raiseError(e,s,t,i)},M.prototype.position=function(){return new m(this.lexer.yylloc.first_line,this.lexer.yylloc.first_column,this.lexer.yylloc.first_offset)},M.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 i=this.ast.prepare(t,e,this);return i.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),i}return this.ast.prepare(t,null,this)},M.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 B=["parser.next","parser.node","parser.showlog"];M.prototype.showlog=function(){const t=(new Error).stack.split("\n");let e;for(let i=2;i<t.length;i++){e=t[i].trim();let s=!1;for(let t=0;t<B.length;t++)if(e.substring(3,3+B[t].length)===B[t]){s=!0;break}if(!s)break}return console.log("Line "+this.lexer.yylloc.first_line+" : "+this.getTokenName(this.token)+">"+this.lexer.yytext+"< @--\x3e"+e),this},M.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},M.prototype.text=function(){return this.lexer.yytext},M.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},M.prototype.peek=function(){const t=this.lexer.getState(),e=this.lexer.lex();return this.lexer.setState(t),e},M.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},M.prototype.is=function(t){return Array.isArray(t)?-1!==t.indexOf(this.token):this.entries[t].has(this.token)},[x,E,y,A,g,N,C,L,b,I,O,v,R,w,D,P].forEach((function(t){for(const e in t){if(Object.prototype.hasOwnProperty.call(M.prototype,e))throw new Error("Function "+e+" is already defined - collision");M.prototype[e]=t[e]}}));var F=M;const H={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},G={values:Object.entries(H).reduce(((t,e)=>{let[i,s]=e;return{...t,[s]:i}}),{}),names:H};var V=Object.freeze(G);var Q=function(t,e,i){this.source=t,this.start=e,this.end=i};const W=function(t,e,i){this.kind=t,e&&(this.leadingComments=e),i&&(this.loc=i)};W.prototype.setTrailingComments=function(t){this.trailingComments=t},W.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},W.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},W.extends=function(t,e){return e.prototype=Object.create(this.prototype),e.extends=this.extends,e.prototype.constructor=e,e.kind=t,e};var Y=W;const $="expression";var j=Y.extends($,(function(t,e,i){Y.apply(this,[t||$,e,i])}));const z="array";var K=j.extends(z,(function(t,e,i,s){j.apply(this,[z,i,s]),this.items=e,this.shortForm=t}));const X="arrowfunc";var q=j.extends(X,(function(t,e,i,s,n,r,o,h){j.apply(this,[X,o,h]),this.arguments=t,this.byref=e,this.body=i,this.type=s,this.nullable=n,this.isStatic=r||!1}));const J="assign";var Z=j.extends(J,(function(t,e,i,s,n){j.apply(this,[J,s,n]),this.left=t,this.right=e,this.operator=i}));const tt="assignref";var et=j.extends(tt,(function(t,e,i,s){j.apply(this,[tt,i,s]),this.left=t,this.right=e}));const it="attribute";var st=Y.extends(it,(function(t,e,i,s){Y.apply(this,[it,i,s]),this.name=t,this.args=e}));const nt="attrgroup";var rt=Y.extends(nt,(function(t,e,i){Y.apply(this,[nt,e,i]),this.attrs=t||[]}));const ot="operation";var ht=j.extends(ot,(function(t,e,i){j.apply(this,[t||ot,e,i])}));var at=ht.extends("bin",(function(t,e,i,s,n){ht.apply(this,["bin",s,n]),this.type=t,this.left=e,this.right=i}));const ct="statement";var lt=Y.extends(ct,(function(t,e,i){Y.apply(this,[t||ct,e,i])}));const _t="block";var ut=lt.extends(_t,(function(t,e,i,s){lt.apply(this,[t||_t,i,s]),this.children=e.filter(Boolean)}));const dt="literal";var pt=j.extends(dt,(function(t,e,i,s,n){j.apply(this,[t||dt,s,n]),this.value=e,i&&(this.raw=i)}));const ft="boolean";var kt=pt.extends(ft,(function(t,e,i,s){pt.apply(this,[ft,t,e,i,s])}));const Tt="break";var mt=lt.extends(Tt,(function(t,e,i){lt.apply(this,[Tt,e,i]),this.level=t}));const xt="byref";var Et=j.extends(xt,(function(t,e,i){j.apply(this,[xt,e,i]),this.what=t}));const yt="call";var At=j.extends(yt,(function(t,e,i,s){j.apply(this,[yt,i,s]),this.what=t,this.arguments=e}));const gt="case";var Nt=lt.extends(gt,(function(t,e,i,s){lt.apply(this,[gt,i,s]),this.test=t,this.body=e}));const Ct="cast";var Lt=ht.extends(Ct,(function(t,e,i,s,n){ht.apply(this,[Ct,s,n]),this.type=t,this.raw=e,this.expr=i}));const bt="catch";var It=lt.extends(bt,(function(t,e,i,s,n){lt.apply(this,[bt,s,n]),this.body=t,this.what=e,this.variable=i}));const St="declaration",Ot=lt.extends(St,(function(t,e,i,s){lt.apply(this,[t||St,i,s]),this.name=e}));Ot.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 vt=Ot;const Rt="class";var wt=vt.extends(Rt,(function(t,e,i,s,n,r,o){vt.apply(this,[Rt,t,r,o]),this.isAnonymous=!t,this.extends=e,this.implements=i,this.body=s,this.attrGroups=[],this.parseFlags(n)}));const Dt="constantstatement";var Pt=lt.extends(Dt,(function(t,e,i,s){lt.apply(this,[t||Dt,i,s]),this.constants=e}));const Ut="classconstant",Mt=Pt.extends(Ut,(function(t,e,i,s,n,r){Pt.apply(this,[t||Ut,e,n,r]),this.parseFlags(i),this.attrGroups=s}));Mt.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 Bt=Mt;const Ft="clone";var Ht=j.extends(Ft,(function(t,e,i){j.apply(this,[Ft,e,i]),this.what=t}));const Gt="closure";var Vt=j.extends(Gt,(function(t,e,i,s,n,r,o,h){j.apply(this,[Gt,o,h]),this.uses=i,this.arguments=t,this.byref=e,this.type=s,this.nullable=n,this.isStatic=r||!1,this.body=null,this.attrGroups=[]})),Qt=Y.extends("comment",(function(t,e,i,s){Y.apply(this,[t,i,s]),this.value=e}));const Wt="commentblock";var Yt=Qt.extends(Wt,(function(t,e,i){Qt.apply(this,[Wt,t,e,i])}));const $t="commentline";var jt=Qt.extends($t,(function(t,e,i){Qt.apply(this,[$t,t,e,i])}));const zt="constant";var Kt=Y.extends(zt,(function(t,e,i,s){Y.apply(this,[zt,i,s]),this.name=t,this.value=e}));const Xt="continue";var qt=lt.extends(Xt,(function(t,e,i){lt.apply(this,[Xt,e,i]),this.level=t}));const Jt="declare",Zt=ut.extends(Jt,(function(t,e,i,s,n){ut.apply(this,[Jt,e,s,n]),this.directives=t,this.mode=i}));Zt.MODE_SHORT="short",Zt.MODE_BLOCK="block",Zt.MODE_NONE="none";var te=Zt;const ee="declaredirective";var ie=Y.extends(ee,(function(t,e,i,s){Y.apply(this,[ee,i,s]),this.key=t,this.value=e}));var se=lt.extends("do",(function(t,e,i,s){lt.apply(this,["do",i,s]),this.test=t,this.body=e}));const ne="echo";var re=lt.extends(ne,(function(t,e,i,s){lt.apply(this,[ne,i,s]),this.shortForm=e,this.expressions=t}));const oe="empty";var he=j.extends(oe,(function(t,e,i){j.apply(this,[oe,e,i]),this.expression=t}));const ae="encapsed",ce=pt.extends(ae,(function(t,e,i,s,n){pt.apply(this,[ae,t,e,s,n]),this.type=i}));ce.TYPE_STRING="string",ce.TYPE_SHELL="shell",ce.TYPE_HEREDOC="heredoc",ce.TYPE_OFFSET="offset";var le=ce;const _e="encapsedpart";var ue=j.extends(_e,(function(t,e,i,s,n){j.apply(this,[_e,s,n]),this.expression=t,this.syntax=e,this.curly=i}));const de="entry";var pe=j.extends(de,(function(t,e,i,s,n,r){j.apply(this,[de,n,r]),this.key=t,this.value=e,this.byRef=i,this.unpack=s}));const fe="enum";var ke=vt.extends(fe,(function(t,e,i,s,n,r){vt.apply(this,[fe,t,n,r]),this.valueType=e,this.implements=i,this.body=s,this.attrGroups=[]}));const Te="enumcase";var me=Y.extends(Te,(function(t,e,i,s){Y.apply(this,[Te,i,s]),this.name=t,this.value=e}));const xe="error";var Ee=Y.extends(xe,(function(t,e,i,s,n,r){Y.apply(this,[xe,n,r]),this.message=t,this.token=e,this.line=i,this.expected=s}));const ye="eval";var Ae=j.extends(ye,(function(t,e,i){j.apply(this,[ye,e,i]),this.source=t}));const ge="exit";var Ne=j.extends(ge,(function(t,e,i,s){j.apply(this,[ge,i,s]),this.expression=t,this.useDie=e}));const Ce="expressionstatement";var Le=lt.extends(Ce,(function(t,e,i){lt.apply(this,[Ce,e,i]),this.expression=t}));var be=lt.extends("for",(function(t,e,i,s,n,r,o){lt.apply(this,["for",r,o]),this.init=t,this.test=e,this.increment=i,this.shortForm=n,this.body=s}));const Ie="foreach";var Se=lt.extends(Ie,(function(t,e,i,s,n,r,o){lt.apply(this,[Ie,r,o]),this.source=t,this.key=e,this.value=i,this.shortForm=n,this.body=s}));const Oe="function";var ve=vt.extends(Oe,(function(t,e,i,s,n,r,o){vt.apply(this,[Oe,t,r,o]),this.arguments=e,this.byref=i,this.type=s,this.nullable=n,this.body=null,this.attrGroups=[]}));const Re="global";var we=lt.extends(Re,(function(t,e,i){lt.apply(this,[Re,e,i]),this.items=t}));const De="goto";var Pe=lt.extends(De,(function(t,e,i){lt.apply(this,[De,e,i]),this.label=t}));const Ue="halt";var Me=lt.extends(Ue,(function(t,e,i){lt.apply(this,[Ue,e,i]),this.after=t}));const Be="identifier",Fe=Y.extends(Be,(function(t,e,i){Y.apply(this,[Be,e,i]),this.name=t}));var He=Fe;var Ge=lt.extends("if",(function(t,e,i,s,n,r){lt.apply(this,["if",n,r]),this.test=t,this.body=e,this.alternate=i,this.shortForm=s}));const Ve="include";var Qe=j.extends(Ve,(function(t,e,i,s,n){j.apply(this,[Ve,s,n]),this.once=t,this.require=e,this.target=i}));const We="inline";var Ye=pt.extends(We,(function(t,e,i,s){pt.apply(this,[We,t,e,i,s])}));const $e="interface";var je=vt.extends($e,(function(t,e,i,s,n,r){vt.apply(this,[$e,t,n,r]),this.extends=e,this.body=i,this.attrGroups=s}));const ze="intersectiontype";var Ke=vt.extends(ze,(function(t,e,i){vt.apply(this,[ze,null,e,i]),this.types=t}));const Xe="isset";var qe=j.extends(Xe,(function(t,e,i){j.apply(this,[Xe,e,i]),this.variables=t}));const Je="label";var Ze=lt.extends(Je,(function(t,e,i){lt.apply(this,[Je,e,i]),this.name=t}));const ti="list";var ei=j.extends(ti,(function(t,e,i,s){j.apply(this,[ti,i,s]),this.items=t,this.shortForm=e}));const ii="lookup";var si=j.extends(ii,(function(t,e,i,s,n){j.apply(this,[t||ii,s,n]),this.what=e,this.offset=i}));const ni="magic";var ri=pt.extends(ni,(function(t,e,i,s){pt.apply(this,[ni,t,e,i,s])}));const oi="match";var hi=j.extends(oi,(function(t,e,i,s){j.apply(this,[oi,i,s]),this.cond=t,this.arms=e}));const ai="matcharm";var ci=j.extends(ai,(function(t,e,i,s){j.apply(this,[ai,i,s]),this.conds=t,this.body=e}));const li="method";var _i=ve.extends(li,(function(){ve.apply(this,arguments),this.kind=li}));const ui="reference";var di=Y.extends(ui,(function(t,e,i){Y.apply(this,[t||ui,e,i])}));const pi="name",fi=di.extends(pi,(function(t,e,i,s){di.apply(this,[pi,i,s]),this.name=t.replace(/\\$/,""),this.resolution=e}));fi.UNQUALIFIED_NAME="uqn",fi.QUALIFIED_NAME="qn",fi.FULL_QUALIFIED_NAME="fqn",fi.RELATIVE_NAME="rn";var ki=fi;const Ti="namespace";var mi=ut.extends(Ti,(function(t,e,i,s,n){ut.apply(this,[Ti,e,s,n]),this.name=t,this.withBrackets=i||!1}));const xi="namedargument";var Ei=j.extends(xi,(function(t,e,i,s){j.apply(this,[xi,i,s]),this.name=t,this.value=e}));var yi=j.extends("new",(function(t,e,i,s){j.apply(this,["new",i,s]),this.what=t,this.arguments=e}));const Ai="noop";var gi=Y.extends(Ai,(function(t,e){Y.apply(this,[Ai,t,e])}));const Ni="nowdoc";var Ci=pt.extends(Ni,(function(t,e,i,s,n){pt.apply(this,[Ni,t,e,s,n]),this.label=i}));const Li="nullkeyword";var bi=Y.extends(Li,(function(t,e,i){Y.apply(this,[Li,e,i]),this.raw=t}));const Ii="nullsafepropertylookup";var Si=si.extends(Ii,(function(t,e,i,s){si.apply(this,[Ii,t,e,i,s])}));const Oi="number";var vi=pt.extends(Oi,(function(t,e,i,s){pt.apply(this,[Oi,t,e,i,s])}));const Ri="offsetlookup";var wi=si.extends(Ri,(function(t,e,i,s){si.apply(this,[Ri,t,e,i,s])}));const Di="parameter";var Pi=vt.extends(Di,(function(t,e,i,s,n,r,o,h,a,c){vt.apply(this,[Di,t,a,c]),this.value=i,this.type=e,this.byref=s,this.variadic=n,this.readonly=r,this.nullable=o,this.flags=h||0,this.attrGroups=[]}));const Ui="parentreference";var Mi=di.extends(Ui,(function(t,e,i){di.apply(this,[Ui,e,i]),this.raw=t}));const Bi="post";var Fi=ht.extends(Bi,(function(t,e,i,s){ht.apply(this,[Bi,i,s]),this.type=t,this.what=e}));var Hi=ht.extends("pre",(function(t,e,i,s){ht.apply(this,["pre",i,s]),this.type=t,this.what=e}));const Gi="print";var Vi=j.extends(Gi,(function(t,e,i){j.apply(this,[Gi,e,i]),this.expression=t}));const Qi="program";var Wi=ut.extends(Qi,(function(t,e,i,s,n,r){ut.apply(this,[Qi,t,n,r]),this.errors=e,i&&(this.comments=i),s&&(this.tokens=s)}));const Yi="property";var $i=lt.extends(Yi,(function(t,e,i,s,n,r,o,h){lt.apply(this,[Yi,o,h]),this.name=t,this.value=e,this.readonly=i,this.nullable=s,this.type=n,this.attrGroups=r}));const ji="propertylookup";var zi=si.extends(ji,(function(t,e,i,s){si.apply(this,[ji,t,e,i,s])}));const Ki="propertystatement",Xi=lt.extends(Ki,(function(t,e,i,s,n){lt.apply(this,[Ki,s,n]),this.properties=e,this.parseFlags(i)}));Xi.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 qi=Xi;const Ji="retif";var Zi=j.extends(Ji,(function(t,e,i,s,n){j.apply(this,[Ji,s,n]),this.test=t,this.trueExpr=e,this.falseExpr=i}));const ts="return";var es=lt.extends(ts,(function(t,e,i){lt.apply(this,[ts,e,i]),this.expr=t}));const is="selfreference";var ss=di.extends(is,(function(t,e,i){di.apply(this,[is,e,i]),this.raw=t}));const ns="silent";var rs=j.extends(ns,(function(t,e,i){j.apply(this,[ns,e,i]),this.expr=t}));const os="static";var hs=lt.extends(os,(function(t,e,i){lt.apply(this,[os,e,i]),this.variables=t}));const as="staticvariable";var cs=Y.extends(as,(function(t,e,i,s){Y.apply(this,[as,i,s]),this.variable=t,this.defaultValue=e}));const ls="staticlookup";var _s=si.extends(ls,(function(t,e,i,s){si.apply(this,[ls,t,e,i,s])}));const us="staticreference";var ds=di.extends(us,(function(t,e,i){di.apply(this,[us,e,i]),this.raw=t}));const ps="string";var fs=pt.extends(ps,(function(t,e,i,s,n,r){pt.apply(this,[ps,e,s,n,r]),this.unicode=i,this.isDoubleQuote=t}));const ks="switch";var Ts=lt.extends(ks,(function(t,e,i,s,n){lt.apply(this,[ks,s,n]),this.test=t,this.body=e,this.shortForm=i}));const ms="throw";var xs=lt.extends(ms,(function(t,e,i){lt.apply(this,[ms,e,i]),this.what=t}));const Es="trait";var ys=vt.extends(Es,(function(t,e,i,s){vt.apply(this,[Es,t,i,s]),this.body=e}));const As="traitalias";var gs=Y.extends(As,(function(t,e,i,s,n,r){Y.apply(this,[As,n,r]),this.trait=t,this.method=e,this.as=i,this.visibility="",s&&(0===s[0]?this.visibility="public":1===s[0]?this.visibility="protected":2===s[0]&&(this.visibility="private"))}));const Ns="traitprecedence";var Cs=Y.extends(Ns,(function(t,e,i,s,n){Y.apply(this,[Ns,s,n]),this.trait=t,this.method=e,this.instead=i}));const Ls="traituse";var bs=Y.extends(Ls,(function(t,e,i,s){Y.apply(this,[Ls,i,s]),this.traits=t,this.adaptations=e}));var Is=lt.extends("try",(function(t,e,i,s,n){lt.apply(this,["try",s,n]),this.body=t,this.catches=e,this.always=i}));const Ss="typereference",Os=di.extends(Ss,(function(t,e,i,s){di.apply(this,[Ss,i,s]),this.name=t,this.raw=e}));Os.types=["int","float","string","bool","object","array","callable","iterable","void","static"];var vs=Os;const Rs="unary";var ws=ht.extends(Rs,(function(t,e,i,s){ht.apply(this,[Rs,i,s]),this.type=t,this.what=e}));const Ds="uniontype";var Ps=vt.extends(Ds,(function(t,e,i){vt.apply(this,[Ds,null,e,i]),this.types=t}));const Us="unset";var Ms=lt.extends(Us,(function(t,e,i){lt.apply(this,[Us,e,i]),this.variables=t}));const Bs="usegroup";var Fs=lt.extends(Bs,(function(t,e,i,s,n){lt.apply(this,[Bs,s,n]),this.name=t,this.type=e,this.items=i}));const Hs="useitem",Gs=lt.extends(Hs,(function(t,e,i,s,n){lt.apply(this,[Hs,s,n]),this.name=t,this.alias=e,this.type=i}));Gs.TYPE_CONST="const",Gs.TYPE_FUNCTION="function";var Vs=Gs;const Qs="variable";var Ws=j.extends(Qs,(function(t,e,i,s){j.apply(this,[Qs,i,s]),this.name=t,this.curly=e||!1}));const Ys="variadic";var $s=j.extends(Ys,(function(t,e,i){j.apply(this,[Ys,e,i]),this.what=t}));const js="variadicplaceholder";var zs=Y.extends(js,(function(t,e){Y.apply(this,[js,t,e])}));const Ks="while";var Xs=lt.extends(Ks,(function(t,e,i,s,n){lt.apply(this,[Ks,s,n]),this.test=t,this.body=e,this.shortForm=i}));const qs="yield";var Js=j.extends(qs,(function(t,e,i,s){j.apply(this,[qs,i,s]),this.value=t,this.key=e}));const Zs="yieldfrom";var tn=j.extends(Zs,(function(t,e,i){j.apply(this,[Zs,e,i]),this.value=t}));const en=function(t,e){this.withPositions=t,this.withSource=e};en.precedence={},[["or"],["xor"],["and"],["="],["?"],["??"],["||"],["&&"],["|"],["^"],["&"],["==","!=","===","!==","<=>"],["<","<=",">",">="],["<<",">>"],["+","-","."],["*","/","%"],["!"],["instanceof"],["cast","silent"],["**"]].forEach((function(t,e){t.forEach((function(t){en.precedence[t]=e+1}))})),en.prototype.isRightAssociative=function(t){return"**"===t||"??"===t},en.prototype.swapLocations=function(t,e,i,s){this.withPositions&&(t.loc.start=e.loc.start,t.loc.end=i.loc.end,this.withSource&&(t.loc.source=s.lexer._input.substring(t.loc.start.offset,t.loc.end.offset)))},en.prototype.resolveLocations=function(t,e,i,s){this.withPositions&&(t.loc.start.offset>e.loc.start.offset&&(t.loc.start=e.loc.start),t.loc.end.offset<i.loc.end.offset&&(t.loc.end=i.loc.end),this.withSource&&(t.loc.source=s.lexer._input.substring(t.loc.start.offset,t.loc.end.offset)))},en.prototype.resolvePrecedence=function(t,e){let i,s,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?(s=en.precedence[t.type],n=en.precedence[t.right.type],s&&n&&n<=s&&(t.type!==t.right.type||!this.isRightAssociative(t.type))&&(i=t.right,t.right=t.right.left,this.swapLocations(t,t.left,t.right,e),i.left=this.resolvePrecedence(t,e),this.swapLocations(i,i.left,i.right,e),t=i)):"retif"===t.right.kind&&(s=en.precedence[t.type],n=en.precedence["?"],s&&n&&n<=s&&(i=t.right,t.right=t.right.test,this.swapLocations(t,t.left,t.right,e),i.test=this.resolvePrecedence(t,e),this.swapLocations(i,i.test,i.falseExpr,e),t=i))):"silent"!==t.kind&&"cast"!==t.kind||!t.expr||t.expr.parenthesizedExpression?"unary"===t.kind?t.what&&!t.what.parenthesizedExpression&&("bin"===t.what.kind?(i=t.what,t.what=t.what.left,this.swapLocations(t,t,t.what,e),i.left=this.resolvePrecedence(t,e),this.swapLocations(i,i.left,i.right,e),t=i):"retif"===t.what.kind&&(i=t.what,t.what=t.what.test,this.swapLocations(t,t,t.what,e),i.test=this.resolvePrecedence(t,e),this.swapLocations(i,i.test,i.falseExpr,e),t=i)):"retif"===t.kind?t.falseExpr&&"retif"===t.falseExpr.kind&&!t.falseExpr.parenthesizedExpression&&(i=t.falseExpr,t.falseExpr=i.test,this.swapLocations(t,t.test,t.falseExpr,e),i.test=this.resolvePrecedence(t,e),this.swapLocations(i,i.test,i.falseExpr,e),t=i):"assign"===t.kind?t.right&&"bin"===t.right.kind&&!t.right.parenthesizedExpression&&(s=en.precedence["="],n=en.precedence[t.right.type],s&&n&&n<s&&(i=t.right,t.right=t.right.left,i.left=t,this.swapLocations(i,i.left,t.right,e),t=i)):"expressionstatement"===t.kind&&this.swapLocations(t,t.expression,t,e):"bin"===t.expr.kind?(i=t.expr,t.expr=t.expr.left,this.swapLocations(t,t,t.expr,e),i.left=this.resolvePrecedence(t,e),this.swapLocations(i,i.left,i.right,e),t=i):"retif"===t.expr.kind&&(i=t.expr,t.expr=t.expr.test,this.swapLocations(t,t,t.expr,e),i.test=this.resolvePrecedence(t,e),this.swapLocations(i,i.test,i.falseExpr,e),t=i),t},en.prototype.prepare=function(t,e,i){let s=null;(this.withPositions||this.withSource)&&(s=i.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=i.lexer._input.substring(s.offset,i.prev[2])),o=new Q(t,s,new m(i.prev[0],i.prev[1],i.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),i.debug&&delete n.stack[r.stackUid],n.resolvePrecedence(c,i)};return i.debug&&(this.stack||(this.stack={},this.stackUid=1),this.stack[++this.stackUid]={position:s,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:i._docIndex=i._docs.length-e.length),i.debug&&delete n.stack[r.stackUid]},r},en.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},[K,q,Z,et,st,rt,at,ut,kt,mt,Et,At,Nt,Lt,It,wt,Bt,Ht,Vt,Qt,Yt,jt,Kt,Pt,qt,vt,te,ie,se,re,he,le,ue,pe,ke,me,Ee,Ae,Ne,j,Le,be,Se,ve,we,Pe,Me,He,Ge,Qe,Ye,je,Ke,qe,Ze,ei,pt,si,ri,hi,ci,_i,ki,mi,Ei,yi,Y,gi,Ci,bi,Si,vi,wi,ht,Pi,Mi,Fi,Hi,Vi,Wi,$i,zi,qi,di,Zi,es,ss,rs,lt,hs,cs,_s,ds,fs,Ts,xs,ys,gs,Cs,bs,Is,vs,ws,Ps,Ms,Fs,Vs,Ws,$s,zs,Xs,Js,tn].forEach((function(t){en.prototype[t.kind]=t}));var sn=en;function nn(t,e){const i=Object.keys(t);let s=i.length;for(;s--;){const n=i[s],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]?nn(r,e[n]):r}return e}const rn=function(t){if("function"==typeof this)return new this(t);if(this.tokens=V,this.lexer=new T(this),this.ast=new sn,this.parser=new F(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")}nn(t,this),this.lexer.version=this.parser.version}},on=function(t){return"function"==typeof t.write?t.toString():t};rn.create=function(t){return new rn(t)},rn.parseEval=function(t,e){return new rn(e).parseEval(t)},rn.prototype.parseEval=function(t){return this.lexer.mode_eval=!0,this.lexer.all_tokens=!1,t=on(t),this.parser.parse(t,"eval")},rn.parseCode=function(t,e,i){"object"!=typeof e||i||(i=e,e="unknown");return new rn(i).parseCode(t,e)},rn.prototype.parseCode=function(t,e){return this.lexer.mode_eval=!1,this.lexer.all_tokens=!1,t=on(t),this.parser.parse(t,e)},rn.tokenGetAll=function(t,e){return new rn(e).tokenGetAll(t)},rn.prototype.tokenGetAll=function(t){this.lexer.mode_eval=!1,this.lexer.all_tokens=!0,t=on(t);const e=this.lexer.EOF,i=this.tokens.values;this.lexer.setInput(t);let s=this.lexer.lex()||e;const n=[];for(;s!=e;){let t=this.lexer.yytext;Object.prototype.hasOwnProperty.call(i,s)&&(t=[i[s],t,this.lexer.yylloc.first_line]),n.push(t),s=this.lexer.lex()||e}return n};var hn=rn,an=V,cn=T,ln=sn,_n=F,un=nn,dn=rn,pn=rn;hn.tokens=an,hn.lexer=cn,hn.AST=ln,hn.parser=_n,hn.combine=un,hn.Engine=dn,hn.default=pn;var fn=function(t,e,i){const s=i&&"markdown"===i.parentParser;if(!t&&s)return"";t=t.replace(/\?>\n<\?/g,"?>\n___PSEUDO_INLINE_PLACEHOLDER___<?");const n=new hn({parser:{extractDoc:!0},ast:{withPositions:!0,withSource:!0}}),r=-1!==t.indexOf("<?php"),o=s&&!r;let h;try{h=o?n.parseEval(t):n.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 h.extra={parseAsEval:o},h.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)})),h};const{hasNewline:kn,skipEverythingButNewLine:Tn,skipNewline:mn,isNextLineEmpty:xn,isPreviousLineEmpty:En,getNextNonSpaceNonCommentCharacterIndex:yn}=s.default.util,An=s.default.version;function gn(t,e){return parseInt(An[0])>1?t[e]:t}const Nn={};function Cn(t){return Nn[t]}[["or"],["xor"],["and"],["=","+=","-=","*=","**=","/=",".=","%=","&=","|=","^=","<<=",">>="],["??"],["||"],["&&"],["|"],["^"],["&"],["==","===","!=","!==","<>","<=>"],["<",">","<=",">="],[">>","<<"],["+","-","."],["*","/","%"],["!"],["instanceof"],["++","--","~"],["**"]].forEach(((t,e)=>{t.forEach((t=>{Nn[t]=e}))}));const Ln=["==","!=","===","!==","<>","<=>"],bn=["*","/","%"],In=[">>","<<"];function Sn(t){return["block","program","namespace","class","enum","interface","trait","traituse","declare"].includes(t.kind)}function On(t){let{body:e}=t;return e?("block"===e.kind&&(e=e.children),e[0]):null}function vn(t){const e=t.children||t.body||t.adaptations;return Array.isArray(e)?e:null}function Rn(t){const e=t.getParentNode();return e?vn(e):null}function wn(t){return t.length>0?t[t.length-1]:null}function Dn(t){const e=t.getValue();if("program"===e.kind){const t=vn(e);return!(!t||0===t.length)&&"inline"===t[0].kind}if("switch"===e.kind){if(!e.body)return!1;const t=vn(e.body);if(0===t.length)return!1;const[i]=t;if(!i.body)return!1;const s=vn(i.body);return 0!==s.length&&"inline"===s[0].kind}const i=On(e);return!!i&&"inline"===i.kind}const Pn=["__construct","__destruct","__call","__callStatic","__get","__set","__isset","__unset","__sleep","__wakeup","__toString","__invoke","__set_state","__clone","__debugInfo"].reduce(((t,e)=>(t[e.toLowerCase()]=e,t)),{});var Un={printNumber:function(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)/,"")},getPrecedence:Cn,isBitwiseOperator:function(t){return!!In[t]||"|"===t||"^"===t||"&"===t},shouldFlatten:function(t,e){return Cn(e)===Cn(t)&&("**"!==t&&((!Ln.includes(t)||!Ln.includes(e))&&(!("%"===e&&bn.includes(t)||"%"===t&&bn.includes(e))&&((e===t||!bn.includes(e)||!bn.includes(t))&&(!In.includes(t)||!In.includes(e))))))},nodeHasStatement:Sn,getNodeListProperty:vn,getParentNodeListProperty:Rn,getLast:wn,getPenultimate:function(t){return t.length>1?t[t.length-2]:null},isLastStatement:function(t){const e=Rn(t);if(!e)return!0;const i=t.getValue();return e[e.length-1]===i},getBodyFirstChild:On,lineShouldEndWithSemicolon:function(t){const e=t.getValue(),i=t.getParentNode();if(!i)return!1;if(["for","foreach","while","do","if","switch"].includes(i.kind)&&"block"!==e.kind&&"if"!==e.kind&&(i.body===e||i.alternate===e))return!0;if(!Sn(i))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 e=t.getParentNode();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)},fileShouldEndWithHardline:function(t){const e=t.getValue(),i="program"===e.kind,s=e.children&&wn(e.children);if(!i)return!1;if(s&&["halt","inline"].includes(s.kind))return!1;if(s&&("declare"===s.kind||"namespace"===s.kind)){const t=s.children.length>0&&wn(s.children);if(t&&["halt","inline"].includes(t.kind))return!1}return!0},maybeStripLeadingSlashFromUse:function(t){const e=t.replace(/^\\/,"");return-1!==e.indexOf("\\")?e:t},hasDanglingComments:function(t){return t.comments&&t.comments.some((t=>!t.leading&&!t.trailing))},hasLeadingComment:function(t){return t.comments&&t.comments.some((t=>t.leading))},hasTrailingComment:function(t){return t.comments&&t.comments.some((t=>t.trailing))},docShouldHaveTrailingNewline:function t(e){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const s=e.getNode(i),n=e.getNode(i+1),r=e.getNode(i+2);if(!n)return!1;if(r&&["call","new","echo"].includes(r.kind)&&!["call","array"].includes(n.kind)||"parameter"===n.kind){const t=r.arguments.length-1;return r.arguments.indexOf(n)!==t}if(r&&"for"===r.kind){const t=r.init.indexOf(n);if(-1!==t)return t!==r.init.length-1;const e=r.test.indexOf(n);if(-1!==e)return e!==r.test.length-1;const i=r.increment.indexOf(n);if(-1!==i)return i!==r.increment.length-1}if("bin"===n.kind)return n.left===s||t(e,i+1);if("case"===n.kind&&n.test===s)return!0;if("staticvariable"===n.kind){const t=r.variables.length-1;return r.variables.indexOf(n)!==t}if("entry"===n.kind){if(n.key===s)return!0;const t=r.items.length-1;return r.items.indexOf(n)!==t}if(["call","new"].includes(n.kind)){const t=n.arguments.length-1;return n.arguments.indexOf(s)!==t}if("echo"===n.kind){const t=n.expressions.length-1;return n.expressions.indexOf(s)!==t}if("array"===n.kind){const t=n.items.length-1;return n.items.indexOf(s)!==t}return"retif"===n.kind&&t(e,i+1)},isLookupNode:function(t){return"propertylookup"===t.kind||"nullsafepropertylookup"===t.kind||"staticlookup"===t.kind||"offsetlookup"===t.kind},isFirstChildrenInlineNode:Dn,shouldPrintHardLineAfterStartInControlStructure:function(t){const e=t.getValue();return!["try","catch"].includes(e.kind)&&Dn(t)},shouldPrintHardLineBeforeEndInControlStructure:function(t){const e=t.getValue();if(["try","catch"].includes(e.kind))return!0;if("switch"===e.kind){const t=vn(e.body);if(0===t.length)return!0;const i=wn(t);if(!i.body)return!0;const s=vn(i.body);return 0===s.length||"inline"!==s[0].kind}return!Dn(t)},getAlignment:function(t){const e=t.split("\n").pop();return e.length-e.trimLeft().length+1},isProgramLikeNode:function(t){return["program","declare","namespace"].includes(t.kind)},isReferenceLikeNode:function(t){return["name","parentreference","selfreference","staticreference"].includes(t.kind)},getNodeKindIncludingLogical:function(t){return"bin"===t.kind&&["||","&&"].includes(t.type)?"logical":t.kind},useDoubleQuote: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},hasEmptyBody:function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"body";const i=t.getValue();return i[e]&&i[e].children&&0===i[e].children.length&&(!i[e].comments||0===i[e].comments.length)},isNextLineEmptyAfterNamespace:function(t,e,i){let s=i(e);return s=Tn(t,s),s=mn(t,s),kn(t,s)},shouldPrintHardlineBeforeTrailingComma:function(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)},isDocNode:function(t){return"nowdoc"===t.kind||"encapsed"===t.kind&&"heredoc"===t.type},getAncestorNode:function(t,e){const i=function(t,e){const i=[].concat(e);let s,n=-1;for(;s=t.getParentNode(++n);)if(-1!==i.indexOf(s.kind))return n;return-1}(t,e);return-1===i?null:t.getParentNode(i)},getNextNode:function(t,e){const i=t.getParentNode(),s=vn(i);if(!s)return null;const n=s.indexOf(e);return-1===n?null:i.children[n+1]},normalizeMagicMethodName:function(t){const e=t.toLowerCase();return Pn[e]?Pn[e]:t},isPreviousLineEmpty:function(t,e,i){return En(t,e,gn(i,"locStart"))},isNextLineEmpty:function(t,e,i){return xn(t,e,gn(i,"locEnd"))},getNextNonSpaceNonCommentCharacterIndex:function(t,e,i){return yn(t,e,gn(i,"locEnd"))}};const{addLeadingComment:Mn,addDanglingComment:Bn,addTrailingComment:Fn,skipNewline:Hn,hasNewline:Gn,hasNewlineInRange:Vn}=s.default.util,{join:Qn,indent:Wn,hardline:Yn,cursor:$n,lineSuffix:jn,breakParent:zn}=s.default.doc.builders,{getNextNonSpaceNonCommentCharacterIndex:Kn,isNextLineEmpty:Xn,isPreviousLineEmpty:qn,isLookupNode:Jn}=Un;function Zn(t,e){const{children:i}=t;0===i.length?Bn(t,e):Mn(i[0],e)}function tr(t,e){"block"===t.kind?Zn(t,e):Mn(t,e)}function er(t,e,i,s,n,r){const o=Kn(t,n,r),h=t.charAt(o);return e&&"identifier"===e.kind&&i&&("function"===i.kind||"method"===i.kind)&&")"===h?(Fn(i,n),!0):!(!i||"function"!==i.kind&&"method"!==i.kind||!s||"block"!==s.kind)&&(Zn(s,n),!0)}function ir(t,e,i,s,n,r){if(!i||"if"!==i.kind||!s)return!1;const o=Kn(t,n,r);return")"===t.charAt(o)?(Fn(e,n),!0):e===i.body&&s===i.alternate?(Bn(i,n),!0):"if"===s.kind?(tr(s.body,n),!0):i.body===s&&(Mn(s,n),!0)}function sr(t,e,i){if(t&&["class","interface","trait"].includes(t.kind)){if(e&&t.extends)if(Array.isArray(t.extends)){if(t.extends.some((t=>{if(e&&e===t)return Bn(e,i),!0})))return!0}else if(e===t.extends)return Bn(e,i),!0;if(e&&t.implements&&t.implements.some((t=>{if(e&&e===t)return Bn(e,i),!0})))return!0;if(!(t.body&&t.body.length>0))return Bn(t,i),!0}return!!(e&&"class"===e.kind&&e.isAnonymous&&e.leadingComments&&"commentblock"===i.kind)}function nr(t,e,i,s,n){if(e&&("function"===e.kind||"method"===e.kind)){let i=0;for(let t=0;t<e.arguments.length;t++)i=n.locEnd(e.arguments[t])>i?n.locEnd(e.arguments[t]):i;const r=e.body&&n.locStart(s)>i&&n.locEnd(s)<n.locStart(e.body),o=Kn(t,s,n);if(e.type&&r&&")"!==t.charAt(o))return n.locEnd(s)<n.locStart(e.type)?(Bn(e.type,s),!0):(Fn(e.type,s),!0)}return!1}function rr(t,e,i,s,n){return!(!i||!["function","method","parameter"].includes(i.kind))&&("typereference"===e.kind&&"identifier"===s.kind&&(Fn(e,n),!0))}function or(t,e){return!(!t||!["label","goto"].includes(t.kind))&&(Fn(t,e),!0)}function hr(t,e,i,s){return i&&"inline"===i.kind?(i.leadingComments||(i.leadingComments=[]),i.leadingComments.includes(s)||i.leadingComments.push(s),!0):!(t||i||!e||"inline"!==e.kind)&&(Bn(e,s),!0)}function ar(t,e,i){return!(!t||"try"!==t.kind||!e)&&("block"===e.kind?(Zn(e,i),!0):"try"===e.kind?(tr(e.always,i),!0):"catch"===e.kind&&(tr(e.body,i),!0))}function cr(t,e,i,s){return i||e||!t||"namespace"!==t.kind||t.withBrackets?!(e||!t||"namespace"!==t.kind||t.withBrackets)&&(Bn(t,s),!0):(Fn(t,s),!0)}function lr(t,e,i,s){return!(!t||"declare"!==t.kind)&&((!e||"noop"!==e.kind)&&(i&&t.directives[0]!==i?!(!i||!e)&&(Mn(i,s),!0):("none"===t.mode?Fn(t,s):Bn(t,s),!0)))}function _r(t,e,i,s,n,r){if(!i||"while"!==i.kind||!s)return!1;const o=Kn(t,n,r);return")"===t.charAt(o)?(Fn(e,n),!0):"block"===s.kind&&(Zn(s,n),!0)}function ur(t,e){return t.getValue().printed=!0,e.printer.printComment(t,e)}function dr(t,e,i){return t.getNode()===e.cursorNode&&t.getValue()?[$n,i,$n]:i}var pr={handleOwnLineComment:function(t,e,i){const{precedingNode:s,enclosingNode:n,followingNode:r}=t;return er(e,s,n,r,t,i)||function(t,e,i){if(t&&Jn(t)&&e&&["identifier","variable","encapsed"].includes(e.kind))return Mn(t,i),!0;return!1}(n,r,t)||ir(e,s,n,r,t,i)||_r(e,s,n,r,t,i)||ar(n,r,t)||sr(n,r,t)||rr(e,s,n,r,t)||nr(e,n,r,t,i)||function(t,e,i,s){if(!i&&t&&("for"===t.kind||"foreach"===t.kind))return t.body&&"block"!==t.body.kind?Mn(i,s):Mn(t,s),!0;return!1}(n,0,r,t)||hr(n,s,r,t)||lr(n,s,r,t)},handleEndOfLineComment:function(t,e,i){const{precedingNode:s,enclosingNode:n,followingNode:r}=t;return function(t,e,i,s,n){if(!e&&!s&&i&&"array"===i.kind)return Fn(i,n),!0;return!1}(0,s,n,r,t)||function(t,e,i,s,n){if(i&&"return"===i.kind&&!i.expr)return Fn(i,n),!0;return!1}(0,0,n,0,t)||er(e,s,n,r,t,i)||function(t,e,i,s,n,r){const o=e&&!Vn(n,r.locEnd(e),r.locStart(s));if((!e||!o)&&t&&"retif"===t.kind&&i)return Mn(i,s),!0;return!1}(n,s,r,t,e,i)||ir(e,s,n,r,t,i)||_r(e,s,n,r,t,i)||ar(n,r,t)||sr(n,r,t)||rr(e,s,n,r,t)||nr(e,n,r,t,i)||function(t,e){if(t&&"entry"===t.kind)return Mn(t,e),!0;return!1}(n,t)||function(t,e,i){if(e&&"call"===e.kind&&t&&e.what===t&&e.arguments.length>0)return Mn(e.arguments[0],i),!0;return!1}(s,n,t)||function(t,e,i){if(t&&"assign"===t.kind&&e){const s=t.loc.start.offset+t.loc.source.indexOf("=");if(i.loc.start.offset>s)return Mn(e,i),!0}return!1}(n,r,t)||hr(n,s,r,t)||cr(n,s,r,t)||lr(n,s,r,t)||or(n,t)},handleRemainingComment:function(t,e,i){const{precedingNode:s,enclosingNode:n,followingNode:r}=t;return ir(e,s,n,r,t,i)||_r(e,s,n,r,t,i)||function(t,e,i,s){const n=Kn(t,i,s);if(")"!==t.charAt(n))return!1;if(e&&("function"===e.kind||"closure"===e.kind||"method"===e.kind||"call"===e.kind||"new"===e.kind)&&0===e.arguments.length)return Bn(e,i),!0;return!1}(e,n,t,i)||sr(n,r,t)||function(t,e,i){if(t&&"traituse"===t.kind&&t.adaptations&&!t.adaptations.length)return Bn(t,i),!0;return!1}(n,0,t)||rr(e,s,n,r,t)||nr(e,n,r,t,i)||or(n,t)||function(t,e,i,s){if(e&&"halt"===e.kind)return Bn(e,s),!0;if(t&&"halt"===t.kind)return Bn(t,s),!0;return!1}(s,n,0,t)||function(t,e){if(t&&("continue"===t.kind||"break"===t.kind)&&!t.label)return Fn(t,e),!0;return!1}(n,t)||hr(n,s,r,t)||cr(n,s,r,t)},getCommentChildNodes:function(t){return"object"!=typeof t?[]:(t=>Object.keys(t).filter((t=>"kind"!==t&&"loc"!==t&&"errors"!==t&&"extra"!==t&&"comments"!==t&&"leadingComments"!==t&&"enclosingNode"!==t&&"precedingNode"!==t&&"followingNode"!==t)).map((e=>t[e])))(t)},canAttachComment:function(t){return t.kind&&"commentblock"!==t.kind&&"commentline"!==t.kind},isBlockComment:function(t){return"commentblock"===t.kind},printDanglingComments:function(t,e,i,s){const n=[],r=t.getValue();return r&&r.comments?(t.each((t=>{const i=t.getValue();!i||i.leading||i.trailing||s&&!s(i)||n.push(ur(t,e))}),"comments"),0===n.length?"":i?Qn(Yn,n):Wn([Yn,Qn(Yn,n)])):""},hasLeadingComment:function(t){return t.comments&&t.comments.some((t=>t.leading))},hasTrailingComment:function(t){return t.comments&&t.comments.some((t=>t.trailing))},hasLeadingOwnLineComment:function(t,e,i){return e.comments&&e.comments.some((e=>e.leading&&Gn(t,i.locEnd(e))))},printComments:function(t,e){const i=[];return t.forEach(((t,s,n)=>{t.printed=!0;const r=n.length===s+1;i.push(t.value),r||i.push(Yn),Xn(e.originalText,t,e)&&!r&&i.push(Yn)})),i},printAllComments:function(t,e,i,s){const n=t.getValue(),r=e(t),o=n&&n.comments;if(!o||0===o.length)return dr(t,i,r);const h=[],a=[s?";":"",r];return t.each((t=>{const e=t.getValue(),{leading:s,trailing:n}=e;if(s){const s=function(t,e,i){const s=t.getValue(),n=ur(t,i);return n?i.printer.isBlockComment&&i.printer.isBlockComment(s)?[n,Gn(i.originalText,i.locEnd(s))?Yn:" "]:[n,Yn]:""}(t,0,i);if(!s)return;h.push(s);const n=i.originalText;Gn(n,Hn(n,i.locEnd(e)))&&h.push(Yn)}else n&&a.push(function(t,e,i){const s=t.getValue(),n=ur(t,i);if(!n)return"";const r=i.printer.isBlockComment&&i.printer.isBlockComment(s);if(Gn(i.originalText,i.locStart(s),{backwards:!0})){const t=qn(i.originalText,s,i);return jn([Yn,t?Yn:"",n])}return r?[" ",n]:[jn([" ",n]),r?"":zn]}(t,0,i))}),"comments"),dr(t,i,h.concat(a))}};function fr(){}fr.strictEqual=function(){};var kr=fr;const{getPrecedence:Tr,shouldFlatten:mr,isBitwiseOperator:xr}=Un;var Er=function(t){const e=t.getParentNode();if(!e)return!1;const i=t.getName(),s=t.getNode();if(["program","expressionstatement","namespace","declare","block","include","print","return","echo"].includes(e.kind))return!1;switch(s.kind){case"pre":case"post":if("unary"===e.kind)return"pre"===s.kind&&("+"===s.type&&"+"===e.type||"-"===s.type&&"-"===e.type);case"unary":switch(e.kind){case"unary":return s.type===e.type&&("+"===s.type||"-"===s.type);case"propertylookup":case"nullsafepropertylookup":case"staticlookup":case"offsetlookup":case"call":return"what"===i&&e.what===s;case"bin":return"**"===e.type&&"left"===i;default:return!1}case"bin":switch(e.kind){case"assign":case"retif":return["and","xor","or"].includes(s.type);case"silent":case"cast":return s.parenthesizedExpression;case"pre":case"post":case"unary":return!0;case"call":case"propertylookup":case"nullsafepropertylookup":case"staticlookup":case"offsetlookup":return"what"===i&&e.what===s;case"bin":{const t=e.type,n=Tr(t),r=s.type,o=Tr(r);return n>o||("||"===t&&"&&"===r||(n===o&&"right"===i?(kr.strictEqual(e.right,s),!0):n===o&&!mr(t,r)||(n<o&&"%"===r?"+"===t||"-"===t:!!xr(t))))}default:return!1}case"propertylookup":case"nullsafepropertylookup":case"staticlookup":return"call"===e.kind&&("what"===i&&e.what===s&&s.parenthesizedExpression);case"clone":case"new":switch(e.kind){case"propertylookup":case"nullsafepropertylookup":case"staticlookup":case"offsetlookup":case"call":return"what"===i&&e.what===s;default:return!1}case"yield":switch(e.kind){case"propertylookup":case"nullsafepropertylookup":case"staticlookup":case"offsetlookup":case"call":return"what"===i&&e.what===s;case"retif":return e.test===s;default:return!(!s.key&&!s.value)}case"assign":return("for"!==e.kind||!e.init.includes(s)&&!e.increment.includes(s))&&("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"===i&&!e.trueExpr);case"propertylookup":case"nullsafepropertylookup":case"staticlookup":case"offsetlookup":case"call":return"what"===i&&e.what===s;default:return!1}case"closure":switch(e.kind){case"call":return"what"===i&&e.what===s;case"propertylookup":case"nullsafepropertylookup":return!0;default:return!1}case"silence":case"cast":return s.parenthesizedExpression;case"string":case"array":switch(e.kind){case"propertylookup":case"nullsafepropertylookup":case"staticlookup":case"offsetlookup":case"call":return(!["string","array"].includes(s.kind)||"offsetlookup"!==e.kind)&&("what"===i&&e.what===s);default:return!1}case"print":case"include":return"bin"===e.kind}return!1};const{breakParent:yr,join:Ar,line:gr,lineSuffix:Nr,group:Cr,conditionalGroup:Lr,indent:br,dedent:Ir,ifBreak:Sr,hardline:Or,softline:vr,literalline:Rr,align:wr,dedentToRoot:Dr}=s.default.doc.builders,{willBreak:Pr}=s.default.doc.utils,{isNextLineEmptyAfterIndex:Ur,hasNewline:Mr,hasNewlineInRange:Br}=s.default.util,{getLast:Fr,getPenultimate:Hr,isLastStatement:Gr,lineShouldEndWithSemicolon:Vr,printNumber:Qr,shouldFlatten:Wr,maybeStripLeadingSlashFromUse:Yr,fileShouldEndWithHardline:$r,hasDanglingComments:jr,hasLeadingComment:zr,hasTrailingComment:Kr,docShouldHaveTrailingNewline:Xr,isLookupNode:qr,isFirstChildrenInlineNode:Jr,shouldPrintHardLineAfterStartInControlStructure:Zr,shouldPrintHardLineBeforeEndInControlStructure:to,getAlignment:eo,isProgramLikeNode:io,getNodeKindIncludingLogical:so,useDoubleQuote:no,hasEmptyBody:ro,isNextLineEmptyAfterNamespace:oo,shouldPrintHardlineBeforeTrailingComma:ho,isDocNode:ao,getAncestorNode:co,isReferenceLikeNode:lo,getNextNode:_o,normalizeMagicMethodName:uo,getNextNonSpaceNonCommentCharacterIndex:po,isNextLineEmpty:fo}=Un;function ko(t,e){return parseFloat(t)>=parseFloat(e)}function To(t,e){return!!t.trailingCommaPHP&&ko(t.phpVersion,e)}function mo(t){return"1tbs"!==t.braceStyle}function xo(t,e,i){let s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return[s?"?":"","->",t.call(i,"offset")]}function Eo(t,e,i){return xo(t,e,i,!0)}function yo(t,e,i){const s=t.getValue(),n=!["variable","identifier"].includes(s.offset.kind);return["::",n?"{":"",t.call(i,"offset"),n?"}":""]}function Ao(t,e,i){const s=t.getValue(),n=s.offset&&"number"===s.offset.kind||co(t,"encapsed");return["[",s.offset?Cr([br([n?"":vr,t.call(i,"offset")]),n?"":vr]):"","]"]}function go(t){return"array"===t.kind&&(t.items.length>0||t.comments)||"function"===t.kind||"method"===t.kind||"closure"===t.kind}function No(t){const e=Fr(t),i=Hr(t);return!zr(e)&&!Kr(e)&&go(e)&&(!i||i.kind!==e.kind)}function Co(t){if(2!==t.length)return!1;const[e,i]=t;return!(e.comments&&e.comments.length||"function"!==e.kind&&"method"!==e.kind&&"closure"!==e.kind||"retif"===i.kind||go(i))}function Lo(t,e,i){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"arguments";const n=t.getValue()[s];if(0===n.length)return["(",pr.printDanglingComments(t,e,!0),")"];let r=!1,o=!1;const h=n.length-1,a=t.map(((t,s)=>{const n=t.getNode(),a=[i(t)];return s===h||(fo(e.originalText,n,e)?(0===s&&(o=!0),r=!0,a.push(",",Or,Or)):a.push(",",gr)),a}),s),c=t.getValue(),l=Fr(n),_=To(e,"7.3")&&["call","new","unset","isset"].includes(c.kind)||To(e,"8.0")&&["function","closure","method","arrowfunc","attribute"].includes(c.kind)?br([l&&ho(l)?Or:"",","]):"";function u(){return Cr(["(",br([gr,...a]),_,gr,")"],{shouldBreak:!0})}const d=Co(n),p=No(n);if(d||p){const e=(d?a.slice(1).some(Pr):a.slice(0,-1).some(Pr))||r;let h,c=0;t.each((t=>{d&&0===c&&(h=[t.call((t=>i(t,{expandFirstArg:!0}))),a.length>1?",":"",o?Or:gr,o?Or:"",a.slice(1)]),p&&c===n.length-1&&(h=[...a.slice(0,-1),t.call((t=>i(t,{expandLastArg:!0})))]),c++}),s);const l=a.some(Pr),f=["(",...h,")"];return[l?yr:"",Lr([l?Sr(u(),f):f,d?["(",Cr(h[0],{shouldBreak:!0}),...h.slice(1),")"]:["(",...a.slice(0,-1),Cr(Fr(h),{shouldBreak:!0}),")"],Cr(["(",br([gr,...a]),Sr(_),gr,")"],{shouldBreak:!0})],{shouldBreak:e})]}return Cr(["(",br([vr,...a]),Sr(_),vr,")"],{shouldBreak:a.some(Pr)||r})}function bo(t){return"array"===t.kind&&0!==t.items.length}function Io(t){return"array"===t.right.kind&&0!==t.right.items.length}function So(t,e,i,s,n){let r=[];const o=t.getValue();if("bin"===o.kind){Wr(o.type,o.left.type)?r=r.concat(t.call((t=>So(t,e,i,!0,n)),"left")):r.push(t.call(e,"left"));const h=Io(o)?[o.type," ",t.call(e,"right")]:[o.type,gr,t.call(e,"right")],a=t.getParentNode(),c=!(n&&["||","&&"].includes(o.type))&&so(a)!==so(o)&&so(o.left)!==so(o)&&so(o.right)!==so(o),l=ao(o.left)||"bin"===o.left.kind&&ao(o.left.right);r.push(l?"":" ",c?Cr(h):h),s&&o.comments&&(r=pr.printAllComments(t,(()=>r),i))}else r.push(t.call(e));return r}function Oo(t,e,i){const s=t.getValue();switch(s.kind){case"propertylookup":return xo(t,e,i);case"nullsafepropertylookup":return Eo(t,e,i);case"staticlookup":return yo(t,0,i);case"offsetlookup":return Ao(t,0,i);default:return"Have not implemented lookup kind ".concat(s.kind," yet.")}}function vo(t){let{opening:e=!0}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("heredoc"===t.type)return e?"<<<".concat(t.label):t.label;const i={string:'"',shell:"`"};return i[t.type]?i[t.type]:"Unimplemented encapsed type ".concat(t.type)}function Ro(t,e,i){const s=[];let n=[];return t.each((t=>{s.push(n),s.push(Cr(i(t))),n=[",",gr],t.getValue()&&fo(e.originalText,t.getValue(),e)&&n.push(vr)}),"items"),s}function wo(t,e){if(0===e.length)return t;let i=0;return e.reduce(((e,s)=>{const{start:n,end:r,alignment:o,before:h,after:a}=s,c=[h||"",...t.slice(n,r),a||""],l=e.concat(t.slice(i,n),o?Dr(Cr(wr(new Array(o).join(" "),c))):Cr(c),r===t.length-1?t.slice(r):"");return i=r,l}),[])}function Do(t,e,i){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"children";const n=t.getValue(),r=t.getParentNode();let o=-1;const h=[],a=[];t.map(((c,l)=>{const _=c.getValue(),u="inline"===_.kind,d=i(c),p=n[s],f=p[l+1],k=!Gr(c)&&!u&&(f&&"case"===f.kind?!Jr(t):f&&"inline"!==f.kind);let T=[d,k?Or:"",k&&fo(e.originalText,_,e)?Or:""];const m=0===l,x=p.length-1===l,E="block"===n.kind&&r&&["function","closure","method","try","catch"].includes(r.kind);let y=E&&m?"":" ";if(u||!u&&x&&o>=0){const t=o;u&&(o=l);if(u&&!m||!u&&x){const e=(u?t:o)+1,i=x&&!u?l+1:l,s=p[u?t:o],r=s?eo(s.raw):"",h=i-e>1,c=h?E&&!s||io(n)&&0===e?"":Or:"",d=h&&"halt"!==_.kind?E&&x?"":Or:"";h&&(y=""),a.push({start:e,end:i,alignment:r,before:c,after:d})}}if(u){const i=f&&"echo"===f.kind&&f.shortForm?"<?=":"<?php",s=_.leadingComments&&_.leadingComments.length?[m&&"namespace"!==n.kind&&!E?"<?php":"","namespace"!==n.kind&&E?"":Or,pr.printComments(_.leadingComments,e),Or,"?>"]:io(n)&&m&&"namespace"!==n.kind?"":[y,"?>"],r=t.getNode(l+1),o=r&&r.children&&r.children.length;T=[s,T,_.comments&&_.comments.length?[i,Or,o?pr.printComments(_.comments,e):"",Or]:io(n)&&x?"":[i," "]]}h.push(T)}),s);const c=wo(h,a);if("program"===n.kind&&!n.extra.parseAsEval){const t=[],[i]=n.children;if(!i||"inline"!==i.kind){const s=e.originalText.trim().match(/^<\?(php|=)(\s+)?\S/),r=[s&&s[2]&&s[2].includes("\n")?[Or,s[2].split("\n").length>2?Or:""]:" ",n.comments?pr.printComments(n.comments,e):""],o=i&&"echo"===i.kind&&i.shortForm;t.push([o?"<?=":"<?php",r])}t.push(c);if(/\?>\n?$/.test(e.originalText)){const i=Fr(n.children),s=i?[Br(e.originalText.trimEnd(),e.locEnd(i),e.locEnd(n))?"inline"===i.kind&&i.comments&&i.comments.length?"":Or:" ",fo(e.originalText,i,e)?Or:""]:n.comments?Or:"";t.push(Nr([s,"?>"]))}return t}return c}function Po(t,e,i,s){return t.map((t=>{const s=[];return s.push(i(t)),Gr(t)||(s.push(Or),fo(e.originalText,t.getValue(),e)&&s.push(Or)),s}),s)}function Uo(t,e,i){let s=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.getValue(),h=jr(o[s])?[Or,t.call((t=>pr.printDanglingComments(t,e,!0)),s),Or]:n,a=Array.isArray(o[s])?Cr(Ar(",",t.map((t=>{const s=i(t);return jr(t.getValue())?[Or,pr.printDanglingComments(t,e,!0),Or,s]:[r,s]}),s))):[r,t.call(i,s)];return br([h,s,Pr(h)?br(a):a])}function Mo(t,e,i){let{inline:s=!1}=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const n=[];return t.getValue().attrGroups?(t.each((t=>{const r=["#["];!s&&n.length>0&&n.push(Or),r.push(vr),t.each((t=>{const s=t.getValue();r.length>2&&r.push(",",gr);const n=[s.name];s.args.length>0&&n.push(Lo(t,e,i,"args")),r.push(Cr(n))}),"attrs"),n.push(Cr([br(r),Sr(To(e,"8.0")?",":""),vr,"]",s?Sr(vr," "):""]))}),"attrGroups"),0===n.length?[]:[...n,s?"":Or]):[]}function Bo(t,e,i){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"body";const n=t.getValue();if(!n[s])return";";const r=t.call(i,s);return[n.shortForm?":":" {",br("block"!==n[s].kind||n[s].children&&n[s].children.length>0||n[s].comments&&n[s].comments.length>0?[Zr(t)?"switch"===n.kind?" ":"":Or,r]:""),"if"===n.kind&&"body"===s?"":[to(t)?Or:"",n.shortForm?["end",n.kind,";"]:"}"]]}function Fo(t,e,i,s,n,r,o){if(!s)return e;const h=Go(t,s,n,r,o);return Cr([e,i,h])}function Ho(t){return!!qr(t)&&(!("variable"!==t.what.kind&&!lo(t.what))||Ho(t.what))}function Go(t,e,i,s,n){const r=s?"&":"";if(pr.hasLeadingOwnLineComment(n.originalText,e,n))return br([Or,r,i]);const o="cast"===e.kind?e.expr:e;return"bin"===o.kind&&!Io(o)||"retif"===o.kind&&(!o.trueExpr&&!bo(o.falseExpr)||"bin"===o.test.kind&&!Io(o.test))||("variable"===t.kind||"string"===t.kind||qr(t))&&("string"===o.kind&&!Vo(o)||Ho(o))?Cr(br([gr,r,i])):[" ",r,i]}function Vo(t){return t.raw.includes("\n")}function Qo(t,e,i){return("string"===t.kind||"encapsed"===t.kind&&("string"===t.type||"shell"===t.type))&&Vo(t)&&!Mr(e,i.locStart(t),{backwards:!0})}function Wo(t,e,i){return Cr(t.map(((s,n)=>0===n?[t.call(e)]:[i,t.call(e)]),"types"))}var Yo=function(t,e,i){const s=t.getValue();if(!s)return"";if("string"==typeof s)return s;const n=function(t,e,i){const s=t.getValue();switch(s.kind){case"program":return Cr([Do(t,e,i),pr.printDanglingComments(t,e,!0,(t=>!t.printed))]);case"expressionstatement":return t.call(i,"expression");case"block":return[Do(t,e,i),pr.printDanglingComments(t,e,!0)];case"declare":{const n=t=>Ar(", ",t.map((t=>i(t)),"directives"));if(["block","short"].includes(s.mode))return["declare(",n(t),")","block"===s.mode?" {":":",s.children.length>0?br([Or,Do(t,e,i)]):"",pr.printDanglingComments(t,e),Or,"block"===s.mode?"}":"enddeclare;"];const r=_o(t,s);return["declare(",n(t),")",r&&"inline"===r.kind?"":";"]}case"declaredirective":return[t.call(i,"key"),"=",t.call(i,"value")];case"namespace":return["namespace ",s.name&&"string"==typeof s.name?[s.name,s.withBrackets?" ":""]:"",s.withBrackets?"{":";",jr(s)?[" ",pr.printDanglingComments(t,e,!0)]:"",s.children.length>0?s.withBrackets?br([Or,Do(t,e,i)]):["inline"===s.children[0].kind?"":[Or,oo(e.originalText,s,e.locStart)?Or:""],Do(t,e,i)]:"",s.withBrackets?[Or,"}"]:""];case"usegroup":return Cr(["use ",s.type?[s.type," "]:"",br([s.name?[Yr(s.name),"\\{",vr]:"",Ar([",",gr],t.map((t=>i(t)),"items"))]),s.name?[Sr(To(e,"7.2")?",":""),vr,"}"]:""]);case"useitem":return[s.type?[s.type," "]:"",Yr(s.name),jr(s)?[" ",pr.printDanglingComments(t,e,!0)]:"",s.alias?[" as ",t.call(i,"alias")]:""];case"class":case"enum":case"interface":case"trait":return function(t,e,i){const s=t.getValue(),n="class"===s.kind&&s.isAnonymous,r=Mo(t,e,i,{inline:n}),o=n?[]:[...r];s.isReadonly&&o.push("readonly ");s.isFinal&&o.push("final ");s.isAbstract&&o.push("abstract ");o.push(n?"":s.kind),s.name&&o.push(" ",t.call(i,"name"));"enum"===s.kind&&s.valueType&&o.push(": ",t.call(i,"valueType"));s.extends&&s.implements?o.push(Lr([[Uo(t,e,i,"extends"),Uo(t,e,i,"implements")],[Uo(t,e,i,"extends"),Uo(t,e,i,"implements"," ",Or)],[Uo(t,e,i,"extends",Or," "),Uo(t,e,i,"implements",Or,s.implements.length>1?Or:" ")]],{shouldBreak:jr(s.extends)})):(s.extends&&o.push(Lr([Uo(t,e,i,"extends"),Uo(t,e,i,"extends"," ",Or),Uo(t,e,i,"extends",Or,s.extends.length>1?Or:" ")])),s.implements&&o.push(Lr([Uo(t,e,i,"implements"),Uo(t,e,i,"implements"," ",Or),Uo(t,e,i,"implements",Or,s.implements.length>1?Or:" ")])));const h=Cr([Cr(o),mo(e)?n?gr:Or:" "]),a=s.body&&0===s.body.length&&!jr(s),c=["{",br([a?"":Or,Po(t,e,i,"body")]),pr.printDanglingComments(t,e,!0),n&&a?vr:Or,"}"];return[h,c]}(t,e,i);case"traitprecedence":return[t.call(i,"trait"),"::",t.call(i,"method")," insteadof ",Ar(", ",t.map(i,"instead"))];case"traitalias":return[s.trait?[t.call(i,"trait"),"::"]:"",s.method?t.call(i,"method"):""," as ",Ar(" ",[...s.visibility?[s.visibility]:[],...s.as?[t.call(i,"as")]:[]])];case"traituse":return Cr(["use ",br(Cr(Ar([",",gr],t.map(i,"traits")))),s.adaptations?[" {",s.adaptations.length>0?[br([Or,Po(t,e,i,"adaptations")]),Or]:jr(s)?[gr,pr.printDanglingComments(t,e,!0),gr]:"","}"]:""]);case"function":case"closure":case"method":return function(t,e,i){const s=t.getValue(),n=Mo(t,e,i,{inline:"closure"===s.kind}),r=[];s.isFinal&&r.push("final ");s.isAbstract&&r.push("abstract ");s.visibility&&r.push(s.visibility," ");s.isStatic&&r.push("static ");r.push("function "),s.byref&&r.push("&");s.name&&r.push(t.call(i,"name"));r.push(Lo(t,e,i)),s.uses&&s.uses.length>0&&r.push(Cr([" use ",Lo(t,e,i,"uses")]));s.type&&r.push([": ",jr(s.type)?[t.call((t=>pr.printDanglingComments(t,e,!0)),"type")," "]:"",s.nullable?"?":"",t.call(i,"type")]);const o=r;if(!s.body)return[...n,o];const h="closure"===s.kind,a=["{",br([ro(t)?"":Or,t.call(i,"body")]),h&&ro(t)?"":Or,"}"];if(h)return[...n,o," ",a];if(0===s.arguments.length)return[...n,o,mo(e)?Or:" ",a];if(r.some(Pr))return[o," ",a];return[...n,Lr([[o,mo(e)?Or:" ",a],[o," ",a]])]}(t,e,i);case"arrowfunc":return[s.parenthesizedExpression?"(":"",...Mo(t,e,i,{inline:!0}),s.isStatic?"static ":"","fn",Lo(t,e,i),s.type?[": ",s.nullable?"?":"",t.call(i,"type")]:""," => ",t.call(i,"body"),s.parenthesizedExpression?")":""];case"parameter":{let n="";1===s.flags?n="public ":2===s.flags?n="protected ":4===s.flags&&(n="private ");const r=[...Mo(t,e,i,{inline:!0}),n,s.readonly?"readonly ":"",s.nullable?"?":"",s.type?[t.call(i,"type")," "]:"",s.byref?"&":"",s.variadic?"...":"","$",t.call(i,"name")];return s.value?Cr([r,jr(s)?" ":"",pr.printDanglingComments(t,e,!0)," =",Go(s.name,s.value,t.call(i,"value"),!1,e)]):r}case"variadic":return["...",t.call(i,"what")];case"property":return Cr([s.readonly?"readonly ":"",s.type?[s.nullable?"?":"",t.call(i,"type")," "]:"","$",t.call(i,"name"),s.value?[" =",Go(s.name,s.value,t.call(i,"value"),!1,e)]:""]);case"propertystatement":{const n=[];t.map((t=>n.push(...Mo(t,e,i))),"properties");const r=t.map((t=>i(t)),"properties"),o=s.properties.some((t=>t.value));let h;1!==r.length||s.properties[0].comments?r.length>0&&(h=br(r[0])):[h]=r;const a=s.visibility||null===s.visibility;return Cr([...n,a?[null===s.visibility?"var":s.visibility,""]:"",s.isStatic?[a?" ":"","static"]:"",h?[" ",h]:"",br(r.slice(1).map((t=>[",",o?Or:gr,t])))])}case"if":{const n=[],r=Bo(t,e,i,"body"),o=Cr(["if (",Cr([br([vr,t.call(i,"test")]),vr]),")",r]);if(n.push(o,Jr(t)||!s.body?"":Or),s.alternate){n.push(s.shortForm?"":"} ");const r=Kr(s.body)&&s.body.comments.some((t=>t.trailing&&!pr.isBlockComment(t)))||function(t){if(!t.comments)return!1;const e=Fr(t.comments.filter((t=>!t.leading&&!t.trailing)));return e&&!pr.isBlockComment(e)}(s),o=!r;n.push(o?"":Or),jr(s)&&n.push(fo(e.originalText,s.body,e)?Or:"",pr.printDanglingComments(t,e,!0),r?Or:" "),n.push("else",Cr("if"===s.alternate.kind?t.call(i,"alternate"):Bo(t,e,i,"alternate")))}else n.push(s.body?s.shortForm?"endif;":"}":"");return n}case"do":return["do",Bo(t,e,i,"body")," while (",Cr([br([vr,t.call(i,"test")]),vr]),")"];case"while":case"switch":return Cr([s.kind," (",Cr([br([vr,t.call(i,"test")]),vr]),")",Bo(t,e,i,"body")]);case"for":{const n=Bo(t,e,i,"body"),r=pr.printDanglingComments(t,e,!0),o=r?[r,vr]:"";return s.init.length||s.test.length||s.increment.length?[o,Cr(["for (",Cr([br([vr,Cr(Ar([",",gr],t.map(i,"init"))),";",gr,Cr(Ar([",",gr],t.map(i,"test"))),";",gr,Cr(Ar([",",gr],t.map(i,"increment")))]),vr]),")",n])]:[o,Cr(["for (;;)",n])]}case"foreach":{const n=Bo(t,e,i,"body"),r=pr.printDanglingComments(t,e,!0);return[r?[r,vr]:"",Cr(["foreach (",Cr([br([vr,t.call(i,"source"),gr,"as ",Cr(s.key?br(Ar([" =>",gr],[t.call(i,"key"),t.call(i,"value")])):t.call(i,"value"))]),vr]),")",n])]}case"try":{const n=[];return n.push("try",Bo(t,e,i,"body")),s.catches&&n.push(t.map(i,"catches")),s.always&&n.push(" finally",Bo(t,e,i,"always")),n}case"catch":return[" catch",s.what?[" (",Ar(" | ",t.map(i,"what")),s.variable?[" ",t.call(i,"variable")]:"",")"]:"",Bo(t,e,i,"body")];case"case":return[s.test?["case ",s.test.comments?br(t.call(i,"test")):t.call(i,"test"),":"]:"default:",s.body&&s.body.children&&s.body.children.length?br([Jr(t)?"":Or,t.call(i,"body")]):""];case"break":case"continue":return s.level&&("number"===s.level.kind&&"1"!==s.level.value)?["".concat(s.kind," "),t.call(i,"level")]:s.kind;case"call":return 1===s.arguments.length&&Qo(s.arguments[0],e.originalText,e)?[t.call(i,"what"),"(",Ar(", ",t.map(i,"arguments")),")"]:qr(s.what)?function(t,e,i){const s=[];function n(t){const{originalText:i}=e,s=po(i,t,e);return")"===i.charAt(s)?Ur(i,s+1,e):fo(i,t,e)}function r(t){const o=t.getValue();if("call"!==o.kind||!qr(o.what)&&"call"!==o.what.kind)if(qr(o)){let n=null;n="propertylookup"===o.kind?xo(t,e,i):"nullsafepropertylookup"===o.kind?Eo(t,e,i):"staticlookup"===o.kind?yo(t,e,i):Ao(t,e,i),s.unshift({node:o,needsParens:Er(t),printed:pr.printAllComments(t,(()=>n),e)}),t.call((t=>r(t)),"what")}else s.unshift({node:o,printed:t.call(i)});else s.unshift({node:o,printed:[pr.printAllComments(t,(()=>Lo(t,e,i)),e),n(o)?Or:""]}),t.call((t=>r(t)),"what")}const o=t.getValue();s.unshift({node:o,printed:Lo(t,e,i)}),t.call((t=>r(t)),"what");for(let t=0;t<s.length;++t)"call"===s[t].node.kind&&s[t-1]&&["propertylookup","nullsafepropertylookup","staticlookup"].includes(s[t-1].node.kind)&&s[t-1].needsParens&&(s[0].printed=["(",s[0].printed],s[t-1].printed=[s[t-1].printed,")"]);const h=[];let a=[s[0]],c=1;for(;c<s.length&&("call"===s[c].node.kind||qr(s[c].node)&&s[c].node.offset&&"number"===s[c].node.offset.kind);++c)a.push(s[c]);if("call"!==s[0].node.kind)for(;c+1<s.length&&(qr(s[c].node)&&qr(s[c+1].node));++c)a.push(s[c]);h.push(a),a=[];let l=!1;for(;c<s.length;++c){if(l&&qr(s[c].node)){if("offsetlookup"===s[c].node.kind&&s[c].node.offset&&"number"===s[c].node.offset.kind){a.push(s[c]);continue}h.push(a),a=[],l=!1}"call"===s[c].node.kind&&(l=!0),a.push(s[c]),s[c].node.comments&&pr.hasTrailingComment(s[c].node)&&(h.push(a),a=[],l=!1)}a.length>0&&h.push(a);function _(t){const i=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||u&&s(e.name))||lo(e)}function s(t){return t.length<e.tabWidth}const n=Fr(t[0]).node;return qr(n)&&("identifier"===n.offset.kind||"variable"===n.offset.kind)&&i}const u="expressionstatement"===t.getParentNode().kind,d=h.length>=2&&!h[1][0].node.comments&&_(h);function p(t){const e=[];for(let i=0;i<t.length;i++)t[i+1]&&t[i+1].needsParens?(e.push("(",t[i].printed,t[i+1].printed,")"),i++):e.push(t[i].printed);return e}function f(t){return 0===t.length?"":br(Cr([Or,Ar(Or,t.map(p))]))}const k=h.map(p),T=k,m=d?3:2,x=h.slice(0,m).flat(),E=x.slice(1,-1).some((t=>pr.hasLeadingComment(t.node)))||x.slice(0,-1).some((t=>pr.hasTrailingComment(t.node)))||h[m]&&pr.hasLeadingComment(h[m][0].node),y=co(t,"encapsed");if(h.length<=m&&!E||y)return Cr(T);const A=Fr(d?h.slice(1,2)[0]:h[0]).node,g="call"!==A.kind&&n(A),N=[p(h[0]),d?h.slice(1,2).map(p):"",g?Or:"",f(h.slice(d?2:1))],C=s.filter((t=>"call"===t.node.kind)).length;if(E||C>=3||k.slice(0,-1).some(Pr))return Cr(N);return[Pr(T)||g?yr:"",Lr([T,N])]}(t,e,i):[t.call(i,"what"),Lo(t,e,i)];case"new":{const n=s.what&&"class"===s.what.kind&&s.what.isAnonymous;if(!n&&1===s.arguments.length&&Qo(s.arguments[0],e.originalText,e))return["new ",...t.call(Mo,"what"),t.call(i,"what"),"(",Ar(", ",t.map(i,"arguments")),")"];const r=[];if(r.push("new "),n)r.push(s.what.leadingComments&&"commentblock"===s.what.leadingComments[0].kind?[pr.printComments(s.what.leadingComments,e)," "]:"",...t.call((t=>Mo(t,e,i,{inline:!0})),"what"),"class",s.arguments.length>0?[" ",Lo(t,e,i)]:"",Cr(t.call(i,"what")));else{const n=["call","offsetlookup"].includes(s.what.kind),o=[n?"(":"",t.call(i,"what"),n?")":"",Lo(t,e,i)];r.push(zr(s.what)?br(o):o)}return r}case"clone":return["clone ",s.what.comments?br(t.call(i,"what")):t.call(i,"what")];case"propertylookup":case"nullsafepropertylookup":case"staticlookup":case"offsetlookup":{const n=t.getParentNode();let r,o=0;do{r=t.getParentNode(o),o++}while(r&&qr(r));const h=co(t,"encapsed")||r&&("new"===r.kind||"assign"===r.kind&&"variable"!==r.left.kind)||"offsetlookup"===s.kind||(lo(s.what)||"variable"===s.what.kind)&&["identifier","variable","encapsedpart"].includes(s.offset.kind)&&n&&!qr(n);return[t.call(i,"what"),h?Oo(t,e,i):Cr(br([vr,Oo(t,e,i)]))]}case"exit":return Cr([s.useDie?"die":"exit","(",s.expression?Qo(s.expression,e.originalText,e)?t.call(i,"expression"):[br([vr,t.call(i,"expression")]),vr]:pr.printDanglingComments(t,e),")"]);case"global":return Cr(["global ",br(Ar([",",gr],t.map(i,"items")))]);case"include":return[s.require?"require":"include",s.once?"_once":""," ",s.target.comments?br(t.call(i,"target")):t.call(i,"target")];case"label":return[t.call(i,"name"),":"];case"goto":return["goto ",t.call(i,"label")];case"throw":return["throw ",s.what.comments?br(t.call(i,"what")):t.call(i,"what")];case"silent":return["@",t.call(i,"expr")];case"halt":return[jr(s)?[pr.printDanglingComments(t,e,!0),Or]:"","__halt_compiler();",s.after];case"eval":return Cr(["eval(",Qo(s.source,e.originalText,e)?t.call(i,"source"):[br([vr,t.call(i,"source")]),vr],")"]);case"echo":{const e=t.map((t=>i(t)),"expressions");let n;return 1!==e.length||s.expressions[0].comments?e.length>0&&(n=ao(s.expressions[0])||s.expressions[0].comments?br(e[0]):Ir(e[0])):[n]=e,Cr([s.shortForm?"":"echo ",n||"",br(e.slice(1).map((t=>[",",gr,t])))])}case"print":return["print ",s.expression.comments?br(t.call(i,"expression")):t.call(i,"expression")];case"return":{const n=[];if(n.push("return"),s.expr){const e=t.call(i,"expr");n.push(" ",s.expr.comments?br(e):e)}return jr(s)&&n.push(" ",pr.printDanglingComments(t,e,!0)),n}case"isset":case"unset":return Cr([s.kind,Lo(t,e,i,"variables")]);case"empty":return Cr(["empty(",br([vr,t.call(i,"expression")]),vr,")"]);case"variable":{const e=t.getParentNode(),n=t.getParentNode(1),r="assign"===e.kind?"":s.byref?"&":"",o="encapsedpart"===e.kind&&"simple"===e.syntax&&e.curly||n&&"offsetlookup"===e.kind&&"encapsedpart"===n.kind&&"simple"===n.syntax&&n.curly?"":"$",h=s.curly?"{":"",a=s.curly?"}":"";return[r,o,h,t.call(i,"name"),a]}case"constantstatement":case"classconstant":{const n=Mo(t,e,i),r=t.map((t=>i(t)),"constants");let o;return 1!==r.length||s.constants[0].comments?r.length>0&&(o=br(r[0])):[o]=r,Cr([...n,s.final?"final ":"",s.visibility?[s.visibility," "]:"","const",o?[" ",o]:"",br(r.slice(1).map((t=>[",",Or,t])))])}case"constant":return Fo(s.name,t.call(i,"name")," =",s.value,t.call(i,"value"),!1,e);case"static":{const e=t.map((t=>i(t)),"variables"),n=s.variables.some((t=>t.defaultValue));let r;return 1!==e.length||s.variables[0].comments?e.length>0&&(r=br(e[0])):[r]=e,Cr(["static",r?[" ",r]:"",br(e.slice(1).map((t=>[",",n?Or:gr,t])))])}case"staticvariable":return Fo(s.variable,t.call(i,"variable")," =",s.defaultValue,t.call(i,"defaultValue"),!1,e);case"list":case"array":{const n="array"===s.kind&&ko(e.phpVersion,"5.4")||"list"===s.kind&&(s.shortForm||ko(e.phpVersion,"7.1")),r=n?"[":[s.kind,"("],o=n?"]":")";if(0===s.items.length)return jr(s)?Cr([r,pr.printDanglingComments(t,e),vr,o]):[r,o];const h=Fr(s.items),a=h&&"noop"===h.kind,[c]=s.items.filter((t=>"noop"!==t.kind)).sort(((t,i)=>e.locStart(t)-e.locStart(i))),l=!(!c||!c.key)&&c&&Br(e.originalText,e.locStart(s),e.locStart(c));return Cr([r,br([vr,Ro(t,e,i)]),a?",":"",Sr(!a&&To(e,"5.0")?[h&&ho(h)?Or:"",","]:""),pr.printDanglingComments(t,e,!0),vr,o],{shouldBreak:l})}case"entry":{const n=s.byRef?"&":"",r=s.unpack?"...":"";return s.key?Fo(s.key,t.call(i,"key")," =>",s.value,t.call(i,"value"),n,e):[n,r,t.call(i,"value")]}case"yield":{const e=[s.key?[t.call(i,"key")," => "]:"",t.call(i,"value")];return["yield",s.key||s.value?" ":"",s.value&&s.value.comments?br(e):e]}case"yieldfrom":return["yield from ",s.value.comments?br(t.call(i,"value")):t.call(i,"value")];case"unary":return[s.type,t.call(i,"what")];case"pre":return[s.type+s.type,t.call(i,"what")];case"post":return[t.call(i,"what"),s.type+s.type];case"cast":return["(",s.type,") ",s.expr.comments?br(t.call(i,"expr")):t.call(i,"expr")];case"assignref":case"assign":{const n="assignref"===s.kind;return Fo(s.left,t.call(i,"left"),[" ",n?"=":s.operator],s.right,t.call(i,"right"),n,e)}case"bin":{const n=t.getParentNode(),r=t.getParentNode(1),o=s!==n.body&&("if"===n.kind||"while"===n.kind||"switch"===n.kind||"do"===n.kind),h=So(t,i,e,!1,o);if(o)return h;if("unary"===n.kind||qr(n)&&"offsetlookup"!==n.kind)return Cr([br([vr,...h]),vr]);const a=s!==n.body&&"for"===n.kind||"retif"===n.kind&&r&&"return"!==r.kind,c=["assign","property","constant","staticvariable","entry"].includes(n.kind),l="bin"===s.left.kind&&Wr(s.type,s.left.type);if(a||Io(s)&&!l||!Io(s)&&c)return Cr(h);const _=h.slice(1);return Cr([h.length>0?h[0]:"",br(_)])}case"retif":{const e=[],n=t.getParentNode();let r,o=0;do{r=t.getParentNode(o),o++}while(r&&"retif"===r.kind);const h=r||n,a="bin"===s.falseExpr.kind?br(t.call(i,"falseExpr")):t.call(i,"falseExpr"),c=[s.trueExpr?gr:" ","?",s.trueExpr?[" ","bin"===s.trueExpr.kind?br(t.call(i,"trueExpr")):t.call(i,"trueExpr"),gr]:"",":",s.trueExpr?[" ",a]:[bo(s.falseExpr)?" ":gr,a]];e.push(c);const l=t=>n===h?Cr(t):t,_=t.getParentNode(1),u="cast"===n.kind&&_?_:n,d=["propertylookup","nullsafepropertylookup","staticlookup"].includes(u.kind),p=t.call(i,"test");if(!s.trueExpr){const t=[p,"bin"===u.kind||["print","echo","return","include"].includes(h.kind)?br(e):e];return"call"===u.kind&&u.what===s||"unary"===u.kind||qr(u)&&"offsetlookup"!==u.kind?Cr([br([vr,t]),vr]):l(t)}return l(["retif"===s.test.kind?br(p):p,br(e),d?vr:""])}case"boolean":return s.value?"true":"false";case"number":return Qr(s.value);case"string":{if("encapsedpart"===t.getParentNode().kind){const i=t.getParentNode(1);let n=0;const r=ko(e.phpVersion,"7.3");let o=Rr;if("heredoc"===i.type){o=r?Or:Rr;const t=i.raw.split("\n");n=t[t.length-1].search(/\S/),-1===n&&(n=t[t.length-2].search(/\S/))}return Ar(o,s.raw.split("\n").map(((t,e)=>e>0||0===s.loc.start.column?t.substring(n):t)))}const i=no(s,e)?'"':"'";let n=s.raw;return"b"===s.raw[0]&&(n=n.slice(1)),['"',"'"].includes(n[0])&&(n=n.substr(1)),['"',"'"].includes(n[n.length-1])&&(n=n.substr(0,n.length-1)),["b"===s.raw[0]?"b":"",i,Ar(Rr,n.split("\n")),i]}case"intersectiontype":return Wo(t,i,"&");case"uniontype":return Wo(t,i,"|");case"encapsedpart":{const e="simple"===s.syntax&&s.curly||"complex"===s.syntax?[s.curly?"$":"","{"]:"",n="simple"===s.syntax&&s.curly||"complex"===s.syntax?"}":"";return[e,t.call(i,"expression"),n]}case"encapsed":switch(s.type){case"string":case"shell":case"heredoc":{const n=ko(e.phpVersion,"7.3")?Or:Rr;return[vo(s),"heredoc"===s.type?n:"",...t.map(i,"value"),vo(s,{opening:!1}),"heredoc"===s.type&&Xr(t)?Or:""]}default:return"Have not implemented kind ".concat(s.type," yet.")}case"inline":return Ar(Rr,s.raw.replace("___PSEUDO_INLINE_PLACEHOLDER___","").split("\n"));case"magic":return s.value;case"nowdoc":{const i=ko(e.phpVersion,"7.3")?Or:Rr;return["<<<'",s.label,"'",i,Ar(i,s.value.split("\n")),i,s.label,Xr(t)?Or:""]}case"name":return["rn"===s.resolution?"namespace\\":"",s.name];case"literal":return t.call(i,"value");case"parentreference":return"parent";case"selfreference":return"self";case"staticreference":return"static";case"typereference":return s.name;case"nullkeyword":return"null";case"identifier":return"method"===t.getParentNode().kind&&(s.name=uo(s.name)),t.call(i,"name");case"match":{const s=t.map(((t,e)=>{const s=null===t.getValue().conds?"default":t.map(((t,e)=>[",",gr,i(t)].slice(0===e?2:0)),"conds"),n=t.call(i,"body");return[",",Or,Cr([Cr([s,br(gr)]),"=> ",n])].slice(e>0?0:1)}),"arms");return Cr(["match (",Cr([vr,br(t.call(i,"cond")),vr]),") {",Cr(br([...s,e.trailingCommaPHP?Sr(","):""]))," ",vr,"}"])}case"noop":return s.comments?pr.printComments(t.getValue().comments,e):"";case"namedargument":return[s.name,": ",t.call(i,"value")];case"enumcase":return Cr(["case ",t.call(i,"name"),s.value?[" =",Go(s.name,s.value,t.call(i,"value"),!1,e)]:""]);case"variadicplaceholder":return"...";default:return"Have not implemented kind ".concat(s.kind," yet.")}}(t,e,i),r=[],o=Er(t);return o&&r.unshift("("),r.push(n),o&&r.push(")"),Vr(t)&&r.push(";"),$r(t)&&r.push(Or),r};const $o=new Set(["loc","range","raw","comments","leadingComments","trailingComments","parenthesizedExpression","parent","prev","start","end","tokens","errors","extra"]);function jo(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=Un.printNumber(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=Un.normalizeMagicMethodName(e.name.name)),"noop"===t.kind)return null}jo.ignoredProperties=$o;var zo=jo;const Ko="PHP";var Xo={phpVersion:{since:"0.13.0",category:Ko,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:Ko,type:"boolean",default:!0,description:"Print trailing commas wherever possible when multi-line."},braceStyle:{since:"0.10.0",category:Ko,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 qo=(t,e,i,s)=>{if("length"===i||"prototype"===i)return;if("arguments"===i||"caller"===i)return;const n=Object.getOwnPropertyDescriptor(t,i),r=Object.getOwnPropertyDescriptor(e,i);!Jo(n,r)&&s||Object.defineProperty(t,i,r)},Jo=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)},Zo=(t,e)=>{const i=Object.getPrototypeOf(e);i!==Object.getPrototypeOf(t)&&Object.setPrototypeOf(t,i)},th=(t,e)=>"/* Wrapped ".concat(t,"*/\n").concat(e),eh=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),ih=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),sh=(t,e,i)=>{const s=""===i?"":"with ".concat(i.trim(),"() "),n=th.bind(null,s,e.toString());Object.defineProperty(n,"name",ih),Object.defineProperty(t,"toString",{...eh,value:n})};var nh=function(t,e){let{ignoreNonConfigurable:i=!1}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{name:s}=t;for(const s of Reflect.ownKeys(e))qo(t,e,s,i);return Zo(t,e),sh(t,e,s),t},rh="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function oh(t){return t&&t.default||t}var hh,ah=()=>{const t={};return t.promise=new Promise(((e,i)=>{t.resolve=e,t.reject=i})),t},ch=function(t,e){return t(e={exports:{}},e.exports),e.exports}((function(t,e){var i=rh&&rh.__awaiter||function(t,e,i,s){return new(i||(i=Promise))((function(n,r){function o(t){try{a(s.next(t))}catch(t){r(t)}}function h(t){try{a(s.throw(t))}catch(t){r(t)}}function a(t){t.done?n(t.value):new i((function(e){e(t.value)})).then(o,h)}a((s=s.apply(t,e||[])).next())}))},s=rh&&rh.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const n=s(ah);function r(t){let e,s,r,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*(){r=n.default();const i=h[1][o]-Date.now();return i<=0?(t.delete(h[0]),void r.resolve()):(e=h[0],s=setTimeout((()=>{t.delete(h[0]),r&&r.resolve()}),i),"function"==typeof s.unref&&s.unref(),r.promise)}));try{for(const e of t)yield h(e)}catch(t){}e=void 0})),a=()=>{e=void 0,void 0!==s&&(clearTimeout(s),s=void 0),void 0!==r&&(r.reject(void 0),r=void 0)},c=t.set.bind(t);return t.set=(i,s)=>{t.has(i)&&t.delete(i);const n=c(i,s);return e&&e===i&&a(),h(),n},h(),t}e.default=r,t.exports=r,t.exports.default=r}));(hh=ch)&&hh.__esModule&&Object.prototype.hasOwnProperty.call(hh,"default")&&hh.default;var lh=ch;const _h=new WeakMap,uh=new WeakMap,dh=function(t){let{cacheKey:e,cache:i=new Map,maxAge:s}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};"number"==typeof s&&lh(i);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=i.get(h);if(a)return a.data;const c=t.apply(this,r);return i.set(h,{data:c,maxAge:s?Date.now()+s:Number.POSITIVE_INFINITY}),c};return nh(n,t,{ignoreNonConfigurable:!0}),uh.set(n,i),n};dh.decorator=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(e,i,s)=>{const n=e[i];if("function"!=typeof n)throw new TypeError("The decorated value must be a function");delete s.value,delete s.writable,s.get=function(){if(!_h.has(this)){const e=dh(n,t);return _h.set(this,e),e}return _h.get(this)}}},dh.clear=t=>{const e=uh.get(t);if(!e)throw new TypeError("Can't clear a function that was not memoized!");if("function"!=typeof e.clear)throw new TypeError("The cache Map can't be cleared!");e.clear()};const ph=/@prettier|@format/,fh=dh((t=>{const e=fn(t),[i]=e.children,[s]=e.comments.filter((t=>"commentblock"===t.kind));if(i&&s&&s.loc.start.line<i.loc.start.line)return s}));var kh={hasPragma:function(t){if(!ph.test(t))return!1;const e=fh(t);if(e){const{value:t}=e;return ph.test(t)}return!1},insertPragma:function(t){const e=fh(t);if(e){const{start:{offset:i},end:{offset:s}}=e.loc,n=t.substring(0,i),r=t.substring(s);return"".concat(n).concat(function(t){let e=t.split("\n");if(1===e.length){const[,t]=/\/*\*\*(.*)\*\//.exec(e[0]);e=["/**"," * ".concat(t.trim())," */"]}const i=e.findIndex((t=>/@\S/.test(t)))||1;return e.splice(i,0," * @format"),e.join("\n")}(e.value)).concat(r)}const i="<?php";if(!t.startsWith(i))return t;const s=i.length,n=t.substring(0,s),r=t.substring(s);return"".concat(n,"\n/** \n * @format \n */\n").concat(r)}},Th="programming",mh="text.html.php",xh="application/x-httpd-php",Eh="#4F5D95",yh=[".php",".aw",".ctp",".fcgi",".inc",".php3",".php4",".php5",".phps",".phpt"],Ah=[".php",".php_cs",".php_cs.dist","Phakefile"],gh=["php"],Nh=["inc"],Ch={name:"PHP",type:Th,tmScope:mh,aceMode:"php",codemirrorMode:"php",codemirrorMimeType:xh,color:Eh,extensions:yh,filenames:Ah,interpreters:gh,aliases:Nh,languageId:272},Lh=Object.freeze({__proto__:null,name:"PHP",type:Th,tmScope:mh,aceMode:"php",codemirrorMode:"php",codemirrorMimeType:xh,color:Eh,extensions:yh,filenames:Ah,interpreters:gh,aliases:Nh,languageId:272,default:Ch}),bh="HTML+PHP",Ih="markup",Sh="#4f5d95",Oh="text.html.php",vh="HTML",Rh=[".phtml"],wh="application/x-httpd-php",Dh={name:bh,type:Ih,color:Sh,tmScope:Oh,group:vh,extensions:Rh,aceMode:"php",codemirrorMode:"php",codemirrorMimeType:wh,languageId:151},Ph=Object.freeze({__proto__:null,name:bh,type:Ih,color:Sh,tmScope:Oh,group:vh,extensions:Rh,aceMode:"php",codemirrorMode:"php",codemirrorMimeType:wh,languageId:151,default:Dh}),Uh=oh(Lh),Mh=oh(Ph);const{join:Bh,hardline:Fh}=s.default.doc.builders,{hasPragma:Hh,insertPragma:Gh}=kh;function Vh(t,e){let{extend:i,override:s}=e;const n={};for(const e in t){n["languageId"===e?"linguistLanguageId":e]=t[e]}if(i)for(const t in i)n[t]=(n[t]||[]).concat(i[t]);for(const t in s)n[t]=s[t];return n}const Qh=[Vh(Uh,{override:{parsers:["php"],vscodeLanguageIds:["php"]}}),Vh(Mh,{override:{parsers:["php"],vscodeLanguageIds:["php"]}})],Wh=t=>e=>e.loc&&e.loc[t]&&e.loc[t].offset,Yh={php:{parse:fn,astFormat:"php",locStart:Wh("start"),locEnd:Wh("end"),hasPragma:Hh}},$h={php:{print:Yo,insertPragma:Gh,massageAstNode:zo,getCommentChildNodes:pr.getCommentChildNodes,canAttachComment:pr.canAttachComment,isBlockComment:pr.isBlockComment,handleComments:{ownLine:pr.handleOwnLineComment,endOfLine:pr.handleEndOfLineComment,remaining:pr.handleRemainingComment},willPrintOwnComments(t){const e=t.getValue();return e&&"noop"===e.kind},printComment(t){const e=t.getValue();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]))?Bh(Fh,t.map(((e,i)=>(i>0?" ":"")+(i<t.length-1?e.trim():e.trimLeft())))):e.value}case"commentline":return e.value.trimRight();default:throw new Error("Not a comment: ".concat(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"),i=t.getParentNode(),s=t.getNode();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)}}};var jh={languages:Qh,printers:$h,parsers:Yh,options:Xo,defaultOptions:{tabWidth:4}},zh=jh.languages,Kh=jh.printers,Xh=jh.parsers,qh=jh.options,Jh=jh.defaultOptions;t.default=jh,t.defaultOptions=Jh,t.languages=zh,t.options=qh,t.parsers=Xh,t.printers=Kh,Object.defineProperty(t,"__esModule",{value:!0})}));
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";function i(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var s=i(e),n={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 "'.concat(t,'" at line ').concat(this.yylineno," (offset ").concat(this.offset,")"))}};n.attributeIndex,n.attributeListDepth,n.matchST_ATTRIBUTE;var r={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}};r.T_COMMENT,r.T_DOC_COMMENT;var o={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}};o.nextINITIAL,o.matchINITIAL;var h={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 i=t;if(t=this.input(),"_"===t){if("_"===i){this.unput(2);break}if("."===i){this.unput(1);break}if("e"===i||"E"===i){this.unput(2);break}}else{if("."===t){if(e){this.unput(1);break}if("_"===i){this.unput(2);break}e=!0;continue}if("e"===t||"E"===t){if("_"===i){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}};h.consume_NUM,h.consume_HNUM,h.consume_LNUM,h.consume_BNUM,h.consume_ONUM;var a={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")}};a.matchST_LOOKING_FOR_PROPERTY,a.matchST_LOOKING_FOR_VARNAME,a.matchST_VAR_OFFSET;var c={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}};c.matchST_IN_SCRIPTING,c.T_WHITESPACE;const l=["\n","\r"],_=["\n","\r",";"],u=_.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 i=this.offset-1;for(;this.offset<this.size&&(this.offset++,this.is_LABEL()););const s=this._input.substring(i,this.offset-1);if((!e||e===this._input[this.offset-1])&&(e&&this.offset++,l.includes(this._input[this.offset-1])))return this.heredoc_label.label=s,this.heredoc_label.length=s.length,this.heredoc_label.finished=!1,i=this.offset-t,this.offset=t,this.consume(i),"'"===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 i=this._input[t-2];if(!l.includes(i))return!1;let s=!1,n=!1,r=0,o=this._input[t-1];if(this.version>=703){for(;"\t"===o||" "===o;)" "===o?s=!0:"\t"===o&&(n=!0),o=this._input[t+r],r++;if(t+=r,l.includes(this._input[t-1]))return!1}if(this._input.substring(t-1,t-1+this.heredoc_label.length)===this.heredoc_label.label){const i=this._input[t-1+this.heredoc_label.length];if((this.version>=703?u:_).includes(i)){if(e){if(this.consume(r),s&&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=s,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(!l.includes(this._input[t-1]))for(;!l.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(l.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(),l.includes(t)||(t=this.input())),l.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}};d.T_CONSTANT_ENCAPSED_STRING,d.is_HEREDOC,d.ST_DOUBLE_QUOTES,d.isDOC_MATCH,d.prematch_ENDOFDOC,d.matchST_NOWDOC,d.matchST_HEREDOC,d.consume_VARIABLE,d.matchST_BACKQUOTE,d.matchST_DOUBLE_QUOTES;var p={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 i=!1;if(this.is_LABEL_START()){for(;this.is_LABEL();)e+=this.input();const t=e.slice(0,-1).toLowerCase();i="extends"!==t&&"implements"!==t}return this.unput(this.offset-t),i?this.tok.T_ENUM:this.tok.T_STRING}if(this.offset<this.size&&e!==this.tok.T_YIELD_FROM){let i=this.input();if("\\"===i){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(),i=this.input()}while("\\"===i)}i&&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(),i=this.castKeywords[e];if("number"==typeof i&&(this.input(),this.is_TABSPACE()&&this.consume_TABSPACE().input(),")"===this._input[this.offset-1]))return i}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):"^"}}};p.T_STRING,p.consume_TOKEN,p.tokenTerminals;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}};f.is_NUM,f.is_NUM_START,f.is_LABEL,f.is_LABEL_START,f.consume_LABEL,f.is_TOKEN,f.is_WHITESPACE,f.is_TABSPACE,f.consume_TABSPACE,f.is_HEX,f.is_OCTAL;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 i=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(i.stack)}return t},[n,r,o,h,a,c,d,p,f].forEach((function(t){for(const e in t)k.prototype[e]=t[e]}));var T=k;var m=function(t,e,i){this.line=t,this.column=e,this.offset=i},x={read_array:function(){let t=null,e=!1;const i=this.node("array");this.token===this.tok.T_ARRAY?(this.next().expect("("),t=")"):(e=!0,t="]");let s=[];return this.next().token!==t&&(s=this.read_array_pair_list(e)),this.expect(t),this.next(),i(e,s)},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 i=null,s=null,n=!1,r=!1;if("&"===this.token)this.next(),n=!0,s=this.read_variable(!0,!1);else if(this.token===this.tok.T_ELLIPSIS&&this.version>=704)this.next(),"&"===this.token&&this.error(),r=!0,s=this.read_expr();else{const t=this.read_expr();this.token===this.tok.T_DOUBLE_ARROW?(this.next(),i=t,"&"===this.token?(this.next(),n=!0,s=this.read_variable(!0,!1)):s=this.read_expr()):s=t}return e(i,s,n,r)}};x.read_array,x.read_array_pair_list,x.read_array_pair;var E={read_class_declaration_statement:function(t){const e=this.node("class"),i=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 s=this.node("identifier");const n=this.text();this.next(),s=s(n);const r=this.read_extends_from(),o=this.read_implements_list();this.expect("{");const h=e(s,r,o,this.next().read_class_body(!0,!1),i);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 i=[],s=[];for(;this.token!==this.EOF&&"}"!==this.token;){if(this.token===this.tok.T_COMMENT){i.push(this.read_comment());continue}if(this.token===this.tok.T_DOC_COMMENT){i.push(this.read_doc_comment());continue}if(this.token===this.tok.T_USE){i=i.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(),i=i.concat(t);continue}this.token===this.tok.T_ATTRIBUTE&&(s=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)i.push(this.read_function(!1,r,s,n)),s=[];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,s);s=[],this.expect(";"),this.next(),i=i.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,s);this.expect(";")&&this.next(),i=i.concat(t)}}return this.expect("}"),this.next(),i},read_variable_list:function(t,e){const i=this.node("propertystatement"),s=this.read_list((function(){const t=this.node("property");let i=!1;this.token===this.tok.T_READ_ONLY&&(i=!0,this.next());const[s,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,i,s,n,e||[]):"="===this.token?t(r,this.next().read_expr(),i,s,n,e||[]):(this.expect([",",";","="]),t(r,null,s,n,e||[]))}),",");return i(null,s,t)},read_constant_list:function(t,e){this.expect(this.tok.T_CONST)&&this.next();const i=this.node("classconstant"),s=this.read_list((function(){const t=this.node("constant");let e=null,i=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("=")&&(i=this.next().read_expr()),t(e,i)}),",");return i(null,s,t,e||[])},read_member_flags:function(t){const e=[-1,-1,-1];if(this.is("T_MEMBER_FLAGS")){let i=0,s=0;do{switch(this.token){case this.tok.T_PUBLIC:i=0,s=0;break;case this.tok.T_PROTECTED:i=0,s=1;break;case this.tok.T_PRIVATE:i=0,s=2;break;case this.tok.T_STATIC:i=1,s=1;break;case this.tok.T_ABSTRACT:i=2,s=1;break;case this.tok.T_FINAL:i=2,s=2}t&&(0==i&&2==s?(this.expect([this.tok.T_PUBLIC,this.tok.T_PROTECTED]),s=-1):2==i&&1==s&&(this.error(),s=-1)),-1!==e[i]?this.error():-1!==s&&(e[i]=s)}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 i=this.node("identifier");const s=this.text();this.next(),i=i(s);const n=this.read_interface_extends_list();this.expect("{");return e(i,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 i=this.position();e=this.read_attr_list();const s=this.read_member_flags(!0);if(this.token==this.tok.T_CONST){const i=this.read_constant_list(s,e);this.expect(";")&&this.next(),t=t.concat(i),e=[]}else if(this.token===this.tok.T_FUNCTION){const n=this.read_function_declaration(2,s,e,i);n.parseFlags(s),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 i=this.text();this.next(),e=e(i),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 i=null;for(;","===this.token;)e.push(this.next().read_namespace_name());if("{"===this.token){for(i=[];this.next().token!==this.EOF&&"}"!==this.token;)i.push(this.read_trait_use_alias()),this.expect(";");this.expect("}")&&this.next()}else this.expect(";")&&this.next();return t(e,i)},read_trait_use_alias:function(){const t=this.node();let e,i=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")){i=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",i,e,this.next().read_name_list());if(this.token===this.tok.T_AS){let s=null,n=null;if(this.next().is("T_MEMBER_FLAGS")&&(s=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===s&&this.expect(this.tok.T_STRING);return t("traitalias",i,e,n,s)}return this.expect([this.tok.T_AS,this.tok.T_INSTEADOF]),t("traitalias",i,e,null,null)}};E.read_class_declaration_statement,E.read_class_modifiers,E.read_class_modifier,E.read_class_body,E.read_variable_list,E.read_constant_list,E.read_member_flags,E.read_optional_type,E.read_interface_declaration_statement,E.read_interface_body,E.read_trait_declaration_statement,E.read_trait_use_statement,E.read_trait_use_alias;var y={read_comment:function(){const t=this.text();let e=this.ast.prepare("/*"===t.substring(0,2)?"commentblock":"commentline",null,this);const i=this.lexer.yylloc.first_offset,s=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=i,this.prev=s,e},read_doc_comment:function(){let t=this.ast.prepare("commentblock",null,this);const e=this.lexer.yylloc.first_offset,i=this.text(),s=this.prev;return this.prev=[this.lexer.yylloc.last_line,this.lexer.yylloc.last_column,this.lexer.offset],this.lex(),t=t(i),t.offset=e,this.prev=s,t}};y.read_comment,y.read_doc_comment;var A={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 i=null;return":"!==this.next().token&&(i=this.read_expr()),this.expect(":")&&this.next(),e("retif",t,i,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,i=[];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 i=this.innerList;t=this.node("list"),i||(e=this.node("assign")),this.next().expect("(")&&this.next(),this.innerList||(this.innerList=!0);const s=this.read_array_pair_list(!1);this.expect(")")&&this.next();let n=!1;for(let t=0;t<s.length;t++)if(null!==s[t]&&"noop"!==s[t].kind){n=!0;break}return n||this.raiseError("Fatal Error : Cannot use empty list on line "+this.lexer.yylloc.first_line),i?t(s,!1):(this.innerList=!1,this.expect("=")?e(t(s,!1),this.next().read_expr(),"="):t(s,!1))}if(this.token===this.tok.T_ATTRIBUTE&&(i=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,i=null;return t=this.node("yield"),this.next().is("EXPR")&&(e=this.read_expr(),this.token===this.tok.T_DOUBLE_ARROW&&(i=e,e=this.next().read_expr())),t(e,i)}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,i);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],i);this.lexer.tokens.push(t),this.next()}}if(this.is("VARIABLE")){t=this.node(),e=this.read_variable(!1,!1);const i="identifier"===e.kind||"staticlookup"===e.kind&&"identifier"===e.offset.kind;switch(this.token){case"=":return i&&this.error("VARIABLE"),"&"==this.next().token?this.read_assignref(t,e):t("assign",e,this.read_expr(),"=");case this.tok.T_PLUS_EQUAL:return i&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"+=");case this.tok.T_MINUS_EQUAL:return i&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"-=");case this.tok.T_MUL_EQUAL:return i&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"*=");case this.tok.T_POW_EQUAL:return i&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"**=");case this.tok.T_DIV_EQUAL:return i&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"/=");case this.tok.T_CONCAT_EQUAL:return i&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),".=");case this.tok.T_MOD_EQUAL:return i&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"%=");case this.tok.T_AND_EQUAL:return i&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"&=");case this.tok.T_OR_EQUAL:return i&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"|=");case this.tok.T_XOR_EQUAL:return i&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"^=");case this.tok.T_SL_EQUAL:return i&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"<<=");case this.tok.T_SR_EQUAL:return i&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),">>=");case this.tok.T_COALESCE_EQUAL:return i&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"??=");case this.tok.T_INC:return i&&this.error("VARIABLE"),this.next(),t("post","+",e);case this.tok.T_DEC:return i&&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 i=this.convertToList(e);e.loc&&(i.loc=e.loc);return t("assign",i,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))),i=this.node("list")(e,!0);return t.loc&&(i.loc=t.loc),t.leadingComments&&(i.leadingComments=t.leadingComments),t.trailingComments&&(i.trailingComments=t.trailingComments),i},read_assignref:function(t,e){let i;return this.next(),this.token===this.tok.T_NEW?(this.version>=700&&this.error(),i=this.read_new_expr()):i=this.read_variable(!1,!1),t("assignref",e,i)},read_inline_function:function(t,e){if(this.token===this.tok.T_FUNCTION){const i=this.read_function(!0,t,e);return i.attrGroups=e,i}!this.version>=704&&this.raiseError("Arrow Functions are not allowed");const i=this.node("arrowfunc");this.expect(this.tok.T_FN)&&this.next();const s=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=i(n,s,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,i=[];return this.expect("(")&&this.next(),e=this.read_expr(),this.expect(")")&&this.next(),this.expect("{")&&this.next(),i=this.read_match_arms(),this.expect("}")&&this.next(),t(e,i)},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 i=this.read_expr();return this.expect(")"),this.next(),"("===this.token&&(e=this.read_argument_list()),t(i,e)}const i=this.read_attr_list();if(this.token===this.tok.T_CLASS){const s=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=s(null,n,r,o,[0,0,0]);return h.attrGroups=i,t(h,e)}let s=this.read_new_class_name();for(;"["===this.token;){const t=this.node("offsetlookup"),e=this.next().read_encaps_var_offset();this.expect("]")&&this.next(),s=t(s,e)}return"("===this.token&&(e=this.read_argument_list()),t(s,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}};A.read_expr,A.read_expr_cast,A.read_isset_variable,A.read_isset_variables,A.read_internal_functions_in_yacc,A.read_optional_expr,A.read_exit_expr,A.read_expr_item,A.convertToList,A.read_assignref,A.read_inline_function,A.read_match_expression,A.read_match_arms,A.read_match_arm,A.read_match_arm_conds,A.read_attribute,A.read_attr_list,A.read_new_expr,A.read_new_class_name,A.handleDereferencable;var g={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 i=this.node("identifier");const s=this.text();this.next(),i=i(s);const n=this.read_enum_value_type(),r=this.read_implements_list();this.expect("{");const o=e(i,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 i=this.next().text();this.next(),e=e(i);const s="="===this.token?this.next().read_expr():null;return this.expect(";"),t(e,s)}};g.read_enum_declaration_statement,g.read_enum_value_type,g.read_enum_case;var N={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,i,s){const n=this.read_function_declaration(t?1:e?2:0,e&&1===e[1],i||[],s);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,i,s){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 _=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 u=t=>(t.attrGroups=i||[],s&&t.loc&&(t.loc.start=s,t.loc.source&&(t.loc.source=this.lexer._input.substr(t.loc.start.offset,t.loc.end.offset-t.loc.start.offset))),t);return u(1===t?r(_,o,a,c,l,e):r(h,_,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 i=this.read_parameter(t);return i&&(e&&this.raiseError("Unexpected parameter after a variadic parameter"),i.variadic&&(e=!0)),i}.bind(this),",")}return[]},read_parameter:function(t){const e=this.node("parameter");let i=null,s=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)){i=this.node("identifier");const t=this.text().substring(1);this.next(),i=i(t)}"="==this.token&&(s=this.next().read_expr());const _=e(i,n,s,c,l,o,r,a);return h&&(_.attrGroups=h),_},read_types(){const t="unset",e="union",i="intersection",s=[];let n=t;const r=this.read_type();if(!r)return null;for(s.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:i:(n===e&&"|"!==this.token||n===i&&"&"!==this.token)&&this.raiseError('Unexpect token "'+this.token+'", "|" and "&" can not be mixed'),this.next(),s.push(this.read_type())}return 1===s.length?s[0]:n===i?this.node("intersectiontype")(s):this.node("uniontype")(s)},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 i="variadic"===e.kind;t&&!i&&this.raiseError("Unexpected non-variadic argument after a variadic argument"),i&&(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(),i=[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(i),this.next(),t.destroy(),this.read_namespace_name())}return t.destroy(),null}};N.is_reference,N.is_variadic,N.read_function,N.read_function_declaration,N.read_lexical_vars,N.read_list_with_dangling_comma,N.read_lexical_var_list,N.read_lexical_var,N.read_parameter_list,N.read_parameter,N.read_types,N.read_promoted,N.read_argument_list,N.read_non_empty_argument_list,N.read_argument,N.read_type;var C={read_if:function(){const t=this.node("if"),e=this.next().read_if_expr();let i=null,s=null,n=!1;if(":"===this.token){n=!0,this.next(),i=this.node("block");const t=[];for(;this.token!==this.EOF&&this.token!==this.tok.T_ENDIF;){if(this.token===this.tok.T_ELSEIF){s=this.read_elseif_short();break}if(this.token===this.tok.T_ELSE){s=this.read_else_short();break}t.push(this.read_inner_statement())}i=i(null,t),this.expect(this.tok.T_ENDIF)&&this.next(),this.expectEndOfStatement()}else i=this.read_statement(),this.token===this.tok.T_ELSEIF?s=this.read_if():this.token===this.tok.T_ELSE&&(s=this.next().read_statement());return t(e,i,s,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"),i=this.next().read_if_expr();this.expect(":")&&this.next();const s=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(i,s(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)}};C.read_if,C.read_if_expr,C.read_elseif_short,C.read_else_short;var L={read_while:function(){const t=this.node("while");this.expect(this.tok.T_WHILE)&&this.next();let e=null,i=null,s=!1;return this.expect("(")&&this.next(),e=this.read_expr(),this.expect(")")&&this.next(),":"===this.token?(s=!0,i=this.read_short_form(this.tok.T_ENDWHILE)):i=this.read_statement(),t(e,i,s)},read_do:function(){const t=this.node("do");this.expect(this.tok.T_DO)&&this.next();let e=null,i=null;return i=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,i)},read_for:function(){const t=this.node("for");this.expect(this.tok.T_FOR)&&this.next();let e=[],i=[],s=[],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?(i=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?(r=!0,n=this.read_short_form(this.tok.T_ENDFOR)):n=this.read_statement(),t(e,i,s,n,r)},read_foreach:function(){const t=this.node("foreach");this.expect(this.tok.T_FOREACH)&&this.next();let e=null,i=null,s=null,n=null,r=!1;return this.expect("(")&&this.next(),e=this.read_expr(),this.expect(this.tok.T_AS)&&(this.next(),s=this.read_foreach_variable(),this.token===this.tok.T_DOUBLE_ARROW&&(i=s,s=this.next().read_foreach_variable())),i&&"list"===i.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,i,s,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 i=this.read_array_pair_list(t);return this.expect(t?"]":")")&&this.next(),e(i,t)}return this.read_variable(!1,!1)}};L.read_while,L.read_do,L.read_for,L.read_foreach,L.read_foreach_variable;var b={read_start:function(){return this.token==this.tok.T_NAMESPACE?this.read_namespace():this.read_top_statement()}};b.read_start;var I={read_namespace:function(){const t=this.node("namespace");let e,i;return this.expect(this.tok.T_NAMESPACE)&&this.next(),i="{"===this.token?{name:[""]}:this.read_namespace_name(),this.currentNamespace=i,";"===this.token?(this.currentNamespace=i,e=this.next().read_top_statements(),this.expect(this.EOF),t(i.name,e,!1)):"{"===this.token?(this.currentNamespace=i,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(i.name,e,!0)):(this.error(["{",";"]),this.currentNamespace=i,e=this.read_top_statements(),this.expect(this.EOF),t(i,e,!1))},read_namespace_name:function(t){const e=this.node();let i,s=this.text();switch(this.token){case this.tok.T_NAME_RELATIVE:i=this.ast.name.RELATIVE_NAME,s=s.replace(/^namespace\\/,"");break;case this.tok.T_NAME_QUALIFIED:i=this.ast.name.QUALIFIED_NAME;break;case this.tok.T_NAME_FULLY_QUALIFIED:i=this.ast.name.FULL_QUALIFIED_NAME;break;default:if(i=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"===s.toLowerCase())return e("parentreference",s);if("self"===s.toLowerCase())return e("selfreference",s)}return e("name",s,i)},read_use_statement:function(){let t=this.node("usegroup"),e=[],i=null;this.expect(this.tok.T_USE)&&this.next();const s=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&&(i=e[0].name,e=this.next().read_use_declarations(null===s),this.expect("}")&&this.next()),t=t(i,s,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 i=null;t&&(i=this.read_use_type());const s=this.read_namespace_name(),n=this.read_use_alias();return e(s.name,n,i)},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"),i=this.text();this.next(),t=e(i)}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}};I.read_namespace,I.read_namespace_name,I.read_use_statement,I.read_class_name_reference,I.read_use_declaration,I.read_use_declarations,I.read_use_alias,I.read_use_type;const S={"\\":"\\",$:"$",n:"\n",r:"\r",t:"\t",f:String.fromCharCode(12),v:String.fromCharCode(11),e:String.fromCharCode(27)};var O={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,i)=>S[e]?S[e]:"x"===e[0]||"X"===e[0]?String.fromCodePoint(parseInt(e.substr(1),16)):"u"===e[0]?String.fromCodePoint(parseInt(i,16)):String.fromCodePoint(parseInt(e,8)))):t.replace(/\\\\/g,"\\").replace(/\\'/g,"'")},remove_heredoc_leading_whitespace_chars:function(t,e,i,s){if(0===e)return t;this.check_heredoc_indentation_level(t,e,i,s);const n=i?" ":"\t",r=new RegExp("\\n".concat(n,"{").concat(e,"}"),"g"),o=new RegExp("^".concat(n,"{").concat(e,"}"));return s&&(t=t.replace(o,"")),t.replace(r,"\n")},check_heredoc_indentation_level:function(t,e,i,s){const n=t.length;let r=0,o=0,h=!0;const a=i?" ":"\t";let c=!1;if(!s){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 ".concat(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 i=this.text();let s=0;"b"!==i[0]&&"B"!==i[0]||(s=1);const n='"'===i[s];this.next();e=e(n,this.resolve_special_chars(i.substring(s+1,i.length-1),n),1===s,i),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 i=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 s=t[t.length-1];"\n"===s?t="\r"===t[t.length-2]?t.substring(0,t.length-2):t.substring(0,t.length-1):"\r"===s&&(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(i,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,i;const s=this.node("offsetlookup");return"["===this.token?(i=this.next().read_expr(),this.expect("]")&&this.next(),e=s(t,i)):this.token===this.tok.T_DOLLAR_OPEN_CURLY_BRACES&&(i=this.read_encapsed_string_item(!1),e=s(t,i)),e},read_encapsed_string_item:function(t){const e=this.node("encapsedpart");let i,s,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),s=this.node("offsetlookup"),i=this.next().read_expr(),this.expect("]")&&this.next(),h=s(n,i)):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&&(s=this.node("offsetlookup"),i=this.next().read_encaps_var_offset(),this.expect("]")&&this.next(),h=s(h,i)),this.token===this.tok.T_OBJECT_OPERATOR){s=this.node("propertylookup"),this.next().expect(this.tok.T_STRING);const t=this.node("identifier");n=this.text(),this.next(),h=s(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 i=this.lexer.yylloc.first_offset;let s=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();const h=this.lexer._input.substring("heredoc"===o?i:n-1,this.lexer.yylloc.first_offset);return s=s(r,h,o),t===this.tok.T_END_HEREDOC&&(s.label=this.lexer.heredoc_label.label,this.lexer.heredoc_label.finished=!0),s},get_magic_constant:function(){const t=this.node("magic"),e=this.text();return this.next(),t(e.toUpperCase(),e)}};O.resolve_special_chars,O.remove_heredoc_leading_whitespace_chars,O.check_heredoc_indentation_level,O.read_dereferencable_scalar,O.read_scalar,O.read_dereferencable,O.read_encapsed_string_item,O.read_encapsed_string,O.get_magic_constant;var v={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 i=this.text();return this.next(),e=e(i),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 i=this.node("identifier");const s=this.text();this.next(),i=i(s);let n=null;if(this.expect("=")&&(n=this.next().read_expr()),t.push(e(i,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 i=this.next().read_expr();return this.expectEndOfStatement(i),e("expressionstatement",i)}if(this.token===this.tok.T_FUNCTION)return this.read_function(!0,[0,1,0]);const i=this.read_variable_declarations();return this.expectEndOfStatement(),e("static",i)}case this.tok.T_ECHO:{const t=this.node("echo"),e=this.text(),i="<?="===e||"<%="===e,s=this.next().read_function_list(this.read_expr,",");return this.expectEndOfStatement(),t(s,i)}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 i="\r"===e||"\n"===e;i&&"\n"===e&&this.lexer.yylloc.first_offset>1&&"\r"===this.lexer._input[this.lexer.yylloc.first_offset-2]&&(e="\r\n");const s=this.node("inline");return this.next(),s(t,i?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 i;this.next().expect("(")&&this.next();const s=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(),i=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(),i=this.ast.declare.MODE_BLOCK}else this.expect(";")&&this.next(),i=this.ast.declare.MODE_NONE;return t(s,e,i)}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()],i=this.text();let s=this.node("identifier");if(":"===this.next().token)return s=s(i),this.next(),t("label",s);s.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 i=t?this.read_top_statements():this.read_inner_statements();return 0===i.length&&this.extractDoc&&this._docs.length>this._docIndex&&i.push(this.node("noop")()),this.expect("}")&&this.next(),e(null,i)}};v.read_top_statements,v.read_top_statement,v.read_inner_statements,v.read_const_list,v.read_declare_list,v.read_inner_statement,v.read_statement,v.read_code_block;var R={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 i=":"===this.token;return t(e,this.read_switch_case_list(),i)},read_switch_case_list:function(){let t=null;const e=this.node("block"),i=[];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;)i.push(this.read_case_list(t));return 0===i.length&&this.extractDoc&&this._docs.length>this._docIndex&&i.push(this.node("noop")()),this.expect(t)&&this.next(),t===this.tok.T_ENDSWITCH&&this.expectEndOfStatement(),e(null,i)},read_case_list:function(t){const e=this.node("case");let i=null;this.token===this.tok.T_CASE?i=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 s=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(i,s(null,n))}};R.read_switch,R.read_switch_case_list,R.read_case_list;var w={read_try:function(){this.expect(this.tok.T_TRY);const t=this.node("try");let e=null;const i=[],s=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 s=null;(this.version<800||this.token===this.tok.T_VARIABLE)&&(s=this.read_variable(!0,!1)),this.expect(")"),i.push(t(this.next().read_statement(),e,s))}return this.token===this.tok.T_FINALLY&&(e=this.next().read_statement()),t(s,i,e)}};w.read_try;var D={read_short_form:function(t){const e=this.node("block"),i=[];for(this.expect(":")&&this.next();this.token!=this.EOF&&this.token!==t;)i.push(this.read_inner_statement());return 0===i.length&&this.extractDoc&&this._docs.length>this._docIndex&&i.push(this.node("noop")()),this.expect(t)&&this.next(),this.expectEndOfStatement(),e(null,i)},read_function_list:function(t,e){const i=[];do{if(this.token==e&&this.version>=703&&i.length>0){i.push(this.node("noop")());break}if(i.push(t.apply(this,[])),this.token!=e)break;if(")"==this.next().token&&this.version>=703)break}while(this.token!=this.EOF);return i},read_list:function(t,e,i){const s=[];if(this.token==e&&(i&&s.push("function"==typeof t?this.node("noop")():null),this.next()),"function"==typeof t)do{const i=t.apply(this,[]);if(i&&s.push(i),this.token!=e)break}while(this.next().token!=this.EOF);else{if(!this.expect(t))return[];for(s.push(this.text());this.next().token!=this.EOF&&this.token==e&&this.next().token==t;)s.push(this.text())}return s},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 i=t();return i&&(this.ast.swapLocations(i,e,i,this),i.byref=!0),i},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}};D.read_short_form,D.read_function_list,D.read_list,D.read_name_list,D.read_byref,D.read_variable_declarations,D.read_extends_from,D.read_interface_extends_list,D.read_implements_list;var P={read_variable:function(t,e){let i;if("&"===this.token)return this.read_byref(this.read_variable.bind(this,t,e));if(this.is([this.tok.T_VARIABLE,"$"]))i=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])){i=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?i=t.destroy(i("boolean",!0,t.name)):"false"===e?i=t.destroy(i("boolean",!1,t.name)):"null"===e?i=t.destroy(i("nullkeyword",t.name)):(i.destroy(t),i=t)}else i.destroy(t),i=t}else if(this.token===this.tok.T_STATIC){i=this.node("staticreference");const t=this.text();this.next(),i=i(t)}else this.expect("VARIABLE");return this.token===this.tok.T_DOUBLE_COLON&&(i=this.read_static_getter(i,e)),this.recursive_variable_chain_scan(i,t,e)},read_static_getter:function(t,e){const i=this.node("staticlookup");let s,n;return this.next().is([this.tok.T_VARIABLE,"$"])?s=this.read_reference_variable(e):this.token===this.tok.T_STRING||this.token===this.tok.T_CLASS||this.version>=700&&this.is("IDENTIFIER")?(s=this.node("identifier"),n=this.text(),this.next(),s=s(n)):"{"===this.token?(s=this.node("literal"),n=this.next().read_expr(),this.expect("}")&&this.next(),s=s("literal",n,null),this.expect("(")):(this.error([this.tok.T_VARIABLE,this.tok.T_STRING]),s=this.node("identifier"),n=this.text(),this.next(),s=s(n)),i(t,s)},read_what:function(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=null,i=null;switch(this.next().token){case this.tok.T_STRING:e=this.node("identifier"),i=this.text(),this.next(),e=e(i),t&&this.token===this.tok.T_OBJECT_OPERATOR&&this.error();break;case this.tok.T_VARIABLE:e=this.node("variable"),i=this.text().substring(1),this.next(),e=e(i,!1);break;case"$":e=this.node(),this.next().expect(["$","{",this.tok.T_VARIABLE]),"{"===this.token?(i=this.next().read_expr(),this.expect("}")&&this.next(),e=e("variable",i,!0)):(i=this.read_expr(),e=e("variable",i,!1));break;case"{":e=this.node("encapsedpart"),i=this.next().read_expr(),this.expect("}")&&this.next(),e=e(i,"complex",!1);break;default:this.error([this.tok.T_STRING,this.tok.T_VARIABLE,"$","{"]),e=this.node("identifier"),i=this.text(),this.next(),e=e(i)}return e},recursive_variable_chain_scan:function(t,e,i){let s,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(s=this.node("offsetlookup"),this.next(),n=!1,i)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=s(t,n);break}case this.tok.T_DOUBLE_COLON:"staticlookup"===t.kind&&"identifier"===t.offset.kind&&this.error(),s=this.node("staticlookup"),t=s(t,this.read_what(!0));break;case this.tok.T_OBJECT_OPERATOR:s=this.node("propertylookup"),t=s(t,this.read_what());break;case this.tok.T_NULLSAFE_OBJECT_OPERATOR:s=this.node("nullsafepropertylookup"),t=s(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,i=this.read_simple_variable();for(;this.token!=this.EOF;){const s=this.node();if("{"!=this.token||t){s.destroy();break}e=this.next().read_expr(),this.expect("}")&&this.next(),i=s("offsetlookup",i,e)}return i},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 i=this.node("variable");this.next(),e=e(i(t,!1),!1);break}default:this.error(["{","$",this.tok.T_VARIABLE]),t=this.text(),this.next(),e=e(t,!1)}return e}};function U(t){return"."!=t&&","!=t&&!isNaN(parseFloat(t))&&isFinite(t)}P.read_variable,P.read_static_getter,P.read_what,P.recursive_variable_chain_scan,P.read_encaps_var_offset,P.read_reference_variable,P.read_simple_variable;const M=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 i=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(i)),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(i)),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(i)),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(i)),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(i)),EOS:new Map([";",this.EOF,this.tok.T_INLINE_HTML].map(i)),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(i))}};M.prototype.getTokenName=function(t){return U(t)?t==this.EOF?"the end of file (EOF)":this.lexer.engine.tokens.values[t]:"'"+t+"'"},M.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 i=this.node("program"),s=[];for(this.next();this.token!=this.EOF;)s.push(this.read_start());0===s.length&&this.extractDoc&&this._docs.length>this._docIndex&&s.push(this.node("noop")()),this.prev=[this.lexer.yylloc.last_line,this.lexer.yylloc.last_column,this.lexer.offset];const n=i(s,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},M.prototype.raiseError=function(t,e,i,s){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,s,this.lexer.yylloc.first_line,i);return this._errors.push(n),n},M.prototype.error=function(t){let e="Parse Error : syntax error",i=this.getTokenName(this.token),s="";if(this.token!==this.EOF){if(U(this.token)){let t=this.text();t.length>10&&(t=t.substring(0,7)+"..."),i="'"+t+"' ("+i+")"}e+=", unexpected "+i}return t&&!Array.isArray(t)&&((U(t)||1===t.length)&&(s=", expecting "+this.getTokenName(t)),e+=s),this.raiseError(e,s,t,i)},M.prototype.position=function(){return new m(this.lexer.yylloc.first_line,this.lexer.yylloc.first_column,this.lexer.yylloc.first_offset)},M.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 i=this.ast.prepare(t,e,this);return i.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),i}return this.ast.prepare(t,null,this)},M.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 B=["parser.next","parser.node","parser.showlog"];M.prototype.showlog=function(){const t=(new Error).stack.split("\n");let e;for(let i=2;i<t.length;i++){e=t[i].trim();let s=!1;for(let t=0;t<B.length;t++)if(e.substring(3,3+B[t].length)===B[t]){s=!0;break}if(!s)break}return console.log("Line "+this.lexer.yylloc.first_line+" : "+this.getTokenName(this.token)+">"+this.lexer.yytext+"< @--\x3e"+e),this},M.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},M.prototype.text=function(){return this.lexer.yytext},M.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},M.prototype.peek=function(){const t=this.lexer.getState(),e=this.lexer.lex();return this.lexer.setState(t),e},M.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},M.prototype.is=function(t){return Array.isArray(t)?-1!==t.indexOf(this.token):this.entries[t].has(this.token)},[x,E,y,A,g,N,C,L,b,I,O,v,R,w,D,P].forEach((function(t){for(const e in t){if(Object.prototype.hasOwnProperty.call(M.prototype,e))throw new Error("Function "+e+" is already defined - collision");M.prototype[e]=t[e]}}));var F=M;const H={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},G={values:Object.entries(H).reduce(((t,e)=>{let[i,s]=e;return{...t,[s]:i}}),{}),names:H};var V=Object.freeze(G);var Q=function(t,e,i){this.source=t,this.start=e,this.end=i};const W=function(t,e,i){this.kind=t,e&&(this.leadingComments=e),i&&(this.loc=i)};W.prototype.setTrailingComments=function(t){this.trailingComments=t},W.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},W.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},W.extends=function(t,e){return e.prototype=Object.create(this.prototype),e.extends=this.extends,e.prototype.constructor=e,e.kind=t,e};var Y=W;const $="expression";var j=Y.extends($,(function(t,e,i){Y.apply(this,[t||$,e,i])}));const z="array";var K=j.extends(z,(function(t,e,i,s){j.apply(this,[z,i,s]),this.items=e,this.shortForm=t}));const X="arrowfunc";var q=j.extends(X,(function(t,e,i,s,n,r,o,h){j.apply(this,[X,o,h]),this.arguments=t,this.byref=e,this.body=i,this.type=s,this.nullable=n,this.isStatic=r||!1}));const J="assign";var Z=j.extends(J,(function(t,e,i,s,n){j.apply(this,[J,s,n]),this.left=t,this.right=e,this.operator=i}));const tt="assignref";var et=j.extends(tt,(function(t,e,i,s){j.apply(this,[tt,i,s]),this.left=t,this.right=e}));const it="attribute";var st=Y.extends(it,(function(t,e,i,s){Y.apply(this,[it,i,s]),this.name=t,this.args=e}));const nt="attrgroup";var rt=Y.extends(nt,(function(t,e,i){Y.apply(this,[nt,e,i]),this.attrs=t||[]}));const ot="operation";var ht=j.extends(ot,(function(t,e,i){j.apply(this,[t||ot,e,i])}));var at=ht.extends("bin",(function(t,e,i,s,n){ht.apply(this,["bin",s,n]),this.type=t,this.left=e,this.right=i}));const ct="statement";var lt=Y.extends(ct,(function(t,e,i){Y.apply(this,[t||ct,e,i])}));const _t="block";var ut=lt.extends(_t,(function(t,e,i,s){lt.apply(this,[t||_t,i,s]),this.children=e.filter(Boolean)}));const dt="literal";var pt=j.extends(dt,(function(t,e,i,s,n){j.apply(this,[t||dt,s,n]),this.value=e,i&&(this.raw=i)}));const ft="boolean";var kt=pt.extends(ft,(function(t,e,i,s){pt.apply(this,[ft,t,e,i,s])}));const Tt="break";var mt=lt.extends(Tt,(function(t,e,i){lt.apply(this,[Tt,e,i]),this.level=t}));const xt="byref";var Et=j.extends(xt,(function(t,e,i){j.apply(this,[xt,e,i]),this.what=t}));const yt="call";var At=j.extends(yt,(function(t,e,i,s){j.apply(this,[yt,i,s]),this.what=t,this.arguments=e}));const gt="case";var Nt=lt.extends(gt,(function(t,e,i,s){lt.apply(this,[gt,i,s]),this.test=t,this.body=e}));const Ct="cast";var Lt=ht.extends(Ct,(function(t,e,i,s,n){ht.apply(this,[Ct,s,n]),this.type=t,this.raw=e,this.expr=i}));const bt="catch";var It=lt.extends(bt,(function(t,e,i,s,n){lt.apply(this,[bt,s,n]),this.body=t,this.what=e,this.variable=i}));const St="declaration",Ot=lt.extends(St,(function(t,e,i,s){lt.apply(this,[t||St,i,s]),this.name=e}));Ot.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 vt=Ot;const Rt="class";var wt=vt.extends(Rt,(function(t,e,i,s,n,r,o){vt.apply(this,[Rt,t,r,o]),this.isAnonymous=!t,this.extends=e,this.implements=i,this.body=s,this.attrGroups=[],this.parseFlags(n)}));const Dt="constantstatement";var Pt=lt.extends(Dt,(function(t,e,i,s){lt.apply(this,[t||Dt,i,s]),this.constants=e}));const Ut="classconstant",Mt=Pt.extends(Ut,(function(t,e,i,s,n,r){Pt.apply(this,[t||Ut,e,n,r]),this.parseFlags(i),this.attrGroups=s}));Mt.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 Bt=Mt;const Ft="clone";var Ht=j.extends(Ft,(function(t,e,i){j.apply(this,[Ft,e,i]),this.what=t}));const Gt="closure";var Vt=j.extends(Gt,(function(t,e,i,s,n,r,o,h){j.apply(this,[Gt,o,h]),this.uses=i,this.arguments=t,this.byref=e,this.type=s,this.nullable=n,this.isStatic=r||!1,this.body=null,this.attrGroups=[]})),Qt=Y.extends("comment",(function(t,e,i,s){Y.apply(this,[t,i,s]),this.value=e}));const Wt="commentblock";var Yt=Qt.extends(Wt,(function(t,e,i){Qt.apply(this,[Wt,t,e,i])}));const $t="commentline";var jt=Qt.extends($t,(function(t,e,i){Qt.apply(this,[$t,t,e,i])}));const zt="constant";var Kt=Y.extends(zt,(function(t,e,i,s){Y.apply(this,[zt,i,s]),this.name=t,this.value=e}));const Xt="continue";var qt=lt.extends(Xt,(function(t,e,i){lt.apply(this,[Xt,e,i]),this.level=t}));const Jt="declare",Zt=ut.extends(Jt,(function(t,e,i,s,n){ut.apply(this,[Jt,e,s,n]),this.directives=t,this.mode=i}));Zt.MODE_SHORT="short",Zt.MODE_BLOCK="block",Zt.MODE_NONE="none";var te=Zt;const ee="declaredirective";var ie=Y.extends(ee,(function(t,e,i,s){Y.apply(this,[ee,i,s]),this.key=t,this.value=e}));var se=lt.extends("do",(function(t,e,i,s){lt.apply(this,["do",i,s]),this.test=t,this.body=e}));const ne="echo";var re=lt.extends(ne,(function(t,e,i,s){lt.apply(this,[ne,i,s]),this.shortForm=e,this.expressions=t}));const oe="empty";var he=j.extends(oe,(function(t,e,i){j.apply(this,[oe,e,i]),this.expression=t}));const ae="encapsed",ce=pt.extends(ae,(function(t,e,i,s,n){pt.apply(this,[ae,t,e,s,n]),this.type=i}));ce.TYPE_STRING="string",ce.TYPE_SHELL="shell",ce.TYPE_HEREDOC="heredoc",ce.TYPE_OFFSET="offset";var le=ce;const _e="encapsedpart";var ue=j.extends(_e,(function(t,e,i,s,n){j.apply(this,[_e,s,n]),this.expression=t,this.syntax=e,this.curly=i}));const de="entry";var pe=j.extends(de,(function(t,e,i,s,n,r){j.apply(this,[de,n,r]),this.key=t,this.value=e,this.byRef=i,this.unpack=s}));const fe="enum";var ke=vt.extends(fe,(function(t,e,i,s,n,r){vt.apply(this,[fe,t,n,r]),this.valueType=e,this.implements=i,this.body=s,this.attrGroups=[]}));const Te="enumcase";var me=Y.extends(Te,(function(t,e,i,s){Y.apply(this,[Te,i,s]),this.name=t,this.value=e}));const xe="error";var Ee=Y.extends(xe,(function(t,e,i,s,n,r){Y.apply(this,[xe,n,r]),this.message=t,this.token=e,this.line=i,this.expected=s}));const ye="eval";var Ae=j.extends(ye,(function(t,e,i){j.apply(this,[ye,e,i]),this.source=t}));const ge="exit";var Ne=j.extends(ge,(function(t,e,i,s){j.apply(this,[ge,i,s]),this.expression=t,this.useDie=e}));const Ce="expressionstatement";var Le=lt.extends(Ce,(function(t,e,i){lt.apply(this,[Ce,e,i]),this.expression=t}));var be=lt.extends("for",(function(t,e,i,s,n,r,o){lt.apply(this,["for",r,o]),this.init=t,this.test=e,this.increment=i,this.shortForm=n,this.body=s}));const Ie="foreach";var Se=lt.extends(Ie,(function(t,e,i,s,n,r,o){lt.apply(this,[Ie,r,o]),this.source=t,this.key=e,this.value=i,this.shortForm=n,this.body=s}));const Oe="function";var ve=vt.extends(Oe,(function(t,e,i,s,n,r,o){vt.apply(this,[Oe,t,r,o]),this.arguments=e,this.byref=i,this.type=s,this.nullable=n,this.body=null,this.attrGroups=[]}));const Re="global";var we=lt.extends(Re,(function(t,e,i){lt.apply(this,[Re,e,i]),this.items=t}));const De="goto";var Pe=lt.extends(De,(function(t,e,i){lt.apply(this,[De,e,i]),this.label=t}));const Ue="halt";var Me=lt.extends(Ue,(function(t,e,i){lt.apply(this,[Ue,e,i]),this.after=t}));const Be="identifier",Fe=Y.extends(Be,(function(t,e,i){Y.apply(this,[Be,e,i]),this.name=t}));var He=Fe;var Ge=lt.extends("if",(function(t,e,i,s,n,r){lt.apply(this,["if",n,r]),this.test=t,this.body=e,this.alternate=i,this.shortForm=s}));const Ve="include";var Qe=j.extends(Ve,(function(t,e,i,s,n){j.apply(this,[Ve,s,n]),this.once=t,this.require=e,this.target=i}));const We="inline";var Ye=pt.extends(We,(function(t,e,i,s){pt.apply(this,[We,t,e,i,s])}));const $e="interface";var je=vt.extends($e,(function(t,e,i,s,n,r){vt.apply(this,[$e,t,n,r]),this.extends=e,this.body=i,this.attrGroups=s}));const ze="intersectiontype";var Ke=vt.extends(ze,(function(t,e,i){vt.apply(this,[ze,null,e,i]),this.types=t}));const Xe="isset";var qe=j.extends(Xe,(function(t,e,i){j.apply(this,[Xe,e,i]),this.variables=t}));const Je="label";var Ze=lt.extends(Je,(function(t,e,i){lt.apply(this,[Je,e,i]),this.name=t}));const ti="list";var ei=j.extends(ti,(function(t,e,i,s){j.apply(this,[ti,i,s]),this.items=t,this.shortForm=e}));const ii="lookup";var si=j.extends(ii,(function(t,e,i,s,n){j.apply(this,[t||ii,s,n]),this.what=e,this.offset=i}));const ni="magic";var ri=pt.extends(ni,(function(t,e,i,s){pt.apply(this,[ni,t,e,i,s])}));const oi="match";var hi=j.extends(oi,(function(t,e,i,s){j.apply(this,[oi,i,s]),this.cond=t,this.arms=e}));const ai="matcharm";var ci=j.extends(ai,(function(t,e,i,s){j.apply(this,[ai,i,s]),this.conds=t,this.body=e}));const li="method";var _i=ve.extends(li,(function(){ve.apply(this,arguments),this.kind=li}));const ui="reference";var di=Y.extends(ui,(function(t,e,i){Y.apply(this,[t||ui,e,i])}));const pi="name",fi=di.extends(pi,(function(t,e,i,s){di.apply(this,[pi,i,s]),this.name=t.replace(/\\$/,""),this.resolution=e}));fi.UNQUALIFIED_NAME="uqn",fi.QUALIFIED_NAME="qn",fi.FULL_QUALIFIED_NAME="fqn",fi.RELATIVE_NAME="rn";var ki=fi;const Ti="namespace";var mi=ut.extends(Ti,(function(t,e,i,s,n){ut.apply(this,[Ti,e,s,n]),this.name=t,this.withBrackets=i||!1}));const xi="namedargument";var Ei=j.extends(xi,(function(t,e,i,s){j.apply(this,[xi,i,s]),this.name=t,this.value=e}));var yi=j.extends("new",(function(t,e,i,s){j.apply(this,["new",i,s]),this.what=t,this.arguments=e}));const Ai="noop";var gi=Y.extends(Ai,(function(t,e){Y.apply(this,[Ai,t,e])}));const Ni="nowdoc";var Ci=pt.extends(Ni,(function(t,e,i,s,n){pt.apply(this,[Ni,t,e,s,n]),this.label=i}));const Li="nullkeyword";var bi=Y.extends(Li,(function(t,e,i){Y.apply(this,[Li,e,i]),this.raw=t}));const Ii="nullsafepropertylookup";var Si=si.extends(Ii,(function(t,e,i,s){si.apply(this,[Ii,t,e,i,s])}));const Oi="number";var vi=pt.extends(Oi,(function(t,e,i,s){pt.apply(this,[Oi,t,e,i,s])}));const Ri="offsetlookup";var wi=si.extends(Ri,(function(t,e,i,s){si.apply(this,[Ri,t,e,i,s])}));const Di="parameter";var Pi=vt.extends(Di,(function(t,e,i,s,n,r,o,h,a,c){vt.apply(this,[Di,t,a,c]),this.value=i,this.type=e,this.byref=s,this.variadic=n,this.readonly=r,this.nullable=o,this.flags=h||0,this.attrGroups=[]}));const Ui="parentreference";var Mi=di.extends(Ui,(function(t,e,i){di.apply(this,[Ui,e,i]),this.raw=t}));const Bi="post";var Fi=ht.extends(Bi,(function(t,e,i,s){ht.apply(this,[Bi,i,s]),this.type=t,this.what=e}));var Hi=ht.extends("pre",(function(t,e,i,s){ht.apply(this,["pre",i,s]),this.type=t,this.what=e}));const Gi="print";var Vi=j.extends(Gi,(function(t,e,i){j.apply(this,[Gi,e,i]),this.expression=t}));const Qi="program";var Wi=ut.extends(Qi,(function(t,e,i,s,n,r){ut.apply(this,[Qi,t,n,r]),this.errors=e,i&&(this.comments=i),s&&(this.tokens=s)}));const Yi="property";var $i=lt.extends(Yi,(function(t,e,i,s,n,r,o,h){lt.apply(this,[Yi,o,h]),this.name=t,this.value=e,this.readonly=i,this.nullable=s,this.type=n,this.attrGroups=r}));const ji="propertylookup";var zi=si.extends(ji,(function(t,e,i,s){si.apply(this,[ji,t,e,i,s])}));const Ki="propertystatement",Xi=lt.extends(Ki,(function(t,e,i,s,n){lt.apply(this,[Ki,s,n]),this.properties=e,this.parseFlags(i)}));Xi.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 qi=Xi;const Ji="retif";var Zi=j.extends(Ji,(function(t,e,i,s,n){j.apply(this,[Ji,s,n]),this.test=t,this.trueExpr=e,this.falseExpr=i}));const ts="return";var es=lt.extends(ts,(function(t,e,i){lt.apply(this,[ts,e,i]),this.expr=t}));const is="selfreference";var ss=di.extends(is,(function(t,e,i){di.apply(this,[is,e,i]),this.raw=t}));const ns="silent";var rs=j.extends(ns,(function(t,e,i){j.apply(this,[ns,e,i]),this.expr=t}));const os="static";var hs=lt.extends(os,(function(t,e,i){lt.apply(this,[os,e,i]),this.variables=t}));const as="staticvariable";var cs=Y.extends(as,(function(t,e,i,s){Y.apply(this,[as,i,s]),this.variable=t,this.defaultValue=e}));const ls="staticlookup";var _s=si.extends(ls,(function(t,e,i,s){si.apply(this,[ls,t,e,i,s])}));const us="staticreference";var ds=di.extends(us,(function(t,e,i){di.apply(this,[us,e,i]),this.raw=t}));const ps="string";var fs=pt.extends(ps,(function(t,e,i,s,n,r){pt.apply(this,[ps,e,s,n,r]),this.unicode=i,this.isDoubleQuote=t}));const ks="switch";var Ts=lt.extends(ks,(function(t,e,i,s,n){lt.apply(this,[ks,s,n]),this.test=t,this.body=e,this.shortForm=i}));const ms="throw";var xs=lt.extends(ms,(function(t,e,i){lt.apply(this,[ms,e,i]),this.what=t}));const Es="trait";var ys=vt.extends(Es,(function(t,e,i,s){vt.apply(this,[Es,t,i,s]),this.body=e}));const As="traitalias";var gs=Y.extends(As,(function(t,e,i,s,n,r){Y.apply(this,[As,n,r]),this.trait=t,this.method=e,this.as=i,this.visibility="",s&&(0===s[0]?this.visibility="public":1===s[0]?this.visibility="protected":2===s[0]&&(this.visibility="private"))}));const Ns="traitprecedence";var Cs=Y.extends(Ns,(function(t,e,i,s,n){Y.apply(this,[Ns,s,n]),this.trait=t,this.method=e,this.instead=i}));const Ls="traituse";var bs=Y.extends(Ls,(function(t,e,i,s){Y.apply(this,[Ls,i,s]),this.traits=t,this.adaptations=e}));var Is=lt.extends("try",(function(t,e,i,s,n){lt.apply(this,["try",s,n]),this.body=t,this.catches=e,this.always=i}));const Ss="typereference",Os=di.extends(Ss,(function(t,e,i,s){di.apply(this,[Ss,i,s]),this.name=t,this.raw=e}));Os.types=["int","float","string","bool","object","array","callable","iterable","void","static"];var vs=Os;const Rs="unary";var ws=ht.extends(Rs,(function(t,e,i,s){ht.apply(this,[Rs,i,s]),this.type=t,this.what=e}));const Ds="uniontype";var Ps=vt.extends(Ds,(function(t,e,i){vt.apply(this,[Ds,null,e,i]),this.types=t}));const Us="unset";var Ms=lt.extends(Us,(function(t,e,i){lt.apply(this,[Us,e,i]),this.variables=t}));const Bs="usegroup";var Fs=lt.extends(Bs,(function(t,e,i,s,n){lt.apply(this,[Bs,s,n]),this.name=t,this.type=e,this.items=i}));const Hs="useitem",Gs=lt.extends(Hs,(function(t,e,i,s,n){lt.apply(this,[Hs,s,n]),this.name=t,this.alias=e,this.type=i}));Gs.TYPE_CONST="const",Gs.TYPE_FUNCTION="function";var Vs=Gs;const Qs="variable";var Ws=j.extends(Qs,(function(t,e,i,s){j.apply(this,[Qs,i,s]),this.name=t,this.curly=e||!1}));const Ys="variadic";var $s=j.extends(Ys,(function(t,e,i){j.apply(this,[Ys,e,i]),this.what=t}));const js="variadicplaceholder";var zs=Y.extends(js,(function(t,e){Y.apply(this,[js,t,e])}));const Ks="while";var Xs=lt.extends(Ks,(function(t,e,i,s,n){lt.apply(this,[Ks,s,n]),this.test=t,this.body=e,this.shortForm=i}));const qs="yield";var Js=j.extends(qs,(function(t,e,i,s){j.apply(this,[qs,i,s]),this.value=t,this.key=e}));const Zs="yieldfrom";var tn=j.extends(Zs,(function(t,e,i){j.apply(this,[Zs,e,i]),this.value=t}));const en=function(t,e){this.withPositions=t,this.withSource=e};en.precedence={},[["or"],["xor"],["and"],["="],["?"],["??"],["||"],["&&"],["|"],["^"],["&"],["==","!=","===","!==","<=>"],["<","<=",">",">="],["<<",">>"],["+","-","."],["*","/","%"],["!"],["instanceof"],["cast","silent"],["**"]].forEach((function(t,e){t.forEach((function(t){en.precedence[t]=e+1}))})),en.prototype.isRightAssociative=function(t){return"**"===t||"??"===t},en.prototype.swapLocations=function(t,e,i,s){this.withPositions&&(t.loc.start=e.loc.start,t.loc.end=i.loc.end,this.withSource&&(t.loc.source=s.lexer._input.substring(t.loc.start.offset,t.loc.end.offset)))},en.prototype.resolveLocations=function(t,e,i,s){this.withPositions&&(t.loc.start.offset>e.loc.start.offset&&(t.loc.start=e.loc.start),t.loc.end.offset<i.loc.end.offset&&(t.loc.end=i.loc.end),this.withSource&&(t.loc.source=s.lexer._input.substring(t.loc.start.offset,t.loc.end.offset)))},en.prototype.resolvePrecedence=function(t,e){let i,s,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?(s=en.precedence[t.type],n=en.precedence[t.right.type],s&&n&&n<=s&&(t.type!==t.right.type||!this.isRightAssociative(t.type))&&(i=t.right,t.right=t.right.left,this.swapLocations(t,t.left,t.right,e),i.left=this.resolvePrecedence(t,e),this.swapLocations(i,i.left,i.right,e),t=i)):"retif"===t.right.kind&&(s=en.precedence[t.type],n=en.precedence["?"],s&&n&&n<=s&&(i=t.right,t.right=t.right.test,this.swapLocations(t,t.left,t.right,e),i.test=this.resolvePrecedence(t,e),this.swapLocations(i,i.test,i.falseExpr,e),t=i))):"silent"!==t.kind&&"cast"!==t.kind||!t.expr||t.expr.parenthesizedExpression?"unary"===t.kind?t.what&&!t.what.parenthesizedExpression&&("bin"===t.what.kind?(i=t.what,t.what=t.what.left,this.swapLocations(t,t,t.what,e),i.left=this.resolvePrecedence(t,e),this.swapLocations(i,i.left,i.right,e),t=i):"retif"===t.what.kind&&(i=t.what,t.what=t.what.test,this.swapLocations(t,t,t.what,e),i.test=this.resolvePrecedence(t,e),this.swapLocations(i,i.test,i.falseExpr,e),t=i)):"retif"===t.kind?t.falseExpr&&"retif"===t.falseExpr.kind&&!t.falseExpr.parenthesizedExpression&&(i=t.falseExpr,t.falseExpr=i.test,this.swapLocations(t,t.test,t.falseExpr,e),i.test=this.resolvePrecedence(t,e),this.swapLocations(i,i.test,i.falseExpr,e),t=i):"assign"===t.kind?t.right&&"bin"===t.right.kind&&!t.right.parenthesizedExpression&&(s=en.precedence["="],n=en.precedence[t.right.type],s&&n&&n<s&&(i=t.right,t.right=t.right.left,i.left=t,this.swapLocations(i,i.left,t.right,e),t=i)):"expressionstatement"===t.kind&&this.swapLocations(t,t.expression,t,e):"bin"===t.expr.kind?(i=t.expr,t.expr=t.expr.left,this.swapLocations(t,t,t.expr,e),i.left=this.resolvePrecedence(t,e),this.swapLocations(i,i.left,i.right,e),t=i):"retif"===t.expr.kind&&(i=t.expr,t.expr=t.expr.test,this.swapLocations(t,t,t.expr,e),i.test=this.resolvePrecedence(t,e),this.swapLocations(i,i.test,i.falseExpr,e),t=i),t},en.prototype.prepare=function(t,e,i){let s=null;(this.withPositions||this.withSource)&&(s=i.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=i.lexer._input.substring(s.offset,i.prev[2])),o=new Q(t,s,new m(i.prev[0],i.prev[1],i.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),i.debug&&delete n.stack[r.stackUid],n.resolvePrecedence(c,i)};return i.debug&&(this.stack||(this.stack={},this.stackUid=1),this.stack[++this.stackUid]={position:s,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:i._docIndex=i._docs.length-e.length),i.debug&&delete n.stack[r.stackUid]},r},en.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},[K,q,Z,et,st,rt,at,ut,kt,mt,Et,At,Nt,Lt,It,wt,Bt,Ht,Vt,Qt,Yt,jt,Kt,Pt,qt,vt,te,ie,se,re,he,le,ue,pe,ke,me,Ee,Ae,Ne,j,Le,be,Se,ve,we,Pe,Me,He,Ge,Qe,Ye,je,Ke,qe,Ze,ei,pt,si,ri,hi,ci,_i,ki,mi,Ei,yi,Y,gi,Ci,bi,Si,vi,wi,ht,Pi,Mi,Fi,Hi,Vi,Wi,$i,zi,qi,di,Zi,es,ss,rs,lt,hs,cs,_s,ds,fs,Ts,xs,ys,gs,Cs,bs,Is,vs,ws,Ps,Ms,Fs,Vs,Ws,$s,zs,Xs,Js,tn].forEach((function(t){en.prototype[t.kind]=t}));var sn=en;function nn(t,e){const i=Object.keys(t);let s=i.length;for(;s--;){const n=i[s],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]?nn(r,e[n]):r}return e}const rn=function(t){if("function"==typeof this)return new this(t);if(this.tokens=V,this.lexer=new T(this),this.ast=new sn,this.parser=new F(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")}nn(t,this),this.lexer.version=this.parser.version}},on=function(t){return"function"==typeof t.write?t.toString():t};rn.create=function(t){return new rn(t)},rn.parseEval=function(t,e){return new rn(e).parseEval(t)},rn.prototype.parseEval=function(t){return this.lexer.mode_eval=!0,this.lexer.all_tokens=!1,t=on(t),this.parser.parse(t,"eval")},rn.parseCode=function(t,e,i){"object"!=typeof e||i||(i=e,e="unknown");return new rn(i).parseCode(t,e)},rn.prototype.parseCode=function(t,e){return this.lexer.mode_eval=!1,this.lexer.all_tokens=!1,t=on(t),this.parser.parse(t,e)},rn.tokenGetAll=function(t,e){return new rn(e).tokenGetAll(t)},rn.prototype.tokenGetAll=function(t){this.lexer.mode_eval=!1,this.lexer.all_tokens=!0,t=on(t);const e=this.lexer.EOF,i=this.tokens.values;this.lexer.setInput(t);let s=this.lexer.lex()||e;const n=[];for(;s!=e;){let t=this.lexer.yytext;Object.prototype.hasOwnProperty.call(i,s)&&(t=[i[s],t,this.lexer.yylloc.first_line]),n.push(t),s=this.lexer.lex()||e}return n};var hn=rn,an=V,cn=T,ln=sn,_n=F,un=nn,dn=rn,pn=rn;hn.tokens=an,hn.lexer=cn,hn.AST=ln,hn.parser=_n,hn.combine=un,hn.Engine=dn,hn.default=pn;var fn=function(t,e,i){const s=i&&"markdown"===i.parentParser;if(!t&&s)return"";t=t.replace(/\?>\n<\?/g,"?>\n___PSEUDO_INLINE_PLACEHOLDER___<?");const n=new hn({parser:{extractDoc:!0},ast:{withPositions:!0,withSource:!0}}),r=-1!==t.indexOf("<?php"),o=s&&!r;let h;try{h=o?n.parseEval(t):n.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 h.extra={parseAsEval:o},h.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)})),h};const{hasNewline:kn,skipEverythingButNewLine:Tn,skipNewline:mn,isNextLineEmpty:xn,isPreviousLineEmpty:En,getNextNonSpaceNonCommentCharacterIndex:yn}=s.default.util,An=s.default.version;function gn(t,e){return parseInt(An[0])>1?t[e]:t}const Nn={};function Cn(t){return Nn[t]}[["or"],["xor"],["and"],["=","+=","-=","*=","**=","/=",".=","%=","&=","|=","^=","<<=",">>="],["??"],["||"],["&&"],["|"],["^"],["&"],["==","===","!=","!==","<>","<=>"],["<",">","<=",">="],[">>","<<"],["+","-","."],["*","/","%"],["!"],["instanceof"],["++","--","~"],["**"]].forEach(((t,e)=>{t.forEach((t=>{Nn[t]=e}))}));const Ln=["==","!=","===","!==","<>","<=>"],bn=["*","/","%"],In=[">>","<<"];function Sn(t){return["block","program","namespace","class","enum","interface","trait","traituse","declare"].includes(t.kind)}function On(t){let{body:e}=t;return e?("block"===e.kind&&(e=e.children),e[0]):null}function vn(t){const e=t.children||t.body||t.adaptations;return Array.isArray(e)?e:null}function Rn(t){const e=t.getParentNode();return e?vn(e):null}function wn(t){return t.length>0?t[t.length-1]:null}function Dn(t){const e=t.getValue();if("program"===e.kind){const t=vn(e);return!(!t||0===t.length)&&"inline"===t[0].kind}if("switch"===e.kind){if(!e.body)return!1;const t=vn(e.body);if(0===t.length)return!1;const[i]=t;if(!i.body)return!1;const s=vn(i.body);return 0!==s.length&&"inline"===s[0].kind}const i=On(e);return!!i&&"inline"===i.kind}const Pn=["__construct","__destruct","__call","__callStatic","__get","__set","__isset","__unset","__sleep","__wakeup","__toString","__invoke","__set_state","__clone","__debugInfo"].reduce(((t,e)=>(t[e.toLowerCase()]=e,t)),{});var Un={printNumber:function(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)/,"")},getPrecedence:Cn,isBitwiseOperator:function(t){return!!In[t]||"|"===t||"^"===t||"&"===t},shouldFlatten:function(t,e){return Cn(e)===Cn(t)&&("**"!==t&&((!Ln.includes(t)||!Ln.includes(e))&&(!("%"===e&&bn.includes(t)||"%"===t&&bn.includes(e))&&((e===t||!bn.includes(e)||!bn.includes(t))&&(!In.includes(t)||!In.includes(e))))))},nodeHasStatement:Sn,getNodeListProperty:vn,getParentNodeListProperty:Rn,getLast:wn,getPenultimate:function(t){return t.length>1?t[t.length-2]:null},isLastStatement:function(t){const e=Rn(t);if(!e)return!0;const i=t.getValue();return e[e.length-1]===i},getBodyFirstChild:On,lineShouldEndWithSemicolon:function(t){const e=t.getValue(),i=t.getParentNode();if(!i)return!1;if(["for","foreach","while","do","if","switch"].includes(i.kind)&&"block"!==e.kind&&"if"!==e.kind&&(i.body===e||i.alternate===e))return!0;if(!Sn(i))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 e=t.getParentNode();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)},fileShouldEndWithHardline:function(t){const e=t.getValue(),i="program"===e.kind,s=e.children&&wn(e.children);if(!i)return!1;if(s&&["halt","inline"].includes(s.kind))return!1;if(s&&("declare"===s.kind||"namespace"===s.kind)){const t=s.children.length>0&&wn(s.children);if(t&&["halt","inline"].includes(t.kind))return!1}return!0},maybeStripLeadingSlashFromUse:function(t){const e=t.replace(/^\\/,"");return-1!==e.indexOf("\\")?e:t},hasDanglingComments:function(t){return t.comments&&t.comments.some((t=>!t.leading&&!t.trailing))},hasLeadingComment:function(t){return t.comments&&t.comments.some((t=>t.leading))},hasTrailingComment:function(t){return t.comments&&t.comments.some((t=>t.trailing))},docShouldHaveTrailingNewline:function t(e){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const s=e.getNode(i),n=e.getNode(i+1),r=e.getNode(i+2);if(!n)return!1;if(r&&["call","new","echo"].includes(r.kind)&&!["call","array"].includes(n.kind)||"parameter"===n.kind){const t=r.arguments.length-1;return r.arguments.indexOf(n)!==t}if(r&&"for"===r.kind){const t=r.init.indexOf(n);if(-1!==t)return t!==r.init.length-1;const e=r.test.indexOf(n);if(-1!==e)return e!==r.test.length-1;const i=r.increment.indexOf(n);if(-1!==i)return i!==r.increment.length-1}if("bin"===n.kind)return n.left===s||t(e,i+1);if("case"===n.kind&&n.test===s)return!0;if("staticvariable"===n.kind){const t=r.variables.length-1;return r.variables.indexOf(n)!==t}if("entry"===n.kind){if(n.key===s)return!0;const t=r.items.length-1;return r.items.indexOf(n)!==t}if(["call","new"].includes(n.kind)){const t=n.arguments.length-1;return n.arguments.indexOf(s)!==t}if("echo"===n.kind){const t=n.expressions.length-1;return n.expressions.indexOf(s)!==t}if("array"===n.kind){const t=n.items.length-1;return n.items.indexOf(s)!==t}return"retif"===n.kind&&t(e,i+1)},isLookupNode:function(t){return"propertylookup"===t.kind||"nullsafepropertylookup"===t.kind||"staticlookup"===t.kind||"offsetlookup"===t.kind},isFirstChildrenInlineNode:Dn,shouldPrintHardLineAfterStartInControlStructure:function(t){const e=t.getValue();return!["try","catch"].includes(e.kind)&&Dn(t)},shouldPrintHardLineBeforeEndInControlStructure:function(t){const e=t.getValue();if(["try","catch"].includes(e.kind))return!0;if("switch"===e.kind){const t=vn(e.body);if(0===t.length)return!0;const i=wn(t);if(!i.body)return!0;const s=vn(i.body);return 0===s.length||"inline"!==s[0].kind}return!Dn(t)},getAlignment:function(t){const e=t.split("\n").pop();return e.length-e.trimLeft().length+1},isProgramLikeNode:function(t){return["program","declare","namespace"].includes(t.kind)},isReferenceLikeNode:function(t){return["name","parentreference","selfreference","staticreference"].includes(t.kind)},getNodeKindIncludingLogical:function(t){return"bin"===t.kind&&["||","&&"].includes(t.type)?"logical":t.kind},useDoubleQuote: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},hasEmptyBody:function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"body";const i=t.getValue();return i[e]&&i[e].children&&0===i[e].children.length&&(!i[e].comments||0===i[e].comments.length)},isNextLineEmptyAfterNamespace:function(t,e,i){let s=i(e);return s=Tn(t,s),s=mn(t,s),kn(t,s)},shouldPrintHardlineBeforeTrailingComma:function(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)},isDocNode:function(t){return"nowdoc"===t.kind||"encapsed"===t.kind&&"heredoc"===t.type},getAncestorNode:function(t,e){const i=function(t,e){const i=[].concat(e);let s,n=-1;for(;s=t.getParentNode(++n);)if(-1!==i.indexOf(s.kind))return n;return-1}(t,e);return-1===i?null:t.getParentNode(i)},getNextNode:function(t,e){const i=t.getParentNode(),s=vn(i);if(!s)return null;const n=s.indexOf(e);return-1===n?null:i.children[n+1]},normalizeMagicMethodName:function(t){const e=t.toLowerCase();return Pn[e]?Pn[e]:t},isPreviousLineEmpty:function(t,e,i){return En(t,e,gn(i,"locStart"))},isNextLineEmpty:function(t,e,i){return xn(t,e,gn(i,"locEnd"))},getNextNonSpaceNonCommentCharacterIndex:function(t,e,i){return yn(t,e,gn(i,"locEnd"))}};const{addLeadingComment:Mn,addDanglingComment:Bn,addTrailingComment:Fn,skipNewline:Hn,hasNewline:Gn,hasNewlineInRange:Vn}=s.default.util,{join:Qn,indent:Wn,hardline:Yn,cursor:$n,lineSuffix:jn,breakParent:zn}=s.default.doc.builders,{getNextNonSpaceNonCommentCharacterIndex:Kn,isNextLineEmpty:Xn,isPreviousLineEmpty:qn,isLookupNode:Jn}=Un;function Zn(t,e){const{children:i}=t;0===i.length?Bn(t,e):Mn(i[0],e)}function tr(t,e){"block"===t.kind?Zn(t,e):Mn(t,e)}function er(t,e,i,s,n,r){const o=Kn(t,n,r),h=t.charAt(o);return e&&"identifier"===e.kind&&i&&("function"===i.kind||"method"===i.kind)&&")"===h?(Fn(i,n),!0):!(!i||"function"!==i.kind&&"method"!==i.kind||!s||"block"!==s.kind)&&(Zn(s,n),!0)}function ir(t,e,i,s,n,r){if(!i||"if"!==i.kind||!s)return!1;const o=Kn(t,n,r);return")"===t.charAt(o)?(Fn(e,n),!0):e===i.body&&s===i.alternate?(Bn(i,n),!0):"if"===s.kind?(tr(s.body,n),!0):i.body===s&&(Mn(s,n),!0)}function sr(t,e,i){if(t&&["class","interface","trait"].includes(t.kind)){if(e&&t.extends)if(Array.isArray(t.extends)){if(t.extends.some((t=>{if(e&&e===t)return Bn(e,i),!0})))return!0}else if(e===t.extends)return Bn(e,i),!0;if(e&&t.implements&&t.implements.some((t=>{if(e&&e===t)return Bn(e,i),!0})))return!0;if(!(t.body&&t.body.length>0))return Bn(t,i),!0}return!!(e&&"class"===e.kind&&e.isAnonymous&&e.leadingComments&&"commentblock"===i.kind)}function nr(t,e,i,s,n){if(e&&("function"===e.kind||"method"===e.kind)){let i=0;for(let t=0;t<e.arguments.length;t++)i=n.locEnd(e.arguments[t])>i?n.locEnd(e.arguments[t]):i;const r=e.body&&n.locStart(s)>i&&n.locEnd(s)<n.locStart(e.body),o=Kn(t,s,n);if(e.type&&r&&")"!==t.charAt(o))return n.locEnd(s)<n.locStart(e.type)?(Bn(e.type,s),!0):(Fn(e.type,s),!0)}return!1}function rr(t,e,i,s,n){return!(!i||!["function","method","parameter"].includes(i.kind))&&("typereference"===e.kind&&"identifier"===s.kind&&(Fn(e,n),!0))}function or(t,e){return!(!t||!["label","goto"].includes(t.kind))&&(Fn(t,e),!0)}function hr(t,e,i,s){return i&&"inline"===i.kind?(i.leadingComments||(i.leadingComments=[]),i.leadingComments.includes(s)||i.leadingComments.push(s),!0):!(t||i||!e||"inline"!==e.kind)&&(Bn(e,s),!0)}function ar(t,e,i){return!(!t||"try"!==t.kind||!e)&&("block"===e.kind?(Zn(e,i),!0):"try"===e.kind?(tr(e.always,i),!0):"catch"===e.kind&&(tr(e.body,i),!0))}function cr(t,e,i,s){return i||e||!t||"namespace"!==t.kind||t.withBrackets?!(e||!t||"namespace"!==t.kind||t.withBrackets)&&(Bn(t,s),!0):(Fn(t,s),!0)}function lr(t,e,i,s){return!(!t||"declare"!==t.kind)&&((!e||"noop"!==e.kind)&&(i&&t.directives[0]!==i?!(!i||!e)&&(Mn(i,s),!0):("none"===t.mode?Fn(t,s):Bn(t,s),!0)))}function _r(t,e,i,s,n,r){if(!i||"while"!==i.kind||!s)return!1;const o=Kn(t,n,r);return")"===t.charAt(o)?(Fn(e,n),!0):"block"===s.kind&&(Zn(s,n),!0)}function ur(t,e){return t.getValue().printed=!0,e.printer.printComment(t,e)}function dr(t,e,i){return t.getNode()===e.cursorNode&&t.getValue()?[$n,i,$n]:i}var pr={handleOwnLineComment:function(t,e,i){const{precedingNode:s,enclosingNode:n,followingNode:r}=t;return er(e,s,n,r,t,i)||function(t,e,i){if(t&&Jn(t)&&e&&["identifier","variable","encapsed"].includes(e.kind))return Mn(t,i),!0;return!1}(n,r,t)||ir(e,s,n,r,t,i)||_r(e,s,n,r,t,i)||ar(n,r,t)||sr(n,r,t)||rr(e,s,n,r,t)||nr(e,n,r,t,i)||function(t,e,i,s){if(!i&&t&&("for"===t.kind||"foreach"===t.kind))return t.body&&"block"!==t.body.kind?Mn(i,s):Mn(t,s),!0;return!1}(n,0,r,t)||hr(n,s,r,t)||lr(n,s,r,t)},handleEndOfLineComment:function(t,e,i){const{precedingNode:s,enclosingNode:n,followingNode:r}=t;return function(t,e,i,s,n){if(!e&&!s&&i&&"array"===i.kind)return Fn(i,n),!0;return!1}(0,s,n,r,t)||function(t,e,i,s,n){if(i&&"return"===i.kind&&!i.expr)return Fn(i,n),!0;return!1}(0,0,n,0,t)||er(e,s,n,r,t,i)||function(t,e,i,s,n,r){const o=e&&!Vn(n,r.locEnd(e),r.locStart(s));if((!e||!o)&&t&&"retif"===t.kind&&i)return Mn(i,s),!0;return!1}(n,s,r,t,e,i)||ir(e,s,n,r,t,i)||_r(e,s,n,r,t,i)||ar(n,r,t)||sr(n,r,t)||rr(e,s,n,r,t)||nr(e,n,r,t,i)||function(t,e){if(t&&"entry"===t.kind)return Mn(t,e),!0;return!1}(n,t)||function(t,e,i){if(e&&"call"===e.kind&&t&&e.what===t&&e.arguments.length>0)return Mn(e.arguments[0],i),!0;return!1}(s,n,t)||function(t,e,i){if(t&&"assign"===t.kind&&e){const s=t.loc.start.offset+t.loc.source.indexOf("=");if(i.loc.start.offset>s)return Mn(e,i),!0}return!1}(n,r,t)||hr(n,s,r,t)||cr(n,s,r,t)||lr(n,s,r,t)||or(n,t)},handleRemainingComment:function(t,e,i){const{precedingNode:s,enclosingNode:n,followingNode:r}=t;return ir(e,s,n,r,t,i)||_r(e,s,n,r,t,i)||function(t,e,i,s){const n=Kn(t,i,s);if(")"!==t.charAt(n))return!1;if(e&&("function"===e.kind||"closure"===e.kind||"method"===e.kind||"call"===e.kind||"new"===e.kind)&&0===e.arguments.length)return Bn(e,i),!0;return!1}(e,n,t,i)||sr(n,r,t)||function(t,e,i){if(t&&"traituse"===t.kind&&t.adaptations&&!t.adaptations.length)return Bn(t,i),!0;return!1}(n,0,t)||rr(e,s,n,r,t)||nr(e,n,r,t,i)||or(n,t)||function(t,e,i,s){if(e&&"halt"===e.kind)return Bn(e,s),!0;if(t&&"halt"===t.kind)return Bn(t,s),!0;return!1}(s,n,0,t)||function(t,e){if(t&&("continue"===t.kind||"break"===t.kind)&&!t.label)return Fn(t,e),!0;return!1}(n,t)||hr(n,s,r,t)||cr(n,s,r,t)},getCommentChildNodes:function(t){return"object"!=typeof t?[]:(t=>Object.keys(t).filter((t=>"kind"!==t&&"loc"!==t&&"errors"!==t&&"extra"!==t&&"comments"!==t&&"leadingComments"!==t&&"enclosingNode"!==t&&"precedingNode"!==t&&"followingNode"!==t)).map((e=>t[e])))(t)},canAttachComment:function(t){return t.kind&&"commentblock"!==t.kind&&"commentline"!==t.kind},isBlockComment:function(t){return"commentblock"===t.kind},printDanglingComments:function(t,e,i,s){const n=[],r=t.getValue();return r&&r.comments?(t.each((t=>{const i=t.getValue();!i||i.leading||i.trailing||s&&!s(i)||n.push(ur(t,e))}),"comments"),0===n.length?"":i?Qn(Yn,n):Wn([Yn,Qn(Yn,n)])):""},hasLeadingComment:function(t){return t.comments&&t.comments.some((t=>t.leading))},hasTrailingComment:function(t){return t.comments&&t.comments.some((t=>t.trailing))},hasLeadingOwnLineComment:function(t,e,i){return e.comments&&e.comments.some((e=>e.leading&&Gn(t,i.locEnd(e))))},printComments:function(t,e){const i=[];return t.forEach(((t,s,n)=>{t.printed=!0;const r=n.length===s+1;i.push(t.value),r||i.push(Yn),Xn(e.originalText,t,e)&&!r&&i.push(Yn)})),i},printAllComments:function(t,e,i,s){const n=t.getValue(),r=e(t),o=n&&n.comments;if(!o||0===o.length)return dr(t,i,r);const h=[],a=[s?";":"",r];return t.each((t=>{const e=t.getValue(),{leading:s,trailing:n}=e;if(s){const s=function(t,e,i){const s=t.getValue(),n=ur(t,i);return n?i.printer.isBlockComment&&i.printer.isBlockComment(s)?[n,Gn(i.originalText,i.locEnd(s))?Yn:" "]:[n,Yn]:""}(t,0,i);if(!s)return;h.push(s);const n=i.originalText;Gn(n,Hn(n,i.locEnd(e)))&&h.push(Yn)}else n&&a.push(function(t,e,i){const s=t.getValue(),n=ur(t,i);if(!n)return"";const r=i.printer.isBlockComment&&i.printer.isBlockComment(s);if(Gn(i.originalText,i.locStart(s),{backwards:!0})){const t=qn(i.originalText,s,i);return jn([Yn,t?Yn:"",n])}return r?[" ",n]:[jn([" ",n]),r?"":zn]}(t,0,i))}),"comments"),dr(t,i,h.concat(a))}};function fr(){}fr.strictEqual=function(){};var kr=fr;const{getPrecedence:Tr,shouldFlatten:mr,isBitwiseOperator:xr}=Un;var Er=function(t){const e=t.getParentNode();if(!e)return!1;const i=t.getName(),s=t.getNode();if(["program","expressionstatement","namespace","declare","block","include","print","return","echo"].includes(e.kind))return!1;switch(s.kind){case"pre":case"post":if("unary"===e.kind)return"pre"===s.kind&&("+"===s.type&&"+"===e.type||"-"===s.type&&"-"===e.type);case"unary":switch(e.kind){case"unary":return s.type===e.type&&("+"===s.type||"-"===s.type);case"propertylookup":case"nullsafepropertylookup":case"staticlookup":case"offsetlookup":case"call":return"what"===i&&e.what===s;case"bin":return"**"===e.type&&"left"===i;default:return!1}case"bin":switch(e.kind){case"assign":case"retif":return["and","xor","or"].includes(s.type);case"silent":case"cast":return s.parenthesizedExpression;case"pre":case"post":case"unary":return!0;case"call":case"propertylookup":case"nullsafepropertylookup":case"staticlookup":case"offsetlookup":return"what"===i&&e.what===s;case"bin":{const t=e.type,n=Tr(t),r=s.type,o=Tr(r);return n>o||("||"===t&&"&&"===r||(n===o&&"right"===i?(kr.strictEqual(e.right,s),!0):n===o&&!mr(t,r)||(n<o&&"%"===r?"+"===t||"-"===t:!!xr(t))))}default:return!1}case"propertylookup":case"nullsafepropertylookup":case"staticlookup":return"call"===e.kind&&("what"===i&&e.what===s&&s.parenthesizedExpression);case"clone":case"new":switch(e.kind){case"propertylookup":case"nullsafepropertylookup":case"staticlookup":case"offsetlookup":case"call":return"what"===i&&e.what===s;default:return!1}case"yield":switch(e.kind){case"propertylookup":case"nullsafepropertylookup":case"staticlookup":case"offsetlookup":case"call":return"what"===i&&e.what===s;case"retif":return e.test===s;default:return!(!s.key&&!s.value)}case"assign":return("for"!==e.kind||!e.init.includes(s)&&!e.increment.includes(s))&&("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"===i&&!e.trueExpr);case"propertylookup":case"nullsafepropertylookup":case"staticlookup":case"offsetlookup":case"call":return"what"===i&&e.what===s;default:return!1}case"closure":switch(e.kind){case"call":return"what"===i&&e.what===s;case"propertylookup":case"nullsafepropertylookup":return!0;default:return!1}case"silence":case"cast":return s.parenthesizedExpression;case"string":case"array":switch(e.kind){case"propertylookup":case"nullsafepropertylookup":case"staticlookup":case"offsetlookup":case"call":return(!["string","array"].includes(s.kind)||"offsetlookup"!==e.kind)&&("what"===i&&e.what===s);default:return!1}case"print":case"include":return"bin"===e.kind}return!1};const{breakParent:yr,join:Ar,line:gr,lineSuffix:Nr,group:Cr,conditionalGroup:Lr,indent:br,dedent:Ir,ifBreak:Sr,hardline:Or,softline:vr,literalline:Rr,align:wr,dedentToRoot:Dr}=s.default.doc.builders,{willBreak:Pr}=s.default.doc.utils,{isNextLineEmptyAfterIndex:Ur,hasNewline:Mr,hasNewlineInRange:Br}=s.default.util,{getLast:Fr,getPenultimate:Hr,isLastStatement:Gr,lineShouldEndWithSemicolon:Vr,printNumber:Qr,shouldFlatten:Wr,maybeStripLeadingSlashFromUse:Yr,fileShouldEndWithHardline:$r,hasDanglingComments:jr,hasLeadingComment:zr,hasTrailingComment:Kr,docShouldHaveTrailingNewline:Xr,isLookupNode:qr,isFirstChildrenInlineNode:Jr,shouldPrintHardLineAfterStartInControlStructure:Zr,shouldPrintHardLineBeforeEndInControlStructure:to,getAlignment:eo,isProgramLikeNode:io,getNodeKindIncludingLogical:so,useDoubleQuote:no,hasEmptyBody:ro,isNextLineEmptyAfterNamespace:oo,shouldPrintHardlineBeforeTrailingComma:ho,isDocNode:ao,getAncestorNode:co,isReferenceLikeNode:lo,getNextNode:_o,normalizeMagicMethodName:uo,getNextNonSpaceNonCommentCharacterIndex:po,isNextLineEmpty:fo,isPreviousLineEmpty:ko}=Un;function To(t,e){return parseFloat(t)>=parseFloat(e)}function mo(t,e){return!!t.trailingCommaPHP&&To(t.phpVersion,e)}function xo(t){return"1tbs"!==t.braceStyle}function Eo(t,e,i){let s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return[s?"?":"","->",t.call(i,"offset")]}function yo(t,e,i){return Eo(t,e,i,!0)}function Ao(t,e,i){const s=t.getValue(),n=!["variable","identifier"].includes(s.offset.kind);return["::",n?"{":"",t.call(i,"offset"),n?"}":""]}function go(t,e,i){const s=t.getValue(),n=s.offset&&"number"===s.offset.kind||co(t,"encapsed");return["[",s.offset?Cr([br([n?"":vr,t.call(i,"offset")]),n?"":vr]):"","]"]}function No(t){return"array"===t.kind&&(t.items.length>0||t.comments)||"function"===t.kind||"method"===t.kind||"closure"===t.kind}function Co(t){const e=Fr(t),i=Hr(t);return!zr(e)&&!Kr(e)&&No(e)&&(!i||i.kind!==e.kind)}function Lo(t){if(2!==t.length)return!1;const[e,i]=t;return!(e.comments&&e.comments.length||"function"!==e.kind&&"method"!==e.kind&&"closure"!==e.kind||"retif"===i.kind||No(i))}function bo(t,e,i){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"arguments";const n=t.getValue()[s];if(0===n.length)return["(",pr.printDanglingComments(t,e,!0),")"];let r=!1,o=!1;const h=n.length-1,a=t.map(((t,s)=>{const n=t.getNode(),a=[i(t)];return s===h||(fo(e.originalText,n,e)?(0===s&&(o=!0),r=!0,a.push(",",Or,Or)):a.push(",",gr)),a}),s),c=t.getValue(),l=Fr(n),_=mo(e,"7.3")&&["call","new","unset","isset"].includes(c.kind)||mo(e,"8.0")&&["function","closure","method","arrowfunc","attribute"].includes(c.kind)?br([l&&ho(l)?Or:"",","]):"";function u(){return Cr(["(",br([gr,...a]),_,gr,")"],{shouldBreak:!0})}const d=Lo(n),p=Co(n);if(d||p){const e=(d?a.slice(1).some(Pr):a.slice(0,-1).some(Pr))||r;let h,c=0;t.each((t=>{d&&0===c&&(h=[t.call((t=>i(t,{expandFirstArg:!0}))),a.length>1?",":"",o?Or:gr,o?Or:"",a.slice(1)]),p&&c===n.length-1&&(h=[...a.slice(0,-1),t.call((t=>i(t,{expandLastArg:!0})))]),c++}),s);const l=a.some(Pr),f=["(",...h,")"];return[l?yr:"",Lr([l?Sr(u(),f):f,d?["(",Cr(h[0],{shouldBreak:!0}),...h.slice(1),")"]:["(",...a.slice(0,-1),Cr(Fr(h),{shouldBreak:!0}),")"],Cr(["(",br([gr,...a]),Sr(_),gr,")"],{shouldBreak:!0})],{shouldBreak:e})]}return Cr(["(",br([vr,...a]),Sr(_),vr,")"],{shouldBreak:a.some(Pr)||r})}function Io(t){return"array"===t.kind&&0!==t.items.length}function So(t){return"array"===t.right.kind&&0!==t.right.items.length}function Oo(t,e,i,s,n){let r=[];const o=t.getValue();if("bin"===o.kind){Wr(o.type,o.left.type)?r=r.concat(t.call((t=>Oo(t,e,i,!0,n)),"left")):r.push(t.call(e,"left"));const h=So(o)?[o.type," ",t.call(e,"right")]:[o.type,gr,t.call(e,"right")],a=t.getParentNode(),c=!(n&&["||","&&"].includes(o.type))&&so(a)!==so(o)&&so(o.left)!==so(o)&&so(o.right)!==so(o),l=ao(o.left)||"bin"===o.left.kind&&ao(o.left.right);r.push(l?"":" ",c?Cr(h):h),s&&o.comments&&(r=pr.printAllComments(t,(()=>r),i))}else r.push(t.call(e));return r}function vo(t,e,i){const s=t.getValue();switch(s.kind){case"propertylookup":return Eo(t,e,i);case"nullsafepropertylookup":return yo(t,e,i);case"staticlookup":return Ao(t,0,i);case"offsetlookup":return go(t,0,i);default:return"Have not implemented lookup kind ".concat(s.kind," yet.")}}function Ro(t){let{opening:e=!0}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("heredoc"===t.type)return e?"<<<".concat(t.label):t.label;const i={string:'"',shell:"`"};return i[t.type]?i[t.type]:"Unimplemented encapsed type ".concat(t.type)}function wo(t,e,i){const s=[];let n=[];return t.each((t=>{s.push(n),s.push(Cr(i(t))),n=[",",gr],t.getValue()&&fo(e.originalText,t.getValue(),e)&&n.push(vr)}),"items"),s}function Do(t,e){if(0===e.length)return t;let i=0;return e.reduce(((e,s)=>{const{start:n,end:r,alignment:o,before:h,after:a}=s,c=[h||"",...t.slice(n,r),a||""],l=e.concat(t.slice(i,n),o?Dr(Cr(wr(new Array(o).join(" "),c))):Cr(c),r===t.length-1?t.slice(r):"");return i=r,l}),[])}function Po(t,e,i){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"children";const n=t.getValue(),r=t.getParentNode();let o=-1;const h=[],a=[];t.map(((c,l)=>{const _=c.getValue(),u="inline"===_.kind,d=i(c),p=n[s],f=p[l+1],k=!Gr(c)&&!u&&(f&&"case"===f.kind?!Jr(t):f&&"inline"!==f.kind);let T=[d,k?Or:"",k&&fo(e.originalText,_,e)?Or:""];const m=0===l,x=p.length-1===l,E="block"===n.kind&&r&&["function","closure","method","try","catch"].includes(r.kind);let y=E&&m?"":" ";if(u||!u&&x&&o>=0){const t=o;u&&(o=l);if(u&&!m||!u&&x){const e=(u?t:o)+1,i=x&&!u?l+1:l,s=p[u?t:o],r=s?eo(s.raw):"",h=i-e>1,c=h?E&&!s||io(n)&&0===e?"":Or:"",d=h&&"halt"!==_.kind?E&&x?"":Or:"";h&&(y=""),a.push({start:e,end:i,alignment:r,before:c,after:d})}}if(u){const i=f&&"echo"===f.kind&&f.shortForm?"<?=":"<?php",s=_.leadingComments&&_.leadingComments.length?[m&&"namespace"!==n.kind&&!E?"<?php":"","namespace"!==n.kind&&E?"":Or,pr.printComments(_.leadingComments,e),Or,"?>"]:io(n)&&m&&"namespace"!==n.kind?"":[y,"?>"],r=t.getNode(l+1),o=r&&r.children&&r.children.length;T=[s,T,_.comments&&_.comments.length?[i,Or,o?pr.printComments(_.comments,e):"",Or]:io(n)&&x?"":[i," "]]}h.push(T)}),s);const c=Do(h,a);if("program"===n.kind&&!n.extra.parseAsEval){const t=[],[i]=n.children;if(!i||"inline"!==i.kind){const s=e.originalText.trim().match(/^<\?(php|=)(\s+)?\S/),r=[s&&s[2]&&s[2].includes("\n")?[Or,s[2].split("\n").length>2?Or:""]:" ",n.comments?pr.printComments(n.comments,e):""],o=i&&"echo"===i.kind&&i.shortForm;t.push([o?"<?=":"<?php",r])}t.push(c);if(/\?>\n?$/.test(e.originalText)){const i=Fr(n.children),s=i?[Br(e.originalText.trimEnd(),e.locEnd(i),e.locEnd(n))?"inline"===i.kind&&i.comments&&i.comments.length?"":Or:" ",fo(e.originalText,i,e)?Or:""]:n.comments?Or:"";t.push(Nr([s,"?>"]))}return t}return c}function Uo(t,e,i,s){return t.map((t=>{const s=[];return s.push(i(t)),Gr(t)||(s.push(Or),fo(e.originalText,t.getValue(),e)&&s.push(Or)),s}),s)}function Mo(t,e,i){let s=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.getValue(),h=jr(o[s])?[Or,t.call((t=>pr.printDanglingComments(t,e,!0)),s),Or]:n,a=Array.isArray(o[s])?Cr(Ar(",",t.map((t=>{const s=i(t);return jr(t.getValue())?[Or,pr.printDanglingComments(t,e,!0),Or,s]:[r,s]}),s))):[r,t.call(i,s)];return br([h,s,Pr(h)?br(a):a])}function Bo(t,e,i){let{inline:s=!1}=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const n=[];return t.getValue().attrGroups?(t.each((t=>{const r=["#["];!s&&n.length>0&&n.push(Or),r.push(vr),t.each((t=>{const s=t.getValue();r.length>2&&r.push(",",gr);const n=[s.name];s.args.length>0&&n.push(bo(t,e,i,"args")),r.push(Cr(n))}),"attrs"),n.push(Cr([br(r),Sr(mo(e,"8.0")?",":""),vr,"]",s?Sr(vr," "):""]))}),"attrGroups"),0===n.length?[]:[...n,s?"":Or]):[]}function Fo(t,e,i){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"body";const n=t.getValue();if(!n[s])return";";const r=t.call(i,s);return[n.shortForm?":":" {",br("block"!==n[s].kind||n[s].children&&n[s].children.length>0||n[s].comments&&n[s].comments.length>0?[Zr(t)?"switch"===n.kind?" ":"":Or,r]:""),"if"===n.kind&&"body"===s?"":[to(t)?Or:"",n.shortForm?["end",n.kind,";"]:"}"]]}function Ho(t,e,i,s,n,r,o){if(!s)return e;const h=Vo(t,s,n,r,o);return Cr([e,i,h])}function Go(t){return!!qr(t)&&(!("variable"!==t.what.kind&&!lo(t.what))||Go(t.what))}function Vo(t,e,i,s,n){const r=s?"&":"";if(pr.hasLeadingOwnLineComment(n.originalText,e,n))return br([Or,r,i]);const o="cast"===e.kind?e.expr:e;return"bin"===o.kind&&!So(o)||"retif"===o.kind&&(!o.trueExpr&&!Io(o.falseExpr)||"bin"===o.test.kind&&!So(o.test))||("variable"===t.kind||"string"===t.kind||qr(t))&&("string"===o.kind&&!Qo(o)||Go(o))?Cr(br([gr,r,i])):[" ",r,i]}function Qo(t){return t.raw.includes("\n")}function Wo(t,e,i){return("string"===t.kind||"encapsed"===t.kind&&("string"===t.type||"shell"===t.type))&&Qo(t)&&!Mr(e,i.locStart(t),{backwards:!0})}function Yo(t,e,i){return Cr(t.map(((s,n)=>0===n?[t.call(e)]:[i,t.call(e)]),"types"))}var $o=function(t,e,i){const s=t.getValue();if(!s)return"";if("string"==typeof s)return s;const n=function(t,e,i){const s=t.getValue();switch(s.kind){case"program":return Cr([Po(t,e,i),pr.printDanglingComments(t,e,!0,(t=>!t.printed))]);case"expressionstatement":return t.call(i,"expression");case"block":return[Po(t,e,i),pr.printDanglingComments(t,e,!0)];case"declare":{const n=t=>Ar(", ",t.map((t=>i(t)),"directives"));if(["block","short"].includes(s.mode))return["declare(",n(t),")","block"===s.mode?" {":":",s.children.length>0?br([Or,Po(t,e,i)]):"",pr.printDanglingComments(t,e),Or,"block"===s.mode?"}":"enddeclare;"];const r=_o(t,s);return["declare(",n(t),")",r&&"inline"===r.kind?"":";"]}case"declaredirective":return[t.call(i,"key"),"=",t.call(i,"value")];case"namespace":return["namespace ",s.name&&"string"==typeof s.name?[s.name,s.withBrackets?" ":""]:"",s.withBrackets?"{":";",jr(s)?[" ",pr.printDanglingComments(t,e,!0)]:"",s.children.length>0?s.withBrackets?br([Or,Po(t,e,i)]):["inline"===s.children[0].kind?"":[Or,oo(e.originalText,s,e.locStart)?Or:""],Po(t,e,i)]:"",s.withBrackets?[Or,"}"]:""];case"usegroup":return Cr(["use ",s.type?[s.type," "]:"",br([s.name?[Yr(s.name),"\\{",vr]:"",Ar([",",gr],t.map((t=>i(t)),"items"))]),s.name?[Sr(mo(e,"7.2")?",":""),vr,"}"]:""]);case"useitem":return[s.type?[s.type," "]:"",Yr(s.name),jr(s)?[" ",pr.printDanglingComments(t,e,!0)]:"",s.alias?[" as ",t.call(i,"alias")]:""];case"class":case"enum":case"interface":case"trait":return function(t,e,i){const s=t.getValue(),n="class"===s.kind&&s.isAnonymous,r=Bo(t,e,i,{inline:n}),o=n?[]:[...r];s.isReadonly&&o.push("readonly ");s.isFinal&&o.push("final ");s.isAbstract&&o.push("abstract ");o.push(n?"":s.kind),s.name&&o.push(" ",t.call(i,"name"));"enum"===s.kind&&s.valueType&&o.push(": ",t.call(i,"valueType"));s.extends&&s.implements?o.push(Lr([[Mo(t,e,i,"extends"),Mo(t,e,i,"implements")],[Mo(t,e,i,"extends"),Mo(t,e,i,"implements"," ",Or)],[Mo(t,e,i,"extends",Or," "),Mo(t,e,i,"implements",Or,s.implements.length>1?Or:" ")]],{shouldBreak:jr(s.extends)})):(s.extends&&o.push(Lr([Mo(t,e,i,"extends"),Mo(t,e,i,"extends"," ",Or),Mo(t,e,i,"extends",Or,s.extends.length>1?Or:" ")])),s.implements&&o.push(Lr([Mo(t,e,i,"implements"),Mo(t,e,i,"implements"," ",Or),Mo(t,e,i,"implements",Or,s.implements.length>1?Or:" ")])));const h=Cr([Cr(o),xo(e)?n?gr:Or:" "]),a=s.body&&0===s.body.length&&!jr(s),c=["{",br([a?"":Or,Uo(t,e,i,"body")]),pr.printDanglingComments(t,e,!0),n&&a?vr:Or,"}"];return[h,c]}(t,e,i);case"traitprecedence":return[t.call(i,"trait"),"::",t.call(i,"method")," insteadof ",Ar(", ",t.map(i,"instead"))];case"traitalias":return[s.trait?[t.call(i,"trait"),"::"]:"",s.method?t.call(i,"method"):""," as ",Ar(" ",[...s.visibility?[s.visibility]:[],...s.as?[t.call(i,"as")]:[]])];case"traituse":return Cr(["use ",br(Cr(Ar([",",gr],t.map(i,"traits")))),s.adaptations?[" {",s.adaptations.length>0?[br([Or,Uo(t,e,i,"adaptations")]),Or]:jr(s)?[gr,pr.printDanglingComments(t,e,!0),gr]:"","}"]:""]);case"function":case"closure":case"method":return function(t,e,i){const s=t.getValue(),n=Bo(t,e,i,{inline:"closure"===s.kind}),r=[];s.isFinal&&r.push("final ");s.isAbstract&&r.push("abstract ");s.visibility&&r.push(s.visibility," ");s.isStatic&&r.push("static ");r.push("function "),s.byref&&r.push("&");s.name&&r.push(t.call(i,"name"));r.push(bo(t,e,i)),s.uses&&s.uses.length>0&&r.push(Cr([" use ",bo(t,e,i,"uses")]));s.type&&r.push([": ",jr(s.type)?[t.call((t=>pr.printDanglingComments(t,e,!0)),"type")," "]:"",s.nullable?"?":"",t.call(i,"type")]);const o=r;if(!s.body)return[...n,o];const h="closure"===s.kind,a=["{",br([ro(t)?"":Or,t.call(i,"body")]),h&&ro(t)?"":Or,"}"];if(h)return[...n,o," ",a];if(0===s.arguments.length)return[...n,o,xo(e)?Or:" ",a];if(r.some(Pr))return[o," ",a];return[...n,Lr([[o,xo(e)?Or:" ",a],[o," ",a]])]}(t,e,i);case"arrowfunc":return[s.parenthesizedExpression?"(":"",...Bo(t,e,i,{inline:!0}),s.isStatic?"static ":"","fn",bo(t,e,i),s.type?[": ",s.nullable?"?":"",t.call(i,"type")]:""," => ",t.call(i,"body"),s.parenthesizedExpression?")":""];case"parameter":{let n="";1===s.flags?n="public ":2===s.flags?n="protected ":4===s.flags&&(n="private ");const r=[...Bo(t,e,i,{inline:!0}),n,s.readonly?"readonly ":"",s.nullable?"?":"",s.type?[t.call(i,"type")," "]:"",s.byref?"&":"",s.variadic?"...":"","$",t.call(i,"name")];return s.value?Cr([r,jr(s)?" ":"",pr.printDanglingComments(t,e,!0)," =",Vo(s.name,s.value,t.call(i,"value"),!1,e)]):r}case"variadic":return["...",t.call(i,"what")];case"property":return Cr([s.readonly?"readonly ":"",s.type?[s.nullable?"?":"",t.call(i,"type")," "]:"","$",t.call(i,"name"),s.value?[" =",Vo(s.name,s.value,t.call(i,"value"),!1,e)]:""]);case"propertystatement":{const n=[];t.map((t=>n.push(...Bo(t,e,i))),"properties");const r=t.map((t=>i(t)),"properties"),o=s.properties.some((t=>t.value));let h;1!==r.length||s.properties[0].comments?r.length>0&&(h=br(r[0])):[h]=r;const a=s.visibility||null===s.visibility;return Cr([...n,a?[null===s.visibility?"var":s.visibility,""]:"",s.isStatic?[a?" ":"","static"]:"",h?[" ",h]:"",br(r.slice(1).map((t=>[",",o?Or:gr,t])))])}case"if":{const n=[],r=Fo(t,e,i,"body"),o=Cr(["if (",Cr([br([vr,t.call(i,"test")]),vr]),")",r]);if(n.push(o,Jr(t)||!s.body?"":Or),s.alternate){n.push(s.shortForm?"":"} ");const r=Kr(s.body)&&s.body.comments.some((t=>t.trailing&&!pr.isBlockComment(t)))||function(t){if(!t.comments)return!1;const e=Fr(t.comments.filter((t=>!t.leading&&!t.trailing)));return e&&!pr.isBlockComment(e)}(s),o=!r;n.push(o?"":Or),jr(s)&&n.push(fo(e.originalText,s.body,e)?Or:"",pr.printDanglingComments(t,e,!0),r?Or:" "),n.push("else",Cr("if"===s.alternate.kind?t.call(i,"alternate"):Fo(t,e,i,"alternate")))}else n.push(s.body?s.shortForm?"endif;":"}":"");return n}case"do":return["do",Fo(t,e,i,"body")," while (",Cr([br([vr,t.call(i,"test")]),vr]),")"];case"while":case"switch":return Cr([s.kind," (",Cr([br([vr,t.call(i,"test")]),vr]),")",Fo(t,e,i,"body")]);case"for":{const n=Fo(t,e,i,"body"),r=pr.printDanglingComments(t,e,!0),o=r?[r,vr]:"";return s.init.length||s.test.length||s.increment.length?[o,Cr(["for (",Cr([br([vr,Cr(Ar([",",gr],t.map(i,"init"))),";",gr,Cr(Ar([",",gr],t.map(i,"test"))),";",gr,Cr(Ar([",",gr],t.map(i,"increment")))]),vr]),")",n])]:[o,Cr(["for (;;)",n])]}case"foreach":{const n=Fo(t,e,i,"body"),r=pr.printDanglingComments(t,e,!0);return[r?[r,vr]:"",Cr(["foreach (",Cr([br([vr,t.call(i,"source"),gr,"as ",Cr(s.key?br(Ar([" =>",gr],[t.call(i,"key"),t.call(i,"value")])):t.call(i,"value"))]),vr]),")",n])]}case"try":{const n=[];return n.push("try",Fo(t,e,i,"body")),s.catches&&n.push(t.map(i,"catches")),s.always&&n.push(" finally",Fo(t,e,i,"always")),n}case"catch":return[" catch",s.what?[" (",Ar(" | ",t.map(i,"what")),s.variable?[" ",t.call(i,"variable")]:"",")"]:"",Fo(t,e,i,"body")];case"case":return[s.test?["case ",s.test.comments?br(t.call(i,"test")):t.call(i,"test"),":"]:"default:",s.body&&s.body.children&&s.body.children.length?br([Jr(t)?"":Or,t.call(i,"body")]):""];case"break":case"continue":return s.level&&("number"===s.level.kind&&"1"!==s.level.value)?["".concat(s.kind," "),t.call(i,"level")]:s.kind;case"call":return 1===s.arguments.length&&Wo(s.arguments[0],e.originalText,e)?[t.call(i,"what"),"(",Ar(", ",t.map(i,"arguments")),")"]:qr(s.what)?function(t,e,i){const s=[];function n(t){const{originalText:i}=e,s=po(i,t,e);return")"===i.charAt(s)?Ur(i,s+1,e):fo(i,t,e)}function r(t){const o=t.getValue();if("call"!==o.kind||!qr(o.what)&&"call"!==o.what.kind)if(qr(o)){let n=null;n="propertylookup"===o.kind?Eo(t,e,i):"nullsafepropertylookup"===o.kind?yo(t,e,i):"staticlookup"===o.kind?Ao(t,e,i):go(t,e,i),s.unshift({node:o,needsParens:Er(t),printed:pr.printAllComments(t,(()=>n),e)}),t.call((t=>r(t)),"what")}else s.unshift({node:o,printed:t.call(i)});else s.unshift({node:o,printed:[pr.printAllComments(t,(()=>bo(t,e,i)),e),n(o)?Or:""]}),t.call((t=>r(t)),"what")}const o=t.getValue();s.unshift({node:o,printed:bo(t,e,i)}),t.call((t=>r(t)),"what");for(let t=0;t<s.length;++t)"call"===s[t].node.kind&&s[t-1]&&["propertylookup","nullsafepropertylookup","staticlookup"].includes(s[t-1].node.kind)&&s[t-1].needsParens&&(s[0].printed=["(",s[0].printed],s[t-1].printed=[s[t-1].printed,")"]);const h=[];let a=[s[0]],c=1;for(;c<s.length&&("call"===s[c].node.kind||qr(s[c].node)&&s[c].node.offset&&"number"===s[c].node.offset.kind);++c)a.push(s[c]);if("call"!==s[0].node.kind)for(;c+1<s.length&&(qr(s[c].node)&&qr(s[c+1].node));++c)a.push(s[c]);h.push(a),a=[];let l=!1;for(;c<s.length;++c){if(l&&qr(s[c].node)){if("offsetlookup"===s[c].node.kind&&s[c].node.offset&&"number"===s[c].node.offset.kind){a.push(s[c]);continue}h.push(a),a=[],l=!1}"call"===s[c].node.kind&&(l=!0),a.push(s[c]),s[c].node.comments&&pr.hasTrailingComment(s[c].node)&&(h.push(a),a=[],l=!1)}a.length>0&&h.push(a);function _(t){const i=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||u&&s(e.name))||lo(e)}function s(t){return t.length<e.tabWidth}const n=Fr(t[0]).node;return qr(n)&&("identifier"===n.offset.kind||"variable"===n.offset.kind)&&i}const u="expressionstatement"===t.getParentNode().kind,d=h.length>=2&&!h[1][0].node.comments&&_(h);function p(t){const e=[];for(let i=0;i<t.length;i++)t[i+1]&&t[i+1].needsParens?(e.push("(",t[i].printed,t[i+1].printed,")"),i++):e.push(t[i].printed);return e}function f(t){return 0===t.length?"":br(Cr([Or,Ar(Or,t.map(p))]))}const k=h.map(p),T=k,m=d?3:2,x=h.slice(0,m).flat(),E=x.slice(1,-1).some((t=>pr.hasLeadingComment(t.node)))||x.slice(0,-1).some((t=>pr.hasTrailingComment(t.node)))||h[m]&&pr.hasLeadingComment(h[m][0].node),y=co(t,"encapsed");if(h.length<=m&&!E||y)return Cr(T);const A=Fr(d?h.slice(1,2)[0]:h[0]).node,g="call"!==A.kind&&n(A),N=[p(h[0]),d?h.slice(1,2).map(p):"",g?Or:"",f(h.slice(d?2:1))],C=s.filter((t=>"call"===t.node.kind)).length;if(E||C>=3||k.slice(0,-1).some(Pr))return Cr(N);return[Pr(T)||g?yr:"",Lr([T,N])]}(t,e,i):[t.call(i,"what"),bo(t,e,i)];case"new":{const n=s.what&&"class"===s.what.kind&&s.what.isAnonymous;if(!n&&1===s.arguments.length&&Wo(s.arguments[0],e.originalText,e))return["new ",...t.call(Bo,"what"),t.call(i,"what"),"(",Ar(", ",t.map(i,"arguments")),")"];const r=[];if(r.push("new "),n)r.push(s.what.leadingComments&&"commentblock"===s.what.leadingComments[0].kind?[pr.printComments(s.what.leadingComments,e)," "]:"",...t.call((t=>Bo(t,e,i,{inline:!0})),"what"),"class",s.arguments.length>0?[" ",bo(t,e,i)]:"",Cr(t.call(i,"what")));else{const n=["call","offsetlookup"].includes(s.what.kind),o=[n?"(":"",t.call(i,"what"),n?")":"",bo(t,e,i)];r.push(zr(s.what)?br(o):o)}return r}case"clone":return["clone ",s.what.comments?br(t.call(i,"what")):t.call(i,"what")];case"propertylookup":case"nullsafepropertylookup":case"staticlookup":case"offsetlookup":{const n=t.getParentNode();let r,o=0;do{r=t.getParentNode(o),o++}while(r&&qr(r));const h=co(t,"encapsed")||r&&("new"===r.kind||"assign"===r.kind&&"variable"!==r.left.kind)||"offsetlookup"===s.kind||(lo(s.what)||"variable"===s.what.kind)&&["identifier","variable","encapsedpart"].includes(s.offset.kind)&&n&&!qr(n);return[t.call(i,"what"),h?vo(t,e,i):Cr(br([vr,vo(t,e,i)]))]}case"exit":return Cr([s.useDie?"die":"exit","(",s.expression?Wo(s.expression,e.originalText,e)?t.call(i,"expression"):[br([vr,t.call(i,"expression")]),vr]:pr.printDanglingComments(t,e),")"]);case"global":return Cr(["global ",br(Ar([",",gr],t.map(i,"items")))]);case"include":return[s.require?"require":"include",s.once?"_once":""," ",s.target.comments?br(t.call(i,"target")):t.call(i,"target")];case"label":return[t.call(i,"name"),":"];case"goto":return["goto ",t.call(i,"label")];case"throw":return["throw ",s.what.comments?br(t.call(i,"what")):t.call(i,"what")];case"silent":return["@",t.call(i,"expr")];case"halt":return[jr(s)?[pr.printDanglingComments(t,e,!0),Or]:"","__halt_compiler();",s.after];case"eval":return Cr(["eval(",Wo(s.source,e.originalText,e)?t.call(i,"source"):[br([vr,t.call(i,"source")]),vr],")"]);case"echo":{const e=t.map((t=>i(t)),"expressions");let n;return 1!==e.length||s.expressions[0].comments?e.length>0&&(n=ao(s.expressions[0])||s.expressions[0].comments?br(e[0]):Ir(e[0])):[n]=e,Cr([s.shortForm?"":"echo ",n||"",br(e.slice(1).map((t=>[",",gr,t])))])}case"print":return["print ",s.expression.comments?br(t.call(i,"expression")):t.call(i,"expression")];case"return":{const n=[];if(n.push("return"),s.expr){const e=t.call(i,"expr");n.push(" ",s.expr.comments?br(e):e)}return jr(s)&&n.push(" ",pr.printDanglingComments(t,e,!0)),n}case"isset":case"unset":return Cr([s.kind,bo(t,e,i,"variables")]);case"empty":return Cr(["empty(",br([vr,t.call(i,"expression")]),vr,")"]);case"variable":{const e=t.getParentNode(),n=t.getParentNode(1),r="assign"===e.kind?"":s.byref?"&":"",o="encapsedpart"===e.kind&&"simple"===e.syntax&&e.curly||n&&"offsetlookup"===e.kind&&"encapsedpart"===n.kind&&"simple"===n.syntax&&n.curly?"":"$",h=s.curly?"{":"",a=s.curly?"}":"";return[r,o,h,t.call(i,"name"),a]}case"constantstatement":case"classconstant":{const n=Bo(t,e,i),r=t.map((t=>i(t)),"constants");let o;return 1!==r.length||s.constants[0].comments?r.length>0&&(o=br(r[0])):[o]=r,Cr([...n,s.final?"final ":"",s.visibility?[s.visibility," "]:"","const",o?[" ",o]:"",br(r.slice(1).map((t=>[",",Or,t])))])}case"constant":return Ho(s.name,t.call(i,"name")," =",s.value,t.call(i,"value"),!1,e);case"static":{const e=t.map((t=>i(t)),"variables"),n=s.variables.some((t=>t.defaultValue));let r;return 1!==e.length||s.variables[0].comments?e.length>0&&(r=br(e[0])):[r]=e,Cr(["static",r?[" ",r]:"",br(e.slice(1).map((t=>[",",n?Or:gr,t])))])}case"staticvariable":return Ho(s.variable,t.call(i,"variable")," =",s.defaultValue,t.call(i,"defaultValue"),!1,e);case"list":case"array":{const n="array"===s.kind&&To(e.phpVersion,"5.4")||"list"===s.kind&&(s.shortForm||To(e.phpVersion,"7.1")),r=n?"[":[s.kind,"("],o=n?"]":")";if(0===s.items.length)return jr(s)?Cr([r,pr.printDanglingComments(t,e),vr,o]):[r,o];const h=Fr(s.items),a=h&&"noop"===h.kind,[c]=s.items.filter((t=>"noop"!==t.kind)).sort(((t,i)=>e.locStart(t)-e.locStart(i))),l=!(!c||!c.key)&&c&&Br(e.originalText,e.locStart(s),e.locStart(c));return Cr([r,br([vr,wo(t,e,i)]),a?",":"",Sr(!a&&mo(e,"5.0")?[h&&ho(h)?Or:"",","]:""),pr.printDanglingComments(t,e,!0),vr,o],{shouldBreak:l})}case"entry":{const n=s.byRef?"&":"",r=s.unpack?"...":"";return s.key?Ho(s.key,t.call(i,"key")," =>",s.value,t.call(i,"value"),n,e):[n,r,t.call(i,"value")]}case"yield":{const e=[s.key?[t.call(i,"key")," => "]:"",t.call(i,"value")];return["yield",s.key||s.value?" ":"",s.value&&s.value.comments?br(e):e]}case"yieldfrom":return["yield from ",s.value.comments?br(t.call(i,"value")):t.call(i,"value")];case"unary":return[s.type,t.call(i,"what")];case"pre":return[s.type+s.type,t.call(i,"what")];case"post":return[t.call(i,"what"),s.type+s.type];case"cast":return["(",s.type,") ",s.expr.comments?br(t.call(i,"expr")):t.call(i,"expr")];case"assignref":case"assign":{const n="assignref"===s.kind;return Ho(s.left,t.call(i,"left"),[" ",n?"=":s.operator],s.right,t.call(i,"right"),n,e)}case"bin":{const n=t.getParentNode(),r=t.getParentNode(1),o=s!==n.body&&("if"===n.kind||"while"===n.kind||"switch"===n.kind||"do"===n.kind),h=Oo(t,i,e,!1,o);if(o)return h;if("unary"===n.kind||qr(n)&&"offsetlookup"!==n.kind)return Cr([br([vr,...h]),vr]);const a=s!==n.body&&"for"===n.kind||"retif"===n.kind&&r&&"return"!==r.kind,c=["assign","property","constant","staticvariable","entry"].includes(n.kind),l="bin"===s.left.kind&&Wr(s.type,s.left.type);if(a||So(s)&&!l||!So(s)&&c)return Cr(h);const _=h.slice(1);return Cr([h.length>0?h[0]:"",br(_)])}case"retif":{const e=[],n=t.getParentNode();let r,o=0;do{r=t.getParentNode(o),o++}while(r&&"retif"===r.kind);const h=r||n,a="bin"===s.falseExpr.kind?br(t.call(i,"falseExpr")):t.call(i,"falseExpr"),c=[s.trueExpr?gr:" ","?",s.trueExpr?[" ","bin"===s.trueExpr.kind?br(t.call(i,"trueExpr")):t.call(i,"trueExpr"),gr]:"",":",s.trueExpr?[" ",a]:[Io(s.falseExpr)?" ":gr,a]];e.push(c);const l=t=>n===h?Cr(t):t,_=t.getParentNode(1),u="cast"===n.kind&&_?_:n,d=["propertylookup","nullsafepropertylookup","staticlookup"].includes(u.kind),p=t.call(i,"test");if(!s.trueExpr){const t=[p,"bin"===u.kind||["print","echo","return","include"].includes(h.kind)?br(e):e];return"call"===u.kind&&u.what===s||"unary"===u.kind||qr(u)&&"offsetlookup"!==u.kind?Cr([br([vr,t]),vr]):l(t)}return l(["retif"===s.test.kind?br(p):p,br(e),d?vr:""])}case"boolean":return s.value?"true":"false";case"number":return Qr(s.value);case"string":{if("encapsedpart"===t.getParentNode().kind){const i=t.getParentNode(1);let n=0;const r=To(e.phpVersion,"7.3");let o=Rr;if("heredoc"===i.type){o=r?Or:Rr;const t=i.raw.split("\n");n=t[t.length-1].search(/\S/),-1===n&&(n=t[t.length-2].search(/\S/))}return Ar(o,s.raw.split("\n").map(((t,e)=>e>0||0===s.loc.start.column?t.substring(n):t)))}const i=no(s,e)?'"':"'";let n=s.raw;return"b"===s.raw[0]&&(n=n.slice(1)),['"',"'"].includes(n[0])&&(n=n.substr(1)),['"',"'"].includes(n[n.length-1])&&(n=n.substr(0,n.length-1)),["b"===s.raw[0]?"b":"",i,Ar(Rr,n.split("\n")),i]}case"intersectiontype":return Yo(t,i,"&");case"uniontype":return Yo(t,i,"|");case"encapsedpart":{const e="simple"===s.syntax&&s.curly||"complex"===s.syntax?[s.curly?"$":"","{"]:"",n="simple"===s.syntax&&s.curly||"complex"===s.syntax?"}":"";return[e,t.call(i,"expression"),n]}case"encapsed":switch(s.type){case"string":case"shell":case"heredoc":{const n=To(e.phpVersion,"7.3")?Or:Rr;return[Ro(s),"heredoc"===s.type?n:"",...t.map(i,"value"),Ro(s,{opening:!1}),"heredoc"===s.type&&Xr(t)?Or:""]}default:return"Have not implemented kind ".concat(s.type," yet.")}case"inline":return Ar(Rr,s.raw.replace("___PSEUDO_INLINE_PLACEHOLDER___","").split("\n"));case"magic":return s.value;case"nowdoc":{const i=To(e.phpVersion,"7.3")?Or:Rr;return["<<<'",s.label,"'",i,Ar(i,s.value.split("\n")),i,s.label,Xr(t)?Or:""]}case"name":return["rn"===s.resolution?"namespace\\":"",s.name];case"literal":return t.call(i,"value");case"parentreference":return"parent";case"selfreference":return"self";case"staticreference":return"static";case"typereference":return s.name;case"nullkeyword":return"null";case"identifier":return"method"===t.getParentNode().kind&&(s.name=uo(s.name)),t.call(i,"name");case"match":{const n=s.arms.length-1,r=t.map(((t,s)=>{const r=t.getValue(),o=pr.hasLeadingComment(r)?[pr.printComments(r.leadingComments,e),Or]:[],h=s<n||e.trailingCommaPHP?",":"",a=pr.hasTrailingComment(r)?[" ",pr.printComments(r.comments.filter((t=>t.trailing)),e)]:[],c=null===r.conds?"default":t.map(((t,e)=>[",",gr,i(t)].slice(0===e?2:0)),"conds"),l=t.call(i,"body"),_=s>0&&ko(e.originalText,r,e)?Or:"";return["",Or,_,...o,Cr([Cr([c,br(gr)]),"=> ",l,h,...a])].slice(s>0?0:1)}),"arms");return Cr(["match (",Cr([vr,br(t.call(i,"cond")),vr]),") {",Cr(br([...r]))," ",vr,"}"])}case"noop":return s.comments?pr.printComments(t.getValue().comments,e):"";case"namedargument":return[s.name,": ",t.call(i,"value")];case"enumcase":return Cr(["case ",t.call(i,"name"),s.value?[" =",Vo(s.name,s.value,t.call(i,"value"),!1,e)]:""]);case"variadicplaceholder":return"...";default:return"Have not implemented kind ".concat(s.kind," yet.")}}(t,e,i),r=[],o=Er(t);return o&&r.unshift("("),r.push(n),o&&r.push(")"),Vr(t)&&r.push(";"),$r(t)&&r.push(Or),r};const jo=new Set(["loc","range","raw","comments","leadingComments","trailingComments","parenthesizedExpression","parent","prev","start","end","tokens","errors","extra"]);function zo(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=Un.printNumber(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=Un.normalizeMagicMethodName(e.name.name)),"noop"===t.kind)return null}zo.ignoredProperties=jo;var Ko=zo;const Xo="PHP";var qo={phpVersion:{since:"0.13.0",category:Xo,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:Xo,type:"boolean",default:!0,description:"Print trailing commas wherever possible when multi-line."},braceStyle:{since:"0.10.0",category:Xo,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 Jo=(t,e,i,s)=>{if("length"===i||"prototype"===i)return;if("arguments"===i||"caller"===i)return;const n=Object.getOwnPropertyDescriptor(t,i),r=Object.getOwnPropertyDescriptor(e,i);!Zo(n,r)&&s||Object.defineProperty(t,i,r)},Zo=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)},th=(t,e)=>{const i=Object.getPrototypeOf(e);i!==Object.getPrototypeOf(t)&&Object.setPrototypeOf(t,i)},eh=(t,e)=>"/* Wrapped ".concat(t,"*/\n").concat(e),ih=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),sh=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),nh=(t,e,i)=>{const s=""===i?"":"with ".concat(i.trim(),"() "),n=eh.bind(null,s,e.toString());Object.defineProperty(n,"name",sh),Object.defineProperty(t,"toString",{...ih,value:n})};var rh=function(t,e){let{ignoreNonConfigurable:i=!1}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{name:s}=t;for(const s of Reflect.ownKeys(e))Jo(t,e,s,i);return th(t,e),nh(t,e,s),t},oh="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function hh(t){return t&&t.default||t}var ah,ch=()=>{const t={};return t.promise=new Promise(((e,i)=>{t.resolve=e,t.reject=i})),t},lh=function(t,e){return t(e={exports:{}},e.exports),e.exports}((function(t,e){var i=oh&&oh.__awaiter||function(t,e,i,s){return new(i||(i=Promise))((function(n,r){function o(t){try{a(s.next(t))}catch(t){r(t)}}function h(t){try{a(s.throw(t))}catch(t){r(t)}}function a(t){t.done?n(t.value):new i((function(e){e(t.value)})).then(o,h)}a((s=s.apply(t,e||[])).next())}))},s=oh&&oh.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const n=s(ch);function r(t){let e,s,r,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*(){r=n.default();const i=h[1][o]-Date.now();return i<=0?(t.delete(h[0]),void r.resolve()):(e=h[0],s=setTimeout((()=>{t.delete(h[0]),r&&r.resolve()}),i),"function"==typeof s.unref&&s.unref(),r.promise)}));try{for(const e of t)yield h(e)}catch(t){}e=void 0})),a=()=>{e=void 0,void 0!==s&&(clearTimeout(s),s=void 0),void 0!==r&&(r.reject(void 0),r=void 0)},c=t.set.bind(t);return t.set=(i,s)=>{t.has(i)&&t.delete(i);const n=c(i,s);return e&&e===i&&a(),h(),n},h(),t}e.default=r,t.exports=r,t.exports.default=r}));(ah=lh)&&ah.__esModule&&Object.prototype.hasOwnProperty.call(ah,"default")&&ah.default;var _h=lh;const uh=new WeakMap,dh=new WeakMap,ph=function(t){let{cacheKey:e,cache:i=new Map,maxAge:s}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};"number"==typeof s&&_h(i);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=i.get(h);if(a)return a.data;const c=t.apply(this,r);return i.set(h,{data:c,maxAge:s?Date.now()+s:Number.POSITIVE_INFINITY}),c};return rh(n,t,{ignoreNonConfigurable:!0}),dh.set(n,i),n};ph.decorator=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(e,i,s)=>{const n=e[i];if("function"!=typeof n)throw new TypeError("The decorated value must be a function");delete s.value,delete s.writable,s.get=function(){if(!uh.has(this)){const e=ph(n,t);return uh.set(this,e),e}return uh.get(this)}}},ph.clear=t=>{const e=dh.get(t);if(!e)throw new TypeError("Can't clear a function that was not memoized!");if("function"!=typeof e.clear)throw new TypeError("The cache Map can't be cleared!");e.clear()};const fh=/@prettier|@format/,kh=ph((t=>{const e=fn(t),[i]=e.children,[s]=e.comments.filter((t=>"commentblock"===t.kind));if(i&&s&&s.loc.start.line<i.loc.start.line)return s}));var Th={hasPragma:function(t){if(!fh.test(t))return!1;const e=kh(t);if(e){const{value:t}=e;return fh.test(t)}return!1},insertPragma:function(t){const e=kh(t);if(e){const{start:{offset:i},end:{offset:s}}=e.loc,n=t.substring(0,i),r=t.substring(s);return"".concat(n).concat(function(t){let e=t.split("\n");if(1===e.length){const[,t]=/\/*\*\*(.*)\*\//.exec(e[0]);e=["/**"," * ".concat(t.trim())," */"]}const i=e.findIndex((t=>/@\S/.test(t)))||1;return e.splice(i,0," * @format"),e.join("\n")}(e.value)).concat(r)}const i="<?php";if(!t.startsWith(i))return t;const s=i.length,n=t.substring(0,s),r=t.substring(s);return"".concat(n,"\n/** \n * @format \n */\n").concat(r)}},mh="programming",xh="text.html.php",Eh="application/x-httpd-php",yh="#4F5D95",Ah=[".php",".aw",".ctp",".fcgi",".inc",".php3",".php4",".php5",".phps",".phpt"],gh=[".php",".php_cs",".php_cs.dist","Phakefile"],Nh=["php"],Ch=["inc"],Lh={name:"PHP",type:mh,tmScope:xh,aceMode:"php",codemirrorMode:"php",codemirrorMimeType:Eh,color:yh,extensions:Ah,filenames:gh,interpreters:Nh,aliases:Ch,languageId:272},bh=Object.freeze({__proto__:null,name:"PHP",type:mh,tmScope:xh,aceMode:"php",codemirrorMode:"php",codemirrorMimeType:Eh,color:yh,extensions:Ah,filenames:gh,interpreters:Nh,aliases:Ch,languageId:272,default:Lh}),Ih="HTML+PHP",Sh="markup",Oh="#4f5d95",vh="text.html.php",Rh="HTML",wh=[".phtml"],Dh="application/x-httpd-php",Ph={name:Ih,type:Sh,color:Oh,tmScope:vh,group:Rh,extensions:wh,aceMode:"php",codemirrorMode:"php",codemirrorMimeType:Dh,languageId:151},Uh=Object.freeze({__proto__:null,name:Ih,type:Sh,color:Oh,tmScope:vh,group:Rh,extensions:wh,aceMode:"php",codemirrorMode:"php",codemirrorMimeType:Dh,languageId:151,default:Ph}),Mh=hh(bh),Bh=hh(Uh);const{join:Fh,hardline:Hh}=s.default.doc.builders,{hasPragma:Gh,insertPragma:Vh}=Th;function Qh(t,e){let{extend:i,override:s}=e;const n={};for(const e in t){n["languageId"===e?"linguistLanguageId":e]=t[e]}if(i)for(const t in i)n[t]=(n[t]||[]).concat(i[t]);for(const t in s)n[t]=s[t];return n}const Wh=[Qh(Mh,{override:{parsers:["php"],vscodeLanguageIds:["php"]}}),Qh(Bh,{override:{parsers:["php"],vscodeLanguageIds:["php"]}})],Yh=t=>e=>e.loc&&e.loc[t]&&e.loc[t].offset,$h={php:{parse:fn,astFormat:"php",locStart:Yh("start"),locEnd:Yh("end"),hasPragma:Gh}},jh={php:{print:$o,insertPragma:Vh,massageAstNode:Ko,getCommentChildNodes:pr.getCommentChildNodes,canAttachComment:pr.canAttachComment,isBlockComment:pr.isBlockComment,handleComments:{ownLine:pr.handleOwnLineComment,endOfLine:pr.handleEndOfLineComment,remaining:pr.handleRemainingComment},willPrintOwnComments(t){const e=t.getValue();return e&&"noop"===e.kind},printComment(t){const e=t.getValue();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]))?Fh(Hh,t.map(((e,i)=>(i>0?" ":"")+(i<t.length-1?e.trim():e.trimLeft())))):e.value}case"commentline":return e.value.trimRight();default:throw new Error("Not a comment: ".concat(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"),i=t.getParentNode(),s=t.getNode();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)}}};var zh={languages:Wh,printers:jh,parsers:$h,options:qo,defaultOptions:{tabWidth:4}},Kh=zh.languages,Xh=zh.printers,qh=zh.parsers,Jh=zh.options,Zh=zh.defaultOptions;t.default=zh,t.defaultOptions=Zh,t.languages=Kh,t.options=Jh,t.parsers=qh,t.printers=Xh,Object.defineProperty(t,"__esModule",{value:!0})}));