miniscript-languageserver 1.7.3 → 1.7.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +1 -1
  2. package/package.json +2 -2
package/index.js CHANGED
@@ -193,6 +193,6 @@ ${e}`;for(let a=0;a<this.details.length;++a){let u=a+1;o=`${o}
193
193
  buildDate: a date in yyyy-mm-dd format, like "2020-05-28"
194
194
  host: a number for the host major and minor version, like 0.9
195
195
  hostName: name of the host application, e.g. "Mini Micro"
196
- hostInfo: URL or other short info about the host app`},stackTrace:{description:"Get a list describing the call stack."}}});var sC=m((Gz,v2)=>{v2.exports={$meta:{description:"Create a `list` with square brackets. Then iterate over the `list` with for, or pull out individual items with a 0-based index in square brackets. A negative index counts from the end. Get a slice (subset) of a `list` with two indices, separated by a colon.",example:["x = [2, 4, 6, 8]","print(x[0]) // get first item from list","print(x[-1]) // get last item from list","print(x[1:3]) // slice items from index 1 to 3","x[2] = 5 // set item at index 2 to 5","print(x)","print(x + [42]) // concatenate two lists"]},remove:{description:"Removes an item from the `list` with the provided index. Due to the removal the `list` will get mutated.",example:["myList = [1, 42, 3]","myList.remove(1)",'print("This list does not contain the answer to everything: " + myList.split(", "))']},insert:{description:"Inserts a value into the `list` at the index provided. Due to the insertion the `list` will get mutated. Returns the mutated `list`.",example:["myList = [1, 3]","myList.insert(1, 42)",'print("This list does contain the answer to everything: " + myList.split(", "))']},push:{description:"Appends a value to the end of the `list`. This operation will mutate the `list`. Additionally, this method will return the updated `list`.",example:["myList = [1, 3]","myList.push(42)",'print("This list does contain the answer to everything: " + myList.split(", "))']},pop:{description:"Returns and removes the last item in the `list`. This operation will mutate the `list`.",example:["myList = [1, 3, 42]","answer = myList.pop",'print("Answer to everything: " + answer)']},pull:{description:"Returns and removes the first item in the `list`. This operation will mutate the `list`.",example:["myList = [42, 1, 3]","answer = myList.pull",'print("Answer to everything: " + answer)']},shuffle:{description:"Shuffles all values in the `list`. This operation will mutate the `list`.",example:["myList = [42, 1, 3]","myList.shuffle",'print("New list order: " + myList.split(", "))']},sum:{description:"Returns sum of all values inside the `list`. Any non-numeric values will be considered a zero.",example:["myList = [42, 1, 3]","sum = myList.sum",'print("Sum of all items in list: " + sum)']},hasIndex:{description:"Returns `true` if the provided index is available in the `list`. Otherwise, this method will return `false`.",example:["myList = [42, 1, 3]","containsIndex = myList.hasIndex(1)","if containsIndex then",' print("List contains index of 1.")',"else",' print("List does not contain index of 1.")',"end if"]},indexOf:{description:"Returns a `number` which indicates the first matching index of the provided value inside the `list`. Optionally a start index can be provided. In case the value does not exist inside the `list` a `null` gets returned.",example:["myList = [42, 1, 3]","index = myList.indexOf(42)","if index != null then",' print("The answer for everything is at the following index: " + index)',"else",' print("No answer for everything found.")',"end if"]},sort:{description:"Sort `list` values alphanumerically. This operation will mutate the `list`. Optionally a key can be provided which which is used in case the items are maps. Additionally, this method will return the updated `list`.",example:['myList = [{ "key": 42 }, { "key": 2 }, { "key": 1 }]','myList.sort("key")',"print(myList)"]},join:{description:"Returns a concatenated `string` containing all stringified values inside the `list`. These values will be separated via the provided separator.",example:["myList = [42, 1, 3]",`print(myList.join(" .-*'*-. "))`]},indexes:{description:"Returns a `list` containing all available indexes.",example:["myList = [42, 1, 3]","for i in myList.indexes"," print(myList[i])","end for"]},len:{description:"Returns a `number` representing the count of values inside the `list`.",example:["myList = [42, 1, 3]",'print("myList contains " + myList.len + " items")']},values:{description:"Returns a `list` containing all available values.",example:["myList = [42, 1, 3]","for v in myList.values"," print(v)","end for"]},replace:{description:"Returns updated `list` where each value matching with the provided replace argument gets replaced. This operation will mutate the `list`.",example:["myList = [1, 2, 2, 7]","myList.replace(2, 3)",'print(myList.join(""))']}}});var oC=m((Kz,_2)=>{_2.exports={$meta:{description:"A `map` is a set of values associated with unique keys. Create a `map` with curly braces; get or set a single value with square brackets. Keys and values may be any type.",example:['x = { "test": 123 }',"x.foo = 42 // set property foo to 42","print(x.foo) // get value of property foo",'print(x + { "bar": 2 }) // concatenate two maps']},remove:{description:"Removes an item from the `map` with the provided key. Due to the removal the `map` will get mutated.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }','myMap.remove("answer")',"print(myMap)"]},push:{description:"Adds the value 1 to the provided key. This operation will mutate the `map`. Additionally, this method will return the updated `map`.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }','myMap.push("answer")',"print(myMap.answer)"]},pull:{description:"Returns and removes the first item in the `map`. This operation will mutate the `map`.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }',"print(myMap.pull)"]},pop:{description:"Returns and removes the last item in the `map`. This operation will mutate the `map`.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }',"print(myMap.pop)"]},shuffle:{description:"Shuffles all values in the `map`. This operation will mutate the `map`.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }',"myMap.shuffle","print(myMap)"]},sum:{description:"Returns sum of all values inside the `map`. Any non-numeric values will be considered a zero.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }',"sum = myMap.sum",'print("Sum of all items in map: " + sum)']},hasIndex:{description:"Returns `true` if the provided key is available in the `map`. Otherwise, this method will return `false`.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }','containsIndex = myList.hasIndex("answer")',"if containsIndex then",' print("Map contains the answer.")',"else",' print("Map does not contain the answer.")',"end if"]},indexOf:{description:"Returns `string` which indicates the key of the provided value inside the `map`. In case the value does not exist inside the `map` a `null` gets returned.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }',"key = myList.indexOf(42)","if key != null then",' print("Map contains the answer.")',"else",' print("Map does not contain the answer.")',"end if"]},indexes:{description:"Returns a `list` containing all available keys.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }',"for key in myMap.indexes"," print(myMap[key])","end for"]},len:{description:"Returns a `number` representing the count of items inside the `map`.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }','print("myMap contains " + myMap.len + " items")']},values:{description:"Returns a `list` containing all available values.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }',"for value in myMap.values"," print(value)","end for"]},replace:{description:"Returns updated `map` where each value matching with the provided replace argument gets replaced. This operation will mutate the `map`.",example:['myObject = { "answer": 45 }',"myObject.replace(45, 42)","print(myObject.answer)"]}}});var aC=m((zz,T2)=>{T2.exports={$meta:{description:"All numbers are stored in full-precision format. Numbers also represent `true == 1` and `false == 0`.",example:["a = 20","b = 22","print(a + b) // addition","print(a - b) // substraction","print(a / b) // division","print(a * b) // multiply","print(a % b) // modulo","print(a - b) // substraction","print(a ^ b) // power","print(a and b) // logical and","print(a or b) // logical or","print(not a) // logical not","print(a == b) // comparison equal","print(a != b) // comparison unequal","print(a > b) // comparison greater than","print(a < b) // comparison lower than","print(a >= b) // comparison greater equal than","print(a <= b) // comparison lower equal than"]}}});var uC=m((Vz,S2)=>{S2.exports={$meta:{description:"Text is stored in strings of Unicode characters. Write strings by surrounding them with quotes. If you need to include a quotation mark in the string, write it twice.",example:['a = "hello"','b = "world"',"print(a + b) // concatinate a and b","print(a * 10) // repeat hello ten times","print(a[0]) // prints h","print(a[1:3]) // prints ell"]},remove:{description:"Returns a new `string` where the provided `string` got removed.",example:['myString = "42 as an answer is wrong"','newString = myString.remove("wrong")','print(newString + "right")']},hasIndex:{description:"Returns `true` if the provided index is available in the `string`. Otherwise, this method will return `false`.",example:['myString = "42 as an answer is wrong"',"containsIndex = myString.hasIndex(1)","if containsIndex then",' print("String contains index of 1.")',"else",' print("String does not contain index of 1.")',"end if"]},insert:{description:"Returns a `string` with the newly inserted `string` at the provided index.",example:['myString = "42 as an answer is wrong"','index = myString.lastIndexOf("w") - 1','newString = myString.insert(index, "not ")',"print(newString)"]},indexOf:{description:"Returns a `number` which indicates the first matching index of the provided value inside the `list`. Optionally a start index can be provided. In case the value does not exist inside the `string` a `null` gets returned.",example:['myString = "42 as an answer is wrong"','index = myString.indexOf("wrong")',"if index != null then",' print("Invalid information spotted at: " + index)',"else",' print("Information seems valid.")',"end if"]},split:{description:"Returns a `list` where each item is a segment of the `string`. The separation depends on the provided separator `string`. Keep in mind that for some odd reason, this method is using regular expressions for matching.",example:['myString = "42 as an answer is wrong"','segments = myString.split(" ")','if segments[0] != "42" then',' print("Invalid information spotted!")',"else",' print("Information seems valid!")',"end if"]},replace:{description:"Returns a new `string` where the provided `string` got replaced by the second provided `string`.",example:['myString = "42 as an answer is wrong"','newString = myString.replace("wrong", "right")',"print(newString)"]},indexes:{description:"Returns a `list` where each item is a `number` representing all available indexes in the `string`.",example:['myString = "42"',"print(myString.indexes)"]},code:{description:"Returns a `number` representing the Unicode code of the first character of the `string`.",example:['myString = "HELLO WORLD"',"print(myString.code)"]},len:{description:"Returns a `number` representing the length of the `string`.",example:['myString = "HELLO WORLD"','print("Size of string is: " + myString.len)']},lower:{description:"Returns a new `string` in which all characters are transformed into lowercase.",example:['myString = "HELLO WORLD"',"print(myString.lower)"]},upper:{description:"Returns a new `string` in which all characters are transformed into uppercase.",example:['myString = "hello world"',"print(myString.upper)"]},val:{description:"Returns a `number` which is parsed from the `string`. In case the `string` is not numeric it will return a zero.",example:['myString = "1.25"',"print(myString.val + 40.75)"]},values:{description:"Returns a `list` where each item is a `string` representing all available characters in the `string`. Could be compared to using `split` but without any separator.",example:['myString = "hello world"',"print(myString.values)"]}}});var lC=m(Yu=>{"use strict";var da=Yu&&Yu.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Yu,"__esModule",{value:!0});var k2=da(rC()),w2=da(iC()),x2=da(sC()),E2=da(oC()),A2=da(aC()),O2=da(uC()),C2={any:k2.default,general:w2.default,list:x2.default,map:E2.default,string:O2.default,number:A2.default};Yu.default=C2});var cC=m((Yz,R2)=>{R2.exports={type:"any",definitions:{insert:{type:"function",arguments:[{label:"index",type:"number"},{label:"value",type:"any"}],returns:["list","string"]},indexOf:{type:"function",arguments:[{label:"value",type:"any"},{label:"offset",type:"number",opt:!0}],returns:["any"]},hasIndex:{type:"function",arguments:[{label:"value",type:"any"}],returns:["number"]},remove:{type:"function",arguments:[{label:"value",type:"any"}],returns:["null"]},push:{type:"function",arguments:[{label:"value",type:"any"}],returns:["map","list","null"]},pull:{type:"function",returns:["any"]},pop:{type:"function",returns:["any"]},shuffle:{type:"function",returns:["null"]},sum:{type:"function",returns:["number"]},indexes:{type:"function",returns:["list"]},len:{type:"function",returns:["number"]},values:{type:"function",returns:["list"]}}}});var hC=m((Jz,P2)=>{P2.exports={type:"general",definitions:{hasIndex:{type:"function",arguments:[{label:"self",types:["list","map","string"]},{label:"index",type:"any"}],returns:["number","null"]},print:{type:"function",arguments:[{label:"value",type:"any",default:{type:"string",value:""}},{label:"delimiter",type:"string",opt:!0}],returns:["null"]},indexes:{type:"function",arguments:[{label:"self",types:["map","list","string"]}],returns:["list","null"]},values:{type:"function",arguments:[{label:"self",types:["map","list","string"]}],returns:["list"]},indexOf:{type:"function",arguments:[{label:"self",types:["list","map","string"]},{label:"value",type:"any"},{label:"after",type:"any",opt:!0}],returns:["any","null"]},len:{type:"function",arguments:[{label:"self",types:["list","string","map"]}],returns:["number","null"]},shuffle:{type:"function",arguments:[{label:"self",types:["list","map"]}],returns:["null"]},val:{type:"function",arguments:[{label:"self",type:"any"}],returns:["number","null"]},lower:{type:"function",arguments:[{label:"self",type:"string"}],returns:["string"]},upper:{type:"function",arguments:[{label:"self",type:"string"}],returns:["string"]},sum:{type:"function",arguments:[{label:"self",types:["list","map"]}],returns:["number"]},pop:{type:"function",arguments:[{label:"self",types:["list","map"]}],returns:["any","null"]},pull:{type:"function",arguments:[{label:"self",types:["list","map"]}],returns:["any","null"]},push:{type:"function",arguments:[{label:"self",types:["list","map"]},{label:"value",type:"any"}],returns:["map","list","null"]},sort:{type:"function",arguments:[{label:"self",type:"list"},{label:"byKey",type:"any"},{label:"ascending",type:"number",default:{type:"number",value:1}}],returns:["list","null"]},remove:{type:"function",arguments:[{label:"self",types:["list","map","string"]},{label:"key",type:"any"}],returns:["list","map","string"]},wait:{type:"function",arguments:[{label:"seconds",type:"number",default:{type:"number",value:1}}],returns:["null"]},abs:{type:"function",arguments:[{label:"value",type:"number",default:{type:"number",value:0}}],returns:["number"]},acos:{type:"function",arguments:[{label:"value",type:"number",default:{type:"number",value:0}}],returns:["number"]},asin:{type:"function",arguments:[{label:"value",type:"number",default:{type:"number",value:0}}],returns:["number"]},atan:{type:"function",arguments:[{label:"y",type:"number",default:{type:"number",value:0}},{label:"x",type:"number",default:{type:"number",value:1}}],returns:["number"]},tan:{type:"function",arguments:[{label:"radians",type:"number",default:{type:"number",value:0}}],returns:["number"]},cos:{type:"function",arguments:[{label:"radians",type:"number",default:{type:"number",value:0}}],returns:["number"]},code:{type:"function",arguments:[{label:"value",type:"string"}],returns:["number"]},char:{type:"function",arguments:[{label:"codePoint",type:"number",default:{type:"number",value:65}}],returns:["string"]},sin:{type:"function",arguments:[{label:"radians",type:"number",default:{type:"number",value:0}}],returns:["number"]},floor:{type:"function",arguments:[{label:"x",type:"number",default:{type:"number",value:0}}],returns:["number"]},range:{type:"function",arguments:[{label:"start",type:"number",default:{type:"number",value:0}},{label:"end",type:"number",default:{type:"number",value:0}},{label:"inc",type:"number",opt:!0}],returns:[{type:"list",valueType:"number"}]},round:{type:"function",arguments:[{label:"x",type:"number",default:{type:"number",value:0}},{label:"decimalPlaces",type:"number",default:{type:"number",value:0}}],returns:["number"]},rnd:{type:"function",arguments:[{label:"seed",type:"number",opt:!0}],returns:["number"]},sign:{type:"function",arguments:[{label:"x",type:"number",default:{type:"number",value:0}}],returns:["number"]},sqrt:{type:"function",arguments:[{label:"x",type:"number",default:{type:"number",value:0}}],returns:["number"]},str:{type:"function",arguments:[{label:"value",type:"any"}],returns:["string"]},ceil:{type:"function",arguments:[{label:"x",type:"number",default:{type:"number",value:0}}],returns:["number"]},pi:{type:"function",returns:["number"]},slice:{type:"function",arguments:[{label:"seq",types:["list","string"]},{label:"from",type:"number",default:{type:"number",value:0}},{label:"to",type:"number",opt:!0}],returns:["list","string"]},hash:{type:"function",arguments:[{label:"value",type:"any"}],returns:["number"]},time:{type:"function",returns:["number"]},bitAnd:{type:"function",arguments:[{label:"a",type:"number",default:{type:"number",value:0}},{label:"b",type:"number",default:{type:"number",value:0}}],returns:["number"]},bitOr:{type:"function",arguments:[{label:"a",type:"number",default:{type:"number",value:0}},{label:"b",type:"number",default:{type:"number",value:0}}],returns:["number"]},bitXor:{type:"function",arguments:[{label:"a",type:"number",default:{type:"number",value:0}},{label:"b",type:"number",default:{type:"number",value:0}}],returns:["number"]},log:{type:"function",arguments:[{label:"value",type:"number",default:{type:"number",value:0}},{label:"base",type:"number",default:{type:"number",value:10}}],returns:["number"]},yield:{type:"function",returns:["null"]},insert:{type:"function",arguments:[{label:"self",types:["list","string"]},{label:"index",type:"number"},{label:"value",type:"any"}],returns:["list","string"]},join:{type:"function",arguments:[{label:"self",type:"list"},{label:"delimiter",type:"string",default:{type:"string",value:" "}}],returns:["string"]},split:{type:"function",arguments:[{label:"self",type:"string"},{label:"delimiter",type:"string",default:{type:"string",value:" "}},{label:"maxCount",type:"number",default:{type:"number",value:-1}}],returns:[{type:"list",valueType:"string"}]},replace:{type:"function",arguments:[{label:"self",types:["list","map","string"]},{label:"oldval",type:"any"},{label:"newval",type:"any"},{label:"maxCount",type:"number",opt:!0}],returns:["list","map","string"]},funcRef:{type:"function",returns:[{type:"map",keyType:"string"}]},list:{type:"function",returns:[{type:"map",keyType:"string"}]},map:{type:"function",returns:[{type:"map",keyType:"string"}]},number:{type:"function",returns:[{type:"map",keyType:"string"}]},string:{type:"function",returns:[{type:"map",keyType:"string"}]},refEquals:{type:"function",arguments:[{label:"a",type:"any"},{label:"b",type:"any"}],returns:["number"]},stackTrace:{type:"function",returns:[{type:"list",valueType:"string"}]},version:{type:"function",returns:["version"]}}}});var fC=m((Qz,D2)=>{D2.exports={type:"list",definitions:{remove:{type:"function",arguments:[{label:"index",type:"number"}],returns:["null"]},insert:{type:"function",arguments:[{label:"index",type:"number"},{label:"value",type:"any"}],returns:["list"]},push:{type:"function",arguments:[{label:"value",type:"any"}],returns:["list"]},pop:{type:"function",returns:["any"]},pull:{type:"function",returns:["any"]},shuffle:{type:"function",returns:["null"]},sum:{type:"function",returns:["number"]},hasIndex:{type:"function",arguments:[{label:"index",type:"number"}],returns:["number"]},indexOf:{type:"function",arguments:[{label:"value",type:"any"},{label:"offset",type:"number",opt:!0}],returns:["number","null"]},sort:{type:"function",arguments:[{label:"byKey",type:"string"},{label:"ascending",type:"number",default:{type:"number",value:1}}],returns:["list"]},join:{type:"function",arguments:[{label:"delimiter",type:"string",default:{type:"string",value:" "}}],returns:["string"]},indexes:{type:"function",returns:[{type:"list",valueType:"number"}]},len:{type:"function",returns:["number"]},values:{type:"function",returns:["list"]},replace:{type:"function",arguments:[{label:"oldVal",type:"any"},{label:"newVal",type:"any"},{label:"maxCount",type:"number",opt:!0}],returns:["list"]}}}});var dC=m((Zz,I2)=>{I2.exports={type:"map",definitions:{remove:{type:"function",arguments:[{label:"key",type:"string"}],returns:["number"]},push:{type:"function",arguments:[{label:"key",type:"string"}],returns:["map"]},pull:{type:"function",returns:["any"]},pop:{type:"function",returns:["any"]},shuffle:{type:"function",returns:["null"]},sum:{type:"function",returns:["number"]},hasIndex:{type:"function",arguments:[{label:"key",type:"string"}],returns:["number"]},indexOf:{type:"function",arguments:[{label:"value",type:"any"},{label:"offset",type:"number",opt:!0}],returns:["any","null"]},indexes:{type:"function",returns:["list"]},len:{type:"function",returns:["number"]},values:{type:"function",returns:["list"]},replace:{type:"function",arguments:[{label:"oldVal",type:"any"},{label:"newVal",type:"any"},{label:"maxCount",type:"number",opt:!0}],returns:["map"]}}}});var pC=m((eV,M2)=>{M2.exports={type:"number",definitions:{}}});var gC=m((tV,L2)=>{L2.exports={type:"string",definitions:{remove:{type:"function",arguments:[{label:"toDelete",type:"string"}],returns:["string"]},hasIndex:{type:"function",arguments:[{label:"index",type:"number"}],returns:["number"]},insert:{type:"function",arguments:[{label:"index",type:"number"},{label:"value",type:"string"}],returns:["string"]},indexOf:{type:"function",arguments:[{label:"value",type:"string"},{label:"offset",type:"number",opt:!0}],returns:["number","null"]},split:{type:"function",arguments:[{label:"delimiter",type:"string",default:{type:"string",value:" "}},{label:"maxCount",type:"number",default:{type:"number",value:-1}}],returns:[{type:"list",valueType:"string"}]},replace:{type:"function",arguments:[{label:"oldVal",type:"string"},{label:"newVal",type:"string"},{label:"maxCount",type:"number",opt:!0}],returns:["string"]},indexes:{type:"function",returns:[{type:"list",valueType:"number"}]},code:{type:"function",returns:["number"]},len:{type:"function",returns:["number"]},lower:{type:"function",returns:["string"]},upper:{type:"function",returns:["string"]},val:{type:"function",returns:["number"]},values:{type:"function",returns:[{type:"list",valueType:"string"}]}}}});var mC=m((nV,N2)=>{N2.exports={type:"version",extends:"map",definitions:{miniscript:{type:"string"},buildDate:{type:"string"},host:{type:"number"},hostName:{type:"string"},hostInfo:{type:"string"}}}});var X_=m(Pn=>{"use strict";var ns=Pn&&Pn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Pn,"__esModule",{value:!0});Pn.miniscriptMeta=void 0;var q2=sr(),j2=ns(lC()),F2=ns(cC()),$2=ns(hC()),B2=ns(fC()),U2=ns(dC()),W2=ns(pC()),H2=ns(gC()),G2=ns(mC());Pn.miniscriptMeta=new q2.Container;Pn.miniscriptMeta.addTypeSignatureFromPayload(F2.default);Pn.miniscriptMeta.addTypeSignatureFromPayload($2.default);Pn.miniscriptMeta.addTypeSignatureFromPayload(B2.default);Pn.miniscriptMeta.addTypeSignatureFromPayload(U2.default);Pn.miniscriptMeta.addTypeSignatureFromPayload(W2.default);Pn.miniscriptMeta.addTypeSignatureFromPayload(H2.default);Pn.miniscriptMeta.addTypeSignatureFromPayload(G2.default);Pn.miniscriptMeta.addMetaFromPayload("en",j2.default)});var Ju=m(Y_=>{"use strict";Object.defineProperty(Y_,"__esModule",{value:!0});var K2=X_(),z2=Yo();Y_.default=new z2.TypeManager({container:K2.miniscriptMeta})});var bC=m(pa=>{"use strict";var V2=pa&&pa.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(pa,"__esModule",{value:!0});pa.activate=void 0;var X2=Ee(),Y2=Yo(),J2=Qv(),Q2=V2(Ju()),yC=(t,e)=>{let n=Q2.default.get(t.uri),r=n.resolveAllAssignmentsWithQuery(e),i=[];for(let s of r){if(s.node.type!==X2.ASTType.AssignmentStatement)continue;let o=s.node,a=n.resolveNamespace(o.variable,!0);if(a==null)continue;let u=a?.label??(0,Y2.createExpressionId)(o.variable),l=a?.kind?(0,J2.getSymbolItemKind)(a.kind):13,c={line:o.variable.start.line-1,character:o.variable.start.character-1},h={line:o.variable.end.line-1,character:o.variable.end.character-1};i.push({name:u,containerName:u,kind:l,location:{uri:t.uri,range:{start:c,end:h}}})}return i};function Z2(t){t.connection.onDocumentSymbol(async e=>{let n=await t.fs.getTextDocument(e.textDocument.uri);return n==null?void 0:t.documentManager.get(n).document?yC(n,""):[]}),t.connection.onWorkspaceSymbol(e=>{let n=[];for(let r of t.fs.getAllTextDocuments())t.documentManager.get(r).document&&n.push(...yC(r,e.query));return n})}pa.activate=Z2});var kd=m(lr=>{"use strict";Object.defineProperty(lr,"__esModule",{value:!0});lr.buildTokens=lr.semanticTokensLegend=lr.SemanticTokenModifier=lr.SemanticTokenType=void 0;var Ht=Yr(),W=Ee(),eU=X_(),vC=(t,e)=>!!eU.miniscriptMeta.getDefinition(t,e),Z;(function(t){t[t.Keyword=0]="Keyword",t[t.String=1]="String",t[t.Number=2]="Number",t[t.Variable=3]="Variable",t[t.Property=4]="Property",t[t.Function=5]="Function",t[t.Parameter=6]="Parameter",t[t.Operator=7]="Operator",t[t.Comment=8]="Comment",t[t.Constant=9]="Constant",t[t.Punctuator=10]="Punctuator"})(Z=lr.SemanticTokenType||(lr.SemanticTokenType={}));var J_;(function(t){t[t.Declaration=0]="Declaration",t[t.Definition=1]="Definition",t[t.Readonly=2]="Readonly",t[t.Static=3]="Static",t[t.Deprecated=4]="Deprecated",t[t.Abstract=5]="Abstract",t[t.Async=6]="Async",t[t.Modification=7]="Modification",t[t.Documentation=8]="Documentation",t[t.DefaultLibrary=9]="DefaultLibrary"})(J_=lr.SemanticTokenModifier||(lr.SemanticTokenModifier={}));lr.semanticTokensLegend={tokenTypes:["keyword","string","number","variable","property","function","parameter","operator","comment","constant","punctuator"],tokenModifiers:["declaration","definition","readonly","static","deprecated","abstract","async","modification","documentation","defaultLibrary"]};var _C=t=>1<<t,Q_=class{constructor(e,n){this._lexer=e,this._builder=n,this._validator=new W.ParserValidatorm}next(){this.previousToken=this.token,this.token=this._lexer.next()}isType(e){return this.token!==null&&e===this.token.type}consume(e){return e(this.token)?(this.next(),!0):!1}consumeMany(e){return e(this.token)?(this.next(),!0):!1}requireType(e){let n=this.token;return this.token.type!==e?null:(this.next(),n)}requireToken(e){let n=this.token;return e(n)?(this.next(),n):null}requireTokenOfAny(e){let n=this.token;return e(n)?(this.next(),n):null}skipNewlines(){let e=this;for(;;){if(W.Selectors.Comment(e.token))this._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length+2,Z.Comment,0);else if(!W.Selectors.EndOfLine(e.token))break;e.next()}}processIdentifier(e=!1,n=!1){let r=this,i=r.requireType(W.TokenType.Identifier);if(i)if(n)r._builder.push(i.start.line-1,i.start.character-1,i.value.length,Z.Parameter,0);else if(e){let o=vC(["any"],i.value)?_C(J_.DefaultLibrary):0;r._builder.push(i.start.line-1,i.start.character-1,i.value.length,Z.Property,o)}else{let o=vC(["general"],i.value)?_C(J_.DefaultLibrary):0;r._builder.push(i.start.line-1,i.start.character-1,i.value.length,Z.Variable,o)}}processLiteral(){let e=this.token;switch(e.type){case W.TokenType.StringLiteral:{this._builder.push(e.start.line-1,e.start.character-1,e.raw.length,Z.String,0);break}case W.TokenType.NumericLiteral:{this._builder.push(e.start.line-1,e.start.character-1,e.raw.length,Z.Number,0);break}case W.TokenType.BooleanLiteral:case W.TokenType.NilLiteral:{this._builder.push(e.start.line-1,e.start.character-1,e.raw.length,Z.Constant,0);break}}this.next()}processAtom(e=!1,n=!1){let r=this;if(Ht.Selectors.Envar(r.token))return r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Keyword,0),r.next(),r.processFeatureEnvarExpression();if(Ht.Selectors.Inject(r.token))return r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Keyword,0),r.next(),r.processFeatureInjectExpression();if(Ht.Selectors.Line(r.token)){r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Keyword,0),r.next();return}else if(Ht.Selectors.File(r.token)){r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Keyword,0),r.next();return}if(r._validator.isLiteral(r.token.type))return r.processLiteral();if(r.isType(W.TokenType.Identifier))return r.processIdentifier()}processQuantity(e=!1,n=!1){let r=this;if(!W.Selectors.LParenthesis(r.token))return r.processAtom(e,n);r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0),r.next(),r.skipNewlines(),r.processExpr();let i=r.requireToken(W.Selectors.RParenthesis);i&&r._builder.push(i.start.line-1,i.start.character-1,i.value.length,Z.Punctuator,0)}processList(e=!1,n=!1){let r=this;if(!W.Selectors.SLBracket(r.token))return r.processQuantity(e,n);if(r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0),r.next(),W.Selectors.SRBracket(r.token))r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0),r.next();else for(r.skipNewlines();!W.Selectors.EndOfFile(r.token);){if(W.Selectors.SRBracket(r.token)){r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0),r.next();break}if(r.processExpr(),W.Selectors.MapSeperator(r.token)&&(r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0),r.next(),r.skipNewlines()),W.Selectors.SRBracket(r.token)){r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0),r.next();break}}}processMap(e=!1,n=!1){let r=this;if(!W.Selectors.CLBracket(r.token))return r.processList(e,n);if(r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0),r.next(),W.Selectors.CRBracket(r.token))r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0),r.next();else for(r.skipNewlines();!W.Selectors.EndOfFile(r.token);){if(W.Selectors.CRBracket(r.token)){r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0),r.next();break}r.processExpr();let i=r.requireToken(W.Selectors.MapKeyValueSeperator);if(!i)return;if(r._builder.push(i.start.line-1,i.start.character-1,i.value.length,Z.Punctuator,0),r.skipNewlines(),r.processExpr(),W.Selectors.MapSeperator(r.token)&&(r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0),r.next(),r.skipNewlines()),W.Selectors.CRBracket(r.token)){r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0),r.next();break}}}processCallArgs(){let e=this;if(W.Selectors.LParenthesis(e.token))if(e._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length,Z.Punctuator,0),e.next(),W.Selectors.RParenthesis(e.token))e._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length,Z.Punctuator,0),e.next();else for(;!W.Selectors.EndOfFile(e.token);){e.skipNewlines(),e.processExpr(),e.skipNewlines();let n=e.requireTokenOfAny(W.SelectorGroups.CallArgsEnd);if(!n)return;if(W.Selectors.RParenthesis(n)){e._builder.push(n.start.line-1,n.start.character-1,n.value.length,Z.Punctuator,0);break}else if(!W.Selectors.ArgumentSeperator(n))break}}processCallExpr(e=!1,n=!1){let r=this;for(r.processMap(e,n);!W.Selectors.EndOfFile(r.token);)if(W.Selectors.MemberSeperator(r.token))r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0),r.next(),r.skipNewlines(),r.processIdentifier(!0);else if(W.Selectors.SLBracket(r.token)&&!r.token.afterSpace){r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0),r.next(),r.skipNewlines(),W.Selectors.SliceSeperator(r.token)?(r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0),r.next(),r.skipNewlines(),W.Selectors.SRBracket(r.token)?r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0):r.processExpr()):(r.processExpr(),W.Selectors.SliceSeperator(r.token)&&(r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0),r.next(),r.skipNewlines(),W.Selectors.SRBracket(r.token)?r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0):r.processExpr()));let i=r.requireToken(W.Selectors.SRBracket);if(!i)return;r._builder.push(i.start.line-1,i.start.character-1,i.value.length,Z.Punctuator,0)}else if(W.Selectors.LParenthesis(r.token)&&(!e||!r.token.afterSpace))r.processCallArgs();else break}processPower(e=!1,n=!1){let r=this;r.processCallExpr(e,n),W.Selectors.Power(r.token)&&(r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Operator,0),r.next(),r.skipNewlines(),r.processCallExpr())}processAddressOf(e=!1,n=!1){let r=this;if(!W.Selectors.Reference(r.token))return r.processPower(e,n);r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0),r.next(),r.skipNewlines(),r.processPower()}processNew(e=!1,n=!1){let r=this;if(!W.Selectors.New(r.token))return r.processAddressOf(e,n);r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Keyword,0),r.next(),r.skipNewlines(),r.processNew()}processUnaryMinus(e=!1,n=!1){let r=this;if(!W.Selectors.Minus(r.token))return r.processNew(e,n);r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Operator,0),r.next(),r.skipNewlines(),r.processNew()}processMultDiv(e=!1,n=!1){let r=this;for(r.processUnaryMinus(e,n);W.SelectorGroups.MultiDivOperators(r.token);)r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Operator,0),r.next(),r.skipNewlines(),r.processUnaryMinus()}processBitwise(e=!1,n=!1){let r=this;for(r.processMultDiv(e,n);Ht.SelectorGroups.BitwiseOperators(r.token);)r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Operator,0),r.next(),r.skipNewlines(),r.processMultDiv()}processAddSub(e=!1,n=!1){let r=this;for(r.processBitwise(e,n);W.Selectors.Plus(r.token)||W.Selectors.Minus(r.token)&&(!n||!r.token.afterSpace||r._lexer.isAtWhitespace());)r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Operator,0),r.next(),r.skipNewlines(),r.processBitwise()}processComparisons(e=!1,n=!1){let r=this;if(r.processAddSub(e,n),!!W.SelectorGroups.ComparisonOperators(r.token))do r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Operator,0),r.next(),r.skipNewlines(),r.processAddSub();while(W.SelectorGroups.ComparisonOperators(r.token))}processBitwiseAnd(e=!1,n=!1){let r=this;for(r.processComparisons(e,n);Ht.Selectors.BitwiseAnd(r.token);)r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0),r.next(),r.processComparisons()}processBitwiseOr(e=!1,n=!1){let r=this;for(r.processBitwiseAnd(e,n);Ht.Selectors.BitwiseOr(r.token);)r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0),r.next(),r.processBitwiseAnd()}processIsa(e=!1,n=!1){let r=this;r.processBitwiseOr(e,n),W.Selectors.Isa(r.token)&&(r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Keyword,0),r.next(),r.skipNewlines(),r.processBitwiseOr())}processNot(e=!1,n=!1){let r=this;if(W.Selectors.Not(r.token)){r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Keyword,0),r.next(),r.skipNewlines(),r.processIsa();return}r.processIsa(e,n)}processAnd(e=!1,n=!1){let r=this;for(r.processNot(e,n);W.Selectors.And(r.token);)r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Keyword,0),r.next(),r.skipNewlines(),r.processNot()}processOr(e=!1,n=!1){let r=this;for(r.processAnd(e,n);W.Selectors.Or(r.token);)r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Keyword,0),r.next(),r.skipNewlines(),r.processAnd()}processFunctionDeclaration(e=!1,n=!1){let r=this;if(!W.Selectors.Function(r.token))return r.processOr(e,n);if(r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Keyword,0),r.next(),!W.SelectorGroups.BlockEndOfLine(r.token)){let i=r.requireToken(W.Selectors.LParenthesis);if(!i)return;for(r._builder.push(i.start.line-1,i.start.character-1,i.value.length,Z.Punctuator,0);!W.SelectorGroups.FunctionDeclarationArgEnd(r.token)&&(r.processIdentifier(!1,!0),r.consume(W.Selectors.Assign)&&(r._builder.push(r.previousToken.start.line-1,r.previousToken.start.character-1,r.previousToken.value.length,Z.Operator,0),r.processExpr()),!W.Selectors.RParenthesis(r.token));){r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0);let o=r.requireToken(W.Selectors.ArgumentSeperator);if(!o)return;if(r._builder.push(o.start.line-1,o.start.character-1,o.value.length,Z.Punctuator,0),W.Selectors.RParenthesis(r.token)){r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0);break}}let s=r.requireToken(W.Selectors.RParenthesis);if(!s)return;r._builder.push(s.start.line-1,s.start.character-1,s.value.length,Z.Punctuator,0)}}processExpr(e=!1,n=!1){this.processFunctionDeclaration(e,n)}processForShortcutStatement(){this.processShortcutStatement()}processForStatement(){let e=this;e.processIdentifier();let n=e.requireToken(W.Selectors.In);n&&(e._builder.push(n.start.line-1,n.start.character-1,n.value.length,Z.Keyword,0),e.processExpr(),W.SelectorGroups.BlockEndOfLine(e.token)||e.processForShortcutStatement())}processWhileShortcutStatement(){this.processShortcutStatement()}processWhileStatement(){let e=this;if(e.processExpr(),!W.SelectorGroups.BlockEndOfLine(e.token))return e.processWhileShortcutStatement()}processIfShortcutStatement(){let e=this;e.processShortcutStatement(),W.Selectors.Else(e.token)&&(e._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length,Z.Keyword,0),e.next(),e.processShortcutStatement())}processNextIfClause(e){let n=this;switch(e){case W.ASTType.ElseifClause:{n.processExpr();let r=n.requireToken(W.Selectors.Then);if(!r)return;n._builder.push(r.start.line-1,r.start.character-1,r.value.length,Z.Keyword,0);break}case W.ASTType.ElseClause:break}}processIfStatement(){let e=this;e.processExpr();let n=e.requireToken(W.Selectors.Then);n&&(e._builder.push(n.start.line-1,n.start.character-1,n.value.length,Z.Keyword,0),W.SelectorGroups.BlockEndOfLine(e.token)||e.processIfShortcutStatement())}processReturnStatement(){let e=this;W.SelectorGroups.ReturnStatementEnd(e.token)||e.processExpr()}processAssignment(){let e=this,n=e.token;if(e.processExpr(!0,!0),W.SelectorGroups.AssignmentEndOfExpr(e.token))return;if(W.Selectors.Assign(e.token)){e._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length,Z.Operator,0),e.next(),e.processExpr();return}else if(W.SelectorGroups.AssignmentShorthand(e.token)){let i=e.token;e._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length,Z.Operator,0),e.next(),e.processExpr();return}let r=[];for(;!W.Selectors.EndOfFile(e.token)&&(e.processExpr(),!(W.SelectorGroups.BlockEndOfLine(e.token)||W.Selectors.Else(e.token)));){if(W.Selectors.ArgumentSeperator(e.token)){e.next(),e.skipNewlines();continue}let i=e.requireTokenOfAny(W.SelectorGroups.AssignmentCommandArgs);if(!i)return;if(W.Selectors.EndOfLine(i)||W.Selectors.EndOfFile(i))break}r.length}processShortcutStatement(){let e=this;if(W.TokenType.Keyword===e.token.type&&W.Keyword.Not!==e.token.value){let n=e.token.value;switch(this._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length,Z.Keyword,0),n){case W.Keyword.Return:e.next(),e.processReturnStatement();case W.Keyword.Continue:{e.next();return}case W.Keyword.Break:{e.next();return}default:}}return e.processAssignment()}processPathSegment(){let e=this;if(this.token.type===W.ASTType.StringLiteral){let r=this.token;e._builder.push(r.start.line-1,r.start.character-1,r.raw.length,Z.String,0),this.next();return}let n="";for(;!Ht.SelectorGroups.PathSegmentEnd(e.token);)e._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length,Z.String,0),n=n+e.token.value,e.next();return e.consumeMany(Ht.SelectorGroups.PathSegmentEnd)&&e._builder.push(e.previousToken.start.line-1,e.previousToken.start.character-1,e.previousToken.value.length,Z.Punctuator,0),n}processFeatureEnvarExpression(){let e=this;e._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length,Z.String,0),e.next()}processFeatureInjectExpression(){this.processPathSegment()}processFeatureImportStatement(){let e=this;e.processIdentifier(),e.consume(Ht.Selectors.From)&&(e._builder.push(e.previousToken.start.line-1,e.previousToken.start.character-1,e.previousToken.value.length,Z.Keyword,0),e.processPathSegment())}processFeatureIncludeStatement(){this.processPathSegment()}processNativeImportCodeStatement(){let e=this;if(e.consume(W.Selectors.LParenthesis)){if(e._builder.push(e.previousToken.start.line-1,e.previousToken.start.character-1,e.previousToken.value.length,Z.Punctuator,0),W.TokenType.StringLiteral===e.token.type){let n=e.token;e._builder.push(n.start.line-1,n.start.character-1,n.raw.length,Z.String,0),e.next()}else return;if(e.consume(W.Selectors.ImportCodeSeperator)){if(e._builder.push(e.previousToken.start.line-1,e.previousToken.start.character-1,e.previousToken.value.length,Z.Punctuator,0),!e.isType(W.TokenType.StringLiteral))return;let n=e.token;e._builder.push(n.start.line-1,n.start.character-1,n.raw.length,Z.String,0),e.next()}e.consume(W.Selectors.RParenthesis)&&e._builder.push(e.previousToken.start.line-1,e.previousToken.start.character-1,e.previousToken.value.length,Z.Punctuator,0)}}processKeyword(){let e=this,n=e.token.value;switch(this._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length,Z.Keyword,0),n){case W.Keyword.Return:{e.next(),e.processReturnStatement();return}case W.Keyword.If:{e.next(),e.processIfStatement();return}case W.Keyword.ElseIf:{e.next(),e.processNextIfClause(W.ASTType.ElseifClause);return}case W.Keyword.Else:{e.next(),e.processNextIfClause(W.ASTType.ElseClause);return}case W.Keyword.While:{e.next(),e.processWhileStatement();return}case W.Keyword.For:{e.next(),e.processForStatement();return}case W.Keyword.EndFunction:{e.next();return}case W.Keyword.EndFor:{e.next();return}case W.Keyword.EndWhile:{e.next();return}case W.Keyword.EndIf:{e.next();return}case W.Keyword.Continue:{e.next();return}case W.Keyword.Break:{e.next();return}case Ht.GreybelKeyword.Include:case Ht.GreybelKeyword.IncludeWithComment:{e.next(),e.processFeatureIncludeStatement();return}case Ht.GreybelKeyword.Import:case Ht.GreybelKeyword.ImportWithComment:{e.next(),e.processFeatureImportStatement();return}case Ht.GreybelKeyword.Envar:{e.next(),e.processFeatureEnvarExpression();return}case Ht.GreybelKeyword.Inject:{e.next(),e.processFeatureInjectExpression();return}case Ht.GreybelKeyword.Debugger:e.next()}}processStatement(){let e=this;if(W.TokenType.Keyword===e.token.type&&W.Keyword.Not!==e.token.value){e.processKeyword();return}e.processAssignment()}process(){let e=this;for(e.next();!W.Selectors.EndOfFile(e.token)&&(e.skipNewlines(),!W.Selectors.EndOfFile(e.token));)e.processStatement()}};function tU(t,e){let n=new Ht.Lexer(e.content,{unsafe:!0});return new Q_(n,t).process(),t}lr.buildTokens=tU});var TC=m(wd=>{"use strict";Object.defineProperty(wd,"__esModule",{value:!0});wd.activate=void 0;var nU=kd();function rU(t){t.connection.languages.semanticTokens.on(async e=>{let n=await t.fs.getTextDocument(e.textDocument.uri);if(n==null)return;let r=t.documentManager.get(n);if(!r.document)return;let i=t.createSemanticTokensBuilder();return(0,nU.buildTokens)(i,r),i.build()})}wd.activate=rU});var SC=m(xd=>{"use strict";Object.defineProperty(xd,"__esModule",{value:!0});xd.buildFoldingRanges=void 0;var Zr=Ee(),Z_=bm(),iU=Pf();function sU(t){let e=[];return new iU.ScraperWalker((r,i)=>{if(r.start.line===r.end.line)return null;switch(r.type){case Zr.ASTType.Comment:return e.push({startLine:r.start.line-1,endLine:r.end.line-1,kind:Z_.FoldingRangeKind.Comment}),null;case Zr.ASTType.MapConstructorExpression:case Zr.ASTType.ListConstructorExpression:case Zr.ASTType.StringLiteral:case Zr.ASTType.WhileStatement:case Zr.ASTType.ForGenericStatement:case Zr.ASTType.FunctionDeclaration:return e.push({startLine:r.start.line-1,endLine:r.end.line-1,kind:Z_.FoldingRangeKind.Region}),null;case Zr.ASTType.IfClause:case Zr.ASTType.ElseifClause:case Zr.ASTType.ElseClause:return e.push({startLine:r.start.line-1,endLine:r.end.line-2,kind:Z_.FoldingRangeKind.Region}),null}return null}).visit(t.document),e}xd.buildFoldingRanges=sU});var kC=m(Ed=>{"use strict";Object.defineProperty(Ed,"__esModule",{value:!0});Ed.activate=void 0;var oU=SC();function aU(t){t.connection.languages.foldingRange.on(async e=>{let n=await t.fs.getTextDocument(e.textDocument.uri);if(n==null)return;let r=t.documentManager.get(n);if(r.document)return(0,oU.buildFoldingRanges)(r)})}Ed.activate=aU});var Cd=m((fV,AC)=>{var Qu=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,uU=typeof AbortController=="function",Ad=uU?AbortController:class{constructor(){this.signal=new wC}abort(e=new Error("This operation was aborted")){this.signal.reason=this.signal.reason||e,this.signal.aborted=!0,this.signal.dispatchEvent({type:"abort",target:this.signal})}},lU=typeof AbortSignal=="function",cU=typeof Ad.AbortSignal=="function",wC=lU?AbortSignal:cU?Ad.AbortController:class{constructor(){this.reason=void 0,this.aborted=!1,this._listeners=[]}dispatchEvent(e){e.type==="abort"&&(this.aborted=!0,this.onabort(e),this._listeners.forEach(n=>n(e),this))}onabort(){}addEventListener(e,n){e==="abort"&&this._listeners.push(n)}removeEventListener(e,n){e==="abort"&&(this._listeners=this._listeners.filter(r=>r!==n))}},rT=new Set,eT=(t,e)=>{let n=`LRU_CACHE_OPTION_${t}`;Od(n)&&iT(n,`${t} option`,`options.${e}`,ma)},tT=(t,e)=>{let n=`LRU_CACHE_METHOD_${t}`;if(Od(n)){let{prototype:r}=ma,{get:i}=Object.getOwnPropertyDescriptor(r,t);iT(n,`${t} method`,`cache.${e}()`,i)}},hU=(t,e)=>{let n=`LRU_CACHE_PROPERTY_${t}`;if(Od(n)){let{prototype:r}=ma,{get:i}=Object.getOwnPropertyDescriptor(r,t);iT(n,`${t} property`,`cache.${e}`,i)}},xC=(...t)=>{typeof process=="object"&&process&&typeof process.emitWarning=="function"?process.emitWarning(...t):console.error(...t)},Od=t=>!rT.has(t),iT=(t,e,n,r)=>{rT.add(t);let i=`The ${e} is deprecated. Please use ${n} instead.`;xC(i,"DeprecationWarning",t,r)},rs=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),EC=t=>rs(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?ga:null:null,ga=class extends Array{constructor(e){super(e),this.fill(0)}},nT=class{constructor(e){if(e===0)return[];let n=EC(e);this.heap=new n(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},ma=class t{constructor(e={}){let{max:n=0,ttl:r,ttlResolution:i=1,ttlAutopurge:s,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:u,dispose:l,disposeAfter:c,noDisposeOnSet:h,noUpdateTTL:f,maxSize:g=0,maxEntrySize:v=0,sizeCalculation:b,fetchMethod:O,fetchContext:A,noDeleteOnFetchRejection:k,noDeleteOnStaleGet:S,allowStaleOnFetchRejection:_,allowStaleOnFetchAbort:N,ignoreFetchAbort:R}=e,{length:G,maxAge:ie,stale:ue}=e instanceof t?{}:e;if(n!==0&&!rs(n))throw new TypeError("max option must be a nonnegative integer");let K=n?EC(n):Array;if(!K)throw new Error("invalid max value: "+n);if(this.max=n,this.maxSize=g,this.maxEntrySize=v||this.maxSize,this.sizeCalculation=b||G,this.sizeCalculation){if(!this.maxSize&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(this.fetchMethod=O||null,this.fetchMethod&&typeof this.fetchMethod!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.fetchContext=A,!this.fetchMethod&&A!==void 0)throw new TypeError("cannot set fetchContext without fetchMethod");if(this.keyMap=new Map,this.keyList=new Array(n).fill(null),this.valList=new Array(n).fill(null),this.next=new K(n),this.prev=new K(n),this.head=0,this.tail=0,this.free=new nT(n),this.initialFill=1,this.size=0,typeof l=="function"&&(this.dispose=l),typeof c=="function"?(this.disposeAfter=c,this.disposed=[]):(this.disposeAfter=null,this.disposed=null),this.noDisposeOnSet=!!h,this.noUpdateTTL=!!f,this.noDeleteOnFetchRejection=!!k,this.allowStaleOnFetchRejection=!!_,this.allowStaleOnFetchAbort=!!N,this.ignoreFetchAbort=!!R,this.maxEntrySize!==0){if(this.maxSize!==0&&!rs(this.maxSize))throw new TypeError("maxSize must be a positive integer if specified");if(!rs(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.initializeSizeTracking()}if(this.allowStale=!!u||!!ue,this.noDeleteOnStaleGet=!!S,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=rs(i)||i===0?i:1,this.ttlAutopurge=!!s,this.ttl=r||ie||0,this.ttl){if(!rs(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.initializeTTLTracking()}if(this.max===0&&this.ttl===0&&this.maxSize===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.max&&!this.maxSize){let C="LRU_CACHE_UNBOUNDED";Od(C)&&(rT.add(C),xC("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",C,t))}ue&&eT("stale","allowStale"),ie&&eT("maxAge","ttl"),G&&eT("length","sizeCalculation")}getRemainingTTL(e){return this.has(e,{updateAgeOnHas:!1})?1/0:0}initializeTTLTracking(){this.ttls=new ga(this.max),this.starts=new ga(this.max),this.setItemTTL=(r,i,s=Qu.now())=>{if(this.starts[r]=i!==0?s:0,this.ttls[r]=i,i!==0&&this.ttlAutopurge){let o=setTimeout(()=>{this.isStale(r)&&this.delete(this.keyList[r])},i+1);o.unref&&o.unref()}},this.updateItemAge=r=>{this.starts[r]=this.ttls[r]!==0?Qu.now():0},this.statusTTL=(r,i)=>{r&&(r.ttl=this.ttls[i],r.start=this.starts[i],r.now=e||n(),r.remainingTTL=r.now+r.ttl-r.start)};let e=0,n=()=>{let r=Qu.now();if(this.ttlResolution>0){e=r;let i=setTimeout(()=>e=0,this.ttlResolution);i.unref&&i.unref()}return r};this.getRemainingTTL=r=>{let i=this.keyMap.get(r);return i===void 0?0:this.ttls[i]===0||this.starts[i]===0?1/0:this.starts[i]+this.ttls[i]-(e||n())},this.isStale=r=>this.ttls[r]!==0&&this.starts[r]!==0&&(e||n())-this.starts[r]>this.ttls[r]}updateItemAge(e){}statusTTL(e,n){}setItemTTL(e,n,r){}isStale(e){return!1}initializeSizeTracking(){this.calculatedSize=0,this.sizes=new ga(this.max),this.removeItemSize=e=>{this.calculatedSize-=this.sizes[e],this.sizes[e]=0},this.requireSize=(e,n,r,i)=>{if(this.isBackgroundFetch(n))return 0;if(!rs(r))if(i){if(typeof i!="function")throw new TypeError("sizeCalculation must be a function");if(r=i(n,e),!rs(r))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return r},this.addItemSize=(e,n,r)=>{if(this.sizes[e]=n,this.maxSize){let i=this.maxSize-this.sizes[e];for(;this.calculatedSize>i;)this.evict(!0)}this.calculatedSize+=this.sizes[e],r&&(r.entrySize=n,r.totalCalculatedSize=this.calculatedSize)}}removeItemSize(e){}addItemSize(e,n){}requireSize(e,n,r,i){if(r||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache")}*indexes({allowStale:e=this.allowStale}={}){if(this.size)for(let n=this.tail;!(!this.isValidIndex(n)||((e||!this.isStale(n))&&(yield n),n===this.head));)n=this.prev[n]}*rindexes({allowStale:e=this.allowStale}={}){if(this.size)for(let n=this.head;!(!this.isValidIndex(n)||((e||!this.isStale(n))&&(yield n),n===this.tail));)n=this.next[n]}isValidIndex(e){return e!==void 0&&this.keyMap.get(this.keyList[e])===e}*entries(){for(let e of this.indexes())this.valList[e]!==void 0&&this.keyList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield[this.keyList[e],this.valList[e]])}*rentries(){for(let e of this.rindexes())this.valList[e]!==void 0&&this.keyList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield[this.keyList[e],this.valList[e]])}*keys(){for(let e of this.indexes())this.keyList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield this.keyList[e])}*rkeys(){for(let e of this.rindexes())this.keyList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield this.keyList[e])}*values(){for(let e of this.indexes())this.valList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield this.valList[e])}*rvalues(){for(let e of this.rindexes())this.valList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield this.valList[e])}[Symbol.iterator](){return this.entries()}find(e,n){for(let r of this.indexes()){let i=this.valList[r],s=this.isBackgroundFetch(i)?i.__staleWhileFetching:i;if(s!==void 0&&e(s,this.keyList[r],this))return this.get(this.keyList[r],n)}}forEach(e,n=this){for(let r of this.indexes()){let i=this.valList[r],s=this.isBackgroundFetch(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(n,s,this.keyList[r],this)}}rforEach(e,n=this){for(let r of this.rindexes()){let i=this.valList[r],s=this.isBackgroundFetch(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(n,s,this.keyList[r],this)}}get prune(){return tT("prune","purgeStale"),this.purgeStale}purgeStale(){let e=!1;for(let n of this.rindexes({allowStale:!0}))this.isStale(n)&&(this.delete(this.keyList[n]),e=!0);return e}dump(){let e=[];for(let n of this.indexes({allowStale:!0})){let r=this.keyList[n],i=this.valList[n],s=this.isBackgroundFetch(i)?i.__staleWhileFetching:i;if(s===void 0)continue;let o={value:s};if(this.ttls){o.ttl=this.ttls[n];let a=Qu.now()-this.starts[n];o.start=Math.floor(Date.now()-a)}this.sizes&&(o.size=this.sizes[n]),e.unshift([r,o])}return e}load(e){this.clear();for(let[n,r]of e){if(r.start){let i=Date.now()-r.start;r.start=Qu.now()-i}this.set(n,r.value,r)}}dispose(e,n,r){}set(e,n,{ttl:r=this.ttl,start:i,noDisposeOnSet:s=this.noDisposeOnSet,size:o=0,sizeCalculation:a=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,status:l}={}){if(o=this.requireSize(e,n,o,a),this.maxEntrySize&&o>this.maxEntrySize)return l&&(l.set="miss",l.maxEntrySizeExceeded=!0),this.delete(e),this;let c=this.size===0?void 0:this.keyMap.get(e);if(c===void 0)c=this.newIndex(),this.keyList[c]=e,this.valList[c]=n,this.keyMap.set(e,c),this.next[this.tail]=c,this.prev[c]=this.tail,this.tail=c,this.size++,this.addItemSize(c,o,l),l&&(l.set="add"),u=!1;else{this.moveToTail(c);let h=this.valList[c];if(n!==h){if(this.isBackgroundFetch(h)?h.__abortController.abort(new Error("replaced")):s||(this.dispose(h,e,"set"),this.disposeAfter&&this.disposed.push([h,e,"set"])),this.removeItemSize(c),this.valList[c]=n,this.addItemSize(c,o,l),l){l.set="replace";let f=h&&this.isBackgroundFetch(h)?h.__staleWhileFetching:h;f!==void 0&&(l.oldValue=f)}}else l&&(l.set="update")}if(r!==0&&this.ttl===0&&!this.ttls&&this.initializeTTLTracking(),u||this.setItemTTL(c,r,i),this.statusTTL(l,c),this.disposeAfter)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return this}newIndex(){return this.size===0?this.tail:this.size===this.max&&this.max!==0?this.evict(!1):this.free.length!==0?this.free.pop():this.initialFill++}pop(){if(this.size){let e=this.valList[this.head];return this.evict(!0),e}}evict(e){let n=this.head,r=this.keyList[n],i=this.valList[n];return this.isBackgroundFetch(i)?i.__abortController.abort(new Error("evicted")):(this.dispose(i,r,"evict"),this.disposeAfter&&this.disposed.push([i,r,"evict"])),this.removeItemSize(n),e&&(this.keyList[n]=null,this.valList[n]=null,this.free.push(n)),this.head=this.next[n],this.keyMap.delete(r),this.size--,n}has(e,{updateAgeOnHas:n=this.updateAgeOnHas,status:r}={}){let i=this.keyMap.get(e);if(i!==void 0)if(this.isStale(i))r&&(r.has="stale",this.statusTTL(r,i));else return n&&this.updateItemAge(i),r&&(r.has="hit"),this.statusTTL(r,i),!0;else r&&(r.has="miss");return!1}peek(e,{allowStale:n=this.allowStale}={}){let r=this.keyMap.get(e);if(r!==void 0&&(n||!this.isStale(r))){let i=this.valList[r];return this.isBackgroundFetch(i)?i.__staleWhileFetching:i}}backgroundFetch(e,n,r,i){let s=n===void 0?void 0:this.valList[n];if(this.isBackgroundFetch(s))return s;let o=new Ad;r.signal&&r.signal.addEventListener("abort",()=>o.abort(r.signal.reason));let a={signal:o.signal,options:r,context:i},u=(g,v=!1)=>{let{aborted:b}=o.signal,O=r.ignoreFetchAbort&&g!==void 0;return r.status&&(b&&!v?(r.status.fetchAborted=!0,r.status.fetchError=o.signal.reason,O&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),b&&!O&&!v?c(o.signal.reason):(this.valList[n]===f&&(g===void 0?f.__staleWhileFetching?this.valList[n]=f.__staleWhileFetching:this.delete(e):(r.status&&(r.status.fetchUpdated=!0),this.set(e,g,a.options))),g)},l=g=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=g),c(g)),c=g=>{let{aborted:v}=o.signal,b=v&&r.allowStaleOnFetchAbort,O=b||r.allowStaleOnFetchRejection,A=O||r.noDeleteOnFetchRejection;if(this.valList[n]===f&&(!A||f.__staleWhileFetching===void 0?this.delete(e):b||(this.valList[n]=f.__staleWhileFetching)),O)return r.status&&f.__staleWhileFetching!==void 0&&(r.status.returnedStale=!0),f.__staleWhileFetching;if(f.__returned===f)throw g},h=(g,v)=>{this.fetchMethod(e,s,a).then(b=>g(b),v),o.signal.addEventListener("abort",()=>{(!r.ignoreFetchAbort||r.allowStaleOnFetchAbort)&&(g(),r.allowStaleOnFetchAbort&&(g=b=>u(b,!0)))})};r.status&&(r.status.fetchDispatched=!0);let f=new Promise(h).then(u,l);return f.__abortController=o,f.__staleWhileFetching=s,f.__returned=null,n===void 0?(this.set(e,f,{...a.options,status:void 0}),n=this.keyMap.get(e)):this.valList[n]=f,f}isBackgroundFetch(e){return e&&typeof e=="object"&&typeof e.then=="function"&&Object.prototype.hasOwnProperty.call(e,"__staleWhileFetching")&&Object.prototype.hasOwnProperty.call(e,"__returned")&&(e.__returned===e||e.__returned===null)}async fetch(e,{allowStale:n=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,ttl:s=this.ttl,noDisposeOnSet:o=this.noDisposeOnSet,size:a=0,sizeCalculation:u=this.sizeCalculation,noUpdateTTL:l=this.noUpdateTTL,noDeleteOnFetchRejection:c=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:h=this.allowStaleOnFetchRejection,ignoreFetchAbort:f=this.ignoreFetchAbort,allowStaleOnFetchAbort:g=this.allowStaleOnFetchAbort,fetchContext:v=this.fetchContext,forceRefresh:b=!1,status:O,signal:A}={}){if(!this.fetchMethod)return O&&(O.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:i,status:O});let k={allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:i,ttl:s,noDisposeOnSet:o,size:a,sizeCalculation:u,noUpdateTTL:l,noDeleteOnFetchRejection:c,allowStaleOnFetchRejection:h,allowStaleOnFetchAbort:g,ignoreFetchAbort:f,status:O,signal:A},S=this.keyMap.get(e);if(S===void 0){O&&(O.fetch="miss");let _=this.backgroundFetch(e,S,k,v);return _.__returned=_}else{let _=this.valList[S];if(this.isBackgroundFetch(_)){let ue=n&&_.__staleWhileFetching!==void 0;return O&&(O.fetch="inflight",ue&&(O.returnedStale=!0)),ue?_.__staleWhileFetching:_.__returned=_}let N=this.isStale(S);if(!b&&!N)return O&&(O.fetch="hit"),this.moveToTail(S),r&&this.updateItemAge(S),this.statusTTL(O,S),_;let R=this.backgroundFetch(e,S,k,v),G=R.__staleWhileFetching!==void 0,ie=G&&n;return O&&(O.fetch=G&&N?"stale":"refresh",ie&&N&&(O.returnedStale=!0)),ie?R.__staleWhileFetching:R.__returned=R}}get(e,{allowStale:n=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,status:s}={}){let o=this.keyMap.get(e);if(o!==void 0){let a=this.valList[o],u=this.isBackgroundFetch(a);return this.statusTTL(s,o),this.isStale(o)?(s&&(s.get="stale"),u?(s&&(s.returnedStale=n&&a.__staleWhileFetching!==void 0),n?a.__staleWhileFetching:void 0):(i||this.delete(e),s&&(s.returnedStale=n),n?a:void 0)):(s&&(s.get="hit"),u?a.__staleWhileFetching:(this.moveToTail(o),r&&this.updateItemAge(o),a))}else s&&(s.get="miss")}connect(e,n){this.prev[n]=e,this.next[e]=n}moveToTail(e){e!==this.tail&&(e===this.head?this.head=this.next[e]:this.connect(this.prev[e],this.next[e]),this.connect(this.tail,e),this.tail=e)}get del(){return tT("del","delete"),this.delete}delete(e){let n=!1;if(this.size!==0){let r=this.keyMap.get(e);if(r!==void 0)if(n=!0,this.size===1)this.clear();else{this.removeItemSize(r);let i=this.valList[r];this.isBackgroundFetch(i)?i.__abortController.abort(new Error("deleted")):(this.dispose(i,e,"delete"),this.disposeAfter&&this.disposed.push([i,e,"delete"])),this.keyMap.delete(e),this.keyList[r]=null,this.valList[r]=null,r===this.tail?this.tail=this.prev[r]:r===this.head?this.head=this.next[r]:(this.next[this.prev[r]]=this.next[r],this.prev[this.next[r]]=this.prev[r]),this.size--,this.free.push(r)}}if(this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return n}clear(){for(let e of this.rindexes({allowStale:!0})){let n=this.valList[e];if(this.isBackgroundFetch(n))n.__abortController.abort(new Error("deleted"));else{let r=this.keyList[e];this.dispose(n,r,"delete"),this.disposeAfter&&this.disposed.push([n,r,"delete"])}}if(this.keyMap.clear(),this.valList.fill(null),this.keyList.fill(null),this.ttls&&(this.ttls.fill(0),this.starts.fill(0)),this.sizes&&this.sizes.fill(0),this.head=0,this.tail=0,this.initialFill=1,this.free.length=0,this.calculatedSize=0,this.size=0,this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift())}get reset(){return tT("reset","clear"),this.clear}get length(){return hU("length","size"),this.size}static get AbortController(){return Ad}static get AbortSignal(){return wC}};AC.exports=ma});var MC=m((dV,IC)=>{var uT=Object.defineProperty,fU=Object.getOwnPropertyDescriptor,dU=Object.getOwnPropertyNames,pU=Object.prototype.hasOwnProperty,gU=(t,e)=>{for(var n in e)uT(t,n,{get:e[n],enumerable:!0})},mU=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of dU(e))!pU.call(t,i)&&i!==n&&uT(t,i,{get:()=>e[i],enumerable:!(r=fU(e,i))||r.enumerable});return t},yU=t=>mU(uT({},"__esModule",{value:!0}),t),OC={};gU(OC,{ScheduleIntervalHelper:()=>sT,SchedulePostMessageHelper:()=>oT,ScheduleSetImmmediateHelper:()=>aT,schedule:()=>_U,scheduleProvider:()=>DC});IC.exports=yU(OC);var bU=Promise.prototype.then.bind(Promise.resolve()),lT=class Rd{constructor(){this.queue=[],this.sleep=0}static{this.SLEEP_LIMIT=512}static{this.QUEUE_LIMIT=1024}static isApplicable(){return!1}static createCallback(){throw new Error("Cannot create callback from base schedule helper!")}tick(){let e=this.queue,n=Math.min(e.length,Rd.QUEUE_LIMIT);this.queue=this.queue.slice(Rd.QUEUE_LIMIT);for(let r=0;r<n;bU(e[r++]));if(this.queue.length>0&&(this.sleep=0),this.sleep++<=Rd.SLEEP_LIMIT){this.nextTick();return}this.endTick()}start(){this.isTickActive()||(this.sleep=0,this.startTick())}add(e){this.queue.push(e),this.start()}},sT=class CC extends lT{constructor(){super(...arguments),this.timer=null,this.boundTick=this.tick.bind(this)}static isApplicable(){return!!globalThis.setInterval}static createCallback(){let e=new CC;return e.add.bind(e)}isTickActive(){return this.timer!==null}startTick(){this.timer=setInterval(this.boundTick,0)}nextTick(){}endTick(){clearInterval(this.timer),this.timer=null}},vU=()=>{try{return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}catch{}return!1},oT=class RC extends lT{constructor(){super(),this.id=(Math.random()+1).toString(36).substring(7),this.active=!1,self.addEventListener("message",this.onMessage.bind(this))}static isApplicable(){return!vU()&&!!self.postMessage&&!!self.addEventListener}static createCallback(){let e=new RC;return e.add.bind(e)}onMessage(e){e.source!==self||e.data!==this.id||this.tick()}isTickActive(){return this.active}startTick(){this.active=!0,self.postMessage(this.id)}nextTick(){self.postMessage(this.id)}endTick(){this.active=!1}},aT=class PC extends lT{constructor(){super(...arguments),this.immediate=null,this.boundTick=this.tick.bind(this)}static isApplicable(){return!!globalThis.setImmediate}static createCallback(){let e=new PC;return e.add.bind(e)}isTickActive(){return this.immediate!==null}startTick(){this.immediate=setImmediate(this.boundTick)}nextTick(){this.immediate=setImmediate(this.boundTick)}endTick(){clearImmediate(this.immediate),this.immediate=null}};function DC(){if(aT.isApplicable())return aT.createCallback();if(oT.isApplicable())return oT.createCallback();if(sT.isApplicable())return sT.createCallback();throw new Error("No schedule helper fulfills requirements!")}var _U=DC()});var LC=m(Bn=>{"use strict";var fT=Bn&&Bn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Bn,"__esModule",{value:!0});Bn.DocumentManager=Bn.PROCESSING_TIMEOUT=Bn.ActiveDocument=Bn.DocumentURIBuilder=void 0;var TU=fT(require("events")),SU=Yr(),kU=fT(Cd()),cT=MC(),ya=md(),wU=fT(Ju()),Pd=class{constructor(e,n=null){this.workspaceFolderUri=n,this.rootPath=e}getFromWorkspaceFolder(e){return this.workspaceFolderUri==null?(console.warn("Workspace folders are not available. Falling back to only relative paths."),ya.Utils.joinPath(this.rootPath,e).toString()):ya.Utils.joinPath(this.workspaceFolderUri,e).toString()}getFromRootPath(e){return ya.Utils.joinPath(this.rootPath,e).toString()}};Bn.DocumentURIBuilder=Pd;var Dd=class{constructor(e){this.documentManager=e.documentManager,this.content=e.content,this.textDocument=e.textDocument,this.document=e.document,this.errors=e.errors}getDirectory(){return ya.Utils.joinPath(ya.URI.parse(this.textDocument.uri),"..")}async getImportsAndIncludes(e=null){if(this.document==null)return[];let n=this.document,r=this.getDirectory(),i=this.documentManager.context,s=new Pd(r,e),o=u=>u.startsWith("/")?i.fs.findExistingPath(s.getFromWorkspaceFolder(u),s.getFromWorkspaceFolder(`${u}.src`)):i.fs.findExistingPath(s.getFromRootPath(u),s.getFromRootPath(`${u}.src`));return(await Promise.all([...n.imports.filter(u=>u.path).map(u=>o(u.path)),...n.includes.filter(u=>u.path).map(u=>o(u.path))])).filter(u=>u!=null)}async getDependencies(){if(this.document==null)return[];if(this.dependencies)return this.dependencies;let e=await this.documentManager.context.fs.getWorkspaceFolderUri(ya.URI.parse(this.textDocument.uri)),n=await this.getImportsAndIncludes(e),r=new Set([...n]);return this.dependencies=Array.from(r),this.dependencies}async getImports(e=!0){if(this.document==null)return[];let n=new Set,r=new Set([this.textDocument.uri]),i=async s=>{let o=await s.getDependencies();for(let a of o){if(r.has(a))continue;let u=await this.documentManager.open(a);r.add(a),u!==null&&(n.add(u),u.document!==null&&e&&await i(u))}};return await i(this),Array.from(n)}};Bn.ActiveDocument=Dd;Bn.PROCESSING_TIMEOUT=100;var hT=class extends TU.default{get context(){return this._context}setContext(e){return this._context=e,this}constructor(e=Bn.PROCESSING_TIMEOUT){super(),this._context=null,this._timer=null,this.results=new kU.default({ttl:1e3*60*20,ttlAutopurge:!0}),this.scheduledItems=new Map,this.tickRef=this.tick.bind(this),this.processingTimeout=e,(0,cT.schedule)(this.tickRef)}tick(){if(this.scheduledItems.size===0){this._timer=null;return}let e=Date.now(),n=Array.from(this.scheduledItems.values());for(let r=0;r<n.length;r++){let i=n[r];e-i.createdAt>this.processingTimeout&&(0,cT.schedule)(()=>this.refresh(i.document))}this._timer=setTimeout(this.tickRef,0)}refresh(e){let n=e.uri;if(!this.scheduledItems.has(n)&&this.results.has(n))return this.results.get(n);let r=this.create(e);return this.results.set(n,r),this.emit("parsed",e,r),this.scheduledItems.delete(n),r}create(e){let n=e.getText(),r=new SU.Parser(n,{unsafe:!0}),i=r.parseChunk();return this._context.documentMerger.flushCacheKey(e.uri),wU.default.analyze(e.uri,i),new Dd({documentManager:this,content:n,textDocument:e,document:i,errors:[...r.lexer.errors,...r.errors]})}schedule(e){let n=e.uri,r=e.getText();return this.results.get(n)?.content===r?!1:(this.scheduledItems.set(n,{document:e,createdAt:Date.now()}),this._timer===null&&(this._timer=setTimeout(this.tickRef,0)),!0)}async open(e){try{let n=await this.context.fs.getTextDocument(e);return n==null?null:this.get(n)}catch{return null}}get(e){return this.results.get(e.uri)||this.refresh(e)}getLatest(e,n=5e3){return new Promise(r=>{(0,cT.schedule)(()=>{if(!this.scheduledItems.has(e.uri))return r(this.get(e));let i=()=>{this.removeListener("parsed",s),r(this.get(e))},s=a=>{a.uri===e.uri&&(this.removeListener("parsed",s),clearTimeout(o),r(this.get(e)))},o=setTimeout(i,n);this.addListener("parsed",s)})})}clear(e){this.results.delete(e.uri),this.emit("cleared",e)}};Bn.DocumentManager=hT});var qC=m((gV,dT)=>{dT.exports=function(t){return NC(xU(t),t)};dT.exports.array=NC;function NC(t,e){var n=t.length,r=new Array(n),i={},s=n,o=EU(e),a=AU(t);for(e.forEach(function(l){if(!a.has(l[0])||!a.has(l[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});s--;)i[s]||u(t[s],s,new Set);return r;function u(l,c,h){if(h.has(l)){var f;try{f=", node was:"+JSON.stringify(l)}catch{f=""}throw new Error("Cyclic dependency"+f)}if(!a.has(l))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(l));if(!i[c]){i[c]=!0;var g=o.get(l)||new Set;if(g=Array.from(g),c=g.length){h.add(l);do{var v=g[--c];u(v,a.get(v),h)}while(c);h.delete(l)}r[--n]=l}}}function xU(t){for(var e=new Set,n=0,r=t.length;n<r;n++){var i=t[n];e.add(i[0]),e.add(i[1])}return Array.from(e)}function EU(t){for(var e=new Map,n=0,r=t.length;n<r;n++){var i=t[n];e.has(i[0])||e.set(i[0],new Set),e.has(i[1])||e.set(i[1],new Set),e.get(i[0]).add(i[1])}return e}function AU(t){for(var e=new Map,n=0,r=t.length;n<r;n++)e.set(t[n],n);return e}});var jC=m(Id=>{"use strict";Object.defineProperty(Id,"__esModule",{value:!0});Id.hash=void 0;function OU(t){let e=5381,n=t.length;for(;n;)e=e*33^t.charCodeAt(--n);return e>>>0}Id.hash=OU});var $C=m(ba=>{"use strict";var gT=ba&&ba.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ba,"__esModule",{value:!0});ba.DocumentMerger=void 0;var CU=gT(Cd()),RU=gT(qC()),PU=bs(),FC=jC(),Md=gT(Ju()),pT=class{constructor(){this.keyToDocumentUriMap=new Map,this.results=new CU.default({ttl:1e3*60*20,ttlAutopurge:!0})}createCacheKey(e,n){let r=(0,FC.hash)(`main-${e.uri}-${e.version}`);for(let i=0;i<n.length;i++){let s=n[i];r^=(0,FC.hash)(`${s.textDocument.uri}-${s.textDocument.version}`),r=r>>>0}return r}registerCacheKey(e,n){this.flushCacheKey(n),this.keyToDocumentUriMap.set(n,e)}flushCacheKey(e){let n=this.keyToDocumentUriMap.get(e);n&&(this.results.delete(n),this.keyToDocumentUriMap.delete(e))}flushCache(){this.results.clear()}async processByDependencies(e,n,r){let i=e.uri;if(r.has(i))return r.get(i);let s=Md.default.get(i);if(r.set(i,null),!s)return null;let o=[],a=await n.documentManager.get(e).getImports(),u=this.createCacheKey(e,a);if(this.results.has(u))return this.results.get(u);this.registerCacheKey(u,i);let l=await n.documentManager.get(e).getDependencies();await Promise.all(l.map(async h=>{let f=n.documentManager.results.get(h);if(!f)return;let{document:g,textDocument:v}=f;if(!g)return;let b=await this.processByDependencies(v,n,r);b!==null&&o.push(b)}));let c=s.merge(...o);return r.set(i,c),this.results.set(u,c),c}async buildByDependencies(e,n){let r=e.uri,i=Md.default.get(r);if(!i)return null;let s=[],o=await n.documentManager.get(e).getImports(),a=this.createCacheKey(e,o);if(this.results.has(a))return this.results.get(a);this.registerCacheKey(a,r);let u=await n.documentManager.get(e).getDependencies(),l=new Map([[r,null]]);await Promise.all(u.map(async h=>{let f=n.documentManager.results.get(h);if(!f)return;let{document:g,textDocument:v}=f;if(!g)return;let b=await this.processByDependencies(v,n,l);b!==null&&s.push(b)}));let c=i.merge(...s);return this.results.set(a,c),c}async buildByWorkspace(e,n){let r=e.uri,i=Md.default.get(r);if(!i)return null;let s=[],o=await n.fs.getWorkspaceRelatedFiles(),a=await Promise.all(o.map(async g=>await n.documentManager.open(g.toString()))),u=this.createCacheKey(e,a);if(this.results.has(u))return this.results.get(u);this.registerCacheKey(u,r);let l=a.map(g=>g.textDocument.uri),c=await Promise.all(a.map(async g=>(await g.getDependencies()).map(b=>[g.textDocument.uri,b]))),h=RU.default.array(l,c.flat());for(let g=h.length-1;g>=0;g--){let v=h[g];if(v===r)continue;let b=Md.default.get(v);if(b===null)return;s.push(b)}let f=i.merge(...s);return this.results.set(u,f),f}async build(e,n){return n.getConfiguration().typeAnalyzer.strategy===PU.TypeAnalyzerStrategy.Workspace?this.buildByWorkspace(e,n):this.buildByDependencies(e,n)}};ba.DocumentMerger=pT});var WC=m(va=>{"use strict";var DU=va&&va.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(va,"__esModule",{value:!0});va.CoreContext=void 0;var IU=DU(require("events")),Zu=bs(),BC=kd();function UC(t){return{fileExtensions:t?.fileExtensions?t.fileExtensions.split(","):Zu.DefaultFileExtensions,formatter:t?.formatter??!0,autocomplete:t?.autocomplete??!0,hoverdocs:t?.hoverdocs??!0,diagnostic:t?.diagnostic??!0,transpiler:{beautify:{keepParentheses:t?.transpiler?.beautify?.keepParentheses??!0,indentation:t?.transpiler?.beautify?.indentation??Zu.IndentationType.Tab,indentationSpaces:t?.transpiler?.beautify?.indentationSpaces??2}},typeAnalyzer:{strategy:t?.typeAnalyzer?.strategy??Zu.TypeAnalyzerStrategy.Dependency,exclude:t?.typeAnalyzer?.exclude??void 0}}}var mT=class extends IU.default{constructor(){super(),this._configuration=UC(),this._features={configuration:!1,workspaceFolder:!1}}get features(){return this._features}getConfiguration(){return this._configuration}async syncConfiguraton(){let e=await this.connection.workspace.getConfiguration(Zu.ConfigurationNamespace),n=UC(e),r=n.typeAnalyzer,i=this._configuration.typeAnalyzer;(r.strategy!==i.strategy||r.exclude!==i.exclude)&&this.documentMerger.flushCache(),this._configuration=n}configureCapabilties(e){this._features.configuration=!!(e.workspace&&e.workspace.configuration),this._features.workspaceFolder=!!(e.workspace&&e.workspace.workspaceFolders)}async onInitialize(e){this.configureCapabilties(e.capabilities);let n={capabilities:{completionProvider:{triggerCharacters:["."],resolveProvider:!0},hoverProvider:!0,colorProvider:!0,definitionProvider:!0,documentFormattingProvider:!0,foldingRangeProvider:!0,signatureHelpProvider:{triggerCharacters:[",","("]},documentSymbolProvider:!0,workspaceSymbolProvider:!0,diagnosticProvider:{identifier:Zu.LanguageId,interFileDependencies:!1,workspaceDiagnostics:!1},semanticTokensProvider:{legend:{tokenTypes:BC.semanticTokensLegend.tokenTypes,tokenModifiers:BC.semanticTokensLegend.tokenModifiers},full:!0},textDocumentSync:2}};return this._features.workspaceFolder&&(n.capabilities.workspace={workspaceFolders:{supported:!0}}),this.emit("ready",this),n}async onInitialized(e){this._features.configuration&&(await this.syncConfiguraton(),this.connection.onDidChangeConfiguration(async()=>{let n=this._configuration;await this.syncConfiguraton(),this.emit("configuration-change",this,this._configuration,n)})),this.emit("loaded",this)}async listen(){this.fs.listen(this.connection),this.connection.onInitialize(this.onInitialize.bind(this)),this.connection.onInitialized(this.onInitialized.bind(this)),this.connection.listen()}};va.CoreContext=mT});var Ld=m(X=>{"use strict";var MU=X&&X.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),LU=X&&X.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),NU=X&&X.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&MU(e,t,n);return LU(e,t),e},qU=X&&X.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(X,"__esModule",{value:!0});X.CoreContext=X.buildTokens=X.semanticTokensLegend=X.lookupBase=X.lookupIdentifier=X.typeAnalyzer=X.appendTooltipHeader=X.appendTooltipBody=X.formatTypes=X.formatDefaultValue=X.createTooltipHeader=X.createSignatureInfo=X.createHover=X.MarkdownString=X.LookupHelper=X.DocumentMerger=X.DocumentManager=X.ActiveDocument=X.ASTScraper=X.activateFoldingRange=X.activateSemantic=X.activateSymbol=X.activateSubscriptions=X.activateSignature=X.activateHover=X.activateFormatter=X.activateDiagnostic=X.activateDefinition=X.activateColor=X.activateAutocomplete=X.DefaultFileExtensions=X.TypeAnalyzerStrategy=X.ConfigurationNamespace=X.LanguageId=X.IndentationType=void 0;var el=bs();Object.defineProperty(X,"IndentationType",{enumerable:!0,get:function(){return el.IndentationType}});Object.defineProperty(X,"LanguageId",{enumerable:!0,get:function(){return el.LanguageId}});Object.defineProperty(X,"ConfigurationNamespace",{enumerable:!0,get:function(){return el.ConfigurationNamespace}});Object.defineProperty(X,"TypeAnalyzerStrategy",{enumerable:!0,get:function(){return el.TypeAnalyzerStrategy}});Object.defineProperty(X,"DefaultFileExtensions",{enumerable:!0,get:function(){return el.DefaultFileExtensions}});var jU=sO();Object.defineProperty(X,"activateAutocomplete",{enumerable:!0,get:function(){return jU.activate}});var FU=gO();Object.defineProperty(X,"activateColor",{enumerable:!0,get:function(){return FU.activate}});var $U=mO();Object.defineProperty(X,"activateDefinition",{enumerable:!0,get:function(){return $U.activate}});var BU=yO();Object.defineProperty(X,"activateDiagnostic",{enumerable:!0,get:function(){return BU.activate}});var UU=KO();Object.defineProperty(X,"activateFormatter",{enumerable:!0,get:function(){return UU.activate}});var WU=QO();Object.defineProperty(X,"activateHover",{enumerable:!0,get:function(){return WU.activate}});var HU=eC();Object.defineProperty(X,"activateSignature",{enumerable:!0,get:function(){return HU.activate}});var GU=nC();Object.defineProperty(X,"activateSubscriptions",{enumerable:!0,get:function(){return GU.activate}});var KU=bC();Object.defineProperty(X,"activateSymbol",{enumerable:!0,get:function(){return KU.activate}});var zU=TC();Object.defineProperty(X,"activateSemantic",{enumerable:!0,get:function(){return zU.activate}});var VU=kC();Object.defineProperty(X,"activateFoldingRange",{enumerable:!0,get:function(){return VU.activate}});X.ASTScraper=NU(Pf());var HC=LC();Object.defineProperty(X,"ActiveDocument",{enumerable:!0,get:function(){return HC.ActiveDocument}});Object.defineProperty(X,"DocumentManager",{enumerable:!0,get:function(){return HC.DocumentManager}});var XU=$C();Object.defineProperty(X,"DocumentMerger",{enumerable:!0,get:function(){return XU.DocumentMerger}});var YU=ea();Object.defineProperty(X,"LookupHelper",{enumerable:!0,get:function(){return YU.LookupHelper}});var JU=bd();Object.defineProperty(X,"MarkdownString",{enumerable:!0,get:function(){return JU.MarkdownString}});var Ks=vd();Object.defineProperty(X,"createHover",{enumerable:!0,get:function(){return Ks.createHover}});Object.defineProperty(X,"createSignatureInfo",{enumerable:!0,get:function(){return Ks.createSignatureInfo}});Object.defineProperty(X,"createTooltipHeader",{enumerable:!0,get:function(){return Ks.createTooltipHeader}});Object.defineProperty(X,"formatDefaultValue",{enumerable:!0,get:function(){return Ks.formatDefaultValue}});Object.defineProperty(X,"formatTypes",{enumerable:!0,get:function(){return Ks.formatTypes}});Object.defineProperty(X,"appendTooltipBody",{enumerable:!0,get:function(){return Ks.appendTooltipBody}});Object.defineProperty(X,"appendTooltipHeader",{enumerable:!0,get:function(){return Ks.appendTooltipHeader}});var QU=Ju();Object.defineProperty(X,"typeAnalyzer",{enumerable:!0,get:function(){return qU(QU).default}});var GC=e_();Object.defineProperty(X,"lookupIdentifier",{enumerable:!0,get:function(){return GC.lookupIdentifier}});Object.defineProperty(X,"lookupBase",{enumerable:!0,get:function(){return GC.lookupBase}});var KC=kd();Object.defineProperty(X,"semanticTokensLegend",{enumerable:!0,get:function(){return KC.semanticTokensLegend}});Object.defineProperty(X,"buildTokens",{enumerable:!0,get:function(){return KC.buildTokens}});var ZU=WC();Object.defineProperty(X,"CoreContext",{enumerable:!0,get:function(){return ZU.CoreContext}})});var YC={};dP(YC,{TextDocument:()=>yT});function bT(t,e){if(t.length<=1)return t;let n=t.length/2|0,r=t.slice(0,n),i=t.slice(n);bT(r,e),bT(i,e);let s=0,o=0,a=0;for(;s<r.length&&o<i.length;)e(r[s],i[o])<=0?t[a++]=r[s++]:t[a++]=i[o++];for(;s<r.length;)t[a++]=r[s++];for(;o<i.length;)t[a++]=i[o++];return t}function zC(t,e,n=0){let r=e?[n]:[];for(let i=0;i<t.length;i++){let s=t.charCodeAt(i);VC(s)&&(s===13&&i+1<t.length&&t.charCodeAt(i+1)===10&&i++,r.push(n+i+1))}return r}function VC(t){return t===13||t===10}function XC(t){let e=t.start,n=t.end;return e.line>n.line||e.line===n.line&&e.character>n.character?{start:n,end:e}:t}function eW(t){let e=XC(t.range);return e!==t.range?{newText:t.newText,range:e}:t}var Nd,yT,JC=fP(()=>{"use strict";Nd=class t{constructor(e,n,r,i){this._uri=e,this._languageId=n,this._version=r,this._content=i,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let n=this.offsetAt(e.start),r=this.offsetAt(e.end);return this._content.substring(n,r)}return this._content}update(e,n){for(let r of e)if(t.isIncremental(r)){let i=XC(r.range),s=this.offsetAt(i.start),o=this.offsetAt(i.end);this._content=this._content.substring(0,s)+r.text+this._content.substring(o,this._content.length);let a=Math.max(i.start.line,0),u=Math.max(i.end.line,0),l=this._lineOffsets,c=zC(r.text,!1,s);if(u-a===c.length)for(let f=0,g=c.length;f<g;f++)l[f+a+1]=c[f];else c.length<1e4?l.splice(a+1,u-a,...c):this._lineOffsets=l=l.slice(0,a+1).concat(c,l.slice(u+1));let h=r.text.length-(o-s);if(h!==0)for(let f=a+1+c.length,g=l.length;f<g;f++)l[f]=l[f]+h}else if(t.isFull(r))this._content=r.text,this._lineOffsets=void 0;else throw new Error("Unknown change event received");this._version=n}getLineOffsets(){return this._lineOffsets===void 0&&(this._lineOffsets=zC(this._content,!0)),this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let n=this.getLineOffsets(),r=0,i=n.length;if(i===0)return{line:0,character:e};for(;r<i;){let o=Math.floor((r+i)/2);n[o]>e?i=o:r=o+1}let s=r-1;return e=this.ensureBeforeEOL(e,n[s]),{line:s,character:e-n[s]}}offsetAt(e){let n=this.getLineOffsets();if(e.line>=n.length)return this._content.length;if(e.line<0)return 0;let r=n[e.line];if(e.character<=0)return r;let i=e.line+1<n.length?n[e.line+1]:this._content.length,s=Math.min(r+e.character,i);return this.ensureBeforeEOL(s,r)}ensureBeforeEOL(e,n){for(;e>n&&VC(this._content.charCodeAt(e-1));)e--;return e}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){let n=e;return n!=null&&typeof n.text=="string"&&n.range!==void 0&&(n.rangeLength===void 0||typeof n.rangeLength=="number")}static isFull(e){let n=e;return n!=null&&typeof n.text=="string"&&n.range===void 0&&n.rangeLength===void 0}};(function(t){function e(i,s,o,a){return new Nd(i,s,o,a)}t.create=e;function n(i,s,o){if(i instanceof Nd)return i.update(s,o),i;throw new Error("TextDocument.update: document must be created by TextDocument.create")}t.update=n;function r(i,s){let o=i.getText(),a=bT(s.map(eW),(c,h)=>{let f=c.range.start.line-h.range.start.line;return f===0?c.range.start.character-h.range.start.character:f}),u=0,l=[];for(let c of a){let h=i.offsetAt(c.range.start);if(h<u)throw new Error("Overlapping edit");h>u&&l.push(o.substring(u,h)),c.newText.length&&l.push(c.newText),u=i.offsetAt(c.range.end)}return l.push(o.substr(u)),l.join("")}t.applyEdits=r})(yT||(yT={}))});var nR=m((_V,tR)=>{"use strict";tR.exports=ZC;function ZC(t,e,n){t instanceof RegExp&&(t=QC(t,n)),e instanceof RegExp&&(e=QC(e,n));var r=eR(t,e,n);return r&&{start:r[0],end:r[1],pre:n.slice(0,r[0]),body:n.slice(r[0]+t.length,r[1]),post:n.slice(r[1]+e.length)}}function QC(t,e){var n=e.match(t);return n?n[0]:null}ZC.range=eR;function eR(t,e,n){var r,i,s,o,a,u=n.indexOf(t),l=n.indexOf(e,u+1),c=u;if(u>=0&&l>0){if(t===e)return[u,l];for(r=[],s=n.length;c>=0&&!a;)c==u?(r.push(c),u=n.indexOf(t,c+1)):r.length==1?a=[r.pop(),l]:(i=r.pop(),i<s&&(s=i,o=l),l=n.indexOf(e,c+1)),c=u<l&&u>=0?u:l;r.length&&(a=[s,o])}return a}});var cR=m((TV,lR)=>{var rR=nR();lR.exports=rW;var iR="\0SLASH"+Math.random()+"\0",sR="\0OPEN"+Math.random()+"\0",_T="\0CLOSE"+Math.random()+"\0",oR="\0COMMA"+Math.random()+"\0",aR="\0PERIOD"+Math.random()+"\0";function vT(t){return parseInt(t,10)==t?parseInt(t,10):t.charCodeAt(0)}function tW(t){return t.split("\\\\").join(iR).split("\\{").join(sR).split("\\}").join(_T).split("\\,").join(oR).split("\\.").join(aR)}function nW(t){return t.split(iR).join("\\").split(sR).join("{").split(_T).join("}").split(oR).join(",").split(aR).join(".")}function uR(t){if(!t)return[""];var e=[],n=rR("{","}",t);if(!n)return t.split(",");var r=n.pre,i=n.body,s=n.post,o=r.split(",");o[o.length-1]+="{"+i+"}";var a=uR(s);return s.length&&(o[o.length-1]+=a.shift(),o.push.apply(o,a)),e.push.apply(e,o),e}function rW(t){return t?(t.substr(0,2)==="{}"&&(t="\\{\\}"+t.substr(2)),tl(tW(t),!0).map(nW)):[]}function iW(t){return"{"+t+"}"}function sW(t){return/^-?0\d/.test(t)}function oW(t,e){return t<=e}function aW(t,e){return t>=e}function tl(t,e){var n=[],r=rR("{","}",t);if(!r)return[t];var i=r.pre,s=r.post.length?tl(r.post,!1):[""];if(/\$$/.test(r.pre))for(var o=0;o<s.length;o++){var a=i+"{"+r.body+"}"+s[o];n.push(a)}else{var u=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(r.body),l=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(r.body),c=u||l,h=r.body.indexOf(",")>=0;if(!c&&!h)return r.post.match(/,.*\}/)?(t=r.pre+"{"+r.body+_T+r.post,tl(t)):[t];var f;if(c)f=r.body.split(/\.\./);else if(f=uR(r.body),f.length===1&&(f=tl(f[0],!1).map(iW),f.length===1))return s.map(function(K){return r.pre+f[0]+K});var g;if(c){var v=vT(f[0]),b=vT(f[1]),O=Math.max(f[0].length,f[1].length),A=f.length==3?Math.abs(vT(f[2])):1,k=oW,S=b<v;S&&(A*=-1,k=aW);var _=f.some(sW);g=[];for(var N=v;k(N,b);N+=A){var R;if(l)R=String.fromCharCode(N),R==="\\"&&(R="");else if(R=String(N),_){var G=O-R.length;if(G>0){var ie=new Array(G+1).join("0");N<0?R="-"+ie+R.slice(1):R=ie+R}}g.push(R)}}else{g=[];for(var ue=0;ue<f.length;ue++)g.push.apply(g,tl(f[ue],!1))}for(var ue=0;ue<g.length;ue++)for(var o=0;o<s.length;o++){var a=i+g[ue]+s[o];(!e||c||a)&&n.push(a)}}return n}});var hR=m(qd=>{"use strict";Object.defineProperty(qd,"__esModule",{value:!0});qd.assertValidPattern=void 0;var uW=1024*64,lW=t=>{if(typeof t!="string")throw new TypeError("invalid pattern");if(t.length>uW)throw new TypeError("pattern is too long")};qd.assertValidPattern=lW});var dR=m(jd=>{"use strict";Object.defineProperty(jd,"__esModule",{value:!0});jd.parseClass=void 0;var cW={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},nl=t=>t.replace(/[[\]\\-]/g,"\\$&"),hW=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),fR=t=>t.join(""),fW=(t,e)=>{let n=e;if(t.charAt(n)!=="[")throw new Error("not in a brace expression");let r=[],i=[],s=n+1,o=!1,a=!1,u=!1,l=!1,c=n,h="";e:for(;s<t.length;){let b=t.charAt(s);if((b==="!"||b==="^")&&s===n+1){l=!0,s++;continue}if(b==="]"&&o&&!u){c=s+1;break}if(o=!0,b==="\\"&&!u){u=!0,s++;continue}if(b==="["&&!u){for(let[O,[A,k,S]]of Object.entries(cW))if(t.startsWith(O,s)){if(h)return["$.",!1,t.length-n,!0];s+=O.length,S?i.push(A):r.push(A),a=a||k;continue e}}if(u=!1,h){b>h?r.push(nl(h)+"-"+nl(b)):b===h&&r.push(nl(b)),h="",s++;continue}if(t.startsWith("-]",s+1)){r.push(nl(b+"-")),s+=2;continue}if(t.startsWith("-",s+1)){h=b,s+=2;continue}r.push(nl(b)),s++}if(c<s)return["",!1,0,!1];if(!r.length&&!i.length)return["$.",!1,t.length-n,!0];if(i.length===0&&r.length===1&&/^\\?.$/.test(r[0])&&!l){let b=r[0].length===2?r[0].slice(-1):r[0];return[hW(b),!1,c-n,!1]}let f="["+(l?"^":"")+fR(r)+"]",g="["+(l?"":"^")+fR(i)+"]";return[r.length&&i.length?"("+f+"|"+g+")":r.length?f:g,a,c-n,!0]};jd.parseClass=fW});var $d=m(Fd=>{"use strict";Object.defineProperty(Fd,"__esModule",{value:!0});Fd.unescape=void 0;var dW=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/\[([^\/\\])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1");Fd.unescape=dW});var kT=m(Wd=>{"use strict";Object.defineProperty(Wd,"__esModule",{value:!0});Wd.AST=void 0;var pW=dR(),Bd=$d(),gW=new Set(["!","?","+","*","@"]),pR=t=>gW.has(t),mW="(?!(?:^|/)\\.\\.?(?:$|/))",Ud="(?!\\.)",yW=new Set(["[","."]),bW=new Set(["..","."]),vW=new Set("().*{}+?[]^$\\!"),_W=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),ST="[^/]",gR=ST+"*?",mR=ST+"+?",TT=class t{type;#e;#t;#s=!1;#r=[];#o;#_;#l;#h=!1;#a;#u;#i=!1;constructor(e,n,r={}){this.type=e,e&&(this.#t=!0),this.#o=n,this.#e=this.#o?this.#o.#e:this,this.#a=this.#e===this?r:this.#e.#a,this.#l=this.#e===this?[]:this.#e.#l,e==="!"&&!this.#e.#h&&this.#l.push(this),this.#_=this.#o?this.#o.#r.length:0}get hasMagic(){if(this.#t!==void 0)return this.#t;for(let e of this.#r)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#t=!0;return this.#t}toString(){return this.#u!==void 0?this.#u:this.type?this.#u=this.type+"("+this.#r.map(e=>String(e)).join("|")+")":this.#u=this.#r.map(e=>String(e)).join("")}#m(){if(this!==this.#e)throw new Error("should only call on root");if(this.#h)return this;this.toString(),this.#h=!0;let e;for(;e=this.#l.pop();){if(e.type!=="!")continue;let n=e,r=n.#o;for(;r;){for(let i=n.#_+1;!r.type&&i<r.#r.length;i++)for(let s of e.#r){if(typeof s=="string")throw new Error("string part in extglob AST??");s.copyIn(r.#r[i])}n=r,r=n.#o}}return this}push(...e){for(let n of e)if(n!==""){if(typeof n!="string"&&!(n instanceof t&&n.#o===this))throw new Error("invalid part: "+n);this.#r.push(n)}}toJSON(){let e=this.type===null?this.#r.slice().map(n=>typeof n=="string"?n:n.toJSON()):[this.type,...this.#r.map(n=>n.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#h&&this.#o?.type==="!")&&e.push({}),e}isStart(){if(this.#e===this)return!0;if(!this.#o?.isStart())return!1;if(this.#_===0)return!0;let e=this.#o;for(let n=0;n<this.#_;n++){let r=e.#r[n];if(!(r instanceof t&&r.type==="!"))return!1}return!0}isEnd(){if(this.#e===this||this.#o?.type==="!")return!0;if(!this.#o?.isEnd())return!1;if(!this.type)return this.#o?.isEnd();let e=this.#o?this.#o.#r.length:0;return this.#_===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this))}clone(e){let n=new t(this.type,e);for(let r of this.#r)n.copyIn(r);return n}static#y(e,n,r,i){let s=!1,o=!1,a=-1,u=!1;if(n.type===null){let g=r,v="";for(;g<e.length;){let b=e.charAt(g++);if(s||b==="\\"){s=!s,v+=b;continue}if(o){g===a+1?(b==="^"||b==="!")&&(u=!0):b==="]"&&!(g===a+2&&u)&&(o=!1),v+=b;continue}else if(b==="["){o=!0,a=g,u=!1,v+=b;continue}if(!i.noext&&pR(b)&&e.charAt(g)==="("){n.push(v),v="";let O=new t(b,n);g=t.#y(e,O,g,i),n.push(O);continue}v+=b}return n.push(v),g}let l=r+1,c=new t(null,n),h=[],f="";for(;l<e.length;){let g=e.charAt(l++);if(s||g==="\\"){s=!s,f+=g;continue}if(o){l===a+1?(g==="^"||g==="!")&&(u=!0):g==="]"&&!(l===a+2&&u)&&(o=!1),f+=g;continue}else if(g==="["){o=!0,a=l,u=!1,f+=g;continue}if(pR(g)&&e.charAt(l)==="("){c.push(f),f="";let v=new t(g,c);c.push(v),l=t.#y(e,v,l,i);continue}if(g==="|"){c.push(f),f="",h.push(c),c=new t(null,n);continue}if(g===")")return f===""&&n.#r.length===0&&(n.#i=!0),c.push(f),f="",n.push(...h,c),l;f+=g}return n.type=null,n.#t=void 0,n.#r=[e.substring(r-1)],l}static fromGlob(e,n={}){let r=new t(null,void 0,n);return t.#y(e,r,0,n),r}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let e=this.toString(),[n,r,i,s]=this.toRegExpSource();if(!(i||this.#t||this.#a.nocase&&!this.#a.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return r;let a=(this.#a.nocase?"i":"")+(s?"u":"");return Object.assign(new RegExp(`^${n}$`,a),{_src:n,_glob:e})}get options(){return this.#a}toRegExpSource(e){let n=e??!!this.#a.dot;if(this.#e===this&&this.#m(),!this.type){let u=this.isStart()&&this.isEnd(),l=this.#r.map(g=>{let[v,b,O,A]=typeof g=="string"?t.#f(g,this.#t,u):g.toRegExpSource(e);return this.#t=this.#t||O,this.#s=this.#s||A,v}).join(""),c="";if(this.isStart()&&typeof this.#r[0]=="string"&&!(this.#r.length===1&&bW.has(this.#r[0]))){let v=yW,b=n&&v.has(l.charAt(0))||l.startsWith("\\.")&&v.has(l.charAt(2))||l.startsWith("\\.\\.")&&v.has(l.charAt(4)),O=!n&&!e&&v.has(l.charAt(0));c=b?mW:O?Ud:""}let h="";return this.isEnd()&&this.#e.#h&&this.#o?.type==="!"&&(h="(?:$|\\/)"),[c+l+h,(0,Bd.unescape)(l),this.#t=!!this.#t,this.#s]}let r=this.type==="*"||this.type==="+",i=this.type==="!"?"(?:(?!(?:":"(?:",s=this.#d(n);if(this.isStart()&&this.isEnd()&&!s&&this.type!=="!"){let u=this.toString();return this.#r=[u],this.type=null,this.#t=void 0,[u,(0,Bd.unescape)(this.toString()),!1,!1]}let o=!r||e||n||!Ud?"":this.#d(!0);o===s&&(o=""),o&&(s=`(?:${s})(?:${o})*?`);let a="";if(this.type==="!"&&this.#i)a=(this.isStart()&&!n?Ud:"")+mR;else{let u=this.type==="!"?"))"+(this.isStart()&&!n&&!e?Ud:"")+gR+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;a=i+s+u}return[a,(0,Bd.unescape)(s),this.#t=!!this.#t,this.#s]}#d(e){return this.#r.map(n=>{if(typeof n=="string")throw new Error("string type in extglob ast??");let[r,i,s,o]=n.toRegExpSource(e);return this.#s=this.#s||o,r}).filter(n=>!(this.isStart()&&this.isEnd())||!!n).join("|")}static#f(e,n,r=!1){let i=!1,s="",o=!1;for(let a=0;a<e.length;a++){let u=e.charAt(a);if(i){i=!1,s+=(vW.has(u)?"\\":"")+u;continue}if(u==="\\"){a===e.length-1?s+="\\\\":i=!0;continue}if(u==="["){let[l,c,h,f]=(0,pW.parseClass)(e,a);if(h){s+=l,o=o||c,a+=h-1,n=n||f;continue}}if(u==="*"){r&&e==="*"?s+=mR:s+=gR,n=!0;continue}if(u==="?"){s+=ST,n=!0;continue}s+=_W(u)}return[s,(0,Bd.unescape)(e),!!n,o]}};Wd.AST=TT});var wT=m(Hd=>{"use strict";Object.defineProperty(Hd,"__esModule",{value:!0});Hd.escape=void 0;var TW=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/[?*()[\]]/g,"[$&]"):t.replace(/[?*()[\]\\]/g,"\\$&");Hd.escape=TW});var is=m(re=>{"use strict";var SW=re&&re.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(re,"__esModule",{value:!0});re.unescape=re.escape=re.AST=re.Minimatch=re.match=re.makeRe=re.braceExpand=re.defaults=re.filter=re.GLOBSTAR=re.sep=re.minimatch=void 0;var kW=SW(cR()),Gd=hR(),vR=kT(),wW=wT(),xW=$d(),EW=(t,e,n={})=>((0,Gd.assertValidPattern)(e),!n.nocomment&&e.charAt(0)==="#"?!1:new zs(e,n).match(t));re.minimatch=EW;var AW=/^\*+([^+@!?\*\[\(]*)$/,OW=t=>e=>!e.startsWith(".")&&e.endsWith(t),CW=t=>e=>e.endsWith(t),RW=t=>(t=t.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(t)),PW=t=>(t=t.toLowerCase(),e=>e.toLowerCase().endsWith(t)),DW=/^\*+\.\*+$/,IW=t=>!t.startsWith(".")&&t.includes("."),MW=t=>t!=="."&&t!==".."&&t.includes("."),LW=/^\.\*+$/,NW=t=>t!=="."&&t!==".."&&t.startsWith("."),qW=/^\*+$/,jW=t=>t.length!==0&&!t.startsWith("."),FW=t=>t.length!==0&&t!=="."&&t!=="..",$W=/^\?+([^+@!?\*\[\(]*)?$/,BW=([t,e=""])=>{let n=_R([t]);return e?(e=e.toLowerCase(),r=>n(r)&&r.toLowerCase().endsWith(e)):n},UW=([t,e=""])=>{let n=TR([t]);return e?(e=e.toLowerCase(),r=>n(r)&&r.toLowerCase().endsWith(e)):n},WW=([t,e=""])=>{let n=TR([t]);return e?r=>n(r)&&r.endsWith(e):n},HW=([t,e=""])=>{let n=_R([t]);return e?r=>n(r)&&r.endsWith(e):n},_R=([t])=>{let e=t.length;return n=>n.length===e&&!n.startsWith(".")},TR=([t])=>{let e=t.length;return n=>n.length===e&&n!=="."&&n!==".."},SR=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",yR={win32:{sep:"\\"},posix:{sep:"/"}};re.sep=SR==="win32"?yR.win32.sep:yR.posix.sep;re.minimatch.sep=re.sep;re.GLOBSTAR=Symbol("globstar **");re.minimatch.GLOBSTAR=re.GLOBSTAR;var GW="[^/]",KW=GW+"*?",zW="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",VW="(?:(?!(?:\\/|^)\\.).)*?",XW=(t,e={})=>n=>(0,re.minimatch)(n,t,e);re.filter=XW;re.minimatch.filter=re.filter;var cr=(t,e={})=>Object.assign({},t,e),YW=t=>{if(!t||typeof t!="object"||!Object.keys(t).length)return re.minimatch;let e=re.minimatch;return Object.assign((r,i,s={})=>e(r,i,cr(t,s)),{Minimatch:class extends e.Minimatch{constructor(i,s={}){super(i,cr(t,s))}static defaults(i){return e.defaults(cr(t,i)).Minimatch}},AST:class extends e.AST{constructor(i,s,o={}){super(i,s,cr(t,o))}static fromGlob(i,s={}){return e.AST.fromGlob(i,cr(t,s))}},unescape:(r,i={})=>e.unescape(r,cr(t,i)),escape:(r,i={})=>e.escape(r,cr(t,i)),filter:(r,i={})=>e.filter(r,cr(t,i)),defaults:r=>e.defaults(cr(t,r)),makeRe:(r,i={})=>e.makeRe(r,cr(t,i)),braceExpand:(r,i={})=>e.braceExpand(r,cr(t,i)),match:(r,i,s={})=>e.match(r,i,cr(t,s)),sep:e.sep,GLOBSTAR:re.GLOBSTAR})};re.defaults=YW;re.minimatch.defaults=re.defaults;var JW=(t,e={})=>((0,Gd.assertValidPattern)(t),e.nobrace||!/\{(?:(?!\{).)*\}/.test(t)?[t]:(0,kW.default)(t));re.braceExpand=JW;re.minimatch.braceExpand=re.braceExpand;var QW=(t,e={})=>new zs(t,e).makeRe();re.makeRe=QW;re.minimatch.makeRe=re.makeRe;var ZW=(t,e,n={})=>{let r=new zs(e,n);return t=t.filter(i=>r.match(i)),r.options.nonull&&!t.length&&t.push(e),t};re.match=ZW;re.minimatch.match=re.match;var bR=/[?*]|[+@!]\(.*?\)|\[|\]/,e5=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),zs=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(e,n={}){(0,Gd.assertValidPattern)(e),n=n||{},this.options=n,this.pattern=e,this.platform=n.platform||SR,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!n.windowsPathsNoEscape||n.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!n.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!n.nonegate,this.comment=!1,this.empty=!1,this.partial=!!n.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=n.windowsNoMagicRoot!==void 0?n.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let n of e)if(typeof n!="string")return!0;return!1}debug(...e){}make(){let e=this.pattern,n=this.options;if(!n.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],n.debug&&(this.debug=(...s)=>console.error(...s)),this.debug(this.pattern,this.globSet);let r=this.globSet.map(s=>this.slashSplit(s));this.globParts=this.preprocess(r),this.debug(this.pattern,this.globParts);let i=this.globParts.map((s,o,a)=>{if(this.isWindows&&this.windowsNoMagicRoot){let u=s[0]===""&&s[1]===""&&(s[2]==="?"||!bR.test(s[2]))&&!bR.test(s[3]),l=/^[a-z]:/i.test(s[0]);if(u)return[...s.slice(0,4),...s.slice(4).map(c=>this.parse(c))];if(l)return[s[0],...s.slice(1).map(c=>this.parse(c))]}return s.map(u=>this.parse(u))});if(this.debug(this.pattern,i),this.set=i.filter(s=>s.indexOf(!1)===-1),this.isWindows)for(let s=0;s<this.set.length;s++){let o=this.set[s];o[0]===""&&o[1]===""&&this.globParts[s][2]==="?"&&typeof o[3]=="string"&&/^[a-z]:$/i.test(o[3])&&(o[2]="?")}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let r=0;r<e.length;r++)for(let i=0;i<e[r].length;i++)e[r][i]==="**"&&(e[r][i]="*");let{optimizationLevel:n=1}=this.options;return n>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):n>=1?e=this.levelOneOptimize(e):e=this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(n=>{let r=-1;for(;(r=n.indexOf("**",r+1))!==-1;){let i=r;for(;n[i+1]==="**";)i++;i!==r&&n.splice(r,i-r)}return n})}levelOneOptimize(e){return e.map(n=>(n=n.reduce((r,i)=>{let s=r[r.length-1];return i==="**"&&s==="**"?r:i===".."&&s&&s!==".."&&s!=="."&&s!=="**"?(r.pop(),r):(r.push(i),r)},[]),n.length===0?[""]:n))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let n=!1;do{if(n=!1,!this.preserveMultipleSlashes){for(let i=1;i<e.length-1;i++){let s=e[i];i===1&&s===""&&e[0]===""||(s==="."||s==="")&&(n=!0,e.splice(i,1),i--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(n=!0,e.pop())}let r=0;for(;(r=e.indexOf("..",r+1))!==-1;){let i=e[r-1];i&&i!=="."&&i!==".."&&i!=="**"&&(n=!0,e.splice(r-1,2),r-=2)}}while(n);return e.length===0?[""]:e}firstPhasePreProcess(e){let n=!1;do{n=!1;for(let r of e){let i=-1;for(;(i=r.indexOf("**",i+1))!==-1;){let o=i;for(;r[o+1]==="**";)o++;o>i&&r.splice(i+1,o-i);let a=r[i+1],u=r[i+2],l=r[i+3];if(a!==".."||!u||u==="."||u===".."||!l||l==="."||l==="..")continue;n=!0,r.splice(i,1);let c=r.slice(0);c[i]="**",e.push(c),i--}if(!this.preserveMultipleSlashes){for(let o=1;o<r.length-1;o++){let a=r[o];o===1&&a===""&&r[0]===""||(a==="."||a==="")&&(n=!0,r.splice(o,1),o--)}r[0]==="."&&r.length===2&&(r[1]==="."||r[1]==="")&&(n=!0,r.pop())}let s=0;for(;(s=r.indexOf("..",s+1))!==-1;){let o=r[s-1];if(o&&o!=="."&&o!==".."&&o!=="**"){n=!0;let u=s===1&&r[s+1]==="**"?["."]:[];r.splice(s-1,2,...u),r.length===0&&r.push(""),s-=2}}}}while(n);return e}secondPhasePreProcess(e){for(let n=0;n<e.length-1;n++)for(let r=n+1;r<e.length;r++){let i=this.partsMatch(e[n],e[r],!this.preserveMultipleSlashes);if(i){e[n]=[],e[r]=i;break}}return e.filter(n=>n.length)}partsMatch(e,n,r=!1){let i=0,s=0,o=[],a="";for(;i<e.length&&s<n.length;)if(e[i]===n[s])o.push(a==="b"?n[s]:e[i]),i++,s++;else if(r&&e[i]==="**"&&n[s]===e[i+1])o.push(e[i]),i++;else if(r&&n[s]==="**"&&e[i]===n[s+1])o.push(n[s]),s++;else if(e[i]==="*"&&n[s]&&(this.options.dot||!n[s].startsWith("."))&&n[s]!=="**"){if(a==="b")return!1;a="a",o.push(e[i]),i++,s++}else if(n[s]==="*"&&e[i]&&(this.options.dot||!e[i].startsWith("."))&&e[i]!=="**"){if(a==="a")return!1;a="b",o.push(n[s]),i++,s++}else return!1;return e.length===n.length&&o}parseNegate(){if(this.nonegate)return;let e=this.pattern,n=!1,r=0;for(let i=0;i<e.length&&e.charAt(i)==="!";i++)n=!n,r++;r&&(this.pattern=e.slice(r)),this.negate=n}matchOne(e,n,r=!1){let i=this.options;if(this.isWindows){let b=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),O=!b&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),A=typeof n[0]=="string"&&/^[a-z]:$/i.test(n[0]),k=!A&&n[0]===""&&n[1]===""&&n[2]==="?"&&typeof n[3]=="string"&&/^[a-z]:$/i.test(n[3]),S=O?3:b?0:void 0,_=k?3:A?0:void 0;if(typeof S=="number"&&typeof _=="number"){let[N,R]=[e[S],n[_]];N.toLowerCase()===R.toLowerCase()&&(n[_]=N,_>S?n=n.slice(_):S>_&&(e=e.slice(S)))}}let{optimizationLevel:s=1}=this.options;s>=2&&(e=this.levelTwoFileOptimize(e)),this.debug("matchOne",this,{file:e,pattern:n}),this.debug("matchOne",e.length,n.length);for(var o=0,a=0,u=e.length,l=n.length;o<u&&a<l;o++,a++){this.debug("matchOne loop");var c=n[a],h=e[o];if(this.debug(n,c,h),c===!1)return!1;if(c===re.GLOBSTAR){this.debug("GLOBSTAR",[n,c,h]);var f=o,g=a+1;if(g===l){for(this.debug("** at the end");o<u;o++)if(e[o]==="."||e[o]===".."||!i.dot&&e[o].charAt(0)===".")return!1;return!0}for(;f<u;){var v=e[f];if(this.debug(`
196
+ hostInfo: URL or other short info about the host app`},stackTrace:{description:"Get a list describing the call stack."}}});var sC=m((Gz,v2)=>{v2.exports={$meta:{description:"Create a `list` with square brackets. Then iterate over the `list` with for, or pull out individual items with a 0-based index in square brackets. A negative index counts from the end. Get a slice (subset) of a `list` with two indices, separated by a colon.",example:["x = [2, 4, 6, 8]","print(x[0]) // get first item from list","print(x[-1]) // get last item from list","print(x[1:3]) // slice items from index 1 to 3","x[2] = 5 // set item at index 2 to 5","print(x)","print(x + [42]) // concatenate two lists"]},remove:{description:"Removes an item from the `list` with the provided index. Due to the removal the `list` will get mutated.",example:["myList = [1, 42, 3]","myList.remove(1)",'print("This list does not contain the answer to everything: " + myList.split(", "))']},insert:{description:"Inserts a value into the `list` at the index provided. Due to the insertion the `list` will get mutated. Returns the mutated `list`.",example:["myList = [1, 3]","myList.insert(1, 42)",'print("This list does contain the answer to everything: " + myList.split(", "))']},push:{description:"Appends a value to the end of the `list`. This operation will mutate the `list`. Additionally, this method will return the updated `list`.",example:["myList = [1, 3]","myList.push(42)",'print("This list does contain the answer to everything: " + myList.split(", "))']},pop:{description:"Returns and removes the last item in the `list`. This operation will mutate the `list`.",example:["myList = [1, 3, 42]","answer = myList.pop",'print("Answer to everything: " + answer)']},pull:{description:"Returns and removes the first item in the `list`. This operation will mutate the `list`.",example:["myList = [42, 1, 3]","answer = myList.pull",'print("Answer to everything: " + answer)']},shuffle:{description:"Shuffles all values in the `list`. This operation will mutate the `list`.",example:["myList = [42, 1, 3]","myList.shuffle",'print("New list order: " + myList.split(", "))']},sum:{description:"Returns sum of all values inside the `list`. Any non-numeric values will be considered a zero.",example:["myList = [42, 1, 3]","sum = myList.sum",'print("Sum of all items in list: " + sum)']},hasIndex:{description:"Returns `true` if the provided index is available in the `list`. Otherwise, this method will return `false`.",example:["myList = [42, 1, 3]","containsIndex = myList.hasIndex(1)","if containsIndex then",' print("List contains index of 1.")',"else",' print("List does not contain index of 1.")',"end if"]},indexOf:{description:"Returns a `number` which indicates the first matching index of the provided value inside the `list`. Optionally a start index can be provided. In case the value does not exist inside the `list` a `null` gets returned.",example:["myList = [42, 1, 3]","index = myList.indexOf(42)","if index != null then",' print("The answer for everything is at the following index: " + index)',"else",' print("No answer for everything found.")',"end if"]},sort:{description:"Sort `list` values alphanumerically. This operation will mutate the `list`. Optionally a key can be provided which which is used in case the items are maps. Additionally, this method will return the updated `list`.",example:['myList = [{ "key": 42 }, { "key": 2 }, { "key": 1 }]','myList.sort("key")',"print(myList)"]},join:{description:"Returns a concatenated `string` containing all stringified values inside the `list`. These values will be separated via the provided separator.",example:["myList = [42, 1, 3]",`print(myList.join(" .-*'*-. "))`]},indexes:{description:"Returns a `list` containing all available indexes.",example:["myList = [42, 1, 3]","for i in myList.indexes"," print(myList[i])","end for"]},len:{description:"Returns a `number` representing the count of values inside the `list`.",example:["myList = [42, 1, 3]",'print("myList contains " + myList.len + " items")']},values:{description:"Returns a `list` containing all available values.",example:["myList = [42, 1, 3]","for v in myList.values"," print(v)","end for"]},replace:{description:"Returns updated `list` where each value matching with the provided replace argument gets replaced. This operation will mutate the `list`.",example:["myList = [1, 2, 2, 7]","myList.replace(2, 3)",'print(myList.join(""))']}}});var oC=m((Kz,_2)=>{_2.exports={$meta:{description:"A `map` is a set of values associated with unique keys. Create a `map` with curly braces; get or set a single value with square brackets. Keys and values may be any type.",example:['x = { "test": 123 }',"x.foo = 42 // set property foo to 42","print(x.foo) // get value of property foo",'print(x + { "bar": 2 }) // concatenate two maps']},remove:{description:"Removes an item from the `map` with the provided key. Due to the removal the `map` will get mutated.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }','myMap.remove("answer")',"print(myMap)"]},push:{description:"Adds the value 1 to the provided key. This operation will mutate the `map`. Additionally, this method will return the updated `map`.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }','myMap.push("answer")',"print(myMap.answer)"]},pull:{description:"Returns and removes the first item in the `map`. This operation will mutate the `map`.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }',"print(myMap.pull)"]},pop:{description:"Returns and removes the last item in the `map`. This operation will mutate the `map`.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }',"print(myMap.pop)"]},shuffle:{description:"Shuffles all values in the `map`. This operation will mutate the `map`.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }',"myMap.shuffle","print(myMap)"]},sum:{description:"Returns sum of all values inside the `map`. Any non-numeric values will be considered a zero.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }',"sum = myMap.sum",'print("Sum of all items in map: " + sum)']},hasIndex:{description:"Returns `true` if the provided key is available in the `map`. Otherwise, this method will return `false`.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }','containsIndex = myList.hasIndex("answer")',"if containsIndex then",' print("Map contains the answer.")',"else",' print("Map does not contain the answer.")',"end if"]},indexOf:{description:"Returns `string` which indicates the key of the provided value inside the `map`. In case the value does not exist inside the `map` a `null` gets returned.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }',"key = myList.indexOf(42)","if key != null then",' print("Map contains the answer.")',"else",' print("Map does not contain the answer.")',"end if"]},indexes:{description:"Returns a `list` containing all available keys.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }',"for key in myMap.indexes"," print(myMap[key])","end for"]},len:{description:"Returns a `number` representing the count of items inside the `map`.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }','print("myMap contains " + myMap.len + " items")']},values:{description:"Returns a `list` containing all available values.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }',"for value in myMap.values"," print(value)","end for"]},replace:{description:"Returns updated `map` where each value matching with the provided replace argument gets replaced. This operation will mutate the `map`.",example:['myObject = { "answer": 45 }',"myObject.replace(45, 42)","print(myObject.answer)"]}}});var aC=m((zz,T2)=>{T2.exports={$meta:{description:"All numbers are stored in full-precision format. Numbers also represent `true == 1` and `false == 0`.",example:["a = 20","b = 22","print(a + b) // addition","print(a - b) // substraction","print(a / b) // division","print(a * b) // multiply","print(a % b) // modulo","print(a - b) // substraction","print(a ^ b) // power","print(a and b) // logical and","print(a or b) // logical or","print(not a) // logical not","print(a == b) // comparison equal","print(a != b) // comparison unequal","print(a > b) // comparison greater than","print(a < b) // comparison lower than","print(a >= b) // comparison greater equal than","print(a <= b) // comparison lower equal than"]}}});var uC=m((Vz,S2)=>{S2.exports={$meta:{description:"Text is stored in strings of Unicode characters. Write strings by surrounding them with quotes. If you need to include a quotation mark in the string, write it twice.",example:['a = "hello"','b = "world"',"print(a + b) // concatinate a and b","print(a * 10) // repeat hello ten times","print(a[0]) // prints h","print(a[1:3]) // prints ell"]},remove:{description:"Returns a new `string` where the provided `string` got removed.",example:['myString = "42 as an answer is wrong"','newString = myString.remove("wrong")','print(newString + "right")']},hasIndex:{description:"Returns `true` if the provided index is available in the `string`. Otherwise, this method will return `false`.",example:['myString = "42 as an answer is wrong"',"containsIndex = myString.hasIndex(1)","if containsIndex then",' print("String contains index of 1.")',"else",' print("String does not contain index of 1.")',"end if"]},insert:{description:"Returns a `string` with the newly inserted `string` at the provided index.",example:['myString = "42 as an answer is wrong"','index = myString.lastIndexOf("w") - 1','newString = myString.insert(index, "not ")',"print(newString)"]},indexOf:{description:"Returns a `number` which indicates the first matching index of the provided value inside the `list`. Optionally a start index can be provided. In case the value does not exist inside the `string` a `null` gets returned.",example:['myString = "42 as an answer is wrong"','index = myString.indexOf("wrong")',"if index != null then",' print("Invalid information spotted at: " + index)',"else",' print("Information seems valid.")',"end if"]},split:{description:"Returns a `list` where each item is a segment of the `string`. The separation depends on the provided separator `string`. Keep in mind that for some odd reason, this method is using regular expressions for matching.",example:['myString = "42 as an answer is wrong"','segments = myString.split(" ")','if segments[0] != "42" then',' print("Invalid information spotted!")',"else",' print("Information seems valid!")',"end if"]},replace:{description:"Returns a new `string` where the provided `string` got replaced by the second provided `string`.",example:['myString = "42 as an answer is wrong"','newString = myString.replace("wrong", "right")',"print(newString)"]},indexes:{description:"Returns a `list` where each item is a `number` representing all available indexes in the `string`.",example:['myString = "42"',"print(myString.indexes)"]},code:{description:"Returns a `number` representing the Unicode code of the first character of the `string`.",example:['myString = "HELLO WORLD"',"print(myString.code)"]},len:{description:"Returns a `number` representing the length of the `string`.",example:['myString = "HELLO WORLD"','print("Size of string is: " + myString.len)']},lower:{description:"Returns a new `string` in which all characters are transformed into lowercase.",example:['myString = "HELLO WORLD"',"print(myString.lower)"]},upper:{description:"Returns a new `string` in which all characters are transformed into uppercase.",example:['myString = "hello world"',"print(myString.upper)"]},val:{description:"Returns a `number` which is parsed from the `string`. In case the `string` is not numeric it will return a zero.",example:['myString = "1.25"',"print(myString.val + 40.75)"]},values:{description:"Returns a `list` where each item is a `string` representing all available characters in the `string`. Could be compared to using `split` but without any separator.",example:['myString = "hello world"',"print(myString.values)"]}}});var lC=m(Yu=>{"use strict";var da=Yu&&Yu.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Yu,"__esModule",{value:!0});var k2=da(rC()),w2=da(iC()),x2=da(sC()),E2=da(oC()),A2=da(aC()),O2=da(uC()),C2={any:k2.default,general:w2.default,list:x2.default,map:E2.default,string:O2.default,number:A2.default};Yu.default=C2});var cC=m((Yz,R2)=>{R2.exports={type:"any",definitions:{insert:{type:"function",arguments:[{label:"index",type:"number"},{label:"value",type:"any"}],returns:["list","string"]},indexOf:{type:"function",arguments:[{label:"value",type:"any"},{label:"offset",type:"number",opt:!0}],returns:["any"]},hasIndex:{type:"function",arguments:[{label:"value",type:"any"}],returns:["number"]},remove:{type:"function",arguments:[{label:"value",type:"any"}],returns:["null"]},push:{type:"function",arguments:[{label:"value",type:"any"}],returns:["map","list","null"]},pull:{type:"function",returns:["any"]},pop:{type:"function",returns:["any"]},shuffle:{type:"function",returns:["null"]},sum:{type:"function",returns:["number"]},indexes:{type:"function",returns:["list"]},len:{type:"function",returns:["number"]},values:{type:"function",returns:["list"]}}}});var hC=m((Jz,P2)=>{P2.exports={type:"general",definitions:{hasIndex:{type:"function",arguments:[{label:"self",types:["list","map","string"]},{label:"index",type:"any"}],returns:["number","null"]},print:{type:"function",arguments:[{label:"value",type:"any",default:{type:"string",value:""}},{label:"delimiter",type:"string",opt:!0}],returns:["null"]},indexes:{type:"function",arguments:[{label:"self",types:["map","list","string"]}],returns:["list","null"]},values:{type:"function",arguments:[{label:"self",types:["map","list","string"]}],returns:["list"]},indexOf:{type:"function",arguments:[{label:"self",types:["list","map","string"]},{label:"value",type:"any"},{label:"after",type:"any",opt:!0}],returns:["any","null"]},len:{type:"function",arguments:[{label:"self",types:["list","string","map"]}],returns:["number","null"]},shuffle:{type:"function",arguments:[{label:"self",types:["list","map"]}],returns:["null"]},val:{type:"function",arguments:[{label:"self",type:"any"}],returns:["number","null"]},lower:{type:"function",arguments:[{label:"self",type:"string"}],returns:["string"]},upper:{type:"function",arguments:[{label:"self",type:"string"}],returns:["string"]},sum:{type:"function",arguments:[{label:"self",types:["list","map"]}],returns:["number"]},pop:{type:"function",arguments:[{label:"self",types:["list","map"]}],returns:["any","null"]},pull:{type:"function",arguments:[{label:"self",types:["list","map"]}],returns:["any","null"]},push:{type:"function",arguments:[{label:"self",types:["list","map"]},{label:"value",type:"any"}],returns:["map","list","null"]},sort:{type:"function",arguments:[{label:"self",type:"list"},{label:"byKey",type:"any"},{label:"ascending",type:"number",default:{type:"number",value:1}}],returns:["list","null"]},remove:{type:"function",arguments:[{label:"self",types:["list","map","string"]},{label:"key",type:"any"}],returns:["list","map","string"]},wait:{type:"function",arguments:[{label:"seconds",type:"number",default:{type:"number",value:1}}],returns:["null"]},abs:{type:"function",arguments:[{label:"value",type:"number",default:{type:"number",value:0}}],returns:["number"]},acos:{type:"function",arguments:[{label:"value",type:"number",default:{type:"number",value:0}}],returns:["number"]},asin:{type:"function",arguments:[{label:"value",type:"number",default:{type:"number",value:0}}],returns:["number"]},atan:{type:"function",arguments:[{label:"y",type:"number",default:{type:"number",value:0}},{label:"x",type:"number",default:{type:"number",value:1}}],returns:["number"]},tan:{type:"function",arguments:[{label:"radians",type:"number",default:{type:"number",value:0}}],returns:["number"]},cos:{type:"function",arguments:[{label:"radians",type:"number",default:{type:"number",value:0}}],returns:["number"]},code:{type:"function",arguments:[{label:"value",type:"string"}],returns:["number"]},char:{type:"function",arguments:[{label:"codePoint",type:"number",default:{type:"number",value:65}}],returns:["string"]},sin:{type:"function",arguments:[{label:"radians",type:"number",default:{type:"number",value:0}}],returns:["number"]},floor:{type:"function",arguments:[{label:"x",type:"number",default:{type:"number",value:0}}],returns:["number"]},range:{type:"function",arguments:[{label:"start",type:"number",default:{type:"number",value:0}},{label:"end",type:"number",default:{type:"number",value:0}},{label:"inc",type:"number",opt:!0}],returns:[{type:"list",valueType:"number"}]},round:{type:"function",arguments:[{label:"x",type:"number",default:{type:"number",value:0}},{label:"decimalPlaces",type:"number",default:{type:"number",value:0}}],returns:["number"]},rnd:{type:"function",arguments:[{label:"seed",type:"number",opt:!0}],returns:["number"]},sign:{type:"function",arguments:[{label:"x",type:"number",default:{type:"number",value:0}}],returns:["number"]},sqrt:{type:"function",arguments:[{label:"x",type:"number",default:{type:"number",value:0}}],returns:["number"]},str:{type:"function",arguments:[{label:"value",type:"any"}],returns:["string"]},ceil:{type:"function",arguments:[{label:"x",type:"number",default:{type:"number",value:0}}],returns:["number"]},pi:{type:"function",returns:["number"]},slice:{type:"function",arguments:[{label:"seq",types:["list","string"]},{label:"from",type:"number",default:{type:"number",value:0}},{label:"to",type:"number",opt:!0}],returns:["list","string"]},hash:{type:"function",arguments:[{label:"value",type:"any"}],returns:["number"]},time:{type:"function",returns:["number"]},bitAnd:{type:"function",arguments:[{label:"a",type:"number",default:{type:"number",value:0}},{label:"b",type:"number",default:{type:"number",value:0}}],returns:["number"]},bitOr:{type:"function",arguments:[{label:"a",type:"number",default:{type:"number",value:0}},{label:"b",type:"number",default:{type:"number",value:0}}],returns:["number"]},bitXor:{type:"function",arguments:[{label:"a",type:"number",default:{type:"number",value:0}},{label:"b",type:"number",default:{type:"number",value:0}}],returns:["number"]},log:{type:"function",arguments:[{label:"value",type:"number",default:{type:"number",value:0}},{label:"base",type:"number",default:{type:"number",value:10}}],returns:["number"]},yield:{type:"function",returns:["null"]},insert:{type:"function",arguments:[{label:"self",types:["list","string"]},{label:"index",type:"number"},{label:"value",type:"any"}],returns:["list","string"]},join:{type:"function",arguments:[{label:"self",type:"list"},{label:"delimiter",type:"string",default:{type:"string",value:" "}}],returns:["string"]},split:{type:"function",arguments:[{label:"self",type:"string"},{label:"delimiter",type:"string",default:{type:"string",value:" "}},{label:"maxCount",type:"number",default:{type:"number",value:-1}}],returns:[{type:"list",valueType:"string"}]},replace:{type:"function",arguments:[{label:"self",types:["list","map","string"]},{label:"oldval",type:"any"},{label:"newval",type:"any"},{label:"maxCount",type:"number",opt:!0}],returns:["list","map","string"]},funcRef:{type:"function",returns:[{type:"map",keyType:"string"}]},list:{type:"function",returns:[{type:"map",keyType:"string"}]},map:{type:"function",returns:[{type:"map",keyType:"string"}]},number:{type:"function",returns:[{type:"map",keyType:"string"}]},string:{type:"function",returns:[{type:"map",keyType:"string"}]},refEquals:{type:"function",arguments:[{label:"a",type:"any"},{label:"b",type:"any"}],returns:["number"]},stackTrace:{type:"function",returns:[{type:"list",valueType:"string"}]},version:{type:"function",returns:["version"]}}}});var fC=m((Qz,D2)=>{D2.exports={type:"list",definitions:{remove:{type:"function",arguments:[{label:"index",type:"number"}],returns:["null"]},insert:{type:"function",arguments:[{label:"index",type:"number"},{label:"value",type:"any"}],returns:["list"]},push:{type:"function",arguments:[{label:"value",type:"any"}],returns:["list"]},pop:{type:"function",returns:["any"]},pull:{type:"function",returns:["any"]},shuffle:{type:"function",returns:["null"]},sum:{type:"function",returns:["number"]},hasIndex:{type:"function",arguments:[{label:"index",type:"number"}],returns:["number"]},indexOf:{type:"function",arguments:[{label:"value",type:"any"},{label:"offset",type:"number",opt:!0}],returns:["number","null"]},sort:{type:"function",arguments:[{label:"byKey",type:"string"},{label:"ascending",type:"number",default:{type:"number",value:1}}],returns:["list"]},join:{type:"function",arguments:[{label:"delimiter",type:"string",default:{type:"string",value:" "}}],returns:["string"]},indexes:{type:"function",returns:[{type:"list",valueType:"number"}]},len:{type:"function",returns:["number"]},values:{type:"function",returns:["list"]},replace:{type:"function",arguments:[{label:"oldVal",type:"any"},{label:"newVal",type:"any"},{label:"maxCount",type:"number",opt:!0}],returns:["list"]}}}});var dC=m((Zz,I2)=>{I2.exports={type:"map",definitions:{remove:{type:"function",arguments:[{label:"key",type:"string"}],returns:["number"]},push:{type:"function",arguments:[{label:"key",type:"string"}],returns:["map"]},pull:{type:"function",returns:["any"]},pop:{type:"function",returns:["any"]},shuffle:{type:"function",returns:["null"]},sum:{type:"function",returns:["number"]},hasIndex:{type:"function",arguments:[{label:"key",type:"string"}],returns:["number"]},indexOf:{type:"function",arguments:[{label:"value",type:"any"},{label:"offset",type:"number",opt:!0}],returns:["any","null"]},indexes:{type:"function",returns:["list"]},len:{type:"function",returns:["number"]},values:{type:"function",returns:["list"]},replace:{type:"function",arguments:[{label:"oldVal",type:"any"},{label:"newVal",type:"any"},{label:"maxCount",type:"number",opt:!0}],returns:["map"]}}}});var pC=m((eV,M2)=>{M2.exports={type:"number",definitions:{}}});var gC=m((tV,L2)=>{L2.exports={type:"string",definitions:{remove:{type:"function",arguments:[{label:"toDelete",type:"string"}],returns:["string"]},hasIndex:{type:"function",arguments:[{label:"index",type:"number"}],returns:["number"]},insert:{type:"function",arguments:[{label:"index",type:"number"},{label:"value",type:"string"}],returns:["string"]},indexOf:{type:"function",arguments:[{label:"value",type:"string"},{label:"offset",type:"number",opt:!0}],returns:["number","null"]},split:{type:"function",arguments:[{label:"delimiter",type:"string",default:{type:"string",value:" "}},{label:"maxCount",type:"number",default:{type:"number",value:-1}}],returns:[{type:"list",valueType:"string"}]},replace:{type:"function",arguments:[{label:"oldVal",type:"string"},{label:"newVal",type:"string"},{label:"maxCount",type:"number",opt:!0}],returns:["string"]},indexes:{type:"function",returns:[{type:"list",valueType:"number"}]},code:{type:"function",returns:["number"]},len:{type:"function",returns:["number"]},lower:{type:"function",returns:["string"]},upper:{type:"function",returns:["string"]},val:{type:"function",returns:["number"]},values:{type:"function",returns:[{type:"list",valueType:"string"}]}}}});var mC=m((nV,N2)=>{N2.exports={type:"version",extends:"map",definitions:{miniscript:{type:"string"},buildDate:{type:"string"},host:{type:"number"},hostName:{type:"string"},hostInfo:{type:"string"}}}});var X_=m(Pn=>{"use strict";var ns=Pn&&Pn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Pn,"__esModule",{value:!0});Pn.miniscriptMeta=void 0;var q2=sr(),j2=ns(lC()),F2=ns(cC()),$2=ns(hC()),B2=ns(fC()),U2=ns(dC()),W2=ns(pC()),H2=ns(gC()),G2=ns(mC());Pn.miniscriptMeta=new q2.Container;Pn.miniscriptMeta.addTypeSignatureFromPayload(F2.default);Pn.miniscriptMeta.addTypeSignatureFromPayload($2.default);Pn.miniscriptMeta.addTypeSignatureFromPayload(B2.default);Pn.miniscriptMeta.addTypeSignatureFromPayload(U2.default);Pn.miniscriptMeta.addTypeSignatureFromPayload(W2.default);Pn.miniscriptMeta.addTypeSignatureFromPayload(H2.default);Pn.miniscriptMeta.addTypeSignatureFromPayload(G2.default);Pn.miniscriptMeta.addMetaFromPayload("en",j2.default)});var Ju=m(Y_=>{"use strict";Object.defineProperty(Y_,"__esModule",{value:!0});var K2=X_(),z2=Yo();Y_.default=new z2.TypeManager({container:K2.miniscriptMeta})});var bC=m(pa=>{"use strict";var V2=pa&&pa.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(pa,"__esModule",{value:!0});pa.activate=void 0;var X2=Ee(),Y2=Yo(),J2=Qv(),Q2=V2(Ju()),yC=(t,e)=>{let n=Q2.default.get(t.uri),r=n.resolveAllAssignmentsWithQuery(e),i=[];for(let s of r){if(s.node.type!==X2.ASTType.AssignmentStatement)continue;let o=s.node,a=n.resolveNamespace(o.variable,!0);if(a==null)continue;let u=(0,Y2.createExpressionId)(o.variable),l=a?.kind?(0,J2.getSymbolItemKind)(a.kind):13,c={line:o.variable.start.line-1,character:o.variable.start.character-1},h={line:o.variable.end.line-1,character:o.variable.end.character-1};i.push({name:u,kind:l,location:{uri:t.uri,range:{start:c,end:h}}})}return i};function Z2(t){t.connection.onDocumentSymbol(async e=>{let n=await t.fs.getTextDocument(e.textDocument.uri);return n==null?void 0:t.documentManager.get(n).document?yC(n,""):[]}),t.connection.onWorkspaceSymbol(e=>{let n=[];for(let r of t.fs.getAllTextDocuments())t.documentManager.get(r).document&&n.push(...yC(r,e.query));return n})}pa.activate=Z2});var kd=m(lr=>{"use strict";Object.defineProperty(lr,"__esModule",{value:!0});lr.buildTokens=lr.semanticTokensLegend=lr.SemanticTokenModifier=lr.SemanticTokenType=void 0;var Ht=Yr(),W=Ee(),eU=X_(),vC=(t,e)=>!!eU.miniscriptMeta.getDefinition(t,e),Z;(function(t){t[t.Keyword=0]="Keyword",t[t.String=1]="String",t[t.Number=2]="Number",t[t.Variable=3]="Variable",t[t.Property=4]="Property",t[t.Function=5]="Function",t[t.Parameter=6]="Parameter",t[t.Operator=7]="Operator",t[t.Comment=8]="Comment",t[t.Constant=9]="Constant",t[t.Punctuator=10]="Punctuator"})(Z=lr.SemanticTokenType||(lr.SemanticTokenType={}));var J_;(function(t){t[t.Declaration=0]="Declaration",t[t.Definition=1]="Definition",t[t.Readonly=2]="Readonly",t[t.Static=3]="Static",t[t.Deprecated=4]="Deprecated",t[t.Abstract=5]="Abstract",t[t.Async=6]="Async",t[t.Modification=7]="Modification",t[t.Documentation=8]="Documentation",t[t.DefaultLibrary=9]="DefaultLibrary"})(J_=lr.SemanticTokenModifier||(lr.SemanticTokenModifier={}));lr.semanticTokensLegend={tokenTypes:["keyword","string","number","variable","property","function","parameter","operator","comment","constant","punctuator"],tokenModifiers:["declaration","definition","readonly","static","deprecated","abstract","async","modification","documentation","defaultLibrary"]};var _C=t=>1<<t,Q_=class{constructor(e,n){this._lexer=e,this._builder=n,this._validator=new W.ParserValidatorm}next(){this.previousToken=this.token,this.token=this._lexer.next()}isType(e){return this.token!==null&&e===this.token.type}consume(e){return e(this.token)?(this.next(),!0):!1}consumeMany(e){return e(this.token)?(this.next(),!0):!1}requireType(e){let n=this.token;return this.token.type!==e?null:(this.next(),n)}requireToken(e){let n=this.token;return e(n)?(this.next(),n):null}requireTokenOfAny(e){let n=this.token;return e(n)?(this.next(),n):null}skipNewlines(){let e=this;for(;;){if(W.Selectors.Comment(e.token))this._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length+2,Z.Comment,0);else if(!W.Selectors.EndOfLine(e.token))break;e.next()}}processIdentifier(e=!1,n=!1){let r=this,i=r.requireType(W.TokenType.Identifier);if(i)if(n)r._builder.push(i.start.line-1,i.start.character-1,i.value.length,Z.Parameter,0);else if(e){let o=vC(["any"],i.value)?_C(J_.DefaultLibrary):0;r._builder.push(i.start.line-1,i.start.character-1,i.value.length,Z.Property,o)}else{let o=vC(["general"],i.value)?_C(J_.DefaultLibrary):0;r._builder.push(i.start.line-1,i.start.character-1,i.value.length,Z.Variable,o)}}processLiteral(){let e=this.token;switch(e.type){case W.TokenType.StringLiteral:{this._builder.push(e.start.line-1,e.start.character-1,e.raw.length,Z.String,0);break}case W.TokenType.NumericLiteral:{this._builder.push(e.start.line-1,e.start.character-1,e.raw.length,Z.Number,0);break}case W.TokenType.BooleanLiteral:case W.TokenType.NilLiteral:{this._builder.push(e.start.line-1,e.start.character-1,e.raw.length,Z.Constant,0);break}}this.next()}processAtom(e=!1,n=!1){let r=this;if(Ht.Selectors.Envar(r.token))return r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Keyword,0),r.next(),r.processFeatureEnvarExpression();if(Ht.Selectors.Inject(r.token))return r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Keyword,0),r.next(),r.processFeatureInjectExpression();if(Ht.Selectors.Line(r.token)){r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Keyword,0),r.next();return}else if(Ht.Selectors.File(r.token)){r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Keyword,0),r.next();return}if(r._validator.isLiteral(r.token.type))return r.processLiteral();if(r.isType(W.TokenType.Identifier))return r.processIdentifier()}processQuantity(e=!1,n=!1){let r=this;if(!W.Selectors.LParenthesis(r.token))return r.processAtom(e,n);r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0),r.next(),r.skipNewlines(),r.processExpr();let i=r.requireToken(W.Selectors.RParenthesis);i&&r._builder.push(i.start.line-1,i.start.character-1,i.value.length,Z.Punctuator,0)}processList(e=!1,n=!1){let r=this;if(!W.Selectors.SLBracket(r.token))return r.processQuantity(e,n);if(r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0),r.next(),W.Selectors.SRBracket(r.token))r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0),r.next();else for(r.skipNewlines();!W.Selectors.EndOfFile(r.token);){if(W.Selectors.SRBracket(r.token)){r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0),r.next();break}if(r.processExpr(),W.Selectors.MapSeperator(r.token)&&(r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0),r.next(),r.skipNewlines()),W.Selectors.SRBracket(r.token)){r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0),r.next();break}}}processMap(e=!1,n=!1){let r=this;if(!W.Selectors.CLBracket(r.token))return r.processList(e,n);if(r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0),r.next(),W.Selectors.CRBracket(r.token))r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0),r.next();else for(r.skipNewlines();!W.Selectors.EndOfFile(r.token);){if(W.Selectors.CRBracket(r.token)){r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0),r.next();break}r.processExpr();let i=r.requireToken(W.Selectors.MapKeyValueSeperator);if(!i)return;if(r._builder.push(i.start.line-1,i.start.character-1,i.value.length,Z.Punctuator,0),r.skipNewlines(),r.processExpr(),W.Selectors.MapSeperator(r.token)&&(r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0),r.next(),r.skipNewlines()),W.Selectors.CRBracket(r.token)){r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0),r.next();break}}}processCallArgs(){let e=this;if(W.Selectors.LParenthesis(e.token))if(e._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length,Z.Punctuator,0),e.next(),W.Selectors.RParenthesis(e.token))e._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length,Z.Punctuator,0),e.next();else for(;!W.Selectors.EndOfFile(e.token);){e.skipNewlines(),e.processExpr(),e.skipNewlines();let n=e.requireTokenOfAny(W.SelectorGroups.CallArgsEnd);if(!n)return;if(W.Selectors.RParenthesis(n)){e._builder.push(n.start.line-1,n.start.character-1,n.value.length,Z.Punctuator,0);break}else if(!W.Selectors.ArgumentSeperator(n))break}}processCallExpr(e=!1,n=!1){let r=this;for(r.processMap(e,n);!W.Selectors.EndOfFile(r.token);)if(W.Selectors.MemberSeperator(r.token))r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0),r.next(),r.skipNewlines(),r.processIdentifier(!0);else if(W.Selectors.SLBracket(r.token)&&!r.token.afterSpace){r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0),r.next(),r.skipNewlines(),W.Selectors.SliceSeperator(r.token)?(r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0),r.next(),r.skipNewlines(),W.Selectors.SRBracket(r.token)?r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0):r.processExpr()):(r.processExpr(),W.Selectors.SliceSeperator(r.token)&&(r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0),r.next(),r.skipNewlines(),W.Selectors.SRBracket(r.token)?r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0):r.processExpr()));let i=r.requireToken(W.Selectors.SRBracket);if(!i)return;r._builder.push(i.start.line-1,i.start.character-1,i.value.length,Z.Punctuator,0)}else if(W.Selectors.LParenthesis(r.token)&&(!e||!r.token.afterSpace))r.processCallArgs();else break}processPower(e=!1,n=!1){let r=this;r.processCallExpr(e,n),W.Selectors.Power(r.token)&&(r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Operator,0),r.next(),r.skipNewlines(),r.processCallExpr())}processAddressOf(e=!1,n=!1){let r=this;if(!W.Selectors.Reference(r.token))return r.processPower(e,n);r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0),r.next(),r.skipNewlines(),r.processPower()}processNew(e=!1,n=!1){let r=this;if(!W.Selectors.New(r.token))return r.processAddressOf(e,n);r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Keyword,0),r.next(),r.skipNewlines(),r.processNew()}processUnaryMinus(e=!1,n=!1){let r=this;if(!W.Selectors.Minus(r.token))return r.processNew(e,n);r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Operator,0),r.next(),r.skipNewlines(),r.processNew()}processMultDiv(e=!1,n=!1){let r=this;for(r.processUnaryMinus(e,n);W.SelectorGroups.MultiDivOperators(r.token);)r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Operator,0),r.next(),r.skipNewlines(),r.processUnaryMinus()}processBitwise(e=!1,n=!1){let r=this;for(r.processMultDiv(e,n);Ht.SelectorGroups.BitwiseOperators(r.token);)r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Operator,0),r.next(),r.skipNewlines(),r.processMultDiv()}processAddSub(e=!1,n=!1){let r=this;for(r.processBitwise(e,n);W.Selectors.Plus(r.token)||W.Selectors.Minus(r.token)&&(!n||!r.token.afterSpace||r._lexer.isAtWhitespace());)r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Operator,0),r.next(),r.skipNewlines(),r.processBitwise()}processComparisons(e=!1,n=!1){let r=this;if(r.processAddSub(e,n),!!W.SelectorGroups.ComparisonOperators(r.token))do r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Operator,0),r.next(),r.skipNewlines(),r.processAddSub();while(W.SelectorGroups.ComparisonOperators(r.token))}processBitwiseAnd(e=!1,n=!1){let r=this;for(r.processComparisons(e,n);Ht.Selectors.BitwiseAnd(r.token);)r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0),r.next(),r.processComparisons()}processBitwiseOr(e=!1,n=!1){let r=this;for(r.processBitwiseAnd(e,n);Ht.Selectors.BitwiseOr(r.token);)r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0),r.next(),r.processBitwiseAnd()}processIsa(e=!1,n=!1){let r=this;r.processBitwiseOr(e,n),W.Selectors.Isa(r.token)&&(r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Keyword,0),r.next(),r.skipNewlines(),r.processBitwiseOr())}processNot(e=!1,n=!1){let r=this;if(W.Selectors.Not(r.token)){r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Keyword,0),r.next(),r.skipNewlines(),r.processIsa();return}r.processIsa(e,n)}processAnd(e=!1,n=!1){let r=this;for(r.processNot(e,n);W.Selectors.And(r.token);)r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Keyword,0),r.next(),r.skipNewlines(),r.processNot()}processOr(e=!1,n=!1){let r=this;for(r.processAnd(e,n);W.Selectors.Or(r.token);)r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Keyword,0),r.next(),r.skipNewlines(),r.processAnd()}processFunctionDeclaration(e=!1,n=!1){let r=this;if(!W.Selectors.Function(r.token))return r.processOr(e,n);if(r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Keyword,0),r.next(),!W.SelectorGroups.BlockEndOfLine(r.token)){let i=r.requireToken(W.Selectors.LParenthesis);if(!i)return;for(r._builder.push(i.start.line-1,i.start.character-1,i.value.length,Z.Punctuator,0);!W.SelectorGroups.FunctionDeclarationArgEnd(r.token)&&(r.processIdentifier(!1,!0),r.consume(W.Selectors.Assign)&&(r._builder.push(r.previousToken.start.line-1,r.previousToken.start.character-1,r.previousToken.value.length,Z.Operator,0),r.processExpr()),!W.Selectors.RParenthesis(r.token));){r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0);let o=r.requireToken(W.Selectors.ArgumentSeperator);if(!o)return;if(r._builder.push(o.start.line-1,o.start.character-1,o.value.length,Z.Punctuator,0),W.Selectors.RParenthesis(r.token)){r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0);break}}let s=r.requireToken(W.Selectors.RParenthesis);if(!s)return;r._builder.push(s.start.line-1,s.start.character-1,s.value.length,Z.Punctuator,0)}}processExpr(e=!1,n=!1){this.processFunctionDeclaration(e,n)}processForShortcutStatement(){this.processShortcutStatement()}processForStatement(){let e=this;e.processIdentifier();let n=e.requireToken(W.Selectors.In);n&&(e._builder.push(n.start.line-1,n.start.character-1,n.value.length,Z.Keyword,0),e.processExpr(),W.SelectorGroups.BlockEndOfLine(e.token)||e.processForShortcutStatement())}processWhileShortcutStatement(){this.processShortcutStatement()}processWhileStatement(){let e=this;if(e.processExpr(),!W.SelectorGroups.BlockEndOfLine(e.token))return e.processWhileShortcutStatement()}processIfShortcutStatement(){let e=this;e.processShortcutStatement(),W.Selectors.Else(e.token)&&(e._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length,Z.Keyword,0),e.next(),e.processShortcutStatement())}processNextIfClause(e){let n=this;switch(e){case W.ASTType.ElseifClause:{n.processExpr();let r=n.requireToken(W.Selectors.Then);if(!r)return;n._builder.push(r.start.line-1,r.start.character-1,r.value.length,Z.Keyword,0);break}case W.ASTType.ElseClause:break}}processIfStatement(){let e=this;e.processExpr();let n=e.requireToken(W.Selectors.Then);n&&(e._builder.push(n.start.line-1,n.start.character-1,n.value.length,Z.Keyword,0),W.SelectorGroups.BlockEndOfLine(e.token)||e.processIfShortcutStatement())}processReturnStatement(){let e=this;W.SelectorGroups.ReturnStatementEnd(e.token)||e.processExpr()}processAssignment(){let e=this,n=e.token;if(e.processExpr(!0,!0),W.SelectorGroups.AssignmentEndOfExpr(e.token))return;if(W.Selectors.Assign(e.token)){e._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length,Z.Operator,0),e.next(),e.processExpr();return}else if(W.SelectorGroups.AssignmentShorthand(e.token)){let i=e.token;e._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length,Z.Operator,0),e.next(),e.processExpr();return}let r=[];for(;!W.Selectors.EndOfFile(e.token)&&(e.processExpr(),!(W.SelectorGroups.BlockEndOfLine(e.token)||W.Selectors.Else(e.token)));){if(W.Selectors.ArgumentSeperator(e.token)){e.next(),e.skipNewlines();continue}let i=e.requireTokenOfAny(W.SelectorGroups.AssignmentCommandArgs);if(!i)return;if(W.Selectors.EndOfLine(i)||W.Selectors.EndOfFile(i))break}r.length}processShortcutStatement(){let e=this;if(W.TokenType.Keyword===e.token.type&&W.Keyword.Not!==e.token.value){let n=e.token.value;switch(this._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length,Z.Keyword,0),n){case W.Keyword.Return:e.next(),e.processReturnStatement();case W.Keyword.Continue:{e.next();return}case W.Keyword.Break:{e.next();return}default:}}return e.processAssignment()}processPathSegment(){let e=this;if(this.token.type===W.ASTType.StringLiteral){let r=this.token;e._builder.push(r.start.line-1,r.start.character-1,r.raw.length,Z.String,0),this.next();return}let n="";for(;!Ht.SelectorGroups.PathSegmentEnd(e.token);)e._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length,Z.String,0),n=n+e.token.value,e.next();return e.consumeMany(Ht.SelectorGroups.PathSegmentEnd)&&e._builder.push(e.previousToken.start.line-1,e.previousToken.start.character-1,e.previousToken.value.length,Z.Punctuator,0),n}processFeatureEnvarExpression(){let e=this;e._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length,Z.String,0),e.next()}processFeatureInjectExpression(){this.processPathSegment()}processFeatureImportStatement(){let e=this;e.processIdentifier(),e.consume(Ht.Selectors.From)&&(e._builder.push(e.previousToken.start.line-1,e.previousToken.start.character-1,e.previousToken.value.length,Z.Keyword,0),e.processPathSegment())}processFeatureIncludeStatement(){this.processPathSegment()}processNativeImportCodeStatement(){let e=this;if(e.consume(W.Selectors.LParenthesis)){if(e._builder.push(e.previousToken.start.line-1,e.previousToken.start.character-1,e.previousToken.value.length,Z.Punctuator,0),W.TokenType.StringLiteral===e.token.type){let n=e.token;e._builder.push(n.start.line-1,n.start.character-1,n.raw.length,Z.String,0),e.next()}else return;if(e.consume(W.Selectors.ImportCodeSeperator)){if(e._builder.push(e.previousToken.start.line-1,e.previousToken.start.character-1,e.previousToken.value.length,Z.Punctuator,0),!e.isType(W.TokenType.StringLiteral))return;let n=e.token;e._builder.push(n.start.line-1,n.start.character-1,n.raw.length,Z.String,0),e.next()}e.consume(W.Selectors.RParenthesis)&&e._builder.push(e.previousToken.start.line-1,e.previousToken.start.character-1,e.previousToken.value.length,Z.Punctuator,0)}}processKeyword(){let e=this,n=e.token.value;switch(this._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length,Z.Keyword,0),n){case W.Keyword.Return:{e.next(),e.processReturnStatement();return}case W.Keyword.If:{e.next(),e.processIfStatement();return}case W.Keyword.ElseIf:{e.next(),e.processNextIfClause(W.ASTType.ElseifClause);return}case W.Keyword.Else:{e.next(),e.processNextIfClause(W.ASTType.ElseClause);return}case W.Keyword.While:{e.next(),e.processWhileStatement();return}case W.Keyword.For:{e.next(),e.processForStatement();return}case W.Keyword.EndFunction:{e.next();return}case W.Keyword.EndFor:{e.next();return}case W.Keyword.EndWhile:{e.next();return}case W.Keyword.EndIf:{e.next();return}case W.Keyword.Continue:{e.next();return}case W.Keyword.Break:{e.next();return}case Ht.GreybelKeyword.Include:case Ht.GreybelKeyword.IncludeWithComment:{e.next(),e.processFeatureIncludeStatement();return}case Ht.GreybelKeyword.Import:case Ht.GreybelKeyword.ImportWithComment:{e.next(),e.processFeatureImportStatement();return}case Ht.GreybelKeyword.Envar:{e.next(),e.processFeatureEnvarExpression();return}case Ht.GreybelKeyword.Inject:{e.next(),e.processFeatureInjectExpression();return}case Ht.GreybelKeyword.Debugger:e.next()}}processStatement(){let e=this;if(W.TokenType.Keyword===e.token.type&&W.Keyword.Not!==e.token.value){e.processKeyword();return}e.processAssignment()}process(){let e=this;for(e.next();!W.Selectors.EndOfFile(e.token)&&(e.skipNewlines(),!W.Selectors.EndOfFile(e.token));)e.processStatement()}};function tU(t,e){let n=new Ht.Lexer(e.content,{unsafe:!0});return new Q_(n,t).process(),t}lr.buildTokens=tU});var TC=m(wd=>{"use strict";Object.defineProperty(wd,"__esModule",{value:!0});wd.activate=void 0;var nU=kd();function rU(t){t.connection.languages.semanticTokens.on(async e=>{let n=await t.fs.getTextDocument(e.textDocument.uri);if(n==null)return;let r=t.documentManager.get(n);if(!r.document)return;let i=t.createSemanticTokensBuilder();return(0,nU.buildTokens)(i,r),i.build()})}wd.activate=rU});var SC=m(xd=>{"use strict";Object.defineProperty(xd,"__esModule",{value:!0});xd.buildFoldingRanges=void 0;var Zr=Ee(),Z_=bm(),iU=Pf();function sU(t){let e=[];return new iU.ScraperWalker((r,i)=>{if(r.start.line===r.end.line)return null;switch(r.type){case Zr.ASTType.Comment:return e.push({startLine:r.start.line-1,endLine:r.end.line-1,kind:Z_.FoldingRangeKind.Comment}),null;case Zr.ASTType.MapConstructorExpression:case Zr.ASTType.ListConstructorExpression:case Zr.ASTType.StringLiteral:case Zr.ASTType.WhileStatement:case Zr.ASTType.ForGenericStatement:case Zr.ASTType.FunctionDeclaration:return e.push({startLine:r.start.line-1,endLine:r.end.line-1,kind:Z_.FoldingRangeKind.Region}),null;case Zr.ASTType.IfClause:case Zr.ASTType.ElseifClause:case Zr.ASTType.ElseClause:return e.push({startLine:r.start.line-1,endLine:r.end.line-2,kind:Z_.FoldingRangeKind.Region}),null}return null}).visit(t.document),e}xd.buildFoldingRanges=sU});var kC=m(Ed=>{"use strict";Object.defineProperty(Ed,"__esModule",{value:!0});Ed.activate=void 0;var oU=SC();function aU(t){t.connection.languages.foldingRange.on(async e=>{let n=await t.fs.getTextDocument(e.textDocument.uri);if(n==null)return;let r=t.documentManager.get(n);if(r.document)return(0,oU.buildFoldingRanges)(r)})}Ed.activate=aU});var Cd=m((fV,AC)=>{var Qu=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,uU=typeof AbortController=="function",Ad=uU?AbortController:class{constructor(){this.signal=new wC}abort(e=new Error("This operation was aborted")){this.signal.reason=this.signal.reason||e,this.signal.aborted=!0,this.signal.dispatchEvent({type:"abort",target:this.signal})}},lU=typeof AbortSignal=="function",cU=typeof Ad.AbortSignal=="function",wC=lU?AbortSignal:cU?Ad.AbortController:class{constructor(){this.reason=void 0,this.aborted=!1,this._listeners=[]}dispatchEvent(e){e.type==="abort"&&(this.aborted=!0,this.onabort(e),this._listeners.forEach(n=>n(e),this))}onabort(){}addEventListener(e,n){e==="abort"&&this._listeners.push(n)}removeEventListener(e,n){e==="abort"&&(this._listeners=this._listeners.filter(r=>r!==n))}},rT=new Set,eT=(t,e)=>{let n=`LRU_CACHE_OPTION_${t}`;Od(n)&&iT(n,`${t} option`,`options.${e}`,ma)},tT=(t,e)=>{let n=`LRU_CACHE_METHOD_${t}`;if(Od(n)){let{prototype:r}=ma,{get:i}=Object.getOwnPropertyDescriptor(r,t);iT(n,`${t} method`,`cache.${e}()`,i)}},hU=(t,e)=>{let n=`LRU_CACHE_PROPERTY_${t}`;if(Od(n)){let{prototype:r}=ma,{get:i}=Object.getOwnPropertyDescriptor(r,t);iT(n,`${t} property`,`cache.${e}`,i)}},xC=(...t)=>{typeof process=="object"&&process&&typeof process.emitWarning=="function"?process.emitWarning(...t):console.error(...t)},Od=t=>!rT.has(t),iT=(t,e,n,r)=>{rT.add(t);let i=`The ${e} is deprecated. Please use ${n} instead.`;xC(i,"DeprecationWarning",t,r)},rs=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),EC=t=>rs(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?ga:null:null,ga=class extends Array{constructor(e){super(e),this.fill(0)}},nT=class{constructor(e){if(e===0)return[];let n=EC(e);this.heap=new n(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},ma=class t{constructor(e={}){let{max:n=0,ttl:r,ttlResolution:i=1,ttlAutopurge:s,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:u,dispose:l,disposeAfter:c,noDisposeOnSet:h,noUpdateTTL:f,maxSize:g=0,maxEntrySize:v=0,sizeCalculation:b,fetchMethod:O,fetchContext:A,noDeleteOnFetchRejection:k,noDeleteOnStaleGet:S,allowStaleOnFetchRejection:_,allowStaleOnFetchAbort:N,ignoreFetchAbort:R}=e,{length:G,maxAge:ie,stale:ue}=e instanceof t?{}:e;if(n!==0&&!rs(n))throw new TypeError("max option must be a nonnegative integer");let K=n?EC(n):Array;if(!K)throw new Error("invalid max value: "+n);if(this.max=n,this.maxSize=g,this.maxEntrySize=v||this.maxSize,this.sizeCalculation=b||G,this.sizeCalculation){if(!this.maxSize&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(this.fetchMethod=O||null,this.fetchMethod&&typeof this.fetchMethod!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.fetchContext=A,!this.fetchMethod&&A!==void 0)throw new TypeError("cannot set fetchContext without fetchMethod");if(this.keyMap=new Map,this.keyList=new Array(n).fill(null),this.valList=new Array(n).fill(null),this.next=new K(n),this.prev=new K(n),this.head=0,this.tail=0,this.free=new nT(n),this.initialFill=1,this.size=0,typeof l=="function"&&(this.dispose=l),typeof c=="function"?(this.disposeAfter=c,this.disposed=[]):(this.disposeAfter=null,this.disposed=null),this.noDisposeOnSet=!!h,this.noUpdateTTL=!!f,this.noDeleteOnFetchRejection=!!k,this.allowStaleOnFetchRejection=!!_,this.allowStaleOnFetchAbort=!!N,this.ignoreFetchAbort=!!R,this.maxEntrySize!==0){if(this.maxSize!==0&&!rs(this.maxSize))throw new TypeError("maxSize must be a positive integer if specified");if(!rs(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.initializeSizeTracking()}if(this.allowStale=!!u||!!ue,this.noDeleteOnStaleGet=!!S,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=rs(i)||i===0?i:1,this.ttlAutopurge=!!s,this.ttl=r||ie||0,this.ttl){if(!rs(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.initializeTTLTracking()}if(this.max===0&&this.ttl===0&&this.maxSize===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.max&&!this.maxSize){let C="LRU_CACHE_UNBOUNDED";Od(C)&&(rT.add(C),xC("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",C,t))}ue&&eT("stale","allowStale"),ie&&eT("maxAge","ttl"),G&&eT("length","sizeCalculation")}getRemainingTTL(e){return this.has(e,{updateAgeOnHas:!1})?1/0:0}initializeTTLTracking(){this.ttls=new ga(this.max),this.starts=new ga(this.max),this.setItemTTL=(r,i,s=Qu.now())=>{if(this.starts[r]=i!==0?s:0,this.ttls[r]=i,i!==0&&this.ttlAutopurge){let o=setTimeout(()=>{this.isStale(r)&&this.delete(this.keyList[r])},i+1);o.unref&&o.unref()}},this.updateItemAge=r=>{this.starts[r]=this.ttls[r]!==0?Qu.now():0},this.statusTTL=(r,i)=>{r&&(r.ttl=this.ttls[i],r.start=this.starts[i],r.now=e||n(),r.remainingTTL=r.now+r.ttl-r.start)};let e=0,n=()=>{let r=Qu.now();if(this.ttlResolution>0){e=r;let i=setTimeout(()=>e=0,this.ttlResolution);i.unref&&i.unref()}return r};this.getRemainingTTL=r=>{let i=this.keyMap.get(r);return i===void 0?0:this.ttls[i]===0||this.starts[i]===0?1/0:this.starts[i]+this.ttls[i]-(e||n())},this.isStale=r=>this.ttls[r]!==0&&this.starts[r]!==0&&(e||n())-this.starts[r]>this.ttls[r]}updateItemAge(e){}statusTTL(e,n){}setItemTTL(e,n,r){}isStale(e){return!1}initializeSizeTracking(){this.calculatedSize=0,this.sizes=new ga(this.max),this.removeItemSize=e=>{this.calculatedSize-=this.sizes[e],this.sizes[e]=0},this.requireSize=(e,n,r,i)=>{if(this.isBackgroundFetch(n))return 0;if(!rs(r))if(i){if(typeof i!="function")throw new TypeError("sizeCalculation must be a function");if(r=i(n,e),!rs(r))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return r},this.addItemSize=(e,n,r)=>{if(this.sizes[e]=n,this.maxSize){let i=this.maxSize-this.sizes[e];for(;this.calculatedSize>i;)this.evict(!0)}this.calculatedSize+=this.sizes[e],r&&(r.entrySize=n,r.totalCalculatedSize=this.calculatedSize)}}removeItemSize(e){}addItemSize(e,n){}requireSize(e,n,r,i){if(r||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache")}*indexes({allowStale:e=this.allowStale}={}){if(this.size)for(let n=this.tail;!(!this.isValidIndex(n)||((e||!this.isStale(n))&&(yield n),n===this.head));)n=this.prev[n]}*rindexes({allowStale:e=this.allowStale}={}){if(this.size)for(let n=this.head;!(!this.isValidIndex(n)||((e||!this.isStale(n))&&(yield n),n===this.tail));)n=this.next[n]}isValidIndex(e){return e!==void 0&&this.keyMap.get(this.keyList[e])===e}*entries(){for(let e of this.indexes())this.valList[e]!==void 0&&this.keyList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield[this.keyList[e],this.valList[e]])}*rentries(){for(let e of this.rindexes())this.valList[e]!==void 0&&this.keyList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield[this.keyList[e],this.valList[e]])}*keys(){for(let e of this.indexes())this.keyList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield this.keyList[e])}*rkeys(){for(let e of this.rindexes())this.keyList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield this.keyList[e])}*values(){for(let e of this.indexes())this.valList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield this.valList[e])}*rvalues(){for(let e of this.rindexes())this.valList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield this.valList[e])}[Symbol.iterator](){return this.entries()}find(e,n){for(let r of this.indexes()){let i=this.valList[r],s=this.isBackgroundFetch(i)?i.__staleWhileFetching:i;if(s!==void 0&&e(s,this.keyList[r],this))return this.get(this.keyList[r],n)}}forEach(e,n=this){for(let r of this.indexes()){let i=this.valList[r],s=this.isBackgroundFetch(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(n,s,this.keyList[r],this)}}rforEach(e,n=this){for(let r of this.rindexes()){let i=this.valList[r],s=this.isBackgroundFetch(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(n,s,this.keyList[r],this)}}get prune(){return tT("prune","purgeStale"),this.purgeStale}purgeStale(){let e=!1;for(let n of this.rindexes({allowStale:!0}))this.isStale(n)&&(this.delete(this.keyList[n]),e=!0);return e}dump(){let e=[];for(let n of this.indexes({allowStale:!0})){let r=this.keyList[n],i=this.valList[n],s=this.isBackgroundFetch(i)?i.__staleWhileFetching:i;if(s===void 0)continue;let o={value:s};if(this.ttls){o.ttl=this.ttls[n];let a=Qu.now()-this.starts[n];o.start=Math.floor(Date.now()-a)}this.sizes&&(o.size=this.sizes[n]),e.unshift([r,o])}return e}load(e){this.clear();for(let[n,r]of e){if(r.start){let i=Date.now()-r.start;r.start=Qu.now()-i}this.set(n,r.value,r)}}dispose(e,n,r){}set(e,n,{ttl:r=this.ttl,start:i,noDisposeOnSet:s=this.noDisposeOnSet,size:o=0,sizeCalculation:a=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,status:l}={}){if(o=this.requireSize(e,n,o,a),this.maxEntrySize&&o>this.maxEntrySize)return l&&(l.set="miss",l.maxEntrySizeExceeded=!0),this.delete(e),this;let c=this.size===0?void 0:this.keyMap.get(e);if(c===void 0)c=this.newIndex(),this.keyList[c]=e,this.valList[c]=n,this.keyMap.set(e,c),this.next[this.tail]=c,this.prev[c]=this.tail,this.tail=c,this.size++,this.addItemSize(c,o,l),l&&(l.set="add"),u=!1;else{this.moveToTail(c);let h=this.valList[c];if(n!==h){if(this.isBackgroundFetch(h)?h.__abortController.abort(new Error("replaced")):s||(this.dispose(h,e,"set"),this.disposeAfter&&this.disposed.push([h,e,"set"])),this.removeItemSize(c),this.valList[c]=n,this.addItemSize(c,o,l),l){l.set="replace";let f=h&&this.isBackgroundFetch(h)?h.__staleWhileFetching:h;f!==void 0&&(l.oldValue=f)}}else l&&(l.set="update")}if(r!==0&&this.ttl===0&&!this.ttls&&this.initializeTTLTracking(),u||this.setItemTTL(c,r,i),this.statusTTL(l,c),this.disposeAfter)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return this}newIndex(){return this.size===0?this.tail:this.size===this.max&&this.max!==0?this.evict(!1):this.free.length!==0?this.free.pop():this.initialFill++}pop(){if(this.size){let e=this.valList[this.head];return this.evict(!0),e}}evict(e){let n=this.head,r=this.keyList[n],i=this.valList[n];return this.isBackgroundFetch(i)?i.__abortController.abort(new Error("evicted")):(this.dispose(i,r,"evict"),this.disposeAfter&&this.disposed.push([i,r,"evict"])),this.removeItemSize(n),e&&(this.keyList[n]=null,this.valList[n]=null,this.free.push(n)),this.head=this.next[n],this.keyMap.delete(r),this.size--,n}has(e,{updateAgeOnHas:n=this.updateAgeOnHas,status:r}={}){let i=this.keyMap.get(e);if(i!==void 0)if(this.isStale(i))r&&(r.has="stale",this.statusTTL(r,i));else return n&&this.updateItemAge(i),r&&(r.has="hit"),this.statusTTL(r,i),!0;else r&&(r.has="miss");return!1}peek(e,{allowStale:n=this.allowStale}={}){let r=this.keyMap.get(e);if(r!==void 0&&(n||!this.isStale(r))){let i=this.valList[r];return this.isBackgroundFetch(i)?i.__staleWhileFetching:i}}backgroundFetch(e,n,r,i){let s=n===void 0?void 0:this.valList[n];if(this.isBackgroundFetch(s))return s;let o=new Ad;r.signal&&r.signal.addEventListener("abort",()=>o.abort(r.signal.reason));let a={signal:o.signal,options:r,context:i},u=(g,v=!1)=>{let{aborted:b}=o.signal,O=r.ignoreFetchAbort&&g!==void 0;return r.status&&(b&&!v?(r.status.fetchAborted=!0,r.status.fetchError=o.signal.reason,O&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),b&&!O&&!v?c(o.signal.reason):(this.valList[n]===f&&(g===void 0?f.__staleWhileFetching?this.valList[n]=f.__staleWhileFetching:this.delete(e):(r.status&&(r.status.fetchUpdated=!0),this.set(e,g,a.options))),g)},l=g=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=g),c(g)),c=g=>{let{aborted:v}=o.signal,b=v&&r.allowStaleOnFetchAbort,O=b||r.allowStaleOnFetchRejection,A=O||r.noDeleteOnFetchRejection;if(this.valList[n]===f&&(!A||f.__staleWhileFetching===void 0?this.delete(e):b||(this.valList[n]=f.__staleWhileFetching)),O)return r.status&&f.__staleWhileFetching!==void 0&&(r.status.returnedStale=!0),f.__staleWhileFetching;if(f.__returned===f)throw g},h=(g,v)=>{this.fetchMethod(e,s,a).then(b=>g(b),v),o.signal.addEventListener("abort",()=>{(!r.ignoreFetchAbort||r.allowStaleOnFetchAbort)&&(g(),r.allowStaleOnFetchAbort&&(g=b=>u(b,!0)))})};r.status&&(r.status.fetchDispatched=!0);let f=new Promise(h).then(u,l);return f.__abortController=o,f.__staleWhileFetching=s,f.__returned=null,n===void 0?(this.set(e,f,{...a.options,status:void 0}),n=this.keyMap.get(e)):this.valList[n]=f,f}isBackgroundFetch(e){return e&&typeof e=="object"&&typeof e.then=="function"&&Object.prototype.hasOwnProperty.call(e,"__staleWhileFetching")&&Object.prototype.hasOwnProperty.call(e,"__returned")&&(e.__returned===e||e.__returned===null)}async fetch(e,{allowStale:n=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,ttl:s=this.ttl,noDisposeOnSet:o=this.noDisposeOnSet,size:a=0,sizeCalculation:u=this.sizeCalculation,noUpdateTTL:l=this.noUpdateTTL,noDeleteOnFetchRejection:c=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:h=this.allowStaleOnFetchRejection,ignoreFetchAbort:f=this.ignoreFetchAbort,allowStaleOnFetchAbort:g=this.allowStaleOnFetchAbort,fetchContext:v=this.fetchContext,forceRefresh:b=!1,status:O,signal:A}={}){if(!this.fetchMethod)return O&&(O.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:i,status:O});let k={allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:i,ttl:s,noDisposeOnSet:o,size:a,sizeCalculation:u,noUpdateTTL:l,noDeleteOnFetchRejection:c,allowStaleOnFetchRejection:h,allowStaleOnFetchAbort:g,ignoreFetchAbort:f,status:O,signal:A},S=this.keyMap.get(e);if(S===void 0){O&&(O.fetch="miss");let _=this.backgroundFetch(e,S,k,v);return _.__returned=_}else{let _=this.valList[S];if(this.isBackgroundFetch(_)){let ue=n&&_.__staleWhileFetching!==void 0;return O&&(O.fetch="inflight",ue&&(O.returnedStale=!0)),ue?_.__staleWhileFetching:_.__returned=_}let N=this.isStale(S);if(!b&&!N)return O&&(O.fetch="hit"),this.moveToTail(S),r&&this.updateItemAge(S),this.statusTTL(O,S),_;let R=this.backgroundFetch(e,S,k,v),G=R.__staleWhileFetching!==void 0,ie=G&&n;return O&&(O.fetch=G&&N?"stale":"refresh",ie&&N&&(O.returnedStale=!0)),ie?R.__staleWhileFetching:R.__returned=R}}get(e,{allowStale:n=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,status:s}={}){let o=this.keyMap.get(e);if(o!==void 0){let a=this.valList[o],u=this.isBackgroundFetch(a);return this.statusTTL(s,o),this.isStale(o)?(s&&(s.get="stale"),u?(s&&(s.returnedStale=n&&a.__staleWhileFetching!==void 0),n?a.__staleWhileFetching:void 0):(i||this.delete(e),s&&(s.returnedStale=n),n?a:void 0)):(s&&(s.get="hit"),u?a.__staleWhileFetching:(this.moveToTail(o),r&&this.updateItemAge(o),a))}else s&&(s.get="miss")}connect(e,n){this.prev[n]=e,this.next[e]=n}moveToTail(e){e!==this.tail&&(e===this.head?this.head=this.next[e]:this.connect(this.prev[e],this.next[e]),this.connect(this.tail,e),this.tail=e)}get del(){return tT("del","delete"),this.delete}delete(e){let n=!1;if(this.size!==0){let r=this.keyMap.get(e);if(r!==void 0)if(n=!0,this.size===1)this.clear();else{this.removeItemSize(r);let i=this.valList[r];this.isBackgroundFetch(i)?i.__abortController.abort(new Error("deleted")):(this.dispose(i,e,"delete"),this.disposeAfter&&this.disposed.push([i,e,"delete"])),this.keyMap.delete(e),this.keyList[r]=null,this.valList[r]=null,r===this.tail?this.tail=this.prev[r]:r===this.head?this.head=this.next[r]:(this.next[this.prev[r]]=this.next[r],this.prev[this.next[r]]=this.prev[r]),this.size--,this.free.push(r)}}if(this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return n}clear(){for(let e of this.rindexes({allowStale:!0})){let n=this.valList[e];if(this.isBackgroundFetch(n))n.__abortController.abort(new Error("deleted"));else{let r=this.keyList[e];this.dispose(n,r,"delete"),this.disposeAfter&&this.disposed.push([n,r,"delete"])}}if(this.keyMap.clear(),this.valList.fill(null),this.keyList.fill(null),this.ttls&&(this.ttls.fill(0),this.starts.fill(0)),this.sizes&&this.sizes.fill(0),this.head=0,this.tail=0,this.initialFill=1,this.free.length=0,this.calculatedSize=0,this.size=0,this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift())}get reset(){return tT("reset","clear"),this.clear}get length(){return hU("length","size"),this.size}static get AbortController(){return Ad}static get AbortSignal(){return wC}};AC.exports=ma});var MC=m((dV,IC)=>{var uT=Object.defineProperty,fU=Object.getOwnPropertyDescriptor,dU=Object.getOwnPropertyNames,pU=Object.prototype.hasOwnProperty,gU=(t,e)=>{for(var n in e)uT(t,n,{get:e[n],enumerable:!0})},mU=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of dU(e))!pU.call(t,i)&&i!==n&&uT(t,i,{get:()=>e[i],enumerable:!(r=fU(e,i))||r.enumerable});return t},yU=t=>mU(uT({},"__esModule",{value:!0}),t),OC={};gU(OC,{ScheduleIntervalHelper:()=>sT,SchedulePostMessageHelper:()=>oT,ScheduleSetImmmediateHelper:()=>aT,schedule:()=>_U,scheduleProvider:()=>DC});IC.exports=yU(OC);var bU=Promise.prototype.then.bind(Promise.resolve()),lT=class Rd{constructor(){this.queue=[],this.sleep=0}static{this.SLEEP_LIMIT=512}static{this.QUEUE_LIMIT=1024}static isApplicable(){return!1}static createCallback(){throw new Error("Cannot create callback from base schedule helper!")}tick(){let e=this.queue,n=Math.min(e.length,Rd.QUEUE_LIMIT);this.queue=this.queue.slice(Rd.QUEUE_LIMIT);for(let r=0;r<n;bU(e[r++]));if(this.queue.length>0&&(this.sleep=0),this.sleep++<=Rd.SLEEP_LIMIT){this.nextTick();return}this.endTick()}start(){this.isTickActive()||(this.sleep=0,this.startTick())}add(e){this.queue.push(e),this.start()}},sT=class CC extends lT{constructor(){super(...arguments),this.timer=null,this.boundTick=this.tick.bind(this)}static isApplicable(){return!!globalThis.setInterval}static createCallback(){let e=new CC;return e.add.bind(e)}isTickActive(){return this.timer!==null}startTick(){this.timer=setInterval(this.boundTick,0)}nextTick(){}endTick(){clearInterval(this.timer),this.timer=null}},vU=()=>{try{return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}catch{}return!1},oT=class RC extends lT{constructor(){super(),this.id=(Math.random()+1).toString(36).substring(7),this.active=!1,self.addEventListener("message",this.onMessage.bind(this))}static isApplicable(){return!vU()&&!!self.postMessage&&!!self.addEventListener}static createCallback(){let e=new RC;return e.add.bind(e)}onMessage(e){e.source!==self||e.data!==this.id||this.tick()}isTickActive(){return this.active}startTick(){this.active=!0,self.postMessage(this.id)}nextTick(){self.postMessage(this.id)}endTick(){this.active=!1}},aT=class PC extends lT{constructor(){super(...arguments),this.immediate=null,this.boundTick=this.tick.bind(this)}static isApplicable(){return!!globalThis.setImmediate}static createCallback(){let e=new PC;return e.add.bind(e)}isTickActive(){return this.immediate!==null}startTick(){this.immediate=setImmediate(this.boundTick)}nextTick(){this.immediate=setImmediate(this.boundTick)}endTick(){clearImmediate(this.immediate),this.immediate=null}};function DC(){if(aT.isApplicable())return aT.createCallback();if(oT.isApplicable())return oT.createCallback();if(sT.isApplicable())return sT.createCallback();throw new Error("No schedule helper fulfills requirements!")}var _U=DC()});var LC=m(Bn=>{"use strict";var fT=Bn&&Bn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Bn,"__esModule",{value:!0});Bn.DocumentManager=Bn.PROCESSING_TIMEOUT=Bn.ActiveDocument=Bn.DocumentURIBuilder=void 0;var TU=fT(require("events")),SU=Yr(),kU=fT(Cd()),cT=MC(),ya=md(),wU=fT(Ju()),Pd=class{constructor(e,n=null){this.workspaceFolderUri=n,this.rootPath=e}getFromWorkspaceFolder(e){return this.workspaceFolderUri==null?(console.warn("Workspace folders are not available. Falling back to only relative paths."),ya.Utils.joinPath(this.rootPath,e).toString()):ya.Utils.joinPath(this.workspaceFolderUri,e).toString()}getFromRootPath(e){return ya.Utils.joinPath(this.rootPath,e).toString()}};Bn.DocumentURIBuilder=Pd;var Dd=class{constructor(e){this.documentManager=e.documentManager,this.content=e.content,this.textDocument=e.textDocument,this.document=e.document,this.errors=e.errors}getDirectory(){return ya.Utils.joinPath(ya.URI.parse(this.textDocument.uri),"..")}async getImportsAndIncludes(e=null){if(this.document==null)return[];let n=this.document,r=this.getDirectory(),i=this.documentManager.context,s=new Pd(r,e),o=u=>u.startsWith("/")?i.fs.findExistingPath(s.getFromWorkspaceFolder(u),s.getFromWorkspaceFolder(`${u}.src`)):i.fs.findExistingPath(s.getFromRootPath(u),s.getFromRootPath(`${u}.src`));return(await Promise.all([...n.imports.filter(u=>u.path).map(u=>o(u.path)),...n.includes.filter(u=>u.path).map(u=>o(u.path))])).filter(u=>u!=null)}async getDependencies(){if(this.document==null)return[];if(this.dependencies)return this.dependencies;let e=await this.documentManager.context.fs.getWorkspaceFolderUri(ya.URI.parse(this.textDocument.uri)),n=await this.getImportsAndIncludes(e),r=new Set([...n]);return this.dependencies=Array.from(r),this.dependencies}async getImports(e=!0){if(this.document==null)return[];let n=new Set,r=new Set([this.textDocument.uri]),i=async s=>{let o=await s.getDependencies();for(let a of o){if(r.has(a))continue;let u=await this.documentManager.open(a);r.add(a),u!==null&&(n.add(u),u.document!==null&&e&&await i(u))}};return await i(this),Array.from(n)}};Bn.ActiveDocument=Dd;Bn.PROCESSING_TIMEOUT=100;var hT=class extends TU.default{get context(){return this._context}setContext(e){return this._context=e,this}constructor(e=Bn.PROCESSING_TIMEOUT){super(),this._context=null,this._timer=null,this.results=new kU.default({ttl:1e3*60*20,ttlAutopurge:!0}),this.scheduledItems=new Map,this.tickRef=this.tick.bind(this),this.processingTimeout=e,(0,cT.schedule)(this.tickRef)}tick(){if(this.scheduledItems.size===0){this._timer=null;return}let e=Date.now(),n=Array.from(this.scheduledItems.values());for(let r=0;r<n.length;r++){let i=n[r];e-i.createdAt>this.processingTimeout&&(0,cT.schedule)(()=>this.refresh(i.document))}this._timer=setTimeout(this.tickRef,0)}refresh(e){let n=e.uri;if(!this.scheduledItems.has(n)&&this.results.has(n))return this.results.get(n);let r=this.create(e);return this.results.set(n,r),this.emit("parsed",e,r),this.scheduledItems.delete(n),r}create(e){let n=e.getText(),r=new SU.Parser(n,{unsafe:!0}),i=r.parseChunk();return this._context.documentMerger.flushCacheKey(e.uri),wU.default.analyze(e.uri,i),new Dd({documentManager:this,content:n,textDocument:e,document:i,errors:[...r.lexer.errors,...r.errors]})}schedule(e){let n=e.uri,r=e.getText();return this.results.get(n)?.content===r?!1:(this.scheduledItems.set(n,{document:e,createdAt:Date.now()}),this._timer===null&&(this._timer=setTimeout(this.tickRef,0)),!0)}async open(e){try{let n=await this.context.fs.getTextDocument(e);return n==null?null:this.get(n)}catch{return null}}get(e){return this.results.get(e.uri)||this.refresh(e)}getLatest(e,n=5e3){return new Promise(r=>{(0,cT.schedule)(()=>{if(!this.scheduledItems.has(e.uri))return r(this.get(e));let i=()=>{this.removeListener("parsed",s),r(this.get(e))},s=a=>{a.uri===e.uri&&(this.removeListener("parsed",s),clearTimeout(o),r(this.get(e)))},o=setTimeout(i,n);this.addListener("parsed",s)})})}clear(e){this.results.delete(e.uri),this.emit("cleared",e)}};Bn.DocumentManager=hT});var qC=m((gV,dT)=>{dT.exports=function(t){return NC(xU(t),t)};dT.exports.array=NC;function NC(t,e){var n=t.length,r=new Array(n),i={},s=n,o=EU(e),a=AU(t);for(e.forEach(function(l){if(!a.has(l[0])||!a.has(l[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});s--;)i[s]||u(t[s],s,new Set);return r;function u(l,c,h){if(h.has(l)){var f;try{f=", node was:"+JSON.stringify(l)}catch{f=""}throw new Error("Cyclic dependency"+f)}if(!a.has(l))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(l));if(!i[c]){i[c]=!0;var g=o.get(l)||new Set;if(g=Array.from(g),c=g.length){h.add(l);do{var v=g[--c];u(v,a.get(v),h)}while(c);h.delete(l)}r[--n]=l}}}function xU(t){for(var e=new Set,n=0,r=t.length;n<r;n++){var i=t[n];e.add(i[0]),e.add(i[1])}return Array.from(e)}function EU(t){for(var e=new Map,n=0,r=t.length;n<r;n++){var i=t[n];e.has(i[0])||e.set(i[0],new Set),e.has(i[1])||e.set(i[1],new Set),e.get(i[0]).add(i[1])}return e}function AU(t){for(var e=new Map,n=0,r=t.length;n<r;n++)e.set(t[n],n);return e}});var jC=m(Id=>{"use strict";Object.defineProperty(Id,"__esModule",{value:!0});Id.hash=void 0;function OU(t){let e=5381,n=t.length;for(;n;)e=e*33^t.charCodeAt(--n);return e>>>0}Id.hash=OU});var $C=m(ba=>{"use strict";var gT=ba&&ba.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ba,"__esModule",{value:!0});ba.DocumentMerger=void 0;var CU=gT(Cd()),RU=gT(qC()),PU=bs(),FC=jC(),Md=gT(Ju()),pT=class{constructor(){this.keyToDocumentUriMap=new Map,this.results=new CU.default({ttl:1e3*60*20,ttlAutopurge:!0})}createCacheKey(e,n){let r=(0,FC.hash)(`main-${e.uri}-${e.version}`);for(let i=0;i<n.length;i++){let s=n[i];r^=(0,FC.hash)(`${s.textDocument.uri}-${s.textDocument.version}`),r=r>>>0}return r}registerCacheKey(e,n){this.flushCacheKey(n),this.keyToDocumentUriMap.set(n,e)}flushCacheKey(e){let n=this.keyToDocumentUriMap.get(e);n&&(this.results.delete(n),this.keyToDocumentUriMap.delete(e))}flushCache(){this.results.clear()}async processByDependencies(e,n,r){let i=e.uri;if(r.has(i))return r.get(i);let s=Md.default.get(i);if(r.set(i,null),!s)return null;let o=[],a=await n.documentManager.get(e).getImports(),u=this.createCacheKey(e,a);if(this.results.has(u))return this.results.get(u);this.registerCacheKey(u,i);let l=await n.documentManager.get(e).getDependencies();await Promise.all(l.map(async h=>{let f=n.documentManager.results.get(h);if(!f)return;let{document:g,textDocument:v}=f;if(!g)return;let b=await this.processByDependencies(v,n,r);b!==null&&o.push(b)}));let c=s.merge(...o);return r.set(i,c),this.results.set(u,c),c}async buildByDependencies(e,n){let r=e.uri,i=Md.default.get(r);if(!i)return null;let s=[],o=await n.documentManager.get(e).getImports(),a=this.createCacheKey(e,o);if(this.results.has(a))return this.results.get(a);this.registerCacheKey(a,r);let u=await n.documentManager.get(e).getDependencies(),l=new Map([[r,null]]);await Promise.all(u.map(async h=>{let f=n.documentManager.results.get(h);if(!f)return;let{document:g,textDocument:v}=f;if(!g)return;let b=await this.processByDependencies(v,n,l);b!==null&&s.push(b)}));let c=i.merge(...s);return this.results.set(a,c),c}async buildByWorkspace(e,n){let r=e.uri,i=Md.default.get(r);if(!i)return null;let s=[],o=await n.fs.getWorkspaceRelatedFiles(),a=await Promise.all(o.map(async g=>await n.documentManager.open(g.toString()))),u=this.createCacheKey(e,a);if(this.results.has(u))return this.results.get(u);this.registerCacheKey(u,r);let l=a.map(g=>g.textDocument.uri),c=await Promise.all(a.map(async g=>(await g.getDependencies()).map(b=>[g.textDocument.uri,b]))),h=RU.default.array(l,c.flat());for(let g=h.length-1;g>=0;g--){let v=h[g];if(v===r)continue;let b=Md.default.get(v);if(b===null)return;s.push(b)}let f=i.merge(...s);return this.results.set(u,f),f}async build(e,n){return n.getConfiguration().typeAnalyzer.strategy===PU.TypeAnalyzerStrategy.Workspace?this.buildByWorkspace(e,n):this.buildByDependencies(e,n)}};ba.DocumentMerger=pT});var WC=m(va=>{"use strict";var DU=va&&va.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(va,"__esModule",{value:!0});va.CoreContext=void 0;var IU=DU(require("events")),Zu=bs(),BC=kd();function UC(t){return{fileExtensions:t?.fileExtensions?t.fileExtensions.split(","):Zu.DefaultFileExtensions,formatter:t?.formatter??!0,autocomplete:t?.autocomplete??!0,hoverdocs:t?.hoverdocs??!0,diagnostic:t?.diagnostic??!0,transpiler:{beautify:{keepParentheses:t?.transpiler?.beautify?.keepParentheses??!0,indentation:t?.transpiler?.beautify?.indentation??Zu.IndentationType.Tab,indentationSpaces:t?.transpiler?.beautify?.indentationSpaces??2}},typeAnalyzer:{strategy:t?.typeAnalyzer?.strategy??Zu.TypeAnalyzerStrategy.Dependency,exclude:t?.typeAnalyzer?.exclude??void 0}}}var mT=class extends IU.default{constructor(){super(),this._configuration=UC(),this._features={configuration:!1,workspaceFolder:!1}}get features(){return this._features}getConfiguration(){return this._configuration}async syncConfiguraton(){let e=await this.connection.workspace.getConfiguration(Zu.ConfigurationNamespace),n=UC(e),r=n.typeAnalyzer,i=this._configuration.typeAnalyzer;(r.strategy!==i.strategy||r.exclude!==i.exclude)&&this.documentMerger.flushCache(),this._configuration=n}configureCapabilties(e){this._features.configuration=!!(e.workspace&&e.workspace.configuration),this._features.workspaceFolder=!!(e.workspace&&e.workspace.workspaceFolders)}async onInitialize(e){this.configureCapabilties(e.capabilities);let n={capabilities:{completionProvider:{triggerCharacters:["."],resolveProvider:!0},hoverProvider:!0,colorProvider:!0,definitionProvider:!0,documentFormattingProvider:!0,foldingRangeProvider:!0,signatureHelpProvider:{triggerCharacters:[",","("]},documentSymbolProvider:!0,workspaceSymbolProvider:!0,diagnosticProvider:{identifier:Zu.LanguageId,interFileDependencies:!1,workspaceDiagnostics:!1},semanticTokensProvider:{legend:{tokenTypes:BC.semanticTokensLegend.tokenTypes,tokenModifiers:BC.semanticTokensLegend.tokenModifiers},full:!0},textDocumentSync:2}};return this._features.workspaceFolder&&(n.capabilities.workspace={workspaceFolders:{supported:!0}}),this.emit("ready",this),n}async onInitialized(e){this._features.configuration&&(await this.syncConfiguraton(),this.connection.onDidChangeConfiguration(async()=>{let n=this._configuration;await this.syncConfiguraton(),this.emit("configuration-change",this,this._configuration,n)})),this.emit("loaded",this)}async listen(){this.fs.listen(this.connection),this.connection.onInitialize(this.onInitialize.bind(this)),this.connection.onInitialized(this.onInitialized.bind(this)),this.connection.listen()}};va.CoreContext=mT});var Ld=m(X=>{"use strict";var MU=X&&X.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),LU=X&&X.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),NU=X&&X.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&MU(e,t,n);return LU(e,t),e},qU=X&&X.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(X,"__esModule",{value:!0});X.CoreContext=X.buildTokens=X.semanticTokensLegend=X.lookupBase=X.lookupIdentifier=X.typeAnalyzer=X.appendTooltipHeader=X.appendTooltipBody=X.formatTypes=X.formatDefaultValue=X.createTooltipHeader=X.createSignatureInfo=X.createHover=X.MarkdownString=X.LookupHelper=X.DocumentMerger=X.DocumentManager=X.ActiveDocument=X.ASTScraper=X.activateFoldingRange=X.activateSemantic=X.activateSymbol=X.activateSubscriptions=X.activateSignature=X.activateHover=X.activateFormatter=X.activateDiagnostic=X.activateDefinition=X.activateColor=X.activateAutocomplete=X.DefaultFileExtensions=X.TypeAnalyzerStrategy=X.ConfigurationNamespace=X.LanguageId=X.IndentationType=void 0;var el=bs();Object.defineProperty(X,"IndentationType",{enumerable:!0,get:function(){return el.IndentationType}});Object.defineProperty(X,"LanguageId",{enumerable:!0,get:function(){return el.LanguageId}});Object.defineProperty(X,"ConfigurationNamespace",{enumerable:!0,get:function(){return el.ConfigurationNamespace}});Object.defineProperty(X,"TypeAnalyzerStrategy",{enumerable:!0,get:function(){return el.TypeAnalyzerStrategy}});Object.defineProperty(X,"DefaultFileExtensions",{enumerable:!0,get:function(){return el.DefaultFileExtensions}});var jU=sO();Object.defineProperty(X,"activateAutocomplete",{enumerable:!0,get:function(){return jU.activate}});var FU=gO();Object.defineProperty(X,"activateColor",{enumerable:!0,get:function(){return FU.activate}});var $U=mO();Object.defineProperty(X,"activateDefinition",{enumerable:!0,get:function(){return $U.activate}});var BU=yO();Object.defineProperty(X,"activateDiagnostic",{enumerable:!0,get:function(){return BU.activate}});var UU=KO();Object.defineProperty(X,"activateFormatter",{enumerable:!0,get:function(){return UU.activate}});var WU=QO();Object.defineProperty(X,"activateHover",{enumerable:!0,get:function(){return WU.activate}});var HU=eC();Object.defineProperty(X,"activateSignature",{enumerable:!0,get:function(){return HU.activate}});var GU=nC();Object.defineProperty(X,"activateSubscriptions",{enumerable:!0,get:function(){return GU.activate}});var KU=bC();Object.defineProperty(X,"activateSymbol",{enumerable:!0,get:function(){return KU.activate}});var zU=TC();Object.defineProperty(X,"activateSemantic",{enumerable:!0,get:function(){return zU.activate}});var VU=kC();Object.defineProperty(X,"activateFoldingRange",{enumerable:!0,get:function(){return VU.activate}});X.ASTScraper=NU(Pf());var HC=LC();Object.defineProperty(X,"ActiveDocument",{enumerable:!0,get:function(){return HC.ActiveDocument}});Object.defineProperty(X,"DocumentManager",{enumerable:!0,get:function(){return HC.DocumentManager}});var XU=$C();Object.defineProperty(X,"DocumentMerger",{enumerable:!0,get:function(){return XU.DocumentMerger}});var YU=ea();Object.defineProperty(X,"LookupHelper",{enumerable:!0,get:function(){return YU.LookupHelper}});var JU=bd();Object.defineProperty(X,"MarkdownString",{enumerable:!0,get:function(){return JU.MarkdownString}});var Ks=vd();Object.defineProperty(X,"createHover",{enumerable:!0,get:function(){return Ks.createHover}});Object.defineProperty(X,"createSignatureInfo",{enumerable:!0,get:function(){return Ks.createSignatureInfo}});Object.defineProperty(X,"createTooltipHeader",{enumerable:!0,get:function(){return Ks.createTooltipHeader}});Object.defineProperty(X,"formatDefaultValue",{enumerable:!0,get:function(){return Ks.formatDefaultValue}});Object.defineProperty(X,"formatTypes",{enumerable:!0,get:function(){return Ks.formatTypes}});Object.defineProperty(X,"appendTooltipBody",{enumerable:!0,get:function(){return Ks.appendTooltipBody}});Object.defineProperty(X,"appendTooltipHeader",{enumerable:!0,get:function(){return Ks.appendTooltipHeader}});var QU=Ju();Object.defineProperty(X,"typeAnalyzer",{enumerable:!0,get:function(){return qU(QU).default}});var GC=e_();Object.defineProperty(X,"lookupIdentifier",{enumerable:!0,get:function(){return GC.lookupIdentifier}});Object.defineProperty(X,"lookupBase",{enumerable:!0,get:function(){return GC.lookupBase}});var KC=kd();Object.defineProperty(X,"semanticTokensLegend",{enumerable:!0,get:function(){return KC.semanticTokensLegend}});Object.defineProperty(X,"buildTokens",{enumerable:!0,get:function(){return KC.buildTokens}});var ZU=WC();Object.defineProperty(X,"CoreContext",{enumerable:!0,get:function(){return ZU.CoreContext}})});var YC={};dP(YC,{TextDocument:()=>yT});function bT(t,e){if(t.length<=1)return t;let n=t.length/2|0,r=t.slice(0,n),i=t.slice(n);bT(r,e),bT(i,e);let s=0,o=0,a=0;for(;s<r.length&&o<i.length;)e(r[s],i[o])<=0?t[a++]=r[s++]:t[a++]=i[o++];for(;s<r.length;)t[a++]=r[s++];for(;o<i.length;)t[a++]=i[o++];return t}function zC(t,e,n=0){let r=e?[n]:[];for(let i=0;i<t.length;i++){let s=t.charCodeAt(i);VC(s)&&(s===13&&i+1<t.length&&t.charCodeAt(i+1)===10&&i++,r.push(n+i+1))}return r}function VC(t){return t===13||t===10}function XC(t){let e=t.start,n=t.end;return e.line>n.line||e.line===n.line&&e.character>n.character?{start:n,end:e}:t}function eW(t){let e=XC(t.range);return e!==t.range?{newText:t.newText,range:e}:t}var Nd,yT,JC=fP(()=>{"use strict";Nd=class t{constructor(e,n,r,i){this._uri=e,this._languageId=n,this._version=r,this._content=i,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let n=this.offsetAt(e.start),r=this.offsetAt(e.end);return this._content.substring(n,r)}return this._content}update(e,n){for(let r of e)if(t.isIncremental(r)){let i=XC(r.range),s=this.offsetAt(i.start),o=this.offsetAt(i.end);this._content=this._content.substring(0,s)+r.text+this._content.substring(o,this._content.length);let a=Math.max(i.start.line,0),u=Math.max(i.end.line,0),l=this._lineOffsets,c=zC(r.text,!1,s);if(u-a===c.length)for(let f=0,g=c.length;f<g;f++)l[f+a+1]=c[f];else c.length<1e4?l.splice(a+1,u-a,...c):this._lineOffsets=l=l.slice(0,a+1).concat(c,l.slice(u+1));let h=r.text.length-(o-s);if(h!==0)for(let f=a+1+c.length,g=l.length;f<g;f++)l[f]=l[f]+h}else if(t.isFull(r))this._content=r.text,this._lineOffsets=void 0;else throw new Error("Unknown change event received");this._version=n}getLineOffsets(){return this._lineOffsets===void 0&&(this._lineOffsets=zC(this._content,!0)),this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let n=this.getLineOffsets(),r=0,i=n.length;if(i===0)return{line:0,character:e};for(;r<i;){let o=Math.floor((r+i)/2);n[o]>e?i=o:r=o+1}let s=r-1;return e=this.ensureBeforeEOL(e,n[s]),{line:s,character:e-n[s]}}offsetAt(e){let n=this.getLineOffsets();if(e.line>=n.length)return this._content.length;if(e.line<0)return 0;let r=n[e.line];if(e.character<=0)return r;let i=e.line+1<n.length?n[e.line+1]:this._content.length,s=Math.min(r+e.character,i);return this.ensureBeforeEOL(s,r)}ensureBeforeEOL(e,n){for(;e>n&&VC(this._content.charCodeAt(e-1));)e--;return e}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){let n=e;return n!=null&&typeof n.text=="string"&&n.range!==void 0&&(n.rangeLength===void 0||typeof n.rangeLength=="number")}static isFull(e){let n=e;return n!=null&&typeof n.text=="string"&&n.range===void 0&&n.rangeLength===void 0}};(function(t){function e(i,s,o,a){return new Nd(i,s,o,a)}t.create=e;function n(i,s,o){if(i instanceof Nd)return i.update(s,o),i;throw new Error("TextDocument.update: document must be created by TextDocument.create")}t.update=n;function r(i,s){let o=i.getText(),a=bT(s.map(eW),(c,h)=>{let f=c.range.start.line-h.range.start.line;return f===0?c.range.start.character-h.range.start.character:f}),u=0,l=[];for(let c of a){let h=i.offsetAt(c.range.start);if(h<u)throw new Error("Overlapping edit");h>u&&l.push(o.substring(u,h)),c.newText.length&&l.push(c.newText),u=i.offsetAt(c.range.end)}return l.push(o.substr(u)),l.join("")}t.applyEdits=r})(yT||(yT={}))});var nR=m((_V,tR)=>{"use strict";tR.exports=ZC;function ZC(t,e,n){t instanceof RegExp&&(t=QC(t,n)),e instanceof RegExp&&(e=QC(e,n));var r=eR(t,e,n);return r&&{start:r[0],end:r[1],pre:n.slice(0,r[0]),body:n.slice(r[0]+t.length,r[1]),post:n.slice(r[1]+e.length)}}function QC(t,e){var n=e.match(t);return n?n[0]:null}ZC.range=eR;function eR(t,e,n){var r,i,s,o,a,u=n.indexOf(t),l=n.indexOf(e,u+1),c=u;if(u>=0&&l>0){if(t===e)return[u,l];for(r=[],s=n.length;c>=0&&!a;)c==u?(r.push(c),u=n.indexOf(t,c+1)):r.length==1?a=[r.pop(),l]:(i=r.pop(),i<s&&(s=i,o=l),l=n.indexOf(e,c+1)),c=u<l&&u>=0?u:l;r.length&&(a=[s,o])}return a}});var cR=m((TV,lR)=>{var rR=nR();lR.exports=rW;var iR="\0SLASH"+Math.random()+"\0",sR="\0OPEN"+Math.random()+"\0",_T="\0CLOSE"+Math.random()+"\0",oR="\0COMMA"+Math.random()+"\0",aR="\0PERIOD"+Math.random()+"\0";function vT(t){return parseInt(t,10)==t?parseInt(t,10):t.charCodeAt(0)}function tW(t){return t.split("\\\\").join(iR).split("\\{").join(sR).split("\\}").join(_T).split("\\,").join(oR).split("\\.").join(aR)}function nW(t){return t.split(iR).join("\\").split(sR).join("{").split(_T).join("}").split(oR).join(",").split(aR).join(".")}function uR(t){if(!t)return[""];var e=[],n=rR("{","}",t);if(!n)return t.split(",");var r=n.pre,i=n.body,s=n.post,o=r.split(",");o[o.length-1]+="{"+i+"}";var a=uR(s);return s.length&&(o[o.length-1]+=a.shift(),o.push.apply(o,a)),e.push.apply(e,o),e}function rW(t){return t?(t.substr(0,2)==="{}"&&(t="\\{\\}"+t.substr(2)),tl(tW(t),!0).map(nW)):[]}function iW(t){return"{"+t+"}"}function sW(t){return/^-?0\d/.test(t)}function oW(t,e){return t<=e}function aW(t,e){return t>=e}function tl(t,e){var n=[],r=rR("{","}",t);if(!r)return[t];var i=r.pre,s=r.post.length?tl(r.post,!1):[""];if(/\$$/.test(r.pre))for(var o=0;o<s.length;o++){var a=i+"{"+r.body+"}"+s[o];n.push(a)}else{var u=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(r.body),l=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(r.body),c=u||l,h=r.body.indexOf(",")>=0;if(!c&&!h)return r.post.match(/,.*\}/)?(t=r.pre+"{"+r.body+_T+r.post,tl(t)):[t];var f;if(c)f=r.body.split(/\.\./);else if(f=uR(r.body),f.length===1&&(f=tl(f[0],!1).map(iW),f.length===1))return s.map(function(K){return r.pre+f[0]+K});var g;if(c){var v=vT(f[0]),b=vT(f[1]),O=Math.max(f[0].length,f[1].length),A=f.length==3?Math.abs(vT(f[2])):1,k=oW,S=b<v;S&&(A*=-1,k=aW);var _=f.some(sW);g=[];for(var N=v;k(N,b);N+=A){var R;if(l)R=String.fromCharCode(N),R==="\\"&&(R="");else if(R=String(N),_){var G=O-R.length;if(G>0){var ie=new Array(G+1).join("0");N<0?R="-"+ie+R.slice(1):R=ie+R}}g.push(R)}}else{g=[];for(var ue=0;ue<f.length;ue++)g.push.apply(g,tl(f[ue],!1))}for(var ue=0;ue<g.length;ue++)for(var o=0;o<s.length;o++){var a=i+g[ue]+s[o];(!e||c||a)&&n.push(a)}}return n}});var hR=m(qd=>{"use strict";Object.defineProperty(qd,"__esModule",{value:!0});qd.assertValidPattern=void 0;var uW=1024*64,lW=t=>{if(typeof t!="string")throw new TypeError("invalid pattern");if(t.length>uW)throw new TypeError("pattern is too long")};qd.assertValidPattern=lW});var dR=m(jd=>{"use strict";Object.defineProperty(jd,"__esModule",{value:!0});jd.parseClass=void 0;var cW={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},nl=t=>t.replace(/[[\]\\-]/g,"\\$&"),hW=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),fR=t=>t.join(""),fW=(t,e)=>{let n=e;if(t.charAt(n)!=="[")throw new Error("not in a brace expression");let r=[],i=[],s=n+1,o=!1,a=!1,u=!1,l=!1,c=n,h="";e:for(;s<t.length;){let b=t.charAt(s);if((b==="!"||b==="^")&&s===n+1){l=!0,s++;continue}if(b==="]"&&o&&!u){c=s+1;break}if(o=!0,b==="\\"&&!u){u=!0,s++;continue}if(b==="["&&!u){for(let[O,[A,k,S]]of Object.entries(cW))if(t.startsWith(O,s)){if(h)return["$.",!1,t.length-n,!0];s+=O.length,S?i.push(A):r.push(A),a=a||k;continue e}}if(u=!1,h){b>h?r.push(nl(h)+"-"+nl(b)):b===h&&r.push(nl(b)),h="",s++;continue}if(t.startsWith("-]",s+1)){r.push(nl(b+"-")),s+=2;continue}if(t.startsWith("-",s+1)){h=b,s+=2;continue}r.push(nl(b)),s++}if(c<s)return["",!1,0,!1];if(!r.length&&!i.length)return["$.",!1,t.length-n,!0];if(i.length===0&&r.length===1&&/^\\?.$/.test(r[0])&&!l){let b=r[0].length===2?r[0].slice(-1):r[0];return[hW(b),!1,c-n,!1]}let f="["+(l?"^":"")+fR(r)+"]",g="["+(l?"":"^")+fR(i)+"]";return[r.length&&i.length?"("+f+"|"+g+")":r.length?f:g,a,c-n,!0]};jd.parseClass=fW});var $d=m(Fd=>{"use strict";Object.defineProperty(Fd,"__esModule",{value:!0});Fd.unescape=void 0;var dW=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/\[([^\/\\])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1");Fd.unescape=dW});var kT=m(Wd=>{"use strict";Object.defineProperty(Wd,"__esModule",{value:!0});Wd.AST=void 0;var pW=dR(),Bd=$d(),gW=new Set(["!","?","+","*","@"]),pR=t=>gW.has(t),mW="(?!(?:^|/)\\.\\.?(?:$|/))",Ud="(?!\\.)",yW=new Set(["[","."]),bW=new Set(["..","."]),vW=new Set("().*{}+?[]^$\\!"),_W=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),ST="[^/]",gR=ST+"*?",mR=ST+"+?",TT=class t{type;#e;#t;#s=!1;#r=[];#o;#_;#l;#h=!1;#a;#u;#i=!1;constructor(e,n,r={}){this.type=e,e&&(this.#t=!0),this.#o=n,this.#e=this.#o?this.#o.#e:this,this.#a=this.#e===this?r:this.#e.#a,this.#l=this.#e===this?[]:this.#e.#l,e==="!"&&!this.#e.#h&&this.#l.push(this),this.#_=this.#o?this.#o.#r.length:0}get hasMagic(){if(this.#t!==void 0)return this.#t;for(let e of this.#r)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#t=!0;return this.#t}toString(){return this.#u!==void 0?this.#u:this.type?this.#u=this.type+"("+this.#r.map(e=>String(e)).join("|")+")":this.#u=this.#r.map(e=>String(e)).join("")}#m(){if(this!==this.#e)throw new Error("should only call on root");if(this.#h)return this;this.toString(),this.#h=!0;let e;for(;e=this.#l.pop();){if(e.type!=="!")continue;let n=e,r=n.#o;for(;r;){for(let i=n.#_+1;!r.type&&i<r.#r.length;i++)for(let s of e.#r){if(typeof s=="string")throw new Error("string part in extglob AST??");s.copyIn(r.#r[i])}n=r,r=n.#o}}return this}push(...e){for(let n of e)if(n!==""){if(typeof n!="string"&&!(n instanceof t&&n.#o===this))throw new Error("invalid part: "+n);this.#r.push(n)}}toJSON(){let e=this.type===null?this.#r.slice().map(n=>typeof n=="string"?n:n.toJSON()):[this.type,...this.#r.map(n=>n.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#h&&this.#o?.type==="!")&&e.push({}),e}isStart(){if(this.#e===this)return!0;if(!this.#o?.isStart())return!1;if(this.#_===0)return!0;let e=this.#o;for(let n=0;n<this.#_;n++){let r=e.#r[n];if(!(r instanceof t&&r.type==="!"))return!1}return!0}isEnd(){if(this.#e===this||this.#o?.type==="!")return!0;if(!this.#o?.isEnd())return!1;if(!this.type)return this.#o?.isEnd();let e=this.#o?this.#o.#r.length:0;return this.#_===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this))}clone(e){let n=new t(this.type,e);for(let r of this.#r)n.copyIn(r);return n}static#y(e,n,r,i){let s=!1,o=!1,a=-1,u=!1;if(n.type===null){let g=r,v="";for(;g<e.length;){let b=e.charAt(g++);if(s||b==="\\"){s=!s,v+=b;continue}if(o){g===a+1?(b==="^"||b==="!")&&(u=!0):b==="]"&&!(g===a+2&&u)&&(o=!1),v+=b;continue}else if(b==="["){o=!0,a=g,u=!1,v+=b;continue}if(!i.noext&&pR(b)&&e.charAt(g)==="("){n.push(v),v="";let O=new t(b,n);g=t.#y(e,O,g,i),n.push(O);continue}v+=b}return n.push(v),g}let l=r+1,c=new t(null,n),h=[],f="";for(;l<e.length;){let g=e.charAt(l++);if(s||g==="\\"){s=!s,f+=g;continue}if(o){l===a+1?(g==="^"||g==="!")&&(u=!0):g==="]"&&!(l===a+2&&u)&&(o=!1),f+=g;continue}else if(g==="["){o=!0,a=l,u=!1,f+=g;continue}if(pR(g)&&e.charAt(l)==="("){c.push(f),f="";let v=new t(g,c);c.push(v),l=t.#y(e,v,l,i);continue}if(g==="|"){c.push(f),f="",h.push(c),c=new t(null,n);continue}if(g===")")return f===""&&n.#r.length===0&&(n.#i=!0),c.push(f),f="",n.push(...h,c),l;f+=g}return n.type=null,n.#t=void 0,n.#r=[e.substring(r-1)],l}static fromGlob(e,n={}){let r=new t(null,void 0,n);return t.#y(e,r,0,n),r}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let e=this.toString(),[n,r,i,s]=this.toRegExpSource();if(!(i||this.#t||this.#a.nocase&&!this.#a.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return r;let a=(this.#a.nocase?"i":"")+(s?"u":"");return Object.assign(new RegExp(`^${n}$`,a),{_src:n,_glob:e})}get options(){return this.#a}toRegExpSource(e){let n=e??!!this.#a.dot;if(this.#e===this&&this.#m(),!this.type){let u=this.isStart()&&this.isEnd(),l=this.#r.map(g=>{let[v,b,O,A]=typeof g=="string"?t.#f(g,this.#t,u):g.toRegExpSource(e);return this.#t=this.#t||O,this.#s=this.#s||A,v}).join(""),c="";if(this.isStart()&&typeof this.#r[0]=="string"&&!(this.#r.length===1&&bW.has(this.#r[0]))){let v=yW,b=n&&v.has(l.charAt(0))||l.startsWith("\\.")&&v.has(l.charAt(2))||l.startsWith("\\.\\.")&&v.has(l.charAt(4)),O=!n&&!e&&v.has(l.charAt(0));c=b?mW:O?Ud:""}let h="";return this.isEnd()&&this.#e.#h&&this.#o?.type==="!"&&(h="(?:$|\\/)"),[c+l+h,(0,Bd.unescape)(l),this.#t=!!this.#t,this.#s]}let r=this.type==="*"||this.type==="+",i=this.type==="!"?"(?:(?!(?:":"(?:",s=this.#d(n);if(this.isStart()&&this.isEnd()&&!s&&this.type!=="!"){let u=this.toString();return this.#r=[u],this.type=null,this.#t=void 0,[u,(0,Bd.unescape)(this.toString()),!1,!1]}let o=!r||e||n||!Ud?"":this.#d(!0);o===s&&(o=""),o&&(s=`(?:${s})(?:${o})*?`);let a="";if(this.type==="!"&&this.#i)a=(this.isStart()&&!n?Ud:"")+mR;else{let u=this.type==="!"?"))"+(this.isStart()&&!n&&!e?Ud:"")+gR+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;a=i+s+u}return[a,(0,Bd.unescape)(s),this.#t=!!this.#t,this.#s]}#d(e){return this.#r.map(n=>{if(typeof n=="string")throw new Error("string type in extglob ast??");let[r,i,s,o]=n.toRegExpSource(e);return this.#s=this.#s||o,r}).filter(n=>!(this.isStart()&&this.isEnd())||!!n).join("|")}static#f(e,n,r=!1){let i=!1,s="",o=!1;for(let a=0;a<e.length;a++){let u=e.charAt(a);if(i){i=!1,s+=(vW.has(u)?"\\":"")+u;continue}if(u==="\\"){a===e.length-1?s+="\\\\":i=!0;continue}if(u==="["){let[l,c,h,f]=(0,pW.parseClass)(e,a);if(h){s+=l,o=o||c,a+=h-1,n=n||f;continue}}if(u==="*"){r&&e==="*"?s+=mR:s+=gR,n=!0;continue}if(u==="?"){s+=ST,n=!0;continue}s+=_W(u)}return[s,(0,Bd.unescape)(e),!!n,o]}};Wd.AST=TT});var wT=m(Hd=>{"use strict";Object.defineProperty(Hd,"__esModule",{value:!0});Hd.escape=void 0;var TW=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/[?*()[\]]/g,"[$&]"):t.replace(/[?*()[\]\\]/g,"\\$&");Hd.escape=TW});var is=m(re=>{"use strict";var SW=re&&re.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(re,"__esModule",{value:!0});re.unescape=re.escape=re.AST=re.Minimatch=re.match=re.makeRe=re.braceExpand=re.defaults=re.filter=re.GLOBSTAR=re.sep=re.minimatch=void 0;var kW=SW(cR()),Gd=hR(),vR=kT(),wW=wT(),xW=$d(),EW=(t,e,n={})=>((0,Gd.assertValidPattern)(e),!n.nocomment&&e.charAt(0)==="#"?!1:new zs(e,n).match(t));re.minimatch=EW;var AW=/^\*+([^+@!?\*\[\(]*)$/,OW=t=>e=>!e.startsWith(".")&&e.endsWith(t),CW=t=>e=>e.endsWith(t),RW=t=>(t=t.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(t)),PW=t=>(t=t.toLowerCase(),e=>e.toLowerCase().endsWith(t)),DW=/^\*+\.\*+$/,IW=t=>!t.startsWith(".")&&t.includes("."),MW=t=>t!=="."&&t!==".."&&t.includes("."),LW=/^\.\*+$/,NW=t=>t!=="."&&t!==".."&&t.startsWith("."),qW=/^\*+$/,jW=t=>t.length!==0&&!t.startsWith("."),FW=t=>t.length!==0&&t!=="."&&t!=="..",$W=/^\?+([^+@!?\*\[\(]*)?$/,BW=([t,e=""])=>{let n=_R([t]);return e?(e=e.toLowerCase(),r=>n(r)&&r.toLowerCase().endsWith(e)):n},UW=([t,e=""])=>{let n=TR([t]);return e?(e=e.toLowerCase(),r=>n(r)&&r.toLowerCase().endsWith(e)):n},WW=([t,e=""])=>{let n=TR([t]);return e?r=>n(r)&&r.endsWith(e):n},HW=([t,e=""])=>{let n=_R([t]);return e?r=>n(r)&&r.endsWith(e):n},_R=([t])=>{let e=t.length;return n=>n.length===e&&!n.startsWith(".")},TR=([t])=>{let e=t.length;return n=>n.length===e&&n!=="."&&n!==".."},SR=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",yR={win32:{sep:"\\"},posix:{sep:"/"}};re.sep=SR==="win32"?yR.win32.sep:yR.posix.sep;re.minimatch.sep=re.sep;re.GLOBSTAR=Symbol("globstar **");re.minimatch.GLOBSTAR=re.GLOBSTAR;var GW="[^/]",KW=GW+"*?",zW="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",VW="(?:(?!(?:\\/|^)\\.).)*?",XW=(t,e={})=>n=>(0,re.minimatch)(n,t,e);re.filter=XW;re.minimatch.filter=re.filter;var cr=(t,e={})=>Object.assign({},t,e),YW=t=>{if(!t||typeof t!="object"||!Object.keys(t).length)return re.minimatch;let e=re.minimatch;return Object.assign((r,i,s={})=>e(r,i,cr(t,s)),{Minimatch:class extends e.Minimatch{constructor(i,s={}){super(i,cr(t,s))}static defaults(i){return e.defaults(cr(t,i)).Minimatch}},AST:class extends e.AST{constructor(i,s,o={}){super(i,s,cr(t,o))}static fromGlob(i,s={}){return e.AST.fromGlob(i,cr(t,s))}},unescape:(r,i={})=>e.unescape(r,cr(t,i)),escape:(r,i={})=>e.escape(r,cr(t,i)),filter:(r,i={})=>e.filter(r,cr(t,i)),defaults:r=>e.defaults(cr(t,r)),makeRe:(r,i={})=>e.makeRe(r,cr(t,i)),braceExpand:(r,i={})=>e.braceExpand(r,cr(t,i)),match:(r,i,s={})=>e.match(r,i,cr(t,s)),sep:e.sep,GLOBSTAR:re.GLOBSTAR})};re.defaults=YW;re.minimatch.defaults=re.defaults;var JW=(t,e={})=>((0,Gd.assertValidPattern)(t),e.nobrace||!/\{(?:(?!\{).)*\}/.test(t)?[t]:(0,kW.default)(t));re.braceExpand=JW;re.minimatch.braceExpand=re.braceExpand;var QW=(t,e={})=>new zs(t,e).makeRe();re.makeRe=QW;re.minimatch.makeRe=re.makeRe;var ZW=(t,e,n={})=>{let r=new zs(e,n);return t=t.filter(i=>r.match(i)),r.options.nonull&&!t.length&&t.push(e),t};re.match=ZW;re.minimatch.match=re.match;var bR=/[?*]|[+@!]\(.*?\)|\[|\]/,e5=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),zs=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(e,n={}){(0,Gd.assertValidPattern)(e),n=n||{},this.options=n,this.pattern=e,this.platform=n.platform||SR,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!n.windowsPathsNoEscape||n.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!n.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!n.nonegate,this.comment=!1,this.empty=!1,this.partial=!!n.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=n.windowsNoMagicRoot!==void 0?n.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let n of e)if(typeof n!="string")return!0;return!1}debug(...e){}make(){let e=this.pattern,n=this.options;if(!n.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],n.debug&&(this.debug=(...s)=>console.error(...s)),this.debug(this.pattern,this.globSet);let r=this.globSet.map(s=>this.slashSplit(s));this.globParts=this.preprocess(r),this.debug(this.pattern,this.globParts);let i=this.globParts.map((s,o,a)=>{if(this.isWindows&&this.windowsNoMagicRoot){let u=s[0]===""&&s[1]===""&&(s[2]==="?"||!bR.test(s[2]))&&!bR.test(s[3]),l=/^[a-z]:/i.test(s[0]);if(u)return[...s.slice(0,4),...s.slice(4).map(c=>this.parse(c))];if(l)return[s[0],...s.slice(1).map(c=>this.parse(c))]}return s.map(u=>this.parse(u))});if(this.debug(this.pattern,i),this.set=i.filter(s=>s.indexOf(!1)===-1),this.isWindows)for(let s=0;s<this.set.length;s++){let o=this.set[s];o[0]===""&&o[1]===""&&this.globParts[s][2]==="?"&&typeof o[3]=="string"&&/^[a-z]:$/i.test(o[3])&&(o[2]="?")}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let r=0;r<e.length;r++)for(let i=0;i<e[r].length;i++)e[r][i]==="**"&&(e[r][i]="*");let{optimizationLevel:n=1}=this.options;return n>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):n>=1?e=this.levelOneOptimize(e):e=this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(n=>{let r=-1;for(;(r=n.indexOf("**",r+1))!==-1;){let i=r;for(;n[i+1]==="**";)i++;i!==r&&n.splice(r,i-r)}return n})}levelOneOptimize(e){return e.map(n=>(n=n.reduce((r,i)=>{let s=r[r.length-1];return i==="**"&&s==="**"?r:i===".."&&s&&s!==".."&&s!=="."&&s!=="**"?(r.pop(),r):(r.push(i),r)},[]),n.length===0?[""]:n))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let n=!1;do{if(n=!1,!this.preserveMultipleSlashes){for(let i=1;i<e.length-1;i++){let s=e[i];i===1&&s===""&&e[0]===""||(s==="."||s==="")&&(n=!0,e.splice(i,1),i--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(n=!0,e.pop())}let r=0;for(;(r=e.indexOf("..",r+1))!==-1;){let i=e[r-1];i&&i!=="."&&i!==".."&&i!=="**"&&(n=!0,e.splice(r-1,2),r-=2)}}while(n);return e.length===0?[""]:e}firstPhasePreProcess(e){let n=!1;do{n=!1;for(let r of e){let i=-1;for(;(i=r.indexOf("**",i+1))!==-1;){let o=i;for(;r[o+1]==="**";)o++;o>i&&r.splice(i+1,o-i);let a=r[i+1],u=r[i+2],l=r[i+3];if(a!==".."||!u||u==="."||u===".."||!l||l==="."||l==="..")continue;n=!0,r.splice(i,1);let c=r.slice(0);c[i]="**",e.push(c),i--}if(!this.preserveMultipleSlashes){for(let o=1;o<r.length-1;o++){let a=r[o];o===1&&a===""&&r[0]===""||(a==="."||a==="")&&(n=!0,r.splice(o,1),o--)}r[0]==="."&&r.length===2&&(r[1]==="."||r[1]==="")&&(n=!0,r.pop())}let s=0;for(;(s=r.indexOf("..",s+1))!==-1;){let o=r[s-1];if(o&&o!=="."&&o!==".."&&o!=="**"){n=!0;let u=s===1&&r[s+1]==="**"?["."]:[];r.splice(s-1,2,...u),r.length===0&&r.push(""),s-=2}}}}while(n);return e}secondPhasePreProcess(e){for(let n=0;n<e.length-1;n++)for(let r=n+1;r<e.length;r++){let i=this.partsMatch(e[n],e[r],!this.preserveMultipleSlashes);if(i){e[n]=[],e[r]=i;break}}return e.filter(n=>n.length)}partsMatch(e,n,r=!1){let i=0,s=0,o=[],a="";for(;i<e.length&&s<n.length;)if(e[i]===n[s])o.push(a==="b"?n[s]:e[i]),i++,s++;else if(r&&e[i]==="**"&&n[s]===e[i+1])o.push(e[i]),i++;else if(r&&n[s]==="**"&&e[i]===n[s+1])o.push(n[s]),s++;else if(e[i]==="*"&&n[s]&&(this.options.dot||!n[s].startsWith("."))&&n[s]!=="**"){if(a==="b")return!1;a="a",o.push(e[i]),i++,s++}else if(n[s]==="*"&&e[i]&&(this.options.dot||!e[i].startsWith("."))&&e[i]!=="**"){if(a==="a")return!1;a="b",o.push(n[s]),i++,s++}else return!1;return e.length===n.length&&o}parseNegate(){if(this.nonegate)return;let e=this.pattern,n=!1,r=0;for(let i=0;i<e.length&&e.charAt(i)==="!";i++)n=!n,r++;r&&(this.pattern=e.slice(r)),this.negate=n}matchOne(e,n,r=!1){let i=this.options;if(this.isWindows){let b=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),O=!b&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),A=typeof n[0]=="string"&&/^[a-z]:$/i.test(n[0]),k=!A&&n[0]===""&&n[1]===""&&n[2]==="?"&&typeof n[3]=="string"&&/^[a-z]:$/i.test(n[3]),S=O?3:b?0:void 0,_=k?3:A?0:void 0;if(typeof S=="number"&&typeof _=="number"){let[N,R]=[e[S],n[_]];N.toLowerCase()===R.toLowerCase()&&(n[_]=N,_>S?n=n.slice(_):S>_&&(e=e.slice(S)))}}let{optimizationLevel:s=1}=this.options;s>=2&&(e=this.levelTwoFileOptimize(e)),this.debug("matchOne",this,{file:e,pattern:n}),this.debug("matchOne",e.length,n.length);for(var o=0,a=0,u=e.length,l=n.length;o<u&&a<l;o++,a++){this.debug("matchOne loop");var c=n[a],h=e[o];if(this.debug(n,c,h),c===!1)return!1;if(c===re.GLOBSTAR){this.debug("GLOBSTAR",[n,c,h]);var f=o,g=a+1;if(g===l){for(this.debug("** at the end");o<u;o++)if(e[o]==="."||e[o]===".."||!i.dot&&e[o].charAt(0)===".")return!1;return!0}for(;f<u;){var v=e[f];if(this.debug(`
197
197
  globstar while`,e,f,n,g,v),this.matchOne(e.slice(f),n.slice(g),r))return this.debug("globstar found match!",f,u,v),!0;if(v==="."||v===".."||!i.dot&&v.charAt(0)==="."){this.debug("dot detected!",e,f,n,g);break}this.debug("globstar swallow a segment, and continue"),f++}return!!(r&&(this.debug(`
