) => P} mapper + */ + constructor(parser, mapper) { + super(); + this.#parser = parser; + this.#mapper = mapper; + } + + /** + * @param {Context} context + * @param {Number} position + * @param {PathNode} path + * @returns {Result
}
+ */
+ parse(context, position, path) {
+ const result = this.#parser.parse(context, position, { parent: path, parser: this.#parser, index: 0 });
+ if (result.status) {
+ result.value = this.#mapper(result.value);
+ }
+ return result
+ }
+
+ /**
+ * @protected
+ * @param {Context} context
+ * @param {Number} indent
+ * @param {PathNode} path
+ */
+ doToString(context, indent, path) {
+ const childrenPath = { parent: path, parser: this.#parser, index: 0 };
+ if (this.isHighlighted(context, path)) {
+ context.highlighted = context.highlighted instanceof Parser ? this.#parser : childrenPath;
+ }
+ let result = this.#parser.toString(context, indent, childrenPath);
+ if (this.#parser instanceof RegExpParser) {
+ if (Object.values(RegExpParser.common).includes(this.#parser.regexp)) {
+ if (
+ this.#parser.regexp === RegExpParser.common.numberInteger
+ && this.#mapper === /** @type {(v: any) => BigInt} */(BigInt)
+ ) {
+ return "P.numberBigInteger"
+ }
+ return result
+ }
+ }
+ let serializedMapper = this.#mapper.toString();
+ if (serializedMapper.length > 60 || serializedMapper.includes("\n")) {
+ serializedMapper = "(...) => { ... }";
+ }
+ serializedMapper = ` -> map<${serializedMapper}>`;
+ result = Parser.appendBeforeHighlight(result, serializedMapper);
+ return result
+ }
+}
+
+/** @extends {RegExpParser255)throw new Error("Value specified to byte constructor ("+e+"=0x"+e.toString(16)+") is larger in value than a single byte.");var t=(e>15?"0x":"0x0")+e.toString(16);return n((function(i,n){var r=k(i,n);return r===e?E(n+1,r):S(n,t)}))},buffer:function(e){return p("buffer",e).map((function(e){return Buffer.from(e)}))},encodedString:function(e,t){return p("string",t).map((function(t){return t.toString(e)}))},uintBE:m,uint8BE:m(1),uint16BE:m(2),uint32BE:m(4),uintLE:g,uint8LE:g(1),uint16LE:g(2),uint32LE:g(4),intBE:b,int8BE:b(1),int16BE:b(2),int32BE:b(4),intLE:f,int8LE:f(1),int16LE:f(2),int32LE:f(4),floatBE:p("floatBE",4).map((function(e){return e.readFloatBE(0)})),floatLE:p("floatLE",4).map((function(e){return e.readFloatLE(0)})),doubleBE:p("doubleBE",8).map((function(e){return e.readDoubleBE(0)})),doubleLE:p("doubleLE",8).map((function(e){return e.readDoubleLE(0)}))},e.exports=n}]);var he=ue(ce.exports);const pe=he;class de{static grammar=this.createGrammar();static createGrammar(){return pe.fail("Unimplemented createGrammar() method in "+this.name)}}class me{static#n=new Map;static registerSerializer(e,t){me.#n.set(e,t)}static getSerializer(e){return me.#n.get(e)}}class ge{#r;get values(){return this.#r}constructor(...e){this.#r=e}}class be{static booleanConverter={fromAttribute:(e,t)=>{},toAttribute:(e,t)=>!0===e?"true":!1===e?"false":""};static sigmoid(e,t=1.7){return 1/(1+e/(1-e)**-t)}static sigmoidPositive(e,t=3.7,i=1.1){return 1-Math.exp(-((e/i)**t))}static clamp(e,t=-1/0,i=1/0){return Math.min(Math.max(e,t),i)}static getScale(e){const t=e.blueprint?.getScale()??getComputedStyle(e).getPropertyValue("--ueb-scale");return""!=t?parseFloat(t):1}static minDecimals(e,t=1,i=1e-8){const n=e*10**t;return Math.abs(n%1)>i?e.toString():e.toFixed(t)}static numberFromText(e=""){switch(e=e.toLowerCase()){case"zero":return 0;case"one":return 1;case"two":return 2;case"three":return 3;case"four":return 4;case"five":return 5;case"six":return 6;case"seven":return 7;case"eight":return 8;case"nine":return 9}}static roundDecimals(e,t=1){const i=10**t;return Math.round(e*i)/i}static printNumber(e){return e==Number.POSITIVE_INFINITY?"inf":e==Number.NEGATIVE_INFINITY?"-inf":be.minDecimals(e)}static printExponential(e){if(e==Number.POSITIVE_INFINITY)return"inf";if(e==Number.NEGATIVE_INFINITY)return"-inf";const t=Math.round(e);if(t>=1e3){const i=Math.floor(Math.log10(t));return`${Math.round(e/10**(i-2))/100}e+${i<10?"0":""}${i}`}return 0==Math.floor(e)?e.toString():this.roundDecimals(e,Math.max(0,3-Math.floor(e).toString().length)).toString()}static approximatelyEqual(e,t,i=1e-8){return!(Math.abs(e-t)>i)}static convertLocation(e,t,i=!1){const n=i?1:1/be.getScale(t),r=t.getBoundingClientRect();return[Math.round((e[0]-r.x)*n),Math.round((e[1]-r.y)*n)]}static isSerialized(e,t,i=e.constructor.attributes?.[t]){return i?.constructor===Object&&i.serialized}static objectGet(e,t,i=void 0){if(void 0!==e){if(!(t instanceof Array))throw new TypeError("UEBlueprint: Expected keys to be an array");return 0!=t.length&&t[0]in e&&void 0!==e[t[0]]?1==t.length?e[t[0]]:be.objectGet(e[t[0]],t.slice(1),i):i}}static objectSet(e,t,i,n=!1,r=Object){if(!(t instanceof Array))throw new TypeError("Expected keys to be an array.");if(1==t.length){if(n||t[0]in e||void 0===e[t[0]])return e[t[0]]=i,!0}else if(t.length>0)return!n||e[t[0]]instanceof Object||(e[t[0]]=new r),be.objectSet(e[t[0]],t.slice(1),i,n,r);return!1}static equals(e,t){return e?.equals&&t?.equals?e.equals(t):(e=be.sanitize(e),t=be.sanitize(t),e?.constructor===BigInt&&t?.constructor===Number?t=BigInt(t):e?.constructor===Number&&t?.constructor===BigInt&&(e=BigInt(e)),e===t||e instanceof Array&&t instanceof Array&&(e.length===t.length&&e.every(((e,i)=>be.equals(e,t[i])))))}static getType(e){return null===e?null:e?.constructor===Object&&e?.type instanceof Function?e.type:e?.constructor}static isValueOfType(e,t,i=!1){return t instanceof le&&(t=t.getTargetType()),i&&null===e||e instanceof t||e?.constructor===t}static sanitize(e,t=e?.constructor){if(t instanceof Array&&(t=t[0]),t instanceof oe)return e;if(t instanceof ge){let i=t.values.find((t=>be.isValueOfType(e,t,!1)));i||(i=t.values[0]),t=i}return t instanceof le?e instanceof le?e:be.sanitize(e,t.getTargetType()):(t&&!be.isValueOfType(e,t,!0)&&(e=t===BigInt?BigInt(e):new t(e)),(e instanceof Boolean||e instanceof Number||e instanceof String)&&(e=e.valueOf()),e)}static snapToGrid(e,t,i){return 1===i?[e,t]:[i*Math.floor(e/i),i*Math.floor(t/i)]}static mergeArrays(e=[],t=[]){let i=[];e=[...e],t=[...t];e:for(;;){for(let n=0;n
/g,"\n").replaceAll(/(\)/g,"")}static encodeHTMLWhitespace(e){return e.replaceAll(" "," ")}static capitalFirstLetter(e){return 0===e.length?e:e.charAt(0).toUpperCase()+e.slice(1)}static formatStringName(e=""){return e.replace(/^\s*b(?=[A-Z])/,"").replaceAll(se.nameRegexSpaceReplacement," ").trim().split(" ").map((e=>be.capitalFirstLetter(e))).join(" ")}static getIdFromReference(e){return e.replace(/(?:.+\.)?([^\.]+)$/,"$1").replaceAll(/(?<=[a-z\d])(?=[A-Z])|(?<=[a-zA-Z])(?=\d)|(?<=[A-Z]{2})(?=[A-Z][a-z])/g,"-").toLowerCase()}static getNameFromPath(e){return e.match(/[^\.\/]+$/)?.[0]??""}static printLinearColor(e){return`${Math.round(255*e.R.valueOf())}, ${Math.round(255*e.G.valueOf())}, ${Math.round(255*e.B.valueOf())}`}static getPolarCoordinates(e,t,i=!1){let n=Math.atan2(t,e);return i&&n<0&&(n=2*Math.PI+n),[Math.sqrt(e*e+t*t),n]}static getCartesianCoordinates(e,t){return[e*Math.cos(t),e*Math.sin(t)]}static range(e=0,t=0,i=(t>=e?1:-1)){return Array.from({length:Math.ceil((t-e)/i)},((t,n)=>e+n*i))}static paste(e,t){const i=new ClipboardEvent("paste",{bubbles:!0,cancelable:!0,clipboardData:new DataTransfer});i.clipboardData.setData("text",t),e.dispatchEvent(i)}static async copy(e){const t=new ClipboardEvent("copy",{bubbles:!0,cancelable:!0,clipboardData:new DataTransfer});e.dispatchEvent(t)}static animate(e,t,i,n,r=(e=>{}),s=(e=>{const t=e**3.5;return t/(t+(1-e)**3.5)})){let a;const o=l=>{void 0===a&&(a=l);let u=(l-a)/i;be.approximatelyEqual(u,1)||u>1?u=1:r(requestAnimationFrame(o));const c=e+(t-e)*s(u);n(c)};r(requestAnimationFrame(o))}}class fe extends de{static lookbehind="";static attributes={lookbehind:{ignored:!0}};static defaultAttribute={nullable:!1,ignored:!1,serialized:!1,expected:!1,inlined:!1,quoted:!1};constructor(e={},t=!1){super(),this.lookbehind;const i=this.constructor;let n=i.attributes;e.attributes&&(n={...i.attributes},be.mergeArrays(Object.keys(n),Object.keys(e.attributes)).forEach((t=>{n[t]={...fe.defaultAttribute,...n[t],...e.attributes[t]},n[t].type||(n[t].type=e[t]instanceof Array?[be.getType(e[t][0])]:be.getType(e[t]))})),fe.defineAttributes(this,n)),this.attributes;const r=Object.keys(e),s=Object.keys(n),a=be.mergeArrays(r,s);r.includes("lookbehind")&&(this.lookbehind=void 0);for(const r of a){if("attributes"==r)continue;let s=e[r],a=n[r];if(!t&&void 0!==s&&!(r in n)&&!r.startsWith(se.subObjectAttributeNamePrefix)){const e=s instanceof Array?`[${s[0]?.constructor.name}]`:s.constructor.name;console.warn(`UEBlueprint: Attribute ${r} (of type ${e}) in the serialized data is not defined in ${i.name}.attributes`)}if(!a){this[r]=s;continue}const o=a.predicate?e=>{Object.defineProperties(this,{["#"+r]:{writable:!0,enumerable:!1},[r]:{enumerable:!0,get(){return this["#"+r]},set(e){a.predicate?.(e)?this["#"+r]=e:console.warn(`UEBlueprint: Tried to assign attribute ${r} to ${i.name} not satisfying the predicate`)}}}),this[r]=e}:e=>this[r]=e;let l=a.default;l instanceof Function&&(l=l(this));let u=a.type;u instanceof oe&&(u=u.compute(this)),u instanceof Array&&(u=Array),void 0===u&&(u=be.getType(l)),void 0===s?Object.hasOwn(a,"default")&&o(l):(s?.constructor===String&&a.serialized&&u!==String&&(s=me.getSerializer(u).read(s)),o(be.sanitize(s,u)))}}static defaultValueProviderFromType(e){return e!==Boolean&&(e===Number?0:e===BigInt?0n:e===String?"":e===Array||e instanceof Array?()=>[]:e instanceof ge?this.defaultValueProviderFromType(e.values[0]):e instanceof le?()=>new le(e.type,e.key,e.getter):e instanceof oe?void 0:()=>new e)}static cleanupAttributes(e,t=""){for(const i in e){e[i]={...fe.defaultAttribute,...e[i]};const n=e[i];if(void 0!==n.type||n.default instanceof Function||(n.type=n.default instanceof Array?[be.getType(n.default[0])]:be.getType(n.default)),!n.ignored&&void 0===n.default&&void 0===n.type)throw new Error(`UEBlueprint: Expected either "type" or "value" property in ${this.name} attribute ${t}`+i);null===n.default&&(n.nullable=!0)}}static isValueOfType(e,t){return null!=e&&(e instanceof t||e.constructor===t)}static expectsAllKeys(){return!Object.values(this.attributes).filter((e=>!e.ignored)).some((e=>!e.expected))}static getAttribute(e,t){return this.getAttributes(e)[t]}static getAttributes(e){return e.attributes??e.constructor?.attributes??{}}static defineAttributes(e,t){Object.defineProperty(e,"attributes",{writable:!0,configurable:!1}),e.attributes=t}getLookbehind(){let e=this.lookbehind??this.constructor.lookbehind;return e=e instanceof ge?e.values[0]:e,e}unexpectedKeys(){return Object.keys(this).length-Object.keys(this.constructor.attributes).length}equals(e){const t=Object.keys(this),i=Object.keys(e);if(t.length!=i.length)return!1;for(const i of t){if(this[i]instanceof fe&&!this[i].equals(e[i]))return!1;if(!be.equals(this[i],e[i]))return!1}return!0}}let ve=he;class ye{static separatedBy=(e,t,i=1)=>new RegExp(e+"(?:"+t+e+")"+(1===i?"*":2===i?"+":`{${i},}`));static Regex=class{static ByteInteger=/0*(?:25[0-5]|2[0-4]\d|1?\d?\d)(?!\d|\.)/;static HexDigit=/[0-9a-fA-F]/;static InlineOptWhitespace=/[^\S\n]*/;static InlineWhitespace=/[^\S\n]+/;static InsideString=/(?:[^"\\]|\\.)*/;static InsideSingleQuotedString=/(?:[^'\\]|\\.)*/;static Integer=/[\-\+]?\d+(?!\d|\.)/;static MultilineWhitespace=/\s*\n\s*/;static Number=/[-\+]?(?:\d*\.)?\d+(?!\d|\.)/;static RealUnit=/\+?(?:0(?:\.\d+)?|1(?:\.0+)?)(?![\.\d])/;static Word=ye.separatedBy("[a-zA-Z]","_");static Symbol=/[a-zA-Z_]\w*/;static DotSeparatedSymbols=ye.separatedBy(this.Symbol.source,"\\.");static PathFragment=ye.separatedBy(this.Symbol.source,"[\\.:]");static PathSpaceFragment=ye.separatedBy(this.Symbol.source,"[\\.:\\ ]");static Path=new RegExp(`(?:\\/${this.PathFragment.source}){2,}`)};static null=ve.lazy((()=>ve.regex(/\(\s*\)/).map((()=>null))));static true=ve.lazy((()=>ve.regex(/true/i).map((()=>!0))));static false=ve.lazy((()=>ve.regex(/false/i).map((()=>!1))));static boolean=ve.lazy((()=>ye.regexMap(/(true)|false/i,(e=>!!e[1]))));static number=ve.lazy((()=>this.regexMap(new RegExp(`(${ye.Regex.Number.source})|(\\+?inf)|(-inf)`),(e=>void 0!==e[2]?Number.POSITIVE_INFINITY:void 0!==e[3]?Number.NEGATIVE_INFINITY:Number(e[1])))));static integer=ve.lazy((()=>ve.regex(ye.Regex.Integer).map(Number)));static bigInt=ve.lazy((()=>ve.regex(ye.Regex.Integer).map(BigInt)));static realUnit=ve.lazy((()=>ve.regex(ye.Regex.RealUnit).map(Number)));static naturalNumber=ve.lazy((()=>ve.regex(/\d+/).map(Number)));static byteNumber=ve.lazy((()=>ve.regex(ye.Regex.ByteInteger).map(Number)));static string=ve.lazy((()=>ye.regexMap(new RegExp(`"(${ye.Regex.InsideString.source})"`),(([e,t])=>t)).map((e=>be.unescapeString(e)))));static colorValue=this.byteNumber;static word=ve.regex(ye.Regex.Word);static pathQuotes=ye.regexMap(new RegExp("'\"("+ye.Regex.InsideString.source+")\"'|'("+ye.Regex.InsideSingleQuotedString.source+")'|\"("+ye.Regex.InsideString.source+')"'),(([e,t,i,n])=>t??i??n));static path=ye.regexMap(new RegExp("'\"("+ye.Regex.InsideString.source+")\"'|'("+ye.Regex.InsideSingleQuotedString.source+")'|\"("+ye.Regex.InsideString.source+')"|('+ye.Regex.Path.source+")"),(([e,t,i,n,r])=>t??i??n??r));static symbol=ve.regex(ye.Regex.Symbol);static symbolQuoted=ye.regexMap(new RegExp('"('+ye.Regex.Symbol.source+')"'),(([e,t])=>t));static attributeName=ve.regex(ye.Regex.DotSeparatedSymbols);static attributeNameQuoted=ye.regexMap(new RegExp('"('+ye.Regex.DotSeparatedSymbols.source+')"'),(([e,t])=>t));static guid=ve.regex(new RegExp(`${ye.Regex.HexDigit.source}{32}`));static commaSeparation=ve.regex(/\s*,\s*(?!\))/);static commaOrSpaceSeparation=ve.regex(/\s*,\s*(?!\))|\s+/);static equalSeparation=ve.regex(/\s*=\s*/);static typeReference=ve.alt(ve.regex(ye.Regex.Path),this.symbol);static hexColorChannel=ve.regex(new RegExp(ye.Regex.HexDigit.source+"{2}"));static regexMap(e,t){const i=RegExp("^(?:"+e.source+")",e.flags),n=""+e;return ve(((e,r)=>{const s=i.exec(e.slice(r));return s?ve.makeSuccess(r+s[0].length,t(s)):ve.makeFailure(r,n)}))}static grammarFor(e,t=(e?.constructor===Object?e.type:e?.constructor),i=this.unknownValue){let n=i;if(t instanceof Array){if(e?.inlined)return this.grammarFor(void 0,t[0]);n=ve.seq(ve.regex(/\(\s*/),this.grammarFor(void 0,t[0]).sepBy(this.commaSeparation),ve.regex(/\s*(?:,\s*)?\)/)).map((([e,t,i])=>t))}else if(t instanceof ge)n=t.values.map((e=>this.grammarFor(void 0,e))).reduce(((e,t)=>t&&t!==this.unknownValue&&e!==this.unknownValue?ve.alt(e,t):this.unknownValue));else{if(t instanceof le)return this.grammarFor(t.getTargetType()).map((()=>new le(t.type,t.getter)));if(e?.constructor===Object)n=this.grammarFor(void 0,t);else switch(t){case BigInt:n=this.bigInt;break;case Boolean:n=this.boolean;break;case Number:n=this.number;break;case String:n=this.string;break;default:if(t?.prototype instanceof de)return t.grammar}}return e?.constructor===Object&&(e.serialized&&t.constructor!==String&&(n=n==this.unknownValue?this.string:ve.seq(ve.string('"'),n,ve.string('"'))),e.nullable&&(n=ve.alt(n,this.null))),n}static getAttribute(e,t){let i,n;if(e instanceof ge)for(let n of e.values)if(i=this.getAttribute(n,t))return i;return e instanceof fe.constructor?(i=e.attributes[t[0]],n=i?.type):e instanceof Array&&(i=e[t[0]],n=i),t.length>1?this.getAttribute(n,t.slice(1)):i}static createAttributeGrammar(e,t=this.attributeName,i=this.equalSeparation,n=((e,t,i)=>{})){return ve.seq(t,i).chain((([t,i])=>{const r=t.split(se.keysSeparator),s=this.getAttribute(e,r);return this.grammarFor(s).map((e=>t=>{n(t,r,e),be.objectSet(t,r,e,!0)}))}))}static createEntityGrammar=(e,t=!0,i=this.commaSeparation)=>ve.seq(this.regexMap(e.lookbehind instanceof ge?new RegExp(`(${e.lookbehind.values.reduce(((e,t)=>e+"|"+t))})\\s*\\(\\s*`):e.lookbehind.constructor==String&&e.lookbehind.length?new RegExp(`(${e.lookbehind})\\s*\\(\\s*`):/()\(\s*/,(e=>e[1])),this.createAttributeGrammar(e).sepBy1(i),ve.regex(/\s*(?:,\s*)?\)/)).map((([e,t,i])=>{let n={};return t.forEach((e=>e(n))),e.length&&(n.lookbehind=e),n})).chain((i=>{let n,r=Object.keys(i);if(Object.keys(e.attributes).filter((t=>e.attributes[t].expected)).find((e=>!r.includes(e)&&(n=e))))return ve.fail("Missing key "+n);const s=Object.keys(i).filter((t=>!(t in e.attributes))).length;return!t&&s>0?ve.fail("Too many unknown keys"):ve.succeed(new e(i))}));static unknownValue}class we extends fe{static attributes={...super.attributes,value:{default:""}};static{this.cleanupAttributes(this.attributes)}static grammar=this.createGrammar();static createGrammar(){return ye.guid.map((e=>new this(e)))}static generateGuid(e=!0){let t=new Uint32Array(4);!0===e&&crypto.getRandomValues(t);let i="";return t.forEach((e=>{i+=("0".repeat(8)+e.toString(16).toUpperCase()).slice(-8)})),new we({value:i})}constructor(e){e||(e=we.generateGuid().value),e.constructor!==Object&&(e={value:e}),super(e),this.value}valueOf(){return this.value}toString(){return this.value}}class Ee extends fe{static attributes={...super.attributes,type:{default:""},path:{default:""}};static{this.cleanupAttributes(this.attributes)}static noneReferenceGrammar=he.string("None").map((()=>this.createNoneInstance()));static fullReferenceGrammar=he.seq(ye.typeReference,he.regex(ye.Regex.InlineOptWhitespace),ye.pathQuotes).map((([e,t,i])=>new this({type:e,path:i})));static typeReferenceGrammar=ye.typeReference.map((e=>new this({type:e,path:""})));static pathReferenceGrammar=ye.path.map((e=>new this({type:"",path:e})));static grammar=this.createGrammar();static createGrammar(){return he.alt(this.noneReferenceGrammar,this.fullReferenceGrammar,this.typeReferenceGrammar,this.pathReferenceGrammar)}constructor(e={}){e.constructor===String&&(e={path:e}),super(e),this.type,this.path}static createNoneInstance(){return new Ee({type:"None",path:""})}sanitize(){if(this.type&&!this.type.startsWith("/")){let e=this.type+"_Deprecated",t=Object.keys(se.paths).find((t=>{const i=be.getNameFromPath(se.paths[t]);return i===this.type||i===e}));t&&(this.type=se.paths[t])}}getName(){return be.getNameFromPath(this.path.replace(/_C$/,""))}toString(){return`${this.type}'"${this.path}"'`}}class Se extends fe{static attributes={...super.attributes,MemberParent:{type:Ee},MemberName:{type:String},MemberGuid:{type:we}};static{this.cleanupAttributes(this.attributes)}static grammar=this.createGrammar();static createGrammar(){return ye.createEntityGrammar(this)}constructor(e){super(e),this.MemberParent,this.MemberName,this.MemberGuid}}class Ce extends fe{static attributes={...super.attributes,value:{default:""}};static{this.cleanupAttributes(this.attributes)}static attributeConverter={fromAttribute:(e,t)=>new Ce(e),toAttribute:(e,t)=>e.toString()};static grammar=this.createGrammar();static createGrammar(){return ye.symbol.map((e=>new this(e)))}constructor(e){e.constructor!==Object&&(e={value:e}),super(e),this.value}valueOf(){return this.value}toString(){return this.value}}class xe extends fe{static attributes={...super.attributes,value:{default:0,predicate:e=>e%1==0&&e>1<<31&&e<-(1<<31)}};static{this.cleanupAttributes(this.attributes)}static grammar=this.createGrammar();static createGrammar(){return ye.integer.map((e=>new this(e)))}constructor(e=0){super(e.constructor===Object?e:{value:e}),this.value}valueOf(){return this.value}toString(){return this.value.toString()}}class Pe extends fe{static attributes={...super.attributes,value:{default:0}};static{this.cleanupAttributes(this.attributes)}static grammar=this.createGrammar();static createGrammar(){return ye.number.map((e=>new this(e)))}constructor(e=0){e.constructor!==Object&&(e={value:e}),super(e),this.value}valueOf(){return this.value}toString(){return this.value.toFixed(6)}}class Ne extends fe{static attributes={...super.attributes,R:{type:Pe,default:()=>new Pe,expected:!0},G:{type:Pe,default:()=>new Pe,expected:!0},B:{type:Pe,default:()=>new Pe,expected:!0},A:{type:Pe,default:()=>new Pe(1)},H:{type:Pe,default:()=>new Pe,ignored:!0},S:{type:Pe,default:()=>new Pe,ignored:!0},V:{type:Pe,default:()=>new Pe,ignored:!0}};static{this.cleanupAttributes(this.attributes)}static grammar=this.createGrammar();static linearToSRGB(e){return e<=0?0:e>=1?1:e<.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055}static sRGBtoLinear(e){return e<=0?0:e>=1?1:e<.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}static getWhite(){return new Ne({R:1,G:1,B:1})}static createGrammar(){return ye.createEntityGrammar(this,!1)}static getLinearColorFromHexGrammar(){return ye.regexMap(new RegExp(`#(${ye.Regex.HexDigit.source}{2})(${ye.Regex.HexDigit.source}{2})(${ye.Regex.HexDigit.source}{2})(${ye.Regex.HexDigit.source}{2})?`),(e=>[e[1],e[2],e[3],e[4]??"FF"])).map((([e,t,i,n])=>new this({R:parseInt(e,16)/255,G:parseInt(t,16)/255,B:parseInt(i,16)/255,A:parseInt(n,16)/255})))}static getLinearColorRGBListGrammar(){return he.seq(ye.byteNumber,ye.commaSeparation,ye.byteNumber,ye.commaSeparation,ye.byteNumber).map((([e,t,i,n,r])=>new this({R:e/255,G:i/255,B:r/255,A:1})))}static getLinearColorRGBGrammar(){return he.seq(he.regex(/rgb\s*\(\s*/),this.getLinearColorRGBListGrammar(),he.regex(/\s*\)/)).map((([e,t,i])=>t))}static getLinearColorRGBAGrammar(){return he.seq(he.regex(/rgba\s*\(\s*/),this.getLinearColorRGBListGrammar(),he.regex(/\s*\)/)).map((([e,t,i])=>t))}static getLinearColorFromAnyFormat(){return he.alt(this.getLinearColorFromHexGrammar(),this.getLinearColorRGBAGrammar(),this.getLinearColorRGBGrammar(),this.getLinearColorRGBListGrammar())}constructor(e){e instanceof Array&&(e={R:e[0]??0,G:e[1]??0,B:e[2]??0,A:e[3]??1}),super(e),this.R,this.G,this.B,this.A,this.H,this.S,this.V,this.#s()}#s(){const e=this.R.value,t=this.G.value,i=this.B.value;if(be.approximatelyEqual(e,t)&&be.approximatelyEqual(e,i)&&be.approximatelyEqual(t,i))return this.S.value=0,void(this.V.value=e);const n=Math.max(e,t,i),r=Math.min(e,t,i),s=n-r;let a;switch(n){case r:a=0;break;case e:a=(t-i)/s+(te.toString(16).toUpperCase().padStart(2,"0"))).join("")}toSRGBAString(){return this.toSRGBA().map((e=>e.toString(16).toUpperCase().padStart(2,"0"))).join("")}toHSVA(){return[this.H.value,this.S.value,this.V.value,this.A.value]}toNumber(){return(Math.round(255*this.R.value)<<24)+(Math.round(255*this.G.value)<<16)+(Math.round(255*this.B.value)<<8)+Math.round(255*this.A.value)}setFromRGBANumber(e){this.A.value=(255&e)/255,this.B.value=(e>>8&255)/255,this.G.value=(e>>16&255)/255,this.R.value=(e>>24&255)/255,this.#s()}setFromSRGBANumber(e){this.A.value=(255&e)/255,this.B.value=Ne.sRGBtoLinear((e>>8&255)/255),this.G.value=Ne.sRGBtoLinear((e>>16&255)/255),this.R.value=Ne.sRGBtoLinear((e>>24&255)/255),this.#s()}toString(){return be.printLinearColor(this)}}class ke extends fe{static attributes={...super.attributes,MacroGraph:{type:Ee,default:()=>new Ee},GraphBlueprint:{type:Ee,default:()=>new Ee},GraphGuid:{type:we,default:()=>new we}};static{this.cleanupAttributes(this.attributes)}static grammar=this.createGrammar();static createGrammar(){return ye.createEntityGrammar(this)}constructor(e){super(e),this.MacroGraph,this.GraphBlueprint,this.GuidEntity}getMacroName(){const e=this.MacroGraph.path.search(":");return this.MacroGraph.path.substring(e+1)}}class Le extends xe{static attributes={...super.attributes,value:{...super.attributes.value,predicate:e=>e%1==0&&e>=0&&e<256}};static{this.cleanupAttributes(this.attributes)}static grammar=this.createGrammar();static createGrammar(){return ye.byteNumber.map((e=>new this(e)))}constructor(e=0){super(e)}}class Ae extends fe{static attributes={...super.attributes,value:{default:""}};static{this.cleanupAttributes(this.attributes)}static grammar=this.createGrammar();static createGrammar(){return ye.symbol.map((e=>new this(e)))}constructor(e){e.constructor!==Object&&(e={value:e}),super(e),this.value}valueOf(){return this.value}toString(){return this.value}}class Me extends Ae{static grammar=this.createGrammar();static createGrammar(){return ye.symbol.map((e=>new this(e)))}}class Te extends Me{static grammar=this.createGrammar();static createGrammar(){return he.regex(ye.Regex.InsideString).map((e=>new this(e)))}}class Be extends fe{static lookbehind="INVTEXT";static attributes={...super.attributes,value:{default:""}};static{this.cleanupAttributes(this.attributes)}static grammar=this.createGrammar();static createGrammar(){return he.alt(he.seq(he.regex(new RegExp(`${this.lookbehind}\\s*\\(`)),ye.grammarFor(this.attributes.value),he.regex(/\s*\)/)).map((([e,t,i])=>t)),he.regex(new RegExp(this.lookbehind)).map((()=>""))).map((e=>new this(e)))}constructor(e){e.constructor!==Object&&(e={value:e}),super(e),this.value}}class Ie extends fe{static lookbehind="NSLOCTEXT";static attributes={...super.attributes,namespace:{default:""},key:{default:""},value:{default:""}};static{this.cleanupAttributes(this.attributes)}static grammar=this.createGrammar();static createGrammar(){return ye.regexMap(new RegExp(String.raw`${this.lookbehind}\s*\(`+String.raw`\s*"(${ye.Regex.InsideString.source})"\s*,`+String.raw`\s*"(${ye.Regex.InsideString.source})"\s*,`+String.raw`\s*"(${ye.Regex.InsideString.source})"\s*`+String.raw`(?:,\s+)?`+String.raw`\)`,"m"),(e=>new this({namespace:be.unescapeString(e[1]),key:be.unescapeString(e[2]),value:be.unescapeString(e[3])})))}constructor(e){super(e),this.namespace,this.key,this.value}toString(){return be.capitalFirstLetter(this.value)}}class $e extends fe{static lookbehind=new ge("LOCGEN_FORMAT_NAMED","LOCGEN_FORMAT_ORDERED");static attributes={...super.attributes,value:{type:[new ge(String,Ie,Be,$e)],default:[]}};static{this.cleanupAttributes(this.attributes)}static grammar=this.createGrammar();static createGrammar(){return he.lazy((()=>he.seq(ye.regexMap(new RegExp(`(${this.lookbehind.values.reduce(((e,t)=>e+"|"+t))})\\s*`),(e=>e[1])),ye.grammarFor(this.attributes.value)).map((([e,t])=>{const i=new this({value:t});return i.lookbehind=e,i}))))}constructor(e){super(e),this.value}toString(){const e=this.value?.[0]?.toString();if(!e)return"";const t=this.value.slice(1).map((e=>e.toString()));return"LOCGEN_FORMAT_NAMED"==this.lookbehind?e.replaceAll(/\{([a-zA-Z]\w*)\}/g,((e,i)=>{const n=t.indexOf(i)+1;return n>0&&n0&&(u="..."+u,c+=3),s[1]
/g,"\n").replaceAll(/(\)/g,"")}static encodeHTMLWhitespace(e){return e.replaceAll(" "," ")}static capitalFirstLetter(e){return 0===e.length?e:e.charAt(0).toUpperCase()+e.slice(1)}static formatStringName(e=""){return e.replace(/^\s*b(?=[A-Z])/,"").replaceAll(ne.nameRegexSpaceReplacement," ").trim().split(" ").map((e=>Ae.capitalFirstLetter(e))).join(" ")}static getIdFromReference(e){return e.replace(/(?:.+\.)?([^\.]+)$/,"$1").replaceAll(/(?<=[a-z\d])(?=[A-Z])|(?<=[a-zA-Z])(?=\d)|(?<=[A-Z]{2})(?=[A-Z][a-z])/g,"-").toLowerCase()}static getNameFromPath(e){return e.match(/[^\.\/]+$/)?.[0]??""}static printLinearColor(e){return`${Math.round(255*e.R.valueOf())}, ${Math.round(255*e.G.valueOf())}, ${Math.round(255*e.B.valueOf())}`}static getPolarCoordinates(e,t,i=!1){let s=Math.atan2(t,e);return i&&s<0&&(s=2*Math.PI+s),[Math.sqrt(e*e+t*t),s]}static getCartesianCoordinates(e,t){return[e*Math.cos(t),e*Math.sin(t)]}static range(e=0,t=0,i=(t>=e?1:-1)){return Array.from({length:Math.ceil((t-e)/i)},((t,s)=>e+s*i))}static paste(e,t){const i=new ClipboardEvent("paste",{bubbles:!0,cancelable:!0,clipboardData:new DataTransfer});i.clipboardData.setData("text",t),e.dispatchEvent(i)}static async copy(e){const t=new ClipboardEvent("copy",{bubbles:!0,cancelable:!0,clipboardData:new DataTransfer});e.dispatchEvent(t)}static animate(e,t,i,s,r=(e=>{}),n=(e=>{const t=e**3.5;return t/(t+(1-e)**3.5)})){let a;const o=l=>{void 0===a&&(a=l);let c=(l-a)/i;Ae.approximatelyEqual(c,1)||c>1?c=1:r(requestAnimationFrame(o));const u=e+(t-e)*n(c);s(u)};r(requestAnimationFrame(o))}}class Le extends xe{static lookbehind="";static attributes={lookbehind:{ignored:!0}};static defaultAttribute={nullable:!1,ignored:!1,serialized:!1,expected:!1,inlined:!1,quoted:!1};constructor(e={},t=!1){super(),this.lookbehind;const i=this.constructor;let s=i.attributes;e.attributes&&(s={...i.attributes},Ae.mergeArrays(Object.keys(e.attributes),Object.keys(s)).forEach((t=>{s[t]={...Le.defaultAttribute,...s[t],...e.attributes[t]},s[t].type||(s[t].type=e[t]instanceof Array?[Ae.getType(e[t][0])]:Ae.getType(e[t]))})),Le.defineAttributes(this,s)),this.attributes;const r=Object.keys(e),n=Object.keys(s),a=Ae.mergeArrays(r,n);r.includes("lookbehind")&&(this.lookbehind=void 0);for(const r of a){if("attributes"==r)continue;let n=e[r],a=s[r];if(!t&&void 0!==n&&!(r in s)&&!r.startsWith(ne.subObjectAttributeNamePrefix)){const e=n instanceof Array?`[${n[0]?.constructor.name}]`:n.constructor.name;console.warn(`UEBlueprint: Attribute ${r} (of type ${e}) in the serialized data is not defined in ${i.name}.attributes`)}if(!a){this[r]=n;continue}const o=a.predicate?e=>{Object.defineProperties(this,{["#"+r]:{writable:!0,enumerable:!1},[r]:{enumerable:!0,get(){return this["#"+r]},set(e){a.predicate?.(e)?this["#"+r]=e:console.warn(`UEBlueprint: Tried to assign attribute ${r} to ${i.name} not satisfying the predicate`)}}}),this[r]=e}:e=>this[r]=e;let l=a.default;l instanceof Function&&(l=l(this));let c=a.type;c instanceof oe&&(c=c.compute(this)),c instanceof Array&&(c=Array),void 0===c&&(c=Ae.getType(l)),void 0===n?Object.hasOwn(a,"default")&&o(l):(n?.constructor===String&&a.serialized&&c!==String&&(n=Ne.getSerializer(c).read(n)),o(Ae.sanitize(n,c)))}}static defaultValueProviderFromType(e){return e!==Boolean&&(e===Number?0:e===BigInt?0n:e===String?"":e===Array||e instanceof Array?()=>[]:e instanceof ke?this.defaultValueProviderFromType(e.values[0]):e instanceof le?()=>new le(e.type,e.getter):e instanceof oe?void 0:()=>new e)}static cleanupAttributes(e,t=""){for(const i in e){e[i]={...Le.defaultAttribute,...e[i]};const s=e[i];if(void 0!==s.type||s.default instanceof Function||(s.type=s.default instanceof Array?[Ae.getType(s.default[0])]:Ae.getType(s.default)),!s.ignored&&void 0===s.default&&void 0===s.type)throw new Error(`UEBlueprint: Expected either "type" or "value" property in ${this.name} attribute ${t}`+i);null===s.default&&(s.nullable=!0)}}static isValueOfType(e,t){return null!=e&&(e instanceof t||e.constructor===t)}static expectsAllKeys(){return!Object.values(this.attributes).filter((e=>!e.ignored)).some((e=>!e.expected))}static getAttribute(e,t){return this.getAttributes(e)[t]}static getAttributes(e){return e.attributes??e.constructor?.attributes??{}}static defineAttributes(e,t){Object.defineProperty(e,"attributes",{writable:!0,configurable:!1}),e.attributes=t}getLookbehind(){let e=this.lookbehind??this.constructor.lookbehind;return e=e instanceof ke?e.values[0]:e,e}unexpectedKeys(){return Object.keys(this).length-Object.keys(this.constructor.attributes).length}equals(e){const t=Object.keys(this),i=Object.keys(e);if(t.length!=i.length)return!1;for(const i of t){if(this[i]instanceof Le&&!this[i].equals(e[i]))return!1;if(!Ae.equals(this[i],e[i]))return!1}return!0}}class Me{static separatedBy=(e,t,i=1)=>new RegExp(e+"(?:"+t+e+")"+(1===i?"*":2===i?"+":`{${i},}`));static Regex=class{static HexDigit=/[0-9a-fA-F]/;static InsideString=/(?:[^"\\]|\\.)*/;static InsideSingleQuotedString=/(?:[^'\\]|\\.)*/;static Integer=/[\-\+]?\d+(?!\d|\.)/;static Number=/[-\+]?(?:\d*\.)?\d+(?!\d|\.)/;static RealUnit=/\+?(?:0(?:\.\d+)?|1(?:\.0+)?)(?![\.\d])/;static Word=Me.separatedBy("[a-zA-Z]","_");static Symbol=/[a-zA-Z_]\w*/;static DotSeparatedSymbols=Me.separatedBy(this.Symbol.source,"\\.");static PathFragment=Me.separatedBy(this.Symbol.source,"[\\.:]");static PathSpaceFragment=Me.separatedBy(this.Symbol.source,"[\\.:\\ ]");static Path=new RegExp(`(?:\\/${this.PathFragment.source}){2,}`)};static null=Pe.reg(/\(\s*\)/).map((()=>null));static true=Pe.reg(/true/i).map((()=>!0));static false=Pe.reg(/false/i).map((()=>!1));static boolean=Pe.regArray(/(true)|false/i).map((e=>!!e[1]));static number=Pe.regArray(new RegExp(`(${Pe.number.getParser().parser.regexp.source})|(\\+?inf)|(-inf)`)).map((([e,t,i,s])=>t?Number(t):i?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY));static bigInt=Pe.reg(new RegExp(Pe.number.getParser().parser.regexp.source)).map(BigInt).map((e=>void 0!==e[2]?Number.POSITIVE_INFINITY:void 0!==e[3]?Number.NEGATIVE_INFINITY:Number(e[1])));static naturalNumber=Pe.lazy((()=>Pe.reg(/\d+/).map(Number)));static string=Pe.doubleQuotedString.map((e=>Ae.unescapeString(e)));static colorValue=Pe.numberByte;static word=Pe.reg(Me.Regex.Word);static pathQuotes=Pe.regArray(new RegExp("'\"("+Me.Regex.InsideString.source+")\"'|'("+Me.Regex.InsideSingleQuotedString.source+")'|\"("+Me.Regex.InsideString.source+')"')).map((([e,t,i,s])=>t??i??s));static path=Pe.regArray(new RegExp("'\"("+Me.Regex.InsideString.source+")\"'|'("+Me.Regex.InsideSingleQuotedString.source+")'|\"("+Me.Regex.InsideString.source+')"|('+Me.Regex.Path.source+")")).map((([e,t,i,s,r])=>t??i??s??r));static symbol=Pe.reg(Me.Regex.Symbol);static symbolQuoted=Pe.reg(new RegExp('"('+Me.Regex.Symbol.source+')"'),1);static attributeName=Pe.reg(Me.Regex.DotSeparatedSymbols);static attributeNameQuoted=Pe.reg(new RegExp('"('+Me.Regex.DotSeparatedSymbols.source+')"'),1);static guid=Pe.reg(new RegExp(`${Me.Regex.HexDigit.source}{32}`));static commaSeparation=Pe.reg(/\s*,\s*(?!\))/);static commaOrSpaceSeparation=Pe.reg(/\s*,\s*(?!\))|\s+/);static equalSeparation=Pe.reg(/\s*=\s*/);static typeReference=Pe.alt(Pe.reg(Me.Regex.Path),this.symbol);static hexColorChannel=Pe.reg(new RegExp(Me.Regex.HexDigit.source+"{2}"));static grammarFor(e,t=(e?.constructor===Object?e.type:e?.constructor),i=this.unknownValue){let s=i;if(t instanceof Array){if(e?.inlined)return this.grammarFor(void 0,t[0]);s=Pe.seq(Pe.reg(/\(\s*/),this.grammarFor(void 0,t[0]).sepBy(this.commaSeparation),Pe.reg(/\s*(?:,\s*)?\)/)).map((([e,t,i])=>t))}else if(t instanceof ke)s=t.values.map((e=>this.grammarFor(void 0,e))).reduce(((e,t)=>t&&t!==this.unknownValue&&e!==this.unknownValue?Pe.alt(e,t):this.unknownValue));else{if(t instanceof le)return this.grammarFor(void 0,t.getTargetType()).map((e=>new le(t.type,(()=>e))));if(e?.constructor===Object)s=this.grammarFor(void 0,t);else switch(t){case Boolean:s=this.boolean;break;case Number:s=this.number;break;case BigInt:s=this.bigInt;break;case String:s=this.string;break;default:if(t?.prototype instanceof xe)return t.grammar}}return e?.constructor===Object&&(e.serialized&&t.constructor!==String&&(s=s==this.unknownValue?this.string:Pe.seq(Pe.str('"'),s,Pe.str('"'))),e.nullable&&(s=Pe.alt(s,this.null))),s}static getAttribute(e,t){let i,s;if(e instanceof ke)for(let s of e.values)if(i=this.getAttribute(s,t))return i;return e instanceof Le.constructor?(i=e.attributes[t[0]],s=i?.type):e instanceof Array&&(i=e[t[0]],s=i),t.length>1?this.getAttribute(s,t.slice(1)):i}static createAttributeGrammar(e,t=this.attributeName,i=this.equalSeparation,s=((e,t,i)=>{})){return Pe.seq(t,i).chain((([t,i])=>{const r=t.split(ne.keysSeparator),n=this.getAttribute(e,r);return this.grammarFor(n).map((e=>t=>{s(t,r,e),Ae.objectSet(t,r,e,!0)}))}))}static createEntityGrammar=(e,t=!0,i=this.commaSeparation)=>Pe.seq(Pe.reg(e.lookbehind instanceof ke?new RegExp(`(${e.lookbehind.values.reduce(((e,t)=>e+"|"+t))})\\s*\\(\\s*`):e.lookbehind.constructor==String&&e.lookbehind.length?new RegExp(`(${e.lookbehind})\\s*\\(\\s*`):/()\(\s*/,1),this.createAttributeGrammar(e).sepBy(i),Pe.reg(/\s*(?:,\s*)?\)/)).map((([e,t,i])=>{let s={};return t.forEach((e=>e(s))),e.length&&(s.lookbehind=e),s})).chain((i=>{let s=Object.keys(i);if(Object.keys(e.attributes).filter((t=>e.attributes[t].expected)).find((e=>!s.includes(e)&&e)))return Pe.failure();const r=Object.keys(i).filter((t=>!(t in e.attributes))).length;return!t&&r>0?Pe.failure():Pe.success().map((()=>new e(i)))}));static unknownValue}class Te extends Le{static attributes={...super.attributes,value:{default:""}};static{this.cleanupAttributes(this.attributes)}static grammar=this.createGrammar();static createGrammar(){return Me.guid.map((e=>new this(e)))}static generateGuid(e=!0){let t=new Uint32Array(4);!0===e&&crypto.getRandomValues(t);let i="";return t.forEach((e=>{i+=("0".repeat(8)+e.toString(16).toUpperCase()).slice(-8)})),new Te({value:i})}constructor(e){e||(e=Te.generateGuid().value),e.constructor!==Object&&(e={value:e}),super(e),this.value}valueOf(){return this.value}toString(){return this.value}}class Ie extends Le{static attributes={...super.attributes,type:{default:""},path:{default:""}};static{this.cleanupAttributes(this.attributes)}static noneReferenceGrammar=Pe.str("None").map((()=>this.createNoneInstance()));static fullReferenceGrammar=Pe.seq(Me.typeReference,Pe.whitespaceInlineOpt,Me.pathQuotes).map((([e,t,i])=>new this({type:e,path:i})));static typeReferenceGrammar=Me.typeReference.map((e=>new this({type:e,path:""})));static pathReferenceGrammar=Me.path.map((e=>new this({type:"",path:e})));static grammar=this.createGrammar();static createGrammar(){return Pe.alt(this.noneReferenceGrammar,this.fullReferenceGrammar,this.typeReferenceGrammar,this.pathReferenceGrammar)}constructor(e={}){e.constructor===String&&(e={path:e}),super(e),this.type,this.path}static createNoneInstance(){return new Ie({type:"None",path:""})}sanitize(){if(this.type&&!this.type.startsWith("/")){let e=this.type+"_Deprecated",t=Object.keys(ne.paths).find((t=>{const i=Ae.getNameFromPath(ne.paths[t]);return i===this.type||i===e}));t&&(this.type=ne.paths[t])}}getName(){return Ae.getNameFromPath(this.path.replace(/_C$/,""))}toString(){return`${this.type}'"${this.path}"'`}}class Be extends Le{static attributes={...super.attributes,MemberParent:{type:Ie},MemberName:{type:String},MemberGuid:{type:Te}};static{this.cleanupAttributes(this.attributes)}static grammar=this.createGrammar();static createGrammar(){return Me.createEntityGrammar(this)}constructor(e){super(e),this.MemberParent,this.MemberName,this.MemberGuid}}class $e extends Le{static attributes={...super.attributes,value:{default:""}};static{this.cleanupAttributes(this.attributes)}static attributeConverter={fromAttribute:(e,t)=>new $e(e),toAttribute:(e,t)=>e.toString()};static grammar=this.createGrammar();static createGrammar(){return Me.symbol.map((e=>new this(e)))}constructor(e){e.constructor!==Object&&(e={value:e}),super(e),this.value}valueOf(){return this.value}toString(){return this.value}}class He extends Le{static attributes={...super.attributes,value:{default:0,predicate:e=>e%1==0&&e>1<<31&&e<-(1<<31)}};static{this.cleanupAttributes(this.attributes)}static grammar=this.createGrammar();static createGrammar(){return Pe.numberInteger.map((e=>new this(e)))}constructor(e=0){-0===e&&(e=0),super(e.constructor===Object?e:{value:e}),this.value}valueOf(){return this.value}toString(){return this.value.toString()}}class Ge extends Le{static attributes={...super.attributes,value:{default:0}};static{this.cleanupAttributes(this.attributes)}static grammar=this.createGrammar();static createGrammar(){return Pe.number.map((e=>new this(e)))}constructor(e=0){e.constructor!==Object&&(e={value:e}),super(e),this.value}valueOf(){return this.value}toString(){return this.value.toFixed(6)}}class Oe extends Le{static attributes={...super.attributes,R:{type:Ge,default:()=>new Ge,expected:!0},G:{type:Ge,default:()=>new Ge,expected:!0},B:{type:Ge,default:()=>new Ge,expected:!0},A:{type:Ge,default:()=>new Ge(1)},H:{type:Ge,default:()=>new Ge,ignored:!0},S:{type:Ge,default:()=>new Ge,ignored:!0},V:{type:Ge,default:()=>new Ge,ignored:!0}};static{this.cleanupAttributes(this.attributes)}static grammar=this.createGrammar();static linearToSRGB(e){return e<=0?0:e>=1?1:e<.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055}static sRGBtoLinear(e){return e<=0?0:e>=1?1:e<.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}static getWhite(){return new Oe({R:1,G:1,B:1})}static createGrammar(){return Me.createEntityGrammar(this,!1)}static getLinearColorFromHexGrammar(){return Pe.regArray(new RegExp("#("+Me.Regex.HexDigit.source+"{2})("+Me.Regex.HexDigit.source+"{2})("+Me.Regex.HexDigit.source+"{2})("+Me.Regex.HexDigit.source+"{2})?")).map((([e,t,i,s,r])=>new this({R:parseInt(t,16)/255,G:parseInt(i,16)/255,B:parseInt(s,16)/255,A:parseInt(r??"FF",16)/255})))}static getLinearColorRGBListGrammar(){return Pe.seq(Pe.numberByte,Me.commaSeparation,Pe.numberByte,Me.commaSeparation,Pe.numberByte).map((([e,t,i,s,r])=>new this({R:e/255,G:i/255,B:r/255,A:1})))}static getLinearColorRGBGrammar(){return Pe.seq(Pe.reg(/rgb\s*\(\s*/),this.getLinearColorRGBListGrammar(),Pe.reg(/\s*\)/)).map((([e,t,i])=>t))}static getLinearColorRGBAGrammar(){return Pe.seq(Pe.reg(/rgba\s*\(\s*/),this.getLinearColorRGBListGrammar(),Pe.reg(/\s*\)/)).map((([e,t,i])=>t))}static getLinearColorFromAnyFormat(){return Pe.alt(this.getLinearColorFromHexGrammar(),this.getLinearColorRGBAGrammar(),this.getLinearColorRGBGrammar(),this.getLinearColorRGBListGrammar())}constructor(e){e instanceof Array&&(e={R:e[0]??0,G:e[1]??0,B:e[2]??0,A:e[3]??1}),super(e),this.R,this.G,this.B,this.A,this.H,this.S,this.V,this.#C()}#C(){const e=this.R.value,t=this.G.value,i=this.B.value;if(Ae.approximatelyEqual(e,t)&&Ae.approximatelyEqual(e,i)&&Ae.approximatelyEqual(t,i))return this.S.value=0,void(this.V.value=e);const s=Math.max(e,t,i),r=Math.min(e,t,i),n=s-r;let a;switch(s){case r:a=0;break;case e:a=(t-i)/n+(te.toString(16).toUpperCase().padStart(2,"0"))).join("")}toSRGBAString(){return this.toSRGBA().map((e=>e.toString(16).toUpperCase().padStart(2,"0"))).join("")}toHSVA(){return[this.H.value,this.S.value,this.V.value,this.A.value]}toNumber(){return(Math.round(255*this.R.value)<<24)+(Math.round(255*this.G.value)<<16)+(Math.round(255*this.B.value)<<8)+Math.round(255*this.A.value)}setFromRGBANumber(e){this.A.value=(255&e)/255,this.B.value=(e>>8&255)/255,this.G.value=(e>>16&255)/255,this.R.value=(e>>24&255)/255,this.#C()}setFromSRGBANumber(e){this.A.value=(255&e)/255,this.B.value=Oe.sRGBtoLinear((e>>8&255)/255),this.G.value=Oe.sRGBtoLinear((e>>16&255)/255),this.R.value=Oe.sRGBtoLinear((e>>24&255)/255),this.#C()}toArray(){return[this.R.value,this.G.value,this.B.value,this.A.value]}toString(){return Ae.printLinearColor(this)}}class De extends Le{static attributes={...super.attributes,MacroGraph:{type:Ie,default:()=>new Ie},GraphBlueprint:{type:Ie,default:()=>new Ie},GraphGuid:{type:Te,default:()=>new Te}};static{this.cleanupAttributes(this.attributes)}static grammar=this.createGrammar();static createGrammar(){return Me.createEntityGrammar(this)}constructor(e){super(e),this.MacroGraph,this.GraphBlueprint,this.GuidEntity}getMacroName(){const e=this.MacroGraph.path.search(":");return this.MacroGraph.path.substring(e+1)}}class Ve extends He{static attributes={...super.attributes,value:{...super.attributes.value,predicate:e=>e%1==0&&e>=0&&e<256}};static{this.cleanupAttributes(this.attributes)}static grammar=this.createGrammar();static createGrammar(){return Pe.numberByte.map((e=>new this(e)))}constructor(e=0){super(e)}}class Re extends Le{static attributes={...super.attributes,value:{default:""}};static{this.cleanupAttributes(this.attributes)}static grammar=this.createGrammar();static createGrammar(){return Me.symbol.map((e=>new this(e)))}constructor(e){e.constructor!==Object&&(e={value:e}),super(e),this.value}valueOf(){return this.value}toString(){return this.value}}class ze extends Re{static grammar=this.createGrammar();static createGrammar(){return Me.symbol.map((e=>new this(e)))}}class _e extends ze{static grammar=this.createGrammar();static createGrammar(){return Pe.reg(Me.Regex.InsideString).map((e=>new this(e)))}}class Fe extends Le{static lookbehind="INVTEXT";static attributes={...super.attributes,value:{default:""}};static{this.cleanupAttributes(this.attributes)}static grammar=this.createGrammar();static createGrammar(){return Pe.alt(Pe.seq(Pe.reg(new RegExp(`${this.lookbehind}\\s*\\(`)),Me.grammarFor(this.attributes.value),Pe.reg(/\s*\)/)).map((([e,t,i])=>t)),Pe.reg(new RegExp(this.lookbehind)).map((()=>""))).map((e=>new this(e)))}constructor(e){e.constructor!==Object&&(e={value:e}),super(e),this.value}}class je extends Le{static lookbehind="NSLOCTEXT";static attributes={...super.attributes,namespace:{default:""},key:{default:""},value:{default:""}};static{this.cleanupAttributes(this.attributes)}static grammar=this.createGrammar();static createGrammar(){return Pe.regArray(new RegExp(String.raw`${this.lookbehind}\s*\(`+String.raw`\s*"(${Me.Regex.InsideString.source})"\s*,`+String.raw`\s*"(${Me.Regex.InsideString.source})"\s*,`+String.raw`\s*"(${Me.Regex.InsideString.source})"\s*`+String.raw`(?:,\s+)?`+String.raw`\)`,"m")).map((e=>new this({namespace:Ae.unescapeString(e[1]),key:Ae.unescapeString(e[2]),value:Ae.unescapeString(e[3])})))}constructor(e){super(e),this.namespace,this.key,this.value}toString(){return Ae.capitalFirstLetter(this.value)}}class Ue extends Le{static lookbehind=new ke("LOCGEN_FORMAT_NAMED","LOCGEN_FORMAT_ORDERED");static attributes={...super.attributes,value:{type:[new ke(String,je,Fe,Ue)],default:[]}};static{this.cleanupAttributes(this.attributes)}static grammar=this.createGrammar();static createGrammar(){return Pe.seq(Pe.reg(new RegExp(`(${this.lookbehind.values.reduce(((e,t)=>e+"|"+t))})\\s*`),1),Me.grammarFor(this.attributes.value)).map((([e,t])=>{const i=new this({value:t});return i.lookbehind=e,i}))}constructor(e){super(e),this.value}toString(){const e=this.value?.[0]?.toString();if(!e)return"";const t=this.value.slice(1).map((e=>e.toString()));return"LOCGEN_FORMAT_NAMED"==this.lookbehind?e.replaceAll(/\{([a-zA-Z]\w*)\}/g,((e,i)=>{const s=t.indexOf(i)+1;return s>0&&s