UNPKG

froala-editor

Version:

The next generation Javascript WYSIWYG HTML rich text editor made by devs for devs. High performance and modern design make it easy to use for developers and loved by users.

7 lines (6 loc) 698 kB
/*! * froala_editor v4.5.1 (https://www.froala.com/wysiwyg-editor) * License https://froala.com/wysiwyg-editor/terms/ * Copyright 2014-2025 Froala Labs */ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("froala-editor")):"function"==typeof define&&define.amd?define(["froala-editor"],t):t(e.FroalaEditor)}(this,function(St){"use strict";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,n=Array(t);a<t;a++)n[a]=e[a];return n}function $e(e,t){var a="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!a){if(Array.isArray(e)||(a=l(e))||t&&e&&"number"==typeof e.length){a&&(e=a);var n=0,r=function(){};return{s:r,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:r}}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 i,o=!0,s=!1;return{s:function(){a=a.call(e)},n:function(){var e=a.next();return o=e.done,e},e:function(e){s=!0,i=e},f:function(){try{o||null==a["return"]||a["return"]()}finally{if(s)throw i}}}}function Se(e){return function t(e){if(Array.isArray(e))return r(e)}(e)||function a(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||l(e)||function n(){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 Rt(e){return(Rt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function l(e,t){if(e){if("string"==typeof e)return r(e,t);var a={}.toString.call(e).slice(8,-1);return"Object"===a&&e.constructor&&(a=e.constructor.name),"Map"===a||"Set"===a?Array.from(e):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?r(e,t):void 0}}if((St=St&&St.hasOwnProperty("default")?St["default"]:St).PLUGINS.align=function(s){var l=s.$;return{apply:function c(e){var t=s.selection.element(),a=l(t).closest(".fr-table-selected"),n=l(t).parents("TD"),r="TD"===t.tagName||n.length&&s.el.contains(n.get(0));if(l(t).parents(".fr-img-caption").length)l(t).css("text-align",e);else if(a.length&&s.el.contains(a[0]))a.find("td").css("text-align",e);else if(r)s.node.isBlock(t)?l(t).css("text-align",e):n.css("text-align",e);else{s.selection.save(),s.html.wrap(!0,!0,!0,!0),s.selection.restore();for(var i=s.selection.blocks(),o=0;o<i.length;o++)l(i[o]).css("text-align",e).removeClass("fr-temp-div"),""===l(i[o]).attr("class")&&l(i[o]).removeAttr("class"),""===l(i[o]).attr("style")&&l(i[o]).removeAttr("style");s.selection.save(),s.html.unwrap(),s.selection.restore()}},refresh:function n(e){var t=s.selection.blocks();if(t.length){var a=s.helpers.getAlignment(l(t[0]));e.find("> *").first().replaceWith(s.icon.create("align-".concat(a)))}},refreshOnShow:function r(e,t){var a=s.selection.blocks();if(a.length){var n=s.helpers.getAlignment(l(a[0]));t.find('a.fr-command[data-param1="'.concat(n,'"]')).addClass("fr-active").attr("aria-selected",!0)}},refreshForToolbar:function i(e){var t=s.selection.blocks();if(t.length){var a=s.helpers.getAlignment(l(t[0]));a=a.charAt(0).toUpperCase()+a.slice(1),"align".concat(a)===e.attr("data-cmd")&&e.addClass("fr-active")}}}},St.DefineIcon("align",{NAME:"align-left",SVG_KEY:"alignLeft"}),St.DefineIcon("align-left",{NAME:"align-left",SVG_KEY:"alignLeft"}),St.DefineIcon("align-right",{NAME:"align-right",SVG_KEY:"alignRight"}),St.DefineIcon("align-center",{NAME:"align-center",SVG_KEY:"alignCenter"}),St.DefineIcon("align-justify",{NAME:"align-justify",SVG_KEY:"alignJustify"}),St.RegisterCommand("align",{type:"dropdown",title:"Align",options:{left:"Align Left",center:"Align Center",right:"Align Right",justify:"Align Justify"},html:function(){var e='<ul class="fr-dropdown-list" role="presentation">',t=St.COMMANDS.align.options;for(var a in t)t.hasOwnProperty(a)&&(e+='<li role="presentation"><a class="fr-command fr-title" tabIndex="-1" role="option" data-cmd="align"data-param1="\n '.concat(a,'" title="').concat(this.language.translate(t[a]),'">').concat(this.icon.create("align-".concat(a)),'<span class="fr-sr-only">\n ').concat(this.language.translate(t[a]),"</span></a></li>"));return e+="</ul>"},callback:function(e,t){this.align.apply(t)},refresh:function(e){this.align.refresh(e)},refreshOnShow:function(e,t){this.align.refreshOnShow(e,t)},plugin:"align"}),St.RegisterCommand("alignLeft",{type:"button",icon:"align-left",title:"Align Left",callback:function(){this.align.apply("left")},refresh:function(e){this.align.refreshForToolbar(e)},plugin:"align"}),St.RegisterCommand("alignRight",{type:"button",icon:"align-right",title:"Align Right",callback:function(){this.align.apply("right")},refresh:function(e){this.align.refreshForToolbar(e)},plugin:"align"}),St.RegisterCommand("alignCenter",{type:"button",icon:"align-center",title:"Align Center",callback:function(){this.align.apply("center")},refresh:function(e){this.align.refreshForToolbar(e)},plugin:"align"}),St.RegisterCommand("alignJustify",{type:"button",icon:"align-justify",title:"Align Justify",callback:function(){this.align.apply("justify")},refresh:function(e){this.align.refreshForToolbar(e)},plugin:"align"}),Object.assign(St.DEFAULTS,{charCounterMax:-1,charCounterCount:!0}),St.PLUGINS.charCounter=function(n){var a,r=n.$,i=function i(){return(n.opts.iframe&&n.markdown&&n.markdown.isEnabled()?n.$el.text()||"":n.el.textContent||"").replace(/\u200B/g,"").length};function e(e){if(n.opts.charCounterMax<0)return!0;if(i()<n.opts.charCounterMax)return!0;var t=e.which;return!(!n.keys.ctrlKey(e)&&n.keys.isCharacter(t)||t===St.KEYCODE.IME)||(e.preventDefault(),e.stopPropagation(),n.events.trigger("charCounter.exceeded"),!1)}function t(e){return n.opts.charCounterMax<0?e:r("<div>").html(e).text().length+i()<=n.opts.charCounterMax?e:(n.events.trigger("charCounter.exceeded"),"")}function o(e,t,a){return n.opts.charCounterMax<0||(e.includes('<span class="fr-emoticon')||e.includes('<i class="fa ')?!(i()>=n.opts.charCounterMax)||(n.events.trigger("charCounter.exceeded"),!1):r("<div>").html(e).text().length+i()<=n.opts.charCounterMax||(n.events.trigger("charCounter.exceeded"),!1))}function s(){if(n.opts.charCounterCount){var e=i()+(0<n.opts.charCounterMax?"/"+n.opts.charCounterMax:"");a.text("".concat(n.language.translate("Characters")," : ").concat(e)),n.opts.toolbarBottom&&a.css("margin-bottom",n.$tb.outerHeight(!0));var t=n.$wp.get(0).offsetWidth-n.$wp.get(0).clientWidth;0<=t&&("rtl"==n.opts.direction?a.css("margin-left",t):a.css("margin-right",t))}}return{_init:function l(){return!!n.$wp&&!!n.opts.charCounterCount&&((a=r(document.createElement("span")).attr("class","fr-counter")).css("bottom",n.$wp.css("border-bottom-width")),n.$second_tb?n.$second_tb.append(a):n.$wp.append(a),n.events.on("keydown",e,!0),n.events.on("paste.afterCleanup",t),n.events.on("keyup contentChanged input",function(){n.events.trigger("charCounter.update")}),n.events.on("html.beforeInsert",o),n.events.on("charCounter.update",s),n.events.trigger("charCounter.update"),void n.events.on("destroy",function(){r(n.o_win).off("resize.char".concat(n.id)),a.removeData().remove(),a=null}))},count:i}},St.PLUGINS.codeBeautifier=function(){var e,t,a,n,j={};function L(n,e){var t={"@page":!0,"@font-face":!0,"@keyframes":!0,"@media":!0,"@supports":!0,"@document":!0},a={"@media":!0,"@supports":!0,"@document":!0};e=e||{},n=(n=n||"").replace(/\r\n|[\r\u2028\u2029]/g,"\n");var r=e.indent_size||4,i=e.indent_char||" ",o=e.selector_separator_newline===undefined||e.selector_separator_newline,s=e.end_with_newline!==undefined&&e.end_with_newline,l=e.newline_between_rules===undefined||e.newline_between_rules,c=e.eol?e.eol:"\n";"string"==typeof r&&(r=parseInt(r,10)),e.indent_with_tabs&&(i="\t",r=1),c=c.replace(/\\r/,"\r").replace(/\\n/,"\n");var d,f=/^\s+$/,p=-1,u=0;function g(){return(d=n.charAt(++p))||""}function h(e){var t,a=p;return e&&v(),t=n.charAt(p+1)||"",p=a-1,g(),t}function m(e){for(var t=p;g();)if("\\"===d)g();else{if(-1!==e.indexOf(d))break;if("\n"===d)break}return n.substring(t,p+1)}function v(){for(var e="";f.test(h());)g(),e+=d;return e}function b(){var e="";for(d&&f.test(d)&&(e=d);f.test(g());)e+=d;return e}function E(e){var t=p;for(e="/"===h(),g();g();){if(!e&&"*"===d&&"/"===h()){g();break}if(e&&"\n"===d)return n.substring(t,p)}return n.substring(t,p)+d}function _(e){return n.substring(p-e.length,p).toLowerCase()===e}function w(){for(var e=0,t=p+1;t<n.length;t++){var a=n.charAt(t);if("{"===a)return!0;if("("===a)e+=1;else if(")"===a){if(0===e)return!1;e-=1}else if(" "===a||"}"===a)return!1}return!1}var y=n.match(/^[\t ]*/)[0],A=new Array(r+1).join(i),C=0,T=0;for(var k,S,R,L={"{":function(e){L.singleSpace(),x.push(e),L.newLine()},"}":function(e){L.newLine(),x.push(e),L.newLine()},_lastCharWhitespace:function(){return f.test(x[x.length-1])},newLine:function(e){x.length&&(e||"\n"===x[x.length-1]||L.trim(),x.push("\n"),y&&x.push(y))},singleSpace:function(){x.length&&!L._lastCharWhitespace()&&x.push(" ")},preserveSingleSpace:function(){k&&L.singleSpace()},trim:function(){for(;L._lastCharWhitespace();)x.pop()}},x=[],I=!1,O=!1,F=!1,M="",D="";;){var N=b();k=""!==N;var P=-1!==N.indexOf("\n");if(D=M,!(M=d))break;if("/"===d&&"*"===h()){var B=0===C;(P||B)&&L.newLine(),x.push(E()),L.newLine(),B&&L.newLine(!0)}else if("/"===d&&"/"===h())P||"{"===D||L.trim(),L.singleSpace(),x.push(E()),L.newLine();else if("@"===d){L.preserveSingleSpace(),x.push(d);var U=(void 0,S=p,R=m(": , {}()[]/='\""),p=S-1,g(),R);U.match(/[ :]$/)&&(g(),U=m(": ").replace(/\s$/,""),x.push(U),L.singleSpace()),(U=U.replace(/\s$/,""))in t&&(T+=1,U in a&&(F=!0))}else"#"===d&&"{"===h()?(L.preserveSingleSpace(),x.push(m("}"))):"{"===d?"}"===h(!0)?(v(),g(),L.singleSpace(),x.push("{}"),L.newLine(),l&&0===C&&L.newLine(!0)):(C++,y+=A,L["{"](d),I=F?(F=!1,T<C):T<=C):"}"===d?(C--,y=y.slice(0,-r),L["}"](d),O=I=!1,T&&T--,l&&0===C&&L.newLine(!0)):":"===d?(v(),!I&&!F||_("&")||w()?":"===h()?(g(),x.push("::")):x.push(":"):(O=!0,x.push(":"),L.singleSpace())):'"'===d||"'"===d?(L.preserveSingleSpace(),x.push(m(d))):" "===d?(O=!1,x.push(d),L.newLine()):"("===d?_("url")?(x.push(d),v(),g()&&(")"!==d&&'"'!==d&&"'"!==d?x.push(m(")")):p--)):(u++,L.preserveSingleSpace(),x.push(d),v()):")"===d?(x.push(d),u--):","===d?(x.push(d),v(),o&&!O&&u<1?L.newLine():L.singleSpace()):("]"===d||("["===d?L.preserveSingleSpace():"="===d?(v(),d="="):L.preserveSingleSpace()),x.push(d))}var $="";return y&&($+=y),$+=x.join("").replace(/[\r\n\t ]+$/,""),s&&($+="\n"),"\n"!=c&&($=$.replace(/[\n]/g,c)),$}function q(e,t){for(var a=0;a<t.length;a+=1)if(t[a]===e)return!0;return!1}function X(e){return e.replace(/^\s+|\s+$/g,"")}function x(e,t){return new r(e,t).beautify()}e=j,t="\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0\u08a2-\u08ac\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19c1-\u19c7\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa80-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc",a=new RegExp("[".concat(t,"]")),n=new RegExp("[".concat(t," ").concat("\u0300-\u036f\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u0620-\u0649\u0672-\u06d3\u06e7-\u06e8\u06fb-\u06fc\u0730-\u074a\u0800-\u0814\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0840-\u0857\u08e4-\u08fe\u0900-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962-\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09d7\u09df-\u09e0\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2-\u0ae3\u0ae6-\u0aef\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b5f-\u0b60\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c01-\u0c03\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62-\u0c63\u0c66-\u0c6f\u0c82\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2-\u0ce3\u0ce6-\u0cef\u0d02\u0d03\u0d46-\u0d48\u0d57\u0d62-\u0d63\u0d66-\u0d6f\u0d82\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0df2\u0df3\u0e34-\u0e3a\u0e40-\u0e45\u0e50-\u0e59\u0eb4-\u0eb9\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f41-\u0f47\u0f71-\u0f84\u0f86-\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u1000-\u1029\u1040-\u1049\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u170e-\u1710\u1720-\u1730\u1740-\u1750\u1772\u1773\u1780-\u17b2\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u1920-\u192b\u1930-\u193b\u1951-\u196d\u19b0-\u19c0\u19c8-\u19c9\u19d0-\u19d9\u1a00-\u1a15\u1a20-\u1a53\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1b46-\u1b4b\u1b50-\u1b59\u1b6b-\u1b73\u1bb0-\u1bb9\u1be6-\u1bf3\u1c00-\u1c22\u1c40-\u1c49\u1c5b-\u1c7d\u1cd0-\u1cd2\u1d00-\u1dbe\u1e01-\u1f15\u200c\u200d\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2d81-\u2d96\u2de0-\u2dff\u3021-\u3028\u3099\u309a\ua640-\ua66d\ua674-\ua67d\ua69f\ua6f0-\ua6f1\ua7f8-\ua800\ua806\ua80b\ua823-\ua827\ua880-\ua881\ua8b4-\ua8c4\ua8d0-\ua8d9\ua8f3-\ua8f7\ua900-\ua909\ua926-\ua92d\ua930-\ua945\ua980-\ua983\ua9b3-\ua9c0\uaa00-\uaa27\uaa40-\uaa41\uaa4c-\uaa4d\uaa50-\uaa59\uaa7b\uaae0-\uaae9\uaaf2-\uaaf3\uabc0-\uabe1\uabec\uabed\uabf0-\uabf9\ufb20-\ufb28\ufe00-\ufe0f\ufe20-\ufe26\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f","]")),e.newline=/[\n\r\u2028\u2029]/,e.lineBreak=new RegExp("\r\n|".concat(e.newline.source)),e.allLineBreaks=new RegExp(e.lineBreak.source,"g"),e.isIdentifierStart=function(e){return e<65?36===e||64===e:e<91||(e<97?95===e:e<123||170<=e&&a.test(String.fromCharCode(e)))},e.isIdentifierChar=function(e){return e<48?36===e:e<58||!(e<65)&&(e<91||(e<97?95===e:e<123||170<=e&&n.test(String.fromCharCode(e))))};var Z={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function r(n,e){var c,r,i,d,o,s,l,f,p,t,a,u,g,h=[],m="";function v(e,t){var a=0;return e&&(a=e.indentation_level,!c.just_added_newline()&&e.line_indent_level>a&&(a=e.line_indent_level)),{mode:t,parent:e,last_text:e?e.last_text:"",last_word:e?e.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,if_block:!1,else_block:!1,do_block:!1,do_while:!1,in_case_statement:!1,in_case:!1,case_body:!1,indentation_level:a,line_indent_level:e?e.line_indent_level:a,start_line_index:c.get_line_number(),ternary_depth:0}}for(u={TK_START_EXPR:function M(){x();var e=Z.Expression;if("["===d.text){if("TK_WORD"===o||")"===f.last_text)return"TK_RESERVED"===o&&q(f.last_text,i.line_starters)&&(c.space_before_token=!0),T(e),A(),C(),void(g.space_in_paren&&(c.space_before_token=!0));e=Z.ArrayLiteral,k(f.mode)&&("["!==f.last_text&&(","!==f.last_text||"]"!==s&&"}"!==s)||g.keep_array_indentation||w())}else"TK_RESERVED"===o&&"for"===f.last_text?e=Z.ForInitializer:"TK_RESERVED"===o&&q(f.last_text,["if","while"])&&(e=Z.Conditional);" "===f.last_text||"TK_START_BLOCK"===o?w():"TK_END_EXPR"===o||"TK_START_EXPR"===o||"TK_END_BLOCK"===o||"."===f.last_text?_(d.wanted_newline):"TK_RESERVED"===o&&"("===d.text||"TK_WORD"===o||"TK_OPERATOR"===o?"TK_RESERVED"===o&&("function"===f.last_word||"typeof"===f.last_word)||"*"===f.last_text&&"function"===s?g.space_after_anon_function&&(c.space_before_token=!0):"TK_RESERVED"!==o||!q(f.last_text,i.line_starters)&&"catch"!==f.last_text||g.space_before_conditional&&(c.space_before_token=!0):c.space_before_token=!0;"("===d.text&&"TK_RESERVED"===o&&"await"===f.last_word&&(c.space_before_token=!0);"("===d.text&&("TK_EQUALS"!==o&&"TK_OPERATOR"!==o||L()||_());T(e),A(),g.space_in_paren&&(c.space_before_token=!0);C()},TK_END_EXPR:function D(){for(;f.mode===Z.Statement;)R();f.multiline_frame&&_("]"===d.text&&k(f.mode)&&!g.keep_array_indentation);g.space_in_paren&&("TK_START_EXPR"!==o||g.space_in_empty_paren?c.space_before_token=!0:(c.trim(),c.space_before_token=!1));"]"===d.text&&g.keep_array_indentation?(A(),R()):(R(),A());c.remove_redundant_indentation(p),f.do_while&&p.mode===Z.Conditional&&(p.mode=Z.Expression,f.do_block=!1,f.do_while=!1)},TK_START_BLOCK:function N(){var e=O(1),t=O(2);t&&(":"===t.text&&q(e.type,["TK_STRING","TK_WORD","TK_RESERVED"])||q(e.text,["get","set"])&&q(t.type,["TK_WORD","TK_RESERVED"]))?q(s,["class","interface"])?T(Z.BlockStatement):T(Z.ObjectLiteral):T(Z.BlockStatement);var a=!e.comments_before.length&&"}"===e.text&&"function"===f.last_word&&"TK_END_EXPR"===o;"expand"===g.brace_style||"none"===g.brace_style&&d.wanted_newline?"TK_OPERATOR"!==o&&(a||"TK_EQUALS"===o||"TK_RESERVED"===o&&I(f.last_text)&&"else"!==f.last_text)?c.space_before_token=!0:w(!1,!0):"TK_OPERATOR"!==o&&"TK_START_EXPR"!==o?"TK_START_BLOCK"===o?w():c.space_before_token=!0:k(p.mode)&&","===f.last_text&&("}"===s?c.space_before_token=!0:w());A(),C()},TK_END_BLOCK:function P(){for(;f.mode===Z.Statement;)R();var e="TK_START_BLOCK"===o;"expand"===g.brace_style?e||w():e||(k(f.mode)&&g.keep_array_indentation?(g.keep_array_indentation=!1,w(),g.keep_array_indentation=!0):w());R(),A()},TK_WORD:F,TK_RESERVED:F,TK_SEMICOLON:function B(){x()&&(c.space_before_token=!1);for(;f.mode===Z.Statement&&!f.if_block&&!f.do_block;)R();A()},TK_STRING:function U(){x()?c.space_before_token=!0:"TK_RESERVED"===o||"TK_WORD"===o?c.space_before_token=!0:"TK_COMMA"===o||"TK_START_EXPR"===o||"TK_EQUALS"===o||"TK_OPERATOR"===o?L()||_():w();A()},TK_EQUALS:function $(){x();f.declaration_statement&&(f.declaration_assignment=!0);c.space_before_token=!0,A(),c.space_before_token=!0},TK_OPERATOR:function H(){x();if("TK_RESERVED"===o&&I(f.last_text))return c.space_before_token=!0,void A();if("*"===d.text&&"TK_DOT"===o)return void A();if(":"===d.text&&f.in_case)return f.case_body=!0,C(),A(),w(),void(f.in_case=!1);if("::"===d.text)return void A();"TK_OPERATOR"===o&&_();var e=!0,t=!0;q(d.text,["--","++","!","~"])||q(d.text,["-","+"])&&(q(o,["TK_START_BLOCK","TK_START_EXPR","TK_EQUALS","TK_OPERATOR"])||q(f.last_text,i.line_starters)||","===f.last_text)?(t=e=!1,!d.wanted_newline||"--"!==d.text&&"++"!==d.text||w(!1,!0)," "===f.last_text&&S(f.mode)&&(e=!0),"TK_RESERVED"===o?e=!0:"TK_END_EXPR"===o?e=!("]"===f.last_text&&("--"===d.text||"++"===d.text)):"TK_OPERATOR"===o&&(e=q(d.text,["--","-","++","+"])&&q(f.last_text,["--","-","++","+"]),q(d.text,["+","-"])&&q(f.last_text,["--","++"])&&(t=!0)),f.mode!==Z.BlockStatement&&f.mode!==Z.Statement||"{"!==f.last_text&&" "!==f.last_text||w()):":"===d.text?0===f.ternary_depth?e=!1:f.ternary_depth-=1:"?"===d.text?f.ternary_depth+=1:"*"===d.text&&"TK_RESERVED"===o&&"function"===f.last_text&&(t=e=!1);c.space_before_token=c.space_before_token||e,A(),c.space_before_token=t},TK_COMMA:function z(){if(f.declaration_statement)return S(f.parent.mode)&&(f.declaration_assignment=!1),A(),void(f.declaration_assignment?w(f.declaration_assignment=!1,!0):(c.space_before_token=!0,g.comma_first&&_()));A(),f.mode===Z.ObjectLiteral||f.mode===Z.Statement&&f.parent.mode===Z.ObjectLiteral?(f.mode===Z.Statement&&R(),w()):(c.space_before_token=!0,g.comma_first&&_())},TK_BLOCK_COMMENT:function K(){if(c.raw)return c.add_raw_token(d),void(d.directives&&"end"===d.directives.preserve&&(g.test_output_raw||(c.raw=!1)));if(d.directives)return w(!1,!0),A(),"start"===d.directives.preserve&&(c.raw=!0),void w(!1,!0);if(!j.newline.test(d.text)&&!d.wanted_newline)return c.space_before_token=!0,A(),void(c.space_before_token=!0);var e,t=function o(e){var t;e=e.replace(/\x0d/g,"");var a=[];t=e.indexOf("\n");for(;-1!==t;)a.push(e.substring(0,t)),e=e.substring(t+1),t=e.indexOf("\n");e.length&&a.push(e);return a}(d.text),a=!1,n=!1,r=d.whitespace_before,i=r.length;w(!1,!0),1<t.length&&(!function s(e,t){for(var a=0;a<e.length;a++){var n=X(e[a]);if(n.charAt(0)!==t)return!1}return!0}(t.slice(1),"*")?function l(e,t){for(var a,n=0,r=e.length;n<r;n++)if((a=e[n])&&0!==a.indexOf(t))return!1;return!0}(t.slice(1),r)&&(n=!0):a=!0);for(A(t[0]),e=1;e<t.length;e++)w(!1,!0),a?A(" ".concat(t[e].replace(/^\s+/g,""))):n&&t[e].length>i?A(t[e].substring(i)):c.add_token(t[e]);w(!1,!0)},TK_COMMENT:function W(){d.wanted_newline?w(!1,!0):c.trim(!0);c.space_before_token=!0,A(),w(!1,!0)},TK_DOT:function G(){x();"TK_RESERVED"===o&&I(f.last_text)?c.space_before_token=!0:_(")"===f.last_text&&g.break_chained_methods);A()},TK_UNKNOWN:function V(){A(),"\n"===d.text[d.text.length-1]&&w()},TK_EOF:function Y(){for(;f.mode===Z.Statement;)R()}},g={},(e=e||{}).braces_on_own_line!==undefined&&(g.brace_style=e.braces_on_own_line?"expand":"collapse"),g.brace_style=e.brace_style?e.brace_style:g.brace_style?g.brace_style:"collapse","expand-strict"===g.brace_style&&(g.brace_style="expand"),g.indent_size=e.indent_size?parseInt(e.indent_size,10):4,g.indent_char=e.indent_char?e.indent_char:" ",g.eol=e.eol?e.eol:"\n",g.preserve_newlines=e.preserve_newlines===undefined||e.preserve_newlines,g.break_chained_methods=e.break_chained_methods!==undefined&&e.break_chained_methods,g.max_preserve_newlines=e.max_preserve_newlines===undefined?0:parseInt(e.max_preserve_newlines,10),g.space_in_paren=e.space_in_paren!==undefined&&e.space_in_paren,g.space_in_empty_paren=e.space_in_empty_paren!==undefined&&e.space_in_empty_paren,g.jslint_happy=e.jslint_happy!==undefined&&e.jslint_happy,g.space_after_anon_function=e.space_after_anon_function!==undefined&&e.space_after_anon_function,g.keep_array_indentation=e.keep_array_indentation!==undefined&&e.keep_array_indentation,g.space_before_conditional=e.space_before_conditional===undefined||e.space_before_conditional,g.unescape_strings=e.unescape_strings!==undefined&&e.unescape_strings,g.wrap_line_length=e.wrap_line_length===undefined?0:parseInt(e.wrap_line_length,10),g.e4x=e.e4x!==undefined&&e.e4x,g.end_with_newline=e.end_with_newline!==undefined&&e.end_with_newline,g.comma_first=e.comma_first!==undefined&&e.comma_first,g.test_output_raw=e.test_output_raw!==undefined&&e.test_output_raw,g.jslint_happy&&(g.space_after_anon_function=!0),e.indent_with_tabs&&(g.indent_char="\t",g.indent_size=1),g.eol=g.eol.replace(/\\r/,"\r").replace(/\\n/,"\n"),l="";0<g.indent_size;)l+=g.indent_char,g.indent_size-=1;var b=0;if(n&&n.length){for(;" "===n.charAt(b)||"\t"===n.charAt(b);)m+=n.charAt(b),b+=1;n=n.substring(b)}function E(e){var t=e.newlines;if(g.keep_array_indentation&&k(f.mode))for(var a=0;a<t;a+=1)w(0<a);else if(g.max_preserve_newlines&&t>g.max_preserve_newlines&&(t=g.max_preserve_newlines),g.preserve_newlines&&1<e.newlines){w();for(var n=1;n<t;n+=1)w(!0)}u[(d=e).type]()}function _(e){if(e=e!==undefined&&e,!c.just_added_newline())if(g.preserve_newlines&&d.wanted_newline||e)w(!1,!0);else if(g.wrap_line_length){c.current_line.get_character_count()+d.text.length+(c.space_before_token?1:0)>=g.wrap_line_length&&w(!1,!0)}}function w(e,t){if(!t&&" "!==f.last_text&&","!==f.last_text&&"="!==f.last_text&&"TK_OPERATOR"!==o)for(;f.mode===Z.Statement&&!f.if_block&&!f.do_block;)R();c.add_new_line(e)&&(f.multiline_frame=!0)}function y(){c.just_added_newline()&&(g.keep_array_indentation&&k(f.mode)&&d.wanted_newline?(c.current_line.push(d.whitespace_before),c.space_before_token=!1):c.set_indent(f.indentation_level)&&(f.line_indent_level=f.indentation_level))}function A(e){c.raw?c.add_raw_token(d):(g.comma_first&&"TK_COMMA"===o&&c.just_added_newline()&&","===c.previous_line.last()&&(c.previous_line.pop(),y(),c.add_token(","),c.space_before_token=!0),e=e||d.text,y(),c.add_token(e))}function C(){f.indentation_level+=1}function T(e){p=f?(t.push(f),f):v(null,e),f=v(p,e)}function k(e){return e===Z.ArrayLiteral}function S(e){return q(e,[Z.Expression,Z.ForInitializer,Z.Conditional])}function R(){0<t.length&&(p=f,f=t.pop(),p.mode===Z.Statement&&c.remove_redundant_indentation(p))}function L(){return f.parent.mode===Z.ObjectLiteral&&f.mode===Z.Statement&&(":"===f.last_text&&0===f.ternary_depth||"TK_RESERVED"===o&&q(f.last_text,["get","set"]))}function x(){return!!("TK_RESERVED"===o&&q(f.last_text,["const","let","const"])&&"TK_WORD"===d.type||"TK_RESERVED"===o&&"do"===f.last_text||"TK_RESERVED"===o&&"return"===f.last_text&&!d.wanted_newline||"TK_RESERVED"===o&&"else"===f.last_text&&("TK_RESERVED"!==d.type||"if"!==d.text)||"TK_END_EXPR"===o&&(p.mode===Z.ForInitializer||p.mode===Z.Conditional)||"TK_WORD"===o&&f.mode===Z.BlockStatement&&!f.in_case&&"--"!==d.text&&"++"!==d.text&&"function"!==s&&"TK_WORD"!==d.type&&"TK_RESERVED"!==d.type||f.mode===Z.ObjectLiteral&&(":"===f.last_text&&0===f.ternary_depth||"TK_RESERVED"===o&&q(f.last_text,["get","set"])))&&(T(Z.Statement),C(),"TK_RESERVED"===o&&q(f.last_text,["const","let","const"])&&"TK_WORD"===d.type&&(f.declaration_statement=!0),L()||_("TK_RESERVED"===d.type&&q(d.text,["do","for","if","while"])),!0)}function I(e){return q(e,["case","return","do","if","throw","else"])}function O(e){var t=r+(e||0);return t<0||t>=h.length?null:h[t]}function F(){("TK_RESERVED"===d.type&&f.mode!==Z.ObjectLiteral&&q(d.text,["set","get"])&&(d.type="TK_WORD"),"TK_RESERVED"===d.type&&f.mode===Z.ObjectLiteral)&&(":"===O(1).text&&(d.type="TK_WORD"));if(x()||!d.wanted_newline||S(f.mode)||"TK_OPERATOR"===o&&"--"!==f.last_text&&"++"!==f.last_text||"TK_EQUALS"===o||!g.preserve_newlines&&"TK_RESERVED"===o&&q(f.last_text,["const","let","const","set","get"])||w(),f.do_block&&!f.do_while){if("TK_RESERVED"===d.type&&"while"===d.text)return c.space_before_token=!0,A(),c.space_before_token=!0,void(f.do_while=!0);w(),f.do_block=!1}if(f.if_block)if(f.else_block||"TK_RESERVED"!==d.type||"else"!==d.text){for(;f.mode===Z.Statement;)R();f.if_block=!1,f.else_block=!1}else f.else_block=!0;if("TK_RESERVED"===d.type&&("case"===d.text||"default"===d.text&&f.in_case_statement))return w(),(f.case_body||g.jslint_happy)&&(!function e(){0<f.indentation_level&&(!f.parent||f.indentation_level>f.parent.indentation_level)&&(f.indentation_level-=1)}(),f.case_body=!1),A(),f.in_case=!0,void(f.in_case_statement=!0);if("TK_RESERVED"===d.type&&"function"===d.text&&((q(f.last_text,["}"," "])||c.just_added_newline()&&!q(f.last_text,["[","{",":","=",","]))&&(c.just_added_blankline()||d.comments_before.length||(w(),w(!0))),"TK_RESERVED"===o||"TK_WORD"===o?"TK_RESERVED"===o&&q(f.last_text,["get","set","new","return","export","async"])?c.space_before_token=!0:"TK_RESERVED"===o&&"default"===f.last_text&&"export"===s?c.space_before_token=!0:w():"TK_OPERATOR"===o||"="===f.last_text?c.space_before_token=!0:(f.multiline_frame||!S(f.mode)&&!k(f.mode))&&w()),"TK_COMMA"!==o&&"TK_START_EXPR"!==o&&"TK_EQUALS"!==o&&"TK_OPERATOR"!==o||L()||_(),"TK_RESERVED"===d.type&&q(d.text,["function","get","set"]))return A(),void(f.last_word=d.text);(a="NONE","TK_END_BLOCK"===o?"TK_RESERVED"===d.type&&q(d.text,["else","catch","finally"])?"expand"===g.brace_style||"end-expand"===g.brace_style||"none"===g.brace_style&&d.wanted_newline?a="NEWLINE":(a="SPACE",c.space_before_token=!0):a="NEWLINE":"TK_SEMICOLON"===o&&f.mode===Z.BlockStatement?a="NEWLINE":"TK_SEMICOLON"===o&&S(f.mode)?a="SPACE":"TK_STRING"===o?a="NEWLINE":"TK_RESERVED"===o||"TK_WORD"===o||"*"===f.last_text&&"function"===s?a="SPACE":"TK_START_BLOCK"===o?a="NEWLINE":"TK_END_EXPR"===o&&(c.space_before_token=!0,a="NEWLINE"),"TK_RESERVED"===d.type&&q(d.text,i.line_starters)&&")"!==f.last_text&&(a="else"===f.last_text||"export"===f.last_text?"SPACE":"NEWLINE"),"TK_RESERVED"===d.type&&q(d.text,["else","catch","finally"]))?"TK_END_BLOCK"!==o||"expand"===g.brace_style||"end-expand"===g.brace_style||"none"===g.brace_style&&d.wanted_newline?w():(c.trim(!0),"}"!==c.current_line.last()&&w(),c.space_before_token=!0):"NEWLINE"===a?"TK_RESERVED"===o&&I(f.last_text)?c.space_before_token=!0:"TK_END_EXPR"!==o?"TK_START_EXPR"===o&&"TK_RESERVED"===d.type&&q(d.text,["const","let","const"])||":"===f.last_text||("TK_RESERVED"===d.type&&"if"===d.text&&"else"===f.last_text?c.space_before_token=!0:w()):"TK_RESERVED"===d.type&&q(d.text,i.line_starters)&&")"!==f.last_text&&w():f.multiline_frame&&k(f.mode)&&","===f.last_text&&"}"===s?w():"SPACE"===a&&(c.space_before_token=!0);A(),f.last_word=d.text,"TK_RESERVED"===d.type&&"do"===d.text&&(f.do_block=!0),"TK_RESERVED"===d.type&&"if"===d.text&&(f.if_block=!0)}o="TK_START_BLOCK",s="",(c=new Q(l,m)).raw=g.test_output_raw,t=[],T(Z.BlockStatement),this.beautify=function(){var e,t;for(i=new ee(n,g,l),h=i.tokenize(),r=0;e=O();){for(var a=0;a<e.comments_before.length;a++)E(e.comments_before[a]);E(e),s=f.last_text,o=e.type,f.last_text=e.text,r+=1}return t=c.get_code(),g.end_with_newline&&(t+="\n"),"\n"!=g.eol&&(t=t.replace(/[\n]/g,g.eol)),t}}function i(t){var a=0,n=-1,r=[],i=!0;this.set_indent=function(e){a=t.baseIndentLength+e*t.indent_length,n=e},this.get_character_count=function(){return a},this.is_empty=function(){return i},this.last=function(){return this._empty?null:r[r.length-1]},this.push=function(e){r.push(e),a+=e.length,i=!1},this.pop=function(){var e=null;return i||(e=r.pop(),a-=e.length,i=0===r.length),e},this.remove_indent=function(){0<n&&(n-=1,a-=t.indent_length)},this.trim=function(){for(;" "===this.last();)r.pop(),a-=1;i=0===r.length},this.toString=function(){var e="";return this._empty||(0<=n&&(e=t.indent_cache[n]),e+=r.join("")),e}}function Q(t,a){a=a||"",this.indent_cache=[a],this.baseIndentLength=a.length,this.indent_length=t.length,this.raw=!1;var n=[];this.baseIndentString=a,this.indent_string=t,this.previous_line=null,this.current_line=null,this.space_before_token=!1,this.add_outputline=function(){this.previous_line=this.current_line,this.current_line=new i(this),n.push(this.current_line)},this.add_outputline(),this.get_line_number=function(){return n.length},this.add_new_line=function(e){return(1!==this.get_line_number()||!this.just_added_newline())&&(!(!e&&this.just_added_newline())&&(this.raw||this.add_outputline(),!0))},this.get_code=function(){return n.join("\n").replace(/[\r\n\t ]+$/,"")},this.set_indent=function(e){if(1<n.length){for(;e>=this.indent_cache.length;)this.indent_cache.push(this.indent_cache[this.indent_cache.length-1]+this.indent_string);return this.current_line.set_indent(e),!0}return this.current_line.set_indent(0),!1},this.add_raw_token=function(e){for(var t=0;t<e.newlines;t++)this.add_outputline();this.current_line.push(e.whitespace_before),this.current_line.push(e.text),this.space_before_token=!1},this.add_token=function(e){this.add_space_before_token(),this.current_line.push(e)},this.add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&this.current_line.push(" "),this.space_before_token=!1},this.remove_redundant_indentation=function(e){if(!e.multiline_frame&&e.mode!==Z.ForInitializer&&e.mode!==Z.Conditional)for(var t=e.start_line_index,a=n.length;t<a;)n[t].remove_indent(),t++},this.trim=function(e){for(e=e!==undefined&&e,this.current_line.trim(t,a);e&&1<n.length&&this.current_line.is_empty();)n.pop(),this.current_line=n[n.length-1],this.current_line.trim();this.previous_line=1<n.length?n[n.length-2]:null},this.just_added_newline=function(){return this.current_line.is_empty()},this.just_added_blankline=function(){return!!this.just_added_newline()&&(1===n.length||n[n.length-2].is_empty())}}var J=function J(e,t,a,n,r,i){this.type=e,this.text=t,this.comments_before=[],this.newlines=a||0,this.wanted_newline=0<a,this.whitespace_before=n||"",this.parent=null,this.directives=null};function ee(R,L,e){var x="\n\r\t ".split(""),I=/[0-9]/,O=/[01234567]/,F=/[0123456789abcdefABCDEF]/,M="+ - * / % & ++ -- = += -= *= /= %= == === != !== > < >= <= >> << >>> >>>= >>= <<= && &= | || ! ~ , : ? ^ ^= |= :: =>".split(" ");this.line_starters="continue,try,throw,return,const,let,const,if,switch,case,default,for,while,break,function,import,export".split(",");var D,N,P,B,U,$,H=this.line_starters.concat(["do","in","else","get","set","new","catch","finally","typeof","yield","async","await"]),z=/([\s\S]*?)((?:\*\/)|$)/g,K=/([^\n\r\u2028\u2029]*)/g,W=/\/\* beautify( \w+[:]\w+)+ \*\//g,G=/ (\w+)[:](\w+)/g,V=/([\s\S]*?)((?:\/\*\sbeautify\signore:end\s\*\/)|$)/g,Y=/((<\?php|<\?=)[\s\S]*?\?>)|(<%[\s\S]*?%>)/g;function o(){var e,t,a=[];if(D=0,N="",$<=U)return["","TK_EOF"];t=B.length?B[B.length-1]:new J("TK_START_BLOCK","{");var n=R.charAt(U);for(U+=1;q(n,x);){if(j.newline.test(n)?"\n"===n&&"\r"===R.charAt(U-2)||(D+=1,a=[]):a.push(n),$<=U)return["","TK_EOF"];n=R.charAt(U),U+=1}if(a.length&&(N=a.join("")),I.test(n)){var r=!0,i=!0,o=I;for("0"===n&&U<$&&/[Xxo]/.test(R.charAt(U))?(i=r=!1,n+=R.charAt(U),U+=1,o=/[o]/.test(R.charAt(U))?O:F):(n="",U-=1);U<$&&o.test(R.charAt(U));)n+=R.charAt(U),U+=1,r&&U<$&&"."===R.charAt(U)&&(n+=R.charAt(U),U+=1,r=!1),i&&U<$&&/[Ee]/.test(R.charAt(U))&&(n+=R.charAt(U),(U+=1)<$&&/[+-]/.test(R.charAt(U))&&(n+=R.charAt(U),U+=1),r=i=!1);return[n,"TK_WORD"]}if(j.isIdentifierStart(R.charCodeAt(U-1))){if(U<$)for(;j.isIdentifierChar(R.charCodeAt(U))&&(n+=R.charAt(U),(U+=1)!==$););return"TK_DOT"===t.type||"TK_RESERVED"===t.type&&q(t.text,["set","get"])||!q(n,H)?[n,"TK_WORD"]:"in"===n?[n,"TK_OPERATOR"]:[n,"TK_RESERVED"]}if("("===n||"["===n)return[n,"TK_START_EXPR"];if(")"===n||"]"===n)return[n,"TK_END_EXPR"];if("{"===n)return[n,"TK_START_BLOCK"];if("}"===n)return[n,"TK_END_BLOCK"];if(" "===n)return[n,"TK_SEMICOLON"];if("/"===n){var s="";if("*"===R.charAt(U)){U+=1,z.lastIndex=U;var l=z.exec(R);s="/*".concat(l[0]),U+=l[0].length;var c=function k(e){if(!e.match(W))return null;var t={};G.lastIndex=0;for(var a=G.exec(e);a;)t[a[1]]=a[2],a=G.exec(e);return t}(s);return c&&"start"===c.ignore&&(V.lastIndex=U,s+=(l=V.exec(R))[0],U+=l[0].length),[s=s.replace(j.lineBreak,"\n"),"TK_BLOCK_COMMENT",c]}if("/"===R.charAt(U)){U+=1,K.lastIndex=U;var d=K.exec(R);return s="//".concat(d[0]),U+=d[0].length,[s,"TK_COMMENT"]}}if("`"===n||"'"===n||'"'===n||("/"===n||L.e4x&&"<"===n&&R.slice(U-1).match(/^<([-a-zA-Z:0-9_.]+|{[^{}]*}|!\[CDATA\[[\s\S]*?\]\])(\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{.*?}))*\s*(\/?)\s*>/))&&("TK_RESERVED"===t.type&&q(t.text,["return","case","throw","else","do","typeof","yield"])||"TK_END_EXPR"===t.type&&")"===t.text&&t.parent&&"TK_RESERVED"===t.parent.type&&q(t.parent.text,["if","while","for"])||q(t.type,["TK_COMMENT","TK_START_EXPR","TK_START_BLOCK","TK_END_BLOCK","TK_OPERATOR","TK_EQUALS","TK_EOF","TK_SEMICOLON","TK_COMMA"]))){var f=n,p=!1,u=!1;if(e=n,"/"===f)for(var g=!1;U<$&&(p||g||R.charAt(U)!==f)&&!j.newline.test(R.charAt(U));)e+=R.charAt(U),p?p=!1:(p="\\"===R.charAt(U),"["===R.charAt(U)?g=!0:"]"===R.charAt(U)&&(g=!1)),U+=1;else if(L.e4x&&"<"===f){var h=/<(\/?)([-a-zA-Z:0-9_.]+|{[^{}]*}|!\[CDATA\[[\s\S]*?\]\])(\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{.*?}))*\s*(\/?)\s*>/g,m=R.slice(U-1),v=h.exec(m);if(v&&0===v.index){for(var b=v[2],E=0;v;){var _=!!v[1],w=v[2],y=!!v[v.length-1]||"![CDATA["===w.slice(0,8);if(w!==b||y||(_?--E:++E),E<=0)break;v=h.exec(m)}var A=v?v.index+v[0].length:m.length;return m=m.slice(0,A),U+=A-1,[m=m.replace(j.lineBreak,"\n"),"TK_STRING"]}}else for(;U<$&&(p||R.charAt(U)!==f&&("`"===f||!j.newline.test(R.charAt(U))));)(p||"`"===f)&&j.newline.test(R.charAt(U))?("\r"===R.charAt(U)&&"\n"===R.charAt(U+1)&&(U+=1),e+="\n"):e+=R.charAt(U),p=p?("x"!==R.charAt(U)&&"u"!==R.charAt(U)||(u=!0),!1):"\\"===R.charAt(U),U+=1;if(u&&L.unescape_strings&&(e=function S(e){var t,a=!1,n="",r=0,i="",o=0;for(;a||r<e.length;)if(t=e.charAt(r),r++,a){if(a=!1,"x"===t)i=e.substr(r,2),r+=2;else{if("u"!==t){n+="\\".concat(t);continue}i=e.substr(r,4),r+=4}if(!i.match(/^[0123456789abcdefABCDEF]+$/))return e;if(0<=(o=parseInt(i,16))&&o<32){n+="x"===t?"\\x".concat(i):"\\u".concat(i);continue}if(34===o||39===o||92===o)n+="\\".concat(String.fromCharCode(o));else{if("x"===t&&126<o&&o<=255)return e;n+=String.fromCharCode(o)}}else"\\"===t?a=!0:n+=t;return n}(e)),U<$&&R.charAt(U)===f&&(e+=f,U+=1,"/"===f))for(;U<$&&j.isIdentifierStart(R.charCodeAt(U));)e+=R.charAt(U),U+=1;return[e,"TK_STRING"]}if("#"===n){if(0===B.length&&"!"===R.charAt(U)){for(e=n;U<$&&"\n"!==n;)e+=n=R.charAt(U),U+=1;return["".concat(X(e),"\n"),"TK_UNKNOWN"]}var C="#";if(U<$&&I.test(R.charAt(U))){for(;C+=n=R.charAt(U),(U+=1)<$&&"#"!==n&&"="!==n;);return"#"===n||("["===R.charAt(U)&&"]"===R.charAt(U+1)?(C+="[]",U+=2):"{"===R.charAt(U)&&"}"===R.charAt(U+1)&&(C+="{}",U+=2)),[C,"TK_WORD"]}}if("<"===n&&("?"===R.charAt(U)||"%"===R.charAt(U))){Y.lastIndex=U-1;var T=Y.exec(R);if(T)return n=T[0],U+=n.length-1,[n=n.replace(j.lineBreak,"\n"),"TK_STRING"]}if("<"===n&&"\x3c!--"===R.substring(U-1,U+3)){for(U+=3,n="\x3c!--";!j.newline.test(R.charAt(U))&&U<$;)n+=R.charAt(U),U++;return P=!0,[n,"TK_COMMENT"]}if("-"===n&&P&&"--\x3e"===R.substring(U-1,U+2))return P=!1,U+=2,["--\x3e","TK_COMMENT"];if("."===n)return[n,"TK_DOT"];if(q(n,M)){for(;U<$&&q(n+R.charAt(U),M)&&(n+=R.charAt(U),!($<=(U+=1))););return","===n?[n,"TK_COMMA"]:"="===n?[n,"TK_EQUALS"]:[n,"TK_OPERATOR"]}return[n,"TK_UNKNOWN"]}this.tokenize=function(){var e,t,a;$=R.length,U=0,P=!1,B=[];for(var n=null,r=[],i=[];!t||"TK_EOF"!==t.type;){for(a=o(),e=new J(a[1],a[0],D,N);"TK_COMMENT"===e.type||"TK_BLOCK_COMMENT"===e.type||"TK_UNKNOWN"===e.type;)"TK_BLOCK_COMMENT"===e.type&&(e.directives=a[2]),i.push(e),a=o(),e=new J(a[1],a[0],D,N);i.length&&(e.comments_before=i,i=[]),"TK_START_BLOCK"===e.type||"TK_START_EXPR"===e.type?(e.parent=t,r.push(n),n=e):("TK_END_BLOCK"===e.type||"TK_END_EXPR"===e.type)&&n&&("]"===e.text&&"["===n.text||")"===e.text&&"("===n.text||"}"===e.text&&"{"===n.text)&&(e.parent=n.parent,n=r.pop()),B.push(e),t=e}return B}}return{run:function I(e,t){function o(e){return e.replace(/\s+$/g,"")}var a,n,r,m,i,s,v,l,c,b,E,_,d,f;for((t=t||{}).wrap_line_length!==undefined&&0!==parseInt(t.wrap_line_length,10)||t.max_char===undefined||0===parseInt(t.max_char,10)||(t.wrap_line_length=t.max_char),n=t.indent_inner_html!==undefined&&t.indent_inner_html,r=t.indent_size===undefined?4:parseInt(t.indent_size,10),m=t.indent_char===undefined?" ":t.indent_char,s=t.brace_style===undefined?"collapse":t.brace_style,i=0===parseInt(t.wrap_line_length,10)?32786:parseInt(t.wrap_line_length||250,10),v=t.unformatted||["a","span","img","bdo","em","strong","dfn","code","samp","kbd","const","cite","abbr","acronym","q","sub","sup","tt","i","b","big","small","u","s","strike","font","ins","del","address","pre"],l=t.preserve_newlines===undefined||t.preserve_newlines,c=l?isNaN(parseInt(t.max_preserve_newlines,10))?32786:parseInt(t.max_preserve_newlines,10):0,b=t.indent_handlebars!==undefined&&t.indent_handlebars,E=t.wrap_attributes===undefined?"auto":t.wrap_attributes,_=t.wrap_attributes_indent_size===undefined?r:parseInt(t.wrap_attributes_indent_size,10)||r,d=t.end_with_newline!==undefined&&t.end_with_newline,f=Array.isArray(t.extra_liners)?t.extra_liners.concat():"string"==typeof t.extra_liners?t.extra_liners.split(","):"head,body,/html".split(","),t.indent_with_tabs&&(m="\t",r=1),(a=new function R(){return this.pos=0,this.token="",this.current_mode="CONTENT",this.tags={parent:"parent1",parentcount:1,parent1:""},this.tag_type="",this.token_text=this.last_token=this.last_text=this.token_type="",this.newlines=0,this.indent_content=n,this.Utils={whitespace:"\n\r\t ".split(""),single_token:"br,input,link,meta,source,!doctype,basefont,base,area,hr,wbr,param,img,isindex,embed".split(","),extra_liners:f,in_array:function(e,t){for(var a=0;a<t.length;a++)if(e===t[a])return!0;return!1}},this.is_whitespace=function(e){for(;0<e.length;e++)if(!this.Utils.in_array(e.charAt(0),this.Utils.whitespace))return!1;return!0},this.traverse_whitespace=function(){var e="";if(e=this.input.charAt(this.pos),this.Utils.in_array(e,this.Utils.whitespace)){for(this.newlines=0;this.Utils.in_array(e,this.Utils.whitespace);)l&&"\n"===e&&this.newlines<=c&&(this.newlines+=1),this.pos++,e=this.input.charAt(this.pos);return!0}return!1},this.space_or_wrap=function(e){this.line_char_count>=this.wrap_line_length?(this.print_newline(!1,e),this.print_indentation(e)):(this.line_char_count++,e.push(" "))},this.get_content=function(){for(var e="",t=[];"<"!=this.input.charAt(this.pos);){if(this.pos>=this.input.length)return t.length?t.join(""):["","TK_EOF"];if(this.traverse_whitespace())this.space_or_wrap(t);else{if(b){var a=this.input.substr(this.pos,3);if("{{#"===a||"{{/"===a)break;if("{{!"===a)return[this.get_tag(),"TK_TAG_HANDLEBARS_COMMENT"];if("{{"===this.input.substr(this.pos,2)&&"{{else}}"===this.get_tag(!0))break}e=this.input.charAt(this.pos),this.pos++,this.line_char_count++,t.push(e)}}return t.length?t.join(""):""},this.get_contents_to=function(e){if(this.pos===this.input.length)return["","TK_EOF"];var t="",a=new RegExp("</".concat(e,"\\s*>"),"igm");a.lastIndex=this.pos;var n=a.exec(this.input),r=n?n.index:this.input.length;return this.pos<r&&(t=this.input.substring(this.pos,r),this.pos=r),t},this.record_tag=function(e){this.tags["".concat(e,"count")]?this.tags["".concat(e,"count")]++:this.tags["".concat(e,"count")]=1,this.tags[e+this.tags["".concat(e,"count")]]=this.indent_level,this.tags[e+this.tags["".concat(e,"count")]+"parent"]=this.tags.parent,this.tags.parent=e+this.tags["".concat(e,"count")]},this.retrieve_tag=function(e){if(this.tags["".concat(e,"count")]){for(var t=this.tags.parent;t&&e+this.tags["".concat(e,"count")]!==t;)t=this.tags["".concat(t,"parent")];t&&(this.indent_level=this.tags[e+this.tags["".concat(e,"count")]],this.tags.parent=this.tags[t+"parent"]),delete this.tags[e+this.tags["".concat(e,"count")]+"parent"],delete this.tags[e+this.tags["".concat(e,"count")]],1===this.tags["".concat(e,"count")]?delete this.tags["".concat(e,"count")]:this.tags["".concat(e,"count")]--}},this.indent_to_tag=function(e){if(this.tags["".concat(e,"count")]){for(var t=this.tags.parent;t&&e+this.tags["".concat(e,"count")]!==t;)t=this.tags["".concat(t,"parent")];t&&(this.indent_level=this.tags[e+this.tags["".concat(e,"count")]])}},this.get_tag=function(e){var t,a,n="",r=[],i="",o=!1,s=!0,l=this.pos,c=this.line_char_count;e=e!==undefined&&e;do{if(this.pos>=this.input.length)return e&&(this.pos=l,this.line_char_count=c),r.length?r.join(""):["","TK_EOF"];if(n=this.input.charAt(this.pos),this.pos++,this.Utils.in_array(n,this.Utils.whitespace))o=!0;else{if("'"!==n&&'"'!==n||(n+=this.get_unformatted(n),o=!0),"="===n&&(o=!1),r.length&&"="!=r[r.length-1]&&">"!=n&&o){if(this.space_or_wrap(r),o=!1,!s&&"force"===E&&"/"!=n){this.print_newline(!0,r),this.print_indentation(r);for(var d=0;d<_;d++)r.push(m)}for(var f=0;f<r.length;f++)if(" "===r[f]){s=!1;break}}if(b&&"<"===a&&n+this.input.charAt(this.pos)==="{{"&&(n+=this.get_unformatted("}}"),r.length&&" "!=r[r.length-1]&&"<"!=r[r.length-1]&&(n=" ".concat(n)),o=!0),"<"!==n||a||(t=this.pos-1,a="<"),b&&!a&&2<=r.length&&"{"===r[r.length-1]&&"{"===r[r.length-2]&&(t="#"===n||"/"===n||"!"===n?this.pos-3:this.pos-2,a="{"),this.line_char_count++,r.push(n),r[1]&&("!"===r[1]||"?"===r[1]||"%"===r[1])){r=[this.get_comment(t)];break}if(b&&r[1]&&"{"===r[1]&&r[2]&&"!"===r[2]){r=[this.get_comment(t)];break}if(b&&"{"===a&&2<r.length&&"}"===r[r.length-2]&&"}"===r[r.length-1])break}}while(">"!=n);var p,u,g=r.join("");p=-1!=g.indexOf(" ")?g.indexOf(" "):"{"===g[0]?g.indexOf("}"):g.indexOf(">"),u="<"!==g[0]&&b?"#"===g[2]?3:2:1;var h=g.substring(u,p).toLowerCase();return"/"===g.charAt(g.length-2)||this.Utils.in_array(h,this.Utils.single_token)?e||(this.tag_type="SINGLE"):b&&"{"===g[0]&&"else"===h?e||(this.indent_to_tag("if"),this.tag_type="HANDLEBARS_ELSE",this.indent_content=!0,this.traverse_whitespace()):this.is_unformatted(h,v)?(i=this.get_unformatted("</".concat(h,">"),g),r.push(i),this.pos,this.tag_type="SINGLE"):"script"===h&&(-1===g.search("type")||-1<g.search("type")&&-1<g.search(/\b(text|application)\/(x-)?(javascript|ecmascript|jscript|livescript)/))?e||(this.record_tag(h),this.tag_type="SCRIPT"):"style"===h&&(-1===g.search("type")||-1<g.search("type")&&-1<g.search("text/css"))?e||(this.record_tag(h),this.tag_type="STYLE"):"!"===h.charAt(0)?e||(this.tag_type="SINGLE",this.traverse_whitespace()):e||("/"===h.charAt(0)?(this.retrieve_tag(h.substring(1)),this.tag_type="END"):(this.record_tag(h),"html"!=h.toLowerCase()&&(this.indent_content=!0),this.tag_type="START"),this.traverse_whitespace()&&this.space_or_wrap(r),this.Utils.in_array(h,this.Utils.extra_liners)&&(this.print_newline(!1,this.output),this.output.length&&"\n"!=this.output[this.output.length-2]&&this.print_newline(!0,this.output))),e&&(this.pos=l,this.line_char_count=c),r.join("")},this.get_comment=function(e){var t="",a=">",n=!1;this.pos=e;var r=this.input.charAt(this.pos);for(this.pos++;this.pos<=this.input.length&&((t+=r)[t.length-1]!==a[a.length-1]||-1==t.indexOf(a));)!n&&t.length<10&&(0===t.indexOf("<![if")?(a="<![endif]>",n=!0):0===t.indexOf("<![cdata[")?(a="]]>",n=!0):0===t.indexOf("<![")?(a="]>",n=!0):0===t.indexOf("\x3c!--")?(a="--\x3e",n=!0):0===t.indexOf("{{!")?(a="}}",n=!0):0===t.indexOf("<?")?(a="?>",n=!0):0===t.indexOf("<%")&&(a="%>",n=!0)),r=this.input.charAt(this.pos),this.pos++;return t},this.get_unformatted=function(e,t){if(t&&-1!=t.toLowerCase().indexOf(e))return"";var a="",n="",r=!0,i="";do{if(this.pos>=this.input.length)return n;if(a=this.input.charAt(this.pos),this.pos++,this.Utils.in_array(a,this.Utils.whitespace)){if(!r){this.line_char_count--;continue}if("\n"===a||"\r"===a){n+="\n",this.line_char_count=0;continue}}n+=a,(i+=a.toLowerCase()).length>e.length&&(i=i.substring(1)),this.line_char_count++,r=!0,b&&"{"===a&&n.length&&"{"===n[n.length-2]&&(n+=this.get_unformatted("}}"))}while(i!==e);return n},this.get_token=function(){var e;if("TK_TAG_SCRIPT"!==this.last_token&&"TK_TAG_STYLE"!==this.last_token)return"CONTENT"===this.current_mode?"string"!=typeof(e=this.get_content())?e:[e,"TK_CONTENT"]:"TAG"===this.current_mode?"string"!=typeof(e=this.get_tag())?e:[e,"TK_TAG_".concat(this.tag_type)]:void 0;var t=this.last_token.substr(7);return"string"!=typeof(e=this.get_contents_to(t))?e:[e,"TK_".concat(t)]},this.get_full_indent=function(e){return(e=this.indent_level+e||0)<1?"":new Array(e+1).join(this.indent_string)},this.is_unformatted=function(e,t){if(!this.Utils.in_array(e,t))return!1;if("a"!=e.toLowerCase()||!this.Utils.in_array("a",t))return!0;var a=(this.get_tag(!0)||"").match(/^\s*<\s*\/?([a