198
198
  >>> no match, partial?`,e,f,n,g),f===u))}let b;if(typeof c=="string"?(b=h===c,this.debug("string match",c,h,b)):(b=c.test(h),this.debug("pattern match",c,h,b)),!b)return!1}if(o===u&&a===l)return!0;if(o===u)return r;if(a===l)return o===u-1&&e[o]==="";throw new Error("wtf?")}braceExpand(){return(0,re.braceExpand)(this.pattern,this.options)}parse(e){(0,Gd.assertValidPattern)(e);let n=this.options;if(e==="**")return re.GLOBSTAR;if(e==="")return"";let r,i=null;(r=e.match(qW))?i=n.dot?FW:jW:(r=e.match(AW))?i=(n.nocase?n.dot?PW:RW:n.dot?CW:OW)(r[1]):(r=e.match($W))?i=(n.nocase?n.dot?UW:BW:n.dot?WW:HW)(r):(r=e.match(DW))?i=n.dot?MW:IW:(r=e.match(LW))&&(i=NW);let s=vR.AST.fromGlob(e,this.options).toMMPattern();return i&&typeof s=="object"&&Reflect.defineProperty(s,"test",{value:i}),s}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let n=this.options,r=n.noglobstar?KW:n.dot?zW:VW,i=new Set(n.nocase?["i"]:[]),s=e.map(u=>{let l=u.map(c=>{if(c instanceof RegExp)for(let h of c.flags.split(""))i.add(h);return typeof c=="string"?e5(c):c===re.GLOBSTAR?re.GLOBSTAR:c._src});return l.forEach((c,h)=>{let f=l[h+1],g=l[h-1];c!==re.GLOBSTAR||g===re.GLOBSTAR||(g===void 0?f!==void 0&&f!==re.GLOBSTAR?l[h+1]="(?:\\/|"+r+"\\/)?"+f:l[h]=r:f===void 0?l[h-1]=g+"(?:\\/|"+r+")?":f!==re.GLOBSTAR&&(l[h-1]=g+"(?:\\/|\\/"+r+"\\/)"+f,l[h+1]=re.GLOBSTAR))}),l.filter(c=>c!==re.GLOBSTAR).join("/")}).join("|"),[o,a]=e.length>1?["(?:",")"]:["",""];s="^"+o+s+a+"$",this.negate&&(s="^(?!"+s+").+$");try{this.regexp=new RegExp(s,[...i].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(e)?["",...e.split(/\/+/)]:e.split(/\/+/)}match(e,n=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&n)return!0;let r=this.options;this.isWindows&&(e=e.split("\\").join("/"));let i=this.slashSplit(e);this.debug(this.pattern,"split",i);let s=this.set;this.debug(this.pattern,"set",s);let o=i[i.length-1];if(!o)for(let a=i.length-2;!o&&a>=0;a--)o=i[a];for(let a=0;a<s.length;a++){let u=s[a],l=i;if(r.matchBase&&u.length===1&&(l=[o]),this.matchOne(l,u,n))return r.flipNegate?!0:!this.negate}return r.flipNegate?!1:this.negate}static defaults(e){return re.minimatch.defaults(e).Minimatch}};re.Minimatch=zs;var t5=kT();Object.defineProperty(re,"AST",{enumerable:!0,get:function(){return t5.AST}});var n5=wT();Object.defineProperty(re,"escape",{enumerable:!0,get:function(){return n5.escape}});var r5=$d();Object.defineProperty(re,"unescape",{enumerable:!0,get:function(){return r5.unescape}});re.minimatch.AST=vR.AST;re.minimatch.Minimatch=zs;re.minimatch.escape=wW.escape;re.minimatch.unescape=xW.unescape});var AR=m(zd=>{"use strict";Object.defineProperty(zd,"__esModule",{value:!0});zd.LRUCache=void 0;var _a=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,wR=new Set,xT=typeof process=="object"&&process?process:{},xR=(t,e,n,r)=>{typeof xT.emitWarning=="function"?xT.emitWarning(t,e,n,r):console.error(`[${n}] ${e}: ${t}`)},Kd=globalThis.AbortController,kR=globalThis.AbortSignal;if(typeof Kd>"u"){kR=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(r,i){this._onabort.push(i)}},Kd=class{constructor(){e()}signal=new kR;abort(r){if(!this.signal.aborted){this.signal.reason=r,this.signal.aborted=!0;for(let i of this.signal._onabort)i(r);this.signal.onabort?.(r)}}};let t=xT.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{t&&(t=!1,xR("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))}}var i5=t=>!wR.has(t),DV=Symbol("type"),ss=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),ER=t=>ss(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?Ta:null:null,Ta=class extends Array{constructor(e){super(e),this.fill(0)}},ET=class t{heap;length;static#e=!1;static create(e){let n=ER(e);if(!n)return[];t.#e=!0;let r=new t(e,n);return t.#e=!1,r}constructor(e,n){if(!t.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new n(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},AT=class t{#e;#t;#s;#r;#o;#_;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#l;#h;#a;#u;#i;#m;#y;#d;#f;#k;#g;#w;#x;#v;#T;#S;#p;static unsafeExposeInternals(e){return{starts:e.#x,ttls:e.#v,sizes:e.#w,keyMap:e.#a,keyList:e.#u,valList:e.#i,next:e.#m,prev:e.#y,get head(){return e.#d},get tail(){return e.#f},free:e.#k,isBackgroundFetch:n=>e.#c(n),backgroundFetch:(n,r,i,s)=>e.#j(n,r,i,s),moveToTail:n=>e.#$(n),indexes:n=>e.#A(n),rindexes:n=>e.#O(n),isStale:n=>e.#b(n)}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#h}get size(){return this.#l}get fetchMethod(){return this.#o}get memoMethod(){return this.#_}get dispose(){return this.#s}get disposeAfter(){return this.#r}constructor(e){let{max:n=0,ttl:r,ttlResolution:i=1,ttlAutopurge:s,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:u,dispose:l,disposeAfter:c,noDisposeOnSet:h,noUpdateTTL:f,maxSize:g=0,maxEntrySize:v=0,sizeCalculation:b,fetchMethod:O,memoMethod:A,noDeleteOnFetchRejection:k,noDeleteOnStaleGet:S,allowStaleOnFetchRejection:_,allowStaleOnFetchAbort:N,ignoreFetchAbort:R}=e;if(n!==0&&!ss(n))throw new TypeError("max option must be a nonnegative integer");let G=n?ER(n):Array;if(!G)throw new Error("invalid max value: "+n);if(this.#e=n,this.#t=g,this.maxEntrySize=v||this.#t,this.sizeCalculation=b,this.sizeCalculation){if(!this.#t&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(A!==void 0&&typeof A!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#_=A,O!==void 0&&typeof O!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#o=O,this.#S=!!O,this.#a=new Map,this.#u=new Array(n).fill(void 0),this.#i=new Array(n).fill(void 0),this.#m=new G(n),this.#y=new G(n),this.#d=0,this.#f=0,this.#k=ET.create(n),this.#l=0,this.#h=0,typeof l=="function"&&(this.#s=l),typeof c=="function"?(this.#r=c,this.#g=[]):(this.#r=void 0,this.#g=void 0),this.#T=!!this.#s,this.#p=!!this.#r,this.noDisposeOnSet=!!h,this.noUpdateTTL=!!f,this.noDeleteOnFetchRejection=!!k,this.allowStaleOnFetchRejection=!!_,this.allowStaleOnFetchAbort=!!N,this.ignoreFetchAbort=!!R,this.maxEntrySize!==0){if(this.#t!==0&&!ss(this.#t))throw new TypeError("maxSize must be a positive integer if specified");if(!ss(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#R()}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!S,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=ss(i)||i===0?i:1,this.ttlAutopurge=!!s,this.ttl=r||0,this.ttl){if(!ss(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#C()}if(this.#e===0&&this.ttl===0&&this.#t===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#e&&!this.#t){let ie="LRU_CACHE_UNBOUNDED";i5(ie)&&(wR.add(ie),xR("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",ie,t))}}getRemainingTTL(e){return this.#a.has(e)?1/0:0}#C(){let e=new Ta(this.#e),n=new Ta(this.#e);this.#v=e,this.#x=n,this.#D=(s,o,a=_a.now())=>{if(n[s]=o!==0?a:0,e[s]=o,o!==0&&this.ttlAutopurge){let u=setTimeout(()=>{this.#b(s)&&this.#P(this.#u[s],"expire")},o+1);u.unref&&u.unref()}},this.#E=s=>{n[s]=e[s]!==0?_a.now():0},this.#n=(s,o)=>{if(e[o]){let a=e[o],u=n[o];if(!a||!u)return;s.ttl=a,s.start=u,s.now=r||i();let l=s.now-u;s.remainingTTL=a-l}};let r=0,i=()=>{let s=_a.now();if(this.ttlResolution>0){r=s;let o=setTimeout(()=>r=0,this.ttlResolution);o.unref&&o.unref()}return s};this.getRemainingTTL=s=>{let o=this.#a.get(s);if(o===void 0)return 0;let a=e[o],u=n[o];if(!a||!u)return 1/0;let l=(r||i())-u;return a-l},this.#b=s=>{let o=n[s],a=e[s];return!!a&&!!o&&(r||i())-o>a}}#E=()=>{};#n=()=>{};#D=()=>{};#b=()=>!1;#R(){let e=new Ta(this.#e);this.#h=0,this.#w=e,this.#I=n=>{this.#h-=e[n],e[n]=0},this.#L=(n,r,i,s)=>{if(this.#c(r))return 0;if(!ss(i))if(s){if(typeof s!="function")throw new TypeError("sizeCalculation must be a function");if(i=s(r,n),!ss(i))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return i},this.#M=(n,r,i)=>{if(e[n]=r,this.#t){let s=this.#t-e[n];for(;this.#h>s;)this.#q(!0)}this.#h+=e[n],i&&(i.entrySize=r,i.totalCalculatedSize=this.#h)}}#I=e=>{};#M=(e,n,r)=>{};#L=(e,n,r,i)=>{if(r||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#A({allowStale:e=this.allowStale}={}){if(this.#l)for(let n=this.#f;!(!this.#N(n)||((e||!this.#b(n))&&(yield n),n===this.#d));)n=this.#y[n]}*#O({allowStale:e=this.allowStale}={}){if(this.#l)for(let n=this.#d;!(!this.#N(n)||((e||!this.#b(n))&&(yield n),n===this.#f));)n=this.#m[n]}#N(e){return e!==void 0&&this.#a.get(this.#u[e])===e}*entries(){for(let e of this.#A())this.#i[e]!==void 0&&this.#u[e]!==void 0&&!this.#c(this.#i[e])&&(yield[this.#u[e],this.#i[e]])}*rentries(){for(let e of this.#O())this.#i[e]!==void 0&&this.#u[e]!==void 0&&!this.#c(this.#i[e])&&(yield[this.#u[e],this.#i[e]])}*keys(){for(let e of this.#A()){let n=this.#u[e];n!==void 0&&!this.#c(this.#i[e])&&(yield n)}}*rkeys(){for(let e of this.#O()){let n=this.#u[e];n!==void 0&&!this.#c(this.#i[e])&&(yield n)}}*values(){for(let e of this.#A())this.#i[e]!==void 0&&!this.#c(this.#i[e])&&(yield this.#i[e])}*rvalues(){for(let e of this.#O())this.#i[e]!==void 0&&!this.#c(this.#i[e])&&(yield this.#i[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,n={}){for(let r of this.#A()){let i=this.#i[r],s=this.#c(i)?i.__staleWhileFetching:i;if(s!==void 0&&e(s,this.#u[r],this))return this.get(this.#u[r],n)}}forEach(e,n=this){for(let r of this.#A()){let i=this.#i[r],s=this.#c(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(n,s,this.#u[r],this)}}rforEach(e,n=this){for(let r of this.#O()){let i=this.#i[r],s=this.#c(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(n,s,this.#u[r],this)}}purgeStale(){let e=!1;for(let n of this.#O({allowStale:!0}))this.#b(n)&&(this.#P(this.#u[n],"expire"),e=!0);return e}info(e){let n=this.#a.get(e);if(n===void 0)return;let r=this.#i[n],i=this.#c(r)?r.__staleWhileFetching:r;if(i===void 0)return;let s={value:i};if(this.#v&&this.#x){let o=this.#v[n],a=this.#x[n];if(o&&a){let u=o-(_a.now()-a);s.ttl=u,s.start=Date.now()}}return this.#w&&(s.size=this.#w[n]),s}dump(){let e=[];for(let n of this.#A({allowStale:!0})){let r=this.#u[n],i=this.#i[n],s=this.#c(i)?i.__staleWhileFetching:i;if(s===void 0||r===void 0)continue;let o={value:s};if(this.#v&&this.#x){o.ttl=this.#v[n];let a=_a.now()-this.#x[n];o.start=Math.floor(Date.now()-a)}this.#w&&(o.size=this.#w[n]),e.unshift([r,o])}return e}load(e){this.clear();for(let[n,r]of e){if(r.start){let i=Date.now()-r.start;r.start=_a.now()-i}this.set(n,r.value,r)}}set(e,n,r={}){if(n===void 0)return this.delete(e),this;let{ttl:i=this.ttl,start:s,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:u}=r,{noUpdateTTL:l=this.noUpdateTTL}=r,c=this.#L(e,n,r.size||0,a);if(this.maxEntrySize&&c>this.maxEntrySize)return u&&(u.set="miss",u.maxEntrySizeExceeded=!0),this.#P(e,"set"),this;let h=this.#l===0?void 0:this.#a.get(e);if(h===void 0)h=this.#l===0?this.#f:this.#k.length!==0?this.#k.pop():this.#l===this.#e?this.#q(!1):this.#l,this.#u[h]=e,this.#i[h]=n,this.#a.set(e,h),this.#m[this.#f]=h,this.#y[h]=this.#f,this.#f=h,this.#l++,this.#M(h,c,u),u&&(u.set="add"),l=!1;else{this.#$(h);let f=this.#i[h];if(n!==f){if(this.#S&&this.#c(f)){f.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:g}=f;g!==void 0&&!o&&(this.#T&&this.#s?.(g,e,"set"),this.#p&&this.#g?.push([g,e,"set"]))}else o||(this.#T&&this.#s?.(f,e,"set"),this.#p&&this.#g?.push([f,e,"set"]));if(this.#I(h),this.#M(h,c,u),this.#i[h]=n,u){u.set="replace";let g=f&&this.#c(f)?f.__staleWhileFetching:f;g!==void 0&&(u.oldValue=g)}}else u&&(u.set="update")}if(i!==0&&!this.#v&&this.#C(),this.#v&&(l||this.#D(h,i,s),u&&this.#n(u,h)),!o&&this.#p&&this.#g){let f=this.#g,g;for(;g=f?.shift();)this.#r?.(...g)}return this}pop(){try{for(;this.#l;){let e=this.#i[this.#d];if(this.#q(!0),this.#c(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#p&&this.#g){let e=this.#g,n;for(;n=e?.shift();)this.#r?.(...n)}}}#q(e){let n=this.#d,r=this.#u[n],i=this.#i[n];return this.#S&&this.#c(i)?i.__abortController.abort(new Error("evicted")):(this.#T||this.#p)&&(this.#T&&this.#s?.(i,r,"evict"),this.#p&&this.#g?.push([i,r,"evict"])),this.#I(n),e&&(this.#u[n]=void 0,this.#i[n]=void 0,this.#k.push(n)),this.#l===1?(this.#d=this.#f=0,this.#k.length=0):this.#d=this.#m[n],this.#a.delete(r),this.#l--,n}has(e,n={}){let{updateAgeOnHas:r=this.updateAgeOnHas,status:i}=n,s=this.#a.get(e);if(s!==void 0){let o=this.#i[s];if(this.#c(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#b(s))i&&(i.has="stale",this.#n(i,s));else return r&&this.#E(s),i&&(i.has="hit",this.#n(i,s)),!0}else i&&(i.has="miss");return!1}peek(e,n={}){let{allowStale:r=this.allowStale}=n,i=this.#a.get(e);if(i===void 0||!r&&this.#b(i))return;let s=this.#i[i];return this.#c(s)?s.__staleWhileFetching:s}#j(e,n,r,i){let s=n===void 0?void 0:this.#i[n];if(this.#c(s))return s;let o=new Kd,{signal:a}=r;a?.addEventListener("abort",()=>o.abort(a.reason),{signal:o.signal});let u={signal:o.signal,options:r,context:i},l=(b,O=!1)=>{let{aborted:A}=o.signal,k=r.ignoreFetchAbort&&b!==void 0;if(r.status&&(A&&!O?(r.status.fetchAborted=!0,r.status.fetchError=o.signal.reason,k&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),A&&!k&&!O)return h(o.signal.reason);let S=g;return this.#i[n]===g&&(b===void 0?S.__staleWhileFetching?this.#i[n]=S.__staleWhileFetching:this.#P(e,"fetch"):(r.status&&(r.status.fetchUpdated=!0),this.set(e,b,u.options))),b},c=b=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=b),h(b)),h=b=>{let{aborted:O}=o.signal,A=O&&r.allowStaleOnFetchAbort,k=A||r.allowStaleOnFetchRejection,S=k||r.noDeleteOnFetchRejection,_=g;if(this.#i[n]===g&&(!S||_.__staleWhileFetching===void 0?this.#P(e,"fetch"):A||(this.#i[n]=_.__staleWhileFetching)),k)return r.status&&_.__staleWhileFetching!==void 0&&(r.status.returnedStale=!0),_.__staleWhileFetching;if(_.__returned===_)throw b},f=(b,O)=>{let A=this.#o?.(e,s,u);A&&A instanceof Promise&&A.then(k=>b(k===void 0?void 0:k),O),o.signal.addEventListener("abort",()=>{(!r.ignoreFetchAbort||r.allowStaleOnFetchAbort)&&(b(void 0),r.allowStaleOnFetchAbort&&(b=k=>l(k,!0)))})};r.status&&(r.status.fetchDispatched=!0);let g=new Promise(f).then(l,c),v=Object.assign(g,{__abortController:o,__staleWhileFetching:s,__returned:void 0});return n===void 0?(this.set(e,v,{...u.options,status:void 0}),n=this.#a.get(e)):this.#i[n]=v,v}#c(e){if(!this.#S)return!1;let n=e;return!!n&&n instanceof Promise&&n.hasOwnProperty("__staleWhileFetching")&&n.__abortController instanceof Kd}async fetch(e,n={}){let{allowStale:r=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:u=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:c=this.noUpdateTTL,noDeleteOnFetchRejection:h=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:f=this.allowStaleOnFetchRejection,ignoreFetchAbort:g=this.ignoreFetchAbort,allowStaleOnFetchAbort:v=this.allowStaleOnFetchAbort,context:b,forceRefresh:O=!1,status:A,signal:k}=n;if(!this.#S)return A&&(A.fetch="get"),this.get(e,{allowStale:r,updateAgeOnGet:i,noDeleteOnStaleGet:s,status:A});let S={allowStale:r,updateAgeOnGet:i,noDeleteOnStaleGet:s,ttl:o,noDisposeOnSet:a,size:u,sizeCalculation:l,noUpdateTTL:c,noDeleteOnFetchRejection:h,allowStaleOnFetchRejection:f,allowStaleOnFetchAbort:v,ignoreFetchAbort:g,status:A,signal:k},_=this.#a.get(e);if(_===void 0){A&&(A.fetch="miss");let N=this.#j(e,_,S,b);return N.__returned=N}else{let N=this.#i[_];if(this.#c(N)){let K=r&&N.__staleWhileFetching!==void 0;return A&&(A.fetch="inflight",K&&(A.returnedStale=!0)),K?N.__staleWhileFetching:N.__returned=N}let R=this.#b(_);if(!O&&!R)return A&&(A.fetch="hit"),this.#$(_),i&&this.#E(_),A&&this.#n(A,_),N;let G=this.#j(e,_,S,b),ue=G.__staleWhileFetching!==void 0&&r;return A&&(A.fetch=R?"stale":"refresh",ue&&R&&(A.returnedStale=!0)),ue?G.__staleWhileFetching:G.__returned=G}}async forceFetch(e,n={}){let r=await this.fetch(e,n);if(r===void 0)throw new Error("fetch() returned undefined");return r}memo(e,n={}){let r=this.#_;if(!r)throw new Error("no memoMethod provided to constructor");let{context:i,forceRefresh:s,...o}=n,a=this.get(e,o);if(!s&&a!==void 0)return a;let u=r(e,a,{options:o,context:i});return this.set(e,u,o),u}get(e,n={}){let{allowStale:r=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,status:o}=n,a=this.#a.get(e);if(a!==void 0){let u=this.#i[a],l=this.#c(u);return o&&this.#n(o,a),this.#b(a)?(o&&(o.get="stale"),l?(o&&r&&u.__staleWhileFetching!==void 0&&(o.returnedStale=!0),r?u.__staleWhileFetching:void 0):(s||this.#P(e,"expire"),o&&r&&(o.returnedStale=!0),r?u:void 0)):(o&&(o.get="hit"),l?u.__staleWhileFetching:(this.#$(a),i&&this.#E(a),u))}else o&&(o.get="miss")}#F(e,n){this.#y[n]=e,this.#m[e]=n}#$(e){e!==this.#f&&(e===this.#d?this.#d=this.#m[e]:this.#F(this.#y[e],this.#m[e]),this.#F(this.#f,e),this.#f=e)}delete(e){return this.#P(e,"delete")}#P(e,n){let r=!1;if(this.#l!==0){let i=this.#a.get(e);if(i!==void 0)if(r=!0,this.#l===1)this.#B(n);else{this.#I(i);let s=this.#i[i];if(this.#c(s)?s.__abortController.abort(new Error("deleted")):(this.#T||this.#p)&&(this.#T&&this.#s?.(s,e,n),this.#p&&this.#g?.push([s,e,n])),this.#a.delete(e),this.#u[i]=void 0,this.#i[i]=void 0,i===this.#f)this.#f=this.#y[i];else if(i===this.#d)this.#d=this.#m[i];else{let o=this.#y[i];this.#m[o]=this.#m[i];let a=this.#m[i];this.#y[a]=this.#y[i]}this.#l--,this.#k.push(i)}}if(this.#p&&this.#g?.length){let i=this.#g,s;for(;s=i?.shift();)this.#r?.(...s)}return r}clear(){return this.#B("delete")}#B(e){for(let n of this.#O({allowStale:!0})){let r=this.#i[n];if(this.#c(r))r.__abortController.abort(new Error("deleted"));else{let i=this.#u[n];this.#T&&this.#s?.(r,i,e),this.#p&&this.#g?.push([r,i,e])}}if(this.#a.clear(),this.#i.fill(void 0),this.#u.fill(void 0),this.#v&&this.#x&&(this.#v.fill(0),this.#x.fill(0)),this.#w&&this.#w.fill(0),this.#d=0,this.#f=0,this.#k.length=0,this.#h=0,this.#l=0,this.#p&&this.#g){let n=this.#g,r;for(;r=n?.shift();)this.#r?.(...r)}}};zd.LRUCache=AT});var LT=m(_n=>{"use strict";var s5=_n&&_n.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(_n,"__esModule",{value:!0});_n.Minipass=_n.isWritable=_n.isReadable=_n.isStream=void 0;var OR=typeof process=="object"&&process?process:{stdout:null,stderr:null},MT=require("node:events"),DR=s5(require("node:stream")),o5=require("node:string_decoder"),a5=t=>!!t&&typeof t=="object"&&(t instanceof ep||t instanceof DR.default||(0,_n.isReadable)(t)||(0,_n.isWritable)(t));_n.isStream=a5;var u5=t=>!!t&&typeof t=="object"&&t instanceof MT.EventEmitter&&typeof t.pipe=="function"&&t.pipe!==DR.default.Writable.prototype.pipe;_n.isReadable=u5;var l5=t=>!!t&&typeof t=="object"&&t instanceof MT.EventEmitter&&typeof t.write=="function"&&typeof t.end=="function";_n.isWritable=l5;var Si=Symbol("EOF"),ki=Symbol("maybeEmitEnd"),os=Symbol("emittedEnd"),Vd=Symbol("emittingEnd"),rl=Symbol("emittedError"),Xd=Symbol("closed"),CR=Symbol("read"),Yd=Symbol("flush"),RR=Symbol("flushChunk"),Cr=Symbol("encoding"),Sa=Symbol("decoder"),Gt=Symbol("flowing"),il=Symbol("paused"),ka=Symbol("resume"),Kt=Symbol("buffer"),vn=Symbol("pipes"),zt=Symbol("bufferLength"),OT=Symbol("bufferPush"),Jd=Symbol("bufferShift"),cn=Symbol("objectMode"),Et=Symbol("destroyed"),CT=Symbol("error"),RT=Symbol("emitData"),PR=Symbol("emitEnd"),PT=Symbol("emitEnd2"),ei=Symbol("async"),DT=Symbol("abort"),Qd=Symbol("aborted"),sl=Symbol("signal"),Vs=Symbol("dataListeners"),Un=Symbol("discarded"),ol=t=>Promise.resolve().then(t),c5=t=>t(),h5=t=>t==="end"||t==="finish"||t==="prefinish",f5=t=>t instanceof ArrayBuffer||!!t&&typeof t=="object"&&t.constructor&&t.constructor.name==="ArrayBuffer"&&t.byteLength>=0,d5=t=>!Buffer.isBuffer(t)&&ArrayBuffer.isView(t),Zd=class{src;dest;opts;ondrain;constructor(e,n,r){this.src=e,this.dest=n,this.opts=r,this.ondrain=()=>e[ka](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},IT=class extends Zd{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,n,r){super(e,n,r),this.proxyErrors=i=>n.emit("error",i),e.on("error",this.proxyErrors)}},p5=t=>!!t.objectMode,g5=t=>!t.objectMode&&!!t.encoding&&t.encoding!=="buffer",ep=class extends MT.EventEmitter{[Gt]=!1;[il]=!1;[vn]=[];[Kt]=[];[cn];[Cr];[ei];[Sa];[Si]=!1;[os]=!1;[Vd]=!1;[Xd]=!1;[rl]=null;[zt]=0;[Et]=!1;[sl];[Qd]=!1;[Vs]=0;[Un]=!1;writable=!0;readable=!0;constructor(...e){let n=e[0]||{};if(super(),n.objectMode&&typeof n.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");p5(n)?(this[cn]=!0,this[Cr]=null):g5(n)?(this[Cr]=n.encoding,this[cn]=!1):(this[cn]=!1,this[Cr]=null),this[ei]=!!n.async,this[Sa]=this[Cr]?new o5.StringDecoder(this[Cr]):null,n&&n.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[Kt]}),n&&n.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[vn]});let{signal:r}=n;r&&(this[sl]=r,r.aborted?this[DT]():r.addEventListener("abort",()=>this[DT]()))}get bufferLength(){return this[zt]}get encoding(){return this[Cr]}set encoding(e){throw new Error("Encoding must be set at instantiation time")}setEncoding(e){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[cn]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[ei]}set async(e){this[ei]=this[ei]||!!e}[DT](){this[Qd]=!0,this.emit("abort",this[sl]?.reason),this.destroy(this[sl]?.reason)}get aborted(){return this[Qd]}set aborted(e){}write(e,n,r){if(this[Qd])return!1;if(this[Si])throw new Error("write after end");if(this[Et])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof n=="function"&&(r=n,n="utf8"),n||(n="utf8");let i=this[ei]?ol:c5;if(!this[cn]&&!Buffer.isBuffer(e)){if(d5(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(f5(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[cn]?(this[Gt]&&this[zt]!==0&&this[Yd](!0),this[Gt]?this.emit("data",e):this[OT](e),this[zt]!==0&&this.emit("readable"),r&&i(r),this[Gt]):e.length?(typeof e=="string"&&!(n===this[Cr]&&!this[Sa]?.lastNeed)&&(e=Buffer.from(e,n)),Buffer.isBuffer(e)&&this[Cr]&&(e=this[Sa].write(e)),this[Gt]&&this[zt]!==0&&this[Yd](!0),this[Gt]?this.emit("data",e):this[OT](e),this[zt]!==0&&this.emit("readable"),r&&i(r),this[Gt]):(this[zt]!==0&&this.emit("readable"),r&&i(r),this[Gt])}read(e){if(this[Et])return null;if(this[Un]=!1,this[zt]===0||e===0||e&&e>this[zt])return this[ki](),null;this[cn]&&(e=null),this[Kt].length>1&&!this[cn]&&(this[Kt]=[this[Cr]?this[Kt].join(""):Buffer.concat(this[Kt],this[zt])]);let n=this[CR](e||null,this[Kt][0]);return this[ki](),n}[CR](e,n){if(this[cn])this[Jd]();else{let r=n;e===r.length||e===null?this[Jd]():typeof r=="string"?(this[Kt][0]=r.slice(e),n=r.slice(0,e),this[zt]-=e):(this[Kt][0]=r.subarray(e),n=r.subarray(0,e),this[zt]-=e)}return this.emit("data",n),!this[Kt].length&&!this[Si]&&this.emit("drain"),n}end(e,n,r){return typeof e=="function"&&(r=e,e=void 0),typeof n=="function"&&(r=n,n="utf8"),e!==void 0&&this.write(e,n),r&&this.once("end",r),this[Si]=!0,this.writable=!1,(this[Gt]||!this[il])&&this[ki](),this}[ka](){this[Et]||(!this[Vs]&&!this[vn].length&&(this[Un]=!0),this[il]=!1,this[Gt]=!0,this.emit("resume"),this[Kt].length?this[Yd]():this[Si]?this[ki]():this.emit("drain"))}resume(){return this[ka]()}pause(){this[Gt]=!1,this[il]=!0,this[Un]=!1}get destroyed(){return this[Et]}get flowing(){return this[Gt]}get paused(){return this[il]}[OT](e){this[cn]?this[zt]+=1:this[zt]+=e.length,this[Kt].push(e)}[Jd](){return this[cn]?this[zt]-=1:this[zt]-=this[Kt][0].length,this[Kt].shift()}[Yd](e=!1){do;while(this[RR](this[Jd]())&&this[Kt].length);!e&&!this[Kt].length&&!this[Si]&&this.emit("drain")}[RR](e){return this.emit("data",e),this[Gt]}pipe(e,n){if(this[Et])return e;this[Un]=!1;let r=this[os];return n=n||{},e===OR.stdout||e===OR.stderr?n.end=!1:n.end=n.end!==!1,n.proxyErrors=!!n.proxyErrors,r?n.end&&e.end():(this[vn].push(n.proxyErrors?new IT(this,e,n):new Zd(this,e,n)),this[ei]?ol(()=>this[ka]()):this[ka]()),e}unpipe(e){let n=this[vn].find(r=>r.dest===e);n&&(this[vn].length===1?(this[Gt]&&this[Vs]===0&&(this[Gt]=!1),this[vn]=[]):this[vn].splice(this[vn].indexOf(n),1),n.unpipe())}addListener(e,n){return this.on(e,n)}on(e,n){let r=super.on(e,n);if(e==="data")this[Un]=!1,this[Vs]++,!this[vn].length&&!this[Gt]&&this[ka]();else if(e==="readable"&&this[zt]!==0)super.emit("readable");else if(h5(e)&&this[os])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[rl]){let i=n;this[ei]?ol(()=>i.call(this,this[rl])):i.call(this,this[rl])}return r}removeListener(e,n){return this.off(e,n)}off(e,n){let r=super.off(e,n);return e==="data"&&(this[Vs]=this.listeners("data").length,this[Vs]===0&&!this[Un]&&!this[vn].length&&(this[Gt]=!1)),r}removeAllListeners(e){let n=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[Vs]=0,!this[Un]&&!this[vn].length&&(this[Gt]=!1)),n}get emittedEnd(){return this[os]}[ki](){!this[Vd]&&!this[os]&&!this[Et]&&this[Kt].length===0&&this[Si]&&(this[Vd]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Xd]&&this.emit("close"),this[Vd]=!1)}emit(e,...n){let r=n[0];if(e!=="error"&&e!=="close"&&e!==Et&&this[Et])return!1;if(e==="data")return!this[cn]&&!r?!1:this[ei]?(ol(()=>this[RT](r)),!0):this[RT](r);if(e==="end")return this[PR]();if(e==="close"){if(this[Xd]=!0,!this[os]&&!this[Et])return!1;let s=super.emit("close");return this.removeAllListeners("close"),s}else if(e==="error"){this[rl]=r,super.emit(CT,r);let s=!this[sl]||this.listeners("error").length?super.emit("error",r):!1;return this[ki](),s}else if(e==="resume"){let s=super.emit("resume");return this[ki](),s}else if(e==="finish"||e==="prefinish"){let s=super.emit(e);return this.removeAllListeners(e),s}let i=super.emit(e,...n);return this[ki](),i}[RT](e){for(let r of this[vn])r.dest.write(e)===!1&&this.pause();let n=this[Un]?!1:super.emit("data",e);return this[ki](),n}[PR](){return this[os]?!1:(this[os]=!0,this.readable=!1,this[ei]?(ol(()=>this[PT]()),!0):this[PT]())}[PT](){if(this[Sa]){let n=this[Sa].end();if(n){for(let r of this[vn])r.dest.write(n);this[Un]||super.emit("data",n)}}for(let n of this[vn])n.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[cn]||(e.dataLength=0);let n=this.promise();return this.on("data",r=>{e.push(r),this[cn]||(e.dataLength+=r.length)}),await n,e}async concat(){if(this[cn])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[Cr]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,n)=>{this.on(Et,()=>n(new Error("stream destroyed"))),this.on("error",r=>n(r)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[Un]=!1;let e=!1,n=async()=>(this.pause(),e=!0,{value:void 0,done:!0});return{next:()=>{if(e)return n();let i=this.read();if(i!==null)return Promise.resolve({done:!1,value:i});if(this[Si])return n();let s,o,a=h=>{this.off("data",u),this.off("end",l),this.off(Et,c),n(),o(h)},u=h=>{this.off("error",a),this.off("end",l),this.off(Et,c),this.pause(),s({value:h,done:!!this[Si]})},l=()=>{this.off("error",a),this.off("data",u),this.off(Et,c),n(),s({done:!0,value:void 0})},c=()=>a(new Error("stream destroyed"));return new Promise((h,f)=>{o=f,s=h,this.once(Et,c),this.once("error",a),this.once("end",l),this.once("data",u)})},throw:n,return:n,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[Un]=!1;let e=!1,n=()=>(this.pause(),this.off(CT,n),this.off(Et,n),this.off("end",n),e=!0,{done:!0,value:void 0}),r=()=>{if(e)return n();let i=this.read();return i===null?n():{done:!1,value:i}};return this.once("end",n),this.once(CT,n),this.once(Et,n),{next:r,throw:n,return:n,[Symbol.iterator](){return this}}}destroy(e){if(this[Et])return e?this.emit("error",e):this.emit(Et),this;this[Et]=!0,this[Un]=!0,this[Kt].length=0,this[zt]=0;let n=this;return typeof n.close=="function"&&!this[Xd]&&n.close(),e?this.emit("error",e):this.emit(Et),this}static get isStream(){return _n.isStream}};_n.Minipass=ep});var zR=m(Be=>{"use strict";var m5=Be&&Be.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),y5=Be&&Be.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),b5=Be&&Be.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&m5(e,t,n);return y5(e,t),e};Object.defineProperty(Be,"__esModule",{value:!0});Be.PathScurry=Be.Path=Be.PathScurryDarwin=Be.PathScurryPosix=Be.PathScurryWin32=Be.PathScurryBase=Be.PathPosix=Be.PathWin32=Be.PathBase=Be.ChildrenCache=Be.ResolveCache=void 0;var jR=AR(),sp=require("node:path"),v5=require("node:url"),ul=require("fs"),_5=b5(require("node:fs")),T5=ul.realpathSync.native,tp=require("node:fs/promises"),IR=LT(),ll={lstatSync:ul.lstatSync,readdir:ul.readdir,readdirSync:ul.readdirSync,readlinkSync:ul.readlinkSync,realpathSync:T5,promises:{lstat:tp.lstat,readdir:tp.readdir,readlink:tp.readlink,realpath:tp.realpath}},FR=t=>!t||t===ll||t===_5?ll:{...ll,...t,promises:{...ll.promises,...t.promises||{}}},$R=/^\\\\\?\\([a-z]:)\\?$/i,S5=t=>t.replace(/\//g,"\\").replace($R,"$1\\"),k5=/[\\\/]/,fr=0,BR=1,UR=2,ti=4,WR=6,HR=8,Xs=10,GR=12,hr=15,al=~hr,NT=16,MR=32,cl=64,Rr=128,np=256,ip=512,LR=cl|Rr|ip,w5=1023,qT=t=>t.isFile()?HR:t.isDirectory()?ti:t.isSymbolicLink()?Xs:t.isCharacterDevice()?UR:t.isBlockDevice()?WR:t.isSocket()?GR:t.isFIFO()?BR:fr,NR=new Map,hl=t=>{let e=NR.get(t);if(e)return e;let n=t.normalize("NFKD");return NR.set(t,n),n},qR=new Map,rp=t=>{let e=qR.get(t);if(e)return e;let n=hl(t.toLowerCase());return qR.set(t,n),n},fl=class extends jR.LRUCache{constructor(){super({max:256})}};Be.ResolveCache=fl;var op=class extends jR.LRUCache{constructor(e=16*1024){super({maxSize:e,sizeCalculation:n=>n.length+1})}};Be.ChildrenCache=op;var KR=Symbol("PathScurry setAsCwd"),Zt=class{name;root;roots;parent;nocase;isCWD=!1;#e;#t;get dev(){return this.#t}#s;get mode(){return this.#s}#r;get nlink(){return this.#r}#o;get uid(){return this.#o}#_;get gid(){return this.#_}#l;get rdev(){return this.#l}#h;get blksize(){return this.#h}#a;get ino(){return this.#a}#u;get size(){return this.#u}#i;get blocks(){return this.#i}#m;get atimeMs(){return this.#m}#y;get mtimeMs(){return this.#y}#d;get ctimeMs(){return this.#d}#f;get birthtimeMs(){return this.#f}#k;get atime(){return this.#k}#g;get mtime(){return this.#g}#w;get ctime(){return this.#w}#x;get birthtime(){return this.#x}#v;#T;#S;#p;#C;#E;#n;#D;#b;#R;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,n=fr,r,i,s,o,a){this.name=e,this.#v=s?rp(e):hl(e),this.#n=n&w5,this.nocase=s,this.roots=i,this.root=r||this,this.#D=o,this.#S=a.fullpath,this.#C=a.relative,this.#E=a.relativePosix,this.parent=a.parent,this.parent?this.#e=this.parent.#e:this.#e=FR(a.fs)}depth(){return this.#T!==void 0?this.#T:this.parent?this.#T=this.parent.depth()+1:this.#T=0}childrenCache(){return this.#D}resolve(e){if(!e)return this;let n=this.getRootString(e),i=e.substring(n.length).split(this.splitSep);return n?this.getRoot(n).#I(i):this.#I(i)}#I(e){let n=this;for(let r of e)n=n.child(r);return n}children(){let e=this.#D.get(this);if(e)return e;let n=Object.assign([],{provisional:0});return this.#D.set(this,n),this.#n&=~NT,n}child(e,n){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let r=this.children(),i=this.nocase?rp(e):hl(e);for(let u of r)if(u.#v===i)return u;let s=this.parent?this.sep:"",o=this.#S?this.#S+s+e:void 0,a=this.newChild(e,fr,{...n,parent:this,fullpath:o});return this.canReaddir()||(a.#n|=Rr),r.push(a),a}relative(){if(this.isCWD)return"";if(this.#C!==void 0)return this.#C;let e=this.name,n=this.parent;if(!n)return this.#C=this.name;let r=n.relative();return r+(!r||!n.parent?"":this.sep)+e}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#E!==void 0)return this.#E;let e=this.name,n=this.parent;if(!n)return this.#E=this.fullpathPosix();let r=n.relativePosix();return r+(!r||!n.parent?"":"/")+e}fullpath(){if(this.#S!==void 0)return this.#S;let e=this.name,n=this.parent;if(!n)return this.#S=this.name;let i=n.fullpath()+(n.parent?this.sep:"")+e;return this.#S=i}fullpathPosix(){if(this.#p!==void 0)return this.#p;if(this.sep==="/")return this.#p=this.fullpath();if(!this.parent){let i=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(i)?this.#p=`//?/${i}`:this.#p=i}let e=this.parent,n=e.fullpathPosix(),r=n+(!n||!e.parent?"":"/")+this.name;return this.#p=r}isUnknown(){return(this.#n&hr)===fr}isType(e){return this[`is${e}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#n&hr)===HR}isDirectory(){return(this.#n&hr)===ti}isCharacterDevice(){return(this.#n&hr)===UR}isBlockDevice(){return(this.#n&hr)===WR}isFIFO(){return(this.#n&hr)===BR}isSocket(){return(this.#n&hr)===GR}isSymbolicLink(){return(this.#n&Xs)===Xs}lstatCached(){return this.#n&MR?this:void 0}readlinkCached(){return this.#b}realpathCached(){return this.#R}readdirCached(){let e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(this.#b)return!0;if(!this.parent)return!1;let e=this.#n&hr;return!(e!==fr&&e!==Xs||this.#n&np||this.#n&Rr)}calledReaddir(){return!!(this.#n&NT)}isENOENT(){return!!(this.#n&Rr)}isNamed(e){return this.nocase?this.#v===rp(e):this.#v===hl(e)}async readlink(){let e=this.#b;if(e)return e;if(this.canReadlink()&&this.parent)try{let n=await this.#e.promises.readlink(this.fullpath()),r=(await this.parent.realpath())?.resolve(n);if(r)return this.#b=r}catch(n){this.#c(n.code);return}}readlinkSync(){let e=this.#b;if(e)return e;if(this.canReadlink()&&this.parent)try{let n=this.#e.readlinkSync(this.fullpath()),r=this.parent.realpathSync()?.resolve(n);if(r)return this.#b=r}catch(n){this.#c(n.code);return}}#M(e){this.#n|=NT;for(let n=e.provisional;n<e.length;n++){let r=e[n];r&&r.#L()}}#L(){this.#n&Rr||(this.#n=(this.#n|Rr)&al,this.#A())}#A(){let e=this.children();e.provisional=0;for(let n of e)n.#L()}#O(){this.#n|=ip,this.#N()}#N(){if(this.#n&cl)return;let e=this.#n;(e&hr)===ti&&(e&=al),this.#n=e|cl,this.#A()}#q(e=""){e==="ENOTDIR"||e==="EPERM"?this.#N():e==="ENOENT"?this.#L():this.children().provisional=0}#j(e=""){e==="ENOTDIR"?this.parent.#N():e==="ENOENT"&&this.#L()}#c(e=""){let n=this.#n;n|=np,e==="ENOENT"&&(n|=Rr),(e==="EINVAL"||e==="UNKNOWN")&&(n&=al),this.#n=n,e==="ENOTDIR"&&this.parent&&this.parent.#N()}#F(e,n){return this.#P(e,n)||this.#$(e,n)}#$(e,n){let r=qT(e),i=this.newChild(e.name,r,{parent:this}),s=i.#n&hr;return s!==ti&&s!==Xs&&s!==fr&&(i.#n|=cl),n.unshift(i),n.provisional++,i}#P(e,n){for(let r=n.provisional;r<n.length;r++){let i=n[r];if((this.nocase?rp(e.name):hl(e.name))===i.#v)return this.#B(e,i,r,n)}}#B(e,n,r,i){let s=n.name;return n.#n=n.#n&al|qT(e),s!==e.name&&(n.name=e.name),r!==i.provisional&&(r===i.length-1?i.pop():i.splice(r,1),i.unshift(n)),i.provisional++,n}async lstat(){if(!(this.#n&Rr))try{return this.#G(await this.#e.promises.lstat(this.fullpath())),this}catch(e){this.#j(e.code)}}lstatSync(){if(!(this.#n&Rr))try{return this.#G(this.#e.lstatSync(this.fullpath())),this}catch(e){this.#j(e.code)}}#G(e){let{atime:n,atimeMs:r,birthtime:i,birthtimeMs:s,blksize:o,blocks:a,ctime:u,ctimeMs:l,dev:c,gid:h,ino:f,mode:g,mtime:v,mtimeMs:b,nlink:O,rdev:A,size:k,uid:S}=e;this.#k=n,this.#m=r,this.#x=i,this.#f=s,this.#h=o,this.#i=a,this.#w=u,this.#d=l,this.#t=c,this.#_=h,this.#a=f,this.#s=g,this.#g=v,this.#y=b,this.#r=O,this.#l=A,this.#u=k,this.#o=S;let _=qT(e);this.#n=this.#n&al|_|MR,_!==fr&&_!==ti&&_!==Xs&&(this.#n|=cl)}#W=[];#H=!1;#K(e){this.#H=!1;let n=this.#W.slice();this.#W.length=0,n.forEach(r=>r(null,e))}readdirCB(e,n=!1){if(!this.canReaddir()){n?e(null,[]):queueMicrotask(()=>e(null,[]));return}let r=this.children();if(this.calledReaddir()){let s=r.slice(0,r.provisional);n?e(null,s):queueMicrotask(()=>e(null,s));return}if(this.#W.push(e),this.#H)return;this.#H=!0;let i=this.fullpath();this.#e.readdir(i,{withFileTypes:!0},(s,o)=>{if(s)this.#q(s.code),r.provisional=0;else{for(let a of o)this.#F(a,r);this.#M(r)}this.#K(r.slice(0,r.provisional))})}#U;async readdir(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let n=this.fullpath();if(this.#U)await this.#U;else{let r=()=>{};this.#U=new Promise(i=>r=i);try{for(let i of await this.#e.promises.readdir(n,{withFileTypes:!0}))this.#F(i,e);this.#M(e)}catch(i){this.#q(i.code),e.provisional=0}this.#U=void 0,r()}return e.slice(0,e.provisional)}readdirSync(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let n=this.fullpath();try{for(let r of this.#e.readdirSync(n,{withFileTypes:!0}))this.#F(r,e);this.#M(e)}catch(r){this.#q(r.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#n&LR)return!1;let e=hr&this.#n;return e===fr||e===ti||e===Xs}shouldWalk(e,n){return(this.#n&ti)===ti&&!(this.#n&LR)&&!e.has(this)&&(!n||n(this))}async realpath(){if(this.#R)return this.#R;if(!((ip|np|Rr)&this.#n))try{let e=await this.#e.promises.realpath(this.fullpath());return this.#R=this.resolve(e)}catch{this.#O()}}realpathSync(){if(this.#R)return this.#R;if(!((ip|np|Rr)&this.#n))try{let e=this.#e.realpathSync(this.fullpath());return this.#R=this.resolve(e)}catch{this.#O()}}[KR](e){if(e===this)return;e.isCWD=!1,this.isCWD=!0;let n=new Set([]),r=[],i=this;for(;i&&i.parent;)n.add(i),i.#C=r.join(this.sep),i.#E=r.join("/"),i=i.parent,r.push("..");for(i=e;i&&i.parent&&!n.has(i);)i.#C=void 0,i.#E=void 0,i=i.parent}};Be.PathBase=Zt;var dl=class t extends Zt{sep="\\";splitSep=k5;constructor(e,n=fr,r,i,s,o,a){super(e,n,r,i,s,o,a)}newChild(e,n=fr,r={}){return new t(e,n,this.root,this.roots,this.nocase,this.childrenCache(),r)}getRootString(e){return sp.win32.parse(e).root}getRoot(e){if(e=S5(e.toUpperCase()),e===this.root.name)return this.root;for(let[n,r]of Object.entries(this.roots))if(this.sameRoot(e,n))return this.roots[e]=r;return this.roots[e]=new ml(e,this).root}sameRoot(e,n=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace($R,"$1\\"),e===n}};Be.PathWin32=dl;var pl=class t extends Zt{splitSep="/";sep="/";constructor(e,n=fr,r,i,s,o,a){super(e,n,r,i,s,o,a)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,n=fr,r={}){return new t(e,n,this.root,this.roots,this.nocase,this.childrenCache(),r)}};Be.PathPosix=pl;var gl=class{root;rootPath;roots;cwd;#e;#t;#s;nocase;#r;constructor(e=process.cwd(),n,r,{nocase:i,childrenCacheSize:s=16*1024,fs:o=ll}={}){this.#r=FR(o),(e instanceof URL||e.startsWith("file://"))&&(e=(0,v5.fileURLToPath)(e));let a=n.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(a),this.#e=new fl,this.#t=new fl,this.#s=new op(s);let u=a.substring(this.rootPath.length).split(r);if(u.length===1&&!u[0]&&u.pop(),i===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=i,this.root=this.newRoot(this.#r),this.roots[this.rootPath]=this.root;let l=this.root,c=u.length-1,h=n.sep,f=this.rootPath,g=!1;for(let v of u){let b=c--;l=l.child(v,{relative:new Array(b).fill("..").join(h),relativePosix:new Array(b).fill("..").join("/"),fullpath:f+=(g?"":h)+v}),g=!0}this.cwd=l}depth(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.depth()}childrenCache(){return this.#s}resolve(...e){let n="";for(let s=e.length-1;s>=0;s--){let o=e[s];if(!(!o||o===".")&&(n=n?`${o}/${n}`:o,this.isAbsolute(o)))break}let r=this.#e.get(n);if(r!==void 0)return r;let i=this.cwd.resolve(n).fullpath();return this.#e.set(n,i),i}resolvePosix(...e){let n="";for(let s=e.length-1;s>=0;s--){let o=e[s];if(!(!o||o===".")&&(n=n?`${o}/${n}`:o,this.isAbsolute(o)))break}let r=this.#t.get(n);if(r!==void 0)return r;let i=this.cwd.resolve(n).fullpathPosix();return this.#t.set(n,i),i}relative(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relative()}relativePosix(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relativePosix()}basename(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.name}dirname(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),(e.parent||e).fullpath()}async readdir(e=this.cwd,n={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Zt||(n=e,e=this.cwd);let{withFileTypes:r}=n;if(e.canReaddir()){let i=await e.readdir();return r?i:i.map(s=>s.name)}else return[]}readdirSync(e=this.cwd,n={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Zt||(n=e,e=this.cwd);let{withFileTypes:r=!0}=n;return e.canReaddir()?r?e.readdirSync():e.readdirSync().map(i=>i.name):[]}async lstat(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstat()}lstatSync(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstatSync()}async readlink(e=this.cwd,{withFileTypes:n}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Zt||(n=e.withFileTypes,e=this.cwd);let r=await e.readlink();return n?r:r?.fullpath()}readlinkSync(e=this.cwd,{withFileTypes:n}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Zt||(n=e.withFileTypes,e=this.cwd);let r=e.readlinkSync();return n?r:r?.fullpath()}async realpath(e=this.cwd,{withFileTypes:n}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Zt||(n=e.withFileTypes,e=this.cwd);let r=await e.realpath();return n?r:r?.fullpath()}realpathSync(e=this.cwd,{withFileTypes:n}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Zt||(n=e.withFileTypes,e=this.cwd);let r=e.realpathSync();return n?r:r?.fullpath()}async walk(e=this.cwd,n={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Zt||(n=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:o}=n,a=[];(!s||s(e))&&a.push(r?e:e.fullpath());let u=new Set,l=(h,f)=>{u.add(h),h.readdirCB((g,v)=>{if(g)return f(g);let b=v.length;if(!b)return f();let O=()=>{--b===0&&f()};for(let A of v)(!s||s(A))&&a.push(r?A:A.fullpath()),i&&A.isSymbolicLink()?A.realpath().then(k=>k?.isUnknown()?k.lstat():k).then(k=>k?.shouldWalk(u,o)?l(k,O):O()):A.shouldWalk(u,o)?l(A,O):O()},!0)},c=e;return new Promise((h,f)=>{l(c,g=>{if(g)return f(g);h(a)})})}walkSync(e=this.cwd,n={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Zt||(n=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:o}=n,a=[];(!s||s(e))&&a.push(r?e:e.fullpath());let u=new Set([e]);for(let l of u){let c=l.readdirSync();for(let h of c){(!s||s(h))&&a.push(r?h:h.fullpath());let f=h;if(h.isSymbolicLink()){if(!(i&&(f=h.realpathSync())))continue;f.isUnknown()&&f.lstatSync()}f.shouldWalk(u,o)&&u.add(f)}}return a}[Symbol.asyncIterator](){return this.iterate()}iterate(e=this.cwd,n={}){return typeof e=="string"?e=this.cwd.resolve(e):e instanceof Zt||(n=e,e=this.cwd),this.stream(e,n)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(e=this.cwd,n={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Zt||(n=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:o}=n;(!s||s(e))&&(yield r?e:e.fullpath());let a=new Set([e]);for(let u of a){let l=u.readdirSync();for(let c of l){(!s||s(c))&&(yield r?c:c.fullpath());let h=c;if(c.isSymbolicLink()){if(!(i&&(h=c.realpathSync())))continue;h.isUnknown()&&h.lstatSync()}h.shouldWalk(a,o)&&a.add(h)}}}stream(e=this.cwd,n={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Zt||(n=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:o}=n,a=new IR.Minipass({objectMode:!0});(!s||s(e))&&a.write(r?e:e.fullpath());let u=new Set,l=[e],c=0,h=()=>{let f=!1;for(;!f;){let g=l.shift();if(!g){c===0&&a.end();return}c++,u.add(g);let v=(O,A,k=!1)=>{if(O)return a.emit("error",O);if(i&&!k){let S=[];for(let _ of A)_.isSymbolicLink()&&S.push(_.realpath().then(N=>N?.isUnknown()?N.lstat():N));if(S.length){Promise.all(S).then(()=>v(null,A,!0));return}}for(let S of A)S&&(!s||s(S))&&(a.write(r?S:S.fullpath())||(f=!0));c--;for(let S of A){let _=S.realpathCached()||S;_.shouldWalk(u,o)&&l.push(_)}f&&!a.flowing?a.once("drain",h):b||h()},b=!0;g.readdirCB(v,!0),b=!1}};return h(),a}streamSync(e=this.cwd,n={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Zt||(n=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:o}=n,a=new IR.Minipass({objectMode:!0}),u=new Set;(!s||s(e))&&a.write(r?e:e.fullpath());let l=[e],c=0,h=()=>{let f=!1;for(;!f;){let g=l.shift();if(!g){c===0&&a.end();return}c++,u.add(g);let v=g.readdirSync();for(let b of v)(!s||s(b))&&(a.write(r?b:b.fullpath())||(f=!0));c--;for(let b of v){let O=b;if(b.isSymbolicLink()){if(!(i&&(O=b.realpathSync())))continue;O.isUnknown()&&O.lstatSync()}O.shouldWalk(u,o)&&l.push(O)}}f&&!a.flowing&&a.once("drain",h)};return h(),a}chdir(e=this.cwd){let n=this.cwd;this.cwd=typeof e=="string"?this.cwd.resolve(e):e,this.cwd[KR](n)}};Be.PathScurryBase=gl;var ml=class extends gl{sep="\\";constructor(e=process.cwd(),n={}){let{nocase:r=!0}=n;super(e,sp.win32,"\\",{...n,nocase:r}),this.nocase=r;for(let i=this.cwd;i;i=i.parent)i.nocase=this.nocase}parseRootPath(e){return sp.win32.parse(e).root.toUpperCase()}newRoot(e){return new dl(this.rootPath,ti,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}};Be.PathScurryWin32=ml;var yl=class extends gl{sep="/";constructor(e=process.cwd(),n={}){let{nocase:r=!1}=n;super(e,sp.posix,"/",{...n,nocase:r}),this.nocase=r}parseRootPath(e){return"/"}newRoot(e){return new pl(this.rootPath,ti,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}};Be.PathScurryPosix=yl;var ap=class extends yl{constructor(e=process.cwd(),n={}){let{nocase:r=!0}=n;super(e,{...n,nocase:r})}};Be.PathScurryDarwin=ap;Be.Path=process.platform==="win32"?dl:pl;Be.PathScurry=process.platform==="win32"?ml:process.platform==="darwin"?ap:yl});var FT=m(up=>{"use strict";Object.defineProperty(up,"__esModule",{value:!0});up.Pattern=void 0;var x5=is(),E5=t=>t.length>=1,A5=t=>t.length>=1,jT=class t{#e;#t;#s;length;#r;#o;#_;#l;#h;#a;#u=!0;constructor(e,n,r,i){if(!E5(e))throw new TypeError("empty pattern list");if(!A5(n))throw new TypeError("empty glob list");if(n.length!==e.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=e.length,r<0||r>=this.length)throw new TypeError("index out of range");if(this.#e=e,this.#t=n,this.#s=r,this.#r=i,this.#s===0){if(this.isUNC()){let[s,o,a,u,...l]=this.#e,[c,h,f,g,...v]=this.#t;l[0]===""&&(l.shift(),v.shift());let b=[s,o,a,u,""].join("/"),O=[c,h,f,g,""].join("/");this.#e=[b,...l],this.#t=[O,...v],this.length=this.#e.length}else if(this.isDrive()||this.isAbsolute()){let[s,...o]=this.#e,[a,...u]=this.#t;o[0]===""&&(o.shift(),u.shift());let l=s+"/",c=a+"/";this.#e=[l,...o],this.#t=[c,...u],this.length=this.#e.length}}}pattern(){return this.#e[this.#s]}isString(){return typeof this.#e[this.#s]=="string"}isGlobstar(){return this.#e[this.#s]===x5.GLOBSTAR}isRegExp(){return this.#e[this.#s]instanceof RegExp}globString(){return this.#_=this.#_||(this.#s===0?this.isAbsolute()?this.#t[0]+this.#t.slice(1).join("/"):this.#t.join("/"):this.#t.slice(this.#s).join("/"))}hasMore(){return this.length>this.#s+1}rest(){return this.#o!==void 0?this.#o:this.hasMore()?(this.#o=new t(this.#e,this.#t,this.#s+1,this.#r),this.#o.#a=this.#a,this.#o.#h=this.#h,this.#o.#l=this.#l,this.#o):this.#o=null}isUNC(){let e=this.#e;return this.#h!==void 0?this.#h:this.#h=this.#r==="win32"&&this.#s===0&&e[0]===""&&e[1]===""&&typeof e[2]=="string"&&!!e[2]&&typeof e[3]=="string"&&!!e[3]}isDrive(){let e=this.#e;return this.#l!==void 0?this.#l:this.#l=this.#r==="win32"&&this.#s===0&&this.length>1&&typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0])}isAbsolute(){let e=this.#e;return this.#a!==void 0?this.#a:this.#a=e[0]===""&&e.length>1||this.isDrive()||this.isUNC()}root(){let e=this.#e[0];return typeof e=="string"&&this.isAbsolute()&&this.#s===0?e:""}checkFollowGlobstar(){return!(this.#s===0||!this.isGlobstar()||!this.#u)}markFollowGlobstar(){return this.#s===0||!this.isGlobstar()||!this.#u?!1:(this.#u=!1,!0)}};up.Pattern=jT});var BT=m(lp=>{"use strict";Object.defineProperty(lp,"__esModule",{value:!0});lp.Ignore=void 0;var VR=is(),O5=FT(),C5=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",$T=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:n,nocase:r,noext:i,noglobstar:s,platform:o=C5}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=o,this.mmopts={dot:!0,nobrace:n,nocase:r,noext:i,noglobstar:s,optimizationLevel:2,platform:o,nocomment:!0,nonegate:!0};for(let a of e)this.add(a)}add(e){let n=new VR.Minimatch(e,this.mmopts);for(let r=0;r<n.set.length;r++){let i=n.set[r],s=n.globParts[r];if(!i||!s)throw new Error("invalid pattern object");for(;i[0]==="."&&s[0]===".";)i.shift(),s.shift();let o=new O5.Pattern(i,s,0,this.platform),a=new VR.Minimatch(o.globString(),this.mmopts),u=s[s.length-1]==="**",l=o.isAbsolute();l?this.absolute.push(a):this.relative.push(a),u&&(l?this.absoluteChildren.push(a):this.relativeChildren.push(a))}}ignored(e){let n=e.fullpath(),r=`${n}/`,i=e.relative()||".",s=`${i}/`;for(let o of this.relative)if(o.match(i)||o.match(s))return!0;for(let o of this.absolute)if(o.match(n)||o.match(r))return!0;return!1}childrenIgnored(e){let n=e.fullpath()+"/",r=(e.relative()||".")+"/";for(let i of this.relativeChildren)if(i.match(r))return!0;for(let i of this.absoluteChildren)if(i.match(n))return!0;return!1}};lp.Ignore=$T});var YR=m(ni=>{"use strict";Object.defineProperty(ni,"__esModule",{value:!0});ni.Processor=ni.SubWalks=ni.MatchRecord=ni.HasWalkedCache=void 0;var XR=is(),cp=class t{store;constructor(e=new Map){this.store=e}copy(){return new t(new Map(this.store))}hasWalked(e,n){return this.store.get(e.fullpath())?.has(n.globString())}storeWalked(e,n){let r=e.fullpath(),i=this.store.get(r);i?i.add(n.globString()):this.store.set(r,new Set([n.globString()]))}};ni.HasWalkedCache=cp;var hp=class{store=new Map;add(e,n,r){let i=(n?2:0)|(r?1:0),s=this.store.get(e);this.store.set(e,s===void 0?i:i&s)}entries(){return[...this.store.entries()].map(([e,n])=>[e,!!(n&2),!!(n&1)])}};ni.MatchRecord=hp;var fp=class{store=new Map;add(e,n){if(!e.canReaddir())return;let r=this.store.get(e);r?r.find(i=>i.globString()===n.globString())||r.push(n):this.store.set(e,[n])}get(e){let n=this.store.get(e);if(!n)throw new Error("attempting to walk unknown path");return n}entries(){return this.keys().map(e=>[e,this.store.get(e)])}keys(){return[...this.store.keys()].filter(e=>e.canReaddir())}};ni.SubWalks=fp;var UT=class t{hasWalkedCache;matches=new hp;subwalks=new fp;patterns;follow;dot;opts;constructor(e,n){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=n?n.copy():new cp}processPatterns(e,n){this.patterns=n;let r=n.map(i=>[e,i]);for(let[i,s]of r){this.hasWalkedCache.storeWalked(i,s);let o=s.root(),a=s.isAbsolute()&&this.opts.absolute!==!1;if(o){i=i.resolve(o==="/"&&this.opts.root!==void 0?this.opts.root:o);let h=s.rest();if(h)s=h;else{this.matches.add(i,!0,!1);continue}}if(i.isENOENT())continue;let u,l,c=!1;for(;typeof(u=s.pattern())=="string"&&(l=s.rest());)i=i.resolve(u),s=l,c=!0;if(u=s.pattern(),l=s.rest(),c){if(this.hasWalkedCache.hasWalked(i,s))continue;this.hasWalkedCache.storeWalked(i,s)}if(typeof u=="string"){let h=u===".."||u===""||u===".";this.matches.add(i.resolve(u),a,h);continue}else if(u===XR.GLOBSTAR){(!i.isSymbolicLink()||this.follow||s.checkFollowGlobstar())&&this.subwalks.add(i,s);let h=l?.pattern(),f=l?.rest();if(!l||(h===""||h===".")&&!f)this.matches.add(i,a,h===""||h===".");else if(h===".."){let g=i.parent||i;f?this.hasWalkedCache.hasWalked(g,f)||this.subwalks.add(g,f):this.matches.add(g,a,!0)}}else u instanceof RegExp&&this.subwalks.add(i,s)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new t(this.opts,this.hasWalkedCache)}filterEntries(e,n){let r=this.subwalks.get(e),i=this.child();for(let s of n)for(let o of r){let a=o.isAbsolute(),u=o.pattern(),l=o.rest();u===XR.GLOBSTAR?i.testGlobstar(s,o,l,a):u instanceof RegExp?i.testRegExp(s,u,l,a):i.testString(s,u,l,a)}return i}testGlobstar(e,n,r,i){if((this.dot||!e.name.startsWith("."))&&(n.hasMore()||this.matches.add(e,i,!1),e.canReaddir()&&(this.follow||!e.isSymbolicLink()?this.subwalks.add(e,n):e.isSymbolicLink()&&(r&&n.checkFollowGlobstar()?this.subwalks.add(e,r):n.markFollowGlobstar()&&this.subwalks.add(e,n)))),r){let s=r.pattern();if(typeof s=="string"&&s!==".."&&s!==""&&s!==".")this.testString(e,s,r.rest(),i);else if(s===".."){let o=e.parent||e;this.subwalks.add(o,r)}else s instanceof RegExp&&this.testRegExp(e,s,r.rest(),i)}}testRegExp(e,n,r,i){n.test(e.name)&&(r?this.subwalks.add(e,r):this.matches.add(e,i,!1))}testString(e,n,r,i){e.isNamed(n)&&(r?this.subwalks.add(e,r):this.matches.add(e,i,!1))}};ni.Processor=UT});var ZR=m(as=>{"use strict";Object.defineProperty(as,"__esModule",{value:!0});as.GlobStream=as.GlobWalker=as.GlobUtil=void 0;var R5=LT(),JR=BT(),QR=YR(),P5=(t,e)=>typeof t=="string"?new JR.Ignore([t],e):Array.isArray(t)?new JR.Ignore(t,e):t,bl=class{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#e=[];#t;#s;signal;maxDepth;includeChildMatches;constructor(e,n,r){if(this.patterns=e,this.path=n,this.opts=r,this.#s=!r.posix&&r.platform==="win32"?"\\":"/",this.includeChildMatches=r.includeChildMatches!==!1,(r.ignore||!this.includeChildMatches)&&(this.#t=P5(r.ignore??[],r),!this.includeChildMatches&&typeof this.#t.add!="function")){let i="cannot ignore child matches, ignore lacks add() method.";throw new Error(i)}this.maxDepth=r.maxDepth||1/0,r.signal&&(this.signal=r.signal,this.signal.addEventListener("abort",()=>{this.#e.length=0}))}#r(e){return this.seen.has(e)||!!this.#t?.ignored?.(e)}#o(e){return!!this.#t?.childrenIgnored?.(e)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let e;for(;!this.paused&&(e=this.#e.shift());)e()}onResume(e){this.signal?.aborted||(this.paused?this.#e.push(e):e())}async matchCheck(e,n){if(n&&this.opts.nodir)return;let r;if(this.opts.realpath){if(r=e.realpathCached()||await e.realpath(),!r)return;e=r}let s=e.isUnknown()||this.opts.stat?await e.lstat():e;if(this.opts.follow&&this.opts.nodir&&s?.isSymbolicLink()){let o=await s.realpath();o&&(o.isUnknown()||this.opts.stat)&&await o.lstat()}return this.matchCheckTest(s,n)}matchCheckTest(e,n){return e&&(this.maxDepth===1/0||e.depth()<=this.maxDepth)&&(!n||e.canReaddir())&&(!this.opts.nodir||!e.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!e.isSymbolicLink()||!e.realpathCached()?.isDirectory())&&!this.#r(e)?e:void 0}matchCheckSync(e,n){if(n&&this.opts.nodir)return;let r;if(this.opts.realpath){if(r=e.realpathCached()||e.realpathSync(),!r)return;e=r}let s=e.isUnknown()||this.opts.stat?e.lstatSync():e;if(this.opts.follow&&this.opts.nodir&&s?.isSymbolicLink()){let o=s.realpathSync();o&&(o?.isUnknown()||this.opts.stat)&&o.lstatSync()}return this.matchCheckTest(s,n)}matchFinish(e,n){if(this.#r(e))return;if(!this.includeChildMatches&&this.#t?.add){let s=`${e.relativePosix()}/**`;this.#t.add(s)}let r=this.opts.absolute===void 0?n:this.opts.absolute;this.seen.add(e);let i=this.opts.mark&&e.isDirectory()?this.#s:"";if(this.opts.withFileTypes)this.matchEmit(e);else if(r){let s=this.opts.posix?e.fullpathPosix():e.fullpath();this.matchEmit(s+i)}else{let s=this.opts.posix?e.relativePosix():e.relative(),o=this.opts.dotRelative&&!s.startsWith(".."+this.#s)?"."+this.#s:"";this.matchEmit(s?o+s+i:"."+i)}}async match(e,n,r){let i=await this.matchCheck(e,r);i&&this.matchFinish(i,n)}matchSync(e,n,r){let i=this.matchCheckSync(e,r);i&&this.matchFinish(i,n)}walkCB(e,n,r){this.signal?.aborted&&r(),this.walkCB2(e,n,new QR.Processor(this.opts),r)}walkCB2(e,n,r,i){if(this.#o(e))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2(e,n,r,i));return}r.processPatterns(e,n);let s=1,o=()=>{--s===0&&i()};for(let[a,u,l]of r.matches.entries())this.#r(a)||(s++,this.match(a,u,l).then(()=>o()));for(let a of r.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;s++;let u=a.readdirCached();a.calledReaddir()?this.walkCB3(a,u,r,o):a.readdirCB((l,c)=>this.walkCB3(a,c,r,o),!0)}o()}walkCB3(e,n,r,i){r=r.filterEntries(e,n);let s=1,o=()=>{--s===0&&i()};for(let[a,u,l]of r.matches.entries())this.#r(a)||(s++,this.match(a,u,l).then(()=>o()));for(let[a,u]of r.subwalks.entries())s++,this.walkCB2(a,u,r.child(),o);o()}walkCBSync(e,n,r){this.signal?.aborted&&r(),this.walkCB2Sync(e,n,new QR.Processor(this.opts),r)}walkCB2Sync(e,n,r,i){if(this.#o(e))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2Sync(e,n,r,i));return}r.processPatterns(e,n);let s=1,o=()=>{--s===0&&i()};for(let[a,u,l]of r.matches.entries())this.#r(a)||this.matchSync(a,u,l);for(let a of r.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;s++;let u=a.readdirSync();this.walkCB3Sync(a,u,r,o)}o()}walkCB3Sync(e,n,r,i){r=r.filterEntries(e,n);let s=1,o=()=>{--s===0&&i()};for(let[a,u,l]of r.matches.entries())this.#r(a)||this.matchSync(a,u,l);for(let[a,u]of r.subwalks.entries())s++,this.walkCB2Sync(a,u,r.child(),o);o()}};as.GlobUtil=bl;var WT=class extends bl{matches=new Set;constructor(e,n,r){super(e,n,r)}matchEmit(e){this.matches.add(e)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((e,n)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?n(this.signal.reason):e(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}};as.GlobWalker=WT;var HT=class extends bl{results;constructor(e,n,r){super(e,n,r),this.results=new R5.Minipass({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(e){this.results.write(e),this.results.flowing||this.pause()}stream(){let e=this.path;return e.isUnknown()?e.lstat().then(()=>{this.walkCB(e,this.patterns,()=>this.results.end())}):this.walkCB(e,this.patterns,()=>this.results.end()),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}};as.GlobStream=HT});var KT=m(gp=>{"use strict";Object.defineProperty(gp,"__esModule",{value:!0});gp.Glob=void 0;var D5=is(),I5=require("node:url"),dp=zR(),M5=FT(),pp=ZR(),L5=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",GT=class{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(e,n){if(!n)throw new TypeError("glob options required");if(this.withFileTypes=!!n.withFileTypes,this.signal=n.signal,this.follow=!!n.follow,this.dot=!!n.dot,this.dotRelative=!!n.dotRelative,this.nodir=!!n.nodir,this.mark=!!n.mark,n.cwd?(n.cwd instanceof URL||n.cwd.startsWith("file://"))&&(n.cwd=(0,I5.fileURLToPath)(n.cwd)):this.cwd="",this.cwd=n.cwd||"",this.root=n.root,this.magicalBraces=!!n.magicalBraces,this.nobrace=!!n.nobrace,this.noext=!!n.noext,this.realpath=!!n.realpath,this.absolute=n.absolute,this.includeChildMatches=n.includeChildMatches!==!1,this.noglobstar=!!n.noglobstar,this.matchBase=!!n.matchBase,this.maxDepth=typeof n.maxDepth=="number"?n.maxDepth:1/0,this.stat=!!n.stat,this.ignore=n.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof e=="string"&&(e=[e]),this.windowsPathsNoEscape=!!n.windowsPathsNoEscape||n.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(e=e.map(u=>u.replace(/\\/g,"/"))),this.matchBase){if(n.noglobstar)throw new TypeError("base matching requires globstar");e=e.map(u=>u.includes("/")?u:`./**/${u}`)}if(this.pattern=e,this.platform=n.platform||L5,this.opts={...n,platform:this.platform},n.scurry){if(this.scurry=n.scurry,n.nocase!==void 0&&n.nocase!==n.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let u=n.platform==="win32"?dp.PathScurryWin32:n.platform==="darwin"?dp.PathScurryDarwin:n.platform?dp.PathScurryPosix:dp.PathScurry;this.scurry=new u(this.cwd,{nocase:n.nocase,fs:n.fs})}this.nocase=this.scurry.nocase;let r=this.platform==="darwin"||this.platform==="win32",i={...n,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:r,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},s=this.pattern.map(u=>new D5.Minimatch(u,i)),[o,a]=s.reduce((u,l)=>(u[0].push(...l.set),u[1].push(...l.globParts),u),[[],[]]);this.patterns=o.map((u,l)=>{let c=a[l];if(!c)throw new Error("invalid pattern object");return new M5.Pattern(u,c,0,this.platform)})}async walk(){return[...await new pp.GlobWalker(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new pp.GlobWalker(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new pp.GlobStream(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new pp.GlobStream(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}};gp.Glob=GT});var zT=m(mp=>{"use strict";Object.defineProperty(mp,"__esModule",{value:!0});mp.hasMagic=void 0;var N5=is(),q5=(t,e={})=>{Array.isArray(t)||(t=[t]);for(let n of t)if(new N5.Minimatch(n,e).hasMagic())return!0;return!1};mp.hasMagic=q5});var rP=m(Ae=>{"use strict";Object.defineProperty(Ae,"__esModule",{value:!0});Ae.glob=Ae.sync=Ae.iterate=Ae.iterateSync=Ae.stream=Ae.streamSync=Ae.Ignore=Ae.hasMagic=Ae.Glob=Ae.unescape=Ae.escape=void 0;Ae.globStreamSync=vl;Ae.globStream=VT;Ae.globSync=XT;Ae.globIterateSync=_l;Ae.globIterate=YT;var eP=is(),Ys=KT(),j5=zT(),nP=is();Object.defineProperty(Ae,"escape",{enumerable:!0,get:function(){return nP.escape}});Object.defineProperty(Ae,"unescape",{enumerable:!0,get:function(){return nP.unescape}});var F5=KT();Object.defineProperty(Ae,"Glob",{enumerable:!0,get:function(){return F5.Glob}});var $5=zT();Object.defineProperty(Ae,"hasMagic",{enumerable:!0,get:function(){return $5.hasMagic}});var B5=BT();Object.defineProperty(Ae,"Ignore",{enumerable:!0,get:function(){return B5.Ignore}});function vl(t,e={}){return new Ys.Glob(t,e).streamSync()}function VT(t,e={}){return new Ys.Glob(t,e).stream()}function XT(t,e={}){return new Ys.Glob(t,e).walkSync()}async function tP(t,e={}){return new Ys.Glob(t,e).walk()}function _l(t,e={}){return new Ys.Glob(t,e).iterateSync()}function YT(t,e={}){return new Ys.Glob(t,e).iterate()}Ae.streamSync=vl;Ae.stream=Object.assign(VT,{sync:vl});Ae.iterateSync=_l;Ae.iterate=Object.assign(YT,{sync:_l});Ae.sync=Object.assign(XT,{stream:vl,iterate:_l});Ae.glob=Object.assign(tP,{glob:tP,globSync:XT,sync:Ae.sync,globStream:VT,stream:Ae.stream,globStreamSync:vl,streamSync:Ae.streamSync,globIterate:YT,iterate:Ae.iterate,globIterateSync:_l,iterateSync:Ae.iterateSync,Glob:Ys.Glob,hasMagic:j5.hasMagic,escape:eP.escape,unescape:eP.unescape});Ae.glob.glob=Ae.glob});var sP=m(wa=>{"use strict";var QT=wa&&wa.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(wa,"__esModule",{value:!0});wa.FileSystem=void 0;var U5=vm(),iP=(JC(),gP(YC)),W5=QT(require("events")),yp=md(),H5=QT(require("fs")),G5=Ld(),K5=QT(Cd()),z5=rP(),JT=class extends W5.default{constructor(e){super(),this._context=e,this._textDocumentManager=new U5.TextDocuments(iP.TextDocument),this._tempTextDocumentCache=new K5.default({ttl:1e3,max:100})}async getWorkspaceFolderUris(){if(!this._context.features.workspaceFolder)return[];if(this._workspace==null)return[];let e=await this._workspace.getWorkspaceFolders();return e==null?[]:Array.from(new Set(e.map(n=>n.uri))).map(n=>yp.URI.parse(n))}async getWorkspaceFolderUri(e){return(await this.getWorkspaceFolderUris()).find(r=>e.path.startsWith(r.path))||null}async getWorkspaceRelatedFiles(){let e=this._context.getConfiguration(),n=e.fileExtensions,r=e.typeAnalyzer.exclude,i=await this.getWorkspaceFolderUris();return(await Promise.all(i.flatMap(async o=>(0,z5.glob)(n.map(a=>`**/*.${a}`),{cwd:o.fsPath,absolute:!0,ignore:r})))).flat().map(o=>yp.URI.file(o))}async findExistingPath(...e){if(e.length===0)return null;for(let n=0;n<e.length;n++)if(await this.getTextDocument(e[n])!=null)return e[n];return null}getAllTextDocuments(){return this._textDocumentManager.all()}async fetchTextDocument(e){let n=yp.URI.parse(e),r=this._tempTextDocumentCache.get(e);if(r!=null)return r;let i=null;try{let s=await H5.default.promises.readFile(n.fsPath,{encoding:"utf-8"});i=iP.TextDocument.create(e,G5.LanguageId,0,s)}catch{}return this._tempTextDocumentCache.set(e,i),i}async getTextDocument(e){let n=this._textDocumentManager.get(e);return n||(yp.URI.parse(e).scheme=="file"?await this.fetchTextDocument(e):null)}async readFile(e){return(await this.getTextDocument(e)).getText()}listen(e){this._workspace=e.workspace,this._textDocumentManager.listen(e),this._textDocumentManager.onDidOpen(n=>{this.emit("text-document-open",n.document)}),this._textDocumentManager.onDidChangeContent(n=>{this.emit("text-document-change",n.document)}),this._textDocumentManager.onDidClose(n=>{this.emit("text-document-close",n.document)})}};wa.FileSystem=JT});var oP=m(bp=>{"use strict";Object.defineProperty(bp,"__esModule",{value:!0});bp.NodeContext=void 0;var ZT=vm(),eS=Ld(),V5=sP(),tS=class extends eS.CoreContext{constructor(){super(),this.documentManager=new eS.DocumentManager().setContext(this),this.documentMerger=new eS.DocumentMerger,this.connection=(0,ZT.createConnection)(ZT.ProposedFeatures.all),this.fs=new V5.FileSystem(this)}createSemanticTokensBuilder(){return new ZT.SemanticTokensBuilder}};bp.NodeContext=tS});Object.defineProperty(exports,"__esModule",{value:!0});var X5=oP(),Pr=Ld(),aP=new X5.NodeContext;aP.on("ready",t=>{(0,Pr.activateAutocomplete)(t),(0,Pr.activateColor)(t),(0,Pr.activateDefinition)(t),(0,Pr.activateDiagnostic)(t),(0,Pr.activateFormatter)(t),(0,Pr.activateHover)(t),(0,Pr.activateSignature)(t),(0,Pr.activateSubscriptions)(t),(0,Pr.activateSymbol)(t),(0,Pr.activateSemantic)(t),(0,Pr.activateFoldingRange)(t)});aP.listen();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "miniscript-languageserver",
3
- "version": "1.7.3",
3
+ "version": "1.7.4",
4
4
  "description": "Language server for MiniScript",
5
5
  "main": "./index.js",
6
6
  "scripts": {
@@ -70,7 +70,7 @@
70
70
  "glob": "^11.0.0",
71
71
  "greybel-core": "~2.2.0",
72
72
  "greybel-transpiler": "~3.3.0",
73
- "miniscript-languageserver-core": "^1.6.4",
73
+ "miniscript-languageserver-core": "^1.6.5",
74
74
  "miniscript-meta": "~1.2.3",
75
75
  "miniscript-type-analyzer": "~0.17.1"
76
76
  }