@prettier/plugin-php 0.17.5 → 0.18.2
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 +9 -14
- package/src/needs-parens.js +8 -0
- package/src/options.js +1 -0
- package/src/printer.js +45 -11
- package/src/util.js +3 -0
- package/standalone.js +1 -1
- package/src/.clean.js.swp +0 -0
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 n=i(e),s={matchST_ATTRIBUTE:function(){var t=0,e=this.input();if(this.is_WHITESPACE()){do{e=this.input()}while(this.is_WHITESPACE());return this.unput(1),null}switch(e){case"]":return 0===t?this.popState():t--,"]";case"(":case")":case":":case"=":return this.consume_TOKEN();case"[":return t++,"[";case",":return",";case'"':return this.ST_DOUBLE_QUOTES();case"'":return this.T_CONSTANT_ENCAPSED_STRING();case"/":if("/"===this._input[this.offset])return this.T_COMMENT();if("*"===this._input[this.offset])return this.input(),this.T_DOC_COMMENT()}if(this.is_LABEL_START()||"\\"===e){for(;this.offset<this.size;){var i=this.input();if(!this.is_LABEL()&&"\\"!==i){i&&this.unput(1);break}}return this.tok.T_STRING}if(this.is_NUM())return this.consume_NUM();throw new Error('Bad terminal sequence "'.concat(e,'" at line ').concat(this.yylineno," (offset ").concat(this.offset,")"))}};s.matchST_ATTRIBUTE;var r={T_COMMENT:function(){for(;this.offset<this.size;){var 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(){var 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())&&"/"===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;){var t=this.input();if("<"==t)if("?"==(t=this.ahead(1))){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||"\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 a={consume_NUM:function(){var t=this.yytext[0],e="."===t;if("0"===t)if("x"===(t=this.input())||"X"===t){if("_"!==(t=this.input())&&this.is_HEX())return this.consume_HNUM();this.unput(t?2:1)}else if("b"===t||"B"===t){if("_"!==(t=this.input())&&"0"===t||"1"===t)return this.consume_BNUM();this.unput(t?2:1)}else this.is_NUM()||t&&this.unput(1);for(;this.offset<this.size;){var i=t;if("_"===(t=this.input())){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}var n=2;if("+"!==(t=this.input())&&"-"!==t||(n=3,t=this.input()),this.is_NUM_START())return this.consume_LNUM(),this.tok.T_DNUMBER;this.unput(t?n:n-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;){var 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;){var t=this.input();if(!this.is_NUM()){t&&this.unput(1);break}}return this.tok.T_LNUMBER},consume_BNUM:function(){for(var t;this.offset<this.size;)if("0"!==(t=this.input())&&"1"!==t&&"_"!==t){t&&this.unput(1);break}return this.tok.T_LNUMBER}};a.consume_NUM,a.consume_HNUM,a.consume_LNUM,a.consume_BNUM;var h={matchST_LOOKING_FOR_PROPERTY:function(){var t=this.input();if("-"===t){if(">"===(t=this.input()))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(){var t=this.input();if(this.popState(),this.begin("ST_IN_SCRIPTING"),this.is_LABEL_START()){if(this.consume_LABEL(),"["===(t=this.input())||"}"===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(){var 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")}};h.matchST_LOOKING_FOR_PROPERTY,h.matchST_LOOKING_FOR_VARNAME,h.matchST_VAR_OFFSET;var l={matchST_IN_SCRIPTING:function(){var t=this.input();switch(t){case" ":case"\t":case"\n":case"\r":case"\r\n":return this.T_WHITESPACE();case"#":return"["===this._input[this.offset]?(this.input(),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();var e=this._input[this.offset];return"\n"!==e&&"\r"!==e||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(),"\n"!==(t=this._input[this.offset])&&"\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;){var t=this.input();if(" "!==t&&"\t"!==t&&"\n"!==t&&"\r"!==t){t&&this.unput(1);break}}return this.tok.T_WHITESPACE}};l.matchST_IN_SCRIPTING,l.T_WHITESPACE;var c=["\n","\r"],u=["\n","\r",";"],_=u.concat(["\t"," ",",","]",")","/","=","!"]),d={T_CONSTANT_ENCAPSED_STRING:function(){for(var t;this.offset<this.size;)if("\\"==(t=this.input()))this.input();else if("'"==t)break;return this.tok.T_CONSTANT_ENCAPSED_STRING},is_HEREDOC:function(){var 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()););var e=this._input[this.offset-1];if("'"===e||'"'===e?this.offset++:e=null,this.is_LABEL_START()){for(var i=this.offset-1;this.offset<this.size&&(this.offset++,this.is_LABEL()););var n=this._input.substring(i,this.offset-1);if((!e||e===this._input[this.offset-1])&&(e&&this.offset++,c.includes(this._input[this.offset-1])))return this.heredoc_label.label=n,this.heredoc_label.length=n.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(){for(var t;this.offset<this.size;)if("\\"==(t=this.input()))this.input();else{if('"'==t)break;if("$"==t){if("{"==(t=this.input())||this.is_LABEL_START()){this.unput(2);break}t&&this.unput(1)}else if("{"==t){if("$"==(t=this.input())){this.unput(2);break}t&&this.unput(1)}}if('"'==t)return this.tok.T_CONSTANT_ENCAPSED_STRING;var e=1;return"b"!==this.yytext[0]&&"B"!==this.yytext[0]||(e=2),this.yytext.length>2&&this.appendToken(this.tok.T_ENCAPSED_AND_WHITESPACE,this.yytext.length-e),this.unput(this.yytext.length-e),this.begin("ST_DOUBLE_QUOTES"),this.yytext},isDOC_MATCH:function(t,e){var i=this._input[t-2];if(!c.includes(i))return!1;var n=!1,s=!1,r=0,o=this._input[t-1];if(this.version>=703){for(;"\t"===o||" "===o;)" "===o?n=!0:"\t"===o&&(s=!0),o=this._input[t+r],r++;if(t+=r,c.includes(this._input[t-1]))return!1}if(this._input.substring(t-1,t-1+this.heredoc_label.length)===this.heredoc_label.label){var a=this._input[t-1+this.heredoc_label.length];if((this.version>=703?_:u).includes(a)){if(e){if(this.consume(r),n&&s)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=n,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;for(var t=this.offset+1;t<this._input.length;){if(this.isDOC_MATCH(t,!1))return;if(!c.includes(this._input[t-1]))for(;!c.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;for(var t=this._input[this.offset-1];this.offset<this.size;)if(c.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(){var 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(),c.includes(t)||(t=this.input())),c.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()))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()){var e=this.offset,i=this.consume_VARIABLE();return this.yytext.length>this.offset-e+2?(this.appendToken(i,this.offset-e+2),this.unput(this.offset-e+2),this.tok.T_ENCAPSED_AND_WHITESPACE):i}}else if("{"===t){if("$"===(t=this.input()))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();var 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(){var t=this.input();if("$"===t){if("{"===(t=this.input()))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()))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()){var e=this.offset,i=this.consume_VARIABLE();return this.yytext.length>this.offset-e+2?(this.appendToken(i,this.offset-e+2),this.unput(this.offset-e+2),this.tok.T_ENCAPSED_AND_WHITESPACE):i}continue}if("{"===t){if("$"===(t=this.input()))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(){var t=this.input();if("$"===t){if("{"===(t=this.input()))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()))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()){var e=this.offset,i=this.consume_VARIABLE();return this.yytext.length>this.offset-e+2?(this.appendToken(i,this.offset-e+2),this.unput(this.offset-e+2),this.tok.T_ENCAPSED_AND_WHITESPACE):i}t&&this.unput(1)}else if("{"===t){if("$"===(t=this.input()))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(){var t=this.yytext.toLowerCase(),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){var i=this.input(1);if('"'===i)return this.ST_DOUBLE_QUOTES();if("'"===i)return this.T_CONSTANT_ENCAPSED_STRING();i&&this.unput(1)}return e},consume_TOKEN:function(){var 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(){var 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(){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(){var t=this.offset;if(this.input(),this.is_TABSPACE()&&this.consume_TABSPACE().input(),this.is_LABEL_START()){var e=this.yytext.length;this.consume_LABEL();var i=this.yytext.substring(e-1).toLowerCase(),n=this.castKeywords[i];if("number"==typeof n&&(this.input(),this.is_TABSPACE()&&this.consume_TABSPACE().input(),")"===this._input[this.offset-1]))return n}return this.unput(this.offset-t),"("},"=":function(){var 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(){var 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(){var t=this._input[this.offset];return"<"===t?"="===(t=this._input[this.offset+1])?(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(){var t=this._input[this.offset];return"="===t?(this.input(),this.tok.T_IS_GREATER_OR_EQUAL):">"===t?"="===(t=this._input[this.offset+1])?(this.consume(2),this.tok.T_SR_EQUAL):(this.input(),this.tok.T_SR):">"},"*":function(){var 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(){var 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(){var t=this._input[this.offset];return"="===t?(this.input(),this.tok.T_AND_EQUAL):"&"===t?(this.input(),this.tok.T_BOOLEAN_AND):"&"},"|":function(){var 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(){var t=this._input.charCodeAt(this.offset-1);return t>47&&t<58||95===t},is_NUM_START:function(){var t=this._input.charCodeAt(this.offset-1);return t>47&&t<58},is_LABEL:function(){var 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(){var 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;){var t=this.input();if(!this.is_LABEL()){t&&this.unput(1);break}}return this},is_TOKEN:function(){var t=this._input[this.offset-1];return-1!==";:,.\\[]()|^&+-/*=%!~$<>?@".indexOf(t)},is_WHITESPACE:function(){var t=this._input[this.offset-1];return" "===t||"\t"===t||"\n"===t||"\r"===t},is_TABSPACE:function(){var t=this._input[this.offset-1];return" "===t||"\t"===t},consume_TABSPACE:function(){for(;this.offset<this.size;){var t=this.input();if(!this.is_TABSPACE()){t&&this.unput(1);break}}return this},is_HEX:function(){var t=this._input.charCodeAt(this.offset-1);return t>47&&t<58||(t>64&&t<71||(t>96&&t<103||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;var T=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=800,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,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},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}};T.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},T.prototype.input=function(){var 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):""},T.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(var e=0;e<this.yytext.length;e++){var i=this.yytext[e];"\r"===i?(i=this.yytext[++e],this.yyprevcol=this.yylloc.last_column,this.yylloc.last_line++,this.yylloc.last_column=0,"\n"!==i&&("\r"===i?this.yylloc.last_line++:this.yylloc.last_column++)):"\n"===i?(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},T.prototype.tryMatch=function(t){return t===this.ahead(t.length)},T.prototype.tryMatchCaseless=function(t){return t===this.ahead(t.length).toLowerCase()},T.prototype.ahead=function(t){var 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},T.prototype.consume=function(t){for(var e=0;e<t;e++){var i=this._input[this.offset];if(!i)break;this.yytext+=i,this.offset++,"\r"===i&&"\n"===this._input[this.offset]&&(this.yytext+="\n",this.offset++,e++),"\n"===i||"\r"===i?(this.yylloc.last_line=++this.yylineno,this.yyprevcol=this.yylloc.last_column,this.yylloc.last_column=0):this.yylloc.last_column++}return this},T.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}},T.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},T.prototype.appendToken=function(t,e){return this.tokens.push([t,e]),this},T.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;var 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},T.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},T.prototype.popState=function(){var 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},T.prototype.next=function(){var 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?("object"==typeof(t=this.tokens.shift())[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){var e=t;e="number"==typeof e?this.engine.tokens.values[e]:'"'+e+'"';var 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},[s,r,o,a,h,l,d,p,f].forEach((function(t){for(var e in t)T.prototype[e]=t[e]}));var k=T,m={read_array:function(){var t=null,e=!1,i=this.node("array");this.token===this.tok.T_ARRAY?(this.next().expect("("),t=")"):(e=!0,t="]");var n=[];return this.next().token!==t&&(n=this.read_array_pair_list(e)),this.expect(t),this.next(),i(e,n)},read_array_pair_list:function(t){var 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)){if(","===this.token)return this.node("noop")();var e=this.node("entry"),i=null,n=null,s=!1,r=!1;if("&"===this.token)this.next(),s=!0,n=this.read_variable(!0,!1);else if(this.token===this.tok.T_ELLIPSIS&&this.version>=704)this.next(),"&"===this.token&&this.error(),r=!0,n=this.read_expr();else{var o=this.read_expr();this.token===this.tok.T_DOUBLE_ARROW?(this.next(),i=o,"&"===this.token?(this.next(),s=!0,n=this.read_variable(!0,!1)):n=this.read_expr()):n=o}return e(i,n,s,r)}}};function E(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function x(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function y(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?x(Object(i),!0).forEach((function(e){E(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):x(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function v(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var i=[],n=!0,s=!1,r=void 0;try{for(var o,a=t[Symbol.iterator]();!(n=(o=a.next()).done)&&(i.push(o.value),!e||i.length!==e);n=!0);}catch(t){s=!0,r=t}finally{try{n||null==a.return||a.return()}finally{if(s)throw r}}return i}(t,e)||g(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function A(t){return function(t){if(Array.isArray(t))return N(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||g(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function g(t,e){if(t){if("string"==typeof t)return N(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(i):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?N(t,e):void 0}}function N(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function C(t){if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(t=g(t))){var e=0,i=function(){};return{s:i,n:function(){return e>=t.length?{done:!0}:{done:!1,value:t[e++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var n,s,r=!0,o=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return r=t.done,t},e:function(t){o=!0,s=t},f:function(){try{r||null==n.return||n.return()}finally{if(o)throw s}}}}m.read_array,m.read_array_pair_list,m.read_array_pair;var S={read_class_declaration_statement:function(t){var 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);var n=this.node("identifier"),s=this.text();this.next(),n=n(s);var r=this.read_extends_from(),o=this.read_implements_list();this.expect("{");var a=e(n,r,o,this.next().read_class_body(),i);return t&&(a.attrGroups=t),a},read_class_modifiers:function(){return[0,0,this.read_class_modifier()]},read_class_modifier:function(){return this.token===this.tok.T_ABSTRACT?(this.next(),1):this.token===this.tok.T_FINAL?(this.next(),2):0},read_class_body:function(){for(var t=[],e=[];this.token!==this.EOF&&"}"!==this.token;)if(this.token!==this.tok.T_COMMENT)if(this.token!==this.tok.T_DOC_COMMENT)if(this.token!==this.tok.T_USE){this.token===this.tok.T_ATTRIBUTE&&(e=this.read_attr_list());var i=this.read_member_flags(!1);if(this.token!==this.tok.T_CONST)if(this.token===this.tok.T_VAR&&(this.next().expect(this.tok.T_VARIABLE),i[0]=null,i[1]=0),this.token===this.tok.T_FUNCTION)t.push(this.read_function(!1,i,e)),e=[];else if(this.token===this.tok.T_VARIABLE||this.version>=704&&("?"===this.token||this.token===this.tok.T_CALLABLE||this.token===this.tok.T_ARRAY||this.token===this.tok.T_NS_SEPARATOR||this.token===this.tok.T_STRING||this.token===this.tok.T_NAMESPACE)){var n=this.read_variable_list(i,e);e=[],this.expect(";"),this.next(),t=t.concat(n)}else this.error([this.tok.T_CONST,this.tok.T_VARIABLE,this.tok.T_FUNCTION]),this.next();else{var s=this.read_constant_list(i,e);this.expect(";")&&this.next(),t=t.concat(s)}}else t=t.concat(this.read_trait_use_statement());else t.push(this.read_doc_comment());else t.push(this.read_comment());return this.expect("}"),this.next(),t},read_variable_list:function(t,e){var i=this.node("propertystatement"),n=this.read_list((function(){var t=this.node("property"),i=v(this.read_optional_type(),2),n=i[0],s=i[1];this.expect(this.tok.T_VARIABLE);var r=this.node("identifier"),o=this.text().substring(1);return this.next(),r=r(o),";"===this.token||","===this.token?t(r,null,n,s,e||[]):"="===this.token?t(r,this.next().read_expr(),n,s,e||[]):(this.expect([",",";","="]),t(r,null,n,s,e||[]))}),",");return i(null,n,t)},read_constant_list:function(t,e){this.expect(this.tok.T_CONST)&&this.next();var i=this.node("classconstant"),n=this.read_list((function(){var t=this.node("constant"),e=null,i=null;if(this.token===this.tok.T_STRING||this.version>=700&&this.is("IDENTIFIER")){e=this.node("identifier");var n=this.text();this.next(),e=e(n)}else this.expect("IDENTIFIER");return this.expect("=")&&(i=this.next().read_expr()),t(e,i)}),",");return i(null,n,t,e||[])},read_member_flags:function(t){var e=[-1,-1,-1];if(this.is("T_MEMBER_FLAGS")){var i=0,n=0;do{switch(this.token){case this.tok.T_PUBLIC:i=0,n=0;break;case this.tok.T_PROTECTED:i=0,n=1;break;case this.tok.T_PRIVATE:i=0,n=2;break;case this.tok.T_STATIC:i=1,n=1;break;case this.tok.T_ABSTRACT:i=2,n=1;break;case this.tok.T_FINAL:i=2,n=2}t&&(0==i&&2==n?(this.expect([this.tok.T_PUBLIC,this.tok.T_PROTECTED]),n=-1):2==i&&1==n&&(this.error(),n=-1)),-1!==e[i]?this.error():-1!==n&&(e[i]=n)}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(){var t=!1;"?"===this.token&&(t=!0,this.next());var 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();var i=this.read_type();if(!i){this.raiseError("Expecting a type definition");break}e.push(i)}while("|"===this.token)}return[t,e]},read_interface_declaration_statement:function(t){var 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);var i=this.node("identifier"),n=this.text();this.next(),i=i(n);var s=this.read_interface_extends_list();return this.expect("{"),e(i,s,this.next().read_interface_body(),t||[])},read_interface_body:function(){for(var t=[],e=[];this.token!==this.EOF&&"}"!==this.token;)if(this.token!==this.tok.T_COMMENT)if(this.token!==this.tok.T_DOC_COMMENT){e=this.read_attr_list();var i=this.read_member_flags(!0);if(this.token==this.tok.T_CONST){var n=this.read_constant_list(i,e);this.expect(";")&&this.next(),t=t.concat(n),e=[]}else if(this.token===this.tok.T_FUNCTION){var s=this.read_function_declaration(2,i,e);s.parseFlags(i),t.push(s),this.expect(";")&&this.next(),e=[]}else this.error([this.tok.T_CONST,this.tok.T_FUNCTION]),this.next()}else t.push(this.read_doc_comment());else t.push(this.read_comment());return this.expect("}")&&this.next(),t},read_trait_declaration_statement:function(){var 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);var e=this.node("identifier"),i=this.text();return this.next(),e=e(i),this.expect("{"),t(e,this.next().read_class_body())},read_trait_use_statement:function(){var t=this.node("traituse");this.expect(this.tok.T_USE)&&this.next();for(var e=[this.read_namespace_name()],i=null;","===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(){var t,e=this.node(),i=null;if(this.is("IDENTIFIER")){t=this.node("identifier");var n=this.text();this.next(),t=t(n)}else if(t=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=t,t=this.node("identifier");var s=this.text();this.next(),t=t(s)}else this.expect(this.tok.T_STRING);else t=t.name;if(this.token===this.tok.T_INSTEADOF)return e("traitprecedence",i,t,this.next().read_name_list());if(this.token===this.tok.T_AS){var r=null,o=null;if(this.next().is("T_MEMBER_FLAGS")&&(r=this.read_member_flags()),this.token===this.tok.T_STRING||this.version>=700&&this.is("IDENTIFIER")){o=this.node("identifier");var a=this.text();this.next(),o=o(a)}else!1===r&&this.expect(this.tok.T_STRING);return e("traitalias",i,t,o,r)}return this.expect([this.tok.T_AS,this.tok.T_INSTEADOF]),e("traitalias",i,t,null,null)}};S.read_class_declaration_statement,S.read_class_modifiers,S.read_class_modifier,S.read_class_body,S.read_variable_list,S.read_constant_list,S.read_member_flags,S.read_optional_type,S.read_interface_declaration_statement,S.read_interface_body,S.read_trait_declaration_statement,S.read_trait_use_statement,S.read_trait_use_alias;var b={read_comment:function(){var t=this.text(),e=this.ast.prepare("/*"===t.substring(0,2)?"commentblock":"commentline",null,this),i=this.lexer.yylloc.first_offset,n=this.prev;return this.prev=[this.lexer.yylloc.last_line,this.lexer.yylloc.last_column,this.lexer.offset],this.lex(),(e=e(t)).offset=i,this.prev=n,e},read_doc_comment:function(){var t=this.ast.prepare("commentblock",null,this),e=this.lexer.yylloc.first_offset,i=this.text(),n=this.prev;return this.prev=[this.lexer.yylloc.last_line,this.lexer.yylloc.last_column,this.lexer.offset],this.lex(),(t=t(i)).offset=e,this.prev=n,t}};b.read_comment,b.read_doc_comment;var L={read_expr:function(t){var 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){var 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(){var t=null;switch(this.token){case this.tok.T_ISSET:t=this.node("isset"),this.next().expect("(")&&this.next();var 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();var i=this.read_expr();this.expect(")")&&this.next(),t=t(i);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();var n=this.read_expr();this.expect(")")&&this.next(),t=t(n);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(){var t=null;return"("===this.token&&(this.next(),t=this.read_optional_expr(")"),this.expect(")")&&this.next()),t},read_expr_item:function(){var 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()).parenthesizedExpression=!0,this.expect(")")&&this.next(),this.handleDereferencable(e);if("`"===this.token)return this.read_encapsed_string("`");if(this.token===this.tok.T_LIST){var n=null,s=this.innerList;t=this.node("list"),s||(n=this.node("assign")),this.next().expect("(")&&this.next(),this.innerList||(this.innerList=!0);var r=this.read_array_pair_list(!1);this.expect(")")&&this.next();for(var o=!1,a=0;a<r.length;a++)if(null!==r[a]&&"noop"!==r[a].kind){o=!0;break}return o||this.raiseError("Fatal Error : Cannot use empty list on line "+this.lexer.yylloc.first_line),s?t(r,!1):(this.innerList=!1,this.expect("=")?n(t(r,!1),this.next().read_expr(),"="):t(r,!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:return this.version<800&&this.raiseError("PHP 8+ is required to use throw as an expression"),this.node("throw")(this.next().read_expr());case this.tok.T_EXIT:var h="die"===this.lexer.yytext.toLowerCase();return t=this.node("exit"),this.next(),t(this.read_exit_expr(),h);case this.tok.T_PRINT:return this.node("print")(this.next().read_expr());case this.tok.T_YIELD:var l=null,c=null;return t=this.node("yield"),this.next().is("EXPR")&&(l=this.read_expr(),this.token===this.tok.T_DOUBLE_ARROW&&(c=l,l=this.next().read_expr())),t(l,c);case this.tok.T_YIELD_FROM:return(t=this.node("yieldfrom"))(e=this.next().read_expr());case this.tok.T_FN:case this.tok.T_FUNCTION:return this.read_inline_function(void 0,i);case this.tok.T_STATIC:var u=[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(u),this.next()}if(this.is("VARIABLE")){t=this.node();var _="identifier"===(e=this.read_variable(!1,!1)).kind||"staticlookup"===e.kind&&"identifier"===e.offset.kind;switch(this.token){case"=":return _&&this.error("VARIABLE"),"&"==this.next().token?this.read_assignref(t,e):t("assign",e,this.read_expr(),"=");case this.tok.T_PLUS_EQUAL:return _&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"+=");case this.tok.T_MINUS_EQUAL:return _&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"-=");case this.tok.T_MUL_EQUAL:return _&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"*=");case this.tok.T_POW_EQUAL:return _&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"**=");case this.tok.T_DIV_EQUAL:return _&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"/=");case this.tok.T_CONCAT_EQUAL:return _&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),".=");case this.tok.T_MOD_EQUAL:return _&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"%=");case this.tok.T_AND_EQUAL:return _&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"&=");case this.tok.T_OR_EQUAL:return _&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"|=");case this.tok.T_XOR_EQUAL:return _&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"^=");case this.tok.T_SL_EQUAL:return _&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"<<=");case this.tok.T_SR_EQUAL:return _&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),">>=");case this.tok.T_COALESCE_EQUAL:return _&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"??=");case this.tok.T_INC:return _&&this.error("VARIABLE"),this.next(),t("post","+",e);case this.tok.T_DEC:return _&&this.error("VARIABLE"),this.next(),t("post","-",e);default:t.destroy(e)}}else{if(this.is("SCALAR")){if(t=this.node(),"array"===(e=this.read_scalar()).kind&&e.shortForm&&"="===this.token){var d=this.convertToList(e);return e.loc&&(d.loc=e.loc),t("assign",d,this.next().read_expr(),"=")}return t.destroy(e),this.handleDereferencable(e)}this.error("EXPR"),this.next()}return e},convertToList:function(t){var e=this,i=t.items.map((function(t){return t.value&&"array"===t.value.kind&&t.value.shortForm&&(t.value=e.convertToList(t.value)),t})),n=this.node("list")(i,!0);return t.loc&&(n.loc=t.loc),t.leadingComments&&(n.leadingComments=t.leadingComments),t.trailingComments&&(n.trailingComments=t.trailingComments),n},read_assignref:function(t,e){var 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){var i=this.read_function(!0,t,e);return i.attrGroups=e,i}!this.version>=704&&this.raiseError("Arrow Functions are not allowed");var n=this.node("arrowfunc");this.expect(this.tok.T_FN)&&this.next();var s=this.is_reference();this.expect("(")&&this.next();var r=this.read_parameter_list();this.expect(")")&&this.next();var o=!1,a=null;":"===this.token&&("?"===this.next().token&&(o=!0,this.next()),a=this.read_types()),this.expect(this.tok.T_DOUBLE_ARROW)&&this.next();var h=n(r,s,this.read_expr(),a,o,!!t);return h.attrGroups=e,h},read_match_expression:function(){var 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");var e,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(){var t=this;return this.read_list((function(){return t.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(){var 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(){var t=this.text(),e=[];return this.next(),"("===this.token&&(e=this.read_argument_list()),this.node("attribute")(t,e)},read_attr_list(){var t=[];if(this.token===this.tok.T_ATTRIBUTE)do{var 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(){var t=this.node("new");this.expect(this.tok.T_NEW)&&this.next();var e=[],i=this.read_attr_list();if(this.token===this.tok.T_CLASS){var n=this.node("class");"("===this.next().token&&(e=this.read_argument_list());var s=this.read_extends_from(),r=this.read_implements_list(),o=null;this.expect("{")&&(o=this.next().read_class_body());var a=n(null,s,r,o,[0,0,0]);return a.attrGroups=i,t(a,e)}var h=this.read_new_class_name();return"("===this.token&&(e=this.read_argument_list()),t(h,e)},read_new_class_name:function(){if(this.token===this.tok.T_NS_SEPARATOR||this.token===this.tok.T_STRING||this.token===this.tok.T_NAMESPACE){var 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}};L.read_expr,L.read_expr_cast,L.read_isset_variable,L.read_isset_variables,L.read_internal_functions_in_yacc,L.read_optional_expr,L.read_exit_expr,L.read_expr_item,L.convertToList,L.read_assignref,L.read_inline_function,L.read_match_expression,L.read_match_arms,L.read_match_arm,L.read_match_arm_conds,L.read_attribute,L.read_attr_list,L.read_new_expr,L.read_new_class_name,L.handleDereferencable;var O={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){var n=this.read_function_declaration(t?1:e?2:0,e&&1===e[1],i||[]);return e&&1==e[2]?(n.parseFlags(e),this.expect(";")&&this.next()):(this.expect("{")&&(n.body=this.read_code_block(!1),n.loc&&n.body.loc&&(n.loc.end=n.body.loc.end)),!t&&e&&n.parseFlags(e)),n},read_function_declaration:function(t,e,i){var n="function";1===t?n="closure":2===t&&(n="method");var s=this.node(n);this.expect(this.tok.T_FUNCTION)&&this.next();var r=this.is_reference(),o=!1,a=[],h=null,l=!1;if(1!==t){var c=this.node("identifier");2===t?this.version>=700?this.token===this.tok.T_STRING||this.is("IDENTIFIER")?(o=this.text(),this.next()):this.version<704&&this.error("IDENTIFIER"):this.token===this.tok.T_STRING?(o=this.text(),this.next()):this.error("IDENTIFIER"):this.version>=700?this.token===this.tok.T_STRING?(o=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)&&(o=this.text()),this.next()),o=c(o)}this.expect("(")&&this.next();var u=this.read_parameter_list();if(this.expect(")")&&this.next(),1===t&&(a=this.read_lexical_vars()),":"===this.token&&("?"===this.next().token&&(l=!0,this.next()),h=this.read_types()),1===t){var _=s(u,r,a,h,l,e);return _.attrGroups=i||[],_}var d=s(o,u,r,h,l);return d.attrGroups=i||[],d},read_lexical_vars:function(){var 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){for(var e=[];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));var t=this.node("variable");this.expect(this.tok.T_VARIABLE);var e=this.text().substring(1);return this.next(),t(e,!1)},read_parameter_list:function(){return")"!=this.token?this.read_list_with_dangling_comma(this.read_parameter.bind(this)):[]},read_parameter:function(){var t,e=this.node("parameter"),i=null,n=null,s=!1,r=[];this.token===this.tok.T_ATTRIBUTE&&(r=this.read_attr_list());var o=this.read_promoted();"?"===this.token&&(this.next(),s=!0),t=this.read_types(),s&&!t&&this.raiseError("Expecting a type definition combined with nullable operator");var a=this.is_reference(),h=this.is_variadic();if(this.expect(this.tok.T_VARIABLE)){i=this.node("identifier");var l=this.text().substring(1);this.next(),i=i(l)}"="==this.token&&(n=this.next().read_expr());var c=e(i,t,n,a,h,s,o);return r&&(c.attrGroups=r),c},read_types(){var t=[],e=this.node("uniontype"),i=this.read_type();if(!i)return null;for(t.push(i);"|"===this.token;)this.next(),i=this.read_type(),t.push(i);return 1===t.length?t[0]:e(t)},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(){var t=[];return this.expect("(")&&this.next(),")"!==this.token&&(t=this.read_non_empty_argument_list()),this.expect(")")&&this.next(),t},read_non_empty_argument_list:function(){var t=!1;return this.read_function_list(function(){var e=this.read_argument();return e&&(t&&this.raiseError("Unexpected argument after a variadic argument"),"variadic"===e.kind&&(t=!0)),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)){var t=this.lexer.getState(),e=this.lexer.lex();if(this.lexer.setState(t),":"===e)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(){var t=this.node();if(this.token===this.tok.T_ARRAY||this.token===this.tok.T_CALLABLE){var e=this.text();return this.next(),t("typereference",e.toLowerCase(),e)}if(this.token===this.tok.T_STRING){var i=this.text(),n=[this.token,this.lexer.getState()];return this.next(),this.token!==this.tok.T_NS_SEPARATOR&&this.ast.typereference.types.indexOf(i.toLowerCase())>-1?t("typereference",i.toLowerCase(),i):(this.lexer.tokens.push(n),this.next(),t.destroy(),this.read_namespace_name())}return this.token===this.tok.T_NAMESPACE||this.token===this.tok.T_NS_SEPARATOR?(t.destroy(),this.read_namespace_name()):(t.destroy(),null)}};O.is_reference,O.is_variadic,O.read_function,O.read_function_declaration,O.read_lexical_vars,O.read_list_with_dangling_comma,O.read_lexical_var_list,O.read_lexical_var,O.read_parameter_list,O.read_parameter,O.read_types,O.read_promoted,O.read_argument_list,O.read_non_empty_argument_list,O.read_argument,O.read_type;var I={read_if:function(){var t=this.node("if"),e=this.next().read_if_expr(),i=null,n=null,s=!1;if(":"===this.token){s=!0,this.next(),i=this.node("block");for(var r=[];this.token!==this.EOF&&this.token!==this.tok.T_ENDIF;){if(this.token===this.tok.T_ELSEIF){n=this.read_elseif_short();break}if(this.token===this.tok.T_ELSE){n=this.read_else_short();break}r.push(this.read_inner_statement())}i=i(null,r),this.expect(this.tok.T_ENDIF)&&this.next(),this.expectEndOfStatement()}else i=this.read_statement(),this.token===this.tok.T_ELSEIF?n=this.read_if():this.token===this.tok.T_ELSE&&(n=this.next().read_statement());return t(e,i,n,s)},read_if_expr:function(){this.expect("(")&&this.next();var t=this.read_expr();return this.expect(")")&&this.next(),t},read_elseif_short:function(){var t=null,e=this.node("if"),i=this.next().read_if_expr();this.expect(":")&&this.next();for(var n=this.node("block"),s=[];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}s.push(this.read_inner_statement())}return e(i,n(null,s),t,!0)},read_else_short:function(){this.next().expect(":")&&this.next();for(var t=this.node("block"),e=[];this.token!=this.EOF&&this.token!==this.tok.T_ENDIF;)e.push(this.read_inner_statement());return t(null,e)}};I.read_if,I.read_if_expr,I.read_elseif_short,I.read_else_short;var R={read_while:function(){var t=this.node("while");this.expect(this.tok.T_WHILE)&&this.next();var e,i=null,n=!1;return this.expect("(")&&this.next(),e=this.read_expr(),this.expect(")")&&this.next(),":"===this.token?(n=!0,i=this.read_short_form(this.tok.T_ENDWHILE)):i=this.read_statement(),t(e,i,n)},read_do:function(){var t=this.node("do");this.expect(this.tok.T_DO)&&this.next();var e,i=null;return e=this.read_statement(),this.expect(this.tok.T_WHILE)&&(this.next().expect("(")&&this.next(),i=this.read_expr(),this.expect(")")&&this.next(),this.expect(";")&&this.next()),t(i,e)},read_for:function(){var t=this.node("for");this.expect(this.tok.T_FOR)&&this.next();var e=[],i=[],n=[],s=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?(n=this.read_list(this.read_expr,","),this.expect(")")&&this.next()):this.next(),":"===this.token?(r=!0,s=this.read_short_form(this.tok.T_ENDFOR)):s=this.read_statement(),t(e,i,n,s,r)},read_foreach:function(){var t=this.node("foreach");this.expect(this.tok.T_FOREACH)&&this.next();var e,i=null,n=null,s=null,r=!1;return this.expect("(")&&this.next(),e=this.read_expr(),this.expect(this.tok.T_AS)&&(this.next(),n=this.read_foreach_variable(),this.token===this.tok.T_DOUBLE_ARROW&&(i=n,n=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,s=this.read_short_form(this.tok.T_ENDFOREACH)):s=this.read_statement(),t(e,i,n,s,r)},read_foreach_variable:function(){if(this.token===this.tok.T_LIST||"["===this.token){var t="["===this.token,e=this.node("list");this.next(),!t&&this.expect("(")&&this.next();var i=this.read_array_pair_list(t);return this.expect(t?"]":")")&&this.next(),e(i,t)}return this.read_variable(!1,!1)}};R.read_while,R.read_do,R.read_for,R.read_foreach,R.read_foreach_variable;var w={read_start:function(){return this.token==this.tok.T_NAMESPACE?this.read_namespace():this.read_top_statement()}};w.read_start;var D={read_namespace:function(){var t,e,i=this.node("namespace");return this.expect(this.tok.T_NAMESPACE)&&this.next(),e="{"==this.token?{name:[""]}:this.read_namespace_name(),this.currentNamespace=e,";"==this.token?(this.currentNamespace=e,t=this.next().read_top_statements(),this.expect(this.EOF),i(e.name,t,!1)):"{"==this.token?(this.currentNamespace=e,t=this.next().read_top_statements(),this.expect("}")&&this.next(),0===t.length&&this.extractDoc&&this._docs.length>this._docIndex&&t.push(this.node("noop")()),i(e.name,t,!0)):"("===this.token?(e.resolution=this.ast.reference.RELATIVE_NAME,e.name=e.name.substring(1),i.destroy(),this.node("call")(e,this.read_argument_list())):(this.error(["{",";"]),this.currentNamespace=e,t=this.read_top_statements(),this.expect(this.EOF),i(e,t,!1))},read_namespace_name:function(t){var e=this.node(),i=!1;this.token===this.tok.T_NAMESPACE&&(this.next().expect(this.tok.T_NS_SEPARATOR)&&this.next(),i=!0);var n=this.read_list(this.tok.T_STRING,this.tok.T_NS_SEPARATOR,!0);if(!i&&1===n.length&&(t||"("!==this.token)){if("parent"===n[0].toLowerCase())return e("parentreference",n[0]);if("self"===n[0].toLowerCase())return e("selfreference",n[0])}return e("name",n,i)},read_use_statement:function(){var t=this.node("usegroup"),e=[],i=null;this.expect(this.tok.T_USE)&&this.next();var n=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===n),this.expect("}")&&this.next()),t=t(i,n,e),this.expect(";")&&this.next(),t},read_class_name_reference:function(){return this.read_variable(!0,!1)},read_use_declaration:function(t){var e=this.node("useitem"),i=null;t&&(i=this.read_use_type());var n=this.read_namespace_name(),s=this.read_use_alias();return e(n.name,s,i)},read_use_declarations:function(t){for(var e=[this.read_use_declaration(t)];","===this.token;){if(this.next(),t){if(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_STRING&&this.token!==this.tok.T_NS_SEPARATOR)break;e.push(this.read_use_declaration(t))}return e},read_use_alias:function(){var t=null;if(this.token===this.tok.T_AS&&this.next().expect(this.tok.T_STRING)){var 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}};D.read_namespace,D.read_namespace_name,D.read_use_statement,D.read_class_name_reference,D.read_use_declaration,D.read_use_declarations,D.read_use_alias,D.read_use_type;var P={"\\":"\\",$:"$",n:"\n",r:"\r",t:"\t",f:String.fromCharCode(12),v:String.fromCharCode(11),e:String.fromCharCode(27)},U={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,(function(t,e,i){return P[e]?P[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,n){if(0===e)return t;this.check_heredoc_indentation_level(t,e,i,n);var s=i?" ":"\t",r=new RegExp("\\n".concat(s,"{").concat(e,"}"),"g"),o=new RegExp("^".concat(s,"{").concat(e,"}"));return n&&(t=t.replace(o,"")),t.replace(r,"\n")},check_heredoc_indentation_level:function(t,e,i,n){var s=t.length,r=0,o=0,a=!0,h=i?" ":"\t",l=!1;if(!n){if(-1===(r=t.indexOf("\n")))return;r++}for(;r<s;)a?t[r]===h?o++:l=!0:a=!1,"\n"!==t[r]&&l&&o<e?this.raiseError("Invalid body indentation level (expecting an indentation at least ".concat(e,")")):l=!1,"\n"===t[r]&&(a=!0,o=0),r++},read_dereferencable_scalar:function(){var t=null;switch(this.token){case this.tok.T_CONSTANT_ENCAPSED_STRING:var e=this.node("string"),i=this.text(),n=0;"b"!==i[0]&&"B"!==i[0]||(n=1);var s='"'===i[n];this.next(),e=e(s,this.resolve_special_chars(i.substring(n+1,i.length-1),s),1===n,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();var t,e;switch(this.token){case this.tok.T_LNUMBER:case this.tok.T_DNUMBER:var i=this.node("number");return t=this.text(),this.next(),i(t,null);case this.tok.T_START_HEREDOC:if("ST_NOWDOC"===this.lexer.curCondition){var n=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));var 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();var r=this.lexer._input.substring(n,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),r,this.lexer.heredoc_label.label)}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:var o=this.error("SCALAR");return this.next(),o}},read_dereferencable:function(t){var e,i,n=this.node("offsetlookup");return"["===this.token?(i=this.next().read_expr(),this.expect("]")&&this.next(),e=n(t,i)):this.token===this.tok.T_DOLLAR_OPEN_CURLY_BRACES&&(e=n(t,i=this.read_encapsed_string_item(!1))),e},read_encapsed_string_item:function(t){var e,i,n,s=this.node("encapsedpart"),r=null,o=!1,a=this.node();if(this.token===this.tok.T_ENCAPSED_AND_WHITESPACE){var h=this.text();this.next(),a=a("string",!1,this.version>=703&&!this.lexer.heredoc_label.finished?this.remove_heredoc_leading_whitespace_chars(this.resolve_special_chars(h,t),this.lexer.heredoc_label.indentation,this.lexer.heredoc_label.indentation_uses_spaces,this.lexer.heredoc_label.first_encaps_node):h,!1,h)}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");var l=this.text();this.next(),"["===this.token?(n=n(l,!1),i=this.node("offsetlookup"),e=this.next().read_expr(),this.expect("]")&&this.next(),a=i(n,e)):a=n(l,!1)}else a=a("variable",this.read_expr(),!1);this.expect("}")&&this.next()}else if(this.token===this.tok.T_CURLY_OPEN)r="complex",a.destroy(),a=this.next().read_variable(!1,!1),this.expect("}")&&this.next();else if(this.token===this.tok.T_VARIABLE){if(r="simple",a.destroy(),a=this.read_simple_variable(),"["===this.token&&(i=this.node("offsetlookup"),e=this.next().read_encaps_var_offset(),this.expect("]")&&this.next(),a=i(a,e)),this.token===this.tok.T_OBJECT_OPERATOR){i=this.node("propertylookup"),this.next().expect(this.tok.T_STRING);var c=this.node("identifier");n=this.text(),this.next(),a=i(a,c(n))}}else{this.expect(this.tok.T_ENCAPSED_AND_WHITESPACE);var u=this.text();this.next(),a.destroy(),a=a("string",!1,u,!1,u)}return this.lexer.heredoc_label.first_encaps_node=!1,s(a,r,o)},read_encapsed_string:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=this.lexer.yylloc.first_offset,n=this.node("encapsed");this.next();var s=this.lexer.yylloc.prev_offset-(e?1:0),r=[],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){var a=r[r.length-1].expression,h=a.value[a.value.length-1];"\n"===h?"\r"===a.value[a.value.length-2]?a.value=a.value.substring(0,a.value.length-2):a.value=a.value.substring(0,a.value.length-1):"\r"===h&&(a.value=a.value.substring(0,a.value.length-1))}this.expect(t)&&this.next();var l=this.lexer._input.substring("heredoc"===o?i:s-1,this.lexer.yylloc.first_offset);return n=n(r,l,o),t===this.tok.T_END_HEREDOC&&(n.label=this.lexer.heredoc_label.label,this.lexer.heredoc_label.finished=!0),n},get_magic_constant:function(){var t=this.node("magic"),e=this.text();return this.next(),t(e.toUpperCase(),e)}};U.resolve_special_chars,U.remove_heredoc_leading_whitespace_chars,U.check_heredoc_indentation_level,U.read_dereferencable_scalar,U.read_scalar,U.read_dereferencable,U.read_encapsed_string_item,U.read_encapsed_string,U.get_magic_constant;var B={read_top_statements:function(){for(var t=[];this.token!==this.EOF&&"}"!==this.token;){var e=this.read_top_statement();e&&(Array.isArray(e)?t=t.concat(e):t.push(e))}return t},read_top_statement:function(){var 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_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_USE:return this.read_use_statement();case this.tok.T_CONST:var e=this.node("constantstatement"),i=this.next().read_const_list();return this.expectEndOfStatement(),e(null,i);case this.tok.T_NAMESPACE:return this.read_namespace();case this.tok.T_HALT_COMPILER:var n=this.node("halt");return this.next().expect("(")&&this.next(),this.expect(")")&&this.next(),this.expect(";"),this.lexer.done=!0,n(this.lexer._input.substring(this.lexer.offset));default:return this.read_statement()}},read_inner_statements:function(){for(var t=[];this.token!=this.EOF&&"}"!==this.token;){var 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);var t=this.node("constant"),e=this.node("identifier"),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(){for(var t=[];this.token!=this.EOF&&")"!==this.token;){this.expect(this.tok.T_STRING);var e=this.node("declaredirective"),i=this.node("identifier"),n=this.text();this.next(),i=i(n);var s=null;if(this.expect("=")&&(s=this.next().read_expr()),t.push(e(i,s)),","!==this.token)break;this.next()}return t},read_inner_statement:function(){var t=[];switch(this.token===this.tok.T_ATTRIBUTE&&(t=this.read_attr_list()),this.token){case this.tok.T_FUNCTION:var 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_HALT_COMPILER:this.raiseError("__HALT_COMPILER() can only be used from the outermost scope");var i=this.node("halt");return this.next().expect("(")&&this.next(),this.expect(")")&&this.next(),i=i(this.lexer._input.substring(this.lexer.offset)),this.expect(";")&&this.next(),i;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:var t=this.node("return");this.next();var e=this.read_optional_expr(";");return this.expectEndOfStatement(),t(e);case this.tok.T_BREAK:case this.tok.T_CONTINUE:var i=this.node(this.token===this.tok.T_CONTINUE?"continue":"break");this.next();var n=this.read_optional_expr(";");return this.expectEndOfStatement(),i(n);case this.tok.T_GLOBAL:var s=this.node("global"),r=this.next().read_list(this.read_simple_variable,",");return this.expectEndOfStatement(),s(r);case this.tok.T_STATIC:var o=[this.token,this.lexer.getState()],a=this.node();if(this.next().token===this.tok.T_DOUBLE_COLON){this.lexer.tokens.push(o);var h=this.next().read_expr();return this.expectEndOfStatement(h),a("expressionstatement",h)}if(this.token===this.tok.T_FUNCTION)return this.read_function(!0,[0,1,0]);var l=this.read_variable_declarations();return this.expectEndOfStatement(),a("static",l);case this.tok.T_ECHO:var c=this.node("echo"),u=this.text(),_="<?="===u||"<%="===u,d=this.next().read_function_list(this.read_expr,",");return this.expectEndOfStatement(),c(d,_);case this.tok.T_INLINE_HTML:var p=this.text(),f=this.lexer.yylloc.first_offset>0?this.lexer._input[this.lexer.yylloc.first_offset-1]:null,T="\r"===f||"\n"===f;T&&"\n"===f&&this.lexer.yylloc.first_offset>1&&"\r"===this.lexer._input[this.lexer.yylloc.first_offset-2]&&(f="\r\n");var k=this.node("inline");return this.next(),k(p,T?f+p:p);case this.tok.T_UNSET:var m=this.node("unset");this.next().expect("(")&&this.next();var E=this.read_function_list(this.read_variable,",");return this.expect(")")&&this.next(),this.expect(";")&&this.next(),m(E);case this.tok.T_DECLARE:var x,y=this.node("declare"),v=[];this.next().expect("(")&&this.next();var A=this.read_declare_list();if(this.expect(")")&&this.next(),":"===this.token){for(this.next();this.token!=this.EOF&&this.token!==this.tok.T_ENDDECLARE;)v.push(this.read_top_statement());0===v.length&&this.extractDoc&&this._docs.length>this._docIndex&&v.push(this.node("noop")()),this.expect(this.tok.T_ENDDECLARE)&&this.next(),this.expectEndOfStatement(),x=this.ast.declare.MODE_SHORT}else if("{"===this.token){for(this.next();this.token!=this.EOF&&"}"!==this.token;)v.push(this.read_top_statement());0===v.length&&this.extractDoc&&this._docs.length>this._docIndex&&v.push(this.node("noop")()),this.expect("}")&&this.next(),x=this.ast.declare.MODE_BLOCK}else this.expect(";")&&this.next(),x=this.ast.declare.MODE_NONE;return y(A,v,x);case this.tok.T_TRY:return this.read_try();case this.tok.T_THROW:var g=this.node("throw"),N=this.next().read_expr();return this.expectEndOfStatement(),g(N);case";":return this.next(),null;case this.tok.T_STRING:var C=this.node(),S=[this.token,this.lexer.getState()],b=this.text(),L=this.node("identifier");if(":"===this.next().token)return L=L(b),this.next(),C("label",L);L.destroy(),C.destroy(),this.lexer.tokens.push(S);var O=this.node("expressionstatement"),I=this.next().read_expr();return this.expectEndOfStatement(I),O(I);case this.tok.T_GOTO:var R=this.node("goto"),w=null;if(this.next().expect(this.tok.T_STRING)){w=this.node("identifier");var D=this.text();this.next(),w=w(D),this.expectEndOfStatement()}return R(w);default:var P=this.node("expressionstatement"),U=this.read_expr();return this.expectEndOfStatement(U),P(U)}},read_code_block:function(t){var e=this.node("block");this.expect("{")&&this.next();var 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)}};B.read_top_statements,B.read_top_statement,B.read_inner_statements,B.read_const_list,B.read_declare_list,B.read_inner_statement,B.read_statement,B.read_code_block;var M={read_switch:function(){var t=this.node("switch");this.expect(this.tok.T_SWITCH)&&this.next(),this.expect("(")&&this.next();var e=this.read_expr();this.expect(")")&&this.next();var i=":"===this.token;return t(e,this.read_switch_case_list(),i)},read_switch_case_list:function(){var t=null,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){var e=this.node("case"),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();for(var n=this.node("block"),s=[];this.token!==this.EOF&&this.token!==t&&this.token!==this.tok.T_CASE&&this.token!==this.tok.T_DEFAULT;)s.push(this.read_inner_statement());return e(i,n(null,s))}};M.read_switch,M.read_switch_case_list,M.read_case_list;var F={read_try:function(){this.expect(this.tok.T_TRY);for(var t=this.node("try"),e=null,i=[],n=this.next().read_statement();this.token===this.tok.T_CATCH;){var s=this.node("catch");this.next().expect("(")&&this.next();var r=this.read_list(this.read_namespace_name,"|",!1),o=null;this.token===this.tok.T_VARIABLE&&(o=this.read_variable(!0,!1)),this.expect(")"),i.push(s(this.next().read_statement(),r,o))}return this.token===this.tok.T_FINALLY&&(e=this.next().read_statement()),t(n,i,e)}};F.read_try;var H={read_short_form:function(t){var 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){var 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){var n=[];if(this.token==e&&(i&&n.push("function"==typeof t?this.node("noop")():null),this.next()),"function"==typeof t)do{var s=t.apply(this,[]);if(s&&n.push(s),this.token!=e)break}while(this.next().token!=this.EOF);else{if(!this.expect(t))return[];for(n.push(this.text());this.next().token!=this.EOF&&this.token==e&&this.next().token==t;)n.push(this.text())}return n},read_name_list:function(){return this.read_list(this.read_namespace_name,",",!1)},read_byref:function(t){var e=this.node("byref");this.next(),e=e(null);var i=t();return i&&(this.ast.swapLocations(i,e,i,this),i.byref=!0),i},read_variable_declarations:function(){return this.read_list((function(){var t=this.node("staticvariable"),e=this.node("variable");if(this.expect(this.tok.T_VARIABLE)){var i=this.text().substring(1);this.next(),e=e(i,!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}};H.read_short_form,H.read_function_list,H.read_list,H.read_name_list,H.read_byref,H.read_variable_declarations,H.read_extends_from,H.read_interface_extends_list,H.read_implements_list;var G={read_variable:function(t,e){var 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_NAMESPACE])){i=this.node();var n=this.read_namespace_name();if(this.token!=this.tok.T_DOUBLE_COLON&&"("!=this.token&&-1===["parentreference","selfreference"].indexOf(n.kind)){var s=n.name.toLowerCase();"true"===s?i=n.destroy(i("boolean",!0,n.name)):"false"===s?i=n.destroy(i("boolean",!1,n.name)):"null"===s?i=n.destroy(i("nullkeyword",n.name)):(i.destroy(n),i=n)}else i.destroy(n),i=n}else if(this.token===this.tok.T_STATIC){i=this.node("staticreference");var r=this.text();this.next(),i=i(r)}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){var i,n,s=this.node("staticlookup");return this.next().is([this.tok.T_VARIABLE,"$"])?i=this.read_reference_variable(e):this.token===this.tok.T_STRING||this.token===this.tok.T_CLASS||this.version>=700&&this.is("IDENTIFIER")?(i=this.node("identifier"),n=this.text(),this.next(),i=i(n)):"{"===this.token?(i=this.node("literal"),n=this.next().read_expr(),this.expect("}")&&this.next(),i=i("literal",n,null),this.expect("(")):(this.error([this.tok.T_VARIABLE,this.tok.T_STRING]),i=this.node("identifier"),n=this.text(),this.next(),i=i(n)),s(t,i)},read_what:function(){var 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)):e=e("variable",i=this.read_expr(),!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){var n,s;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"{":var r="["===this.token;if(n=this.node("offsetlookup"),this.next(),s=!1,i)s=this.read_encaps_var_offset(),this.expect(r?"]":"}")&&this.next();else(r?"]"!==this.token:"}"!==this.token)?(s=this.read_expr(),this.expect(r?"]":"}")&&this.next()):this.next();t=n(t,s);break;case this.tok.T_DOUBLE_COLON:"staticlookup"===t.kind&&"identifier"===t.offset.kind&&this.error(),t=(n=this.node("staticlookup"))(t,this.read_what(!0));break;case this.tok.T_OBJECT_OPERATOR:t=(n=this.node("propertylookup"))(t,this.read_what());break;case this.tok.T_NULLSAFE_OBJECT_OPERATOR:t=(n=this.node("nullsafepropertylookup"))(t,this.read_what());break;default:break t}return t},read_encaps_var_offset:function(){var t=this.node();if(this.token===this.tok.T_STRING){var e=this.text();this.next(),t=t("identifier",e)}else if(this.token===this.tok.T_NUM_STRING){var i=this.text();this.next(),t=t("number",i,null)}else if("-"===this.token){this.next();var n=-1*this.text();this.expect(this.tok.T_NUM_STRING)&&this.next(),t=t("number",n,null)}else if(this.token===this.tok.T_VARIABLE){var s=this.text().substring(1);this.next(),t=t("variable",s,!1)}else{this.expect([this.tok.T_STRING,this.tok.T_NUM_STRING,"-",this.tok.T_VARIABLE]);var r=this.text();this.next(),t=t("identifier",r)}return t},read_reference_variable:function(t){for(var e,i=this.read_simple_variable();this.token!=this.EOF;){var n=this.node();if("{"!=this.token||t){n.destroy();break}e=this.next().read_expr(),this.expect("}")&&this.next(),i=n("offsetlookup",i,e)}return i},read_simple_variable:function(){var 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"{":var i=this.next().read_expr();this.expect("}")&&this.next(),e=e(i,!0);break;case"$":e=e(this.read_simple_variable(),!1);break;case this.tok.T_VARIABLE:t=this.text().substring(1);var n=this.node("variable");this.next(),e=e(n(t,!1),!1);break;default:this.error(["{","$",this.tok.T_VARIABLE]),t=this.text(),this.next(),e=e(t,!1)}return e}};function V(t){return"."!=t&&","!=t&&!isNaN(parseFloat(t))&&isFinite(t)}G.read_variable,G.read_static_getter,G.read_what,G.recursive_variable_chain_scan,G.read_encaps_var_offset,G.read_reference_variable,G.read_simple_variable;var W=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=800,this.extractDoc=!1,this.extractTokens=!1,this.suppressErrors=!1;var 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_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_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_NS_SEPARATOR,this.tok.T_STRING,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_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))}};W.prototype.getTokenName=function(t){return V(t)?t==this.EOF?"the end of file (EOF)":this.lexer.engine.tokens.values[t]:"'"+t+"'"},W.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;var i=this.node("program"),n=[];for(this.next();this.token!=this.EOF;)n.push(this.read_start());0===n.length&&this.extractDoc&&this._docs.length>this._docIndex&&n.push(this.node("noop")()),this.prev=[this.lexer.yylloc.last_line,this.lexer.yylloc.last_column,this.lexer.offset];var s=i(n,this._errors,this._docs,this._tokens);if(this.debug){var r=this.ast.checkNodes();if(r.length>0)throw r.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 s},W.prototype.raiseError=function(t,e,i,n){if(t+=" on line "+this.lexer.yylloc.first_line,!this.suppressErrors){var s=new SyntaxError(t,this.filename,this.lexer.yylloc.first_line);throw s.lineNumber=this.lexer.yylloc.first_line,s.fileName=this.filename,s.columnNumber=this.lexer.yylloc.first_column,s}var r=this.ast.prepare("error",null,this)(t,n,this.lexer.yylloc.first_line,i);return this._errors.push(r),r},W.prototype.error=function(t){var e="Parse Error : syntax error",i=this.getTokenName(this.token),n="";if(this.token!==this.EOF){if(V(this.token)){var s=this.text();s.length>10&&(s=s.substring(0,7)+"..."),i="'"+s+"' ("+i+")"}e+=", unexpected "+i}return t&&!Array.isArray(t)&&((V(t)||1===t.length)&&(n=", expecting "+this.getTokenName(t)),e+=n),this.raiseError(e,n,t,i)},W.prototype.node=function(t){if(this.extractDoc){var 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)));var i=this.ast.prepare(t,e,this);return i.postBuild=function(t){if(this._docIndex<this._docs.length)if(this._lastNode){for(var e=this.prev[2],i=this._docIndex;i<this._docs.length&&!(this._docs[i].offset>e);i++);i>this._docIndex&&(this._lastNode.setTrailingComments(this._docs.slice(this._docIndex,i)),this._docIndex=i)}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)},W.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};var Q=["parser.next","parser.node","parser.showlog"];W.prototype.showlog=function(){for(var t,e=(new Error).stack.split("\n"),i=2;i<e.length;i++){t=e[i].trim();for(var n=!1,s=0;s<Q.length;s++)if(t.substring(3,3+Q[s].length)===Q[s]){n=!0;break}if(!n)break}return console.log("Line "+this.lexer.yylloc.first_line+" : "+this.getTokenName(this.token)+">"+this.lexer.yytext+"< @--\x3e"+t),this},W.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},W.prototype.text=function(){return this.lexer.yytext},W.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},W.prototype.lex=function(){if(this.extractTokens)do{if(this.token=this.lexer.lex()||this.EOF,this.token===this.EOF)return this;var t=this.lexer.yytext;if(t=this.lexer.engine.tokens.values.hasOwnProperty(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},W.prototype.is=function(t){return Array.isArray(t)?-1!==t.indexOf(this.token):this.entries[t].has(this.token)},[m,S,b,L,O,I,R,w,D,U,B,M,F,H,G].forEach((function(t){for(var e in t){if(W.prototype.hasOwnProperty(e))throw new Error("Function "+e+" is already defined - collision");W.prototype[e]=t[e]}}));var Y=W,j={values:{101:"T_HALT_COMPILER",102:"T_USE",103:"T_ENCAPSED_AND_WHITESPACE",104:"T_OBJECT_OPERATOR",105:"T_STRING",106:"T_DOLLAR_OPEN_CURLY_BRACES",107:"T_STRING_VARNAME",108:"T_CURLY_OPEN",109:"T_NUM_STRING",110:"T_ISSET",111:"T_EMPTY",112:"T_INCLUDE",113:"T_INCLUDE_ONCE",114:"T_EVAL",115:"T_REQUIRE",116:"T_REQUIRE_ONCE",117:"T_NAMESPACE",118:"T_NS_SEPARATOR",119:"T_AS",120:"T_IF",121:"T_ENDIF",122:"T_WHILE",123:"T_DO",124:"T_FOR",125:"T_SWITCH",126:"T_BREAK",127:"T_CONTINUE",128:"T_RETURN",129:"T_GLOBAL",130:"T_STATIC",131:"T_ECHO",132:"T_INLINE_HTML",133:"T_UNSET",134:"T_FOREACH",135:"T_DECLARE",136:"T_TRY",137:"T_THROW",138:"T_GOTO",139:"T_FINALLY",140:"T_CATCH",141:"T_ENDDECLARE",142:"T_LIST",143:"T_CLONE",144:"T_PLUS_EQUAL",145:"T_MINUS_EQUAL",146:"T_MUL_EQUAL",147:"T_DIV_EQUAL",148:"T_CONCAT_EQUAL",149:"T_MOD_EQUAL",150:"T_AND_EQUAL",151:"T_OR_EQUAL",152:"T_XOR_EQUAL",153:"T_SL_EQUAL",154:"T_SR_EQUAL",155:"T_INC",156:"T_DEC",157:"T_BOOLEAN_OR",158:"T_BOOLEAN_AND",159:"T_LOGICAL_OR",160:"T_LOGICAL_AND",161:"T_LOGICAL_XOR",162:"T_SL",163:"T_SR",164:"T_IS_IDENTICAL",165:"T_IS_NOT_IDENTICAL",166:"T_IS_EQUAL",167:"T_IS_NOT_EQUAL",168:"T_IS_SMALLER_OR_EQUAL",169:"T_IS_GREATER_OR_EQUAL",170:"T_INSTANCEOF",171:"T_INT_CAST",172:"T_DOUBLE_CAST",173:"T_STRING_CAST",174:"T_ARRAY_CAST",175:"T_OBJECT_CAST",176:"T_BOOL_CAST",177:"T_UNSET_CAST",178:"T_EXIT",179:"T_PRINT",180:"T_YIELD",181:"T_YIELD_FROM",182:"T_FUNCTION",183:"T_DOUBLE_ARROW",184:"T_DOUBLE_COLON",185:"T_ARRAY",186:"T_CALLABLE",187:"T_CLASS",188:"T_ABSTRACT",189:"T_TRAIT",190:"T_FINAL",191:"T_EXTENDS",192:"T_INTERFACE",193:"T_IMPLEMENTS",194:"T_VAR",195:"T_PUBLIC",196:"T_PROTECTED",197:"T_PRIVATE",198:"T_CONST",199:"T_NEW",200:"T_INSTEADOF",201:"T_ELSEIF",202:"T_ELSE",203:"T_ENDSWITCH",204:"T_CASE",205:"T_DEFAULT",206:"T_ENDFOR",207:"T_ENDFOREACH",208:"T_ENDWHILE",209:"T_CONSTANT_ENCAPSED_STRING",210:"T_LNUMBER",211:"T_DNUMBER",212:"T_LINE",213:"T_FILE",214:"T_DIR",215:"T_TRAIT_C",216:"T_METHOD_C",217:"T_FUNC_C",218:"T_NS_C",219:"T_START_HEREDOC",220:"T_END_HEREDOC",221:"T_CLASS_C",222:"T_VARIABLE",223:"T_OPEN_TAG",224:"T_OPEN_TAG_WITH_ECHO",225:"T_CLOSE_TAG",226:"T_WHITESPACE",227:"T_COMMENT",228:"T_DOC_COMMENT",229:"T_ELLIPSIS",230:"T_COALESCE",231:"T_POW",232:"T_POW_EQUAL",233:"T_SPACESHIP",234:"T_COALESCE_EQUAL",235:"T_FN",236:"T_NULLSAFE_OBJECT_OPERATOR",237:"T_MATCH",238:"T_ATTRIBUTE"},names:{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}},$=function(t,e,i){this.source=t,this.start=e,this.end=i},z=function(t,e,i){this.line=t,this.column=e,this.offset=i},K=function(t,e,i){this.kind=t,e&&(this.leadingComments=e),i&&(this.loc=i)};K.prototype.setTrailingComments=function(t){this.trailingComments=t},K.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},K.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},K.extends=function(t,e){return e.prototype=Object.create(this.prototype),e.extends=this.extends,e.prototype.constructor=e,e.kind=t,e};var X=K,J="expression",q=X.extends(J,(function(t,e,i){X.apply(this,[t||J,e,i])})),Z="array",tt=q.extends(Z,(function(t,e,i,n){q.apply(this,[Z,i,n]),this.items=e,this.shortForm=t})),et="arrowfunc",it=q.extends(et,(function(t,e,i,n,s,r,o,a){q.apply(this,[et,o,a]),this.arguments=t,this.byref=e,this.body=i,this.type=n,this.nullable=s,this.isStatic=r||!1})),nt="assign",st=q.extends(nt,(function(t,e,i,n,s){q.apply(this,[nt,n,s]),this.left=t,this.right=e,this.operator=i})),rt="assignref",ot=q.extends(rt,(function(t,e,i,n){q.apply(this,[rt,i,n]),this.left=t,this.right=e})),at="attribute",ht=X.extends(at,(function(t,e,i,n){X.apply(this,[at,i,n]),this.name=t,this.args=e})),lt="attrgroup",ct=X.extends(lt,(function(t,e,i){X.apply(this,[lt,e,i]),this.attrs=t||[]})),ut="operation",_t=q.extends(ut,(function(t,e,i){q.apply(this,[t||ut,e,i])})),dt=_t.extends("bin",(function(t,e,i,n,s){_t.apply(this,["bin",n,s]),this.type=t,this.left=e,this.right=i})),pt="statement",ft=X.extends(pt,(function(t,e,i){X.apply(this,[t||pt,e,i])})),Tt="block",kt=ft.extends(Tt,(function(t,e,i,n){ft.apply(this,[t||Tt,i,n]),this.children=e.filter(Boolean)})),mt="literal",Et=q.extends(mt,(function(t,e,i,n,s){q.apply(this,[t||mt,n,s]),this.value=e,i&&(this.raw=i)})),xt="boolean",yt=Et.extends(xt,(function(t,e,i,n){Et.apply(this,[xt,t,e,i,n])})),vt="break",At=ft.extends(vt,(function(t,e,i){ft.apply(this,[vt,e,i]),this.level=t})),gt="byref",Nt=q.extends(gt,(function(t,e,i){q.apply(this,[gt,e,i]),this.what=t})),Ct="call",St=q.extends(Ct,(function(t,e,i,n){q.apply(this,[Ct,i,n]),this.what=t,this.arguments=e})),bt="case",Lt=ft.extends(bt,(function(t,e,i,n){ft.apply(this,[bt,i,n]),this.test=t,this.body=e})),Ot="cast",It=_t.extends(Ot,(function(t,e,i,n,s){_t.apply(this,[Ot,n,s]),this.type=t,this.raw=e,this.expr=i})),Rt="catch",wt=ft.extends(Rt,(function(t,e,i,n,s){ft.apply(this,[Rt,n,s]),this.body=t,this.what=e,this.variable=i})),Dt="declaration",Pt=ft.extends(Dt,(function(t,e,i,n){ft.apply(this,[t||Dt,i,n]),this.name=e}));Pt.prototype.parseFlags=function(t){this.isAbstract=1===t[2],this.isFinal=2===t[2],"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 Ut=Pt,Bt="class",Mt=Ut.extends(Bt,(function(t,e,i,n,s,r,o){Ut.apply(this,[Bt,t,r,o]),this.isAnonymous=!t,this.extends=e,this.implements=i,this.body=n,this.attrGroups=[],this.parseFlags(s)})),Ft="constantstatement",Ht=ft.extends(Ft,(function(t,e,i,n){ft.apply(this,[t||Ft,i,n]),this.constants=e})),Gt="classconstant",Vt=Ht.extends(Gt,(function(t,e,i,n,s,r){Ht.apply(this,[t||Gt,e,s,r]),this.parseFlags(i),this.attrGroups=n}));Vt.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")};var Wt=Vt,Qt="clone",Yt=q.extends(Qt,(function(t,e,i){q.apply(this,[Qt,e,i]),this.what=t})),jt="closure",$t=q.extends(jt,(function(t,e,i,n,s,r,o,a){q.apply(this,[jt,o,a]),this.uses=i,this.arguments=t,this.byref=e,this.type=n,this.nullable=s,this.isStatic=r||!1,this.body=null,this.attrGroups=[]})),zt=X.extends("comment",(function(t,e,i,n){X.apply(this,[t,i,n]),this.value=e})),Kt="commentblock",Xt=zt.extends(Kt,(function(t,e,i){zt.apply(this,[Kt,t,e,i])})),Jt="commentline",qt=zt.extends(Jt,(function(t,e,i){zt.apply(this,[Jt,t,e,i])})),Zt="constant",te=X.extends(Zt,(function(t,e,i,n){X.apply(this,[Zt,i,n]),this.name=t,this.value=e})),ee="continue",ie=ft.extends(ee,(function(t,e,i){ft.apply(this,[ee,e,i]),this.level=t})),ne="declare",se=kt.extends(ne,(function(t,e,i,n,s){kt.apply(this,[ne,e,n,s]),this.directives=t,this.mode=i}));se.MODE_SHORT="short",se.MODE_BLOCK="block",se.MODE_NONE="none";var re=se,oe="declaredirective",ae=X.extends(oe,(function(t,e,i,n){X.apply(this,[oe,i,n]),this.key=t,this.value=e})),he=ft.extends("do",(function(t,e,i,n){ft.apply(this,["do",i,n]),this.test=t,this.body=e})),le="echo",ce=ft.extends(le,(function(t,e,i,n){ft.apply(this,[le,i,n]),this.shortForm=e,this.expressions=t})),ue="empty",_e=q.extends(ue,(function(t,e,i){q.apply(this,[ue,e,i]),this.expression=t})),de="encapsed",pe=Et.extends(de,(function(t,e,i,n,s){Et.apply(this,[de,t,e,n,s]),this.type=i}));pe.TYPE_STRING="string",pe.TYPE_SHELL="shell",pe.TYPE_HEREDOC="heredoc",pe.TYPE_OFFSET="offset";var fe=pe,Te="encapsedpart",ke=q.extends(Te,(function(t,e,i,n,s){q.apply(this,[Te,n,s]),this.expression=t,this.syntax=e,this.curly=i})),me="entry",Ee=q.extends(me,(function(t,e,i,n,s,r){q.apply(this,[me,s,r]),this.key=t,this.value=e,this.byRef=i,this.unpack=n})),xe="error",ye=X.extends(xe,(function(t,e,i,n,s,r){X.apply(this,[xe,s,r]),this.message=t,this.token=e,this.line=i,this.expected=n})),ve="eval",Ae=q.extends(ve,(function(t,e,i){q.apply(this,[ve,e,i]),this.source=t})),ge="exit",Ne=q.extends(ge,(function(t,e,i,n){q.apply(this,[ge,i,n]),this.expression=t,this.useDie=e})),Ce="expressionstatement",Se=ft.extends(Ce,(function(t,e,i){ft.apply(this,[Ce,e,i]),this.expression=t})),be=ft.extends("for",(function(t,e,i,n,s,r,o){ft.apply(this,["for",r,o]),this.init=t,this.test=e,this.increment=i,this.shortForm=s,this.body=n})),Le="foreach",Oe=ft.extends(Le,(function(t,e,i,n,s,r,o){ft.apply(this,[Le,r,o]),this.source=t,this.key=e,this.value=i,this.shortForm=s,this.body=n})),Ie="function",Re=Ut.extends(Ie,(function(t,e,i,n,s,r,o){Ut.apply(this,[Ie,t,r,o]),this.arguments=e,this.byref=i,this.type=n,this.nullable=s,this.body=null,this.attrGroups=[]})),we="global",De=ft.extends(we,(function(t,e,i){ft.apply(this,[we,e,i]),this.items=t})),Pe="goto",Ue=ft.extends(Pe,(function(t,e,i){ft.apply(this,[Pe,e,i]),this.label=t})),Be="halt",Me=ft.extends(Be,(function(t,e,i){ft.apply(this,[Be,e,i]),this.after=t})),Fe="identifier",He=X.extends(Fe,(function(t,e,i){X.apply(this,[Fe,e,i]),this.name=t})),Ge=ft.extends("if",(function(t,e,i,n,s,r){ft.apply(this,["if",s,r]),this.test=t,this.body=e,this.alternate=i,this.shortForm=n})),Ve="include",We=q.extends(Ve,(function(t,e,i,n,s){q.apply(this,[Ve,n,s]),this.once=t,this.require=e,this.target=i})),Qe="inline",Ye=Et.extends(Qe,(function(t,e,i,n){Et.apply(this,[Qe,t,e,i,n])})),je="interface",$e=Ut.extends(je,(function(t,e,i,n,s,r){Ut.apply(this,[je,t,s,r]),this.extends=e,this.body=i,this.attrGroups=n})),ze="isset",Ke=q.extends(ze,(function(t,e,i){q.apply(this,[ze,e,i]),this.variables=t})),Xe="label",Je=ft.extends(Xe,(function(t,e,i){ft.apply(this,[Xe,e,i]),this.name=t})),qe="list",Ze=q.extends(qe,(function(t,e,i,n){q.apply(this,[qe,i,n]),this.items=t,this.shortForm=e})),ti="lookup",ei=q.extends(ti,(function(t,e,i,n,s){q.apply(this,[t||ti,n,s]),this.what=e,this.offset=i})),ii="magic",ni=Et.extends(ii,(function(t,e,i,n){Et.apply(this,[ii,t,e,i,n])})),si="match",ri=q.extends(si,(function(t,e,i,n){q.apply(this,[si,i,n]),this.cond=t,this.arms=e})),oi="matcharm",ai=q.extends(oi,(function(t,e,i,n){q.apply(this,[oi,i,n]),this.conds=t,this.body=e})),hi="method",li=Re.extends(hi,(function(){Re.apply(this,arguments),this.kind=hi})),ci="reference",ui=X.extends(ci,(function(t,e,i){X.apply(this,[t||ci,e,i])})),_i="name",di=ui.extends(_i,(function t(e,i,n,s){ui.apply(this,[_i,n,s]),i?this.resolution=t.RELATIVE_NAME:1===e.length?this.resolution=t.UNQUALIFIED_NAME:e[0]?this.resolution=t.QUALIFIED_NAME:this.resolution=t.FULL_QUALIFIED_NAME,this.name=e.join("\\")}));di.UNQUALIFIED_NAME="uqn",di.QUALIFIED_NAME="qn",di.FULL_QUALIFIED_NAME="fqn",di.RELATIVE_NAME="rn";var pi=di,fi="namespace",Ti=kt.extends(fi,(function(t,e,i,n,s){kt.apply(this,[fi,e,n,s]),this.name=t,this.withBrackets=i||!1})),ki="namedargument",mi=q.extends(ki,(function(t,e,i,n){q.apply(this,[ki,i,n]),this.name=t,this.value=e})),Ei=q.extends("new",(function(t,e,i,n){q.apply(this,["new",i,n]),this.what=t,this.arguments=e})),xi="noop",yi=X.extends(xi,(function(t,e){X.apply(this,[xi,t,e])})),vi="nowdoc",Ai=Et.extends(vi,(function(t,e,i,n,s){Et.apply(this,[vi,t,e,n,s]),this.label=i})),gi="nullkeyword",Ni=X.extends(gi,(function(t,e,i){X.apply(this,[gi,e,i]),this.raw=t})),Ci="nullsafepropertylookup",Si=ei.extends(Ci,(function(t,e,i,n){ei.apply(this,[Ci,t,e,i,n])})),bi="number",Li=Et.extends(bi,(function(t,e,i,n){Et.apply(this,[bi,t,e,i,n])})),Oi="offsetlookup",Ii=ei.extends(Oi,(function(t,e,i,n){ei.apply(this,[Oi,t,e,i,n])})),Ri="parameter",wi=Ut.extends(Ri,(function(t,e,i,n,s,r,o,a,h){Ut.apply(this,[Ri,t,a,h]),this.value=i,this.type=e,this.byref=n,this.variadic=s,this.nullable=r,this.flags=o||0,this.attrGroups=[]})),Di="parentreference",Pi=ui.extends(Di,(function(t,e,i){ui.apply(this,[Di,e,i]),this.raw=t})),Ui="post",Bi=_t.extends(Ui,(function(t,e,i,n){_t.apply(this,[Ui,i,n]),this.type=t,this.what=e})),Mi=_t.extends("pre",(function(t,e,i,n){_t.apply(this,["pre",i,n]),this.type=t,this.what=e})),Fi="print",Hi=q.extends(Fi,(function(t,e,i){q.apply(this,[Fi,e,i]),this.expression=t})),Gi="program",Vi=kt.extends(Gi,(function(t,e,i,n,s,r){kt.apply(this,[Gi,t,s,r]),this.errors=e,i&&(this.comments=i),n&&(this.tokens=n)})),Wi="property",Qi=ft.extends(Wi,(function(t,e,i,n,s,r,o){ft.apply(this,[Wi,r,o]),this.name=t,this.value=e,this.nullable=i,this.type=n,this.attrGroups=s})),Yi="propertylookup",ji=ei.extends(Yi,(function(t,e,i,n){ei.apply(this,[Yi,t,e,i,n])})),$i="propertystatement",zi=ft.extends($i,(function(t,e,i,n,s){ft.apply(this,[$i,n,s]),this.properties=e,this.parseFlags(i)}));zi.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 Ki=zi,Xi="retif",Ji=q.extends(Xi,(function(t,e,i,n,s){q.apply(this,[Xi,n,s]),this.test=t,this.trueExpr=e,this.falseExpr=i})),qi="return",Zi=ft.extends(qi,(function(t,e,i){ft.apply(this,[qi,e,i]),this.expr=t})),tn="selfreference",en=ui.extends(tn,(function(t,e,i){ui.apply(this,[tn,e,i]),this.raw=t})),nn="silent",sn=q.extends(nn,(function(t,e,i){q.apply(this,[nn,e,i]),this.expr=t})),rn="static",on=ft.extends(rn,(function(t,e,i){ft.apply(this,[rn,e,i]),this.variables=t})),an="staticvariable",hn=X.extends(an,(function(t,e,i,n){X.apply(this,[an,i,n]),this.variable=t,this.defaultValue=e})),ln="staticlookup",cn=ei.extends(ln,(function(t,e,i,n){ei.apply(this,[ln,t,e,i,n])})),un="staticreference",_n=ui.extends(un,(function(t,e,i){ui.apply(this,[un,e,i]),this.raw=t})),dn="string",pn=Et.extends(dn,(function(t,e,i,n,s,r){Et.apply(this,[dn,e,n,s,r]),this.unicode=i,this.isDoubleQuote=t})),fn="switch",Tn=ft.extends(fn,(function(t,e,i,n,s){ft.apply(this,[fn,n,s]),this.test=t,this.body=e,this.shortForm=i})),kn="throw",mn=ft.extends(kn,(function(t,e,i){ft.apply(this,[kn,e,i]),this.what=t})),En="trait",xn=Ut.extends(En,(function(t,e,i,n){Ut.apply(this,[En,t,i,n]),this.body=e})),yn="traitalias",vn=X.extends(yn,(function(t,e,i,n,s,r){X.apply(this,[yn,s,r]),this.trait=t,this.method=e,this.as=i,this.visibility="",n&&(0===n[0]?this.visibility="public":1===n[0]?this.visibility="protected":2===n[0]&&(this.visibility="private"))})),An="traitprecedence",gn=X.extends(An,(function(t,e,i,n,s){X.apply(this,[An,n,s]),this.trait=t,this.method=e,this.instead=i})),Nn="traituse",Cn=X.extends(Nn,(function(t,e,i,n){X.apply(this,[Nn,i,n]),this.traits=t,this.adaptations=e})),Sn=ft.extends("try",(function(t,e,i,n,s){ft.apply(this,["try",n,s]),this.body=t,this.catches=e,this.always=i})),bn="typereference",Ln=ui.extends(bn,(function(t,e,i,n){ui.apply(this,[bn,i,n]),this.name=t,this.raw=e}));Ln.types=["int","float","string","bool","object","array","callable","iterable","void"];var On=Ln,In="unary",Rn=_t.extends(In,(function(t,e,i,n){_t.apply(this,[In,i,n]),this.type=t,this.what=e})),wn="uniontype",Dn=Ut.extends(wn,(function(t,e,i){Ut.apply(this,[wn,null,e,i]),this.types=t})),Pn="unset",Un=ft.extends(Pn,(function(t,e,i){ft.apply(this,[Pn,e,i]),this.variables=t})),Bn="usegroup",Mn=ft.extends(Bn,(function(t,e,i,n,s){ft.apply(this,[Bn,n,s]),this.name=t,this.type=e,this.items=i})),Fn="useitem",Hn=ft.extends(Fn,(function(t,e,i,n,s){ft.apply(this,[Fn,n,s]),this.name=t,this.alias=e,this.type=i}));Hn.TYPE_CONST="const",Hn.TYPE_FUNCTION="function";var Gn=Hn,Vn="variable",Wn=q.extends(Vn,(function(t,e,i,n){q.apply(this,[Vn,i,n]),this.name=t,this.curly=e||!1})),Qn="variadic",Yn=q.extends(Qn,(function(t,e,i){q.apply(this,[Qn,e,i]),this.what=t})),jn="while",$n=ft.extends(jn,(function(t,e,i,n,s){ft.apply(this,[jn,n,s]),this.test=t,this.body=e,this.shortForm=i})),zn="yield",Kn=q.extends(zn,(function(t,e,i,n){q.apply(this,[zn,i,n]),this.value=t,this.key=e})),Xn="yieldfrom",Jn=q.extends(Xn,(function(t,e,i){q.apply(this,[Xn,e,i]),this.value=t})),qn=function(t,e){this.withPositions=t,this.withSource=e};qn.prototype.position=function(t){return new z(t.lexer.yylloc.first_line,t.lexer.yylloc.first_column,t.lexer.yylloc.first_offset)},qn.precedence={},[["or"],["xor"],["and"],["="],["?"],["??"],["||"],["&&"],["|"],["^"],["&"],["==","!=","===","!==","<=>"],["<","<=",">",">="],["<<",">>"],["+","-","."],["*","/","%"],["!"],["instanceof"],["cast","silent"],["**"]].forEach((function(t,e){t.forEach((function(t){qn.precedence[t]=e+1}))})),qn.prototype.isRightAssociative=function(t){return"**"===t||"??"===t},qn.prototype.swapLocations=function(t,e,i,n){this.withPositions&&(t.loc.start=e.loc.start,t.loc.end=i.loc.end,this.withSource&&(t.loc.source=n.lexer._input.substring(t.loc.start.offset,t.loc.end.offset)))},qn.prototype.resolveLocations=function(t,e,i,n){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=n.lexer._input.substring(t.loc.start.offset,t.loc.end.offset)))},qn.prototype.resolvePrecedence=function(t,e){var i,n,s;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?(n=qn.precedence[t.type],s=qn.precedence[t.right.type],n&&s&&s<=n&&(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&&(n=qn.precedence[t.type],s=qn.precedence["?"],n&&s&&s<=n&&(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&&(n=qn.precedence["="],s=qn.precedence[t.right.type],n&&s&&s<n&&(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},qn.prototype.prepare=function(t,e,i){var n=null;(this.withPositions||this.withSource)&&(n=this.position(i));var s=this,r=function r(){var o=null,a=Array.prototype.slice.call(arguments);if(a.push(e),s.withPositions||s.withSource){var h=null;s.withSource&&(h=i.lexer._input.substring(n.offset,i.prev[2])),o=new $(h,n,new z(i.prev[0],i.prev[1],i.prev[2])),a.push(o)}t||(t=a.shift());var l=s[t];if("function"!=typeof l)throw new Error('Undefined node "'+t+'"');var c=Object.create(l.prototype);return l.apply(c,a),r.instance=c,r.trailingComments&&(c.trailingComments=r.trailingComments),"function"==typeof r.postBuild&&r.postBuild(c),i.debug&&delete qn.stack[r.stackUid],s.resolvePrecedence(c,i)};return i.debug&&(qn.stack||(qn.stack={},qn.stackUid=1),qn.stack[++qn.stackUid]={position:n,stack:(new Error).stack.split("\n").slice(3,5)},r.stackUid=qn.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 qn.stack[r.stackUid]},r},qn.prototype.checkNodes=function(){var t=[];for(var e in qn.stack)qn.stack.hasOwnProperty(e)&&t.push(qn.stack[e]);return qn.stack={},t},[tt,it,st,ot,ht,ct,dt,kt,yt,At,Nt,St,Lt,It,wt,Mt,Wt,Yt,$t,zt,Xt,qt,te,Ht,ie,Ut,re,ae,he,ce,_e,fe,ke,Ee,ye,Ae,Ne,q,Se,be,Oe,Re,De,Ue,Me,He,Ge,We,Ye,$e,Ke,Je,Ze,Et,ei,ni,ri,ai,li,pi,Ti,mi,Ei,X,yi,Ai,Ni,Si,Li,Ii,_t,wi,Pi,Bi,Mi,Hi,Vi,Qi,ji,Ki,ui,Ji,Zi,en,sn,ft,on,hn,cn,_n,pn,Tn,mn,xn,vn,gn,Cn,Sn,On,Rn,Dn,Un,Mn,Gn,Wn,Yn,$n,Kn,Jn].forEach((function(t){qn.prototype[t.kind]=t}));var Zn=qn;function ts(t,e){for(var i=Object.keys(t),n=i.length;n--;){var s=i[n],r=t[s];null===r?delete e[s]:"function"==typeof r?e[s]=r.bind(e):Array.isArray(r)?e[s]=Array.isArray(e[s])?e[s].concat(r):r:e[s]="object"==typeof r&&"object"==typeof e[s]?ts(r,e[s]):r}return e}var es=function(t){if("function"==typeof this)return new this(t);if(this.tokens=j,this.lexer=new k(this),this.ast=new Zn,this.parser=new Y(this.lexer,this.ast),t&&"object"==typeof t){if(t.parser&&(t.lexer||(t.lexer={}),t.parser.version)){if("string"==typeof t.parser.version){var 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")}ts(t,this),this.lexer.version=this.parser.version}},is=function(t){return"function"==typeof t.write?t.toString():t};es.create=function(t){return new es(t)},es.parseEval=function(t,e){return new es(e).parseEval(t)},es.prototype.parseEval=function(t){return this.lexer.mode_eval=!0,this.lexer.all_tokens=!1,t=is(t),this.parser.parse(t,"eval")},es.parseCode=function(t,e,i){return"object"!=typeof e||i||(i=e,e="unknown"),new es(i).parseCode(t,e)},es.prototype.parseCode=function(t,e){return this.lexer.mode_eval=!1,this.lexer.all_tokens=!1,t=is(t),this.parser.parse(t,e)},es.tokenGetAll=function(t,e){return new es(e).tokenGetAll(t)},es.prototype.tokenGetAll=function(t){this.lexer.mode_eval=!1,this.lexer.all_tokens=!0,t=is(t);var e=this.lexer.EOF,i=this.tokens.values;this.lexer.setInput(t);for(var n=this.lexer.lex()||e,s=[];n!=e;){var r=this.lexer.yytext;i.hasOwnProperty(n)&&(r=[i[n],r,this.lexer.yylloc.first_line]),s.push(r),n=this.lexer.lex()||e}return s};var ns=es,ss=j,rs=k,os=Zn,as=Y,hs=ts,ls=es;ns.tokens=ss,ns.lexer=rs,ns.AST=os,ns.parser=as,ns.combine=hs,ns.default=ls;var cs=function(t,e,i){var n=i&&"markdown"===i.parentParser;if(!t&&n)return"";t=t.replace(/\?>\r?\n<\?/g,"?>\n___PSEUDO_INLINE_PLACEHOLDER___<?");var s,r=new ns({parser:{extractDoc:!0},ast:{withPositions:!0,withSource:!0}}),o=-1!==t.indexOf("<?php"),a=n&&!o;try{s=a?r.parseEval(t):r.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 s.extra={parseAsEval:a},s.comments.forEach((function(t){"\r"===t.value[t.value.length-1]&&(t.value=t.value.slice(0,-1),t.loc.end.offset=t.loc.end.offset-1),"\n"===t.value[t.value.length-1]&&(t.value=t.value.slice(0,-1),t.loc.end.offset=t.loc.end.offset-1)})),s},us=n.default.util,_s=us.hasNewline,ds=us.skipEverythingButNewLine,ps=us.skipNewline,fs=us.isNextLineEmpty,Ts=us.isPreviousLineEmpty,ks=us.getNextNonSpaceNonCommentCharacterIndex,ms=n.default.version;function Es(t,e){return parseInt(ms[0])>1?t[e]:t}var xs={};function ys(t){return xs[t]}[["or"],["xor"],["and"],["=","+=","-=","*=","**=","/=",".=","%=","&=","|=","^=","<<=",">>="],["??"],["||"],["&&"],["|"],["^"],["&"],["==","===","!=","!==","<>","<=>"],["<",">","<=",">="],[">>","<<"],["+","-","."],["*","/","%"],["!"],["instanceof"],["++","--","~"],["**"]].forEach((function(t,e){t.forEach((function(t){xs[t]=e}))}));var vs=["==","!=","===","!==","<>","<=>"],As=["*","/","%"],gs=[">>","<<"];function Ns(t){return["block","program","namespace","class","interface","trait","traituse","declare"].includes(t.kind)}function Cs(t){var e=t.body;return e?("block"===e.kind&&(e=e.children),e[0]):null}function Ss(t){var e=t.children||t.body||t.adaptations;return Array.isArray(e)?e:null}function bs(t){var e=t.getParentNode();return e?Ss(e):null}function Ls(t){return t.length>0?t[t.length-1]:null}function Os(t){var e=t.getValue();if("program"===e.kind){var i=Ss(e);return!(!i||0===i.length)&&"inline"===i[0].kind}if("switch"===e.kind){if(!e.body)return!1;var n=Ss(e.body);if(0===n.length)return!1;var s=v(n,1)[0];if(!s.body)return!1;var r=Ss(s.body);return 0!==r.length&&"inline"===r[0].kind}var o=Cs(e);return!!o&&"inline"===o.kind}var Is=["__construct","__destruct","__call","__callStatic","__get","__set","__isset","__unset","__sleep","__wakeup","__toString","__invoke","__set_state","__clone","__debugInfo"].reduce((function(t,e){return t[e.toLowerCase()]=e,t}),{});var Rs={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:ys,isBitwiseOperator:function(t){return!!gs[t]||"|"===t||"^"===t||"&"===t},shouldFlatten:function(t,e){return ys(e)===ys(t)&&("**"!==t&&((!vs.includes(t)||!vs.includes(e))&&(!("%"===e&&As.includes(t)||"%"===t&&As.includes(e))&&((e===t||!As.includes(e)||!As.includes(t))&&(!gs.includes(t)||!gs.includes(e))))))},nodeHasStatement:Ns,getNodeListProperty:Ss,getParentNodeListProperty:bs,getLast:Ls,getPenultimate:function(t){return t.length>1?t[t.length-2]:null},isLastStatement:function(t){var e=bs(t);if(!e)return!0;var i=t.getValue();return e[e.length-1]===i},getBodyFirstChild:Cs,lineShouldEndWithSemicolon:function(t){var 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(!Ns(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){var n=t.getParentNode();if(n&&"interface"===n.kind)return!0}return["expressionstatement","do","usegroup","classconstant","propertystatement","traitprecedence","traitalias","goto","constantstatement","global","static","echo","unset","return","break","continue","throw"].includes(e.kind)},fileShouldEndWithHardline:function(t){var e=t.getValue(),i="program"===e.kind,n=e.children&&Ls(e.children);if(!i)return!1;if(n&&["halt","inline"].includes(n.kind))return!1;if(n&&("declare"===n.kind||"namespace"===n.kind)){var s=n.children.length>0&&Ls(n.children);if(s&&["halt","inline"].includes(s.kind))return!1}return!0},maybeStripLeadingSlashFromUse:function(t){var e=t.replace(/^\\/,"");return-1!==e.indexOf("\\")?e:t},hasDanglingComments:function(t){return t.comments&&t.comments.some((function(t){return!t.leading&&!t.trailing}))},hasLeadingComment:function(t){return t.comments&&t.comments.some((function(t){return t.leading}))},hasTrailingComment:function(t){return t.comments&&t.comments.some((function(t){return t.trailing}))},docShouldHaveTrailingNewline:function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=e.getNode(i),s=e.getNode(i+1),r=e.getNode(i+2);if(!s)return!1;if(r&&["call","new","echo"].includes(r.kind)&&!["call","array"].includes(s.kind)||"parameter"===s.kind){var o=r.arguments.length-1,a=r.arguments.indexOf(s);return a!==o}if(r&&"for"===r.kind){var h=r.init.indexOf(s);if(-1!==h)return h!==r.init.length-1;var l=r.test.indexOf(s);if(-1!==l)return l!==r.test.length-1;var c=r.increment.indexOf(s);if(-1!==c)return c!==r.increment.length-1}if("bin"===s.kind)return s.left===n||t(e,i+1);if("case"===s.kind&&s.test===n)return!0;if("staticvariable"===s.kind){var u=r.variables.length-1,_=r.variables.indexOf(s);return _!==u}if("entry"===s.kind){if(s.key===n)return!0;var d=r.items.length-1,p=r.items.indexOf(s);return p!==d}if(["call","new"].includes(s.kind)){var f=s.arguments.length-1,T=s.arguments.indexOf(n);return T!==f}if("echo"===s.kind){var k=s.expressions.length-1,m=s.expressions.indexOf(n);return m!==k}if("array"===s.kind){var E=s.items.length-1,x=s.items.indexOf(n);return x!==E}return"retif"===s.kind&&t(e,i+1)},isLookupNode:function(t){return"propertylookup"===t.kind||"staticlookup"===t.kind||"offsetlookup"===t.kind},isFirstChildrenInlineNode:Os,shouldPrintHardLineAfterStartInControlStructure:function(t){var e=t.getValue();return!["try","catch"].includes(e.kind)&&Os(t)},shouldPrintHardLineBeforeEndInControlStructure:function(t){var e=t.getValue();if(["try","catch"].includes(e.kind))return!0;if("switch"===e.kind){var i=Ss(e.body);if(0===i.length)return!0;var n=Ls(i);if(!n.body)return!0;var s=Ss(n.body);return 0===s.length||"inline"!==s[0].kind}return!Os(t)},getAlignment:function(t){var 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){var i=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?i:!i}return t.isDoubleQuote},hasEmptyBody:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"body",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){var n=i(e);return n=ds(t,n),n=ps(t,n),_s(t,n)},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){var i=function(t,e){for(var i,n=[].concat(e),s=-1;i=t.getParentNode(++s);)if(-1!==n.indexOf(i.kind))return s;return-1}(t,e);return-1===i?null:t.getParentNode(i)},getNextNode:function(t,e){var i=t.getParentNode(),n=Ss(i);if(!n)return null;var s=n.indexOf(e);return-1===s?null:i.children[s+1]},normalizeMagicMethodName:function(t){var e=t.toLowerCase();return Is[e]?Is[e]:t},isPreviousLineEmpty:function(t,e,i){return Ts(t,e,Es(i,"locStart"))},isNextLineEmpty:function(t,e,i){return fs(t,e,Es(i,"locEnd"))},getNextNonSpaceNonCommentCharacterIndex:function(t,e,i){return ks(t,e,Es(i,"locEnd"))}},ws=n.default.util,Ds=ws.addLeadingComment,Ps=ws.addDanglingComment,Us=ws.addTrailingComment,Bs=ws.skipNewline,Ms=ws.hasNewline,Fs=ws.hasNewlineInRange,Hs=n.default.doc.builders,Gs=Hs.concat,Vs=Hs.join,Ws=Hs.indent,Qs=Hs.hardline,Ys=Hs.cursor,js=Hs.lineSuffix,$s=Hs.breakParent,zs=Rs.getNextNonSpaceNonCommentCharacterIndex,Ks=Rs.isNextLineEmpty,Xs=Rs.isPreviousLineEmpty,Js=Rs.isLookupNode;function qs(t,e){var i=t.children;0===i.length?Ps(t,e):Ds(i[0],e)}function Zs(t,e){"block"===t.kind?qs(t,e):Ds(t,e)}function tr(t,e,i,n,s,r){var o=zs(t,s,r),a=t.charAt(o);return e&&"identifier"===e.kind&&i&&("function"===i.kind||"method"===i.kind)&&")"===a?(Us(i,s),!0):!(!i||"function"!==i.kind&&"method"!==i.kind||!n||"block"!==n.kind)&&(qs(n,s),!0)}function er(t,e,i,n,s,r){if(!i||"if"!==i.kind||!n)return!1;var o=zs(t,s,r);return")"===t.charAt(o)?(Us(e,s),!0):e===i.body&&n===i.alternate?(Ps(i,s),!0):"if"===n.kind?(Zs(n.body,s),!0):i.body===n&&(Ds(n,s),!0)}function ir(t,e,i){if(t&&["class","interface","trait"].includes(t.kind)){if(e&&t.extends)if(Array.isArray(t.extends)){if(t.extends.some((function(t){if(e&&e===t)return Ps(e,i),!0})))return!0}else if(e===t.extends)return Ps(e,i),!0;if(e&&t.implements&&t.implements.some((function(t){if(e&&e===t)return Ps(e,i),!0})))return!0;if(!(t.body&&t.body.length>0))return Ps(t,i),!0}return!!(e&&"class"===e.kind&&e.isAnonymous&&e.leadingComments&&"commentblock"===i.kind)}function nr(t,e,i,n,s){if(e&&("function"===e.kind||"method"===e.kind)){for(var r=0,o=0;o<e.arguments.length;o++)r=s.locEnd(e.arguments[o])>r?s.locEnd(e.arguments[o]):r;var a=e.body&&s.locStart(n)>r&&s.locEnd(n)<s.locStart(e.body),h=zs(t,n,s);if(e.type&&a&&")"!==t.charAt(h))return s.locEnd(n)<s.locStart(e.type)?(Ps(e.type,n),!0):(Us(e.type,n),!0)}return!1}function sr(t,e,i,n,s){return!(!i||!["function","method","parameter"].includes(i.kind))&&("typereference"===e.kind&&"identifier"===n.kind&&(Us(e,s),!0))}function rr(t,e){return!(!t||!["label","goto"].includes(t.kind))&&(Us(t,e),!0)}function or(t,e,i,n){return i&&"inline"===i.kind?(i.leadingComments||(i.leadingComments=[]),i.leadingComments.includes(n)||i.leadingComments.push(n),!0):!(t||i||!e||"inline"!==e.kind)&&(Ps(e,n),!0)}function ar(t,e,i){return!(!t||"try"!==t.kind||!e)&&("block"===e.kind?(qs(e,i),!0):"try"===e.kind?(Zs(e.always,i),!0):"catch"===e.kind&&(Zs(e.body,i),!0))}function hr(t,e,i,n){return i||e||!t||"namespace"!==t.kind||t.withBrackets?!(e||!t||"namespace"!==t.kind||t.withBrackets)&&(Ps(t,n),!0):(Us(t,n),!0)}function lr(t,e,i,n){return!(!t||"declare"!==t.kind)&&((!e||"noop"!==e.kind)&&(i&&t.directives[0]!==i?!(!i||!e)&&(Ds(i,n),!0):("none"===t.mode?Us(t,n):Ps(t,n),!0)))}function cr(t,e,i,n,s,r){if(!i||"while"!==i.kind||!n)return!1;var o=zs(t,s,r);return")"===t.charAt(o)?(Us(e,s),!0):"block"===n.kind&&(qs(n,s),!0)}function ur(t,e){return t.getValue().printed=!0,e.printer.printComment(t,e)}function _r(t,e,i){return t.getNode()===e.cursorNode&&t.getValue()?Gs([Ys,i,Ys]):i}var dr={handleOwnLineComment:function(t,e,i){var n=t.precedingNode,s=t.enclosingNode,r=t.followingNode;return tr(e,n,s,r,t,i)||function(t,e,i){if(t&&Js(t)&&e&&["identifier","variable","encapsed"].includes(e.kind))return Ds(t,i),!0;return!1}(s,r,t)||er(e,n,s,r,t,i)||cr(e,n,s,r,t,i)||ar(s,r,t)||ir(s,r,t)||sr(e,n,s,r,t)||nr(e,s,r,t,i)||function(t,e,i,n){if(!i&&t&&("for"===t.kind||"foreach"===t.kind))return t.body&&"block"!==t.body.kind?Ds(i,n):Ds(t,n),!0;return!1}(s,0,r,t)||or(s,n,r,t)||lr(s,n,r,t)},handleEndOfLineComment:function(t,e,i){var n=t.precedingNode,s=t.enclosingNode,r=t.followingNode;return function(t,e,i,n,s){if(!e&&!n&&i&&"array"===i.kind)return Us(i,s),!0;return!1}(0,n,s,r,t)||function(t,e,i,n,s){if(i&&"return"===i.kind&&!i.expr)return Us(i,s),!0;return!1}(0,0,s,0,t)||tr(e,n,s,r,t,i)||function(t,e,i,n,s,r){var o=e&&!Fs(s,r.locEnd(e),r.locStart(n));if((!e||!o)&&t&&"retif"===t.kind&&i)return Ds(i,n),!0;return!1}(s,n,r,t,e,i)||er(e,n,s,r,t,i)||cr(e,n,s,r,t,i)||ar(s,r,t)||ir(s,r,t)||sr(e,n,s,r,t)||nr(e,s,r,t,i)||function(t,e){if(t&&"entry"===t.kind)return Ds(t,e),!0;return!1}(s,t)||function(t,e,i){if(e&&"call"===e.kind&&t&&e.what===t&&e.arguments.length>0)return Ds(e.arguments[0],i),!0;return!1}(n,s,t)||function(t,e,i){if(t&&"assign"===t.kind&&e){var n=t.loc.start.offset+t.loc.source.indexOf("=");if(i.loc.start.offset>n)return Ds(e,i),!0}return!1}(s,r,t)||or(s,n,r,t)||hr(s,n,r,t)||lr(s,n,r,t)||rr(s,t)},handleRemainingComment:function(t,e,i){var n=t.precedingNode,s=t.enclosingNode,r=t.followingNode;return er(e,n,s,r,t,i)||cr(e,n,s,r,t,i)||function(t,e,i,n){var s=zs(t,i,n);if(")"!==t.charAt(s))return!1;if(e&&("function"===e.kind||"closure"===e.kind||"method"===e.kind||"call"===e.kind||"new"===e.kind)&&0===e.arguments.length)return Ps(e,i),!0;return!1}(e,s,t,i)||ir(s,r,t)||function(t,e,i){if(t&&"traituse"===t.kind&&t.adaptations&&!t.adaptations.length)return Ps(t,i),!0;return!1}(s,0,t)||sr(e,n,s,r,t)||nr(e,s,r,t,i)||rr(s,t)||function(t,e,i,n){if(e&&"halt"===e.kind)return Ps(e,n),!0;if(t&&"halt"===t.kind)return Ps(t,n),!0;return!1}(n,s,0,t)||function(t,e){if(t&&("continue"===t.kind||"break"===t.kind)&&!t.label)return Us(t,e),!0;return!1}(s,t)||or(s,n,r,t)||hr(s,n,r,t)},getCommentChildNodes:function(t){return"object"!=typeof t?[]:function(t){return Object.keys(t).filter((function(t){return"kind"!==t&&"loc"!==t&&"errors"!==t&&"extra"!==t&&"comments"!==t&&"leadingComments"!==t&&"enclosingNode"!==t&&"precedingNode"!==t&&"followingNode"!==t})).map((function(e){return 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,n){var s=[],r=t.getValue();return r&&r.comments?(t.each((function(t){var i=t.getValue();!i||i.leading||i.trailing||n&&!n(i)||s.push(ur(t,e))}),"comments"),0===s.length?"":i?Vs(Qs,s):Ws(Gs([Qs,Vs(Qs,s)]))):""},hasLeadingComment:function(t){return t.comments&&t.comments.some((function(t){return t.leading}))},hasTrailingComment:function(t){return t.comments&&t.comments.some((function(t){return t.trailing}))},hasLeadingOwnLineComment:function(t,e,i){return e.comments&&e.comments.some((function(e){return e.leading&&Ms(t,i.locEnd(e))}))},printComments:function(t,e){var i=[];return t.forEach((function(t,n,s){t.printed=!0;var r=s.length===n+1;i.push(t.value),r||i.push(Qs),Ks(e.originalText,t,e)&&!r&&i.push(Qs)})),Gs(i)},printAllComments:function(t,e,i,n){var s=t.getValue(),r=e(t),o=s&&s.comments;if(!o||0===o.length)return _r(t,i,r);var a=[],h=[n?";":"",r];return t.each((function(t){var e=t.getValue(),n=e.leading,s=e.trailing;if(n){var r=function(t,e,i){var n=t.getValue(),s=ur(t,i);if(!s)return"";var r=i.printer.isBlockComment&&i.printer.isBlockComment(n);return Gs(r?[s,Ms(i.originalText,i.locEnd(n))?Qs:" "]:[s,Qs])}(t,0,i);if(!r)return;a.push(r);var o=i.originalText;Ms(o,Bs(o,i.locEnd(e)))&&a.push(Qs)}else s&&h.push(function(t,e,i){var n=t.getValue(),s=ur(t,i);if(!s)return"";var r=i.printer.isBlockComment&&i.printer.isBlockComment(n);if(Ms(i.originalText,i.locStart(n),{backwards:!0})){var o=Xs(i.originalText,n,i);return js(Gs([Qs,o?Qs:"",s]))}return Gs(r?[" ",s]:[js(Gs([" ",s])),r?"":$s])}(t,0,i))}),"comments"),_r(t,i,Gs(a.concat(h)))}};function pr(){}pr.strictEqual=function(){};var fr=pr,Tr=Rs.getPrecedence,kr=Rs.shouldFlatten,mr=Rs.isBitwiseOperator;var Er=function(t){var e=t.getParentNode();if(!e)return!1;var i=t.getName(),n=t.getNode();if(["program","expressionstatement","namespace","declare","block","include","print","return","echo"].includes(e.kind))return!1;switch(n.kind){case"pre":case"post":if("unary"===e.kind)return"pre"===n.kind&&("+"===n.type&&"+"===e.type||"-"===n.type&&"-"===e.type);case"unary":switch(e.kind){case"unary":return n.type===e.type&&("+"===n.type||"-"===n.type);case"propertylookup":case"staticlookup":case"offsetlookup":case"call":return"what"===i&&e.what===n;case"bin":return"**"===e.type&&"left"===i;default:return!1}case"bin":switch(e.kind){case"assign":case"retif":return["and","xor","or"].includes(n.type);case"silent":case"cast":return n.parenthesizedExpression;case"pre":case"post":case"unary":return!0;case"call":case"propertylookup":case"staticlookup":case"offsetlookup":return"what"===i&&e.what===n;case"bin":var s=e.type,r=Tr(s),o=n.type,a=Tr(o);return r>a||("||"===s&&"&&"===o||(r===a&&"right"===i?(fr.strictEqual(e.right,n),!0):r===a&&!kr(s,o)||(r<a&&"%"===o?"+"===s||"-"===s:!!mr(s))));default:return!1}case"propertylookup":case"staticlookup":switch(e.kind){case"call":return"what"===i&&e.what===n&&n.parenthesizedExpression;default:return!1}case"clone":case"new":switch(e.kind){case"propertylookup":case"staticlookup":case"offsetlookup":case"call":return"what"===i&&e.what===n;default:return!1}case"yield":switch(e.kind){case"propertylookup":case"staticlookup":case"offsetlookup":case"call":return"what"===i&&e.what===n;case"retif":return e.test===n;default:return!(!n.key&&!n.value)}case"assign":return("for"!==e.kind||!e.init.includes(n)&&!e.increment.includes(n))&&("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"staticlookup":case"offsetlookup":case"call":return"what"===i&&e.what===n;default:return!1}case"closure":switch(e.kind){case"call":return"what"===i&&e.what===n;case"propertylookup":return!0;default:return!1}case"silence":case"cast":return n.parenthesizedExpression;case"string":case"array":switch(e.kind){case"propertylookup":case"staticlookup":case"offsetlookup":case"call":return(!["string","array"].includes(n.kind)||"offsetlookup"!==e.kind)&&("what"===i&&e.what===n);default:return!1}case"print":case"include":return"bin"===e.kind}return!1},xr=n.default.doc.builders,yr=xr.breakParent,vr=xr.concat,Ar=xr.join,gr=xr.line,Nr=xr.lineSuffix,Cr=xr.group,Sr=xr.conditionalGroup,br=xr.indent,Lr=xr.dedent,Or=xr.ifBreak,Ir=xr.hardline,Rr=xr.softline,wr=xr.literalline,Dr=xr.align,Pr=xr.dedentToRoot,Ur=n.default.doc.utils.willBreak,Br=n.default.util,Mr=Br.isNextLineEmptyAfterIndex,Fr=Br.hasNewline,Hr=Br.hasNewlineInRange,Gr=Rs.getLast,Vr=Rs.getPenultimate,Wr=Rs.isLastStatement,Qr=Rs.lineShouldEndWithSemicolon,Yr=Rs.printNumber,jr=Rs.shouldFlatten,$r=Rs.maybeStripLeadingSlashFromUse,zr=Rs.fileShouldEndWithHardline,Kr=Rs.hasDanglingComments,Xr=Rs.hasLeadingComment,Jr=Rs.hasTrailingComment,qr=Rs.docShouldHaveTrailingNewline,Zr=Rs.isLookupNode,to=Rs.isFirstChildrenInlineNode,eo=Rs.shouldPrintHardLineAfterStartInControlStructure,io=Rs.shouldPrintHardLineBeforeEndInControlStructure,no=Rs.getAlignment,so=Rs.isProgramLikeNode,ro=Rs.getNodeKindIncludingLogical,oo=Rs.useDoubleQuote,ao=Rs.hasEmptyBody,ho=Rs.isNextLineEmptyAfterNamespace,lo=Rs.shouldPrintHardlineBeforeTrailingComma,co=Rs.isDocNode,uo=Rs.getAncestorNode,_o=Rs.isReferenceLikeNode,po=Rs.getNextNode,fo=Rs.normalizeMagicMethodName,To=Rs.getNextNonSpaceNonCommentCharacterIndex,ko=Rs.isNextLineEmpty;function mo(t,e){return parseFloat(t)>=parseFloat(e)}function Eo(t,e){return!!t.trailingCommaPHP&&mo(t.phpVersion,e)}function xo(t){switch(t.braceStyle){case"1tbs":return!1;case"psr-2":default:return!0}}function yo(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return vr([n?"?":"","->",t.call(i,"offset")])}function vo(t,e,i){return yo(t,e,i,!0)}function Ao(t,e,i){var n=t.getValue(),s=!["variable","identifier"].includes(n.offset.kind);return vr(["::",s?"{":"",t.call(i,"offset"),s?"}":""])}function go(t,e,i){var n=t.getValue(),s=n.offset&&"number"===n.offset.kind||uo(t,"encapsed");return vr(["[",n.offset?Cr(vr([br(vr([s?"":Rr,t.call(i,"offset")])),s?"":Rr])):"","]"])}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){var e=Gr(t),i=Vr(t);return!Xr(e)&&!Jr(e)&&No(e)&&(!i||i.kind!==e.kind)}function So(t){if(2!==t.length)return!1;var e=v(t,2),i=e[0],n=e[1];return!(i.comments&&i.comments.length||"function"!==i.kind&&"method"!==i.kind&&"closure"!==i.kind||"retif"===n.kind||No(n))}function bo(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"arguments",s=t.getValue()[n];if(0===s.length)return vr(["(",dr.printDanglingComments(t,e,!0),")"]);var r=!1,o=!1,a=s.length-1,h=t.map((function(t,n){var s=t.getNode(),h=[i(t)];return n===a||(ko(e.originalText,s,e)?(0===n&&(o=!0),r=!0,h.push(",",Ir,Ir)):h.push(",",gr)),vr(h)}),n),l=t.getValue(),c=Gr(s),u=Eo(e,"7.3")&&["call","new","unset","isset"].includes(l.kind)||Eo(e,"8.0")&&["function","closure","method","arrowfunc"].includes(l.kind)?br(vr([c&&lo(c)?Ir:"",","])):"";function _(){return Cr(vr(["(",br(vr([gr,vr(h)])),u,gr,")"]),{shouldBreak:!0})}var d=So(s),p=Co(s);if(d||p){var f,T=(d?h.slice(1).some(Ur):h.slice(0,-1).some(Ur))||r,k=0;t.each((function(t){d&&0===k&&(f=[vr([t.call((function(t){return i(t,{expandFirstArg:!0})})),h.length>1?",":"",o?Ir:gr,o?Ir:""])].concat(h.slice(1))),p&&k===s.length-1&&(f=h.slice(0,-1).concat(t.call((function(t){return i(t,{expandLastArg:!0})})))),k++}),n);var m=h.some(Ur),E=vr(["(",vr(f),")"]);return vr([m?yr:"",Sr([m?Or(_(),E):E,vr(d?["(",Cr(f[0],{shouldBreak:!0}),vr(f.slice(1)),")"]:["(",vr(h.slice(0,-1)),Cr(Gr(f),{shouldBreak:!0}),")"]),Cr(vr(["(",br(vr([gr,vr(h)])),Or(u),gr,")"]),{shouldBreak:!0})],{shouldBreak:T})])}return Cr(vr(["(",br(vr([Rr,vr(h)])),Or(u),Rr,")"]),{shouldBreak:h.some(Ur)||r})}function Lo(t){return"array"===t.kind&&0!==t.items.length}function Oo(t){return"array"===t.right.kind&&0!==t.right.items.length}function Io(t,e,i){var n=t.getValue();switch(n.kind){case"propertylookup":return yo(t,e,i);case"nullsafepropertylookup":return vo(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(n.kind," yet.")}}function Ro(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=e.opening,n=void 0===i||i;if("heredoc"===t.type)return n?"<<<".concat(t.label):t.label;var s={string:'"',shell:"`"};return s[t.type]?s[t.type]:"Unimplemented encapsed type ".concat(t.type)}function wo(t,e,i){var n=[],s=[];return t.each((function(t){n.push(vr(s)),n.push(Cr(i(t))),s=[",",gr],t.getValue()&&ko(e.originalText,t.getValue(),e)&&s.push(Rr)}),"items"),vr(n)}function Do(t,e){if(0===e.length)return t;var i=0;return e.reduce((function(e,n){var s=n.start,r=n.end,o=n.alignment,a=n.before,h=n.after,l=vr([a||"",vr(t.slice(s,r)),h||""]),c=e.concat(t.slice(i,s),o?Pr(Cr(vr([Dr(new Array(o).join(" "),l)]))):Cr(l),r===t.length-1?t.slice(r):"");return i=r,c}),[])}function Po(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"children",s=t.getValue(),r=t.getParentNode(),o=-1,a=[],h=[];t.map((function(l,c){var u=l.getValue(),_="inline"===u.kind,d=i(l),p=s[n],f=p[c+1],T=!Wr(l)&&!_&&(f&&"case"===f.kind?!to(t):f&&"inline"!==f.kind),k=vr([d,T?Ir:"",T&&ko(e.originalText,u,e)?Ir:""]),m=0===c,E=p.length-1===c,x="block"===s.kind&&r&&["function","closure","method","try","catch"].includes(r.kind),y=x&&m?"":" ";if(_||!_&&E&&o>=0){var v=o;if(_&&(o=c),_&&!m||!_&&E){var A=(_?v:o)+1,g=E&&!_?c+1:c,N=p[_?v:o],C=N?no(N.raw):"",S=g-A>1,b=S?x&&!N||so(s)&&0===A?"":Ir:"",L=S&&"halt"!==u.kind?x&&E?"":Ir:"";S&&(y=""),h.push({start:A,end:g,alignment:C,before:b,after:L})}}if(_){var O=f&&"echo"===f.kind&&f.shortForm?"<?=":"<?php",I=u.leadingComments&&u.leadingComments.length?vr([m&&"namespace"!==s.kind&&!x?"<?php":"","namespace"!==s.kind&&x?"":Ir,dr.printComments(u.leadingComments,e),Ir,"?>"]):so(s)&&m&&"namespace"!==s.kind?"":vr([y,"?>"]),R=t.getNode(c+1),w=R&&R.children&&R.children.length,D=u.comments&&u.comments.length?vr([O,Ir,w?dr.printComments(u.comments,e):"",Ir,w?"?>":""]):so(s)&&E?"":vr([O," "]);k=vr([I,k,D])}a.push(k)}),n);var l=Do(a,h);if("program"===s.kind&&!s.extra.parseAsEval){var c=[],u=v(s.children,1),_=u[0],d=!_||"inline"!==_.kind;if(d){var p=e.originalText.trim().match(/^<\?(php|=)(\s+)?\S/),f=vr([p&&p[2]&&p[2].includes("\n")?vr([Ir,p[2].split("\n").length>2?Ir:""]):" ",s.comments?dr.printComments(s.comments,e):""]),T=_&&"echo"===_.kind&&_.shortForm;c.push(vr([T?"<?=":"<?php",f]))}c.push(vr(l));var k=e.originalText.trim().endsWith("?>");if(k){var m=Gr(s.children),E=m?vr([Hr(e.originalText.trimEnd(),e.locEnd(m),e.locEnd(s))?Ir:" ",ko(e.originalText,m,e)?Ir:""]):s.comments?Ir:"";c.push(Nr(vr([E,"?>"])))}return vr(c)}return vr(l)}function Uo(t,e,i,n){return vr(t.map((function(t){var n=[];return n.push(i(t)),Wr(t)||(n.push(Ir),ko(e.originalText,t.getValue(),e)&&n.push(Ir)),vr(n)}),n))}function Bo(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"extends",s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:" ",r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:" ",o=t.getValue(),a=Kr(o[n])?vr([Ir,t.call((function(t){return dr.printDanglingComments(t,e,!0)}),n),Ir]):s,h=Array.isArray(o[n])?Cr(vr([Ar(",",t.map((function(t){var n=i(t);return Kr(t.getValue())?vr([Ir,dr.printDanglingComments(t,e,!0),Ir,n]):vr([r,n])}),n))])):vr([r,t.call(i,n)]);return br(vr([a,n,Ur(a)?br(h):h]))}function Mo(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},s=n.inline,r=void 0!==s&&s,o=[];return t.getValue().attrGroups?(t.each((function(t){var n=["#["];o.length>0&&o.push(r?" ":Ir),n.push(Or(Rr)),t.each((function(t){var s=t.getValue();n.length>2&&n.push(",",Or(Rr," "));var r=[s.name];s.args.length>0&&r.push(bo(t,e,i,"args")),n.push(Cr(vr(r)))}),"attrs"),o.push(Cr(vr([br(vr(n)),Or(Rr),"]",Rr,r?" ":""])))}),"attrGroups"),0===o.length?[]:[vr([].concat(o,[r?"":Ir]))]):[]}function Fo(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"body",s=t.getValue();if(!s[n])return";";var r=t.call(i,n);return vr([s.shortForm?":":" {",br(vr(["block"!==s[n].kind||s[n].children&&s[n].children.length>0||s[n].comments&&s[n].comments.length>0?vr([eo(t)?"switch"===s.kind?" ":"":Ir,r]):""])),"if"===s.kind&&"body"===n?"":vr([io(t)?Ir:"",s.shortForm?vr(["end",s.kind,";"]):"}"])])}function Ho(t,e,i,n,s,r,o){if(!n)return e;var a=Go(t,n,s,r,o);return Cr(vr([e,i,a]))}function Go(t,e,i,n,s){var r=n?"&":"";if(dr.hasLeadingOwnLineComment(s.originalText,e,s))return br(vr([Ir,r,i]));var o="cast"===e.kind?e.expr:e;return"bin"===o.kind&&!Oo(o)||"retif"===o.kind&&(!o.trueExpr&&!Lo(o.falseExpr)||"bin"===o.test.kind&&!Oo(o.test))||("variable"===t.kind||"string"===t.kind||Zr(t))&&("string"===o.kind&&!Vo(o)||function t(e){return!!Zr(e)&&(!("variable"!==e.what.kind&&!_o(e.what))||t(e.what))}(o))?Cr(br(vr([gr,r,i]))):vr([" ",r,i])}function Vo(t){return t.raw.includes("\n")}function Wo(t,e,i){return("string"===t.kind||"encapsed"===t.kind&&("string"===t.type||"shell"===t.type))&&Vo(t)&&!Fr(e,i.locStart(t),{backwards:!0})}var Qo=function(t,e,i){var n=t.getValue();if(!n)return"";if("string"==typeof n)return n;var s=function(t,e,i){var n=t.getValue();switch(n.kind){case"program":return Cr(vr([Po(t,e,i),dr.printDanglingComments(t,e,!0,(function(t){return!t.printed}))]));case"expressionstatement":return t.call(i,"expression");case"block":return vr([Po(t,e,i),dr.printDanglingComments(t,e,!0)]);case"declare":var s=function(t){return Ar(", ",t.map((function(t){return vr([i(t)])}),"directives"))};if(["block","short"].includes(n.mode))return vr(["declare(",s(t),")","block"===n.mode?" {":":",n.children.length>0?br(vr([Ir,Po(t,e,i)])):"",dr.printDanglingComments(t,e),Ir,"block"===n.mode?"}":"enddeclare;"]);var r=po(t,n);return vr(["declare(",s(t),")",r&&"inline"===r.kind?"":";"]);case"declaredirective":return vr([t.call(i,"key"),"=",t.call(i,"value")]);case"namespace":return vr(["namespace ",n.name&&"string"==typeof n.name?vr([n.name,n.withBrackets?" ":""]):"",n.withBrackets?"{":";",Kr(n)?vr([" ",dr.printDanglingComments(t,e,!0)]):"",n.children.length>0?n.withBrackets?br(vr([Ir,Po(t,e,i)])):vr(["inline"===n.children[0].kind?"":vr([Ir,ho(e.originalText,n,e.locStart)?Ir:""]),Po(t,e,i)]):"",n.withBrackets?vr([Ir,"}"]):""]);case"usegroup":return Cr(vr(["use ",n.type?vr([n.type," "]):"",br(vr([n.name?vr([$r(n.name),"\\{",Rr]):"",Ar(vr([",",gr]),t.map((function(t){return vr([i(t)])}),"items"))])),n.name?vr([Or(Eo(e,"7.2")?",":""),Rr,"}"]):""]));case"useitem":return vr([n.type?vr([n.type," "]):"",$r(n.name),Kr(n)?vr([" ",dr.printDanglingComments(t,e,!0)]):"",n.alias?vr([" as ",t.call(i,"alias")]):""]);case"class":case"interface":case"trait":return function(t,e,i){var n=t.getValue(),s="class"===n.kind&&n.isAnonymous,r=Mo(t,e,i,{inline:s}),o=s?[]:A(r);n.isFinal&&o.push("final ");n.isAbstract&&o.push("abstract ");o.push(s?"":n.kind),n.name&&o.push(" ",t.call(i,"name"));n.extends&&n.implements?o.push(Sr([vr([Bo(t,e,i,"extends"),Bo(t,e,i,"implements")]),vr([Bo(t,e,i,"extends"),Bo(t,e,i,"implements"," ",Ir)]),vr([Bo(t,e,i,"extends",Ir," "),Bo(t,e,i,"implements",Ir,n.implements.length>1?Ir:" ")])],{shouldBreak:Kr(n.extends)})):(n.extends&&o.push(Sr([Bo(t,e,i,"extends"),Bo(t,e,i,"extends"," ",Ir),Bo(t,e,i,"extends",Ir,n.extends.length>1?Ir:" ")])),n.implements&&o.push(Sr([Bo(t,e,i,"implements"),Bo(t,e,i,"implements"," ",Ir),Bo(t,e,i,"implements",Ir,n.implements.length>1?Ir:" ")])));var a=Cr(vr([Cr(vr(o)),xo(e)?s?gr:Ir:" "])),h=n.body&&0===n.body.length&&!Kr(n),l=vr(["{",br(vr([h?"":Ir,Uo(t,e,i,"body")])),dr.printDanglingComments(t,e,!0),s&&h?Rr:Ir,"}"]);return vr([a,l])}(t,e,i);case"traitprecedence":return vr([t.call(i,"trait"),"::",t.call(i,"method")," insteadof ",Ar(", ",t.map(i,"instead"))]);case"traitalias":return vr([n.trait?vr([t.call(i,"trait"),"::"]):"",n.method?t.call(i,"method"):""," as ",Ar(" ",[].concat(A(n.visibility?[n.visibility]:[]),A(n.as?[t.call(i,"as")]:[])))]);case"traituse":return Cr(vr(["use ",br(Cr(Ar(vr([",",gr]),t.map(i,"traits")))),n.adaptations?vr([" {",n.adaptations.length>0?vr([br(vr([Ir,Uo(t,e,i,"adaptations")])),Ir]):Kr(n)?vr([gr,dr.printDanglingComments(t,e,!0),gr]):"","}"]):""]));case"function":case"closure":case"method":return function(t,e,i){var n=t.getValue(),s=A(Mo(t,e,i,{inline:"closure"===n.kind}));n.isFinal&&s.push("final ");n.isAbstract&&s.push("abstract ");n.visibility&&s.push(n.visibility," ");n.isStatic&&s.push("static ");s.push("function "),n.byref&&s.push("&");n.name&&s.push(t.call(i,"name"));s.push(bo(t,e,i)),n.uses&&n.uses.length>0&&s.push(Cr(vr([" use ",bo(t,e,i,"uses")])));n.type&&s.push(vr([": ",Kr(n.type)?vr([t.call((function(t){return dr.printDanglingComments(t,e,!0)}),"type")," "]):"",n.nullable?"?":"",t.call(i,"type")]));var r=vr(s);if(!n.body)return r;var o="closure"===n.kind,a=vr(["{",br(vr([ao(t)?"":Ir,t.call(i,"body")])),o&&ao(t)?"":Ir,"}"]);if(o)return vr([r," ",a]);if(0===n.arguments.length)return vr([r,xo(e)?Ir:" ",a]);if(s.some(Ur))return vr([r," ",a]);return Sr([vr([r,xo(e)?Ir:" ",a]),vr([r," ",a])])}(t,e,i);case"arrowfunc":return vr([].concat(A(Mo(t,e,i,{inline:!0})),[n.isStatic?"static ":"","fn",bo(t,e,i),n.type?vr([": ",n.nullable?"?":"",t.call(i,"type")]):""," => ",t.call(i,"body")]));case"parameter":var o="";1===n.flags?o="public ":2===n.flags?o="protected ":4===n.flags&&(o="private ");var a=vr([].concat(A(Mo(t,e,i,{inline:!0})),[o,n.nullable?"?":"",n.type?vr([t.call(i,"type")," "]):"",n.byref?"&":"",n.variadic?"...":"","$",t.call(i,"name")]));return n.value?Cr(vr([a,Kr(n)?" ":"",dr.printDanglingComments(t,e,!0),vr([" =",Go(n.name,n.value,t.call(i,"value"),!1,e)])])):a;case"variadic":return vr(["...",t.call(i,"what")]);case"property":return Cr(vr([n.type?vr([n.nullable?"?":"",t.call(i,"type")," "]):"","$",t.call(i,"name"),n.value?vr([" =",Go(n.name,n.value,t.call(i,"value"),!1,e)]):""]));case"propertystatement":var h=[];t.map((function(t){return h.push.apply(h,A(Mo(t,e,i)))}),"properties");var l,c=t.map((function(t){return i(t)}),"properties"),u=n.properties.some((function(t){return t.value}));if(1!==c.length||n.properties[0].comments)c.length>0&&(l=br(c[0]));else l=v(c,1)[0];var _=n.visibility||null===n.visibility;return Cr(vr([].concat(h,[_?vr([null===n.visibility?"var":n.visibility,""]):"",n.isStatic?vr([_?" ":"","static"]):"",l?vr([" ",l]):"",br(vr(c.slice(1).map((function(t){return vr([",",u?Ir:gr,t])}))))])));case"if":var d=[],p=Fo(t,e,i,"body"),f=Cr(vr(["if (",Cr(vr([br(vr([Rr,t.call(i,"test")])),Rr])),")",p]));if(d.push(f,to(t)||!n.body?"":Ir),n.alternate){d.push(n.shortForm?"":"} ");var T=Jr(n.body)&&n.body.comments.some((function(t){return t.trailing&&!dr.isBlockComment(t)}))||function(t){if(!t.comments)return!1;var e=Gr(t.comments.filter((function(t){return!t.leading&&!t.trailing})));return e&&!dr.isBlockComment(e)}(n),k=!T;d.push(k?"":Ir),Kr(n)&&d.push(ko(e.originalText,n.body,e)?Ir:"",dr.printDanglingComments(t,e,!0),T?Ir:" "),d.push("else",Cr("if"===n.alternate.kind?t.call(i,"alternate"):Fo(t,e,i,"alternate")))}else d.push(n.body?n.shortForm?"endif;":"}":"");return vr(d);case"do":return vr(["do",Fo(t,e,i,"body")," while (",Cr(vr([br(vr([Rr,t.call(i,"test")])),Rr])),")"]);case"while":case"switch":return Cr(vr([n.kind," (",Cr(vr([br(vr([Rr,t.call(i,"test")])),Rr])),")",Fo(t,e,i,"body")]));case"for":var m=Fo(t,e,i,"body"),E=dr.printDanglingComments(t,e,!0),x=E?vr([E,Rr]):"";return n.init.length||n.test.length||n.increment.length?vr([x,Cr(vr(["for (",Cr(vr([br(vr([Rr,Cr(vr([Ar(vr([",",gr]),t.map(i,"init"))])),";",gr,Cr(vr([Ar(vr([",",gr]),t.map(i,"test"))])),";",gr,Cr(Ar(vr([",",gr]),t.map(i,"increment")))])),Rr])),")",m]))]):vr([x,Cr(vr(["for (;;)",m]))]);case"foreach":var y=Fo(t,e,i,"body"),g=dr.printDanglingComments(t,e,!0),N=g?vr([g,Rr]):"";return vr([N,Cr(vr(["foreach (",Cr(vr([br(vr([Rr,t.call(i,"source"),gr,"as ",Cr(n.key?br(Ar(vr([" =>",gr]),[t.call(i,"key"),t.call(i,"value")])):t.call(i,"value"))])),Rr])),")",y]))]);case"try":var C=[];return C.push("try",Fo(t,e,i,"body")),n.catches&&C.push(vr(t.map(i,"catches"))),n.always&&C.push(" finally",Fo(t,e,i,"always")),vr(C);case"catch":return vr([" catch",n.what?vr([" (",Ar(" | ",t.map(i,"what")),n.variable?vr([" ",t.call(i,"variable")]):"",")"]):"",Fo(t,e,i,"body")]);case"case":return vr([n.test?vr(["case ",n.test.comments?br(t.call(i,"test")):t.call(i,"test"),":"]):"default:",n.body&&n.body.children&&n.body.children.length?br(vr([to(t)?"":Ir,t.call(i,"body")])):""]);case"break":case"continue":return n.level&&("number"===n.level.kind&&"1"!==n.level.value)?vr(["".concat(n.kind," "),t.call(i,"level")]):n.kind;case"call":return 1===n.arguments.length&&Wo(n.arguments[0],e.originalText,e)?vr([t.call(i,"what"),vr(["(",Ar(", ",t.map(i,"arguments")),")"])]):Zr(n.what)?function(t,e,i){var n=[];function s(t){var i=e.originalText,n=To(i,t,e);return")"===i.charAt(n)?Mr(i,n+1,e):ko(i,t,e)}function r(t){var o=t.getValue();if("call"!==o.kind||!Zr(o.what)&&"call"!==o.what.kind)if(Zr(o)){var a=null;a="propertylookup"===o.kind?yo(t,e,i):"nullsafepropertylookup"===o.kind?vo(t,e,i):"staticlookup"===o.kind?Ao(t,e,i):go(t,e,i),n.unshift({node:o,needsParens:Er(t),printed:dr.printAllComments(t,(function(){return a}),e)}),t.call((function(t){return r(t)}),"what")}else n.unshift({node:o,printed:t.call(i)});else n.unshift({node:o,printed:vr([dr.printAllComments(t,(function(){return vr([bo(t,e,i)])}),e),s(o)?Ir:""])}),t.call((function(t){return r(t)}),"what")}var o=t.getValue();n.unshift({node:o,printed:bo(t,e,i)}),t.call((function(t){return r(t)}),"what");for(var a=0;a<n.length;++a)"call"===n[a].node.kind&&n[a-1]&&["propertylookup","staticlookup"].includes(n[a-1].node.kind)&&n[a-1].needsParens&&(n[0].printed=vr(["(",n[0].printed]),n[a-1].printed=vr([n[a-1].printed,")"]));for(var h=[],l=[n[0]],c=1;c<n.length&&("call"===n[c].node.kind||Zr(n[c].node)&&n[c].node.offset&&"number"===n[c].node.offset.kind);++c)l.push(n[c]);if("call"!==n[0].node.kind)for(;c+1<n.length&&(Zr(n[c].node)&&Zr(n[c+1].node));++c)l.push(n[c]);h.push(l),l=[];for(var u=!1;c<n.length;++c){if(u&&Zr(n[c].node)){if("offsetlookup"===n[c].node.kind&&n[c].node.offset&&"number"===n[c].node.offset.kind){l.push(n[c]);continue}h.push(l),l=[],u=!1}"call"===n[c].node.kind&&(u=!0),l.push(n[c]),n[c].node.comments&&dr.hasTrailingComment(n[c].node)&&(h.push(l),l=[],u=!1)}l.length>0&&h.push(l);function _(t){var i=t[1].length&&"offsetlookup"===t[1][0].node.kind;if(1===t[0].length){var n=t[0][0].node;return"variable"===n.kind&&("this"===n.name||d&&s(n.name))||_o(n)}function s(t){return t.length<e.tabWidth}var r=Gr(t[0]).node;return Zr(r)&&("identifier"===r.offset.kind||"variable"===r.offset.kind)&&i}var d="expressionstatement"===t.getParentNode().kind,p=h.length>=2&&!h[1][0].node.comments&&_(h);function f(t){for(var e=[],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 vr(e)}function T(t){return 0===t.length?"":br(Cr(vr([Ir,Ar(Ir,t.map(f))])))}var k=h.map(f),m=vr(k),E=p?3:2,x=h.slice(0,E).reduce((function(t,e){return t.concat(e)}),[]),y=x.slice(1,-1).some((function(t){return dr.hasLeadingComment(t.node)}))||x.slice(0,-1).some((function(t){return dr.hasTrailingComment(t.node)}))||h[E]&&dr.hasLeadingComment(h[E][0].node),v=uo(t,"encapsed");if(h.length<=E&&!y||v)return Cr(m);var A=Gr(p?h.slice(1,2)[0]:h[0]).node,g="call"!==A.kind&&s(A),N=vr([f(h[0]),p?vr(h.slice(1,2).map(f)):"",g?Ir:"",T(h.slice(p?2:1))]),C=n.filter((function(t){return"call"===t.node.kind})).length;if(y||C>=3||k.slice(0,-1).some(Ur))return Cr(N);return vr([Ur(m)||g?yr:"",Sr([m,N])])}(t,e,i):vr([t.call(i,"what"),bo(t,e,i)]);case"new":var S=n.what&&"class"===n.what.kind&&n.what.isAnonymous;if(!S&&1===n.arguments.length&&Wo(n.arguments[0],e.originalText,e))return vr(["new "].concat(A(t.call(Mo,"what")),[t.call(i,"what"),"(",Ar(", ",t.map(i,"arguments")),")"]));var b=[];if(b.push("new "),S)b.push.apply(b,[n.what.leadingComments&&"commentblock"===n.what.leadingComments[0].kind?vr([dr.printComments(n.what.leadingComments,e)," "]):""].concat(A(t.call((function(t,e,i){return Mo(t,e,i,{inline:!0})}),"what")),["class",n.arguments.length>0?vr([" ",bo(t,e,i)]):"",Cr(t.call(i,"what"))]));else{var L=vr([t.call(i,"what"),bo(t,e,i)]);b.push(Xr(n.what)?br(L):L)}return vr(b);case"clone":return vr(["clone ",n.what.comments?br(t.call(i,"what")):t.call(i,"what")]);case"propertylookup":case"nullsafepropertylookup":case"staticlookup":case"offsetlookup":var O,I=t.getParentNode(),R=0;do{O=t.getParentNode(R),R++}while(O&&Zr(O));var w=uo(t,"encapsed")||O&&("new"===O.kind||"assign"===O.kind&&"variable"!==O.left.kind)||"offsetlookup"===n.kind||(_o(n.what)||"variable"===n.what.kind)&&["identifier","variable","encapsedpart"].includes(n.offset.kind)&&I&&!Zr(I);return vr([t.call(i,"what"),w?Io(t,e,i):Cr(br(vr([Rr,Io(t,e,i)])))]);case"exit":return Cr(vr([n.useDie?"die":"exit","(",n.expression?Wo(n.expression,e.originalText,e)?t.call(i,"expression"):vr([br(vr([Rr,t.call(i,"expression")])),Rr]):dr.printDanglingComments(t,e),")"]));case"global":return Cr(vr(["global ",br(vr([Ar(vr([",",gr]),t.map(i,"items"))]))]));case"include":return vr([n.require?"require":"include",n.once?"_once":""," ",n.target.comments?br(t.call(i,"target")):t.call(i,"target")]);case"label":return vr([t.call(i,"name"),":"]);case"goto":return vr(["goto ",t.call(i,"label")]);case"throw":return vr(["throw ",n.what.comments?br(t.call(i,"what")):t.call(i,"what")]);case"silent":return vr(["@",t.call(i,"expr")]);case"halt":return vr([Kr(n)?vr([dr.printDanglingComments(t,e,!0),Ir]):"","__halt_compiler();",n.after]);case"eval":return Cr(vr(["eval(",Wo(n.source,e.originalText,e)?t.call(i,"source"):vr([br(vr([Rr,t.call(i,"source")])),Rr]),")"]));case"echo":var D,P=t.map((function(t){return i(t)}),"expressions");if(1!==P.length||n.expressions[0].comments)P.length>0&&(D=co(n.expressions[0])||n.expressions[0].comments?br(P[0]):Lr(P[0]));else D=v(P,1)[0];return Cr(vr([n.shortForm?"":"echo ",D||"",br(vr(P.slice(1).map((function(t){return vr([",",gr,t])}))))]));case"print":return vr(["print ",n.expression.comments?br(t.call(i,"expression")):t.call(i,"expression")]);case"return":var U=[];if(U.push("return"),n.expr){var B=t.call(i,"expr");U.push(" ",n.expr.comments?br(B):B)}return Kr(n)&&U.push(" ",dr.printDanglingComments(t,e,!0)),vr(U);case"isset":case"unset":return Cr(vr([n.kind,bo(t,e,i,"variables")]));case"empty":return Cr(vr(["empty(",br(vr([Rr,t.call(i,"expression")])),Rr,")"]));case"variable":var M=t.getParentNode(),F=t.getParentNode(1),H="assign"===M.kind?"":n.byref?"&":"",G="encapsedpart"===M.kind&&"simple"===M.syntax&&M.curly||F&&"offsetlookup"===M.kind&&"encapsedpart"===F.kind&&"simple"===F.syntax&&F.curly?"":"$",V=n.curly?"{":"",W=n.curly?"}":"";return vr([H,G,V,t.call(i,"name"),W]);case"constantstatement":case"classconstant":var Q,Y=Mo(t,e,i),j=t.map((function(t){return i(t)}),"constants");if(1!==j.length||n.constants[0].comments)j.length>0&&(Q=br(j[0]));else Q=v(j,1)[0];return Cr(vr([].concat(A(Y),[n.visibility?vr([n.visibility," "]):"","const",Q?vr([" ",Q]):"",br(vr(j.slice(1).map((function(t){return vr([",",Ir,t])}))))])));case"constant":return Ho(n.name,t.call(i,"name")," =",n.value,t.call(i,"value"),!1,e);case"static":var $,z=t.map((function(t){return i(t)}),"variables"),K=n.variables.some((function(t){return t.defaultValue}));if(1!==z.length||n.variables[0].comments)z.length>0&&($=br(z[0]));else $=v(z,1)[0];return Cr(vr(["static",$?vr([" ",$]):"",br(vr(z.slice(1).map((function(t){return vr([",",K?Ir:gr,t])}))))]));case"staticvariable":return Ho(n.variable,t.call(i,"variable")," =",n.defaultValue,t.call(i,"defaultValue"),!1,e);case"list":case"array":var X="array"===n.kind&&mo(e.phpVersion,"5.4")||"list"===n.kind&&(n.shortForm||mo(e.phpVersion,"7.1")),J=X?"[":vr([n.kind,"("]),q=X?"]":")";if(0===n.items.length)return Kr(n)?Cr(vr([J,dr.printDanglingComments(t,e),Rr,q])):vr([J,q]);var Z=Gr(n.items),tt=Z&&"noop"===Z.kind,et=v(n.items.filter((function(t){return"noop"!==t.kind})).sort((function(t,i){return e.locStart(t)-e.locStart(i)})),1)[0],it=!(!et||!et.key)&&et&&Hr(e.originalText,e.locStart(n),e.locStart(et));return Cr(vr([J,br(vr([Rr,wo(t,e,i)])),tt?",":"",Or(!tt&&Eo(e,"5.0")?vr([Z&&lo(Z)?Ir:"",","]):""),dr.printDanglingComments(t,e,!0),Rr,q]),{shouldBreak:it});case"entry":var nt=n.byRef?"&":"",st=n.unpack?"...":"";return n.key?Ho(n.key,t.call(i,"key")," =>",n.value,t.call(i,"value"),nt,e):vr([nt,st,t.call(i,"value")]);case"yield":var rt=vr([n.key?vr([t.call(i,"key")," => "]):"",t.call(i,"value")]);return vr(["yield",n.key||n.value?" ":"",n.value&&n.value.comments?br(rt):rt]);case"yieldfrom":return vr(["yield from ",n.value.comments?br(t.call(i,"value")):t.call(i,"value")]);case"unary":return vr([n.type,t.call(i,"what")]);case"pre":return vr([n.type+n.type,t.call(i,"what")]);case"post":return vr([t.call(i,"what"),n.type+n.type]);case"cast":return vr(["(",n.type,") ",n.expr.comments?br(t.call(i,"expr")):t.call(i,"expr")]);case"assignref":case"assign":var ot="assignref"===n.kind;return Ho(n.left,t.call(i,"left"),vr([" ",ot?"=":n.operator]),n.right,t.call(i,"right"),ot,e);case"bin":var at=t.getParentNode(),ht=t.getParentNode(1),lt=n!==at.body&&("if"===at.kind||"while"===at.kind||"switch"===at.kind||"do"===at.kind),ct=function t(e,i,n,s,r){var o=[],a=e.getValue();if("bin"===a.kind){jr(a.type,a.left.type)?o=o.concat(e.call((function(e){return t(e,i,n,!0,r)}),"left")):o.push(e.call(i,"left"));var h=Oo(a),l=vr(h?[a.type," ",e.call(i,"right")]:[a.type,gr,e.call(i,"right")]),c=e.getParentNode(),u=!(r&&["||","&&"].includes(a.type))&&ro(c)!==ro(a)&&ro(a.left)!==ro(a)&&ro(a.right)!==ro(a),_=co(a.left)||"bin"===a.left.kind&&co(a.left.right);o.push(_?"":" ",u?Cr(l):l),s&&a.comments&&(o=dr.printAllComments(e,(function(){return vr(o)}),n))}else o.push(e.call(i));return o}(t,i,e,!1,lt);if(lt)return vr(ct);if("unary"===at.kind||Zr(at)&&"offsetlookup"!==at.kind)return Cr(vr([br(vr([Rr,vr(ct)])),Rr]));var ut=n!==at.body&&"for"===at.kind||"retif"===at.kind&&ht&&"return"!==ht.kind,_t=["assign","property","constant","staticvariable","entry"].includes(at.kind),dt="bin"===n.left.kind&&jr(n.type,n.left.type);if(ut||Oo(n)&&!dt||!Oo(n)&&_t)return Cr(vr(ct));var pt=vr(ct.slice(1));return Cr(vr([ct.length>0?ct[0]:"",br(pt)]));case"retif":var ft,Tt=[],kt=t.getParentNode(),mt=0;do{ft=t.getParentNode(mt),mt++}while(ft&&"retif"===ft.kind);var Et=ft||kt,xt="bin"===n.falseExpr.kind?br(t.call(i,"falseExpr")):t.call(i,"falseExpr"),yt=vr([n.trueExpr?gr:" ","?",n.trueExpr?vr([" ","bin"===n.trueExpr.kind?br(t.call(i,"trueExpr")):t.call(i,"trueExpr"),gr]):"",":",n.trueExpr?vr([" ",xt]):vr([Lo(n.falseExpr)?" ":gr,xt])]);Tt.push(yt);var vt=function(t){return kt===Et?Cr(t):t},At=t.getParentNode(1),gt="cast"===kt.kind&&At?At:kt,Nt=["propertylookup","staticlookup"].includes(gt.kind),Ct=t.call(i,"test");if(!n.trueExpr){var St=vr([Ct,"bin"===gt.kind||["print","echo","return","include"].includes(Et.kind)?br(vr(Tt)):vr(Tt)]);return"call"===gt.kind&>.what===n||"unary"===gt.kind||Zr(gt)&&"offsetlookup"!==gt.kind?Cr(vr([br(vr([Rr,St])),Rr])):vt(St)}return vt(vr(["retif"===n.test.kind?br(Ct):Ct,br(vr(Tt)),Nt?Rr:""]));case"boolean":return n.value?"true":"false";case"number":return Yr(n.value);case"string":if("encapsedpart"===t.getParentNode().kind){var bt=t.getParentNode(1),Lt=0,Ot=mo(e.phpVersion,"7.3"),It=wr;if("heredoc"===bt.type){It=Ot?Ir:wr;var Rt=bt.raw.split(/\r?\n/g);-1===(Lt=Rt[Rt.length-1].search(/\S/))&&(Lt=Rt[Rt.length-2].search(/\S/))}return Ar(It,n.raw.split(/\r?\n/g).map((function(t,e){return e>0||0===n.loc.start.column?t.substring(Lt):t})))}var wt=oo(n,e)?'"':"'",Dt=n.raw;return"b"===n.raw[0]&&(Dt=Dt.slice(1)),['"',"'"].includes(Dt[0])&&(Dt=Dt.substr(1)),['"',"'"].includes(Dt[Dt.length-1])&&(Dt=Dt.substr(0,Dt.length-1)),vr(["b"===n.raw[0]?"b":"",wt,Ar(wr,Dt.split(/\r?\n/g)),wt]);case"uniontype":return Cr(vr(t.map((function(e,n){return vr(0===n?[t.call(i)]:["|",t.call(i)])}),"types")));case"encapsedpart":var Pt="simple"===n.syntax&&n.curly||"complex"===n.syntax?vr([n.curly?"$":"","{"]):"",Ut="simple"===n.syntax&&n.curly||"complex"===n.syntax?"}":"";return vr([Pt,t.call(i,"expression"),Ut]);case"encapsed":switch(n.type){case"string":case"shell":case"heredoc":var Bt=mo(e.phpVersion,"7.3")?Ir:wr;return vr([Ro(n),"heredoc"===n.type?Bt:"",vr(t.map(i,"value")),Ro(n,{opening:!1}),"heredoc"===n.type&&qr(t)?Ir:""]);default:return"Have not implemented kind ".concat(n.type," yet.")}case"inline":return Ar(wr,n.raw.replace("___PSEUDO_INLINE_PLACEHOLDER___","").split(/\r?\n/g));case"magic":return n.value;case"nowdoc":var Mt=mo(e.phpVersion,"7.3")?Ir:wr;return vr(["<<<'",n.label,"'",Mt,Ar(Mt,n.value.split(/\r?\n/g)),Mt,n.label,qr(t)?Ir:""]);case"name":return vr(["rn"===n.resolution?"namespace\\":"",n.name]);case"literal":return t.call(i,"value");case"parentreference":return"parent";case"selfreference":return"self";case"staticreference":return"static";case"typereference":return n.name;case"nullkeyword":return"null";case"identifier":return"method"===t.getParentNode().kind&&(n.name=fo(n.name)),t.call(i,"name");case"match":var Ft=t.map((function(t,e){var n=null===t.getValue().conds?"default":vr(t.map((function(t,e){return Cr(vr(e>0?[",",gr,i(t)]:[i(t)]))}),"conds")),s=t.call(i,"body");return vr(e>0?[", ",gr,n," => ",s]:[gr,n," => ",s])}),"arms");return Cr(vr(["match (",Cr(vr([Rr,br(vr([t.call(i,"cond")])),Rr])),") {",br(vr(Ft))," ",Rr,"}"]));case"noop":return n.comments?dr.printComments(t.getValue().comments,e):"";case"namedargument":return vr([n.name,": ",t.call(i,"value")]);case"error":default:return"Have not implemented kind ".concat(n.kind," yet.")}}(t,e,i),r=[],o=Er(t);return o&&r.unshift("("),r.push(s),o&&r.push(")"),Qr(t)&&r.push(";"),zr(t)&&r.push(Ir),vr(r)};var Yo=function(t,e){if(["loc","range","raw","comments","leadingComments","trailingComments","parenthesizedExpression","parent","prev","start","end","tokens","errors","extra"].forEach((function(t){delete e[t]})),"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(/\r\n?|\n/g,"")}if(("continue"===t.kind||"break"===t.kind)&&t.level){var i=e.level;"number"===i.kind&&(e.level="1"===i.value?null:i)}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;if("number"===t.kind&&(e.value=Rs.printNumber(t.value)),["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=Rs.normalizeMagicMethodName(e.name.name)),"noop"===t.kind)return null},jo="PHP",$o={phpVersion:{since:"0.13.0",category:jo,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"}]},trailingCommaPHP:{since:"0.0.0",category:jo,type:"boolean",default:!0,description:"Print trailing commas wherever possible when multi-line."},braceStyle:{since:"0.10.0",category:jo,type:"choice",default:"psr-2",description:"Print one space or newline for code blocks (classes and functions).",choices:[{value:"psr-2",description:"Use PSR-2 brace style."},{value:"1tbs",description:"Use 1tbs brace style."}]}},zo=function(t,e,i,n){if("length"!==i&&"prototype"!==i&&"arguments"!==i&&"caller"!==i){var s=Object.getOwnPropertyDescriptor(t,i),r=Object.getOwnPropertyDescriptor(e,i);!Ko(s,r)&&n||Object.defineProperty(t,i,r)}},Ko=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)},Xo=function(t,e){var i=Object.getPrototypeOf(e);i!==Object.getPrototypeOf(t)&&Object.setPrototypeOf(t,i)},Jo=function(t,e){return"/* Wrapped ".concat(t,"*/\n").concat(e)},qo=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),Zo=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),ta=function(t,e,i){var n=""===i?"":"with ".concat(i.trim(),"() "),s=Jo.bind(null,n,e.toString());Object.defineProperty(s,"name",Zo),Object.defineProperty(t,"toString",y(y({},qo),{},{value:s}))},ea=function(t,e){var i,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=n.ignoreNonConfigurable,r=void 0!==s&&s,o=t.name,a=C(Reflect.ownKeys(e));try{for(a.s();!(i=a.n()).done;){var h=i.value;zo(t,e,h,r)}}catch(t){a.e(t)}finally{a.f()}return Xo(t,e),ta(t,e,o),t},ia="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function na(t){return t&&t.default||t}var sa,ra=function(){var t={};return t.promise=new Promise((function(e,i){t.resolve=e,t.reject=i})),t},oa=function(t,e){return t(e={exports:{}},e.exports),e.exports}((function(t,e){var i=ia&&ia.__awaiter||function(t,e,i,n){return new(i||(i=Promise))((function(s,r){function o(t){try{h(n.next(t))}catch(t){r(t)}}function a(t){try{h(n.throw(t))}catch(t){r(t)}}function h(t){t.done?s(t.value):new i((function(e){e(t.value)})).then(o,a)}h((n=n.apply(t,e||[])).next())}))},n=ia&&ia.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var s=n(ra);function r(t){var e,n,r,o=this,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"maxAge",h=function(){return i(o,void 0,void 0,regeneratorRuntime.mark((function o(){var h,l,c,u,_=this;return regeneratorRuntime.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:if(void 0===e){o.next=2;break}return o.abrupt("return");case 2:h=function(o){return i(_,void 0,void 0,regeneratorRuntime.mark((function i(){var h;return regeneratorRuntime.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(r=s.default(),!((h=o[1][a]-Date.now())<=0)){i.next=6;break}return t.delete(o[0]),r.resolve(),i.abrupt("return");case 6:return e=o[0],"function"==typeof(n=setTimeout((function(){t.delete(o[0]),r&&r.resolve()}),h)).unref&&n.unref(),i.abrupt("return",r.promise);case 10:case"end":return i.stop()}}),i)})))},o.prev=3,l=C(t),o.prev=5,l.s();case 7:if((c=l.n()).done){o.next=13;break}return u=c.value,o.next=11,h(u);case 11:o.next=7;break;case 13:o.next=18;break;case 15:o.prev=15,o.t0=o.catch(5),l.e(o.t0);case 18:return o.prev=18,l.f(),o.finish(18);case 21:o.next=25;break;case 23:o.prev=23,o.t1=o.catch(3);case 25:e=void 0;case 26:case"end":return o.stop()}}),o,null,[[3,23],[5,15,18,21]])})))},l=function(){e=void 0,void 0!==n&&(clearTimeout(n),n=void 0),void 0!==r&&(r.reject(void 0),r=void 0)},c=t.set.bind(t);return t.set=function(i,n){t.has(i)&&t.delete(i);var s=c(i,n);return e&&e===i&&l(),h(),s},h(),t}e.default=r,t.exports=r,t.exports.default=r}));(sa=oa)&&sa.__esModule&&Object.prototype.hasOwnProperty.call(sa,"default")&&sa.default;var aa=oa,ha=new WeakMap,la=new WeakMap,ca=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=e.cacheKey,n=e.cache,s=void 0===n?new Map:n,r=e.maxAge;"number"==typeof r&&aa(s);var o=function(){for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];var a=i?i(n):n[0],h=s.get(a);if(h)return h.data;var l=t.apply(this,n);return s.set(a,{data:l,maxAge:r?Date.now()+r:Number.POSITIVE_INFINITY}),l};return ea(o,t,{ignoreNonConfigurable:!0}),la.set(o,s),o};ca.decorator=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(e,i,n){var s=e[i];if("function"!=typeof s)throw new TypeError("The decorated value must be a function");delete n.value,delete n.writable,n.get=function(){if(!ha.has(this)){var e=ca(s,t);return ha.set(this,e),e}return ha.get(this)}}},ca.clear=function(t){var e=la.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()};var ua=/@prettier|@format/,_a=ca((function(t){var e=cs(t),i=v(e.children,1)[0],n=v(e.comments.filter((function(t){return"commentblock"===t.kind})),1)[0];if(i&&n&&n.loc.start.line<i.loc.start.line)return n}));var da=function(t){if(!ua.test(t))return!1;var e=_a(t);if(e){var i=e.value;return ua.test(i)}return!1},pa=function(t){var e=_a(t);if(e){var i=e.loc,n=i.start.offset,s=i.end.offset,r=t.substring(0,n),o=t.substring(s);return"".concat(r).concat(function(t,e){var i=t.split(/\r?\n/g);if(1===i.length){var n=v(/\/*\*\*(.*)\*\//.exec(i[0]),2)[1];i=["/**"," * ".concat(n.trim())," */"]}var s=i.findIndex((function(t){return/@\S/.test(t)}))||1;return i.splice(s,0," * @format"),i.join(function(t){var e=t.indexOf("\n");return e>=0&&"\r"===t.charAt(e-1)?"\r\n":"\n"}(e))}(e.value,t)).concat(o)}var a="<?php";if(!t.startsWith(a))return t;var h=a.length,l=t.substring(0,h),c=t.substring(h);return"".concat(l,"\n/** \n * @format \n */\n").concat(c)},fa="programming",Ta="text.html.php",ka="application/x-httpd-php",ma="#4F5D95",Ea=[".php",".aw",".ctp",".fcgi",".inc",".php3",".php4",".php5",".phps",".phpt"],xa=[".php",".php_cs",".php_cs.dist","Phakefile"],ya=["php"],va=["inc"],Aa={name:"PHP",type:fa,tmScope:Ta,aceMode:"php",codemirrorMode:"php",codemirrorMimeType:ka,color:ma,extensions:Ea,filenames:xa,interpreters:ya,aliases:va,languageId:272},ga=Object.freeze({__proto__:null,name:"PHP",type:fa,tmScope:Ta,aceMode:"php",codemirrorMode:"php",codemirrorMimeType:ka,color:ma,extensions:Ea,filenames:xa,interpreters:ya,aliases:va,languageId:272,default:Aa}),Na="HTML+PHP",Ca="markup",Sa="text.html.php",ba="HTML",La=[".phtml"],Oa="application/x-httpd-php",Ia={name:Na,type:Ca,tmScope:Sa,group:ba,extensions:La,aceMode:"php",codemirrorMode:"php",codemirrorMimeType:Oa,languageId:151},Ra=Object.freeze({__proto__:null,name:Na,type:Ca,tmScope:Sa,group:ba,extensions:La,aceMode:"php",codemirrorMode:"php",codemirrorMimeType:Oa,languageId:151,default:Ia}),wa=na(ga),Da=na(Ra),Pa=n.default.doc.builders,Ua=Pa.join,Ba=Pa.hardline,Ma=da,Fa=pa;function Ha(t,e){var i=e.extend,n=e.override,s={};for(var r in t){s["languageId"===r?"linguistLanguageId":r]=t[r]}if(i)for(var o in i)s[o]=(s[o]||[]).concat(i[o]);for(var a in n)s[a]=n[a];return s}var Ga=[Ha(wa,{override:{parsers:["php"],vscodeLanguageIds:["php"]}}),Ha(Da,{override:{parsers:["php"],vscodeLanguageIds:["php"]}})],Va=function(t){return function(e){return e.loc&&e.loc[t]&&e.loc[t].offset}},Wa={php:{parse:cs,astFormat:"php",locStart:Va("start"),locEnd:Va("end"),hasPragma:Ma}},Qa={languages:Ga,printers:{php:{print:Qo,insertPragma:Fa,massageAstNode:Yo,getCommentChildNodes:dr.getCommentChildNodes,canAttachComment:dr.canAttachComment,isBlockComment:dr.isBlockComment,handleComments:{ownLine:dr.handleOwnLineComment,endOfLine:dr.handleEndOfLineComment,remaining:dr.handleRemainingComment},willPrintOwnComments(t){var e=t.getValue();return e&&"noop"===e.kind},printComment(t){var e=t.getValue();switch(e.kind){case"commentblock":if(!e.value.includes("\n"))return e.value;var i=e.value.split(/\r?\n/g);return i.slice(1,i.length-1).every((function(t){return"*"===t.trim()[0]}))?Ua(Ba,i.map((function(t,e){return(e>0?" ":"")+(e<i.length-1?t.trim():t.trimLeft())}))):e.value;case"commentline":return e.value.trimRight();default:throw new Error("Not a comment: ".concat(JSON.stringify(e)))}},hasPrettierIgnore(t){var e=function(t){return t.value.includes("prettier-ignore")&&!t.value.includes("prettier-ignore-start")&&!t.value.includes("prettier-ignore-end")},i=t.getParentNode(),n=t.getNode();return n&&"classconstant"!==n.kind&&n.comments&&n.comments.length>0&&n.comments.some(e)||n&&"constant"===n.kind&&i&&"classconstant"===i.kind&&i.comments&&i.comments.length>0&&i.comments.some(e)}}},parsers:Wa,options:$o,defaultOptions:{tabWidth:4}},Ya=Qa.languages,ja=Qa.printers,$a=Qa.parsers,za=Qa.options,Ka=Qa.defaultOptions;t.default=Qa,t.defaultOptions=Ka,t.languages=Ya,t.options=za,t.parsers=$a,t.printers=ja,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 n=i(e);function s(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function r(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?s(Object(i),!0).forEach((function(e){a(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):s(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function a(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function h(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var i=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==i)return;var n,s,r=[],o=!0,a=!1;try{for(i=i.call(t);!(o=(n=i.next()).done)&&(r.push(n.value),!e||r.length!==e);o=!0);}catch(t){a=!0,s=t}finally{try{o||null==i.return||i.return()}finally{if(a)throw s}}return r}(t,e)||c(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(t){return function(t){if(Array.isArray(t))return u(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||c(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(t,e){if(t){if("string"==typeof t)return u(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?u(t,e):void 0}}function u(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function _(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=c(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,s=function(){};return{s:s,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:s}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,o=!0,a=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return o=t.done,t},e:function(t){a=!0,r=t},f:function(){try{o||null==i.return||i.return()}finally{if(a)throw r}}}}var d={matchST_ATTRIBUTE:function(){var t=0,e=this.input();if(this.is_WHITESPACE()){do{e=this.input()}while(this.is_WHITESPACE());return this.unput(1),null}switch(e){case"]":return 0===t?this.popState():t--,"]";case"(":case")":case":":case"=":return this.consume_TOKEN();case"[":return t++,"[";case",":return",";case'"':return this.ST_DOUBLE_QUOTES();case"'":return this.T_CONSTANT_ENCAPSED_STRING();case"/":if("/"===this._input[this.offset])return this.T_COMMENT();if("*"===this._input[this.offset])return this.input(),this.T_DOC_COMMENT()}if(this.is_LABEL_START()||"\\"===e){for(;this.offset<this.size;){var i=this.input();if(!this.is_LABEL()&&"\\"!==i){i&&this.unput(1);break}}return this.tok.T_STRING}if(this.is_NUM())return this.consume_NUM();throw new Error('Bad terminal sequence "'.concat(e,'" at line ').concat(this.yylineno," (offset ").concat(this.offset,")"))}};d.matchST_ATTRIBUTE;var p={T_COMMENT:function(){for(;this.offset<this.size;){var 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(){var 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())&&"/"===this._input[this.offset]){this.input();break}return e}};p.T_COMMENT,p.T_DOC_COMMENT;var f={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;){var t=this.input();if("<"==t)if("?"==(t=this.ahead(1))){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||"\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}};f.nextINITIAL,f.matchINITIAL;var T={consume_NUM:function(){var t=this.yytext[0],e="."===t;if("0"===t)if("x"===(t=this.input())||"X"===t){if("_"!==(t=this.input())&&this.is_HEX())return this.consume_HNUM();this.unput(t?2:1)}else if("b"===t||"B"===t){if("_"!==(t=this.input())&&"0"===t||"1"===t)return this.consume_BNUM();this.unput(t?2:1)}else this.is_NUM()||t&&this.unput(1);for(;this.offset<this.size;){var i=t;if("_"===(t=this.input())){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}var n=2;if("+"!==(t=this.input())&&"-"!==t||(n=3,t=this.input()),this.is_NUM_START())return this.consume_LNUM(),this.tok.T_DNUMBER;this.unput(t?n:n-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;){var 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;){var t=this.input();if(!this.is_NUM()){t&&this.unput(1);break}}return this.tok.T_LNUMBER},consume_BNUM:function(){for(var t;this.offset<this.size;)if("0"!==(t=this.input())&&"1"!==t&&"_"!==t){t&&this.unput(1);break}return this.tok.T_LNUMBER}};T.consume_NUM,T.consume_HNUM,T.consume_LNUM,T.consume_BNUM;var k={matchST_LOOKING_FOR_PROPERTY:function(){var t=this.input();if("-"===t){if(">"===(t=this.input()))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(){var t=this.input();if(this.popState(),this.begin("ST_IN_SCRIPTING"),this.is_LABEL_START()){if(this.consume_LABEL(),"["===(t=this.input())||"}"===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(){var 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")}};k.matchST_LOOKING_FOR_PROPERTY,k.matchST_LOOKING_FOR_VARNAME,k.matchST_VAR_OFFSET;var m={matchST_IN_SCRIPTING:function(){var 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.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();var e=this._input[this.offset];return"\n"!==e&&"\r"!==e||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(),"\n"!==(t=this._input[this.offset])&&"\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;){var t=this.input();if(" "!==t&&"\t"!==t&&"\n"!==t&&"\r"!==t){t&&this.unput(1);break}}return this.tok.T_WHITESPACE}};m.matchST_IN_SCRIPTING,m.T_WHITESPACE;var E=["\n","\r"],x=["\n","\r",";"],y=x.concat(["\t"," ",",","]",")","/","=","!"]),v={T_CONSTANT_ENCAPSED_STRING:function(){for(var t;this.offset<this.size;)if("\\"==(t=this.input()))this.input();else if("'"==t)break;return this.tok.T_CONSTANT_ENCAPSED_STRING},is_HEREDOC:function(){var 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()););var e=this._input[this.offset-1];if("'"===e||'"'===e?this.offset++:e=null,this.is_LABEL_START()){for(var i=this.offset-1;this.offset<this.size&&(this.offset++,this.is_LABEL()););var n=this._input.substring(i,this.offset-1);if((!e||e===this._input[this.offset-1])&&(e&&this.offset++,E.includes(this._input[this.offset-1])))return this.heredoc_label.label=n,this.heredoc_label.length=n.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(){for(var t;this.offset<this.size;)if("\\"==(t=this.input()))this.input();else{if('"'==t)break;if("$"==t){if("{"==(t=this.input())||this.is_LABEL_START()){this.unput(2);break}t&&this.unput(1)}else if("{"==t){if("$"==(t=this.input())){this.unput(2);break}t&&this.unput(1)}}if('"'==t)return this.tok.T_CONSTANT_ENCAPSED_STRING;var e=1;return"b"!==this.yytext[0]&&"B"!==this.yytext[0]||(e=2),this.yytext.length>2&&this.appendToken(this.tok.T_ENCAPSED_AND_WHITESPACE,this.yytext.length-e),this.unput(this.yytext.length-e),this.begin("ST_DOUBLE_QUOTES"),this.yytext},isDOC_MATCH:function(t,e){var i=this._input[t-2];if(!E.includes(i))return!1;var n=!1,s=!1,r=0,o=this._input[t-1];if(this.version>=703){for(;"\t"===o||" "===o;)" "===o?n=!0:"\t"===o&&(s=!0),o=this._input[t+r],r++;if(t+=r,E.includes(this._input[t-1]))return!1}if(this._input.substring(t-1,t-1+this.heredoc_label.length)===this.heredoc_label.label){var a=this._input[t-1+this.heredoc_label.length];if((this.version>=703?y:x).includes(a)){if(e){if(this.consume(r),n&&s)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=n,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;for(var t=this.offset+1;t<this._input.length;){if(this.isDOC_MATCH(t,!1))return;if(!E.includes(this._input[t-1]))for(;!E.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;for(var t=this._input[this.offset-1];this.offset<this.size;)if(E.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(){var 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(),E.includes(t)||(t=this.input())),E.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()))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()){var e=this.offset,i=this.consume_VARIABLE();return this.yytext.length>this.offset-e+2?(this.appendToken(i,this.offset-e+2),this.unput(this.offset-e+2),this.tok.T_ENCAPSED_AND_WHITESPACE):i}}else if("{"===t){if("$"===(t=this.input()))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();var 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(){var t=this.input();if("$"===t){if("{"===(t=this.input()))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()))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()){var e=this.offset,i=this.consume_VARIABLE();return this.yytext.length>this.offset-e+2?(this.appendToken(i,this.offset-e+2),this.unput(this.offset-e+2),this.tok.T_ENCAPSED_AND_WHITESPACE):i}continue}if("{"===t){if("$"===(t=this.input()))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(){var t=this.input();if("$"===t){if("{"===(t=this.input()))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()))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()){var e=this.offset,i=this.consume_VARIABLE();return this.yytext.length>this.offset-e+2?(this.appendToken(i,this.offset-e+2),this.unput(this.offset-e+2),this.tok.T_ENCAPSED_AND_WHITESPACE):i}t&&this.unput(1)}else if("{"===t){if("$"===(t=this.input()))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}};v.T_CONSTANT_ENCAPSED_STRING,v.is_HEREDOC,v.ST_DOUBLE_QUOTES,v.isDOC_MATCH,v.prematch_ENDOFDOC,v.matchST_NOWDOC,v.matchST_HEREDOC,v.consume_VARIABLE,v.matchST_BACKQUOTE,v.matchST_DOUBLE_QUOTES;var A={T_STRING:function(){var t=this.yytext.toLowerCase(),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){var i=this.input(1);if('"'===i)return this.ST_DOUBLE_QUOTES();if("'"===i)return this.T_CONSTANT_ENCAPSED_STRING();i&&this.unput(1)}return e},consume_TOKEN:function(){var 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(){var 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(){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(){var t=this.offset;if(this.input(),this.is_TABSPACE()&&this.consume_TABSPACE().input(),this.is_LABEL_START()){var e=this.yytext.length;this.consume_LABEL();var i=this.yytext.substring(e-1).toLowerCase(),n=this.castKeywords[i];if("number"==typeof n&&(this.input(),this.is_TABSPACE()&&this.consume_TABSPACE().input(),")"===this._input[this.offset-1]))return n}return this.unput(this.offset-t),"("},"=":function(){var 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(){var 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(){var t=this._input[this.offset];return"<"===t?"="===(t=this._input[this.offset+1])?(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(){var t=this._input[this.offset];return"="===t?(this.input(),this.tok.T_IS_GREATER_OR_EQUAL):">"===t?"="===(t=this._input[this.offset+1])?(this.consume(2),this.tok.T_SR_EQUAL):(this.input(),this.tok.T_SR):">"},"*":function(){var 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(){var 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(){var t=this._input[this.offset];return"="===t?(this.input(),this.tok.T_AND_EQUAL):"&"===t?(this.input(),this.tok.T_BOOLEAN_AND):"&"},"|":function(){var 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):"^"}}};A.T_STRING,A.consume_TOKEN,A.tokenTerminals;var g={is_NUM:function(){var t=this._input.charCodeAt(this.offset-1);return t>47&&t<58||95===t},is_NUM_START:function(){var t=this._input.charCodeAt(this.offset-1);return t>47&&t<58},is_LABEL:function(){var 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(){var 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;){var t=this.input();if(!this.is_LABEL()){t&&this.unput(1);break}}return this},is_TOKEN:function(){var t=this._input[this.offset-1];return-1!==";:,.\\[]()|^&+-/*=%!~$<>?@".indexOf(t)},is_WHITESPACE:function(){var t=this._input[this.offset-1];return" "===t||"\t"===t||"\n"===t||"\r"===t},is_TABSPACE:function(){var t=this._input[this.offset-1];return" "===t||"\t"===t},consume_TABSPACE:function(){for(;this.offset<this.size;){var t=this.input();if(!this.is_TABSPACE()){t&&this.unput(1);break}}return this},is_HEX:function(){var t=this._input.charCodeAt(this.offset-1);return t>47&&t<58||(t>64&&t<71||(t>96&&t<103||95===t))}};g.is_NUM,g.is_NUM_START,g.is_LABEL,g.is_LABEL_START,g.consume_LABEL,g.is_TOKEN,g.is_WHITESPACE,g.is_TABSPACE,g.consume_TABSPACE,g.is_HEX;var N=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}};N.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},N.prototype.input=function(){var 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):""},N.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(var e=0;e<this.yytext.length;e++){var i=this.yytext[e];"\r"===i?(i=this.yytext[++e],this.yyprevcol=this.yylloc.last_column,this.yylloc.last_line++,this.yylloc.last_column=0,"\n"!==i&&("\r"===i?this.yylloc.last_line++:this.yylloc.last_column++)):"\n"===i?(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},N.prototype.tryMatch=function(t){return t===this.ahead(t.length)},N.prototype.tryMatchCaseless=function(t){return t===this.ahead(t.length).toLowerCase()},N.prototype.ahead=function(t){var 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},N.prototype.consume=function(t){for(var e=0;e<t;e++){var i=this._input[this.offset];if(!i)break;this.yytext+=i,this.offset++,"\r"===i&&"\n"===this._input[this.offset]&&(this.yytext+="\n",this.offset++,e++),"\n"===i||"\r"===i?(this.yylloc.last_line=++this.yylineno,this.yyprevcol=this.yylloc.last_column,this.yylloc.last_column=0):this.yylloc.last_column++}return this},N.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}},N.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},N.prototype.appendToken=function(t,e){return this.tokens.push([t,e]),this},N.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;var 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},N.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},N.prototype.popState=function(){var 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},N.prototype.next=function(){var 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?("object"===o((t=this.tokens.shift())[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){var e=t;e="number"==typeof e?this.engine.tokens.values[e]:'"'+e+'"';var 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},[d,p,f,T,k,m,v,A,g].forEach((function(t){for(var e in t)N.prototype[e]=t[e]}));var C=N,S=function(t,e,i){this.line=t,this.column=e,this.offset=i},b={read_array:function(){var t=null,e=!1,i=this.node("array");this.token===this.tok.T_ARRAY?(this.next().expect("("),t=")"):(e=!0,t="]");var n=[];return this.next().token!==t&&(n=this.read_array_pair_list(e)),this.expect(t),this.next(),i(e,n)},read_array_pair_list:function(t){var 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)){if(","===this.token)return this.node("noop")();var e=this.node("entry"),i=null,n=null,s=!1,r=!1;if("&"===this.token)this.next(),s=!0,n=this.read_variable(!0,!1);else if(this.token===this.tok.T_ELLIPSIS&&this.version>=704)this.next(),"&"===this.token&&this.error(),r=!0,n=this.read_expr();else{var o=this.read_expr();this.token===this.tok.T_DOUBLE_ARROW?(this.next(),i=o,"&"===this.token?(this.next(),s=!0,n=this.read_variable(!0,!1)):n=this.read_expr()):n=o}return e(i,n,s,r)}}};b.read_array,b.read_array_pair_list,b.read_array_pair;var O={read_class_declaration_statement:function(t){var 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);var n=this.node("identifier"),s=this.text();this.next(),n=n(s);var r=this.read_extends_from(),o=this.read_implements_list();this.expect("{");var a=e(n,r,o,this.next().read_class_body(!0,!1),i);return t&&(a.attrGroups=t),a},read_class_modifiers:function(){return[0,0,this.read_class_modifier()]},read_class_modifier:function(){return this.token===this.tok.T_ABSTRACT?(this.next(),1):this.token===this.tok.T_FINAL?(this.next(),2):0},read_class_body:function(t,e){for(var i=[],n=[];this.token!==this.EOF&&"}"!==this.token;)if(this.token!==this.tok.T_COMMENT)if(this.token!==this.tok.T_DOC_COMMENT)if(this.token!==this.tok.T_USE)if(e&&this.token===this.tok.T_CASE){var s=this.read_enum_case();this.expect(";")&&this.next(),i=i.concat(s)}else{this.token===this.tok.T_ATTRIBUTE&&(n=this.read_attr_list());var r=this.position(),o=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),o[0]=null,o[1]=0),this.token===this.tok.T_FUNCTION)i.push(this.read_function(!1,o,n,r)),n=[];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_CALLABLE||this.token===this.tok.T_ARRAY||this.token===this.tok.T_NS_SEPARATOR||this.token===this.tok.T_STRING||this.token===this.tok.T_NAMESPACE))){var a=this.read_variable_list(o,n);n=[],this.expect(";"),this.next(),i=i.concat(a)}else this.error([this.tok.T_CONST].concat(l(t?[this.tok.T_VARIABLE]:[]),l(e?[this.tok.T_CASE]:[]),[this.tok.T_FUNCTION])),this.next();else{var h=this.read_constant_list(o,n);this.expect(";")&&this.next(),i=i.concat(h)}}else i=i.concat(this.read_trait_use_statement());else i.push(this.read_doc_comment());else i.push(this.read_comment());return this.expect("}"),this.next(),i},read_variable_list:function(t,e){var i=this.node("propertystatement"),n=this.read_list((function(){var t=this.node("property"),i=!1;this.token===this.tok.T_READ_ONLY&&(i=!0,this.next());var n=h(this.read_optional_type(),2),s=n[0],r=n[1];this.expect(this.tok.T_VARIABLE);var o=this.node("identifier"),a=this.text().substring(1);return this.next(),o=o(a),";"===this.token||","===this.token?t(o,null,i,s,r,e||[]):"="===this.token?t(o,this.next().read_expr(),i,s,r,e||[]):(this.expect([",",";","="]),t(o,null,s,r,e||[]))}),",");return i(null,n,t)},read_constant_list:function(t,e){this.expect(this.tok.T_CONST)&&this.next();var i=this.node("classconstant"),n=this.read_list((function(){var t=this.node("constant"),e=null,i=null;if(this.token===this.tok.T_STRING||this.version>=700&&this.is("IDENTIFIER")){e=this.node("identifier");var n=this.text();this.next(),e=e(n)}else this.expect("IDENTIFIER");return this.expect("=")&&(i=this.next().read_expr()),t(e,i)}),",");return i(null,n,t,e||[])},read_member_flags:function(t){var e=[-1,-1,-1];if(this.is("T_MEMBER_FLAGS")){var i=0,n=0;do{switch(this.token){case this.tok.T_PUBLIC:i=0,n=0;break;case this.tok.T_PROTECTED:i=0,n=1;break;case this.tok.T_PRIVATE:i=0,n=2;break;case this.tok.T_STATIC:i=1,n=1;break;case this.tok.T_ABSTRACT:i=2,n=1;break;case this.tok.T_FINAL:i=2,n=2}t&&(0==i&&2==n?(this.expect([this.tok.T_PUBLIC,this.tok.T_PROTECTED]),n=-1):2==i&&1==n&&(this.error(),n=-1)),-1!==e[i]?this.error():-1!==n&&(e[i]=n)}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(){var t=!1;"?"===this.token&&(t=!0,this.next());var 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();var i=this.read_type();if(!i){this.raiseError("Expecting a type definition");break}e.push(i)}while("|"===this.token)}return[t,e]},read_interface_declaration_statement:function(t){var 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);var i=this.node("identifier"),n=this.text();this.next(),i=i(n);var s=this.read_interface_extends_list();return this.expect("{"),e(i,s,this.next().read_interface_body(),t||[])},read_interface_body:function(){for(var t=[],e=[];this.token!==this.EOF&&"}"!==this.token;)if(this.token!==this.tok.T_COMMENT)if(this.token!==this.tok.T_DOC_COMMENT){var i=this.position();e=this.read_attr_list();var n=this.read_member_flags(!0);if(this.token==this.tok.T_CONST){var s=this.read_constant_list(n,e);this.expect(";")&&this.next(),t=t.concat(s),e=[]}else if(this.token===this.tok.T_FUNCTION){var r=this.read_function_declaration(2,n,e,i);r.parseFlags(n),t.push(r),this.expect(";")&&this.next(),e=[]}else this.error([this.tok.T_CONST,this.tok.T_FUNCTION]),this.next()}else t.push(this.read_doc_comment());else t.push(this.read_comment());return this.expect("}")&&this.next(),t},read_trait_declaration_statement:function(){var 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);var e=this.node("identifier"),i=this.text();return this.next(),e=e(i),this.expect("{"),t(e,this.next().read_class_body(!0,!1))},read_trait_use_statement:function(){var t=this.node("traituse");this.expect(this.tok.T_USE)&&this.next();for(var e=[this.read_namespace_name()],i=null;","===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(){var t,e=this.node(),i=null;if(this.is("IDENTIFIER")){t=this.node("identifier");var n=this.text();this.next(),t=t(n)}else if(t=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=t,t=this.node("identifier");var s=this.text();this.next(),t=t(s)}else this.expect(this.tok.T_STRING);else t=t.name;if(this.token===this.tok.T_INSTEADOF)return e("traitprecedence",i,t,this.next().read_name_list());if(this.token===this.tok.T_AS){var r=null,o=null;if(this.next().is("T_MEMBER_FLAGS")&&(r=this.read_member_flags()),this.token===this.tok.T_STRING||this.version>=700&&this.is("IDENTIFIER")){o=this.node("identifier");var a=this.text();this.next(),o=o(a)}else!1===r&&this.expect(this.tok.T_STRING);return e("traitalias",i,t,o,r)}return this.expect([this.tok.T_AS,this.tok.T_INSTEADOF]),e("traitalias",i,t,null,null)}};O.read_class_declaration_statement,O.read_class_modifiers,O.read_class_modifier,O.read_class_body,O.read_variable_list,O.read_constant_list,O.read_member_flags,O.read_optional_type,O.read_interface_declaration_statement,O.read_interface_body,O.read_trait_declaration_statement,O.read_trait_use_statement,O.read_trait_use_alias;var L={read_comment:function(){var t=this.text(),e=this.ast.prepare("/*"===t.substring(0,2)?"commentblock":"commentline",null,this),i=this.lexer.yylloc.first_offset,n=this.prev;return this.prev=[this.lexer.yylloc.last_line,this.lexer.yylloc.last_column,this.lexer.offset],this.lex(),(e=e(t)).offset=i,this.prev=n,e},read_doc_comment:function(){var t=this.ast.prepare("commentblock",null,this),e=this.lexer.yylloc.first_offset,i=this.text(),n=this.prev;return this.prev=[this.lexer.yylloc.last_line,this.lexer.yylloc.last_column,this.lexer.offset],this.lex(),(t=t(i)).offset=e,this.prev=n,t}};L.read_comment,L.read_doc_comment;var I={read_expr:function(t){var 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){var 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(){var t=null;switch(this.token){case this.tok.T_ISSET:t=this.node("isset"),this.next().expect("(")&&this.next();var 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();var i=this.read_expr();this.expect(")")&&this.next(),t=t(i);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();var n=this.read_expr();this.expect(")")&&this.next(),t=t(n);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(){var t=null;return"("===this.token&&(this.next(),t=this.read_optional_expr(")"),this.expect(")")&&this.next()),t},read_expr_item:function(){var 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()).parenthesizedExpression=!0,this.expect(")")&&this.next(),this.handleDereferencable(e);if("`"===this.token)return this.read_encapsed_string("`");if(this.token===this.tok.T_LIST){var n=null,s=this.innerList;t=this.node("list"),s||(n=this.node("assign")),this.next().expect("(")&&this.next(),this.innerList||(this.innerList=!0);var r=this.read_array_pair_list(!1);this.expect(")")&&this.next();for(var o=!1,a=0;a<r.length;a++)if(null!==r[a]&&"noop"!==r[a].kind){o=!0;break}return o||this.raiseError("Fatal Error : Cannot use empty list on line "+this.lexer.yylloc.first_line),s?t(r,!1):(this.innerList=!1,this.expect("=")?n(t(r,!1),this.next().read_expr(),"="):t(r,!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:return this.version<800&&this.raiseError("PHP 8+ is required to use throw as an expression"),this.node("throw")(this.next().read_expr());case this.tok.T_EXIT:var h="die"===this.lexer.yytext.toLowerCase();return t=this.node("exit"),this.next(),t(this.read_exit_expr(),h);case this.tok.T_PRINT:return this.node("print")(this.next().read_expr());case this.tok.T_YIELD:var l=null,c=null;return t=this.node("yield"),this.next().is("EXPR")&&(l=this.read_expr(),this.token===this.tok.T_DOUBLE_ARROW&&(c=l,l=this.next().read_expr())),t(l,c);case this.tok.T_YIELD_FROM:return(t=this.node("yieldfrom"))(e=this.next().read_expr());case this.tok.T_FN:case this.tok.T_FUNCTION:return this.read_inline_function(void 0,i);case this.tok.T_STATIC:var u=[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(u),this.next()}if(this.is("VARIABLE")){t=this.node();var _="identifier"===(e=this.read_variable(!1,!1)).kind||"staticlookup"===e.kind&&"identifier"===e.offset.kind;switch(this.token){case"=":return _&&this.error("VARIABLE"),"&"==this.next().token?this.read_assignref(t,e):t("assign",e,this.read_expr(),"=");case this.tok.T_PLUS_EQUAL:return _&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"+=");case this.tok.T_MINUS_EQUAL:return _&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"-=");case this.tok.T_MUL_EQUAL:return _&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"*=");case this.tok.T_POW_EQUAL:return _&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"**=");case this.tok.T_DIV_EQUAL:return _&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"/=");case this.tok.T_CONCAT_EQUAL:return _&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),".=");case this.tok.T_MOD_EQUAL:return _&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"%=");case this.tok.T_AND_EQUAL:return _&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"&=");case this.tok.T_OR_EQUAL:return _&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"|=");case this.tok.T_XOR_EQUAL:return _&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"^=");case this.tok.T_SL_EQUAL:return _&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"<<=");case this.tok.T_SR_EQUAL:return _&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),">>=");case this.tok.T_COALESCE_EQUAL:return _&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"??=");case this.tok.T_INC:return _&&this.error("VARIABLE"),this.next(),t("post","+",e);case this.tok.T_DEC:return _&&this.error("VARIABLE"),this.next(),t("post","-",e);default:t.destroy(e)}}else{if(this.is("SCALAR")){if(t=this.node(),"array"===(e=this.read_scalar()).kind&&e.shortForm&&"="===this.token){var d=this.convertToList(e);return e.loc&&(d.loc=e.loc),t("assign",d,this.next().read_expr(),"=")}return t.destroy(e),this.handleDereferencable(e)}this.error("EXPR"),this.next()}return e},convertToList:function(t){var e=this,i=t.items.map((function(t){return t.value&&"array"===t.value.kind&&t.value.shortForm&&(t.value=e.convertToList(t.value)),t})),n=this.node("list")(i,!0);return t.loc&&(n.loc=t.loc),t.leadingComments&&(n.leadingComments=t.leadingComments),t.trailingComments&&(n.trailingComments=t.trailingComments),n},read_assignref:function(t,e){var 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){var i=this.read_function(!0,t,e);return i.attrGroups=e,i}!this.version>=704&&this.raiseError("Arrow Functions are not allowed");var n=this.node("arrowfunc");this.expect(this.tok.T_FN)&&this.next();var s=this.is_reference();this.expect("(")&&this.next();var r=this.read_parameter_list();this.expect(")")&&this.next();var o=!1,a=null;":"===this.token&&("?"===this.next().token&&(o=!0,this.next()),a=this.read_types()),this.expect(this.tok.T_DOUBLE_ARROW)&&this.next();var h=n(r,s,this.read_expr(),a,o,!!t);return h.attrGroups=e,h},read_match_expression:function(){var 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");var e,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(){var t=this;return this.read_list((function(){return t.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(){var 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:function(){var t=this.text(),e=[];return this.next(),"("===this.token&&(e=this.read_argument_list()),this.node("attribute")(t,e)},read_attr_list:function(){var t=[];if(this.token===this.tok.T_ATTRIBUTE)do{var 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(){var t=this.node("new");this.expect(this.tok.T_NEW)&&this.next();var e=[],i=this.read_attr_list();if(this.token===this.tok.T_CLASS){var n=this.node("class");"("===this.next().token&&(e=this.read_argument_list());var s=this.read_extends_from(),r=this.read_implements_list(),o=null;this.expect("{")&&(o=this.next().read_class_body(!0,!1));var a=n(null,s,r,o,[0,0,0]);return a.attrGroups=i,t(a,e)}for(var h=this.read_new_class_name();"["===this.token;){var l=this.node("offsetlookup"),c=this.next().read_encaps_var_offset();this.expect("]")&&this.next(),h=l(h,c)}return"("===this.token&&(e=this.read_argument_list()),t(h,e)},read_new_class_name:function(){if(this.token===this.tok.T_NS_SEPARATOR||this.token===this.tok.T_STRING||this.token===this.tok.T_NAMESPACE){var 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}};I.read_expr,I.read_expr_cast,I.read_isset_variable,I.read_isset_variables,I.read_internal_functions_in_yacc,I.read_optional_expr,I.read_exit_expr,I.read_expr_item,I.convertToList,I.read_assignref,I.read_inline_function,I.read_match_expression,I.read_match_arms,I.read_match_arm,I.read_match_arm_conds,I.read_attribute,I.read_attr_list,I.read_new_expr,I.read_new_class_name,I.handleDereferencable;var R={read_enum_declaration_statement:function(t){var e=this.node("enum");if(!this.expect(this.tok.T_ENUM))return null;this.next().expect(this.tok.T_STRING);var i=this.node("identifier"),n=this.text();this.next(),i=i(n);var s=this.read_enum_value_type(),r=this.read_implements_list();this.expect("{");var o=e(i,s,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);var t=this.node("enumcase"),e=this.node("identifier"),i=this.next().text();this.next(),e=e(i);var n="="===this.token?this.next().read_expr():null;return this.expect(";"),t(e,n)}};R.read_enum_declaration_statement,R.read_enum_value_type,R.read_enum_case;var w={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,n){var s=this.read_function_declaration(t?1:e?2:0,e&&1===e[1],i||[],n);return e&&1==e[2]?(s.parseFlags(e),this.expect(";")&&this.next()):(this.expect("{")&&(s.body=this.read_code_block(!1),s.loc&&s.body.loc&&(s.loc.end=s.body.loc.end)),!t&&e&&s.parseFlags(e)),s},read_function_declaration:function(t,e,i,n){var s=this,r="function";1===t?r="closure":2===t&&(r="method");var o=this.node(r);this.expect(this.tok.T_FUNCTION)&&this.next();var a=this.is_reference(),h=!1,l=[],c=null,u=!1;if(1!==t){var _=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=_(h)}this.expect("(")&&this.next();var d=this.read_parameter_list("__construct"===h.name);this.expect(")")&&this.next(),1===t&&(l=this.read_lexical_vars()),":"===this.token&&("?"===this.next().token&&(u=!0,this.next()),c=this.read_types());var p=function(t){return t.attrGroups=i||[],n&&t.loc&&(t.loc.start=n,t.loc.source&&(t.loc.source=s.lexer._input.substr(t.loc.start.offset,t.loc.end.offset-t.loc.start.offset))),t};return p(1===t?o(d,a,l,c,u,e):o(h,d,a,c,u))},read_lexical_vars:function(){var 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){for(var e=[];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));var t=this.node("variable");this.expect(this.tok.T_VARIABLE);var e=this.text().substring(1);return this.next(),t(e,!1)},read_parameter_list:function(t){return")"!=this.token?this.read_list_with_dangling_comma(this.read_parameter.bind(this,t)):[]},read_parameter:function(t){var e,i=this.node("parameter"),n=null,s=null,r=!1,o=!1,a=[];this.token===this.tok.T_ATTRIBUTE&&(a=this.read_attr_list());var h=this.read_promoted();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),e=this.read_types(),r&&!e&&this.raiseError("Expecting a type definition combined with nullable operator");var l=this.is_reference(),c=this.is_variadic();if(this.expect(this.tok.T_VARIABLE)){n=this.node("identifier");var u=this.text().substring(1);this.next(),n=n(u)}"="==this.token&&(s=this.next().read_expr());var _=i(n,e,s,l,c,o,r,h);return a&&(_.attrGroups=a),_},read_types:function(){var t=[],e=this.node("uniontype"),i=this.read_type();if(!i)return null;for(t.push(i);"|"===this.token;)this.next(),i=this.read_type(),t.push(i);return 1===t.length?t[0]:e(t)},read_promoted:function(){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(){var t=[];return this.expect("(")&&this.next(),")"!==this.token&&(t=this.read_non_empty_argument_list()),this.expect(")")&&this.next(),t},read_non_empty_argument_list:function(){var t=!1;return this.read_function_list(function(){var e=this.read_argument();return e&&(t&&this.raiseError("Unexpected argument after a variadic argument"),"variadic"===e.kind&&(t=!0)),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)){var t=this.lexer.getState(),e=this.lexer.lex();if(this.lexer.setState(t),":"===e)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(){var t=this.node();if(this.token===this.tok.T_ARRAY||this.token===this.tok.T_CALLABLE){var e=this.text();return this.next(),t("typereference",e.toLowerCase(),e)}if(this.token===this.tok.T_STRING||this.token===this.tok.T_STATIC){var i=this.text(),n=[this.token,this.lexer.getState()];return this.next(),this.token!==this.tok.T_NS_SEPARATOR&&this.ast.typereference.types.indexOf(i.toLowerCase())>-1?t("typereference",i.toLowerCase(),i):(this.lexer.tokens.push(n),this.next(),t.destroy(),this.read_namespace_name())}return this.token===this.tok.T_NAMESPACE||this.token===this.tok.T_NS_SEPARATOR?(t.destroy(),this.read_namespace_name()):(t.destroy(),null)}};w.is_reference,w.is_variadic,w.read_function,w.read_function_declaration,w.read_lexical_vars,w.read_list_with_dangling_comma,w.read_lexical_var_list,w.read_lexical_var,w.read_parameter_list,w.read_parameter,w.read_types,w.read_promoted,w.read_argument_list,w.read_non_empty_argument_list,w.read_argument,w.read_type;var D={read_if:function(){var t=this.node("if"),e=this.next().read_if_expr(),i=null,n=null,s=!1;if(":"===this.token){s=!0,this.next(),i=this.node("block");for(var r=[];this.token!==this.EOF&&this.token!==this.tok.T_ENDIF;){if(this.token===this.tok.T_ELSEIF){n=this.read_elseif_short();break}if(this.token===this.tok.T_ELSE){n=this.read_else_short();break}r.push(this.read_inner_statement())}i=i(null,r),this.expect(this.tok.T_ENDIF)&&this.next(),this.expectEndOfStatement()}else i=this.read_statement(),this.token===this.tok.T_ELSEIF?n=this.read_if():this.token===this.tok.T_ELSE&&(n=this.next().read_statement());return t(e,i,n,s)},read_if_expr:function(){this.expect("(")&&this.next();var t=this.read_expr();return this.expect(")")&&this.next(),t},read_elseif_short:function(){var t=null,e=this.node("if"),i=this.next().read_if_expr();this.expect(":")&&this.next();for(var n=this.node("block"),s=[];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}s.push(this.read_inner_statement())}return e(i,n(null,s),t,!0)},read_else_short:function(){this.next().expect(":")&&this.next();for(var t=this.node("block"),e=[];this.token!=this.EOF&&this.token!==this.tok.T_ENDIF;)e.push(this.read_inner_statement());return t(null,e)}};D.read_if,D.read_if_expr,D.read_elseif_short,D.read_else_short;var P={read_while:function(){var t=this.node("while");this.expect(this.tok.T_WHILE)&&this.next();var e,i=null,n=!1;return this.expect("(")&&this.next(),e=this.read_expr(),this.expect(")")&&this.next(),":"===this.token?(n=!0,i=this.read_short_form(this.tok.T_ENDWHILE)):i=this.read_statement(),t(e,i,n)},read_do:function(){var t=this.node("do");this.expect(this.tok.T_DO)&&this.next();var e,i=null;return e=this.read_statement(),this.expect(this.tok.T_WHILE)&&(this.next().expect("(")&&this.next(),i=this.read_expr(),this.expect(")")&&this.next(),this.expect(";")&&this.next()),t(i,e)},read_for:function(){var t=this.node("for");this.expect(this.tok.T_FOR)&&this.next();var e=[],i=[],n=[],s=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?(n=this.read_list(this.read_expr,","),this.expect(")")&&this.next()):this.next(),":"===this.token?(r=!0,s=this.read_short_form(this.tok.T_ENDFOR)):s=this.read_statement(),t(e,i,n,s,r)},read_foreach:function(){var t=this.node("foreach");this.expect(this.tok.T_FOREACH)&&this.next();var e,i=null,n=null,s=null,r=!1;return this.expect("(")&&this.next(),e=this.read_expr(),this.expect(this.tok.T_AS)&&(this.next(),n=this.read_foreach_variable(),this.token===this.tok.T_DOUBLE_ARROW&&(i=n,n=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,s=this.read_short_form(this.tok.T_ENDFOREACH)):s=this.read_statement(),t(e,i,n,s,r)},read_foreach_variable:function(){if(this.token===this.tok.T_LIST||"["===this.token){var t="["===this.token,e=this.node("list");this.next(),!t&&this.expect("(")&&this.next();var i=this.read_array_pair_list(t);return this.expect(t?"]":")")&&this.next(),e(i,t)}return this.read_variable(!1,!1)}};P.read_while,P.read_do,P.read_for,P.read_foreach,P.read_foreach_variable;var U={read_start:function(){return this.token==this.tok.T_NAMESPACE?this.read_namespace():this.read_top_statement()}};U.read_start;var B={read_namespace:function(){var t,e,i=this.node("namespace");return this.expect(this.tok.T_NAMESPACE)&&this.next(),e="{"==this.token?{name:[""]}:this.read_namespace_name(),this.currentNamespace=e,";"==this.token?(this.currentNamespace=e,t=this.next().read_top_statements(),this.expect(this.EOF),i(e.name,t,!1)):"{"==this.token?(this.currentNamespace=e,t=this.next().read_top_statements(),this.expect("}")&&this.next(),0===t.length&&this.extractDoc&&this._docs.length>this._docIndex&&t.push(this.node("noop")()),i(e.name,t,!0)):"("===this.token?(e.resolution=this.ast.reference.RELATIVE_NAME,e.name=e.name.substring(1),i.destroy(),this.node("call")(e,this.read_argument_list())):(this.error(["{",";"]),this.currentNamespace=e,t=this.read_top_statements(),this.expect(this.EOF),i(e,t,!1))},read_namespace_name:function(t){var e=this.node(),i=!1;this.token===this.tok.T_NAMESPACE&&(this.next().expect(this.tok.T_NS_SEPARATOR)&&this.next(),i=!0);var n=this.read_list(this.tok.T_STRING,this.tok.T_NS_SEPARATOR,!0);if(!i&&1===n.length&&(t||"("!==this.token)){if("parent"===n[0].toLowerCase())return e("parentreference",n[0]);if("self"===n[0].toLowerCase())return e("selfreference",n[0])}return e("name",n,i)},read_use_statement:function(){var t=this.node("usegroup"),e=[],i=null;this.expect(this.tok.T_USE)&&this.next();var n=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===n),this.expect("}")&&this.next()),t=t(i,n,e),this.expect(";")&&this.next(),t},read_class_name_reference:function(){return this.read_variable(!0,!1)},read_use_declaration:function(t){var e=this.node("useitem"),i=null;t&&(i=this.read_use_type());var n=this.read_namespace_name(),s=this.read_use_alias();return e(n.name,s,i)},read_use_declarations:function(t){for(var e=[this.read_use_declaration(t)];","===this.token;){if(this.next(),t){if(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_STRING&&this.token!==this.tok.T_NS_SEPARATOR)break;e.push(this.read_use_declaration(t))}return e},read_use_alias:function(){var t=null;if(this.token===this.tok.T_AS&&this.next().expect(this.tok.T_STRING)){var 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}};B.read_namespace,B.read_namespace_name,B.read_use_statement,B.read_class_name_reference,B.read_use_declaration,B.read_use_declarations,B.read_use_alias,B.read_use_type;var M={"\\":"\\",$:"$",n:"\n",r:"\r",t:"\t",f:String.fromCharCode(12),v:String.fromCharCode(11),e:String.fromCharCode(27)},F={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,(function(t,e,i){return M[e]?M[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,n){if(0===e)return t;this.check_heredoc_indentation_level(t,e,i,n);var s=i?" ":"\t",r=new RegExp("\\n".concat(s,"{").concat(e,"}"),"g"),o=new RegExp("^".concat(s,"{").concat(e,"}"));return n&&(t=t.replace(o,"")),t.replace(r,"\n")},check_heredoc_indentation_level:function(t,e,i,n){var s=t.length,r=0,o=0,a=!0,h=i?" ":"\t",l=!1;if(!n){if(-1===(r=t.indexOf("\n")))return;r++}for(;r<s;)a?t[r]===h?o++:l=!0:a=!1,"\n"!==t[r]&&l&&o<e?this.raiseError("Invalid body indentation level (expecting an indentation at least ".concat(e,")")):l=!1,"\n"===t[r]&&(a=!0,o=0),r++},read_dereferencable_scalar:function(){var t=null;switch(this.token){case this.tok.T_CONSTANT_ENCAPSED_STRING:var e=this.node("string"),i=this.text(),n=0;"b"!==i[0]&&"B"!==i[0]||(n=1);var s='"'===i[n];this.next(),e=e(s,this.resolve_special_chars(i.substring(n+1,i.length-1),s),1===n,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();var t,e;switch(this.token){case this.tok.T_LNUMBER:case this.tok.T_DNUMBER:var i=this.node("number");return t=this.text(),this.next(),i(t,null);case this.tok.T_START_HEREDOC:if("ST_NOWDOC"===this.lexer.curCondition){var n=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));var 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();var r=this.lexer._input.substring(n,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),r,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:var o=this.error("SCALAR");return this.next(),o}},read_dereferencable:function(t){var e,i,n=this.node("offsetlookup");return"["===this.token?(i=this.next().read_expr(),this.expect("]")&&this.next(),e=n(t,i)):this.token===this.tok.T_DOLLAR_OPEN_CURLY_BRACES&&(e=n(t,i=this.read_encapsed_string_item(!1))),e},read_encapsed_string_item:function(t){var e,i,n,s=this.node("encapsedpart"),r=null,o=!1,a=this.node();if(this.token===this.tok.T_ENCAPSED_AND_WHITESPACE){var h=this.text();this.next(),a=a("string",!1,this.version>=703&&!this.lexer.heredoc_label.finished?this.remove_heredoc_leading_whitespace_chars(this.resolve_special_chars(h,t),this.lexer.heredoc_label.indentation,this.lexer.heredoc_label.indentation_uses_spaces,this.lexer.heredoc_label.first_encaps_node):h,!1,h)}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");var l=this.text();this.next(),"["===this.token?(n=n(l,!1),i=this.node("offsetlookup"),e=this.next().read_expr(),this.expect("]")&&this.next(),a=i(n,e)):a=n(l,!1)}else a=a("variable",this.read_expr(),!1);this.expect("}")&&this.next()}else if(this.token===this.tok.T_CURLY_OPEN)r="complex",a.destroy(),a=this.next().read_variable(!1,!1),this.expect("}")&&this.next();else if(this.token===this.tok.T_VARIABLE){if(r="simple",a.destroy(),a=this.read_simple_variable(),"["===this.token&&(i=this.node("offsetlookup"),e=this.next().read_encaps_var_offset(),this.expect("]")&&this.next(),a=i(a,e)),this.token===this.tok.T_OBJECT_OPERATOR){i=this.node("propertylookup"),this.next().expect(this.tok.T_STRING);var c=this.node("identifier");n=this.text(),this.next(),a=i(a,c(n))}}else{this.expect(this.tok.T_ENCAPSED_AND_WHITESPACE);var u=this.text();this.next(),a.destroy(),a=a("string",!1,u,!1,u)}return this.lexer.heredoc_label.first_encaps_node=!1,s(a,r,o)},read_encapsed_string:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=this.lexer.yylloc.first_offset,n=this.node("encapsed");this.next();var s=this.lexer.yylloc.prev_offset-(e?1:0),r=[],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){var a=r[r.length-1].expression,h=a.value[a.value.length-1];"\n"===h?"\r"===a.value[a.value.length-2]?a.value=a.value.substring(0,a.value.length-2):a.value=a.value.substring(0,a.value.length-1):"\r"===h&&(a.value=a.value.substring(0,a.value.length-1))}this.expect(t)&&this.next();var l=this.lexer._input.substring("heredoc"===o?i:s-1,this.lexer.yylloc.first_offset);return n=n(r,l,o),t===this.tok.T_END_HEREDOC&&(n.label=this.lexer.heredoc_label.label,this.lexer.heredoc_label.finished=!0),n},get_magic_constant:function(){var t=this.node("magic"),e=this.text();return this.next(),t(e.toUpperCase(),e)}};F.resolve_special_chars,F.remove_heredoc_leading_whitespace_chars,F.check_heredoc_indentation_level,F.read_dereferencable_scalar,F.read_scalar,F.read_dereferencable,F.read_encapsed_string_item,F.read_encapsed_string,F.get_magic_constant;var H={read_top_statements:function(){for(var t=[];this.token!==this.EOF&&"}"!==this.token;){var e=this.read_top_statement();e&&(Array.isArray(e)?t=t.concat(e):t.push(e))}return t},read_top_statement:function(){var 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_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:var e=this.node("constantstatement"),i=this.next().read_const_list();return this.expectEndOfStatement(),e(null,i);case this.tok.T_NAMESPACE:return this.read_namespace();case this.tok.T_HALT_COMPILER:var n=this.node("halt");return this.next().expect("(")&&this.next(),this.expect(")")&&this.next(),this.expect(";"),this.lexer.done=!0,n(this.lexer._input.substring(this.lexer.offset));default:return this.read_statement()}},read_inner_statements:function(){for(var t=[];this.token!=this.EOF&&"}"!==this.token;){var 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);var t=this.node("constant"),e=this.node("identifier"),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(){for(var t=[];this.token!=this.EOF&&")"!==this.token;){this.expect(this.tok.T_STRING);var e=this.node("declaredirective"),i=this.node("identifier"),n=this.text();this.next(),i=i(n);var s=null;if(this.expect("=")&&(s=this.next().read_expr()),t.push(e(i,s)),","!==this.token)break;this.next()}return t},read_inner_statement:function(){var t=[];switch(this.token===this.tok.T_ATTRIBUTE&&(t=this.read_attr_list()),this.token){case this.tok.T_FUNCTION:var 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");var i=this.node("halt");return this.next().expect("(")&&this.next(),this.expect(")")&&this.next(),i=i(this.lexer._input.substring(this.lexer.offset)),this.expect(";")&&this.next(),i;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:var t=this.node("return");this.next();var e=this.read_optional_expr(";");return this.expectEndOfStatement(),t(e);case this.tok.T_BREAK:case this.tok.T_CONTINUE:var i=this.node(this.token===this.tok.T_CONTINUE?"continue":"break");this.next();var n=this.read_optional_expr(";");return this.expectEndOfStatement(),i(n);case this.tok.T_GLOBAL:var s=this.node("global"),r=this.next().read_list(this.read_simple_variable,",");return this.expectEndOfStatement(),s(r);case this.tok.T_STATIC:var o=[this.token,this.lexer.getState()],a=this.node();if(this.next().token===this.tok.T_DOUBLE_COLON){this.lexer.tokens.push(o);var h=this.next().read_expr();return this.expectEndOfStatement(h),a("expressionstatement",h)}if(this.token===this.tok.T_FUNCTION)return this.read_function(!0,[0,1,0]);var l=this.read_variable_declarations();return this.expectEndOfStatement(),a("static",l);case this.tok.T_ECHO:var c=this.node("echo"),u=this.text(),_="<?="===u||"<%="===u,d=this.next().read_function_list(this.read_expr,",");return this.expectEndOfStatement(),c(d,_);case this.tok.T_INLINE_HTML:var p=this.text(),f=this.lexer.yylloc.first_offset>0?this.lexer._input[this.lexer.yylloc.first_offset-1]:null,T="\r"===f||"\n"===f;T&&"\n"===f&&this.lexer.yylloc.first_offset>1&&"\r"===this.lexer._input[this.lexer.yylloc.first_offset-2]&&(f="\r\n");var k=this.node("inline");return this.next(),k(p,T?f+p:p);case this.tok.T_UNSET:var m=this.node("unset");this.next().expect("(")&&this.next();var E=this.read_function_list(this.read_variable,",");return this.expect(")")&&this.next(),this.expect(";")&&this.next(),m(E);case this.tok.T_DECLARE:var x,y=this.node("declare"),v=[];this.next().expect("(")&&this.next();var A=this.read_declare_list();if(this.expect(")")&&this.next(),":"===this.token){for(this.next();this.token!=this.EOF&&this.token!==this.tok.T_ENDDECLARE;)v.push(this.read_top_statement());0===v.length&&this.extractDoc&&this._docs.length>this._docIndex&&v.push(this.node("noop")()),this.expect(this.tok.T_ENDDECLARE)&&this.next(),this.expectEndOfStatement(),x=this.ast.declare.MODE_SHORT}else if("{"===this.token){for(this.next();this.token!=this.EOF&&"}"!==this.token;)v.push(this.read_top_statement());0===v.length&&this.extractDoc&&this._docs.length>this._docIndex&&v.push(this.node("noop")()),this.expect("}")&&this.next(),x=this.ast.declare.MODE_BLOCK}else this.expect(";")&&this.next(),x=this.ast.declare.MODE_NONE;return y(A,v,x);case this.tok.T_TRY:return this.read_try();case this.tok.T_THROW:var g=this.node("throw"),N=this.next().read_expr();return this.expectEndOfStatement(),g(N);case";":return this.next(),null;case this.tok.T_STRING:var C=this.node(),S=[this.token,this.lexer.getState()],b=this.text(),O=this.node("identifier");if(":"===this.next().token)return O=O(b),this.next(),C("label",O);O.destroy(),C.destroy(),this.lexer.tokens.push(S);var L=this.node("expressionstatement"),I=this.next().read_expr();return this.expectEndOfStatement(I),L(I);case this.tok.T_GOTO:var R=this.node("goto"),w=null;if(this.next().expect(this.tok.T_STRING)){w=this.node("identifier");var D=this.text();this.next(),w=w(D),this.expectEndOfStatement()}return R(w);default:var P=this.node("expressionstatement"),U=this.read_expr();return this.expectEndOfStatement(U),P(U)}},read_code_block:function(t){var e=this.node("block");this.expect("{")&&this.next();var 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)}};H.read_top_statements,H.read_top_statement,H.read_inner_statements,H.read_const_list,H.read_declare_list,H.read_inner_statement,H.read_statement,H.read_code_block;var G={read_switch:function(){var t=this.node("switch");this.expect(this.tok.T_SWITCH)&&this.next(),this.expect("(")&&this.next();var e=this.read_expr();this.expect(")")&&this.next();var i=":"===this.token;return t(e,this.read_switch_case_list(),i)},read_switch_case_list:function(){var t=null,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){var e=this.node("case"),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();for(var n=this.node("block"),s=[];this.token!==this.EOF&&this.token!==t&&this.token!==this.tok.T_CASE&&this.token!==this.tok.T_DEFAULT;)s.push(this.read_inner_statement());return e(i,n(null,s))}};G.read_switch,G.read_switch_case_list,G.read_case_list;var V={read_try:function(){this.expect(this.tok.T_TRY);for(var t=this.node("try"),e=null,i=[],n=this.next().read_statement();this.token===this.tok.T_CATCH;){var s=this.node("catch");this.next().expect("(")&&this.next();var r=this.read_list(this.read_namespace_name,"|",!1),o=null;(this.version<800||this.token===this.tok.T_VARIABLE)&&(o=this.read_variable(!0,!1)),this.expect(")"),i.push(s(this.next().read_statement(),r,o))}return this.token===this.tok.T_FINALLY&&(e=this.next().read_statement()),t(n,i,e)}};V.read_try;var W={read_short_form:function(t){var 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){var 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){var n=[];if(this.token==e&&(i&&n.push("function"==typeof t?this.node("noop")():null),this.next()),"function"==typeof t)do{var s=t.apply(this,[]);if(s&&n.push(s),this.token!=e)break}while(this.next().token!=this.EOF);else{if(!this.expect(t))return[];for(n.push(this.text());this.next().token!=this.EOF&&this.token==e&&this.next().token==t;)n.push(this.text())}return n},read_name_list:function(){return this.read_list(this.read_namespace_name,",",!1)},read_byref:function(t){var e=this.node("byref");this.next(),e=e(null);var i=t();return i&&(this.ast.swapLocations(i,e,i,this),i.byref=!0),i},read_variable_declarations:function(){return this.read_list((function(){var t=this.node("staticvariable"),e=this.node("variable");if(this.expect(this.tok.T_VARIABLE)){var i=this.text().substring(1);this.next(),e=e(i,!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}};W.read_short_form,W.read_function_list,W.read_list,W.read_name_list,W.read_byref,W.read_variable_declarations,W.read_extends_from,W.read_interface_extends_list,W.read_implements_list;var Q={read_variable:function(t,e){var 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_NAMESPACE])){i=this.node();var n=this.read_namespace_name();if(this.token!=this.tok.T_DOUBLE_COLON&&"("!=this.token&&-1===["parentreference","selfreference"].indexOf(n.kind)){var s=n.name.toLowerCase();"true"===s?i=n.destroy(i("boolean",!0,n.name)):"false"===s?i=n.destroy(i("boolean",!1,n.name)):"null"===s?i=n.destroy(i("nullkeyword",n.name)):(i.destroy(n),i=n)}else i.destroy(n),i=n}else if(this.token===this.tok.T_STATIC){i=this.node("staticreference");var r=this.text();this.next(),i=i(r)}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){var i,n,s=this.node("staticlookup");return this.next().is([this.tok.T_VARIABLE,"$"])?i=this.read_reference_variable(e):this.token===this.tok.T_STRING||this.token===this.tok.T_CLASS||this.version>=700&&this.is("IDENTIFIER")?(i=this.node("identifier"),n=this.text(),this.next(),i=i(n)):"{"===this.token?(i=this.node("literal"),n=this.next().read_expr(),this.expect("}")&&this.next(),i=i("literal",n,null),this.expect("(")):(this.error([this.tok.T_VARIABLE,this.tok.T_STRING]),i=this.node("identifier"),n=this.text(),this.next(),i=i(n)),s(t,i)},read_what:function(){var 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)):e=e("variable",i=this.read_expr(),!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){var n,s;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"{":var r="["===this.token;if(n=this.node("offsetlookup"),this.next(),s=!1,i)s=this.read_encaps_var_offset(),this.expect(r?"]":"}")&&this.next();else(r?"]"!==this.token:"}"!==this.token)?(s=this.read_expr(),this.expect(r?"]":"}")&&this.next()):this.next();t=n(t,s);break;case this.tok.T_DOUBLE_COLON:"staticlookup"===t.kind&&"identifier"===t.offset.kind&&this.error(),t=(n=this.node("staticlookup"))(t,this.read_what(!0));break;case this.tok.T_OBJECT_OPERATOR:t=(n=this.node("propertylookup"))(t,this.read_what());break;case this.tok.T_NULLSAFE_OBJECT_OPERATOR:t=(n=this.node("nullsafepropertylookup"))(t,this.read_what());break;default:break t}return t},read_encaps_var_offset:function(){var t=this.node();if(this.token===this.tok.T_STRING){var e=this.text();this.next(),t=t("identifier",e)}else if(this.token===this.tok.T_NUM_STRING){var i=this.text();this.next(),t=t("number",i,null)}else if("-"===this.token){this.next();var n=-1*this.text();this.expect(this.tok.T_NUM_STRING)&&this.next(),t=t("number",n,null)}else if(this.token===this.tok.T_VARIABLE){var s=this.text().substring(1);this.next(),t=t("variable",s,!1)}else{this.expect([this.tok.T_STRING,this.tok.T_NUM_STRING,"-",this.tok.T_VARIABLE]);var r=this.text();this.next(),t=t("identifier",r)}return t},read_reference_variable:function(t){for(var e,i=this.read_simple_variable();this.token!=this.EOF;){var n=this.node();if("{"!=this.token||t){n.destroy();break}e=this.next().read_expr(),this.expect("}")&&this.next(),i=n("offsetlookup",i,e)}return i},read_simple_variable:function(){var 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"{":var i=this.next().read_expr();this.expect("}")&&this.next(),e=e(i,!0);break;case"$":e=e(this.read_simple_variable(),!1);break;case this.tok.T_VARIABLE:t=this.text().substring(1);var n=this.node("variable");this.next(),e=e(n(t,!1),!1);break;default:this.error(["{","$",this.tok.T_VARIABLE]),t=this.text(),this.next(),e=e(t,!1)}return e}};function Y(t){return"."!=t&&","!=t&&!isNaN(parseFloat(t))&&isFinite(t)}Q.read_variable,Q.read_static_getter,Q.read_what,Q.recursive_variable_chain_scan,Q.read_encaps_var_offset,Q.read_reference_variable,Q.read_simple_variable;var j=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;var 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_NS_SEPARATOR,this.tok.T_STRING,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_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))}};j.prototype.getTokenName=function(t){return Y(t)?t==this.EOF?"the end of file (EOF)":this.lexer.engine.tokens.values[t]:"'"+t+"'"},j.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;var i=this.node("program"),n=[];for(this.next();this.token!=this.EOF;)n.push(this.read_start());0===n.length&&this.extractDoc&&this._docs.length>this._docIndex&&n.push(this.node("noop")()),this.prev=[this.lexer.yylloc.last_line,this.lexer.yylloc.last_column,this.lexer.offset];var s=i(n,this._errors,this._docs,this._tokens);if(this.debug){var r=this.ast.checkNodes();if(r.length>0)throw r.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 s},j.prototype.raiseError=function(t,e,i,n){if(t+=" on line "+this.lexer.yylloc.first_line,!this.suppressErrors){var s=new SyntaxError(t,this.filename,this.lexer.yylloc.first_line);throw s.lineNumber=this.lexer.yylloc.first_line,s.fileName=this.filename,s.columnNumber=this.lexer.yylloc.first_column,s}var r=this.ast.prepare("error",null,this)(t,n,this.lexer.yylloc.first_line,i);return this._errors.push(r),r},j.prototype.error=function(t){var e="Parse Error : syntax error",i=this.getTokenName(this.token),n="";if(this.token!==this.EOF){if(Y(this.token)){var s=this.text();s.length>10&&(s=s.substring(0,7)+"..."),i="'"+s+"' ("+i+")"}e+=", unexpected "+i}return t&&!Array.isArray(t)&&((Y(t)||1===t.length)&&(n=", expecting "+this.getTokenName(t)),e+=n),this.raiseError(e,n,t,i)},j.prototype.position=function(){return new S(this.lexer.yylloc.first_line,this.lexer.yylloc.first_column,this.lexer.yylloc.first_offset)},j.prototype.node=function(t){if(this.extractDoc){var 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)));var i=this.ast.prepare(t,e,this);return i.postBuild=function(t){if(this._docIndex<this._docs.length)if(this._lastNode){for(var e=this.prev[2],i=this._docIndex;i<this._docs.length&&!(this._docs[i].offset>e);i++);i>this._docIndex&&(this._lastNode.setTrailingComments(this._docs.slice(this._docIndex,i)),this._docIndex=i)}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)},j.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};var $=["parser.next","parser.node","parser.showlog"];j.prototype.showlog=function(){for(var t,e=(new Error).stack.split("\n"),i=2;i<e.length;i++){t=e[i].trim();for(var n=!1,s=0;s<$.length;s++)if(t.substring(3,3+$[s].length)===$[s]){n=!0;break}if(!n)break}return console.log("Line "+this.lexer.yylloc.first_line+" : "+this.getTokenName(this.token)+">"+this.lexer.yytext+"< @--\x3e"+t),this},j.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},j.prototype.text=function(){return this.lexer.yytext},j.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},j.prototype.lex=function(){if(this.extractTokens)do{if(this.token=this.lexer.lex()||this.EOF,this.token===this.EOF)return this;var 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},j.prototype.is=function(t){return Array.isArray(t)?-1!==t.indexOf(this.token):this.entries[t].has(this.token)},[b,O,L,I,R,w,D,P,U,B,F,H,G,V,W,Q].forEach((function(t){for(var e in t){if(Object.prototype.hasOwnProperty.call(j.prototype,e))throw new Error("Function "+e+" is already defined - collision");j.prototype[e]=t[e]}}));var z=j,K=Object.freeze({values:{101:"T_HALT_COMPILER",102:"T_USE",103:"T_ENCAPSED_AND_WHITESPACE",104:"T_OBJECT_OPERATOR",105:"T_STRING",106:"T_DOLLAR_OPEN_CURLY_BRACES",107:"T_STRING_VARNAME",108:"T_CURLY_OPEN",109:"T_NUM_STRING",110:"T_ISSET",111:"T_EMPTY",112:"T_INCLUDE",113:"T_INCLUDE_ONCE",114:"T_EVAL",115:"T_REQUIRE",116:"T_REQUIRE_ONCE",117:"T_NAMESPACE",118:"T_NS_SEPARATOR",119:"T_AS",120:"T_IF",121:"T_ENDIF",122:"T_WHILE",123:"T_DO",124:"T_FOR",125:"T_SWITCH",126:"T_BREAK",127:"T_CONTINUE",128:"T_RETURN",129:"T_GLOBAL",130:"T_STATIC",131:"T_ECHO",132:"T_INLINE_HTML",133:"T_UNSET",134:"T_FOREACH",135:"T_DECLARE",136:"T_TRY",137:"T_THROW",138:"T_GOTO",139:"T_FINALLY",140:"T_CATCH",141:"T_ENDDECLARE",142:"T_LIST",143:"T_CLONE",144:"T_PLUS_EQUAL",145:"T_MINUS_EQUAL",146:"T_MUL_EQUAL",147:"T_DIV_EQUAL",148:"T_CONCAT_EQUAL",149:"T_MOD_EQUAL",150:"T_AND_EQUAL",151:"T_OR_EQUAL",152:"T_XOR_EQUAL",153:"T_SL_EQUAL",154:"T_SR_EQUAL",155:"T_INC",156:"T_DEC",157:"T_BOOLEAN_OR",158:"T_BOOLEAN_AND",159:"T_LOGICAL_OR",160:"T_LOGICAL_AND",161:"T_LOGICAL_XOR",162:"T_SL",163:"T_SR",164:"T_IS_IDENTICAL",165:"T_IS_NOT_IDENTICAL",166:"T_IS_EQUAL",167:"T_IS_NOT_EQUAL",168:"T_IS_SMALLER_OR_EQUAL",169:"T_IS_GREATER_OR_EQUAL",170:"T_INSTANCEOF",171:"T_INT_CAST",172:"T_DOUBLE_CAST",173:"T_STRING_CAST",174:"T_ARRAY_CAST",175:"T_OBJECT_CAST",176:"T_BOOL_CAST",177:"T_UNSET_CAST",178:"T_EXIT",179:"T_PRINT",180:"T_YIELD",181:"T_YIELD_FROM",182:"T_FUNCTION",183:"T_DOUBLE_ARROW",184:"T_DOUBLE_COLON",185:"T_ARRAY",186:"T_CALLABLE",187:"T_CLASS",188:"T_ABSTRACT",189:"T_TRAIT",190:"T_FINAL",191:"T_EXTENDS",192:"T_INTERFACE",193:"T_IMPLEMENTS",194:"T_VAR",195:"T_PUBLIC",196:"T_PROTECTED",197:"T_PRIVATE",198:"T_CONST",199:"T_NEW",200:"T_INSTEADOF",201:"T_ELSEIF",202:"T_ELSE",203:"T_ENDSWITCH",204:"T_CASE",205:"T_DEFAULT",206:"T_ENDFOR",207:"T_ENDFOREACH",208:"T_ENDWHILE",209:"T_CONSTANT_ENCAPSED_STRING",210:"T_LNUMBER",211:"T_DNUMBER",212:"T_LINE",213:"T_FILE",214:"T_DIR",215:"T_TRAIT_C",216:"T_METHOD_C",217:"T_FUNC_C",218:"T_NS_C",219:"T_START_HEREDOC",220:"T_END_HEREDOC",221:"T_CLASS_C",222:"T_VARIABLE",223:"T_OPEN_TAG",224:"T_OPEN_TAG_WITH_ECHO",225:"T_CLOSE_TAG",226:"T_WHITESPACE",227:"T_COMMENT",228:"T_DOC_COMMENT",229:"T_ELLIPSIS",230:"T_COALESCE",231:"T_POW",232:"T_POW_EQUAL",233:"T_SPACESHIP",234:"T_COALESCE_EQUAL",235:"T_FN",236:"T_NULLSAFE_OBJECT_OPERATOR",237:"T_MATCH",238:"T_ATTRIBUTE",239:"T_ENUM",240:"T_READ_ONLY"},names:{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}}),X=function(t,e,i){this.source=t,this.start=e,this.end=i},J=function(t,e,i){this.kind=t,e&&(this.leadingComments=e),i&&(this.loc=i)};J.prototype.setTrailingComments=function(t){this.trailingComments=t},J.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},J.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},J.extends=function(t,e){return e.prototype=Object.create(this.prototype),e.extends=this.extends,e.prototype.constructor=e,e.kind=t,e};var q=J,Z="expression",tt=q.extends(Z,(function(t,e,i){q.apply(this,[t||Z,e,i])})),et="array",it=tt.extends(et,(function(t,e,i,n){tt.apply(this,[et,i,n]),this.items=e,this.shortForm=t})),nt="arrowfunc",st=tt.extends(nt,(function(t,e,i,n,s,r,o,a){tt.apply(this,[nt,o,a]),this.arguments=t,this.byref=e,this.body=i,this.type=n,this.nullable=s,this.isStatic=r||!1})),rt="assign",ot=tt.extends(rt,(function(t,e,i,n,s){tt.apply(this,[rt,n,s]),this.left=t,this.right=e,this.operator=i})),at="assignref",ht=tt.extends(at,(function(t,e,i,n){tt.apply(this,[at,i,n]),this.left=t,this.right=e})),lt="attribute",ct=q.extends(lt,(function(t,e,i,n){q.apply(this,[lt,i,n]),this.name=t,this.args=e})),ut="attrgroup",_t=q.extends(ut,(function(t,e,i){q.apply(this,[ut,e,i]),this.attrs=t||[]})),dt="operation",pt=tt.extends(dt,(function(t,e,i){tt.apply(this,[t||dt,e,i])})),ft=pt.extends("bin",(function(t,e,i,n,s){pt.apply(this,["bin",n,s]),this.type=t,this.left=e,this.right=i})),Tt="statement",kt=q.extends(Tt,(function(t,e,i){q.apply(this,[t||Tt,e,i])})),mt="block",Et=kt.extends(mt,(function(t,e,i,n){kt.apply(this,[t||mt,i,n]),this.children=e.filter(Boolean)})),xt="literal",yt=tt.extends(xt,(function(t,e,i,n,s){tt.apply(this,[t||xt,n,s]),this.value=e,i&&(this.raw=i)})),vt="boolean",At=yt.extends(vt,(function(t,e,i,n){yt.apply(this,[vt,t,e,i,n])})),gt="break",Nt=kt.extends(gt,(function(t,e,i){kt.apply(this,[gt,e,i]),this.level=t})),Ct="byref",St=tt.extends(Ct,(function(t,e,i){tt.apply(this,[Ct,e,i]),this.what=t})),bt="call",Ot=tt.extends(bt,(function(t,e,i,n){tt.apply(this,[bt,i,n]),this.what=t,this.arguments=e})),Lt="case",It=kt.extends(Lt,(function(t,e,i,n){kt.apply(this,[Lt,i,n]),this.test=t,this.body=e})),Rt="cast",wt=pt.extends(Rt,(function(t,e,i,n,s){pt.apply(this,[Rt,n,s]),this.type=t,this.raw=e,this.expr=i})),Dt="catch",Pt=kt.extends(Dt,(function(t,e,i,n,s){kt.apply(this,[Dt,n,s]),this.body=t,this.what=e,this.variable=i})),Ut="declaration",Bt=kt.extends(Ut,(function(t,e,i,n){kt.apply(this,[t||Ut,i,n]),this.name=e}));Bt.prototype.parseFlags=function(t){this.isAbstract=1===t[2],this.isFinal=2===t[2],"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 Mt=Bt,Ft="class",Ht=Mt.extends(Ft,(function(t,e,i,n,s,r,o){Mt.apply(this,[Ft,t,r,o]),this.isAnonymous=!t,this.extends=e,this.implements=i,this.body=n,this.attrGroups=[],this.parseFlags(s)})),Gt="constantstatement",Vt=kt.extends(Gt,(function(t,e,i,n){kt.apply(this,[t||Gt,i,n]),this.constants=e})),Wt="classconstant",Qt=Vt.extends(Wt,(function(t,e,i,n,s,r){Vt.apply(this,[t||Wt,e,s,r]),this.parseFlags(i),this.attrGroups=n}));Qt.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")};var Yt=Qt,jt="clone",$t=tt.extends(jt,(function(t,e,i){tt.apply(this,[jt,e,i]),this.what=t})),zt="closure",Kt=tt.extends(zt,(function(t,e,i,n,s,r,o,a){tt.apply(this,[zt,o,a]),this.uses=i,this.arguments=t,this.byref=e,this.type=n,this.nullable=s,this.isStatic=r||!1,this.body=null,this.attrGroups=[]})),Xt=q.extends("comment",(function(t,e,i,n){q.apply(this,[t,i,n]),this.value=e})),Jt="commentblock",qt=Xt.extends(Jt,(function(t,e,i){Xt.apply(this,[Jt,t,e,i])})),Zt="commentline",te=Xt.extends(Zt,(function(t,e,i){Xt.apply(this,[Zt,t,e,i])})),ee="constant",ie=q.extends(ee,(function(t,e,i,n){q.apply(this,[ee,i,n]),this.name=t,this.value=e})),ne="continue",se=kt.extends(ne,(function(t,e,i){kt.apply(this,[ne,e,i]),this.level=t})),re="declare",oe=Et.extends(re,(function(t,e,i,n,s){Et.apply(this,[re,e,n,s]),this.directives=t,this.mode=i}));oe.MODE_SHORT="short",oe.MODE_BLOCK="block",oe.MODE_NONE="none";var ae=oe,he="declaredirective",le=q.extends(he,(function(t,e,i,n){q.apply(this,[he,i,n]),this.key=t,this.value=e})),ce=kt.extends("do",(function(t,e,i,n){kt.apply(this,["do",i,n]),this.test=t,this.body=e})),ue="echo",_e=kt.extends(ue,(function(t,e,i,n){kt.apply(this,[ue,i,n]),this.shortForm=e,this.expressions=t})),de="empty",pe=tt.extends(de,(function(t,e,i){tt.apply(this,[de,e,i]),this.expression=t})),fe="encapsed",Te=yt.extends(fe,(function(t,e,i,n,s){yt.apply(this,[fe,t,e,n,s]),this.type=i}));Te.TYPE_STRING="string",Te.TYPE_SHELL="shell",Te.TYPE_HEREDOC="heredoc",Te.TYPE_OFFSET="offset";var ke=Te,me="encapsedpart",Ee=tt.extends(me,(function(t,e,i,n,s){tt.apply(this,[me,n,s]),this.expression=t,this.syntax=e,this.curly=i})),xe="entry",ye=tt.extends(xe,(function(t,e,i,n,s,r){tt.apply(this,[xe,s,r]),this.key=t,this.value=e,this.byRef=i,this.unpack=n})),ve="enum",Ae=Mt.extends(ve,(function(t,e,i,n,s,r){Mt.apply(this,[ve,t,s,r]),this.valueType=e,this.implements=i,this.body=n,this.attrGroups=[]})),ge="enumcase",Ne=q.extends(ge,(function(t,e,i,n){q.apply(this,[ge,i,n]),this.name=t,this.value=e})),Ce="error",Se=q.extends(Ce,(function(t,e,i,n,s,r){q.apply(this,[Ce,s,r]),this.message=t,this.token=e,this.line=i,this.expected=n})),be="eval",Oe=tt.extends(be,(function(t,e,i){tt.apply(this,[be,e,i]),this.source=t})),Le="exit",Ie=tt.extends(Le,(function(t,e,i,n){tt.apply(this,[Le,i,n]),this.expression=t,this.useDie=e})),Re="expressionstatement",we=kt.extends(Re,(function(t,e,i){kt.apply(this,[Re,e,i]),this.expression=t})),De=kt.extends("for",(function(t,e,i,n,s,r,o){kt.apply(this,["for",r,o]),this.init=t,this.test=e,this.increment=i,this.shortForm=s,this.body=n})),Pe="foreach",Ue=kt.extends(Pe,(function(t,e,i,n,s,r,o){kt.apply(this,[Pe,r,o]),this.source=t,this.key=e,this.value=i,this.shortForm=s,this.body=n})),Be="function",Me=Mt.extends(Be,(function(t,e,i,n,s,r,o){Mt.apply(this,[Be,t,r,o]),this.arguments=e,this.byref=i,this.type=n,this.nullable=s,this.body=null,this.attrGroups=[]})),Fe="global",He=kt.extends(Fe,(function(t,e,i){kt.apply(this,[Fe,e,i]),this.items=t})),Ge="goto",Ve=kt.extends(Ge,(function(t,e,i){kt.apply(this,[Ge,e,i]),this.label=t})),We="halt",Qe=kt.extends(We,(function(t,e,i){kt.apply(this,[We,e,i]),this.after=t})),Ye="identifier",je=q.extends(Ye,(function(t,e,i){q.apply(this,[Ye,e,i]),this.name=t})),$e=je,ze=kt.extends("if",(function(t,e,i,n,s,r){kt.apply(this,["if",s,r]),this.test=t,this.body=e,this.alternate=i,this.shortForm=n})),Ke="include",Xe=tt.extends(Ke,(function(t,e,i,n,s){tt.apply(this,[Ke,n,s]),this.once=t,this.require=e,this.target=i})),Je="inline",qe=yt.extends(Je,(function(t,e,i,n){yt.apply(this,[Je,t,e,i,n])})),Ze="interface",ti=Mt.extends(Ze,(function(t,e,i,n,s,r){Mt.apply(this,[Ze,t,s,r]),this.extends=e,this.body=i,this.attrGroups=n})),ei="isset",ii=tt.extends(ei,(function(t,e,i){tt.apply(this,[ei,e,i]),this.variables=t})),ni="label",si=kt.extends(ni,(function(t,e,i){kt.apply(this,[ni,e,i]),this.name=t})),ri="list",oi=tt.extends(ri,(function(t,e,i,n){tt.apply(this,[ri,i,n]),this.items=t,this.shortForm=e})),ai="lookup",hi=tt.extends(ai,(function(t,e,i,n,s){tt.apply(this,[t||ai,n,s]),this.what=e,this.offset=i})),li="magic",ci=yt.extends(li,(function(t,e,i,n){yt.apply(this,[li,t,e,i,n])})),ui="match",_i=tt.extends(ui,(function(t,e,i,n){tt.apply(this,[ui,i,n]),this.cond=t,this.arms=e})),di="matcharm",pi=tt.extends(di,(function(t,e,i,n){tt.apply(this,[di,i,n]),this.conds=t,this.body=e})),fi="method",Ti=Me.extends(fi,(function(){Me.apply(this,arguments),this.kind=fi})),ki="reference",mi=q.extends(ki,(function(t,e,i){q.apply(this,[t||ki,e,i])})),Ei="name",xi=mi.extends(Ei,(function t(e,i,n,s){mi.apply(this,[Ei,n,s]),i?this.resolution=t.RELATIVE_NAME:1===e.length?this.resolution=t.UNQUALIFIED_NAME:e[0]?this.resolution=t.QUALIFIED_NAME:this.resolution=t.FULL_QUALIFIED_NAME,this.name=e.join("\\")}));xi.UNQUALIFIED_NAME="uqn",xi.QUALIFIED_NAME="qn",xi.FULL_QUALIFIED_NAME="fqn",xi.RELATIVE_NAME="rn";var yi=xi,vi="namespace",Ai=Et.extends(vi,(function(t,e,i,n,s){Et.apply(this,[vi,e,n,s]),this.name=t,this.withBrackets=i||!1})),gi="namedargument",Ni=tt.extends(gi,(function(t,e,i,n){tt.apply(this,[gi,i,n]),this.name=t,this.value=e})),Ci=tt.extends("new",(function(t,e,i,n){tt.apply(this,["new",i,n]),this.what=t,this.arguments=e})),Si="noop",bi=q.extends(Si,(function(t,e){q.apply(this,[Si,t,e])})),Oi="nowdoc",Li=yt.extends(Oi,(function(t,e,i,n,s){yt.apply(this,[Oi,t,e,n,s]),this.label=i})),Ii="nullkeyword",Ri=q.extends(Ii,(function(t,e,i){q.apply(this,[Ii,e,i]),this.raw=t})),wi="nullsafepropertylookup",Di=hi.extends(wi,(function(t,e,i,n){hi.apply(this,[wi,t,e,i,n])})),Pi="number",Ui=yt.extends(Pi,(function(t,e,i,n){yt.apply(this,[Pi,t,e,i,n])})),Bi="offsetlookup",Mi=hi.extends(Bi,(function(t,e,i,n){hi.apply(this,[Bi,t,e,i,n])})),Fi="parameter",Hi=Mt.extends(Fi,(function(t,e,i,n,s,r,o,a,h,l){Mt.apply(this,[Fi,t,h,l]),this.value=i,this.type=e,this.byref=n,this.variadic=s,this.readonly=r,this.nullable=o,this.flags=a||0,this.attrGroups=[]})),Gi="parentreference",Vi=mi.extends(Gi,(function(t,e,i){mi.apply(this,[Gi,e,i]),this.raw=t})),Wi="post",Qi=pt.extends(Wi,(function(t,e,i,n){pt.apply(this,[Wi,i,n]),this.type=t,this.what=e})),Yi=pt.extends("pre",(function(t,e,i,n){pt.apply(this,["pre",i,n]),this.type=t,this.what=e})),ji="print",$i=tt.extends(ji,(function(t,e,i){tt.apply(this,[ji,e,i]),this.expression=t})),zi="program",Ki=Et.extends(zi,(function(t,e,i,n,s,r){Et.apply(this,[zi,t,s,r]),this.errors=e,i&&(this.comments=i),n&&(this.tokens=n)})),Xi="property",Ji=kt.extends(Xi,(function(t,e,i,n,s,r,o,a){kt.apply(this,[Xi,o,a]),this.name=t,this.value=e,this.readonly=i,this.nullable=n,this.type=s,this.attrGroups=r})),qi="propertylookup",Zi=hi.extends(qi,(function(t,e,i,n){hi.apply(this,[qi,t,e,i,n])})),tn="propertystatement",en=kt.extends(tn,(function(t,e,i,n,s){kt.apply(this,[tn,n,s]),this.properties=e,this.parseFlags(i)}));en.prototype.parseFlags=function(t){-1===t[0]?this.visibility="":null===t[0]?this.visibility=null:0===t[0]?this.visibility="public":1===t[0]?this.visibility="protected":2===t[0]&&(this.visibility="private"),this.isStatic=1===t[1]};var nn=en,sn="retif",rn=tt.extends(sn,(function(t,e,i,n,s){tt.apply(this,[sn,n,s]),this.test=t,this.trueExpr=e,this.falseExpr=i})),on="return",an=kt.extends(on,(function(t,e,i){kt.apply(this,[on,e,i]),this.expr=t})),hn="selfreference",ln=mi.extends(hn,(function(t,e,i){mi.apply(this,[hn,e,i]),this.raw=t})),cn="silent",un=tt.extends(cn,(function(t,e,i){tt.apply(this,[cn,e,i]),this.expr=t})),_n="static",dn=kt.extends(_n,(function(t,e,i){kt.apply(this,[_n,e,i]),this.variables=t})),pn="staticvariable",fn=q.extends(pn,(function(t,e,i,n){q.apply(this,[pn,i,n]),this.variable=t,this.defaultValue=e})),Tn="staticlookup",kn=hi.extends(Tn,(function(t,e,i,n){hi.apply(this,[Tn,t,e,i,n])})),mn="staticreference",En=mi.extends(mn,(function(t,e,i){mi.apply(this,[mn,e,i]),this.raw=t})),xn="string",yn=yt.extends(xn,(function(t,e,i,n,s,r){yt.apply(this,[xn,e,n,s,r]),this.unicode=i,this.isDoubleQuote=t})),vn="switch",An=kt.extends(vn,(function(t,e,i,n,s){kt.apply(this,[vn,n,s]),this.test=t,this.body=e,this.shortForm=i})),gn="throw",Nn=kt.extends(gn,(function(t,e,i){kt.apply(this,[gn,e,i]),this.what=t})),Cn="trait",Sn=Mt.extends(Cn,(function(t,e,i,n){Mt.apply(this,[Cn,t,i,n]),this.body=e})),bn="traitalias",On=q.extends(bn,(function(t,e,i,n,s,r){q.apply(this,[bn,s,r]),this.trait=t,this.method=e,this.as=i,this.visibility="",n&&(0===n[0]?this.visibility="public":1===n[0]?this.visibility="protected":2===n[0]&&(this.visibility="private"))})),Ln="traitprecedence",In=q.extends(Ln,(function(t,e,i,n,s){q.apply(this,[Ln,n,s]),this.trait=t,this.method=e,this.instead=i})),Rn="traituse",wn=q.extends(Rn,(function(t,e,i,n){q.apply(this,[Rn,i,n]),this.traits=t,this.adaptations=e})),Dn=kt.extends("try",(function(t,e,i,n,s){kt.apply(this,["try",n,s]),this.body=t,this.catches=e,this.always=i})),Pn="typereference",Un=mi.extends(Pn,(function(t,e,i,n){mi.apply(this,[Pn,i,n]),this.name=t,this.raw=e}));Un.types=["int","float","string","bool","object","array","callable","iterable","void","static"];var Bn=Un,Mn="unary",Fn=pt.extends(Mn,(function(t,e,i,n){pt.apply(this,[Mn,i,n]),this.type=t,this.what=e})),Hn="uniontype",Gn=Mt.extends(Hn,(function(t,e,i){Mt.apply(this,[Hn,null,e,i]),this.types=t})),Vn="unset",Wn=kt.extends(Vn,(function(t,e,i){kt.apply(this,[Vn,e,i]),this.variables=t})),Qn="usegroup",Yn=kt.extends(Qn,(function(t,e,i,n,s){kt.apply(this,[Qn,n,s]),this.name=t,this.type=e,this.items=i})),jn="useitem",$n=kt.extends(jn,(function(t,e,i,n,s){kt.apply(this,[jn,n,s]),this.name=t,this.alias=e,this.type=i}));$n.TYPE_CONST="const",$n.TYPE_FUNCTION="function";var zn=$n,Kn="variable",Xn=tt.extends(Kn,(function(t,e,i,n){tt.apply(this,[Kn,i,n]),this.name=t,this.curly=e||!1})),Jn="variadic",qn=tt.extends(Jn,(function(t,e,i){tt.apply(this,[Jn,e,i]),this.what=t})),Zn="while",ts=kt.extends(Zn,(function(t,e,i,n,s){kt.apply(this,[Zn,n,s]),this.test=t,this.body=e,this.shortForm=i})),es="yield",is=tt.extends(es,(function(t,e,i,n){tt.apply(this,[es,i,n]),this.value=t,this.key=e})),ns="yieldfrom",ss=tt.extends(ns,(function(t,e,i){tt.apply(this,[ns,e,i]),this.value=t})),rs=function(t,e){this.withPositions=t,this.withSource=e};rs.precedence={},[["or"],["xor"],["and"],["="],["?"],["??"],["||"],["&&"],["|"],["^"],["&"],["==","!=","===","!==","<=>"],["<","<=",">",">="],["<<",">>"],["+","-","."],["*","/","%"],["!"],["instanceof"],["cast","silent"],["**"]].forEach((function(t,e){t.forEach((function(t){rs.precedence[t]=e+1}))})),rs.prototype.isRightAssociative=function(t){return"**"===t||"??"===t},rs.prototype.swapLocations=function(t,e,i,n){this.withPositions&&(t.loc.start=e.loc.start,t.loc.end=i.loc.end,this.withSource&&(t.loc.source=n.lexer._input.substring(t.loc.start.offset,t.loc.end.offset)))},rs.prototype.resolveLocations=function(t,e,i,n){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=n.lexer._input.substring(t.loc.start.offset,t.loc.end.offset)))},rs.prototype.resolvePrecedence=function(t,e){var i,n,s;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?(n=rs.precedence[t.type],s=rs.precedence[t.right.type],n&&s&&s<=n&&(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&&(n=rs.precedence[t.type],s=rs.precedence["?"],n&&s&&s<=n&&(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&&(n=rs.precedence["="],s=rs.precedence[t.right.type],n&&s&&s<n&&(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},rs.prototype.prepare=function(t,e,i){var n=null;(this.withPositions||this.withSource)&&(n=i.position());var s=this,r=function r(){var o=null,a=Array.prototype.slice.call(arguments);if(a.push(e),s.withPositions||s.withSource){var h=null;s.withSource&&(h=i.lexer._input.substring(n.offset,i.prev[2])),o=new X(h,n,new S(i.prev[0],i.prev[1],i.prev[2])),a.push(o)}t||(t=a.shift());var l=s[t];if("function"!=typeof l)throw new Error('Undefined node "'+t+'"');var c=Object.create(l.prototype);return l.apply(c,a),r.instance=c,r.trailingComments&&(c.trailingComments=r.trailingComments),"function"==typeof r.postBuild&&r.postBuild(c),i.debug&&delete rs.stack[r.stackUid],s.resolvePrecedence(c,i)};return i.debug&&(rs.stack||(rs.stack={},rs.stackUid=1),rs.stack[++rs.stackUid]={position:n,stack:(new Error).stack.split("\n").slice(3,5)},r.stackUid=rs.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 rs.stack[r.stackUid]},r},rs.prototype.checkNodes=function(){var t=[];for(var e in rs.stack)Object.prototype.hasOwnProperty.call(rs.stack,e)&&t.push(rs.stack[e]);return rs.stack={},t},[it,st,ot,ht,ct,_t,ft,Et,At,Nt,St,Ot,It,wt,Pt,Ht,Yt,$t,Kt,Xt,qt,te,ie,Vt,se,Mt,ae,le,ce,_e,pe,ke,Ee,ye,Ae,Ne,Se,Oe,Ie,tt,we,De,Ue,Me,He,Ve,Qe,$e,ze,Xe,qe,ti,ii,si,oi,yt,hi,ci,_i,pi,Ti,yi,Ai,Ni,Ci,q,bi,Li,Ri,Di,Ui,Mi,pt,Hi,Vi,Qi,Yi,$i,Ki,Ji,Zi,nn,mi,rn,an,ln,un,kt,dn,fn,kn,En,yn,An,Nn,Sn,On,In,wn,Dn,Bn,Fn,Gn,Wn,Yn,zn,Xn,qn,ts,is,ss].forEach((function(t){rs.prototype[t.kind]=t}));var os=rs;function as(t,e){for(var i=Object.keys(t),n=i.length;n--;){var s=i[n],r=t[s];null===r?delete e[s]:"function"==typeof r?e[s]=r.bind(e):Array.isArray(r)?e[s]=Array.isArray(e[s])?e[s].concat(r):r:"object"===o(r)?e[s]="object"===o(e[s])?as(r,e[s]):r:e[s]=r}return e}var hs=function(t){if("function"==typeof this)return new this(t);if(this.tokens=K,this.lexer=new C(this),this.ast=new os,this.parser=new z(this.lexer,this.ast),t&&"object"===o(t)){if(t.parser&&(t.lexer||(t.lexer={}),t.parser.version)){if("string"==typeof t.parser.version){var 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")}as(t,this),this.lexer.version=this.parser.version}},ls=function(t){return"function"==typeof t.write?t.toString():t};hs.create=function(t){return new hs(t)},hs.parseEval=function(t,e){return new hs(e).parseEval(t)},hs.prototype.parseEval=function(t){return this.lexer.mode_eval=!0,this.lexer.all_tokens=!1,t=ls(t),this.parser.parse(t,"eval")},hs.parseCode=function(t,e,i){return"object"!==o(e)||i||(i=e,e="unknown"),new hs(i).parseCode(t,e)},hs.prototype.parseCode=function(t,e){return this.lexer.mode_eval=!1,this.lexer.all_tokens=!1,t=ls(t),this.parser.parse(t,e)},hs.tokenGetAll=function(t,e){return new hs(e).tokenGetAll(t)},hs.prototype.tokenGetAll=function(t){this.lexer.mode_eval=!1,this.lexer.all_tokens=!0,t=ls(t);var e=this.lexer.EOF,i=this.tokens.values;this.lexer.setInput(t);for(var n=this.lexer.lex()||e,s=[];n!=e;){var r=this.lexer.yytext;Object.prototype.hasOwnProperty.call(i,n)&&(r=[i[n],r,this.lexer.yylloc.first_line]),s.push(r),n=this.lexer.lex()||e}return s};var cs=hs,us=K,_s=C,ds=os,ps=z,fs=as,Ts=hs,ks=hs;cs.tokens=us,cs.lexer=_s,cs.AST=ds,cs.parser=ps,cs.combine=fs,cs.Engine=Ts,cs.default=ks;var ms=function(t,e,i){var n=i&&"markdown"===i.parentParser;if(!t&&n)return"";t=t.replace(/\?>\r?\n<\?/g,"?>\n___PSEUDO_INLINE_PLACEHOLDER___<?");var s,r=new cs({parser:{extractDoc:!0},ast:{withPositions:!0,withSource:!0}}),o=-1!==t.indexOf("<?php"),a=n&&!o;try{s=a?r.parseEval(t):r.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 s.extra={parseAsEval:a},s.comments.forEach((function(t){"\r"===t.value[t.value.length-1]&&(t.value=t.value.slice(0,-1),t.loc.end.offset=t.loc.end.offset-1),"\n"===t.value[t.value.length-1]&&(t.value=t.value.slice(0,-1),t.loc.end.offset=t.loc.end.offset-1)})),s},Es=n.default.util,xs=Es.hasNewline,ys=Es.skipEverythingButNewLine,vs=Es.skipNewline,As=Es.isNextLineEmpty,gs=Es.isPreviousLineEmpty,Ns=Es.getNextNonSpaceNonCommentCharacterIndex,Cs=n.default.version;function Ss(t,e){return parseInt(Cs[0])>1?t[e]:t}var bs={};function Os(t){return bs[t]}[["or"],["xor"],["and"],["=","+=","-=","*=","**=","/=",".=","%=","&=","|=","^=","<<=",">>="],["??"],["||"],["&&"],["|"],["^"],["&"],["==","===","!=","!==","<>","<=>"],["<",">","<=",">="],[">>","<<"],["+","-","."],["*","/","%"],["!"],["instanceof"],["++","--","~"],["**"]].forEach((function(t,e){t.forEach((function(t){bs[t]=e}))}));var Ls=["==","!=","===","!==","<>","<=>"],Is=["*","/","%"],Rs=[">>","<<"];function ws(t){return["block","program","namespace","class","enum","interface","trait","traituse","declare"].includes(t.kind)}function Ds(t){var e=t.body;return e?("block"===e.kind&&(e=e.children),e[0]):null}function Ps(t){var e=t.children||t.body||t.adaptations;return Array.isArray(e)?e:null}function Us(t){var e=t.getParentNode();return e?Ps(e):null}function Bs(t){return t.length>0?t[t.length-1]:null}function Ms(t){var e=t.getValue();if("program"===e.kind){var i=Ps(e);return!(!i||0===i.length)&&"inline"===i[0].kind}if("switch"===e.kind){if(!e.body)return!1;var n=Ps(e.body);if(0===n.length)return!1;var s=h(n,1)[0];if(!s.body)return!1;var r=Ps(s.body);return 0!==r.length&&"inline"===r[0].kind}var o=Ds(e);return!!o&&"inline"===o.kind}var Fs=["__construct","__destruct","__call","__callStatic","__get","__set","__isset","__unset","__sleep","__wakeup","__toString","__invoke","__set_state","__clone","__debugInfo"].reduce((function(t,e){return t[e.toLowerCase()]=e,t}),{});var Hs={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:Os,isBitwiseOperator:function(t){return!!Rs[t]||"|"===t||"^"===t||"&"===t},shouldFlatten:function(t,e){return Os(e)===Os(t)&&("**"!==t&&((!Ls.includes(t)||!Ls.includes(e))&&(!("%"===e&&Is.includes(t)||"%"===t&&Is.includes(e))&&((e===t||!Is.includes(e)||!Is.includes(t))&&(!Rs.includes(t)||!Rs.includes(e))))))},nodeHasStatement:ws,getNodeListProperty:Ps,getParentNodeListProperty:Us,getLast:Bs,getPenultimate:function(t){return t.length>1?t[t.length-2]:null},isLastStatement:function(t){var e=Us(t);if(!e)return!0;var i=t.getValue();return e[e.length-1]===i},getBodyFirstChild:Ds,lineShouldEndWithSemicolon:function(t){var 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(!ws(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){var n=t.getParentNode();if(n&&"interface"===n.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){var e=t.getValue(),i="program"===e.kind,n=e.children&&Bs(e.children);if(!i)return!1;if(n&&["halt","inline"].includes(n.kind))return!1;if(n&&("declare"===n.kind||"namespace"===n.kind)){var s=n.children.length>0&&Bs(n.children);if(s&&["halt","inline"].includes(s.kind))return!1}return!0},maybeStripLeadingSlashFromUse:function(t){var e=t.replace(/^\\/,"");return-1!==e.indexOf("\\")?e:t},hasDanglingComments:function(t){return t.comments&&t.comments.some((function(t){return!t.leading&&!t.trailing}))},hasLeadingComment:function(t){return t.comments&&t.comments.some((function(t){return t.leading}))},hasTrailingComment:function(t){return t.comments&&t.comments.some((function(t){return t.trailing}))},docShouldHaveTrailingNewline:function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=e.getNode(i),s=e.getNode(i+1),r=e.getNode(i+2);if(!s)return!1;if(r&&["call","new","echo"].includes(r.kind)&&!["call","array"].includes(s.kind)||"parameter"===s.kind){var o=r.arguments.length-1,a=r.arguments.indexOf(s);return a!==o}if(r&&"for"===r.kind){var h=r.init.indexOf(s);if(-1!==h)return h!==r.init.length-1;var l=r.test.indexOf(s);if(-1!==l)return l!==r.test.length-1;var c=r.increment.indexOf(s);if(-1!==c)return c!==r.increment.length-1}if("bin"===s.kind)return s.left===n||t(e,i+1);if("case"===s.kind&&s.test===n)return!0;if("staticvariable"===s.kind){var u=r.variables.length-1,_=r.variables.indexOf(s);return _!==u}if("entry"===s.kind){if(s.key===n)return!0;var d=r.items.length-1,p=r.items.indexOf(s);return p!==d}if(["call","new"].includes(s.kind)){var f=s.arguments.length-1,T=s.arguments.indexOf(n);return T!==f}if("echo"===s.kind){var k=s.expressions.length-1,m=s.expressions.indexOf(n);return m!==k}if("array"===s.kind){var E=s.items.length-1,x=s.items.indexOf(n);return x!==E}return"retif"===s.kind&&t(e,i+1)},isLookupNode:function(t){return"propertylookup"===t.kind||"nullsafepropertylookup"===t.kind||"staticlookup"===t.kind||"offsetlookup"===t.kind},isFirstChildrenInlineNode:Ms,shouldPrintHardLineAfterStartInControlStructure:function(t){var e=t.getValue();return!["try","catch"].includes(e.kind)&&Ms(t)},shouldPrintHardLineBeforeEndInControlStructure:function(t){var e=t.getValue();if(["try","catch"].includes(e.kind))return!0;if("switch"===e.kind){var i=Ps(e.body);if(0===i.length)return!0;var n=Bs(i);if(!n.body)return!0;var s=Ps(n.body);return 0===s.length||"inline"!==s[0].kind}return!Ms(t)},getAlignment:function(t){var 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){var i=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?i:!i}return t.isDoubleQuote},hasEmptyBody:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"body",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){var n=i(e);return n=ys(t,n),n=vs(t,n),xs(t,n)},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){var i=function(t,e){for(var i,n=[].concat(e),s=-1;i=t.getParentNode(++s);)if(-1!==n.indexOf(i.kind))return s;return-1}(t,e);return-1===i?null:t.getParentNode(i)},getNextNode:function(t,e){var i=t.getParentNode(),n=Ps(i);if(!n)return null;var s=n.indexOf(e);return-1===s?null:i.children[s+1]},normalizeMagicMethodName:function(t){var e=t.toLowerCase();return Fs[e]?Fs[e]:t},isPreviousLineEmpty:function(t,e,i){return gs(t,e,Ss(i,"locStart"))},isNextLineEmpty:function(t,e,i){return As(t,e,Ss(i,"locEnd"))},getNextNonSpaceNonCommentCharacterIndex:function(t,e,i){return Ns(t,e,Ss(i,"locEnd"))}},Gs=n.default.util,Vs=Gs.addLeadingComment,Ws=Gs.addDanglingComment,Qs=Gs.addTrailingComment,Ys=Gs.skipNewline,js=Gs.hasNewline,$s=Gs.hasNewlineInRange,zs=n.default.doc.builders,Ks=zs.concat,Xs=zs.join,Js=zs.indent,qs=zs.hardline,Zs=zs.cursor,tr=zs.lineSuffix,er=zs.breakParent,ir=Hs.getNextNonSpaceNonCommentCharacterIndex,nr=Hs.isNextLineEmpty,sr=Hs.isPreviousLineEmpty,rr=Hs.isLookupNode;function or(t,e){var i=t.children;0===i.length?Ws(t,e):Vs(i[0],e)}function ar(t,e){"block"===t.kind?or(t,e):Vs(t,e)}function hr(t,e,i,n,s,r){var o=ir(t,s,r),a=t.charAt(o);return e&&"identifier"===e.kind&&i&&("function"===i.kind||"method"===i.kind)&&")"===a?(Qs(i,s),!0):!(!i||"function"!==i.kind&&"method"!==i.kind||!n||"block"!==n.kind)&&(or(n,s),!0)}function lr(t,e,i,n,s,r){if(!i||"if"!==i.kind||!n)return!1;var o=ir(t,s,r);return")"===t.charAt(o)?(Qs(e,s),!0):e===i.body&&n===i.alternate?(Ws(i,s),!0):"if"===n.kind?(ar(n.body,s),!0):i.body===n&&(Vs(n,s),!0)}function cr(t,e,i){if(t&&["class","interface","trait"].includes(t.kind)){if(e&&t.extends)if(Array.isArray(t.extends)){if(t.extends.some((function(t){if(e&&e===t)return Ws(e,i),!0})))return!0}else if(e===t.extends)return Ws(e,i),!0;if(e&&t.implements&&t.implements.some((function(t){if(e&&e===t)return Ws(e,i),!0})))return!0;if(!(t.body&&t.body.length>0))return Ws(t,i),!0}return!!(e&&"class"===e.kind&&e.isAnonymous&&e.leadingComments&&"commentblock"===i.kind)}function ur(t,e,i,n,s){if(e&&("function"===e.kind||"method"===e.kind)){for(var r=0,o=0;o<e.arguments.length;o++)r=s.locEnd(e.arguments[o])>r?s.locEnd(e.arguments[o]):r;var a=e.body&&s.locStart(n)>r&&s.locEnd(n)<s.locStart(e.body),h=ir(t,n,s);if(e.type&&a&&")"!==t.charAt(h))return s.locEnd(n)<s.locStart(e.type)?(Ws(e.type,n),!0):(Qs(e.type,n),!0)}return!1}function _r(t,e,i,n,s){return!(!i||!["function","method","parameter"].includes(i.kind))&&("typereference"===e.kind&&"identifier"===n.kind&&(Qs(e,s),!0))}function dr(t,e){return!(!t||!["label","goto"].includes(t.kind))&&(Qs(t,e),!0)}function pr(t,e,i,n){return i&&"inline"===i.kind?(i.leadingComments||(i.leadingComments=[]),i.leadingComments.includes(n)||i.leadingComments.push(n),!0):!(t||i||!e||"inline"!==e.kind)&&(Ws(e,n),!0)}function fr(t,e,i){return!(!t||"try"!==t.kind||!e)&&("block"===e.kind?(or(e,i),!0):"try"===e.kind?(ar(e.always,i),!0):"catch"===e.kind&&(ar(e.body,i),!0))}function Tr(t,e,i,n){return i||e||!t||"namespace"!==t.kind||t.withBrackets?!(e||!t||"namespace"!==t.kind||t.withBrackets)&&(Ws(t,n),!0):(Qs(t,n),!0)}function kr(t,e,i,n){return!(!t||"declare"!==t.kind)&&((!e||"noop"!==e.kind)&&(i&&t.directives[0]!==i?!(!i||!e)&&(Vs(i,n),!0):("none"===t.mode?Qs(t,n):Ws(t,n),!0)))}function mr(t,e,i,n,s,r){if(!i||"while"!==i.kind||!n)return!1;var o=ir(t,s,r);return")"===t.charAt(o)?(Qs(e,s),!0):"block"===n.kind&&(or(n,s),!0)}function Er(t,e){return t.getValue().printed=!0,e.printer.printComment(t,e)}function xr(t,e,i){return t.getNode()===e.cursorNode&&t.getValue()?Ks([Zs,i,Zs]):i}var yr={handleOwnLineComment:function(t,e,i){var n=t.precedingNode,s=t.enclosingNode,r=t.followingNode;return hr(e,n,s,r,t,i)||function(t,e,i){if(t&&rr(t)&&e&&["identifier","variable","encapsed"].includes(e.kind))return Vs(t,i),!0;return!1}(s,r,t)||lr(e,n,s,r,t,i)||mr(e,n,s,r,t,i)||fr(s,r,t)||cr(s,r,t)||_r(e,n,s,r,t)||ur(e,s,r,t,i)||function(t,e,i,n){if(!i&&t&&("for"===t.kind||"foreach"===t.kind))return t.body&&"block"!==t.body.kind?Vs(i,n):Vs(t,n),!0;return!1}(s,0,r,t)||pr(s,n,r,t)||kr(s,n,r,t)},handleEndOfLineComment:function(t,e,i){var n=t.precedingNode,s=t.enclosingNode,r=t.followingNode;return function(t,e,i,n,s){if(!e&&!n&&i&&"array"===i.kind)return Qs(i,s),!0;return!1}(0,n,s,r,t)||function(t,e,i,n,s){if(i&&"return"===i.kind&&!i.expr)return Qs(i,s),!0;return!1}(0,0,s,0,t)||hr(e,n,s,r,t,i)||function(t,e,i,n,s,r){var o=e&&!$s(s,r.locEnd(e),r.locStart(n));if((!e||!o)&&t&&"retif"===t.kind&&i)return Vs(i,n),!0;return!1}(s,n,r,t,e,i)||lr(e,n,s,r,t,i)||mr(e,n,s,r,t,i)||fr(s,r,t)||cr(s,r,t)||_r(e,n,s,r,t)||ur(e,s,r,t,i)||function(t,e){if(t&&"entry"===t.kind)return Vs(t,e),!0;return!1}(s,t)||function(t,e,i){if(e&&"call"===e.kind&&t&&e.what===t&&e.arguments.length>0)return Vs(e.arguments[0],i),!0;return!1}(n,s,t)||function(t,e,i){if(t&&"assign"===t.kind&&e){var n=t.loc.start.offset+t.loc.source.indexOf("=");if(i.loc.start.offset>n)return Vs(e,i),!0}return!1}(s,r,t)||pr(s,n,r,t)||Tr(s,n,r,t)||kr(s,n,r,t)||dr(s,t)},handleRemainingComment:function(t,e,i){var n=t.precedingNode,s=t.enclosingNode,r=t.followingNode;return lr(e,n,s,r,t,i)||mr(e,n,s,r,t,i)||function(t,e,i,n){var s=ir(t,i,n);if(")"!==t.charAt(s))return!1;if(e&&("function"===e.kind||"closure"===e.kind||"method"===e.kind||"call"===e.kind||"new"===e.kind)&&0===e.arguments.length)return Ws(e,i),!0;return!1}(e,s,t,i)||cr(s,r,t)||function(t,e,i){if(t&&"traituse"===t.kind&&t.adaptations&&!t.adaptations.length)return Ws(t,i),!0;return!1}(s,0,t)||_r(e,n,s,r,t)||ur(e,s,r,t,i)||dr(s,t)||function(t,e,i,n){if(e&&"halt"===e.kind)return Ws(e,n),!0;if(t&&"halt"===t.kind)return Ws(t,n),!0;return!1}(n,s,0,t)||function(t,e){if(t&&("continue"===t.kind||"break"===t.kind)&&!t.label)return Qs(t,e),!0;return!1}(s,t)||pr(s,n,r,t)||Tr(s,n,r,t)},getCommentChildNodes:function(t){return"object"!==o(t)?[]:function(t){return Object.keys(t).filter((function(t){return"kind"!==t&&"loc"!==t&&"errors"!==t&&"extra"!==t&&"comments"!==t&&"leadingComments"!==t&&"enclosingNode"!==t&&"precedingNode"!==t&&"followingNode"!==t})).map((function(e){return 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,n){var s=[],r=t.getValue();return r&&r.comments?(t.each((function(t){var i=t.getValue();!i||i.leading||i.trailing||n&&!n(i)||s.push(Er(t,e))}),"comments"),0===s.length?"":i?Xs(qs,s):Js(Ks([qs,Xs(qs,s)]))):""},hasLeadingComment:function(t){return t.comments&&t.comments.some((function(t){return t.leading}))},hasTrailingComment:function(t){return t.comments&&t.comments.some((function(t){return t.trailing}))},hasLeadingOwnLineComment:function(t,e,i){return e.comments&&e.comments.some((function(e){return e.leading&&js(t,i.locEnd(e))}))},printComments:function(t,e){var i=[];return t.forEach((function(t,n,s){t.printed=!0;var r=s.length===n+1;i.push(t.value),r||i.push(qs),nr(e.originalText,t,e)&&!r&&i.push(qs)})),Ks(i)},printAllComments:function(t,e,i,n){var s=t.getValue(),r=e(t),o=s&&s.comments;if(!o||0===o.length)return xr(t,i,r);var a=[],h=[n?";":"",r];return t.each((function(t){var e=t.getValue(),n=e.leading,s=e.trailing;if(n){var r=function(t,e,i){var n=t.getValue(),s=Er(t,i);if(!s)return"";var r=i.printer.isBlockComment&&i.printer.isBlockComment(n);return Ks(r?[s,js(i.originalText,i.locEnd(n))?qs:" "]:[s,qs])}(t,0,i);if(!r)return;a.push(r);var o=i.originalText;js(o,Ys(o,i.locEnd(e)))&&a.push(qs)}else s&&h.push(function(t,e,i){var n=t.getValue(),s=Er(t,i);if(!s)return"";var r=i.printer.isBlockComment&&i.printer.isBlockComment(n);if(js(i.originalText,i.locStart(n),{backwards:!0})){var o=sr(i.originalText,n,i);return tr(Ks([qs,o?qs:"",s]))}return Ks(r?[" ",s]:[tr(Ks([" ",s])),r?"":er])}(t,0,i))}),"comments"),xr(t,i,Ks(a.concat(h)))}};function vr(){}vr.strictEqual=function(){};var Ar=vr,gr=Hs.getPrecedence,Nr=Hs.shouldFlatten,Cr=Hs.isBitwiseOperator;var Sr=function(t){var e=t.getParentNode();if(!e)return!1;var i=t.getName(),n=t.getNode();if(["program","expressionstatement","namespace","declare","block","include","print","return","echo"].includes(e.kind))return!1;switch(n.kind){case"pre":case"post":if("unary"===e.kind)return"pre"===n.kind&&("+"===n.type&&"+"===e.type||"-"===n.type&&"-"===e.type);case"unary":switch(e.kind){case"unary":return n.type===e.type&&("+"===n.type||"-"===n.type);case"propertylookup":case"nullsafepropertylookup":case"staticlookup":case"offsetlookup":case"call":return"what"===i&&e.what===n;case"bin":return"**"===e.type&&"left"===i;default:return!1}case"bin":switch(e.kind){case"assign":case"retif":return["and","xor","or"].includes(n.type);case"silent":case"cast":return n.parenthesizedExpression;case"pre":case"post":case"unary":return!0;case"call":case"propertylookup":case"nullsafepropertylookup":case"staticlookup":case"offsetlookup":return"what"===i&&e.what===n;case"bin":var s=e.type,r=gr(s),o=n.type,a=gr(o);return r>a||("||"===s&&"&&"===o||(r===a&&"right"===i?(Ar.strictEqual(e.right,n),!0):r===a&&!Nr(s,o)||(r<a&&"%"===o?"+"===s||"-"===s:!!Cr(s))));default:return!1}case"propertylookup":case"nullsafepropertylookup":case"staticlookup":return"call"===e.kind&&("what"===i&&e.what===n&&n.parenthesizedExpression);case"clone":case"new":switch(e.kind){case"propertylookup":case"nullsafepropertylookup":case"staticlookup":case"offsetlookup":case"call":return"what"===i&&e.what===n;default:return!1}case"yield":switch(e.kind){case"propertylookup":case"nullsafepropertylookup":case"staticlookup":case"offsetlookup":case"call":return"what"===i&&e.what===n;case"retif":return e.test===n;default:return!(!n.key&&!n.value)}case"assign":return("for"!==e.kind||!e.init.includes(n)&&!e.increment.includes(n))&&("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===n;default:return!1}case"closure":switch(e.kind){case"call":return"what"===i&&e.what===n;case"propertylookup":case"nullsafepropertylookup":return!0;default:return!1}case"silence":case"cast":return n.parenthesizedExpression;case"string":case"array":switch(e.kind){case"propertylookup":case"nullsafepropertylookup":case"staticlookup":case"offsetlookup":case"call":return(!["string","array"].includes(n.kind)||"offsetlookup"!==e.kind)&&("what"===i&&e.what===n);default:return!1}case"print":case"include":return"bin"===e.kind}return!1},br=n.default.doc.builders,Or=br.breakParent,Lr=br.concat,Ir=br.join,Rr=br.line,wr=br.lineSuffix,Dr=br.group,Pr=br.conditionalGroup,Ur=br.indent,Br=br.dedent,Mr=br.ifBreak,Fr=br.hardline,Hr=br.softline,Gr=br.literalline,Vr=br.align,Wr=br.dedentToRoot,Qr=n.default.doc.utils.willBreak,Yr=n.default.util,jr=Yr.isNextLineEmptyAfterIndex,$r=Yr.hasNewline,zr=Yr.hasNewlineInRange,Kr=Hs.getLast,Xr=Hs.getPenultimate,Jr=Hs.isLastStatement,qr=Hs.lineShouldEndWithSemicolon,Zr=Hs.printNumber,to=Hs.shouldFlatten,eo=Hs.maybeStripLeadingSlashFromUse,io=Hs.fileShouldEndWithHardline,no=Hs.hasDanglingComments,so=Hs.hasLeadingComment,ro=Hs.hasTrailingComment,oo=Hs.docShouldHaveTrailingNewline,ao=Hs.isLookupNode,ho=Hs.isFirstChildrenInlineNode,lo=Hs.shouldPrintHardLineAfterStartInControlStructure,co=Hs.shouldPrintHardLineBeforeEndInControlStructure,uo=Hs.getAlignment,_o=Hs.isProgramLikeNode,po=Hs.getNodeKindIncludingLogical,fo=Hs.useDoubleQuote,To=Hs.hasEmptyBody,ko=Hs.isNextLineEmptyAfterNamespace,mo=Hs.shouldPrintHardlineBeforeTrailingComma,Eo=Hs.isDocNode,xo=Hs.getAncestorNode,yo=Hs.isReferenceLikeNode,vo=Hs.getNextNode,Ao=Hs.normalizeMagicMethodName,go=Hs.getNextNonSpaceNonCommentCharacterIndex,No=Hs.isNextLineEmpty;function Co(t,e){return parseFloat(t)>=parseFloat(e)}function So(t,e){return!!t.trailingCommaPHP&&Co(t.phpVersion,e)}function bo(t){return"1tbs"!==t.braceStyle}function Oo(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return Lr([n?"?":"","->",t.call(i,"offset")])}function Lo(t,e,i){return Oo(t,e,i,!0)}function Io(t,e,i){var n=t.getValue(),s=!["variable","identifier"].includes(n.offset.kind);return Lr(["::",s?"{":"",t.call(i,"offset"),s?"}":""])}function Ro(t,e,i){var n=t.getValue(),s=n.offset&&"number"===n.offset.kind||xo(t,"encapsed");return Lr(["[",n.offset?Dr(Lr([Ur(Lr([s?"":Hr,t.call(i,"offset")])),s?"":Hr])):"","]"])}function wo(t){return"array"===t.kind&&(t.items.length>0||t.comments)||"function"===t.kind||"method"===t.kind||"closure"===t.kind}function Do(t){var e=Kr(t),i=Xr(t);return!so(e)&&!ro(e)&&wo(e)&&(!i||i.kind!==e.kind)}function Po(t){if(2!==t.length)return!1;var e=h(t,2),i=e[0],n=e[1];return!(i.comments&&i.comments.length||"function"!==i.kind&&"method"!==i.kind&&"closure"!==i.kind||"retif"===n.kind||wo(n))}function Uo(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"arguments",s=t.getValue()[n];if(0===s.length)return Lr(["(",yr.printDanglingComments(t,e,!0),")"]);var r=!1,o=!1,a=s.length-1,h=t.map((function(t,n){var s=t.getNode(),h=[i(t)];return n===a||(No(e.originalText,s,e)?(0===n&&(o=!0),r=!0,h.push(",",Fr,Fr)):h.push(",",Rr)),Lr(h)}),n),l=t.getValue(),c=Kr(s),u=So(e,"7.3")&&["call","new","unset","isset"].includes(l.kind)||So(e,"8.0")&&["function","closure","method","arrowfunc","attribute"].includes(l.kind)?Ur(Lr([c&&mo(c)?Fr:"",","])):"";function _(){return Dr(Lr(["(",Ur(Lr([Rr,Lr(h)])),u,Rr,")"]),{shouldBreak:!0})}var d=Po(s),p=Do(s);if(d||p){var f,T=(d?h.slice(1).some(Qr):h.slice(0,-1).some(Qr))||r,k=0;t.each((function(t){d&&0===k&&(f=[Lr([t.call((function(t){return i(t,{expandFirstArg:!0})})),h.length>1?",":"",o?Fr:Rr,o?Fr:""])].concat(h.slice(1))),p&&k===s.length-1&&(f=h.slice(0,-1).concat(t.call((function(t){return i(t,{expandLastArg:!0})})))),k++}),n);var m=h.some(Qr),E=Lr(["(",Lr(f),")"]);return Lr([m?Or:"",Pr([m?Mr(_(),E):E,Lr(d?["(",Dr(f[0],{shouldBreak:!0}),Lr(f.slice(1)),")"]:["(",Lr(h.slice(0,-1)),Dr(Kr(f),{shouldBreak:!0}),")"]),Dr(Lr(["(",Ur(Lr([Rr,Lr(h)])),Mr(u),Rr,")"]),{shouldBreak:!0})],{shouldBreak:T})])}return Dr(Lr(["(",Ur(Lr([Hr,Lr(h)])),Mr(u),Hr,")"]),{shouldBreak:h.some(Qr)||r})}function Bo(t){return"array"===t.kind&&0!==t.items.length}function Mo(t){return"array"===t.right.kind&&0!==t.right.items.length}function Fo(t,e,i,n,s){var r=[],o=t.getValue();if("bin"===o.kind){to(o.type,o.left.type)?r=r.concat(t.call((function(t){return Fo(t,e,i,!0,s)}),"left")):r.push(t.call(e,"left"));var a=Mo(o),h=Lr(a?[o.type," ",t.call(e,"right")]:[o.type,Rr,t.call(e,"right")]),l=t.getParentNode(),c=!(s&&["||","&&"].includes(o.type))&&po(l)!==po(o)&&po(o.left)!==po(o)&&po(o.right)!==po(o),u=Eo(o.left)||"bin"===o.left.kind&&Eo(o.left.right);r.push(u?"":" ",c?Dr(h):h),n&&o.comments&&(r=yr.printAllComments(t,(function(){return Lr(r)}),i))}else r.push(t.call(e));return r}function Ho(t,e,i){var n=t.getValue();switch(n.kind){case"propertylookup":return Oo(t,e,i);case"nullsafepropertylookup":return Lo(t,e,i);case"staticlookup":return Io(t,0,i);case"offsetlookup":return Ro(t,0,i);default:return"Have not implemented lookup kind ".concat(n.kind," yet.")}}function Go(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=e.opening,n=void 0===i||i;if("heredoc"===t.type)return n?"<<<".concat(t.label):t.label;var s={string:'"',shell:"`"};return s[t.type]?s[t.type]:"Unimplemented encapsed type ".concat(t.type)}function Vo(t,e,i){var n=[],s=[];return t.each((function(t){n.push(Lr(s)),n.push(Dr(i(t))),s=[",",Rr],t.getValue()&&No(e.originalText,t.getValue(),e)&&s.push(Hr)}),"items"),Lr(n)}function Wo(t,e){if(0===e.length)return t;var i=0;return e.reduce((function(e,n){var s=n.start,r=n.end,o=n.alignment,a=n.before,h=n.after,l=Lr([a||"",Lr(t.slice(s,r)),h||""]),c=e.concat(t.slice(i,s),o?Wr(Dr(Lr([Vr(new Array(o).join(" "),l)]))):Dr(l),r===t.length-1?t.slice(r):"");return i=r,c}),[])}function Qo(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"children",s=t.getValue(),r=t.getParentNode(),o=-1,a=[],l=[];t.map((function(h,c){var u=h.getValue(),_="inline"===u.kind,d=i(h),p=s[n],f=p[c+1],T=!Jr(h)&&!_&&(f&&"case"===f.kind?!ho(t):f&&"inline"!==f.kind),k=Lr([d,T?Fr:"",T&&No(e.originalText,u,e)?Fr:""]),m=0===c,E=p.length-1===c,x="block"===s.kind&&r&&["function","closure","method","try","catch"].includes(r.kind),y=x&&m?"":" ";if(_||!_&&E&&o>=0){var v=o;if(_&&(o=c),_&&!m||!_&&E){var A=(_?v:o)+1,g=E&&!_?c+1:c,N=p[_?v:o],C=N?uo(N.raw):"",S=g-A>1,b=S?x&&!N||_o(s)&&0===A?"":Fr:"",O=S&&"halt"!==u.kind?x&&E?"":Fr:"";S&&(y=""),l.push({start:A,end:g,alignment:C,before:b,after:O})}}if(_){var L=f&&"echo"===f.kind&&f.shortForm?"<?=":"<?php",I=u.leadingComments&&u.leadingComments.length?Lr([m&&"namespace"!==s.kind&&!x?"<?php":"","namespace"!==s.kind&&x?"":Fr,yr.printComments(u.leadingComments,e),Fr,"?>"]):_o(s)&&m&&"namespace"!==s.kind?"":Lr([y,"?>"]),R=t.getNode(c+1),w=R&&R.children&&R.children.length,D=u.comments&&u.comments.length?Lr([L,Fr,w?yr.printComments(u.comments,e):"",Fr,w?"?>":""]):_o(s)&&E?"":Lr([L," "]);k=Lr([I,k,D])}a.push(k)}),n);var c=Wo(a,l);if("program"===s.kind&&!s.extra.parseAsEval){var u=[],_=h(s.children,1),d=_[0],p=!d||"inline"!==d.kind;if(p){var f=e.originalText.trim().match(/^<\?(php|=)(\s+)?\S/),T=Lr([f&&f[2]&&f[2].includes("\n")?Lr([Fr,f[2].split("\n").length>2?Fr:""]):" ",s.comments?yr.printComments(s.comments,e):""]),k=d&&"echo"===d.kind&&d.shortForm;u.push(Lr([k?"<?=":"<?php",T]))}u.push(Lr(c));var m=e.originalText.trim().endsWith("?>");if(m){var E=Kr(s.children),x=E?Lr([zr(e.originalText.trimEnd(),e.locEnd(E),e.locEnd(s))?Fr:" ",No(e.originalText,E,e)?Fr:""]):s.comments?Fr:"";u.push(wr(Lr([x,"?>"])))}return Lr(u)}return Lr(c)}function Yo(t,e,i,n){return Lr(t.map((function(t){var n=[];return n.push(i(t)),Jr(t)||(n.push(Fr),No(e.originalText,t.getValue(),e)&&n.push(Fr)),Lr(n)}),n))}function jo(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"extends",s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:" ",r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:" ",o=t.getValue(),a=no(o[n])?Lr([Fr,t.call((function(t){return yr.printDanglingComments(t,e,!0)}),n),Fr]):s,h=Array.isArray(o[n])?Dr(Lr([Ir(",",t.map((function(t){var n=i(t);return no(t.getValue())?Lr([Fr,yr.printDanglingComments(t,e,!0),Fr,n]):Lr([r,n])}),n))])):Lr([r,t.call(i,n)]);return Ur(Lr([a,n,Qr(a)?Ur(h):h]))}function $o(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},s=n.inline,r=void 0!==s&&s,o=[];return t.getValue().attrGroups?(t.each((function(t){var n=["#["];!r&&o.length>0&&o.push(Fr),n.push(Hr),t.each((function(t){var s=t.getValue();n.length>2&&n.push(",",Rr);var r=[s.name];s.args.length>0&&r.push(Uo(t,e,i,"args")),n.push(Dr(Lr(r)))}),"attrs"),o.push(Dr(Lr([Ur(Lr(n)),Mr(So(e,"8.0")?",":""),Hr,"]",r?Mr(Hr," "):""])))}),"attrGroups"),0===o.length?[]:[Lr([].concat(o,[r?"":Fr]))]):[]}function zo(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"body",s=t.getValue();if(!s[n])return";";var r=t.call(i,n);return Lr([s.shortForm?":":" {",Ur(Lr(["block"!==s[n].kind||s[n].children&&s[n].children.length>0||s[n].comments&&s[n].comments.length>0?Lr([lo(t)?"switch"===s.kind?" ":"":Fr,r]):""])),"if"===s.kind&&"body"===n?"":Lr([co(t)?Fr:"",s.shortForm?Lr(["end",s.kind,";"]):"}"])])}function Ko(t,e,i,n,s,r,o){if(!n)return e;var a=Jo(t,n,s,r,o);return Dr(Lr([e,i,a]))}function Xo(t){return!!ao(t)&&(!("variable"!==t.what.kind&&!yo(t.what))||Xo(t.what))}function Jo(t,e,i,n,s){var r=n?"&":"";if(yr.hasLeadingOwnLineComment(s.originalText,e,s))return Ur(Lr([Fr,r,i]));var o="cast"===e.kind?e.expr:e;return"bin"===o.kind&&!Mo(o)||"retif"===o.kind&&(!o.trueExpr&&!Bo(o.falseExpr)||"bin"===o.test.kind&&!Mo(o.test))||("variable"===t.kind||"string"===t.kind||ao(t))&&("string"===o.kind&&!qo(o)||Xo(o))?Dr(Ur(Lr([Rr,r,i]))):Lr([" ",r,i])}function qo(t){return t.raw.includes("\n")}function Zo(t,e,i){return("string"===t.kind||"encapsed"===t.kind&&("string"===t.type||"shell"===t.type))&&qo(t)&&!$r(e,i.locStart(t),{backwards:!0})}var ta=function(t,e,i){var n=t.getValue();if(!n)return"";if("string"==typeof n)return n;var s=function(t,e,i){var n=t.getValue();switch(n.kind){case"program":return Dr(Lr([Qo(t,e,i),yr.printDanglingComments(t,e,!0,(function(t){return!t.printed}))]));case"expressionstatement":return t.call(i,"expression");case"block":return Lr([Qo(t,e,i),yr.printDanglingComments(t,e,!0)]);case"declare":var s=function(t){return Ir(", ",t.map((function(t){return Lr([i(t)])}),"directives"))};if(["block","short"].includes(n.mode))return Lr(["declare(",s(t),")","block"===n.mode?" {":":",n.children.length>0?Ur(Lr([Fr,Qo(t,e,i)])):"",yr.printDanglingComments(t,e),Fr,"block"===n.mode?"}":"enddeclare;"]);var r=vo(t,n);return Lr(["declare(",s(t),")",r&&"inline"===r.kind?"":";"]);case"declaredirective":return Lr([t.call(i,"key"),"=",t.call(i,"value")]);case"namespace":return Lr(["namespace ",n.name&&"string"==typeof n.name?Lr([n.name,n.withBrackets?" ":""]):"",n.withBrackets?"{":";",no(n)?Lr([" ",yr.printDanglingComments(t,e,!0)]):"",n.children.length>0?n.withBrackets?Ur(Lr([Fr,Qo(t,e,i)])):Lr(["inline"===n.children[0].kind?"":Lr([Fr,ko(e.originalText,n,e.locStart)?Fr:""]),Qo(t,e,i)]):"",n.withBrackets?Lr([Fr,"}"]):""]);case"usegroup":return Dr(Lr(["use ",n.type?Lr([n.type," "]):"",Ur(Lr([n.name?Lr([eo(n.name),"\\{",Hr]):"",Ir(Lr([",",Rr]),t.map((function(t){return Lr([i(t)])}),"items"))])),n.name?Lr([Mr(So(e,"7.2")?",":""),Hr,"}"]):""]));case"useitem":return Lr([n.type?Lr([n.type," "]):"",eo(n.name),no(n)?Lr([" ",yr.printDanglingComments(t,e,!0)]):"",n.alias?Lr([" as ",t.call(i,"alias")]):""]);case"class":case"enum":case"interface":case"trait":return function(t,e,i){var n=t.getValue(),s="class"===n.kind&&n.isAnonymous,r=$o(t,e,i,{inline:s}),o=s?[]:l(r);n.isFinal&&o.push("final ");n.isAbstract&&o.push("abstract ");o.push(s?"":n.kind),n.name&&o.push(" ",t.call(i,"name"));"enum"===n.kind&&n.valueType&&o.push(": ",t.call(i,"valueType"));n.extends&&n.implements?o.push(Pr([Lr([jo(t,e,i,"extends"),jo(t,e,i,"implements")]),Lr([jo(t,e,i,"extends"),jo(t,e,i,"implements"," ",Fr)]),Lr([jo(t,e,i,"extends",Fr," "),jo(t,e,i,"implements",Fr,n.implements.length>1?Fr:" ")])],{shouldBreak:no(n.extends)})):(n.extends&&o.push(Pr([jo(t,e,i,"extends"),jo(t,e,i,"extends"," ",Fr),jo(t,e,i,"extends",Fr,n.extends.length>1?Fr:" ")])),n.implements&&o.push(Pr([jo(t,e,i,"implements"),jo(t,e,i,"implements"," ",Fr),jo(t,e,i,"implements",Fr,n.implements.length>1?Fr:" ")])));var a=Dr(Lr([Dr(Lr(o)),bo(e)?s?Rr:Fr:" "])),h=n.body&&0===n.body.length&&!no(n),c=Lr(["{",Ur(Lr([h?"":Fr,Yo(t,e,i,"body")])),yr.printDanglingComments(t,e,!0),s&&h?Hr:Fr,"}"]);return Lr([a,c])}(t,e,i);case"traitprecedence":return Lr([t.call(i,"trait"),"::",t.call(i,"method")," insteadof ",Ir(", ",t.map(i,"instead"))]);case"traitalias":return Lr([n.trait?Lr([t.call(i,"trait"),"::"]):"",n.method?t.call(i,"method"):""," as ",Ir(" ",[].concat(l(n.visibility?[n.visibility]:[]),l(n.as?[t.call(i,"as")]:[])))]);case"traituse":return Dr(Lr(["use ",Ur(Dr(Ir(Lr([",",Rr]),t.map(i,"traits")))),n.adaptations?Lr([" {",n.adaptations.length>0?Lr([Ur(Lr([Fr,Yo(t,e,i,"adaptations")])),Fr]):no(n)?Lr([Rr,yr.printDanglingComments(t,e,!0),Rr]):"","}"]):""]));case"function":case"closure":case"method":return function(t,e,i){var n=t.getValue(),s=l($o(t,e,i,{inline:"closure"===n.kind}));n.isFinal&&s.push("final ");n.isAbstract&&s.push("abstract ");n.visibility&&s.push(n.visibility," ");n.isStatic&&s.push("static ");s.push("function "),n.byref&&s.push("&");n.name&&s.push(t.call(i,"name"));s.push(Uo(t,e,i)),n.uses&&n.uses.length>0&&s.push(Dr(Lr([" use ",Uo(t,e,i,"uses")])));n.type&&s.push(Lr([": ",no(n.type)?Lr([t.call((function(t){return yr.printDanglingComments(t,e,!0)}),"type")," "]):"",n.nullable?"?":"",t.call(i,"type")]));var r=Lr(s);if(!n.body)return r;var o="closure"===n.kind,a=Lr(["{",Ur(Lr([To(t)?"":Fr,t.call(i,"body")])),o&&To(t)?"":Fr,"}"]);if(o)return Lr([r," ",a]);if(0===n.arguments.length)return Lr([r,bo(e)?Fr:" ",a]);if(s.some(Qr))return Lr([r," ",a]);return Pr([Lr([r,bo(e)?Fr:" ",a]),Lr([r," ",a])])}(t,e,i);case"arrowfunc":return Lr([].concat(l($o(t,e,i,{inline:!0})),[n.isStatic?"static ":"","fn",Uo(t,e,i),n.type?Lr([": ",n.nullable?"?":"",t.call(i,"type")]):""," => ",t.call(i,"body")]));case"parameter":var o="";1===n.flags?o="public ":2===n.flags?o="protected ":4===n.flags&&(o="private ");var a=Lr([].concat(l($o(t,e,i,{inline:!0})),[o,n.readonly?"readonly ":"",n.nullable?"?":"",n.type?Lr([t.call(i,"type")," "]):"",n.byref?"&":"",n.variadic?"...":"","$",t.call(i,"name")]));return n.value?Dr(Lr([a,no(n)?" ":"",yr.printDanglingComments(t,e,!0),Lr([" =",Jo(n.name,n.value,t.call(i,"value"),!1,e)])])):a;case"variadic":return Lr(["...",t.call(i,"what")]);case"property":return Dr(Lr([n.readonly?"readonly ":"",n.type?Lr([n.nullable?"?":"",t.call(i,"type")," "]):"","$",t.call(i,"name"),n.value?Lr([" =",Jo(n.name,n.value,t.call(i,"value"),!1,e)]):""]));case"propertystatement":var c=[];t.map((function(t){return c.push.apply(c,l($o(t,e,i)))}),"properties");var u,_=t.map((function(t){return i(t)}),"properties"),d=n.properties.some((function(t){return t.value}));if(1!==_.length||n.properties[0].comments)_.length>0&&(u=Ur(_[0]));else u=h(_,1)[0];var p=n.visibility||null===n.visibility;return Dr(Lr([].concat(c,[p?Lr([null===n.visibility?"var":n.visibility,""]):"",n.isStatic?Lr([p?" ":"","static"]):"",u?Lr([" ",u]):"",Ur(Lr(_.slice(1).map((function(t){return Lr([",",d?Fr:Rr,t])}))))])));case"if":var f=[],T=zo(t,e,i,"body"),k=Dr(Lr(["if (",Dr(Lr([Ur(Lr([Hr,t.call(i,"test")])),Hr])),")",T]));if(f.push(k,ho(t)||!n.body?"":Fr),n.alternate){f.push(n.shortForm?"":"} ");var m=ro(n.body)&&n.body.comments.some((function(t){return t.trailing&&!yr.isBlockComment(t)}))||function(t){if(!t.comments)return!1;var e=Kr(t.comments.filter((function(t){return!t.leading&&!t.trailing})));return e&&!yr.isBlockComment(e)}(n),E=!m;f.push(E?"":Fr),no(n)&&f.push(No(e.originalText,n.body,e)?Fr:"",yr.printDanglingComments(t,e,!0),m?Fr:" "),f.push("else",Dr("if"===n.alternate.kind?t.call(i,"alternate"):zo(t,e,i,"alternate")))}else f.push(n.body?n.shortForm?"endif;":"}":"");return Lr(f);case"do":return Lr(["do",zo(t,e,i,"body")," while (",Dr(Lr([Ur(Lr([Hr,t.call(i,"test")])),Hr])),")"]);case"while":case"switch":return Dr(Lr([n.kind," (",Dr(Lr([Ur(Lr([Hr,t.call(i,"test")])),Hr])),")",zo(t,e,i,"body")]));case"for":var x=zo(t,e,i,"body"),y=yr.printDanglingComments(t,e,!0),v=y?Lr([y,Hr]):"";return n.init.length||n.test.length||n.increment.length?Lr([v,Dr(Lr(["for (",Dr(Lr([Ur(Lr([Hr,Dr(Lr([Ir(Lr([",",Rr]),t.map(i,"init"))])),";",Rr,Dr(Lr([Ir(Lr([",",Rr]),t.map(i,"test"))])),";",Rr,Dr(Ir(Lr([",",Rr]),t.map(i,"increment")))])),Hr])),")",x]))]):Lr([v,Dr(Lr(["for (;;)",x]))]);case"foreach":var A=zo(t,e,i,"body"),g=yr.printDanglingComments(t,e,!0),N=g?Lr([g,Hr]):"";return Lr([N,Dr(Lr(["foreach (",Dr(Lr([Ur(Lr([Hr,t.call(i,"source"),Rr,"as ",Dr(n.key?Ur(Ir(Lr([" =>",Rr]),[t.call(i,"key"),t.call(i,"value")])):t.call(i,"value"))])),Hr])),")",A]))]);case"try":var C=[];return C.push("try",zo(t,e,i,"body")),n.catches&&C.push(Lr(t.map(i,"catches"))),n.always&&C.push(" finally",zo(t,e,i,"always")),Lr(C);case"catch":return Lr([" catch",n.what?Lr([" (",Ir(" | ",t.map(i,"what")),n.variable?Lr([" ",t.call(i,"variable")]):"",")"]):"",zo(t,e,i,"body")]);case"case":return Lr([n.test?Lr(["case ",n.test.comments?Ur(t.call(i,"test")):t.call(i,"test"),":"]):"default:",n.body&&n.body.children&&n.body.children.length?Ur(Lr([ho(t)?"":Fr,t.call(i,"body")])):""]);case"break":case"continue":return n.level&&("number"===n.level.kind&&"1"!==n.level.value)?Lr(["".concat(n.kind," "),t.call(i,"level")]):n.kind;case"call":return 1===n.arguments.length&&Zo(n.arguments[0],e.originalText,e)?Lr([t.call(i,"what"),Lr(["(",Ir(", ",t.map(i,"arguments")),")"])]):ao(n.what)?function(t,e,i){var n=[];function s(t){var i=e.originalText,n=go(i,t,e);return")"===i.charAt(n)?jr(i,n+1,e):No(i,t,e)}function r(t){var o=t.getValue();if("call"!==o.kind||!ao(o.what)&&"call"!==o.what.kind)if(ao(o)){var a=null;a="propertylookup"===o.kind?Oo(t,e,i):"nullsafepropertylookup"===o.kind?Lo(t,e,i):"staticlookup"===o.kind?Io(t,e,i):Ro(t,e,i),n.unshift({node:o,needsParens:Sr(t),printed:yr.printAllComments(t,(function(){return a}),e)}),t.call((function(t){return r(t)}),"what")}else n.unshift({node:o,printed:t.call(i)});else n.unshift({node:o,printed:Lr([yr.printAllComments(t,(function(){return Lr([Uo(t,e,i)])}),e),s(o)?Fr:""])}),t.call((function(t){return r(t)}),"what")}var o=t.getValue();n.unshift({node:o,printed:Uo(t,e,i)}),t.call((function(t){return r(t)}),"what");for(var a=0;a<n.length;++a)"call"===n[a].node.kind&&n[a-1]&&["propertylookup","nullsafepropertylookup","staticlookup"].includes(n[a-1].node.kind)&&n[a-1].needsParens&&(n[0].printed=Lr(["(",n[0].printed]),n[a-1].printed=Lr([n[a-1].printed,")"]));for(var h=[],l=[n[0]],c=1;c<n.length&&("call"===n[c].node.kind||ao(n[c].node)&&n[c].node.offset&&"number"===n[c].node.offset.kind);++c)l.push(n[c]);if("call"!==n[0].node.kind)for(;c+1<n.length&&(ao(n[c].node)&&ao(n[c+1].node));++c)l.push(n[c]);h.push(l),l=[];for(var u=!1;c<n.length;++c){if(u&&ao(n[c].node)){if("offsetlookup"===n[c].node.kind&&n[c].node.offset&&"number"===n[c].node.offset.kind){l.push(n[c]);continue}h.push(l),l=[],u=!1}"call"===n[c].node.kind&&(u=!0),l.push(n[c]),n[c].node.comments&&yr.hasTrailingComment(n[c].node)&&(h.push(l),l=[],u=!1)}l.length>0&&h.push(l);function _(t){var i=t[1].length&&"offsetlookup"===t[1][0].node.kind;if(1===t[0].length){var n=t[0][0].node;return"variable"===n.kind&&("this"===n.name||d&&s(n.name))||yo(n)}function s(t){return t.length<e.tabWidth}var r=Kr(t[0]).node;return ao(r)&&("identifier"===r.offset.kind||"variable"===r.offset.kind)&&i}var d="expressionstatement"===t.getParentNode().kind,p=h.length>=2&&!h[1][0].node.comments&&_(h);function f(t){for(var e=[],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 Lr(e)}function T(t){return 0===t.length?"":Ur(Dr(Lr([Fr,Ir(Fr,t.map(f))])))}var k=h.map(f),m=Lr(k),E=p?3:2,x=h.slice(0,E).reduce((function(t,e){return t.concat(e)}),[]),y=x.slice(1,-1).some((function(t){return yr.hasLeadingComment(t.node)}))||x.slice(0,-1).some((function(t){return yr.hasTrailingComment(t.node)}))||h[E]&&yr.hasLeadingComment(h[E][0].node),v=xo(t,"encapsed");if(h.length<=E&&!y||v)return Dr(m);var A=Kr(p?h.slice(1,2)[0]:h[0]).node,g="call"!==A.kind&&s(A),N=Lr([f(h[0]),p?Lr(h.slice(1,2).map(f)):"",g?Fr:"",T(h.slice(p?2:1))]),C=n.filter((function(t){return"call"===t.node.kind})).length;if(y||C>=3||k.slice(0,-1).some(Qr))return Dr(N);return Lr([Qr(m)||g?Or:"",Pr([m,N])])}(t,e,i):Lr([t.call(i,"what"),Uo(t,e,i)]);case"new":var S=n.what&&"class"===n.what.kind&&n.what.isAnonymous;if(!S&&1===n.arguments.length&&Zo(n.arguments[0],e.originalText,e))return Lr(["new "].concat(l(t.call($o,"what")),[t.call(i,"what"),"(",Ir(", ",t.map(i,"arguments")),")"]));var b=[];if(b.push("new "),S)b.push.apply(b,[n.what.leadingComments&&"commentblock"===n.what.leadingComments[0].kind?Lr([yr.printComments(n.what.leadingComments,e)," "]):""].concat(l(t.call((function(t){return $o(t,e,i,{inline:!0})}),"what")),["class",n.arguments.length>0?Lr([" ",Uo(t,e,i)]):"",Dr(t.call(i,"what"))]));else{var O=Lr([t.call(i,"what"),Uo(t,e,i)]);b.push(so(n.what)?Ur(O):O)}return Lr(b);case"clone":return Lr(["clone ",n.what.comments?Ur(t.call(i,"what")):t.call(i,"what")]);case"propertylookup":case"nullsafepropertylookup":case"staticlookup":case"offsetlookup":var L,I=t.getParentNode(),R=0;do{L=t.getParentNode(R),R++}while(L&&ao(L));var w=xo(t,"encapsed")||L&&("new"===L.kind||"assign"===L.kind&&"variable"!==L.left.kind)||"offsetlookup"===n.kind||(yo(n.what)||"variable"===n.what.kind)&&["identifier","variable","encapsedpart"].includes(n.offset.kind)&&I&&!ao(I);return Lr([t.call(i,"what"),w?Ho(t,e,i):Dr(Ur(Lr([Hr,Ho(t,e,i)])))]);case"exit":return Dr(Lr([n.useDie?"die":"exit","(",n.expression?Zo(n.expression,e.originalText,e)?t.call(i,"expression"):Lr([Ur(Lr([Hr,t.call(i,"expression")])),Hr]):yr.printDanglingComments(t,e),")"]));case"global":return Dr(Lr(["global ",Ur(Lr([Ir(Lr([",",Rr]),t.map(i,"items"))]))]));case"include":return Lr([n.require?"require":"include",n.once?"_once":""," ",n.target.comments?Ur(t.call(i,"target")):t.call(i,"target")]);case"label":return Lr([t.call(i,"name"),":"]);case"goto":return Lr(["goto ",t.call(i,"label")]);case"throw":return Lr(["throw ",n.what.comments?Ur(t.call(i,"what")):t.call(i,"what")]);case"silent":return Lr(["@",t.call(i,"expr")]);case"halt":return Lr([no(n)?Lr([yr.printDanglingComments(t,e,!0),Fr]):"","__halt_compiler();",n.after]);case"eval":return Dr(Lr(["eval(",Zo(n.source,e.originalText,e)?t.call(i,"source"):Lr([Ur(Lr([Hr,t.call(i,"source")])),Hr]),")"]));case"echo":var D,P=t.map((function(t){return i(t)}),"expressions");if(1!==P.length||n.expressions[0].comments)P.length>0&&(D=Eo(n.expressions[0])||n.expressions[0].comments?Ur(P[0]):Br(P[0]));else D=h(P,1)[0];return Dr(Lr([n.shortForm?"":"echo ",D||"",Ur(Lr(P.slice(1).map((function(t){return Lr([",",Rr,t])}))))]));case"print":return Lr(["print ",n.expression.comments?Ur(t.call(i,"expression")):t.call(i,"expression")]);case"return":var U=[];if(U.push("return"),n.expr){var B=t.call(i,"expr");U.push(" ",n.expr.comments?Ur(B):B)}return no(n)&&U.push(" ",yr.printDanglingComments(t,e,!0)),Lr(U);case"isset":case"unset":return Dr(Lr([n.kind,Uo(t,e,i,"variables")]));case"empty":return Dr(Lr(["empty(",Ur(Lr([Hr,t.call(i,"expression")])),Hr,")"]));case"variable":var M=t.getParentNode(),F=t.getParentNode(1),H="assign"===M.kind?"":n.byref?"&":"",G="encapsedpart"===M.kind&&"simple"===M.syntax&&M.curly||F&&"offsetlookup"===M.kind&&"encapsedpart"===F.kind&&"simple"===F.syntax&&F.curly?"":"$",V=n.curly?"{":"",W=n.curly?"}":"";return Lr([H,G,V,t.call(i,"name"),W]);case"constantstatement":case"classconstant":var Q,Y=$o(t,e,i),j=t.map((function(t){return i(t)}),"constants");if(1!==j.length||n.constants[0].comments)j.length>0&&(Q=Ur(j[0]));else Q=h(j,1)[0];return Dr(Lr([].concat(l(Y),[n.visibility?Lr([n.visibility," "]):"","const",Q?Lr([" ",Q]):"",Ur(Lr(j.slice(1).map((function(t){return Lr([",",Fr,t])}))))])));case"constant":return Ko(n.name,t.call(i,"name")," =",n.value,t.call(i,"value"),!1,e);case"static":var $,z=t.map((function(t){return i(t)}),"variables"),K=n.variables.some((function(t){return t.defaultValue}));if(1!==z.length||n.variables[0].comments)z.length>0&&($=Ur(z[0]));else $=h(z,1)[0];return Dr(Lr(["static",$?Lr([" ",$]):"",Ur(Lr(z.slice(1).map((function(t){return Lr([",",K?Fr:Rr,t])}))))]));case"staticvariable":return Ko(n.variable,t.call(i,"variable")," =",n.defaultValue,t.call(i,"defaultValue"),!1,e);case"list":case"array":var X="array"===n.kind&&Co(e.phpVersion,"5.4")||"list"===n.kind&&(n.shortForm||Co(e.phpVersion,"7.1")),J=X?"[":Lr([n.kind,"("]),q=X?"]":")";if(0===n.items.length)return no(n)?Dr(Lr([J,yr.printDanglingComments(t,e),Hr,q])):Lr([J,q]);var Z=Kr(n.items),tt=Z&&"noop"===Z.kind,et=h(n.items.filter((function(t){return"noop"!==t.kind})).sort((function(t,i){return e.locStart(t)-e.locStart(i)})),1)[0],it=!(!et||!et.key)&&et&&zr(e.originalText,e.locStart(n),e.locStart(et));return Dr(Lr([J,Ur(Lr([Hr,Vo(t,e,i)])),tt?",":"",Mr(!tt&&So(e,"5.0")?Lr([Z&&mo(Z)?Fr:"",","]):""),yr.printDanglingComments(t,e,!0),Hr,q]),{shouldBreak:it});case"entry":var nt=n.byRef?"&":"",st=n.unpack?"...":"";return n.key?Ko(n.key,t.call(i,"key")," =>",n.value,t.call(i,"value"),nt,e):Lr([nt,st,t.call(i,"value")]);case"yield":var rt=Lr([n.key?Lr([t.call(i,"key")," => "]):"",t.call(i,"value")]);return Lr(["yield",n.key||n.value?" ":"",n.value&&n.value.comments?Ur(rt):rt]);case"yieldfrom":return Lr(["yield from ",n.value.comments?Ur(t.call(i,"value")):t.call(i,"value")]);case"unary":return Lr([n.type,t.call(i,"what")]);case"pre":return Lr([n.type+n.type,t.call(i,"what")]);case"post":return Lr([t.call(i,"what"),n.type+n.type]);case"cast":return Lr(["(",n.type,") ",n.expr.comments?Ur(t.call(i,"expr")):t.call(i,"expr")]);case"assignref":case"assign":var ot="assignref"===n.kind;return Ko(n.left,t.call(i,"left"),Lr([" ",ot?"=":n.operator]),n.right,t.call(i,"right"),ot,e);case"bin":var at=t.getParentNode(),ht=t.getParentNode(1),lt=n!==at.body&&("if"===at.kind||"while"===at.kind||"switch"===at.kind||"do"===at.kind),ct=Fo(t,i,e,!1,lt);if(lt)return Lr(ct);if("unary"===at.kind||ao(at)&&"offsetlookup"!==at.kind)return Dr(Lr([Ur(Lr([Hr,Lr(ct)])),Hr]));var ut=n!==at.body&&"for"===at.kind||"retif"===at.kind&&ht&&"return"!==ht.kind,_t=["assign","property","constant","staticvariable","entry"].includes(at.kind),dt="bin"===n.left.kind&&to(n.type,n.left.type);if(ut||Mo(n)&&!dt||!Mo(n)&&_t)return Dr(Lr(ct));var pt=Lr(ct.slice(1));return Dr(Lr([ct.length>0?ct[0]:"",Ur(pt)]));case"retif":var ft,Tt=[],kt=t.getParentNode(),mt=0;do{ft=t.getParentNode(mt),mt++}while(ft&&"retif"===ft.kind);var Et=ft||kt,xt="bin"===n.falseExpr.kind?Ur(t.call(i,"falseExpr")):t.call(i,"falseExpr"),yt=Lr([n.trueExpr?Rr:" ","?",n.trueExpr?Lr([" ","bin"===n.trueExpr.kind?Ur(t.call(i,"trueExpr")):t.call(i,"trueExpr"),Rr]):"",":",n.trueExpr?Lr([" ",xt]):Lr([Bo(n.falseExpr)?" ":Rr,xt])]);Tt.push(yt);var vt=function(t){return kt===Et?Dr(t):t},At=t.getParentNode(1),gt="cast"===kt.kind&&At?At:kt,Nt=["propertylookup","nullsafepropertylookup","staticlookup"].includes(gt.kind),Ct=t.call(i,"test");if(!n.trueExpr){var St=Lr([Ct,"bin"===gt.kind||["print","echo","return","include"].includes(Et.kind)?Ur(Lr(Tt)):Lr(Tt)]);return"call"===gt.kind&>.what===n||"unary"===gt.kind||ao(gt)&&"offsetlookup"!==gt.kind?Dr(Lr([Ur(Lr([Hr,St])),Hr])):vt(St)}return vt(Lr(["retif"===n.test.kind?Ur(Ct):Ct,Ur(Lr(Tt)),Nt?Hr:""]));case"boolean":return n.value?"true":"false";case"number":return Zr(n.value);case"string":if("encapsedpart"===t.getParentNode().kind){var bt=t.getParentNode(1),Ot=0,Lt=Co(e.phpVersion,"7.3"),It=Gr;if("heredoc"===bt.type){It=Lt?Fr:Gr;var Rt=bt.raw.split(/\r?\n/g);-1===(Ot=Rt[Rt.length-1].search(/\S/))&&(Ot=Rt[Rt.length-2].search(/\S/))}return Ir(It,n.raw.split(/\r?\n/g).map((function(t,e){return e>0||0===n.loc.start.column?t.substring(Ot):t})))}var wt=fo(n,e)?'"':"'",Dt=n.raw;return"b"===n.raw[0]&&(Dt=Dt.slice(1)),['"',"'"].includes(Dt[0])&&(Dt=Dt.substr(1)),['"',"'"].includes(Dt[Dt.length-1])&&(Dt=Dt.substr(0,Dt.length-1)),Lr(["b"===n.raw[0]?"b":"",wt,Ir(Gr,Dt.split(/\r?\n/g)),wt]);case"uniontype":return Dr(Lr(t.map((function(e,n){return Lr(0===n?[t.call(i)]:["|",t.call(i)])}),"types")));case"encapsedpart":var Pt="simple"===n.syntax&&n.curly||"complex"===n.syntax?Lr([n.curly?"$":"","{"]):"",Ut="simple"===n.syntax&&n.curly||"complex"===n.syntax?"}":"";return Lr([Pt,t.call(i,"expression"),Ut]);case"encapsed":switch(n.type){case"string":case"shell":case"heredoc":var Bt=Co(e.phpVersion,"7.3")?Fr:Gr;return Lr([Go(n),"heredoc"===n.type?Bt:"",Lr(t.map(i,"value")),Go(n,{opening:!1}),"heredoc"===n.type&&oo(t)?Fr:""]);default:return"Have not implemented kind ".concat(n.type," yet.")}case"inline":return Ir(Gr,n.raw.replace("___PSEUDO_INLINE_PLACEHOLDER___","").split(/\r?\n/g));case"magic":return n.value;case"nowdoc":var Mt=Co(e.phpVersion,"7.3")?Fr:Gr;return Lr(["<<<'",n.label,"'",Mt,Ir(Mt,n.value.split(/\r?\n/g)),Mt,n.label,oo(t)?Fr:""]);case"name":return Lr(["rn"===n.resolution?"namespace\\":"",n.name]);case"literal":return t.call(i,"value");case"parentreference":return"parent";case"selfreference":return"self";case"staticreference":return"static";case"typereference":return n.name;case"nullkeyword":return"null";case"identifier":return"method"===t.getParentNode().kind&&(n.name=Ao(n.name)),t.call(i,"name");case"match":var Ft=t.map((function(t,e){var n=null===t.getValue().conds?"default":Lr(t.map((function(t,e){return Dr(Lr(e>0?[",",Rr,i(t)]:[i(t)]))}),"conds")),s=t.call(i,"body");return Lr(e>0?[", ",Rr,n," => ",s]:[Rr,n," => ",s])}),"arms");return Dr(Lr(["match (",Dr(Lr([Hr,Ur(Lr([t.call(i,"cond")])),Hr])),") {",Ur(Lr(Ft))," ",Hr,"}"]));case"noop":return n.comments?yr.printComments(t.getValue().comments,e):"";case"namedargument":return Lr([n.name,": ",t.call(i,"value")]);case"enumcase":return Dr(Lr(["case ",t.call(i,"name"),n.value?Lr([" =",Jo(n.name,n.value,t.call(i,"value"),!1,e)]):""]));default:return"Have not implemented kind ".concat(n.kind," yet.")}}(t,e,i),r=[],o=Sr(t);return o&&r.unshift("("),r.push(s),o&&r.push(")"),qr(t)&&r.push(";"),io(t)&&r.push(Fr),Lr(r)};var ea=function(t,e){if(["loc","range","raw","comments","leadingComments","trailingComments","parenthesizedExpression","parent","prev","start","end","tokens","errors","extra"].forEach((function(t){delete e[t]})),"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(/\r\n?|\n/g,"")}if(("continue"===t.kind||"break"===t.kind)&&t.level){var i=e.level;"number"===i.kind&&(e.level="1"===i.value?null:i)}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;if("number"===t.kind&&(e.value=Hs.printNumber(t.value)),["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=Hs.normalizeMagicMethodName(e.name.name)),"noop"===t.kind)return null},ia="PHP",na={phpVersion:{since:"0.13.0",category:ia,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"}]},trailingCommaPHP:{since:"0.0.0",category:ia,type:"boolean",default:!0,description:"Print trailing commas wherever possible when multi-line."},braceStyle:{since:"0.10.0",category:ia,type:"choice",default:"psr-2",description:"Print one space or newline for code blocks (classes and functions).",choices:[{value:"psr-2",description:"Use PSR-2 brace style."},{value:"1tbs",description:"Use 1tbs brace style."}]}},sa=function(t,e,i,n){if("length"!==i&&"prototype"!==i&&"arguments"!==i&&"caller"!==i){var s=Object.getOwnPropertyDescriptor(t,i),r=Object.getOwnPropertyDescriptor(e,i);!ra(s,r)&&n||Object.defineProperty(t,i,r)}},ra=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)},oa=function(t,e){var i=Object.getPrototypeOf(e);i!==Object.getPrototypeOf(t)&&Object.setPrototypeOf(t,i)},aa=function(t,e){return"/* Wrapped ".concat(t,"*/\n").concat(e)},ha=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),la=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),ca=function(t,e,i){var n=""===i?"":"with ".concat(i.trim(),"() "),s=aa.bind(null,n,e.toString());Object.defineProperty(s,"name",la),Object.defineProperty(t,"toString",r(r({},ha),{},{value:s}))},ua=function(t,e){var i,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=n.ignoreNonConfigurable,r=void 0!==s&&s,o=t.name,a=_(Reflect.ownKeys(e));try{for(a.s();!(i=a.n()).done;){var h=i.value;sa(t,e,h,r)}}catch(t){a.e(t)}finally{a.f()}return oa(t,e),ca(t,e,o),t},_a="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function da(t){return t&&t.default||t}var pa,fa=function(){var t={};return t.promise=new Promise((function(e,i){t.resolve=e,t.reject=i})),t},Ta=function(t,e){return t(e={exports:{}},e.exports),e.exports}((function(t,e){var i=_a&&_a.__awaiter||function(t,e,i,n){return new(i||(i=Promise))((function(s,r){function o(t){try{h(n.next(t))}catch(t){r(t)}}function a(t){try{h(n.throw(t))}catch(t){r(t)}}function h(t){t.done?s(t.value):new i((function(e){e(t.value)})).then(o,a)}h((n=n.apply(t,e||[])).next())}))},n=_a&&_a.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var s=n(fa);function r(t){var e,n,r,o=this,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"maxAge",h=function(){return i(o,void 0,void 0,regeneratorRuntime.mark((function o(){var h,l,c,u,d=this;return regeneratorRuntime.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:if(void 0===e){o.next=2;break}return o.abrupt("return");case 2:h=function(o){return i(d,void 0,void 0,regeneratorRuntime.mark((function i(){var h;return regeneratorRuntime.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(r=s.default(),!((h=o[1][a]-Date.now())<=0)){i.next=6;break}return t.delete(o[0]),r.resolve(),i.abrupt("return");case 6:return e=o[0],"function"==typeof(n=setTimeout((function(){t.delete(o[0]),r&&r.resolve()}),h)).unref&&n.unref(),i.abrupt("return",r.promise);case 10:case"end":return i.stop()}}),i)})))},o.prev=3,l=_(t),o.prev=5,l.s();case 7:if((c=l.n()).done){o.next=13;break}return u=c.value,o.next=11,h(u);case 11:o.next=7;break;case 13:o.next=18;break;case 15:o.prev=15,o.t0=o.catch(5),l.e(o.t0);case 18:return o.prev=18,l.f(),o.finish(18);case 21:o.next=25;break;case 23:o.prev=23,o.t1=o.catch(3);case 25:e=void 0;case 26:case"end":return o.stop()}}),o,null,[[3,23],[5,15,18,21]])})))},l=function(){e=void 0,void 0!==n&&(clearTimeout(n),n=void 0),void 0!==r&&(r.reject(void 0),r=void 0)},c=t.set.bind(t);return t.set=function(i,n){t.has(i)&&t.delete(i);var s=c(i,n);return e&&e===i&&l(),h(),s},h(),t}e.default=r,t.exports=r,t.exports.default=r}));(pa=Ta)&&pa.__esModule&&Object.prototype.hasOwnProperty.call(pa,"default")&&pa.default;var ka=Ta,ma=new WeakMap,Ea=new WeakMap,xa=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=e.cacheKey,n=e.cache,s=void 0===n?new Map:n,r=e.maxAge;"number"==typeof r&&ka(s);var o=function(){for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];var a=i?i(n):n[0],h=s.get(a);if(h)return h.data;var l=t.apply(this,n);return s.set(a,{data:l,maxAge:r?Date.now()+r:Number.POSITIVE_INFINITY}),l};return ua(o,t,{ignoreNonConfigurable:!0}),Ea.set(o,s),o};xa.decorator=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(e,i,n){var s=e[i];if("function"!=typeof s)throw new TypeError("The decorated value must be a function");delete n.value,delete n.writable,n.get=function(){if(!ma.has(this)){var e=xa(s,t);return ma.set(this,e),e}return ma.get(this)}}},xa.clear=function(t){var e=Ea.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()};var ya=/@prettier|@format/,va=xa((function(t){var e=ms(t),i=h(e.children,1)[0],n=h(e.comments.filter((function(t){return"commentblock"===t.kind})),1)[0];if(i&&n&&n.loc.start.line<i.loc.start.line)return n}));var Aa=function(t){if(!ya.test(t))return!1;var e=va(t);if(e){var i=e.value;return ya.test(i)}return!1},ga=function(t){var e=va(t);if(e){var i=e.loc,n=i.start.offset,s=i.end.offset,r=t.substring(0,n),o=t.substring(s);return"".concat(r).concat(function(t,e){var i=t.split(/\r?\n/g);if(1===i.length){var n=h(/\/*\*\*(.*)\*\//.exec(i[0]),2)[1];i=["/**"," * ".concat(n.trim())," */"]}var s=i.findIndex((function(t){return/@\S/.test(t)}))||1;return i.splice(s,0," * @format"),i.join(function(t){var e=t.indexOf("\n");return e>=0&&"\r"===t.charAt(e-1)?"\r\n":"\n"}(e))}(e.value,t)).concat(o)}var a="<?php";if(!t.startsWith(a))return t;var l=a.length,c=t.substring(0,l),u=t.substring(l);return"".concat(c,"\n/** \n * @format \n */\n").concat(u)},Na="programming",Ca="text.html.php",Sa="application/x-httpd-php",ba="#4F5D95",Oa=[".php",".aw",".ctp",".fcgi",".inc",".php3",".php4",".php5",".phps",".phpt"],La=[".php",".php_cs",".php_cs.dist","Phakefile"],Ia=["php"],Ra=["inc"],wa={name:"PHP",type:Na,tmScope:Ca,aceMode:"php",codemirrorMode:"php",codemirrorMimeType:Sa,color:ba,extensions:Oa,filenames:La,interpreters:Ia,aliases:Ra,languageId:272},Da=Object.freeze({__proto__:null,name:"PHP",type:Na,tmScope:Ca,aceMode:"php",codemirrorMode:"php",codemirrorMimeType:Sa,color:ba,extensions:Oa,filenames:La,interpreters:Ia,aliases:Ra,languageId:272,default:wa}),Pa="HTML+PHP",Ua="markup",Ba="text.html.php",Ma="HTML",Fa=[".phtml"],Ha="application/x-httpd-php",Ga={name:Pa,type:Ua,tmScope:Ba,group:Ma,extensions:Fa,aceMode:"php",codemirrorMode:"php",codemirrorMimeType:Ha,languageId:151},Va=Object.freeze({__proto__:null,name:Pa,type:Ua,tmScope:Ba,group:Ma,extensions:Fa,aceMode:"php",codemirrorMode:"php",codemirrorMimeType:Ha,languageId:151,default:Ga}),Wa=da(Da),Qa=da(Va),Ya=n.default.doc.builders,ja=Ya.join,$a=Ya.hardline,za=Aa,Ka=ga;function Xa(t,e){var i=e.extend,n=e.override,s={};for(var r in t){s["languageId"===r?"linguistLanguageId":r]=t[r]}if(i)for(var o in i)s[o]=(s[o]||[]).concat(i[o]);for(var a in n)s[a]=n[a];return s}var Ja=[Xa(Wa,{override:{parsers:["php"],vscodeLanguageIds:["php"]}}),Xa(Qa,{override:{parsers:["php"],vscodeLanguageIds:["php"]}})],qa=function(t){return function(e){return e.loc&&e.loc[t]&&e.loc[t].offset}},Za={php:{parse:ms,astFormat:"php",locStart:qa("start"),locEnd:qa("end"),hasPragma:za}},th={php:{print:ta,insertPragma:Ka,massageAstNode:ea,getCommentChildNodes:yr.getCommentChildNodes,canAttachComment:yr.canAttachComment,isBlockComment:yr.isBlockComment,handleComments:{ownLine:yr.handleOwnLineComment,endOfLine:yr.handleEndOfLineComment,remaining:yr.handleRemainingComment},willPrintOwnComments:function(t){var e=t.getValue();return e&&"noop"===e.kind},printComment:function(t){var e=t.getValue();switch(e.kind){case"commentblock":if(!e.value.includes("\n"))return e.value;var i=e.value.split(/\r?\n/g);return i.slice(1,i.length-1).every((function(t){return"*"===t.trim()[0]}))?ja($a,i.map((function(t,e){return(e>0?" ":"")+(e<i.length-1?t.trim():t.trimLeft())}))):e.value;case"commentline":return e.value.trimRight();default:throw new Error("Not a comment: ".concat(JSON.stringify(e)))}},hasPrettierIgnore:function(t){var e=function(t){return t.value.includes("prettier-ignore")&&!t.value.includes("prettier-ignore-start")&&!t.value.includes("prettier-ignore-end")},i=t.getParentNode(),n=t.getNode();return n&&"classconstant"!==n.kind&&n.comments&&n.comments.length>0&&n.comments.some(e)||n&&"constant"===n.kind&&i&&"classconstant"===i.kind&&i.comments&&i.comments.length>0&&i.comments.some(e)}}},eh={languages:Ja,printers:th,parsers:Za,options:na,defaultOptions:{tabWidth:4}},ih=eh.languages,nh=eh.printers,sh=eh.parsers,rh=eh.options,oh=eh.defaultOptions;t.default=eh,t.defaultOptions=oh,t.languages=ih,t.options=rh,t.parsers=sh,t.printers=nh,Object.defineProperty(t,"__esModule",{value:!0})}));
|