@typespec/html-program-viewer 0.70.0-dev.2 → 0.70.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/emitter/index.js +12 -5
- package/dist/manifest-0K2D8hcR.js +6 -0
- package/dist/react/index.js +700 -516
- package/package.json +4 -4
- package/dist/manifest-uxZ2CVxd.js +0 -6
package/dist/react/index.js
CHANGED
|
@@ -28596,7 +28596,6 @@ createJSONSchemaValidator(TypeSpecConfigJsonSchema);
|
|
|
28596
28596
|
*
|
|
28597
28597
|
* @see {@link defineKit}
|
|
28598
28598
|
*
|
|
28599
|
-
* @experimental
|
|
28600
28599
|
* @internal
|
|
28601
28600
|
*/
|
|
28602
28601
|
const TypekitPrototype = {};
|
|
@@ -28605,8 +28604,6 @@ const TypekitNamespaceSymbol = Symbol.for("TypekitNamespace");
|
|
|
28605
28604
|
* Defines an extension to the Typekit interface.
|
|
28606
28605
|
*
|
|
28607
28606
|
* All Typekit instances will inherit the functionality defined by calls to this function.
|
|
28608
|
-
*
|
|
28609
|
-
* @experimental
|
|
28610
28607
|
*/
|
|
28611
28608
|
function defineKit(source) {
|
|
28612
28609
|
for (const [name, fnOrNs] of Object.entries(source)) {
|
|
@@ -28626,6 +28623,423 @@ function defineKit(source) {
|
|
|
28626
28623
|
}
|
|
28627
28624
|
}
|
|
28628
28625
|
|
|
28626
|
+
/**
|
|
28627
|
+
* Create a new Typekit that operates in the given realm.
|
|
28628
|
+
*
|
|
28629
|
+
* Ordinarily, you should use the default typekit `$` to manipulate types in the current program, or call `$` with a
|
|
28630
|
+
* Realm or Program as the first argument if you want to work in a specific realm or in the default typekit realm of
|
|
28631
|
+
* a specific program.
|
|
28632
|
+
*
|
|
28633
|
+
* @param realm - The realm to create the typekit in.
|
|
28634
|
+
*
|
|
28635
|
+
* @experimental
|
|
28636
|
+
*/
|
|
28637
|
+
function createTypekit(realm) {
|
|
28638
|
+
const tk = Object.create(TypekitPrototype);
|
|
28639
|
+
const handler = {
|
|
28640
|
+
get(target, prop, receiver) {
|
|
28641
|
+
if (prop === "program") {
|
|
28642
|
+
// don't wrap program (probably need to ensure this isn't a nested program somewhere)
|
|
28643
|
+
return realm.program;
|
|
28644
|
+
}
|
|
28645
|
+
if (prop === "realm") {
|
|
28646
|
+
return realm;
|
|
28647
|
+
}
|
|
28648
|
+
const value = Reflect.get(target, prop, receiver);
|
|
28649
|
+
// Wrap functions to set `this` correctly
|
|
28650
|
+
if (typeof value === "function") {
|
|
28651
|
+
const proxyWrapper = function (...args) {
|
|
28652
|
+
// Call the original function (`value`) with the correct `this` (the proxy)
|
|
28653
|
+
return value.apply(proxy, args);
|
|
28654
|
+
};
|
|
28655
|
+
// functions may also have properties added to them, like in the case of `withDiagnostics`.
|
|
28656
|
+
// Copy enumerable properties from the original function (`value`) to the wrapper
|
|
28657
|
+
for (const propName of Object.keys(value)) {
|
|
28658
|
+
const originalPropValue = value[propName];
|
|
28659
|
+
if (typeof originalPropValue === "function") {
|
|
28660
|
+
// If the property is a function, wrap it to ensure `this` is bound correctly
|
|
28661
|
+
proxyWrapper[propName] = function (...args) {
|
|
28662
|
+
// Call the original property function with `this` bound to the proxy
|
|
28663
|
+
return originalPropValue.apply(proxy, args);
|
|
28664
|
+
};
|
|
28665
|
+
}
|
|
28666
|
+
else {
|
|
28667
|
+
// If the property is not a function, copy it directly
|
|
28668
|
+
// Use Reflect.defineProperty to handle potential getters/setters correctly, though Object.keys usually only returns data properties.
|
|
28669
|
+
Reflect.defineProperty(proxyWrapper, propName, Reflect.getOwnPropertyDescriptor(value, propName));
|
|
28670
|
+
}
|
|
28671
|
+
}
|
|
28672
|
+
return proxyWrapper;
|
|
28673
|
+
}
|
|
28674
|
+
// Wrap objects to ensure their functions are bound correctly, avoid wrapping `get` accessors
|
|
28675
|
+
if (typeof value === "object" &&
|
|
28676
|
+
value !== null &&
|
|
28677
|
+
!Reflect.getOwnPropertyDescriptor(target, prop)?.get) {
|
|
28678
|
+
return new Proxy(value, handler);
|
|
28679
|
+
}
|
|
28680
|
+
return value;
|
|
28681
|
+
},
|
|
28682
|
+
};
|
|
28683
|
+
const proxy = new Proxy(tk, handler);
|
|
28684
|
+
return proxy;
|
|
28685
|
+
}
|
|
28686
|
+
|
|
28687
|
+
var _a;
|
|
28688
|
+
/**
|
|
28689
|
+
* A Realm's view of a Program's state map for a given state key.
|
|
28690
|
+
*
|
|
28691
|
+
* For all operations, if a type was created within the realm, the realm's own state map is used. Otherwise, the owning'
|
|
28692
|
+
* Program's state map is used.
|
|
28693
|
+
*
|
|
28694
|
+
* @experimental
|
|
28695
|
+
*/
|
|
28696
|
+
class StateMapRealmView {
|
|
28697
|
+
#realm;
|
|
28698
|
+
#parentState;
|
|
28699
|
+
#realmState;
|
|
28700
|
+
constructor(realm, realmState, parentState) {
|
|
28701
|
+
this.#realm = realm;
|
|
28702
|
+
this.#parentState = parentState;
|
|
28703
|
+
this.#realmState = realmState;
|
|
28704
|
+
}
|
|
28705
|
+
has(t) {
|
|
28706
|
+
return this.#select(t).has(t) ?? false;
|
|
28707
|
+
}
|
|
28708
|
+
set(t, v) {
|
|
28709
|
+
this.#select(t).set(t, v);
|
|
28710
|
+
return this;
|
|
28711
|
+
}
|
|
28712
|
+
get(t) {
|
|
28713
|
+
return this.#select(t).get(t);
|
|
28714
|
+
}
|
|
28715
|
+
delete(t) {
|
|
28716
|
+
return this.#select(t).delete(t);
|
|
28717
|
+
}
|
|
28718
|
+
forEach(cb, thisArg) {
|
|
28719
|
+
for (const item of this.entries()) {
|
|
28720
|
+
cb.call(thisArg, item[1], item[0], this);
|
|
28721
|
+
}
|
|
28722
|
+
return this;
|
|
28723
|
+
}
|
|
28724
|
+
get size() {
|
|
28725
|
+
return this.#realmState.size + this.#parentState.size;
|
|
28726
|
+
}
|
|
28727
|
+
clear() {
|
|
28728
|
+
this.#realmState.clear();
|
|
28729
|
+
}
|
|
28730
|
+
*entries() {
|
|
28731
|
+
for (const item of this.#realmState) {
|
|
28732
|
+
yield item;
|
|
28733
|
+
}
|
|
28734
|
+
for (const item of this.#parentState) {
|
|
28735
|
+
yield item;
|
|
28736
|
+
}
|
|
28737
|
+
return undefined;
|
|
28738
|
+
}
|
|
28739
|
+
*values() {
|
|
28740
|
+
for (const item of this.entries()) {
|
|
28741
|
+
yield item[1];
|
|
28742
|
+
}
|
|
28743
|
+
return undefined;
|
|
28744
|
+
}
|
|
28745
|
+
*keys() {
|
|
28746
|
+
for (const item of this.entries()) {
|
|
28747
|
+
yield item[0];
|
|
28748
|
+
}
|
|
28749
|
+
return undefined;
|
|
28750
|
+
}
|
|
28751
|
+
[Symbol.iterator]() {
|
|
28752
|
+
return this.entries();
|
|
28753
|
+
}
|
|
28754
|
+
[Symbol.toStringTag] = "StateMap";
|
|
28755
|
+
#select(keyType) {
|
|
28756
|
+
if (this.#realm.hasType(keyType)) {
|
|
28757
|
+
return this.#realmState;
|
|
28758
|
+
}
|
|
28759
|
+
return this.#parentState;
|
|
28760
|
+
}
|
|
28761
|
+
}
|
|
28762
|
+
/**
|
|
28763
|
+
* A Realm is an alternate view of a Program where types can be cloned, deleted, and modified without affecting the
|
|
28764
|
+
* original types in the Program.
|
|
28765
|
+
*
|
|
28766
|
+
* The realm stores the types that exist within the realm, views of state maps that only apply within the realm,
|
|
28767
|
+
* and a view of types that have been removed from the realm's view.
|
|
28768
|
+
*
|
|
28769
|
+
* @experimental
|
|
28770
|
+
*/
|
|
28771
|
+
class Realm {
|
|
28772
|
+
#program;
|
|
28773
|
+
/**
|
|
28774
|
+
* Stores all types owned by this realm.
|
|
28775
|
+
*/
|
|
28776
|
+
#types = new Set();
|
|
28777
|
+
/**
|
|
28778
|
+
* Stores types that are deleted in this realm. When a realm is active and doing a traversal, you will
|
|
28779
|
+
* not find this type in e.g. collections. Deleted types are mapped to `null` if you ask for it.
|
|
28780
|
+
*/
|
|
28781
|
+
#deletedTypes = new WeakSet();
|
|
28782
|
+
#stateMaps = new Map();
|
|
28783
|
+
key;
|
|
28784
|
+
/**
|
|
28785
|
+
* Create a new realm in the given program.
|
|
28786
|
+
*
|
|
28787
|
+
* @param program - The program to create the realm in.
|
|
28788
|
+
* @param description - A short description of the realm's purpose.
|
|
28789
|
+
*/
|
|
28790
|
+
constructor(program, description) {
|
|
28791
|
+
this.key = Symbol(description);
|
|
28792
|
+
this.#program = program;
|
|
28793
|
+
}
|
|
28794
|
+
#_typekit;
|
|
28795
|
+
/**
|
|
28796
|
+
* The typekit instance bound to this realm.
|
|
28797
|
+
*
|
|
28798
|
+
* If the realm does not already have a typekit associated with it, one will be created and bound to this realm.
|
|
28799
|
+
*/
|
|
28800
|
+
get typekit() {
|
|
28801
|
+
return (this.#_typekit ??= createTypekit(this));
|
|
28802
|
+
}
|
|
28803
|
+
/**
|
|
28804
|
+
* The program that this realm is associated with.
|
|
28805
|
+
*/
|
|
28806
|
+
get program() {
|
|
28807
|
+
return this.#program;
|
|
28808
|
+
}
|
|
28809
|
+
/**
|
|
28810
|
+
* Gets a state map for the given state key symbol.
|
|
28811
|
+
*
|
|
28812
|
+
* This state map is a view of the program's state map for the given state key, with modifications made to the realm's
|
|
28813
|
+
* own state.
|
|
28814
|
+
*
|
|
28815
|
+
* @param stateKey - The symbol to use as the state key.
|
|
28816
|
+
* @returns The realm's state map for the given state key.
|
|
28817
|
+
*/
|
|
28818
|
+
stateMap(stateKey) {
|
|
28819
|
+
let m = this.#stateMaps.get(stateKey);
|
|
28820
|
+
if (!m) {
|
|
28821
|
+
m = new Map();
|
|
28822
|
+
this.#stateMaps.set(stateKey, m);
|
|
28823
|
+
}
|
|
28824
|
+
return new StateMapRealmView(this, m, this.#program.stateMap(stateKey));
|
|
28825
|
+
}
|
|
28826
|
+
/**
|
|
28827
|
+
* Clones a type and adds it to the realm. This operation will use the realm's typekit to clone the type.
|
|
28828
|
+
*
|
|
28829
|
+
* @param type - The type to clone.
|
|
28830
|
+
* @returns A clone of the input type that exists within this realm.
|
|
28831
|
+
*/
|
|
28832
|
+
clone(type) {
|
|
28833
|
+
compilerAssert(type, "Undefined type passed to clone");
|
|
28834
|
+
const clone = this.#cloneIntoRealm(type);
|
|
28835
|
+
this.typekit.type.finishType(clone);
|
|
28836
|
+
return clone;
|
|
28837
|
+
}
|
|
28838
|
+
/**
|
|
28839
|
+
* Removes a type from this realm. This operation will not affect the type in the program, only this realm's view
|
|
28840
|
+
* of the type.
|
|
28841
|
+
*
|
|
28842
|
+
* @param type - The TypeSpec type to remove from this realm.
|
|
28843
|
+
*/
|
|
28844
|
+
remove(type) {
|
|
28845
|
+
this.#deletedTypes.add(type);
|
|
28846
|
+
}
|
|
28847
|
+
/**
|
|
28848
|
+
* Determines whether or not this realm contains a given type.
|
|
28849
|
+
*
|
|
28850
|
+
* @param type - The type to check.
|
|
28851
|
+
* @returns true if the type was created within this realm or added to this realm, false otherwise.
|
|
28852
|
+
*/
|
|
28853
|
+
hasType(type) {
|
|
28854
|
+
return this.#types.has(type);
|
|
28855
|
+
}
|
|
28856
|
+
/**
|
|
28857
|
+
* Adds a type to this realm. Once a type is added to the realm, the realm considers it part of itself.
|
|
28858
|
+
*
|
|
28859
|
+
* A type can be present in multiple realms, but `Realm.realmForType` will only return the last realm that the type
|
|
28860
|
+
* was added to.
|
|
28861
|
+
*
|
|
28862
|
+
* @param type - The type to add to this realm.
|
|
28863
|
+
*/
|
|
28864
|
+
addType(type) {
|
|
28865
|
+
this.#types.add(type);
|
|
28866
|
+
_a.realmForType.set(type, this);
|
|
28867
|
+
}
|
|
28868
|
+
#cloneIntoRealm(type) {
|
|
28869
|
+
const clone = this.typekit.type.clone(type);
|
|
28870
|
+
this.#types.add(clone);
|
|
28871
|
+
_a.realmForType.set(clone, this);
|
|
28872
|
+
return clone;
|
|
28873
|
+
}
|
|
28874
|
+
// TODO better way?
|
|
28875
|
+
/** @internal */
|
|
28876
|
+
get types() {
|
|
28877
|
+
return this.#types;
|
|
28878
|
+
}
|
|
28879
|
+
static realmForType = singleton("Realm.realmForType", () => new WeakMap());
|
|
28880
|
+
}
|
|
28881
|
+
_a = Realm;
|
|
28882
|
+
/**
|
|
28883
|
+
* Create a singleton instance that is shared across the process.
|
|
28884
|
+
* This is to have a true singleton even if multiple instance of the compiler/library are loaded.
|
|
28885
|
+
* @param key - The key to use for the singleton.
|
|
28886
|
+
* @param init - The function to call to create the singleton.
|
|
28887
|
+
*/
|
|
28888
|
+
function singleton(key, init) {
|
|
28889
|
+
const sym = Symbol.for(key);
|
|
28890
|
+
if (!globalThis[sym]) {
|
|
28891
|
+
globalThis[sym] = init();
|
|
28892
|
+
}
|
|
28893
|
+
return globalThis[sym];
|
|
28894
|
+
}
|
|
28895
|
+
|
|
28896
|
+
/**
|
|
28897
|
+
* Filters the properties of a model by removing them from the model instance if
|
|
28898
|
+
* a given `filter` predicate is not satisfied.
|
|
28899
|
+
*
|
|
28900
|
+
* @param model - the model to filter properties on
|
|
28901
|
+
* @param filter - the predicate to filter properties with
|
|
28902
|
+
*/
|
|
28903
|
+
/**
|
|
28904
|
+
* Creates a unique symbol for storing state on objects
|
|
28905
|
+
* @param name The name/description of the state
|
|
28906
|
+
*/
|
|
28907
|
+
function createStateSymbol(name) {
|
|
28908
|
+
return Symbol.for(`TypeSpec.${name}`);
|
|
28909
|
+
}
|
|
28910
|
+
/**
|
|
28911
|
+
* Instantiate a NameTemplate string with the properties of a source object.
|
|
28912
|
+
*
|
|
28913
|
+
* @param formatString - The template string to format. It should contain placeholders in the form of {propertyName}.
|
|
28914
|
+
* @param sourceObject - The object containing the properties to replace in the template string.
|
|
28915
|
+
* @returns The formatted string with the placeholders replaced by the corresponding property values from the source object.
|
|
28916
|
+
*/
|
|
28917
|
+
function replaceTemplatedStringFromProperties(formatString, sourceObject) {
|
|
28918
|
+
// Template parameters are not valid source objects, just skip them
|
|
28919
|
+
if (sourceObject.kind === "TemplateParameter") {
|
|
28920
|
+
return formatString;
|
|
28921
|
+
}
|
|
28922
|
+
return formatString.replace(/{(\w+)}/g, (_, propName) => {
|
|
28923
|
+
return sourceObject[propName];
|
|
28924
|
+
});
|
|
28925
|
+
}
|
|
28926
|
+
|
|
28927
|
+
function useStateMap(key) {
|
|
28928
|
+
const getter = (program, target) => program.stateMap(key).get(target);
|
|
28929
|
+
const setter = (program, target, value) => program.stateMap(key).set(target, value);
|
|
28930
|
+
const mapGetter = (program) => program.stateMap(key);
|
|
28931
|
+
return [getter, setter, mapGetter];
|
|
28932
|
+
}
|
|
28933
|
+
function useStateSet(key) {
|
|
28934
|
+
const getter = (program, target) => program.stateSet(key).has(target);
|
|
28935
|
+
const setter = (program, target) => program.stateSet(key).add(target);
|
|
28936
|
+
return [getter, setter];
|
|
28937
|
+
}
|
|
28938
|
+
|
|
28939
|
+
// Contains all intrinsic data setter or getter
|
|
28940
|
+
// Anything that the TypeSpec check might should be here.
|
|
28941
|
+
const stateKeys = {
|
|
28942
|
+
minValues: createStateSymbol("minValues"),
|
|
28943
|
+
maxValues: createStateSymbol("maxValues"),
|
|
28944
|
+
minValueExclusive: createStateSymbol("minValueExclusive"),
|
|
28945
|
+
maxValueExclusive: createStateSymbol("maxValueExclusive"),
|
|
28946
|
+
minLength: createStateSymbol("minLengthValues"),
|
|
28947
|
+
maxLength: createStateSymbol("maxLengthValues"),
|
|
28948
|
+
minItems: createStateSymbol("minItems"),
|
|
28949
|
+
maxItems: createStateSymbol("maxItems"),
|
|
28950
|
+
docs: createStateSymbol("docs"),
|
|
28951
|
+
returnDocs: createStateSymbol("returnsDocs"),
|
|
28952
|
+
errorsDocs: createStateSymbol("errorDocs"),
|
|
28953
|
+
discriminator: createStateSymbol("discriminator"),
|
|
28954
|
+
};
|
|
28955
|
+
function getMinValueAsNumeric(program, target) {
|
|
28956
|
+
return program.stateMap(stateKeys.minValues).get(target);
|
|
28957
|
+
}
|
|
28958
|
+
function getMinValue(program, target) {
|
|
28959
|
+
return getMinValueAsNumeric(program, target)?.asNumber() ?? undefined;
|
|
28960
|
+
}
|
|
28961
|
+
function getMaxValueAsNumeric(program, target) {
|
|
28962
|
+
return program.stateMap(stateKeys.maxValues).get(target);
|
|
28963
|
+
}
|
|
28964
|
+
function getMaxValue(program, target) {
|
|
28965
|
+
return getMaxValueAsNumeric(program, target)?.asNumber() ?? undefined;
|
|
28966
|
+
}
|
|
28967
|
+
function getMinValueExclusiveAsNumeric(program, target) {
|
|
28968
|
+
return program.stateMap(stateKeys.minValueExclusive).get(target);
|
|
28969
|
+
}
|
|
28970
|
+
function getMinValueExclusive(program, target) {
|
|
28971
|
+
return getMinValueExclusiveAsNumeric(program, target)?.asNumber() ?? undefined;
|
|
28972
|
+
}
|
|
28973
|
+
function getMaxValueExclusiveAsNumeric(program, target) {
|
|
28974
|
+
return program.stateMap(stateKeys.maxValueExclusive).get(target);
|
|
28975
|
+
}
|
|
28976
|
+
function getMaxValueExclusive(program, target) {
|
|
28977
|
+
return getMaxValueExclusiveAsNumeric(program, target)?.asNumber() ?? undefined;
|
|
28978
|
+
}
|
|
28979
|
+
/**
|
|
28980
|
+
* Get the minimum length of a string type as a {@link Numeric} value.
|
|
28981
|
+
* @param program Current program
|
|
28982
|
+
* @param target Type with the `@minLength` decorator
|
|
28983
|
+
*/
|
|
28984
|
+
function getMinLengthAsNumeric(program, target) {
|
|
28985
|
+
return program.stateMap(stateKeys.minLength).get(target);
|
|
28986
|
+
}
|
|
28987
|
+
function getMinLength(program, target) {
|
|
28988
|
+
return getMinLengthAsNumeric(program, target)?.asNumber() ?? undefined;
|
|
28989
|
+
}
|
|
28990
|
+
/**
|
|
28991
|
+
* Get the minimum length of a string type as a {@link Numeric} value.
|
|
28992
|
+
* @param program Current program
|
|
28993
|
+
* @param target Type with the `@maxLength` decorator
|
|
28994
|
+
*/
|
|
28995
|
+
function getMaxLengthAsNumeric(program, target) {
|
|
28996
|
+
return program.stateMap(stateKeys.maxLength).get(target);
|
|
28997
|
+
}
|
|
28998
|
+
function getMaxLength(program, target) {
|
|
28999
|
+
return getMaxLengthAsNumeric(program, target)?.asNumber() ?? undefined;
|
|
29000
|
+
}
|
|
29001
|
+
function getMinItemsAsNumeric(program, target) {
|
|
29002
|
+
return program.stateMap(stateKeys.minItems).get(target);
|
|
29003
|
+
}
|
|
29004
|
+
function getMinItems(program, target) {
|
|
29005
|
+
return getMinItemsAsNumeric(program, target)?.asNumber() ?? undefined;
|
|
29006
|
+
}
|
|
29007
|
+
function getMaxItemsAsNumeric(program, target) {
|
|
29008
|
+
return program.stateMap(stateKeys.maxItems).get(target);
|
|
29009
|
+
}
|
|
29010
|
+
function getMaxItems(program, target) {
|
|
29011
|
+
return getMaxItemsAsNumeric(program, target)?.asNumber() ?? undefined;
|
|
29012
|
+
}
|
|
29013
|
+
/** @internal */
|
|
29014
|
+
function setDocData(program, target, key, data) {
|
|
29015
|
+
program.stateMap(getDocKey(key)).set(target, data);
|
|
29016
|
+
}
|
|
29017
|
+
function getDocKey(target) {
|
|
29018
|
+
switch (target) {
|
|
29019
|
+
case "self":
|
|
29020
|
+
return stateKeys.docs;
|
|
29021
|
+
case "returns":
|
|
29022
|
+
return stateKeys.returnDocs;
|
|
29023
|
+
case "errors":
|
|
29024
|
+
return stateKeys.errorsDocs;
|
|
29025
|
+
}
|
|
29026
|
+
}
|
|
29027
|
+
/**
|
|
29028
|
+
* @internal
|
|
29029
|
+
* Get the documentation information for the given type. In most cases you probably just want to use {@link getDoc}
|
|
29030
|
+
* @param program Program
|
|
29031
|
+
* @param target Type
|
|
29032
|
+
* @returns Doc data with source information.
|
|
29033
|
+
*/
|
|
29034
|
+
function getDocDataInternal(program, target, key) {
|
|
29035
|
+
return program.stateMap(getDocKey(key)).get(target);
|
|
29036
|
+
}
|
|
29037
|
+
function getDiscriminator(program, entity) {
|
|
29038
|
+
return program.stateMap(stateKeys.discriminator).get(entity);
|
|
29039
|
+
}
|
|
29040
|
+
const [getDiscriminatedOptions, setDiscriminatedOptions] = useStateMap(createStateSymbol("discriminated"));
|
|
29041
|
+
// #endregion
|
|
29042
|
+
|
|
28629
29043
|
/**
|
|
28630
29044
|
* Creates a diagnosable function wrapper.
|
|
28631
29045
|
*
|
|
@@ -28635,7 +29049,6 @@ function defineKit(source) {
|
|
|
28635
29049
|
*
|
|
28636
29050
|
* @param fn The function to wrap, which must return a tuple `[Result, readonly Diagnostic[]]`.
|
|
28637
29051
|
* @returns A function that ignores diagnostics by default, with a `withDiagnostics` method.
|
|
28638
|
-
* @experimental
|
|
28639
29052
|
*/
|
|
28640
29053
|
function createDiagnosable(fn) {
|
|
28641
29054
|
function wrapper(...args) {
|
|
@@ -28693,7 +29106,10 @@ function isTemplateDeclarationOrInstance(type) {
|
|
|
28693
29106
|
defineKit({
|
|
28694
29107
|
array: {
|
|
28695
29108
|
is(type) {
|
|
28696
|
-
return (type.
|
|
29109
|
+
return (type.entityKind === "Type" &&
|
|
29110
|
+
type.kind === "Model" &&
|
|
29111
|
+
isArrayModelType(this.program, type) &&
|
|
29112
|
+
type.properties.size === 0);
|
|
28697
29113
|
},
|
|
28698
29114
|
getElementType(type) {
|
|
28699
29115
|
if (!this.array.is(type)) {
|
|
@@ -28799,6 +29215,9 @@ defineKit({
|
|
|
28799
29215
|
isAssignableTo: createDiagnosable(function (source, target, diagnosticTarget) {
|
|
28800
29216
|
return this.program.checker.isTypeAssignableTo(source, target, diagnosticTarget ?? source);
|
|
28801
29217
|
}),
|
|
29218
|
+
resolve: createDiagnosable(function (reference) {
|
|
29219
|
+
return this.program.resolveTypeOrValueReference(reference);
|
|
29220
|
+
}),
|
|
28802
29221
|
},
|
|
28803
29222
|
});
|
|
28804
29223
|
|
|
@@ -28854,7 +29273,7 @@ defineKit({
|
|
|
28854
29273
|
return member;
|
|
28855
29274
|
},
|
|
28856
29275
|
is(type) {
|
|
28857
|
-
return type.kind === "EnumMember";
|
|
29276
|
+
return type.entityKind === "Type" && type.kind === "EnumMember";
|
|
28858
29277
|
},
|
|
28859
29278
|
},
|
|
28860
29279
|
});
|
|
@@ -28878,21 +29297,6 @@ function validateDecoratorUniqueOnNode(context, type, decorator) {
|
|
|
28878
29297
|
return true;
|
|
28879
29298
|
}
|
|
28880
29299
|
|
|
28881
|
-
/**
|
|
28882
|
-
* Filters the properties of a model by removing them from the model instance if
|
|
28883
|
-
* a given `filter` predicate is not satisfied.
|
|
28884
|
-
*
|
|
28885
|
-
* @param model - the model to filter properties on
|
|
28886
|
-
* @param filter - the predicate to filter properties with
|
|
28887
|
-
*/
|
|
28888
|
-
/**
|
|
28889
|
-
* Creates a unique symbol for storing state on objects
|
|
28890
|
-
* @param name The name/description of the state
|
|
28891
|
-
*/
|
|
28892
|
-
function createStateSymbol(name) {
|
|
28893
|
-
return Symbol.for(`TypeSpec.${name}`);
|
|
28894
|
-
}
|
|
28895
|
-
|
|
28896
29300
|
const deprecatedKey = createStateSymbol("deprecated");
|
|
28897
29301
|
/**
|
|
28898
29302
|
* Returns complete deprecation details for the given type or node
|
|
@@ -28950,122 +29354,6 @@ class DuplicateTracker {
|
|
|
28950
29354
|
}
|
|
28951
29355
|
}
|
|
28952
29356
|
|
|
28953
|
-
function useStateMap(key) {
|
|
28954
|
-
const getter = (program, target) => program.stateMap(key).get(target);
|
|
28955
|
-
const setter = (program, target, value) => program.stateMap(key).set(target, value);
|
|
28956
|
-
const mapGetter = (program) => program.stateMap(key);
|
|
28957
|
-
return [getter, setter, mapGetter];
|
|
28958
|
-
}
|
|
28959
|
-
function useStateSet(key) {
|
|
28960
|
-
const getter = (program, target) => program.stateSet(key).has(target);
|
|
28961
|
-
const setter = (program, target) => program.stateSet(key).add(target);
|
|
28962
|
-
return [getter, setter];
|
|
28963
|
-
}
|
|
28964
|
-
|
|
28965
|
-
// Contains all intrinsic data setter or getter
|
|
28966
|
-
// Anything that the TypeSpec check might should be here.
|
|
28967
|
-
const stateKeys = {
|
|
28968
|
-
minValues: createStateSymbol("minValues"),
|
|
28969
|
-
maxValues: createStateSymbol("maxValues"),
|
|
28970
|
-
minValueExclusive: createStateSymbol("minValueExclusive"),
|
|
28971
|
-
maxValueExclusive: createStateSymbol("maxValueExclusive"),
|
|
28972
|
-
minLength: createStateSymbol("minLengthValues"),
|
|
28973
|
-
maxLength: createStateSymbol("maxLengthValues"),
|
|
28974
|
-
minItems: createStateSymbol("minItems"),
|
|
28975
|
-
maxItems: createStateSymbol("maxItems"),
|
|
28976
|
-
docs: createStateSymbol("docs"),
|
|
28977
|
-
returnDocs: createStateSymbol("returnsDocs"),
|
|
28978
|
-
errorsDocs: createStateSymbol("errorDocs"),
|
|
28979
|
-
discriminator: createStateSymbol("discriminator"),
|
|
28980
|
-
};
|
|
28981
|
-
function getMinValueAsNumeric(program, target) {
|
|
28982
|
-
return program.stateMap(stateKeys.minValues).get(target);
|
|
28983
|
-
}
|
|
28984
|
-
function getMinValue(program, target) {
|
|
28985
|
-
return getMinValueAsNumeric(program, target)?.asNumber() ?? undefined;
|
|
28986
|
-
}
|
|
28987
|
-
function getMaxValueAsNumeric(program, target) {
|
|
28988
|
-
return program.stateMap(stateKeys.maxValues).get(target);
|
|
28989
|
-
}
|
|
28990
|
-
function getMaxValue(program, target) {
|
|
28991
|
-
return getMaxValueAsNumeric(program, target)?.asNumber() ?? undefined;
|
|
28992
|
-
}
|
|
28993
|
-
function getMinValueExclusiveAsNumeric(program, target) {
|
|
28994
|
-
return program.stateMap(stateKeys.minValueExclusive).get(target);
|
|
28995
|
-
}
|
|
28996
|
-
function getMinValueExclusive(program, target) {
|
|
28997
|
-
return getMinValueExclusiveAsNumeric(program, target)?.asNumber() ?? undefined;
|
|
28998
|
-
}
|
|
28999
|
-
function getMaxValueExclusiveAsNumeric(program, target) {
|
|
29000
|
-
return program.stateMap(stateKeys.maxValueExclusive).get(target);
|
|
29001
|
-
}
|
|
29002
|
-
function getMaxValueExclusive(program, target) {
|
|
29003
|
-
return getMaxValueExclusiveAsNumeric(program, target)?.asNumber() ?? undefined;
|
|
29004
|
-
}
|
|
29005
|
-
/**
|
|
29006
|
-
* Get the minimum length of a string type as a {@link Numeric} value.
|
|
29007
|
-
* @param program Current program
|
|
29008
|
-
* @param target Type with the `@minLength` decorator
|
|
29009
|
-
*/
|
|
29010
|
-
function getMinLengthAsNumeric(program, target) {
|
|
29011
|
-
return program.stateMap(stateKeys.minLength).get(target);
|
|
29012
|
-
}
|
|
29013
|
-
function getMinLength(program, target) {
|
|
29014
|
-
return getMinLengthAsNumeric(program, target)?.asNumber() ?? undefined;
|
|
29015
|
-
}
|
|
29016
|
-
/**
|
|
29017
|
-
* Get the minimum length of a string type as a {@link Numeric} value.
|
|
29018
|
-
* @param program Current program
|
|
29019
|
-
* @param target Type with the `@maxLength` decorator
|
|
29020
|
-
*/
|
|
29021
|
-
function getMaxLengthAsNumeric(program, target) {
|
|
29022
|
-
return program.stateMap(stateKeys.maxLength).get(target);
|
|
29023
|
-
}
|
|
29024
|
-
function getMaxLength(program, target) {
|
|
29025
|
-
return getMaxLengthAsNumeric(program, target)?.asNumber() ?? undefined;
|
|
29026
|
-
}
|
|
29027
|
-
function getMinItemsAsNumeric(program, target) {
|
|
29028
|
-
return program.stateMap(stateKeys.minItems).get(target);
|
|
29029
|
-
}
|
|
29030
|
-
function getMinItems(program, target) {
|
|
29031
|
-
return getMinItemsAsNumeric(program, target)?.asNumber() ?? undefined;
|
|
29032
|
-
}
|
|
29033
|
-
function getMaxItemsAsNumeric(program, target) {
|
|
29034
|
-
return program.stateMap(stateKeys.maxItems).get(target);
|
|
29035
|
-
}
|
|
29036
|
-
function getMaxItems(program, target) {
|
|
29037
|
-
return getMaxItemsAsNumeric(program, target)?.asNumber() ?? undefined;
|
|
29038
|
-
}
|
|
29039
|
-
/** @internal */
|
|
29040
|
-
function setDocData(program, target, key, data) {
|
|
29041
|
-
program.stateMap(getDocKey(key)).set(target, data);
|
|
29042
|
-
}
|
|
29043
|
-
function getDocKey(target) {
|
|
29044
|
-
switch (target) {
|
|
29045
|
-
case "self":
|
|
29046
|
-
return stateKeys.docs;
|
|
29047
|
-
case "returns":
|
|
29048
|
-
return stateKeys.returnDocs;
|
|
29049
|
-
case "errors":
|
|
29050
|
-
return stateKeys.errorsDocs;
|
|
29051
|
-
}
|
|
29052
|
-
}
|
|
29053
|
-
/**
|
|
29054
|
-
* @internal
|
|
29055
|
-
* Get the documentation information for the given type. In most cases you probably just want to use {@link getDoc}
|
|
29056
|
-
* @param program Program
|
|
29057
|
-
* @param target Type
|
|
29058
|
-
* @returns Doc data with source information.
|
|
29059
|
-
*/
|
|
29060
|
-
function getDocDataInternal(program, target, key) {
|
|
29061
|
-
return program.stateMap(getDocKey(key)).get(target);
|
|
29062
|
-
}
|
|
29063
|
-
function getDiscriminator(program, entity) {
|
|
29064
|
-
return program.stateMap(stateKeys.discriminator).get(entity);
|
|
29065
|
-
}
|
|
29066
|
-
const [getDiscriminatedOptions, setDiscriminatedOptions] = useStateMap(createStateSymbol("discriminated"));
|
|
29067
|
-
// #endregion
|
|
29068
|
-
|
|
29069
29357
|
function getDiscriminatedUnion(typeOrProgram, typeOrDiscriminator) {
|
|
29070
29358
|
return getDiscriminatedUnionForUnion(typeOrProgram, typeOrDiscriminator);
|
|
29071
29359
|
}
|
|
@@ -31056,15 +31344,6 @@ var MutatorFlow;
|
|
|
31056
31344
|
})(MutatorFlow || (MutatorFlow = {}));
|
|
31057
31345
|
// #endregion
|
|
31058
31346
|
|
|
31059
|
-
function replaceTemplatedStringFromProperties(formatString, sourceObject) {
|
|
31060
|
-
// Template parameters are not valid source objects, just skip them
|
|
31061
|
-
if (sourceObject.kind === "TemplateParameter") {
|
|
31062
|
-
return formatString;
|
|
31063
|
-
}
|
|
31064
|
-
return formatString.replace(/{(\w+)}/g, (_, propName) => {
|
|
31065
|
-
return sourceObject[propName];
|
|
31066
|
-
});
|
|
31067
|
-
}
|
|
31068
31347
|
const [getSummary, setSummary] = useStateMap(createStateSymbol("summary"));
|
|
31069
31348
|
/**
|
|
31070
31349
|
* @doc attaches a documentation string. Works great with multi-line string literals.
|
|
@@ -31144,7 +31423,7 @@ defineKit({
|
|
|
31144
31423
|
return en;
|
|
31145
31424
|
},
|
|
31146
31425
|
is(type) {
|
|
31147
|
-
return type.kind === "Enum";
|
|
31426
|
+
return type.entityKind === "Type" && type.kind === "Enum";
|
|
31148
31427
|
},
|
|
31149
31428
|
createFromUnion(type) {
|
|
31150
31429
|
if (!type.name) {
|
|
@@ -31190,6 +31469,9 @@ defineKit({
|
|
|
31190
31469
|
get void() {
|
|
31191
31470
|
return this.program.checker.voidType;
|
|
31192
31471
|
},
|
|
31472
|
+
is(entity) {
|
|
31473
|
+
return entity.entityKind === "Type" && entity.kind === "Intrinsic";
|
|
31474
|
+
},
|
|
31193
31475
|
},
|
|
31194
31476
|
});
|
|
31195
31477
|
|
|
@@ -31408,13 +31690,13 @@ defineKit({
|
|
|
31408
31690
|
});
|
|
31409
31691
|
},
|
|
31410
31692
|
isBoolean(type) {
|
|
31411
|
-
return type.kind === "Boolean";
|
|
31693
|
+
return type.entityKind === "Type" && type.kind === "Boolean";
|
|
31412
31694
|
},
|
|
31413
31695
|
isString(type) {
|
|
31414
|
-
return type.kind === "String";
|
|
31696
|
+
return type.entityKind === "Type" && type.kind === "String";
|
|
31415
31697
|
},
|
|
31416
31698
|
isNumeric(type) {
|
|
31417
|
-
return type.kind === "Number";
|
|
31699
|
+
return type.entityKind === "Type" && type.kind === "Number";
|
|
31418
31700
|
},
|
|
31419
31701
|
is(type) {
|
|
31420
31702
|
return (this.literal.isBoolean(type) || this.literal.isNumeric(type) || this.literal.isString(type));
|
|
@@ -31425,7 +31707,7 @@ defineKit({
|
|
|
31425
31707
|
defineKit({
|
|
31426
31708
|
modelProperty: {
|
|
31427
31709
|
is(type) {
|
|
31428
|
-
return type.kind === "ModelProperty";
|
|
31710
|
+
return type.entityKind === "Type" && type.kind === "ModelProperty";
|
|
31429
31711
|
},
|
|
31430
31712
|
getEncoding(type) {
|
|
31431
31713
|
return getEncode(this.program, type) ?? getEncode(this.program, type.type);
|
|
@@ -31449,7 +31731,7 @@ defineKit({
|
|
|
31449
31731
|
},
|
|
31450
31732
|
});
|
|
31451
31733
|
|
|
31452
|
-
const
|
|
31734
|
+
const indexCache = new Map();
|
|
31453
31735
|
defineKit({
|
|
31454
31736
|
model: {
|
|
31455
31737
|
create(desc) {
|
|
@@ -31467,7 +31749,7 @@ defineKit({
|
|
|
31467
31749
|
return model;
|
|
31468
31750
|
},
|
|
31469
31751
|
is(type) {
|
|
31470
|
-
return type.kind === "Model";
|
|
31752
|
+
return type.entityKind === "Type" && type.kind === "Model";
|
|
31471
31753
|
},
|
|
31472
31754
|
isExpresion(type) {
|
|
31473
31755
|
return type.name === "";
|
|
@@ -31475,30 +31757,30 @@ defineKit({
|
|
|
31475
31757
|
getEffectiveModel(model, filter) {
|
|
31476
31758
|
return getEffectiveModelType(this.program, model, filter);
|
|
31477
31759
|
},
|
|
31478
|
-
|
|
31479
|
-
if (
|
|
31480
|
-
return
|
|
31760
|
+
getIndexType(model) {
|
|
31761
|
+
if (indexCache.has(model)) {
|
|
31762
|
+
return indexCache.get(model);
|
|
31481
31763
|
}
|
|
31482
31764
|
if (!model.indexer) {
|
|
31483
31765
|
return undefined;
|
|
31484
31766
|
}
|
|
31485
31767
|
if (model.indexer.key.name === "string") {
|
|
31486
31768
|
const record = this.record.create(model.indexer.value);
|
|
31487
|
-
|
|
31769
|
+
indexCache.set(model, record);
|
|
31488
31770
|
return record;
|
|
31489
31771
|
}
|
|
31490
31772
|
if (model.indexer.key.name === "integer") {
|
|
31491
31773
|
const array = this.array.create(model.indexer.value);
|
|
31492
|
-
|
|
31774
|
+
indexCache.set(model, array);
|
|
31493
31775
|
return array;
|
|
31494
31776
|
}
|
|
31495
|
-
return
|
|
31777
|
+
return undefined;
|
|
31496
31778
|
},
|
|
31497
31779
|
getProperties(model, options = {}) {
|
|
31498
31780
|
// Add explicitly defined properties
|
|
31499
31781
|
const properties = copyMap(model.properties);
|
|
31500
31782
|
// Add discriminator property if it exists
|
|
31501
|
-
const discriminator = this.
|
|
31783
|
+
const discriminator = this.model.getDiscriminatedUnion(model);
|
|
31502
31784
|
if (discriminator) {
|
|
31503
31785
|
const discriminatorName = discriminator.propertyName;
|
|
31504
31786
|
properties.set(discriminatorName, this.modelProperty.create({ name: discriminatorName, type: this.builtin.string }));
|
|
@@ -31527,9 +31809,9 @@ defineKit({
|
|
|
31527
31809
|
return model.baseModel;
|
|
31528
31810
|
}
|
|
31529
31811
|
// model MyModel { ...Record<>} should be model with additional properties
|
|
31530
|
-
const
|
|
31531
|
-
if (
|
|
31532
|
-
return
|
|
31812
|
+
const indexType = this.model.getIndexType(model);
|
|
31813
|
+
if (indexType && this.record.is(indexType)) {
|
|
31814
|
+
return indexType;
|
|
31533
31815
|
}
|
|
31534
31816
|
if (model.baseModel) {
|
|
31535
31817
|
return this.model.getAdditionalPropertiesRecord(model.baseModel);
|
|
@@ -31549,7 +31831,7 @@ defineKit({
|
|
|
31549
31831
|
defineKit({
|
|
31550
31832
|
operation: {
|
|
31551
31833
|
is(type) {
|
|
31552
|
-
return type.kind === "Operation";
|
|
31834
|
+
return type.entityKind === "Type" && type.kind === "Operation";
|
|
31553
31835
|
},
|
|
31554
31836
|
getPagingMetadata: createDiagnosable(function (operation) {
|
|
31555
31837
|
return getPagingOperation(this.program, operation);
|
|
@@ -31578,7 +31860,10 @@ defineKit({
|
|
|
31578
31860
|
defineKit({
|
|
31579
31861
|
record: {
|
|
31580
31862
|
is(type) {
|
|
31581
|
-
return (type.
|
|
31863
|
+
return (type.entityKind === "Type" &&
|
|
31864
|
+
type.kind === "Model" &&
|
|
31865
|
+
isRecordModelType(this.program, type) &&
|
|
31866
|
+
type.properties.size === 0);
|
|
31582
31867
|
},
|
|
31583
31868
|
getElementType(type) {
|
|
31584
31869
|
if (!this.record.is(type)) {
|
|
@@ -31599,16 +31884,10 @@ defineKit({
|
|
|
31599
31884
|
},
|
|
31600
31885
|
});
|
|
31601
31886
|
|
|
31602
|
-
defineKit({
|
|
31603
|
-
resolve: createDiagnosable(function (reference) {
|
|
31604
|
-
return this.program.resolveTypeOrValueReference(reference);
|
|
31605
|
-
}),
|
|
31606
|
-
});
|
|
31607
|
-
|
|
31608
31887
|
defineKit({
|
|
31609
31888
|
scalar: {
|
|
31610
31889
|
is(type) {
|
|
31611
|
-
return type.kind === "Scalar";
|
|
31890
|
+
return type.entityKind === "Type" && type.kind === "Scalar";
|
|
31612
31891
|
},
|
|
31613
31892
|
extendsBoolean: extendsStdType("boolean"),
|
|
31614
31893
|
extendsBytes: extendsStdType("bytes"),
|
|
@@ -31696,7 +31975,7 @@ function extendsStdType(typeName) {
|
|
|
31696
31975
|
defineKit({
|
|
31697
31976
|
tuple: {
|
|
31698
31977
|
is(type) {
|
|
31699
|
-
return type.kind === "Tuple";
|
|
31978
|
+
return type.entityKind === "Type" && type.kind === "Tuple";
|
|
31700
31979
|
},
|
|
31701
31980
|
create(values = []) {
|
|
31702
31981
|
const tuple = this.program.checker.createType({
|
|
@@ -31710,17 +31989,38 @@ defineKit({
|
|
|
31710
31989
|
},
|
|
31711
31990
|
});
|
|
31712
31991
|
|
|
31992
|
+
/**
|
|
31993
|
+
* Simple utility function to capitalize a string.
|
|
31994
|
+
*/
|
|
31995
|
+
function capitalize(s) {
|
|
31996
|
+
return (s.charAt(0).toUpperCase() + s.slice(1));
|
|
31997
|
+
}
|
|
31998
|
+
|
|
31713
31999
|
/**
|
|
31714
32000
|
* Get a plausible name for the given type.
|
|
31715
32001
|
* @experimental
|
|
31716
32002
|
*/
|
|
31717
32003
|
function getPlausibleName(type) {
|
|
31718
|
-
let name = type.name;
|
|
31719
|
-
if (!name) {
|
|
31720
|
-
name = "TypeExpression"; // TODO: Implement automatic name generation based on the type context
|
|
31721
|
-
}
|
|
32004
|
+
let name = type.name ?? "TypeExpression";
|
|
31722
32005
|
if (isTemplateInstance(type)) {
|
|
31723
|
-
const namePrefix = type.templateMapper.args
|
|
32006
|
+
const namePrefix = type.templateMapper.args
|
|
32007
|
+
.map((a) => {
|
|
32008
|
+
if (a.entityKind === "Type") {
|
|
32009
|
+
switch (a.kind) {
|
|
32010
|
+
case "Scalar":
|
|
32011
|
+
const name = getPlausibleName(a);
|
|
32012
|
+
// Box<scalar> is not a scalar so capital case naming convention applies
|
|
32013
|
+
return capitalize(name);
|
|
32014
|
+
case "Model":
|
|
32015
|
+
case "Interface":
|
|
32016
|
+
case "Enum":
|
|
32017
|
+
case "Union":
|
|
32018
|
+
return getPlausibleName(a);
|
|
32019
|
+
}
|
|
32020
|
+
}
|
|
32021
|
+
return "name" in a ? a.name : "";
|
|
32022
|
+
})
|
|
32023
|
+
.join("_");
|
|
31724
32024
|
name = `${namePrefix}${name}`;
|
|
31725
32025
|
}
|
|
31726
32026
|
return name;
|
|
@@ -31728,6 +32028,9 @@ function getPlausibleName(type) {
|
|
|
31728
32028
|
|
|
31729
32029
|
defineKit({
|
|
31730
32030
|
type: {
|
|
32031
|
+
is(entity) {
|
|
32032
|
+
return entity.entityKind === "Type";
|
|
32033
|
+
},
|
|
31731
32034
|
finishType(type) {
|
|
31732
32035
|
this.program.checker.finishType(type);
|
|
31733
32036
|
},
|
|
@@ -31818,20 +32121,6 @@ defineKit({
|
|
|
31818
32121
|
getPlausibleName(type) {
|
|
31819
32122
|
return getPlausibleName(type);
|
|
31820
32123
|
},
|
|
31821
|
-
getDiscriminator(type) {
|
|
31822
|
-
let discriminator;
|
|
31823
|
-
if (this.model.is(type)) {
|
|
31824
|
-
discriminator = getDiscriminator(this.program, type);
|
|
31825
|
-
}
|
|
31826
|
-
else {
|
|
31827
|
-
const unionDiscriminator = ignoreDiagnostics(getDiscriminatedUnion(this.program, type));
|
|
31828
|
-
const propertyName = unionDiscriminator?.options.discriminatorPropertyName;
|
|
31829
|
-
if (propertyName) {
|
|
31830
|
-
discriminator = { propertyName };
|
|
31831
|
-
}
|
|
31832
|
-
}
|
|
31833
|
-
return discriminator;
|
|
31834
|
-
},
|
|
31835
32124
|
maxValue(type) {
|
|
31836
32125
|
return getMaxValue(this.program, type);
|
|
31837
32126
|
},
|
|
@@ -31919,7 +32208,7 @@ defineKit({
|
|
|
31919
32208
|
return variant;
|
|
31920
32209
|
},
|
|
31921
32210
|
is(type) {
|
|
31922
|
-
return type.kind === "UnionVariant";
|
|
32211
|
+
return type.entityKind === "Type" && type.kind === "UnionVariant";
|
|
31923
32212
|
},
|
|
31924
32213
|
},
|
|
31925
32214
|
});
|
|
@@ -31990,7 +32279,7 @@ defineKit({
|
|
|
31990
32279
|
});
|
|
31991
32280
|
},
|
|
31992
32281
|
is(type) {
|
|
31993
|
-
return type.kind === "Union";
|
|
32282
|
+
return type.entityKind === "Type" && type.kind === "Union";
|
|
31994
32283
|
},
|
|
31995
32284
|
isValidEnum(type) {
|
|
31996
32285
|
for (const variant of type.variants.values()) {
|
|
@@ -32035,15 +32324,7 @@ defineKit({
|
|
|
32035
32324
|
defineKit({
|
|
32036
32325
|
value: {
|
|
32037
32326
|
is(value) {
|
|
32038
|
-
|
|
32039
|
-
return (this.value.isString(type) ||
|
|
32040
|
-
this.value.isNumeric(type) ||
|
|
32041
|
-
this.value.isBoolean(type) ||
|
|
32042
|
-
this.value.isArray(type) ||
|
|
32043
|
-
this.value.isObject(type) ||
|
|
32044
|
-
this.value.isEnum(type) ||
|
|
32045
|
-
this.value.isNull(type) ||
|
|
32046
|
-
this.value.isScalar(type));
|
|
32327
|
+
return value.entityKind === "Value";
|
|
32047
32328
|
},
|
|
32048
32329
|
create(value) {
|
|
32049
32330
|
if (typeof value === "string") {
|
|
@@ -32085,106 +32366,45 @@ defineKit({
|
|
|
32085
32366
|
};
|
|
32086
32367
|
},
|
|
32087
32368
|
isBoolean(type) {
|
|
32088
|
-
return type.valueKind === "BooleanValue";
|
|
32089
|
-
},
|
|
32090
|
-
isString(type) {
|
|
32091
|
-
return type.valueKind === "StringValue";
|
|
32092
|
-
},
|
|
32093
|
-
isNumeric(type) {
|
|
32094
|
-
return type.valueKind === "NumericValue";
|
|
32095
|
-
},
|
|
32096
|
-
isArray(type) {
|
|
32097
|
-
return type.valueKind === "ArrayValue";
|
|
32098
|
-
},
|
|
32099
|
-
isObject(type) {
|
|
32100
|
-
return type.valueKind === "ObjectValue";
|
|
32101
|
-
},
|
|
32102
|
-
isEnum(type) {
|
|
32103
|
-
return type.valueKind === "EnumValue";
|
|
32104
|
-
},
|
|
32105
|
-
isNull(type) {
|
|
32106
|
-
return type.valueKind === "NullValue";
|
|
32107
|
-
},
|
|
32108
|
-
isScalar(type) {
|
|
32109
|
-
return type.valueKind === "ScalarValue";
|
|
32110
|
-
},
|
|
32111
|
-
isAssignableTo: createDiagnosable(function (source, target, diagnosticTarget) {
|
|
32112
|
-
return this.program.checker.isTypeAssignableTo(source, target, diagnosticTarget ?? source);
|
|
32113
|
-
}),
|
|
32114
|
-
resolve: createDiagnosable(function (reference, kind) {
|
|
32115
|
-
const [value, diagnostics] = this.program.resolveTypeOrValueReference(reference);
|
|
32116
|
-
if (value && !isValue(value)) {
|
|
32117
|
-
return [undefined, diagnostics];
|
|
32118
|
-
}
|
|
32119
|
-
if (value && kind && value.valueKind !== kind) {
|
|
32120
|
-
throw new Error(`Value kind mismatch: expected ${kind}, got ${value.valueKind}`);
|
|
32121
|
-
}
|
|
32122
|
-
return [value, diagnostics];
|
|
32123
|
-
}),
|
|
32124
|
-
},
|
|
32125
|
-
});
|
|
32126
|
-
|
|
32127
|
-
/**
|
|
32128
|
-
* Create a new Typekit that operates in the given realm.
|
|
32129
|
-
*
|
|
32130
|
-
* Ordinarily, you should use the default typekit `$` to manipulate types in the current program, or call `$` with a
|
|
32131
|
-
* Realm or Program as the first argument if you want to work in a specific realm or in the default typekit realm of
|
|
32132
|
-
* a specific program.
|
|
32133
|
-
*
|
|
32134
|
-
* @param realm - The realm to create the typekit in.
|
|
32135
|
-
*
|
|
32136
|
-
* @experimental
|
|
32137
|
-
*/
|
|
32138
|
-
function createTypekit(realm) {
|
|
32139
|
-
const tk = Object.create(TypekitPrototype);
|
|
32140
|
-
const handler = {
|
|
32141
|
-
get(target, prop, receiver) {
|
|
32142
|
-
if (prop === "program") {
|
|
32143
|
-
// don't wrap program (probably need to ensure this isn't a nested program somewhere)
|
|
32144
|
-
return realm.program;
|
|
32145
|
-
}
|
|
32146
|
-
if (prop === "realm") {
|
|
32147
|
-
return realm;
|
|
32148
|
-
}
|
|
32149
|
-
const value = Reflect.get(target, prop, receiver);
|
|
32150
|
-
// Wrap functions to set `this` correctly
|
|
32151
|
-
if (typeof value === "function") {
|
|
32152
|
-
const proxyWrapper = function (...args) {
|
|
32153
|
-
// Call the original function (`value`) with the correct `this` (the proxy)
|
|
32154
|
-
return value.apply(proxy, args);
|
|
32155
|
-
};
|
|
32156
|
-
// functions may also have properties added to them, like in the case of `withDiagnostics`.
|
|
32157
|
-
// Copy enumerable properties from the original function (`value`) to the wrapper
|
|
32158
|
-
for (const propName of Object.keys(value)) {
|
|
32159
|
-
const originalPropValue = value[propName];
|
|
32160
|
-
if (typeof originalPropValue === "function") {
|
|
32161
|
-
// If the property is a function, wrap it to ensure `this` is bound correctly
|
|
32162
|
-
proxyWrapper[propName] = function (...args) {
|
|
32163
|
-
// Call the original property function with `this` bound to the proxy
|
|
32164
|
-
return originalPropValue.apply(proxy, args);
|
|
32165
|
-
};
|
|
32166
|
-
}
|
|
32167
|
-
else {
|
|
32168
|
-
// If the property is not a function, copy it directly
|
|
32169
|
-
// Use Reflect.defineProperty to handle potential getters/setters correctly, though Object.keys usually only returns data properties.
|
|
32170
|
-
Reflect.defineProperty(proxyWrapper, propName, Reflect.getOwnPropertyDescriptor(value, propName));
|
|
32171
|
-
}
|
|
32172
|
-
}
|
|
32173
|
-
return proxyWrapper;
|
|
32369
|
+
return this.value.is(type) && type.valueKind === "BooleanValue";
|
|
32370
|
+
},
|
|
32371
|
+
isString(type) {
|
|
32372
|
+
return this.value.is(type) && type.valueKind === "StringValue";
|
|
32373
|
+
},
|
|
32374
|
+
isNumeric(type) {
|
|
32375
|
+
return this.value.is(type) && type.valueKind === "NumericValue";
|
|
32376
|
+
},
|
|
32377
|
+
isArray(type) {
|
|
32378
|
+
return this.value.is(type) && type.valueKind === "ArrayValue";
|
|
32379
|
+
},
|
|
32380
|
+
isObject(type) {
|
|
32381
|
+
return this.value.is(type) && type.valueKind === "ObjectValue";
|
|
32382
|
+
},
|
|
32383
|
+
isEnum(type) {
|
|
32384
|
+
return this.value.is(type) && type.valueKind === "EnumValue";
|
|
32385
|
+
},
|
|
32386
|
+
isNull(type) {
|
|
32387
|
+
return this.value.is(type) && type.valueKind === "NullValue";
|
|
32388
|
+
},
|
|
32389
|
+
isScalar(type) {
|
|
32390
|
+
return this.value.is(type) && type.valueKind === "ScalarValue";
|
|
32391
|
+
},
|
|
32392
|
+
isAssignableTo: createDiagnosable(function (source, target, diagnosticTarget) {
|
|
32393
|
+
return this.program.checker.isTypeAssignableTo(source, target, diagnosticTarget ?? source);
|
|
32394
|
+
}),
|
|
32395
|
+
resolve: createDiagnosable(function (reference, kind) {
|
|
32396
|
+
const [value, diagnostics] = this.program.resolveTypeOrValueReference(reference);
|
|
32397
|
+
if (value && !isValue(value)) {
|
|
32398
|
+
return [undefined, diagnostics];
|
|
32174
32399
|
}
|
|
32175
|
-
|
|
32176
|
-
|
|
32177
|
-
value !== null &&
|
|
32178
|
-
!Reflect.getOwnPropertyDescriptor(target, prop)?.get) {
|
|
32179
|
-
return new Proxy(value, handler);
|
|
32400
|
+
if (value && kind && value.valueKind !== kind) {
|
|
32401
|
+
throw new Error(`Value kind mismatch: expected ${kind}, got ${value.valueKind}`);
|
|
32180
32402
|
}
|
|
32181
|
-
return value;
|
|
32182
|
-
},
|
|
32183
|
-
}
|
|
32184
|
-
|
|
32185
|
-
|
|
32186
|
-
}
|
|
32187
|
-
// #region Default Typekit
|
|
32403
|
+
return [value, diagnostics];
|
|
32404
|
+
}),
|
|
32405
|
+
},
|
|
32406
|
+
});
|
|
32407
|
+
|
|
32188
32408
|
const DEFAULT_REALM = Symbol.for("TypeSpec.Typekit.DEFAULT_TYPEKIT_REALM");
|
|
32189
32409
|
function _$(arg) {
|
|
32190
32410
|
let realm;
|
|
@@ -32210,7 +32430,8 @@ function _$(arg) {
|
|
|
32210
32430
|
*
|
|
32211
32431
|
* @example
|
|
32212
32432
|
* ```ts
|
|
32213
|
-
* import {
|
|
32433
|
+
* import { Realm } from "@typespec/compiler/experimental";
|
|
32434
|
+
* import { $ } from "@typespec/compiler/typekit";
|
|
32214
32435
|
*
|
|
32215
32436
|
* const realm = new Realm(program, "my custom realm");
|
|
32216
32437
|
*
|
|
@@ -32219,226 +32440,14 @@ function _$(arg) {
|
|
|
32219
32440
|
*
|
|
32220
32441
|
* @example
|
|
32221
32442
|
* ```ts
|
|
32222
|
-
* import {
|
|
32443
|
+
* import { $ } from "@typespec/compiler/typekit";
|
|
32223
32444
|
*
|
|
32224
32445
|
* const clone = $(program).type.clone(inputType);
|
|
32225
32446
|
* ```
|
|
32226
32447
|
*
|
|
32227
32448
|
* @see {@link Realm}
|
|
32228
|
-
*
|
|
32229
|
-
* @experimental
|
|
32230
32449
|
*/
|
|
32231
32450
|
const $$1 = _$;
|
|
32232
|
-
// #endregion
|
|
32233
|
-
|
|
32234
|
-
var _a;
|
|
32235
|
-
/**
|
|
32236
|
-
* A Realm's view of a Program's state map for a given state key.
|
|
32237
|
-
*
|
|
32238
|
-
* For all operations, if a type was created within the realm, the realm's own state map is used. Otherwise, the owning'
|
|
32239
|
-
* Program's state map is used.
|
|
32240
|
-
*
|
|
32241
|
-
* @experimental
|
|
32242
|
-
*/
|
|
32243
|
-
class StateMapRealmView {
|
|
32244
|
-
#realm;
|
|
32245
|
-
#parentState;
|
|
32246
|
-
#realmState;
|
|
32247
|
-
constructor(realm, realmState, parentState) {
|
|
32248
|
-
this.#realm = realm;
|
|
32249
|
-
this.#parentState = parentState;
|
|
32250
|
-
this.#realmState = realmState;
|
|
32251
|
-
}
|
|
32252
|
-
has(t) {
|
|
32253
|
-
return this.#select(t).has(t) ?? false;
|
|
32254
|
-
}
|
|
32255
|
-
set(t, v) {
|
|
32256
|
-
this.#select(t).set(t, v);
|
|
32257
|
-
return this;
|
|
32258
|
-
}
|
|
32259
|
-
get(t) {
|
|
32260
|
-
return this.#select(t).get(t);
|
|
32261
|
-
}
|
|
32262
|
-
delete(t) {
|
|
32263
|
-
return this.#select(t).delete(t);
|
|
32264
|
-
}
|
|
32265
|
-
forEach(cb, thisArg) {
|
|
32266
|
-
for (const item of this.entries()) {
|
|
32267
|
-
cb.call(thisArg, item[1], item[0], this);
|
|
32268
|
-
}
|
|
32269
|
-
return this;
|
|
32270
|
-
}
|
|
32271
|
-
get size() {
|
|
32272
|
-
return this.#realmState.size + this.#parentState.size;
|
|
32273
|
-
}
|
|
32274
|
-
clear() {
|
|
32275
|
-
this.#realmState.clear();
|
|
32276
|
-
}
|
|
32277
|
-
*entries() {
|
|
32278
|
-
for (const item of this.#realmState) {
|
|
32279
|
-
yield item;
|
|
32280
|
-
}
|
|
32281
|
-
for (const item of this.#parentState) {
|
|
32282
|
-
yield item;
|
|
32283
|
-
}
|
|
32284
|
-
return undefined;
|
|
32285
|
-
}
|
|
32286
|
-
*values() {
|
|
32287
|
-
for (const item of this.entries()) {
|
|
32288
|
-
yield item[1];
|
|
32289
|
-
}
|
|
32290
|
-
return undefined;
|
|
32291
|
-
}
|
|
32292
|
-
*keys() {
|
|
32293
|
-
for (const item of this.entries()) {
|
|
32294
|
-
yield item[0];
|
|
32295
|
-
}
|
|
32296
|
-
return undefined;
|
|
32297
|
-
}
|
|
32298
|
-
[Symbol.iterator]() {
|
|
32299
|
-
return this.entries();
|
|
32300
|
-
}
|
|
32301
|
-
[Symbol.toStringTag] = "StateMap";
|
|
32302
|
-
#select(keyType) {
|
|
32303
|
-
if (this.#realm.hasType(keyType)) {
|
|
32304
|
-
return this.#realmState;
|
|
32305
|
-
}
|
|
32306
|
-
return this.#parentState;
|
|
32307
|
-
}
|
|
32308
|
-
}
|
|
32309
|
-
/**
|
|
32310
|
-
* A Realm is an alternate view of a Program where types can be cloned, deleted, and modified without affecting the
|
|
32311
|
-
* original types in the Program.
|
|
32312
|
-
*
|
|
32313
|
-
* The realm stores the types that exist within the realm, views of state maps that only apply within the realm,
|
|
32314
|
-
* and a view of types that have been removed from the realm's view.
|
|
32315
|
-
*
|
|
32316
|
-
* @experimental
|
|
32317
|
-
*/
|
|
32318
|
-
class Realm {
|
|
32319
|
-
#program;
|
|
32320
|
-
/**
|
|
32321
|
-
* Stores all types owned by this realm.
|
|
32322
|
-
*/
|
|
32323
|
-
#types = new Set();
|
|
32324
|
-
/**
|
|
32325
|
-
* Stores types that are deleted in this realm. When a realm is active and doing a traversal, you will
|
|
32326
|
-
* not find this type in e.g. collections. Deleted types are mapped to `null` if you ask for it.
|
|
32327
|
-
*/
|
|
32328
|
-
#deletedTypes = new WeakSet();
|
|
32329
|
-
#stateMaps = new Map();
|
|
32330
|
-
key;
|
|
32331
|
-
/**
|
|
32332
|
-
* Create a new realm in the given program.
|
|
32333
|
-
*
|
|
32334
|
-
* @param program - The program to create the realm in.
|
|
32335
|
-
* @param description - A short description of the realm's purpose.
|
|
32336
|
-
*/
|
|
32337
|
-
constructor(program, description) {
|
|
32338
|
-
this.key = Symbol(description);
|
|
32339
|
-
this.#program = program;
|
|
32340
|
-
}
|
|
32341
|
-
#_typekit;
|
|
32342
|
-
/**
|
|
32343
|
-
* The typekit instance bound to this realm.
|
|
32344
|
-
*
|
|
32345
|
-
* If the realm does not already have a typekit associated with it, one will be created and bound to this realm.
|
|
32346
|
-
*/
|
|
32347
|
-
get typekit() {
|
|
32348
|
-
return (this.#_typekit ??= createTypekit(this));
|
|
32349
|
-
}
|
|
32350
|
-
/**
|
|
32351
|
-
* The program that this realm is associated with.
|
|
32352
|
-
*/
|
|
32353
|
-
get program() {
|
|
32354
|
-
return this.#program;
|
|
32355
|
-
}
|
|
32356
|
-
/**
|
|
32357
|
-
* Gets a state map for the given state key symbol.
|
|
32358
|
-
*
|
|
32359
|
-
* This state map is a view of the program's state map for the given state key, with modifications made to the realm's
|
|
32360
|
-
* own state.
|
|
32361
|
-
*
|
|
32362
|
-
* @param stateKey - The symbol to use as the state key.
|
|
32363
|
-
* @returns The realm's state map for the given state key.
|
|
32364
|
-
*/
|
|
32365
|
-
stateMap(stateKey) {
|
|
32366
|
-
let m = this.#stateMaps.get(stateKey);
|
|
32367
|
-
if (!m) {
|
|
32368
|
-
m = new Map();
|
|
32369
|
-
this.#stateMaps.set(stateKey, m);
|
|
32370
|
-
}
|
|
32371
|
-
return new StateMapRealmView(this, m, this.#program.stateMap(stateKey));
|
|
32372
|
-
}
|
|
32373
|
-
/**
|
|
32374
|
-
* Clones a type and adds it to the realm. This operation will use the realm's typekit to clone the type.
|
|
32375
|
-
*
|
|
32376
|
-
* @param type - The type to clone.
|
|
32377
|
-
* @returns A clone of the input type that exists within this realm.
|
|
32378
|
-
*/
|
|
32379
|
-
clone(type) {
|
|
32380
|
-
compilerAssert(type, "Undefined type passed to clone");
|
|
32381
|
-
const clone = this.#cloneIntoRealm(type);
|
|
32382
|
-
this.typekit.type.finishType(clone);
|
|
32383
|
-
return clone;
|
|
32384
|
-
}
|
|
32385
|
-
/**
|
|
32386
|
-
* Removes a type from this realm. This operation will not affect the type in the program, only this realm's view
|
|
32387
|
-
* of the type.
|
|
32388
|
-
*
|
|
32389
|
-
* @param type - The TypeSpec type to remove from this realm.
|
|
32390
|
-
*/
|
|
32391
|
-
remove(type) {
|
|
32392
|
-
this.#deletedTypes.add(type);
|
|
32393
|
-
}
|
|
32394
|
-
/**
|
|
32395
|
-
* Determines whether or not this realm contains a given type.
|
|
32396
|
-
*
|
|
32397
|
-
* @param type - The type to check.
|
|
32398
|
-
* @returns true if the type was created within this realm or added to this realm, false otherwise.
|
|
32399
|
-
*/
|
|
32400
|
-
hasType(type) {
|
|
32401
|
-
return this.#types.has(type);
|
|
32402
|
-
}
|
|
32403
|
-
/**
|
|
32404
|
-
* Adds a type to this realm. Once a type is added to the realm, the realm considers it part of itself.
|
|
32405
|
-
*
|
|
32406
|
-
* A type can be present in multiple realms, but `Realm.realmForType` will only return the last realm that the type
|
|
32407
|
-
* was added to.
|
|
32408
|
-
*
|
|
32409
|
-
* @param type - The type to add to this realm.
|
|
32410
|
-
*/
|
|
32411
|
-
addType(type) {
|
|
32412
|
-
this.#types.add(type);
|
|
32413
|
-
_a.realmForType.set(type, this);
|
|
32414
|
-
}
|
|
32415
|
-
#cloneIntoRealm(type) {
|
|
32416
|
-
const clone = this.typekit.type.clone(type);
|
|
32417
|
-
this.#types.add(clone);
|
|
32418
|
-
_a.realmForType.set(clone, this);
|
|
32419
|
-
return clone;
|
|
32420
|
-
}
|
|
32421
|
-
// TODO better way?
|
|
32422
|
-
/** @internal */
|
|
32423
|
-
get types() {
|
|
32424
|
-
return this.#types;
|
|
32425
|
-
}
|
|
32426
|
-
static realmForType = singleton("Realm.realmForType", () => new WeakMap());
|
|
32427
|
-
}
|
|
32428
|
-
_a = Realm;
|
|
32429
|
-
/**
|
|
32430
|
-
* Create a singleton instance that is shared across the process.
|
|
32431
|
-
* This is to have a true singleton even if multiple instance of the compiler/library are loaded.
|
|
32432
|
-
* @param key - The key to use for the singleton.
|
|
32433
|
-
* @param init - The function to call to create the singleton.
|
|
32434
|
-
*/
|
|
32435
|
-
function singleton(key, init) {
|
|
32436
|
-
const sym = Symbol.for(key);
|
|
32437
|
-
if (!globalThis[sym]) {
|
|
32438
|
-
globalThis[sym] = init();
|
|
32439
|
-
}
|
|
32440
|
-
return globalThis[sym];
|
|
32441
|
-
}
|
|
32442
32451
|
|
|
32443
32452
|
/**
|
|
32444
32453
|
* The fixed set of options for each of the kinds of delimited lists in TypeSpec.
|
|
@@ -32873,6 +32882,181 @@ var ResolutionKind;
|
|
|
32873
32882
|
ResolutionKind[ResolutionKind["Constraint"] = 3] = "Constraint";
|
|
32874
32883
|
})(ResolutionKind || (ResolutionKind = {}));
|
|
32875
32884
|
|
|
32885
|
+
var yaml = {exports: {}};
|
|
32886
|
+
|
|
32887
|
+
var hasRequiredYaml;
|
|
32888
|
+
|
|
32889
|
+
function requireYaml () {
|
|
32890
|
+
if (hasRequiredYaml) return yaml.exports;
|
|
32891
|
+
hasRequiredYaml = 1;
|
|
32892
|
+
(function (module, exports) {
|
|
32893
|
+
(function(f){function e(){var i=f();return i.default||i}module.exports=e();})(function(){var Ti=Object.create;var yt=Object.defineProperty;var Ci=Object.getOwnPropertyDescriptor;var Mi=Object.getOwnPropertyNames;var ki=Object.getPrototypeOf,vi=Object.prototype.hasOwnProperty;var te=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),nr=(t,e)=>{for(var n in e)yt(t,n,{get:e[n],enumerable:true});},rr=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of Mi(e))!vi.call(t,s)&&s!==n&&yt(t,s,{get:()=>e[s],enumerable:!(r=Ci(e,s))||r.enumerable});return t};var sr=(t,e,n)=>(n=t!=null?Ti(ki(t)):{},rr(yt(n,"default",{value:t,enumerable:true}),t)),Ii=t=>rr(yt({},"__esModule",{value:true}),t);var le=te(U=>{var re={ANCHOR:"&",COMMENT:"#",TAG:"!",DIRECTIVES_END:"-",DOCUMENT_END:"."},lt={ALIAS:"ALIAS",BLANK_LINE:"BLANK_LINE",BLOCK_FOLDED:"BLOCK_FOLDED",BLOCK_LITERAL:"BLOCK_LITERAL",COMMENT:"COMMENT",DIRECTIVE:"DIRECTIVE",DOCUMENT:"DOCUMENT",FLOW_MAP:"FLOW_MAP",FLOW_SEQ:"FLOW_SEQ",MAP:"MAP",MAP_KEY:"MAP_KEY",MAP_VALUE:"MAP_VALUE",PLAIN:"PLAIN",QUOTE_DOUBLE:"QUOTE_DOUBLE",QUOTE_SINGLE:"QUOTE_SINGLE",SEQ:"SEQ",SEQ_ITEM:"SEQ_ITEM"},Ao="tag:yaml.org,2002:",To={MAP:"tag:yaml.org,2002:map",SEQ:"tag:yaml.org,2002:seq",STR:"tag:yaml.org,2002:str"};function Ps(t){let e=[0],n=t.indexOf(`
|
|
32894
|
+
`);for(;n!==-1;)n+=1,e.push(n),n=t.indexOf(`
|
|
32895
|
+
`,n);return e}function _s(t){let e,n;return typeof t=="string"?(e=Ps(t),n=t):(Array.isArray(t)&&(t=t[0]),t&&t.context&&(t.lineStarts||(t.lineStarts=Ps(t.context.src)),e=t.lineStarts,n=t.context.src)),{lineStarts:e,src:n}}function Tn(t,e){if(typeof t!="number"||t<0)return null;let{lineStarts:n,src:r}=_s(e);if(!n||!r||t>r.length)return null;for(let i=0;i<n.length;++i){let o=n[i];if(t<o)return {line:i,col:t-n[i-1]+1};if(t===o)return {line:i+1,col:1}}let s=n.length;return {line:s,col:t-n[s-1]+1}}function Co(t,e){let{lineStarts:n,src:r}=_s(e);if(!n||!(t>=1)||t>n.length)return null;let s=n[t-1],i=n[t];for(;i&&i>s&&r[i-1]===`
|
|
32896
|
+
`;)--i;return r.slice(s,i)}function Mo({start:t,end:e},n,r=80){let s=Co(t.line,n);if(!s)return null;let{col:i}=t;if(s.length>r)if(i<=r-10)s=s.substr(0,r-1)+"\u2026";else {let f=Math.round(r/2);s.length>i+f&&(s=s.substr(0,i+f-1)+"\u2026"),i-=s.length-r,s="\u2026"+s.substr(1-r);}let o=1,a="";e&&(e.line===t.line&&i+(e.col-t.col)<=r+1?o=e.col-t.col:(o=Math.min(s.length+1,r)-i,a="\u2026"));let c=i>1?" ".repeat(i-1):"",l="^".repeat(o);return `${s}
|
|
32897
|
+
${c}${l}${a}`}var Be=class t{static copy(e){return new t(e.start,e.end)}constructor(e,n){this.start=e,this.end=n||e;}isEmpty(){return typeof this.start!="number"||!this.end||this.end<=this.start}setOrigRange(e,n){let{start:r,end:s}=this;if(e.length===0||s<=e[0])return this.origStart=r,this.origEnd=s,n;let i=n;for(;i<e.length&&!(e[i]>r);)++i;this.origStart=r+i;let o=i;for(;i<e.length&&!(e[i]>=s);)++i;return this.origEnd=s+i,o}},se=class t{static addStringTerminator(e,n,r){if(r[r.length-1]===`
|
|
32898
|
+
`)return r;let s=t.endOfWhiteSpace(e,n);return s>=e.length||e[s]===`
|
|
32899
|
+
`?r+`
|
|
32900
|
+
`:r}static atDocumentBoundary(e,n,r){let s=e[n];if(!s)return true;let i=e[n-1];if(i&&i!==`
|
|
32901
|
+
`)return false;if(r){if(s!==r)return false}else if(s!==re.DIRECTIVES_END&&s!==re.DOCUMENT_END)return false;let o=e[n+1],a=e[n+2];if(o!==s||a!==s)return false;let c=e[n+3];return !c||c===`
|
|
32902
|
+
`||c===" "||c===" "}static endOfIdentifier(e,n){let r=e[n],s=r==="<",i=s?[`
|
|
32903
|
+
`," "," ",">"]:[`
|
|
32904
|
+
`," "," ","[","]","{","}",","];for(;r&&i.indexOf(r)===-1;)r=e[n+=1];return s&&r===">"&&(n+=1),n}static endOfIndent(e,n){let r=e[n];for(;r===" ";)r=e[n+=1];return n}static endOfLine(e,n){let r=e[n];for(;r&&r!==`
|
|
32905
|
+
`;)r=e[n+=1];return n}static endOfWhiteSpace(e,n){let r=e[n];for(;r===" "||r===" ";)r=e[n+=1];return n}static startOfLine(e,n){let r=e[n-1];if(r===`
|
|
32906
|
+
`)return n;for(;r&&r!==`
|
|
32907
|
+
`;)r=e[n-=1];return n+1}static endOfBlockIndent(e,n,r){let s=t.endOfIndent(e,r);if(s>r+n)return s;{let i=t.endOfWhiteSpace(e,s),o=e[i];if(!o||o===`
|
|
32908
|
+
`)return i}return null}static atBlank(e,n,r){let s=e[n];return s===`
|
|
32909
|
+
`||s===" "||s===" "||r&&!s}static nextNodeIsIndented(e,n,r){return !e||n<0?false:n>0?true:r&&e==="-"}static normalizeOffset(e,n){let r=e[n];return r?r!==`
|
|
32910
|
+
`&&e[n-1]===`
|
|
32911
|
+
`?n-1:t.endOfWhiteSpace(e,n):n}static foldNewline(e,n,r){let s=0,i=false,o="",a=e[n+1];for(;a===" "||a===" "||a===`
|
|
32912
|
+
`;){switch(a){case `
|
|
32913
|
+
`:s=0,n+=1,o+=`
|
|
32914
|
+
`;break;case " ":s<=r&&(i=true),n=t.endOfWhiteSpace(e,n+2)-1;break;case " ":s+=1,n+=1;break}a=e[n+1];}return o||(o=" "),a&&s<=r&&(i=true),{fold:o,offset:n,error:i}}constructor(e,n,r){Object.defineProperty(this,"context",{value:r||null,writable:true}),this.error=null,this.range=null,this.valueRange=null,this.props=n||[],this.type=e,this.value=null;}getPropValue(e,n,r){if(!this.context)return null;let{src:s}=this.context,i=this.props[e];return i&&s[i.start]===n?s.slice(i.start+(r?1:0),i.end):null}get anchor(){for(let e=0;e<this.props.length;++e){let n=this.getPropValue(e,re.ANCHOR,true);if(n!=null)return n}return null}get comment(){let e=[];for(let n=0;n<this.props.length;++n){let r=this.getPropValue(n,re.COMMENT,true);r!=null&&e.push(r);}return e.length>0?e.join(`
|
|
32915
|
+
`):null}commentHasRequiredWhitespace(e){let{src:n}=this.context;if(this.header&&e===this.header.end||!this.valueRange)return false;let{end:r}=this.valueRange;return e!==r||t.atBlank(n,r-1)}get hasComment(){if(this.context){let{src:e}=this.context;for(let n=0;n<this.props.length;++n)if(e[this.props[n].start]===re.COMMENT)return true}return false}get hasProps(){if(this.context){let{src:e}=this.context;for(let n=0;n<this.props.length;++n)if(e[this.props[n].start]!==re.COMMENT)return true}return false}get includesTrailingLines(){return false}get jsonLike(){return [lt.FLOW_MAP,lt.FLOW_SEQ,lt.QUOTE_DOUBLE,lt.QUOTE_SINGLE].indexOf(this.type)!==-1}get rangeAsLinePos(){if(!this.range||!this.context)return;let e=Tn(this.range.start,this.context.root);if(!e)return;let n=Tn(this.range.end,this.context.root);return {start:e,end:n}}get rawValue(){if(!this.valueRange||!this.context)return null;let{start:e,end:n}=this.valueRange;return this.context.src.slice(e,n)}get tag(){for(let e=0;e<this.props.length;++e){let n=this.getPropValue(e,re.TAG,false);if(n!=null){if(n[1]==="<")return {verbatim:n.slice(2,-1)};{let[r,s,i]=n.match(/^(.*!)([^!]*)$/);return {handle:s,suffix:i}}}}return null}get valueRangeContainsNewline(){if(!this.valueRange||!this.context)return false;let{start:e,end:n}=this.valueRange,{src:r}=this.context;for(let s=e;s<n;++s)if(r[s]===`
|
|
32916
|
+
`)return true;return false}parseComment(e){let{src:n}=this.context;if(n[e]===re.COMMENT){let r=t.endOfLine(n,e+1),s=new Be(e,r);return this.props.push(s),r}return e}setOrigRanges(e,n){return this.range&&(n=this.range.setOrigRange(e,n)),this.valueRange&&this.valueRange.setOrigRange(e,n),this.props.forEach(r=>r.setOrigRange(e,n)),n}toString(){let{context:{src:e},range:n,value:r}=this;if(r!=null)return r;let s=e.slice(n.start,n.end);return t.addStringTerminator(e,n.end,s)}},ye=class extends Error{constructor(e,n,r){if(!r||!(n instanceof se))throw new Error(`Invalid arguments for new ${e}`);super(),this.name=e,this.message=r,this.source=n;}makePretty(){if(!this.source)return;this.nodeType=this.source.type;let e=this.source.context&&this.source.context.root;if(typeof this.offset=="number"){this.range=new Be(this.offset,this.offset+1);let n=e&&Tn(this.offset,e);if(n){let r={line:n.line,col:n.col+1};this.linePos={start:n,end:r};}delete this.offset;}else this.range=this.source.range,this.linePos=this.source.rangeAsLinePos;if(this.linePos){let{line:n,col:r}=this.linePos.start;this.message+=` at line ${n}, column ${r}`;let s=e&&Mo(this.linePos,e);s&&(this.message+=`:
|
|
32917
|
+
|
|
32918
|
+
${s}
|
|
32919
|
+
`);}delete this.source;}},Cn=class extends ye{constructor(e,n){super("YAMLReferenceError",e,n);}},ft=class extends ye{constructor(e,n){super("YAMLSemanticError",e,n);}},Mn=class extends ye{constructor(e,n){super("YAMLSyntaxError",e,n);}},kn=class extends ye{constructor(e,n){super("YAMLWarning",e,n);}};function ko(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:true,configurable:true,writable:true}):t[e]=n,t}var vn=class t extends se{static endOfLine(e,n,r){let s=e[n],i=n;for(;s&&s!==`
|
|
32920
|
+
`&&!(r&&(s==="["||s==="]"||s==="{"||s==="}"||s===","));){let o=e[i+1];if(s===":"&&(!o||o===`
|
|
32921
|
+
`||o===" "||o===" "||r&&o===",")||(s===" "||s===" ")&&o==="#")break;i+=1,s=o;}return i}get strValue(){if(!this.valueRange||!this.context)return null;let{start:e,end:n}=this.valueRange,{src:r}=this.context,s=r[n-1];for(;e<n&&(s===`
|
|
32922
|
+
`||s===" "||s===" ");)s=r[--n-1];let i="";for(let a=e;a<n;++a){let c=r[a];if(c===`
|
|
32923
|
+
`){let{fold:l,offset:f}=se.foldNewline(r,a,-1);i+=l,a=f;}else if(c===" "||c===" "){let l=a,f=r[a+1];for(;a<n&&(f===" "||f===" ");)a+=1,f=r[a+1];f!==`
|
|
32924
|
+
`&&(i+=a>l?r.slice(l,a+1):c);}else i+=c;}let o=r[e];switch(o){case " ":{let a="Plain value cannot start with a tab character";return {errors:[new ft(this,a)],str:i}}case "@":case "`":{let a=`Plain value cannot start with reserved character ${o}`;return {errors:[new ft(this,a)],str:i}}default:return i}}parseBlockValue(e){let{indent:n,inFlow:r,src:s}=this.context,i=e,o=e;for(let a=s[i];a===`
|
|
32925
|
+
`&&!se.atDocumentBoundary(s,i+1);a=s[i]){let c=se.endOfBlockIndent(s,n,i+1);if(c===null||s[c]==="#")break;s[c]===`
|
|
32926
|
+
`?i=c:(o=t.endOfLine(s,c,r),i=o);}return this.valueRange.isEmpty()&&(this.valueRange.start=e),this.valueRange.end=o,o}parse(e,n){this.context=e;let{inFlow:r,src:s}=e,i=n,o=s[i];return o&&o!=="#"&&o!==`
|
|
32927
|
+
`&&(i=t.endOfLine(s,n,r)),this.valueRange=new Be(n,i),i=se.endOfWhiteSpace(s,i),i=this.parseComment(i),(!this.hasComment||this.valueRange.isEmpty())&&(i=this.parseBlockValue(i)),i}};U.Char=re;U.Node=se;U.PlainValue=vn;U.Range=Be;U.Type=lt;U.YAMLError=ye;U.YAMLReferenceError=Cn;U.YAMLSemanticError=ft;U.YAMLSyntaxError=Mn;U.YAMLWarning=kn;U._defineProperty=ko;U.defaultTagPrefix=Ao;U.defaultTags=To;});var Rs=te(xs=>{var u=le(),Se=class extends u.Node{constructor(){super(u.Type.BLANK_LINE);}get includesTrailingLines(){return true}parse(e,n){return this.context=e,this.range=new u.Range(n,n+1),n+1}},ut=class extends u.Node{constructor(e,n){super(e,n),this.node=null;}get includesTrailingLines(){return !!this.node&&this.node.includesTrailingLines}parse(e,n){this.context=e;let{parseNode:r,src:s}=e,{atLineStart:i,lineStart:o}=e;!i&&this.type===u.Type.SEQ_ITEM&&(this.error=new u.YAMLSemanticError(this,"Sequence items must not have preceding content on the same line"));let a=i?n-o:e.indent,c=u.Node.endOfWhiteSpace(s,n+1),l=s[c],f=l==="#",m=[],d=null;for(;l===`
|
|
32928
|
+
`||l==="#";){if(l==="#"){let h=u.Node.endOfLine(s,c+1);m.push(new u.Range(c,h)),c=h;}else {i=true,o=c+1;let h=u.Node.endOfWhiteSpace(s,o);s[h]===`
|
|
32929
|
+
`&&m.length===0&&(d=new Se,o=d.parse({src:s},o)),c=u.Node.endOfIndent(s,o);}l=s[c];}if(u.Node.nextNodeIsIndented(l,c-(o+a),this.type!==u.Type.SEQ_ITEM)?this.node=r({atLineStart:i,inCollection:false,indent:a,lineStart:o,parent:this},c):l&&o>n+1&&(c=o-1),this.node){if(d){let h=e.parent.items||e.parent.contents;h&&h.push(d);}m.length&&Array.prototype.push.apply(this.props,m),c=this.node.range.end;}else if(f){let h=m[0];this.props.push(h),c=h.end;}else c=u.Node.endOfLine(s,n+1);let y=this.node?this.node.valueRange.end:c;return this.valueRange=new u.Range(n,y),c}setOrigRanges(e,n){return n=super.setOrigRanges(e,n),this.node?this.node.setOrigRanges(e,n):n}toString(){let{context:{src:e},node:n,range:r,value:s}=this;if(s!=null)return s;let i=n?e.slice(r.start,n.range.start)+String(n):e.slice(r.start,r.end);return u.Node.addStringTerminator(e,r.end,i)}},Ee=class extends u.Node{constructor(){super(u.Type.COMMENT);}parse(e,n){this.context=e;let r=this.parseComment(n);return this.range=new u.Range(n,r),r}};function In(t){let e=t;for(;e instanceof ut;)e=e.node;if(!(e instanceof Bt))return null;let n=e.items.length,r=-1;for(let o=n-1;o>=0;--o){let a=e.items[o];if(a.type===u.Type.COMMENT){let{indent:c,lineStart:l}=a.context;if(c>0&&a.range.start>=l+c)break;r=o;}else if(a.type===u.Type.BLANK_LINE)r=o;else break}if(r===-1)return null;let s=e.items.splice(r,n-r),i=s[0].range.start;for(;e.range.end=i,e.valueRange&&e.valueRange.end>i&&(e.valueRange.end=i),e!==t;)e=e.context.parent;return s}var Bt=class t extends u.Node{static nextContentHasIndent(e,n,r){let s=u.Node.endOfLine(e,n)+1;n=u.Node.endOfWhiteSpace(e,s);let i=e[n];return i?n>=s+r?true:i!=="#"&&i!==`
|
|
32930
|
+
`?false:t.nextContentHasIndent(e,n,r):false}constructor(e){super(e.type===u.Type.SEQ_ITEM?u.Type.SEQ:u.Type.MAP);for(let r=e.props.length-1;r>=0;--r)if(e.props[r].start<e.context.lineStart){this.props=e.props.slice(0,r+1),e.props=e.props.slice(r+1);let s=e.props[0]||e.valueRange;e.range.start=s.start;break}this.items=[e];let n=In(e);n&&Array.prototype.push.apply(this.items,n);}get includesTrailingLines(){return this.items.length>0}parse(e,n){this.context=e;let{parseNode:r,src:s}=e,i=u.Node.startOfLine(s,n),o=this.items[0];o.context.parent=this,this.valueRange=u.Range.copy(o.valueRange);let a=o.range.start-o.context.lineStart,c=n;c=u.Node.normalizeOffset(s,c);let l=s[c],f=u.Node.endOfWhiteSpace(s,i)===c,m=false;for(;l;){for(;l===`
|
|
32931
|
+
`||l==="#";){if(f&&l===`
|
|
32932
|
+
`&&!m){let h=new Se;if(c=h.parse({src:s},c),this.valueRange.end=c,c>=s.length){l=null;break}this.items.push(h),c-=1;}else if(l==="#"){if(c<i+a&&!t.nextContentHasIndent(s,c,a))return c;let h=new Ee;if(c=h.parse({indent:a,lineStart:i,src:s},c),this.items.push(h),this.valueRange.end=c,c>=s.length){l=null;break}}if(i=c+1,c=u.Node.endOfIndent(s,i),u.Node.atBlank(s,c)){let h=u.Node.endOfWhiteSpace(s,c),g=s[h];(!g||g===`
|
|
32933
|
+
`||g==="#")&&(c=h);}l=s[c],f=true;}if(!l)break;if(c!==i+a&&(f||l!==":")){if(c<i+a){i>n&&(c=i);break}else if(!this.error){let h="All collection items must start at the same column";this.error=new u.YAMLSyntaxError(this,h);}}if(o.type===u.Type.SEQ_ITEM){if(l!=="-"){i>n&&(c=i);break}}else if(l==="-"&&!this.error){let h=s[c+1];if(!h||h===`
|
|
32934
|
+
`||h===" "||h===" "){let g="A collection cannot be both a mapping and a sequence";this.error=new u.YAMLSyntaxError(this,g);}}let d=r({atLineStart:f,inCollection:true,indent:a,lineStart:i,parent:this},c);if(!d)return c;if(this.items.push(d),this.valueRange.end=d.valueRange.end,c=u.Node.normalizeOffset(s,d.range.end),l=s[c],f=false,m=d.includesTrailingLines,l){let h=c-1,g=s[h];for(;g===" "||g===" ";)g=s[--h];g===`
|
|
32935
|
+
`&&(i=h+1,f=true);}let y=In(d);y&&Array.prototype.push.apply(this.items,y);}return c}setOrigRanges(e,n){return n=super.setOrigRanges(e,n),this.items.forEach(r=>{n=r.setOrigRanges(e,n);}),n}toString(){let{context:{src:e},items:n,range:r,value:s}=this;if(s!=null)return s;let i=e.slice(r.start,n[0].range.start)+String(n[0]);for(let o=1;o<n.length;++o){let a=n[o],{atLineStart:c,indent:l}=a.context;if(c)for(let f=0;f<l;++f)i+=" ";i+=String(a);}return u.Node.addStringTerminator(e,r.end,i)}},Pn=class extends u.Node{constructor(){super(u.Type.DIRECTIVE),this.name=null;}get parameters(){let e=this.rawValue;return e?e.trim().split(/[ \t]+/):[]}parseName(e){let{src:n}=this.context,r=e,s=n[r];for(;s&&s!==`
|
|
32936
|
+
`&&s!==" "&&s!==" ";)s=n[r+=1];return this.name=n.slice(e,r),r}parseParameters(e){let{src:n}=this.context,r=e,s=n[r];for(;s&&s!==`
|
|
32937
|
+
`&&s!=="#";)s=n[r+=1];return this.valueRange=new u.Range(e,r),r}parse(e,n){this.context=e;let r=this.parseName(n+1);return r=this.parseParameters(r),r=this.parseComment(r),this.range=new u.Range(n,r),r}},_n=class t extends u.Node{static startCommentOrEndBlankLine(e,n){let r=u.Node.endOfWhiteSpace(e,n),s=e[r];return s==="#"||s===`
|
|
32938
|
+
`?r:n}constructor(){super(u.Type.DOCUMENT),this.directives=null,this.contents=null,this.directivesEndMarker=null,this.documentEndMarker=null;}parseDirectives(e){let{src:n}=this.context;this.directives=[];let r=true,s=false,i=e;for(;!u.Node.atDocumentBoundary(n,i,u.Char.DIRECTIVES_END);)switch(i=t.startCommentOrEndBlankLine(n,i),n[i]){case `
|
|
32939
|
+
`:if(r){let o=new Se;i=o.parse({src:n},i),i<n.length&&this.directives.push(o);}else i+=1,r=true;break;case "#":{let o=new Ee;i=o.parse({src:n},i),this.directives.push(o),r=false;}break;case "%":{let o=new Pn;i=o.parse({parent:this,src:n},i),this.directives.push(o),s=true,r=false;}break;default:return s?this.error=new u.YAMLSemanticError(this,"Missing directives-end indicator line"):this.directives.length>0&&(this.contents=this.directives,this.directives=[]),i}return n[i]?(this.directivesEndMarker=new u.Range(i,i+3),i+3):(s?this.error=new u.YAMLSemanticError(this,"Missing directives-end indicator line"):this.directives.length>0&&(this.contents=this.directives,this.directives=[]),i)}parseContents(e){let{parseNode:n,src:r}=this.context;this.contents||(this.contents=[]);let s=e;for(;r[s-1]==="-";)s-=1;let i=u.Node.endOfWhiteSpace(r,e),o=s===e;for(this.valueRange=new u.Range(i);!u.Node.atDocumentBoundary(r,i,u.Char.DOCUMENT_END);){switch(r[i]){case `
|
|
32940
|
+
`:if(o){let a=new Se;i=a.parse({src:r},i),i<r.length&&this.contents.push(a);}else i+=1,o=true;s=i;break;case "#":{let a=new Ee;i=a.parse({src:r},i),this.contents.push(a),o=false;}break;default:{let a=u.Node.endOfIndent(r,i),l=n({atLineStart:o,indent:-1,inFlow:false,inCollection:false,lineStart:s,parent:this},a);if(!l)return this.valueRange.end=a;this.contents.push(l),i=l.range.end,o=false;let f=In(l);f&&Array.prototype.push.apply(this.contents,f);}}i=t.startCommentOrEndBlankLine(r,i);}if(this.valueRange.end=i,r[i]&&(this.documentEndMarker=new u.Range(i,i+3),i+=3,r[i])){if(i=u.Node.endOfWhiteSpace(r,i),r[i]==="#"){let a=new Ee;i=a.parse({src:r},i),this.contents.push(a);}switch(r[i]){case `
|
|
32941
|
+
`:i+=1;break;case void 0:break;default:this.error=new u.YAMLSyntaxError(this,"Document end marker line cannot have a non-comment suffix");}}return i}parse(e,n){e.root=this,this.context=e;let{src:r}=e,s=r.charCodeAt(n)===65279?n+1:n;return s=this.parseDirectives(s),s=this.parseContents(s),s}setOrigRanges(e,n){return n=super.setOrigRanges(e,n),this.directives.forEach(r=>{n=r.setOrigRanges(e,n);}),this.directivesEndMarker&&(n=this.directivesEndMarker.setOrigRange(e,n)),this.contents.forEach(r=>{n=r.setOrigRanges(e,n);}),this.documentEndMarker&&(n=this.documentEndMarker.setOrigRange(e,n)),n}toString(){let{contents:e,directives:n,value:r}=this;if(r!=null)return r;let s=n.join("");return e.length>0&&((n.length>0||e[0].type===u.Type.COMMENT)&&(s+=`---
|
|
32942
|
+
`),s+=e.join("")),s[s.length-1]!==`
|
|
32943
|
+
`&&(s+=`
|
|
32944
|
+
`),s}},xn=class extends u.Node{parse(e,n){this.context=e;let{src:r}=e,s=u.Node.endOfIdentifier(r,n+1);return this.valueRange=new u.Range(n+1,s),s=u.Node.endOfWhiteSpace(r,s),s=this.parseComment(s),s}},fe={CLIP:"CLIP",KEEP:"KEEP",STRIP:"STRIP"},Rn=class extends u.Node{constructor(e,n){super(e,n),this.blockIndent=null,this.chomping=fe.CLIP,this.header=null;}get includesTrailingLines(){return this.chomping===fe.KEEP}get strValue(){if(!this.valueRange||!this.context)return null;let{start:e,end:n}=this.valueRange,{indent:r,src:s}=this.context;if(this.valueRange.isEmpty())return "";let i=null,o=s[n-1];for(;o===`
|
|
32945
|
+
`||o===" "||o===" ";){if(n-=1,n<=e){if(this.chomping===fe.KEEP)break;return ""}o===`
|
|
32946
|
+
`&&(i=n),o=s[n-1];}let a=n+1;i&&(this.chomping===fe.KEEP?(a=i,n=this.valueRange.end):n=i);let c=r+this.blockIndent,l=this.type===u.Type.BLOCK_FOLDED,f=true,m="",d="",y=false;for(let h=e;h<n;++h){for(let w=0;w<c&&s[h]===" ";++w)h+=1;let g=s[h];if(g===`
|
|
32947
|
+
`)d===`
|
|
32948
|
+
`?m+=`
|
|
32949
|
+
`:d=`
|
|
32950
|
+
`;else {let w=u.Node.endOfLine(s,h),C=s.slice(h,w);h=w,l&&(g===" "||g===" ")&&h<a?(d===" "?d=`
|
|
32951
|
+
`:!y&&!f&&d===`
|
|
32952
|
+
`&&(d=`
|
|
32953
|
+
|
|
32954
|
+
`),m+=d+C,d=w<n&&s[w]||"",y=true):(m+=d+C,d=l&&h<a?" ":`
|
|
32955
|
+
`,y=false),f&&C!==""&&(f=false);}}return this.chomping===fe.STRIP?m:m+`
|
|
32956
|
+
`}parseBlockHeader(e){let{src:n}=this.context,r=e+1,s="";for(;;){let i=n[r];switch(i){case "-":this.chomping=fe.STRIP;break;case "+":this.chomping=fe.KEEP;break;case "0":case "1":case "2":case "3":case "4":case "5":case "6":case "7":case "8":case "9":s+=i;break;default:return this.blockIndent=Number(s)||null,this.header=new u.Range(e,r),r}r+=1;}}parseBlockValue(e){let{indent:n,src:r}=this.context,s=!!this.blockIndent,i=e,o=e,a=1;for(let c=r[i];c===`
|
|
32957
|
+
`&&(i+=1,!u.Node.atDocumentBoundary(r,i));c=r[i]){let l=u.Node.endOfBlockIndent(r,n,i);if(l===null)break;let f=r[l],m=l-(i+n);if(this.blockIndent){if(f&&f!==`
|
|
32958
|
+
`&&m<this.blockIndent){if(r[l]==="#")break;if(!this.error){let y=`Block scalars must not be less indented than their ${s?"explicit indentation indicator":"first line"}`;this.error=new u.YAMLSemanticError(this,y);}}}else if(r[l]!==`
|
|
32959
|
+
`){if(m<a){let d="Block scalars with more-indented leading empty lines must use an explicit indentation indicator";this.error=new u.YAMLSemanticError(this,d);}this.blockIndent=m;}else m>a&&(a=m);r[l]===`
|
|
32960
|
+
`?i=l:i=o=u.Node.endOfLine(r,l);}return this.chomping!==fe.KEEP&&(i=r[o]?o+1:o),this.valueRange=new u.Range(e+1,i),i}parse(e,n){this.context=e;let{src:r}=e,s=this.parseBlockHeader(n);return s=u.Node.endOfWhiteSpace(r,s),s=this.parseComment(s),s=this.parseBlockValue(s),s}setOrigRanges(e,n){return n=super.setOrigRanges(e,n),this.header?this.header.setOrigRange(e,n):n}},Dn=class extends u.Node{constructor(e,n){super(e,n),this.items=null;}prevNodeIsJsonLike(e=this.items.length){let n=this.items[e-1];return !!n&&(n.jsonLike||n.type===u.Type.COMMENT&&this.prevNodeIsJsonLike(e-1))}parse(e,n){this.context=e;let{parseNode:r,src:s}=e,{indent:i,lineStart:o}=e,a=s[n];this.items=[{char:a,offset:n}];let c=u.Node.endOfWhiteSpace(s,n+1);for(a=s[c];a&&a!=="]"&&a!=="}";){switch(a){case `
|
|
32961
|
+
`:{o=c+1;let l=u.Node.endOfWhiteSpace(s,o);if(s[l]===`
|
|
32962
|
+
`){let f=new Se;o=f.parse({src:s},o),this.items.push(f);}if(c=u.Node.endOfIndent(s,o),c<=o+i&&(a=s[c],c<o+i||a!=="]"&&a!=="}")){let f="Insufficient indentation in flow collection";this.error=new u.YAMLSemanticError(this,f);}}break;case ",":this.items.push({char:a,offset:c}),c+=1;break;case "#":{let l=new Ee;c=l.parse({src:s},c),this.items.push(l);}break;case "?":case ":":{let l=s[c+1];if(l===`
|
|
32963
|
+
`||l===" "||l===" "||l===","||a===":"&&this.prevNodeIsJsonLike()){this.items.push({char:a,offset:c}),c+=1;break}}default:{let l=r({atLineStart:false,inCollection:false,inFlow:true,indent:-1,lineStart:o,parent:this},c);if(!l)return this.valueRange=new u.Range(n,c),c;this.items.push(l),c=u.Node.normalizeOffset(s,l.range.end);}}c=u.Node.endOfWhiteSpace(s,c),a=s[c];}return this.valueRange=new u.Range(n,c+1),a&&(this.items.push({char:a,offset:c}),c=u.Node.endOfWhiteSpace(s,c+1),c=this.parseComment(c)),c}setOrigRanges(e,n){return n=super.setOrigRanges(e,n),this.items.forEach(r=>{if(r instanceof u.Node)n=r.setOrigRanges(e,n);else if(e.length===0)r.origOffset=r.offset;else {let s=n;for(;s<e.length&&!(e[s]>r.offset);)++s;r.origOffset=r.offset+s,n=s;}}),n}toString(){let{context:{src:e},items:n,range:r,value:s}=this;if(s!=null)return s;let i=n.filter(c=>c instanceof u.Node),o="",a=r.start;return i.forEach(c=>{let l=e.slice(a,c.range.start);a=c.range.end,o+=l+String(c),o[o.length-1]===`
|
|
32964
|
+
`&&e[a-1]!==`
|
|
32965
|
+
`&&e[a]===`
|
|
32966
|
+
`&&(a+=1);}),o+=e.slice(a,r.end),u.Node.addStringTerminator(e,r.end,o)}},Yn=class t extends u.Node{static endOfQuote(e,n){let r=e[n];for(;r&&r!=='"';)n+=r==="\\"?2:1,r=e[n];return n+1}get strValue(){if(!this.valueRange||!this.context)return null;let e=[],{start:n,end:r}=this.valueRange,{indent:s,src:i}=this.context;i[r-1]!=='"'&&e.push(new u.YAMLSyntaxError(this,'Missing closing "quote'));let o="";for(let a=n+1;a<r-1;++a){let c=i[a];if(c===`
|
|
32967
|
+
`){u.Node.atDocumentBoundary(i,a+1)&&e.push(new u.YAMLSemanticError(this,"Document boundary indicators are not allowed within string values"));let{fold:l,offset:f,error:m}=u.Node.foldNewline(i,a,s);o+=l,a=f,m&&e.push(new u.YAMLSemanticError(this,"Multi-line double-quoted string needs to be sufficiently indented"));}else if(c==="\\")switch(a+=1,i[a]){case "0":o+="\0";break;case "a":o+="\x07";break;case "b":o+="\b";break;case "e":o+="\x1B";break;case "f":o+="\f";break;case "n":o+=`
|
|
32968
|
+
`;break;case "r":o+="\r";break;case "t":o+=" ";break;case "v":o+="\v";break;case "N":o+="\x85";break;case "_":o+="\xA0";break;case "L":o+="\u2028";break;case "P":o+="\u2029";break;case " ":o+=" ";break;case '"':o+='"';break;case "/":o+="/";break;case "\\":o+="\\";break;case " ":o+=" ";break;case "x":o+=this.parseCharCode(a+1,2,e),a+=2;break;case "u":o+=this.parseCharCode(a+1,4,e),a+=4;break;case "U":o+=this.parseCharCode(a+1,8,e),a+=8;break;case `
|
|
32969
|
+
`:for(;i[a+1]===" "||i[a+1]===" ";)a+=1;break;default:e.push(new u.YAMLSyntaxError(this,`Invalid escape sequence ${i.substr(a-1,2)}`)),o+="\\"+i[a];}else if(c===" "||c===" "){let l=a,f=i[a+1];for(;f===" "||f===" ";)a+=1,f=i[a+1];f!==`
|
|
32970
|
+
`&&(o+=a>l?i.slice(l,a+1):c);}else o+=c;}return e.length>0?{errors:e,str:o}:o}parseCharCode(e,n,r){let{src:s}=this.context,i=s.substr(e,n),a=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;return isNaN(a)?(r.push(new u.YAMLSyntaxError(this,`Invalid escape sequence ${s.substr(e-2,n+2)}`)),s.substr(e-2,n+2)):String.fromCodePoint(a)}parse(e,n){this.context=e;let{src:r}=e,s=t.endOfQuote(r,n+1);return this.valueRange=new u.Range(n,s),s=u.Node.endOfWhiteSpace(r,s),s=this.parseComment(s),s}},$n=class t extends u.Node{static endOfQuote(e,n){let r=e[n];for(;r;)if(r==="'"){if(e[n+1]!=="'")break;r=e[n+=2];}else r=e[n+=1];return n+1}get strValue(){if(!this.valueRange||!this.context)return null;let e=[],{start:n,end:r}=this.valueRange,{indent:s,src:i}=this.context;i[r-1]!=="'"&&e.push(new u.YAMLSyntaxError(this,"Missing closing 'quote"));let o="";for(let a=n+1;a<r-1;++a){let c=i[a];if(c===`
|
|
32971
|
+
`){u.Node.atDocumentBoundary(i,a+1)&&e.push(new u.YAMLSemanticError(this,"Document boundary indicators are not allowed within string values"));let{fold:l,offset:f,error:m}=u.Node.foldNewline(i,a,s);o+=l,a=f,m&&e.push(new u.YAMLSemanticError(this,"Multi-line single-quoted string needs to be sufficiently indented"));}else if(c==="'")o+=c,a+=1,i[a]!=="'"&&e.push(new u.YAMLSyntaxError(this,"Unescaped single quote? This should not happen."));else if(c===" "||c===" "){let l=a,f=i[a+1];for(;f===" "||f===" ";)a+=1,f=i[a+1];f!==`
|
|
32972
|
+
`&&(o+=a>l?i.slice(l,a+1):c);}else o+=c;}return e.length>0?{errors:e,str:o}:o}parse(e,n){this.context=e;let{src:r}=e,s=t.endOfQuote(r,n+1);return this.valueRange=new u.Range(n,s),s=u.Node.endOfWhiteSpace(r,s),s=this.parseComment(s),s}};function vo(t,e){switch(t){case u.Type.ALIAS:return new xn(t,e);case u.Type.BLOCK_FOLDED:case u.Type.BLOCK_LITERAL:return new Rn(t,e);case u.Type.FLOW_MAP:case u.Type.FLOW_SEQ:return new Dn(t,e);case u.Type.MAP_KEY:case u.Type.MAP_VALUE:case u.Type.SEQ_ITEM:return new ut(t,e);case u.Type.COMMENT:case u.Type.PLAIN:return new u.PlainValue(t,e);case u.Type.QUOTE_DOUBLE:return new Yn(t,e);case u.Type.QUOTE_SINGLE:return new $n(t,e);default:return null}}var Bn=class t{static parseType(e,n,r){switch(e[n]){case "*":return u.Type.ALIAS;case ">":return u.Type.BLOCK_FOLDED;case "|":return u.Type.BLOCK_LITERAL;case "{":return u.Type.FLOW_MAP;case "[":return u.Type.FLOW_SEQ;case "?":return !r&&u.Node.atBlank(e,n+1,true)?u.Type.MAP_KEY:u.Type.PLAIN;case ":":return !r&&u.Node.atBlank(e,n+1,true)?u.Type.MAP_VALUE:u.Type.PLAIN;case "-":return !r&&u.Node.atBlank(e,n+1,true)?u.Type.SEQ_ITEM:u.Type.PLAIN;case '"':return u.Type.QUOTE_DOUBLE;case "'":return u.Type.QUOTE_SINGLE;default:return u.Type.PLAIN}}constructor(e={},{atLineStart:n,inCollection:r,inFlow:s,indent:i,lineStart:o,parent:a}={}){u._defineProperty(this,"parseNode",(c,l)=>{if(u.Node.atDocumentBoundary(this.src,l))return null;let f=new t(this,c),{props:m,type:d,valueStart:y}=f.parseProps(l),h=vo(d,m),g=h.parse(f,y);if(h.range=new u.Range(l,g),g<=l&&(h.error=new Error("Node#parse consumed no characters"),h.error.parseEnd=g,h.error.source=h,h.range.end=l+1),f.nodeStartsCollection(h)){!h.error&&!f.atLineStart&&f.parent.type===u.Type.DOCUMENT&&(h.error=new u.YAMLSyntaxError(h,"Block collection must not have preceding content here (e.g. directives-end indicator)"));let w=new Bt(h);return g=w.parse(new t(f),g),w.range=new u.Range(l,g),w}return h}),this.atLineStart=n??(e.atLineStart||false),this.inCollection=r??(e.inCollection||false),this.inFlow=s??(e.inFlow||false),this.indent=i??e.indent,this.lineStart=o??e.lineStart,this.parent=a??(e.parent||{}),this.root=e.root,this.src=e.src;}nodeStartsCollection(e){let{inCollection:n,inFlow:r,src:s}=this;if(n||r)return false;if(e instanceof ut)return true;let i=e.range.end;return s[i]===`
|
|
32973
|
+
`||s[i-1]===`
|
|
32974
|
+
`?false:(i=u.Node.endOfWhiteSpace(s,i),s[i]===":")}parseProps(e){let{inFlow:n,parent:r,src:s}=this,i=[],o=false;e=this.atLineStart?u.Node.endOfIndent(s,e):u.Node.endOfWhiteSpace(s,e);let a=s[e];for(;a===u.Char.ANCHOR||a===u.Char.COMMENT||a===u.Char.TAG||a===`
|
|
32975
|
+
`;){if(a===`
|
|
32976
|
+
`){let l=e,f;do f=l+1,l=u.Node.endOfIndent(s,f);while(s[l]===`
|
|
32977
|
+
`);let m=l-(f+this.indent),d=r.type===u.Type.SEQ_ITEM&&r.context.atLineStart;if(s[l]!=="#"&&!u.Node.nextNodeIsIndented(s[l],m,!d))break;this.atLineStart=true,this.lineStart=f,o=false,e=l;}else if(a===u.Char.COMMENT){let l=u.Node.endOfLine(s,e+1);i.push(new u.Range(e,l)),e=l;}else {let l=u.Node.endOfIdentifier(s,e+1);a===u.Char.TAG&&s[l]===","&&/^[a-zA-Z0-9-]+\.[a-zA-Z0-9-]+,\d\d\d\d(-\d\d){0,2}\/\S/.test(s.slice(e+1,l+13))&&(l=u.Node.endOfIdentifier(s,l+5)),i.push(new u.Range(e,l)),o=true,e=u.Node.endOfWhiteSpace(s,l);}a=s[e];}o&&a===":"&&u.Node.atBlank(s,e+1,true)&&(e-=1);let c=t.parseType(s,e,n);return {props:i,type:c,valueStart:e}}};function Io(t){let e=[];t.indexOf("\r")!==-1&&(t=t.replace(/\r\n?/g,(s,i)=>(s.length>1&&e.push(i),`
|
|
32978
|
+
`)));let n=[],r=0;do{let s=new _n,i=new Bn({src:t});r=s.parse(i,r),n.push(s);}while(r<t.length);return n.setOrigRanges=()=>{if(e.length===0)return false;for(let i=1;i<e.length;++i)e[i]-=i;let s=0;for(let i=0;i<n.length;++i)s=n[i].setOrigRanges(e,s);return e.splice(0,e.length),true},n.toString=()=>n.join(`...
|
|
32979
|
+
`),n}xs.parse=Io;});var qe=te(k=>{var p=le();function Po(t,e,n){return n?`#${n.replace(/[\s\S]^/gm,`$&${e}#`)}
|
|
32980
|
+
${e}${t}`:t}function Fe(t,e,n){return n?n.indexOf(`
|
|
32981
|
+
`)===-1?`${t} #${n}`:`${t}
|
|
32982
|
+
`+n.replace(/^/gm,`${e||""}#`):t}var W=class{};function ue(t,e,n){if(Array.isArray(t))return t.map((r,s)=>ue(r,String(s),n));if(t&&typeof t.toJSON=="function"){let r=n&&n.anchors&&n.anchors.get(t);r&&(n.onCreate=i=>{r.res=i,delete n.onCreate;});let s=t.toJSON(e,n);return r&&n.onCreate&&n.onCreate(s),s}return (!n||!n.keep)&&typeof t=="bigint"?Number(t):t}var P=class extends W{constructor(e){super(),this.value=e;}toJSON(e,n){return n&&n.keep?this.value:ue(this.value,e,n)}toString(){return String(this.value)}};function Ds(t,e,n){let r=n;for(let s=e.length-1;s>=0;--s){let i=e[s];if(Number.isInteger(i)&&i>=0){let o=[];o[i]=r,r=o;}else {let o={};Object.defineProperty(o,i,{value:r,writable:true,enumerable:true,configurable:true}),r=o;}}return t.createNode(r,false)}var Bs=t=>t==null||typeof t=="object"&&t[Symbol.iterator]().next().done,j=class t extends W{constructor(e){super(),p._defineProperty(this,"items",[]),this.schema=e;}addIn(e,n){if(Bs(e))this.add(n);else {let[r,...s]=e,i=this.get(r,true);if(i instanceof t)i.addIn(s,n);else if(i===void 0&&this.schema)this.set(r,Ds(this.schema,s,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${s}`)}}deleteIn([e,...n]){if(n.length===0)return this.delete(e);let r=this.get(e,true);if(r instanceof t)return r.deleteIn(n);throw new Error(`Expected YAML collection at ${e}. Remaining path: ${n}`)}getIn([e,...n],r){let s=this.get(e,true);return n.length===0?!r&&s instanceof P?s.value:s:s instanceof t?s.getIn(n,r):void 0}hasAllNullValues(){return this.items.every(e=>{if(!e||e.type!=="PAIR")return false;let n=e.value;return n==null||n instanceof P&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn([e,...n]){if(n.length===0)return this.has(e);let r=this.get(e,true);return r instanceof t?r.hasIn(n):false}setIn([e,...n],r){if(n.length===0)this.set(e,r);else {let s=this.get(e,true);if(s instanceof t)s.setIn(n,r);else if(s===void 0&&this.schema)this.set(e,Ds(this.schema,n,r));else throw new Error(`Expected YAML collection at ${e}. Remaining path: ${n}`)}}toJSON(){return null}toString(e,{blockItem:n,flowChars:r,isMap:s,itemIndent:i},o,a){let{indent:c,indentStep:l,stringify:f}=e,m=this.type===p.Type.FLOW_MAP||this.type===p.Type.FLOW_SEQ||e.inFlow;m&&(i+=l);let d=s&&this.hasAllNullValues();e=Object.assign({},e,{allNullValues:d,indent:i,inFlow:m,type:null});let y=false,h=false,g=this.items.reduce((C,L,M)=>{let A;L&&(!y&&L.spaceBefore&&C.push({type:"comment",str:""}),L.commentBefore&&L.commentBefore.match(/^.*$/gm).forEach(Ai=>{C.push({type:"comment",str:`#${Ai}`});}),L.comment&&(A=L.comment),m&&(!y&&L.spaceBefore||L.commentBefore||L.comment||L.key&&(L.key.commentBefore||L.key.comment)||L.value&&(L.value.commentBefore||L.value.comment))&&(h=true)),y=false;let _=f(L,e,()=>A=null,()=>y=true);return m&&!h&&_.includes(`
|
|
32983
|
+
`)&&(h=true),m&&M<this.items.length-1&&(_+=","),_=Fe(_,i,A),y&&(A||m)&&(y=false),C.push({type:"item",str:_}),C},[]),w;if(g.length===0)w=r.start+r.end;else if(m){let{start:C,end:L}=r,M=g.map(A=>A.str);if(h||M.reduce((A,_)=>A+_.length+2,2)>t.maxFlowStringSingleLineLength){w=C;for(let A of M)w+=A?`
|
|
32984
|
+
${l}${c}${A}`:`
|
|
32985
|
+
`;w+=`
|
|
32986
|
+
${c}${L}`;}else w=`${C} ${M.join(" ")} ${L}`;}else {let C=g.map(n);w=C.shift();for(let L of C)w+=L?`
|
|
32987
|
+
${c}${L}`:`
|
|
32988
|
+
`;}return this.comment?(w+=`
|
|
32989
|
+
`+this.comment.replace(/^/gm,`${c}#`),o&&o()):y&&a&&a(),w}};p._defineProperty(j,"maxFlowStringSingleLineLength",60);function Ft(t){let e=t instanceof P?t.value:t;return e&&typeof e=="string"&&(e=Number(e)),Number.isInteger(e)&&e>=0?e:null}var pe=class extends j{add(e){this.items.push(e);}delete(e){let n=Ft(e);return typeof n!="number"?false:this.items.splice(n,1).length>0}get(e,n){let r=Ft(e);if(typeof r!="number")return;let s=this.items[r];return !n&&s instanceof P?s.value:s}has(e){let n=Ft(e);return typeof n=="number"&&n<this.items.length}set(e,n){let r=Ft(e);if(typeof r!="number")throw new Error(`Expected a valid index, not ${e}.`);this.items[r]=n;}toJSON(e,n){let r=[];n&&n.onCreate&&n.onCreate(r);let s=0;for(let i of this.items)r.push(ue(i,String(s++),n));return r}toString(e,n,r){return e?super.toString(e,{blockItem:s=>s.type==="comment"?s.str:`- ${s.str}`,flowChars:{start:"[",end:"]"},isMap:false,itemIndent:(e.indent||"")+" "},n,r):JSON.stringify(this)}},_o=(t,e,n)=>e===null?"":typeof e!="object"?String(e):t instanceof W&&n&&n.doc?t.toString({anchors:Object.create(null),doc:n.doc,indent:"",indentStep:n.indentStep,inFlow:true,inStringifyKey:true,stringify:n.stringify}):JSON.stringify(e),T=class t extends W{constructor(e,n=null){super(),this.key=e,this.value=n,this.type=t.Type.PAIR;}get commentBefore(){return this.key instanceof W?this.key.commentBefore:void 0}set commentBefore(e){if(this.key==null&&(this.key=new P(null)),this.key instanceof W)this.key.commentBefore=e;else {let n="Pair.commentBefore is an alias for Pair.key.commentBefore. To set it, the key must be a Node.";throw new Error(n)}}addToJSMap(e,n){let r=ue(this.key,"",e);if(n instanceof Map){let s=ue(this.value,r,e);n.set(r,s);}else if(n instanceof Set)n.add(r);else {let s=_o(this.key,r,e),i=ue(this.value,s,e);s in n?Object.defineProperty(n,s,{value:i,writable:true,enumerable:true,configurable:true}):n[s]=i;}return n}toJSON(e,n){let r=n&&n.mapAsMap?new Map:{};return this.addToJSMap(n,r)}toString(e,n,r){if(!e||!e.doc)return JSON.stringify(this);let{indent:s,indentSeq:i,simpleKeys:o}=e.doc.options,{key:a,value:c}=this,l=a instanceof W&&a.comment;if(o){if(l)throw new Error("With simple keys, key nodes cannot have comments");if(a instanceof j){let _="With simple keys, collection cannot be used as a key value";throw new Error(_)}}let f=!o&&(!a||l||(a instanceof W?a instanceof j||a.type===p.Type.BLOCK_FOLDED||a.type===p.Type.BLOCK_LITERAL:typeof a=="object")),{doc:m,indent:d,indentStep:y,stringify:h}=e;e=Object.assign({},e,{implicitKey:!f,indent:d+y});let g=false,w=h(a,e,()=>l=null,()=>g=true);if(w=Fe(w,e.indent,l),!f&&w.length>1024){if(o)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");f=true;}if(e.allNullValues&&!o)return this.comment?(w=Fe(w,e.indent,this.comment),n&&n()):g&&!l&&r&&r(),e.inFlow&&!f?w:`? ${w}`;w=f?`? ${w}
|
|
32990
|
+
${d}:`:`${w}:`,this.comment&&(w=Fe(w,e.indent,this.comment),n&&n());let C="",L=null;if(c instanceof W){if(c.spaceBefore&&(C=`
|
|
32991
|
+
`),c.commentBefore){let _=c.commentBefore.replace(/^/gm,`${e.indent}#`);C+=`
|
|
32992
|
+
${_}`;}L=c.comment;}else c&&typeof c=="object"&&(c=m.schema.createNode(c,true));e.implicitKey=false,!f&&!this.comment&&c instanceof P&&(e.indentAtStart=w.length+1),g=false,!i&&s>=2&&!e.inFlow&&!f&&c instanceof pe&&c.type!==p.Type.FLOW_SEQ&&!c.tag&&!m.anchors.getName(c)&&(e.indent=e.indent.substr(2));let M=h(c,e,()=>L=null,()=>g=true),A=" ";return C||this.comment?A=`${C}
|
|
32993
|
+
${e.indent}`:!f&&c instanceof j?(!(M[0]==="["||M[0]==="{")||M.includes(`
|
|
32994
|
+
`))&&(A=`
|
|
32995
|
+
${e.indent}`):M[0]===`
|
|
32996
|
+
`&&(A=""),g&&!L&&r&&r(),Fe(w+A+M,e.indent,L)}};p._defineProperty(T,"Type",{PAIR:"PAIR",MERGE_PAIR:"MERGE_PAIR"});var qt=(t,e)=>{if(t instanceof be){let n=e.get(t.source);return n.count*n.aliasCount}else if(t instanceof j){let n=0;for(let r of t.items){let s=qt(r,e);s>n&&(n=s);}return n}else if(t instanceof T){let n=qt(t.key,e),r=qt(t.value,e);return Math.max(n,r)}return 1},be=class t extends W{static stringify({range:e,source:n},{anchors:r,doc:s,implicitKey:i,inStringifyKey:o}){let a=Object.keys(r).find(l=>r[l]===n);if(!a&&o&&(a=s.anchors.getName(n)||s.anchors.newName()),a)return `*${a}${i?" ":""}`;let c=s.anchors.getName(n)?"Alias node must be after source node":"Source node not found for alias node";throw new Error(`${c} [${e}]`)}constructor(e){super(),this.source=e,this.type=p.Type.ALIAS;}set tag(e){throw new Error("Alias nodes cannot have tags")}toJSON(e,n){if(!n)return ue(this.source,e,n);let{anchors:r,maxAliasCount:s}=n,i=r.get(this.source);if(!i||i.res===void 0){let o="This should not happen: Alias anchor was not resolved?";throw this.cstNode?new p.YAMLReferenceError(this.cstNode,o):new ReferenceError(o)}if(s>=0&&(i.count+=1,i.aliasCount===0&&(i.aliasCount=qt(this.source,r)),i.count*i.aliasCount>s)){let o="Excessive alias count indicates a resource exhaustion attack";throw this.cstNode?new p.YAMLReferenceError(this.cstNode,o):new ReferenceError(o)}return i.res}toString(e){return t.stringify(this,e)}};p._defineProperty(be,"default",true);function pt(t,e){let n=e instanceof P?e.value:e;for(let r of t)if(r instanceof T&&(r.key===e||r.key===n||r.key&&r.key.value===n))return r}var mt=class extends j{add(e,n){e?e instanceof T||(e=new T(e.key||e,e.value)):e=new T(e);let r=pt(this.items,e.key),s=this.schema&&this.schema.sortMapEntries;if(r)if(n)r.value=e.value;else throw new Error(`Key ${e.key} already set`);else if(s){let i=this.items.findIndex(o=>s(e,o)<0);i===-1?this.items.push(e):this.items.splice(i,0,e);}else this.items.push(e);}delete(e){let n=pt(this.items,e);return n?this.items.splice(this.items.indexOf(n),1).length>0:false}get(e,n){let r=pt(this.items,e),s=r&&r.value;return !n&&s instanceof P?s.value:s}has(e){return !!pt(this.items,e)}set(e,n){this.add(new T(e,n),true);}toJSON(e,n,r){let s=r?new r:n&&n.mapAsMap?new Map:{};n&&n.onCreate&&n.onCreate(s);for(let i of this.items)i.addToJSMap(n,s);return s}toString(e,n,r){if(!e)return JSON.stringify(this);for(let s of this.items)if(!(s instanceof T))throw new Error(`Map items must all be pairs; found ${JSON.stringify(s)} instead`);return super.toString(e,{blockItem:s=>s.str,flowChars:{start:"{",end:"}"},isMap:true,itemIndent:e.indent||""},n,r)}},Fs="<<",Vt=class extends T{constructor(e){if(e instanceof T){let n=e.value;n instanceof pe||(n=new pe,n.items.push(e.value),n.range=e.value.range),super(e.key,n),this.range=e.range;}else super(new P(Fs),new pe);this.type=T.Type.MERGE_PAIR;}addToJSMap(e,n){for(let{source:r}of this.value.items){if(!(r instanceof mt))throw new Error("Merge sources must be maps");let s=r.toJSON(null,e,Map);for(let[i,o]of s)n instanceof Map?n.has(i)||n.set(i,o):n instanceof Set?n.add(i):Object.prototype.hasOwnProperty.call(n,i)||Object.defineProperty(n,i,{value:o,writable:true,enumerable:true,configurable:true});}return n}toString(e,n){let r=this.value;if(r.items.length>1)return super.toString(e,n);this.value=r.items[0];let s=super.toString(e,n);return this.value=r,s}},xo={defaultType:p.Type.BLOCK_LITERAL,lineWidth:76},Ro={trueStr:"true",falseStr:"false"},Do={asBigInt:false},Yo={nullStr:"null"},Ne={defaultType:p.Type.PLAIN,doubleQuoted:{jsonEncoding:false,minMultiLineLength:40},fold:{lineWidth:80,minContentWidth:20}};function qn(t,e,n){for(let{format:r,test:s,resolve:i}of e)if(s){let o=t.match(s);if(o){let a=i.apply(null,o);return a instanceof P||(a=new P(a)),r&&(a.format=r),a}}return n&&(t=n(t)),new P(t)}var qs="flow",Fn="block",Ut="quoted",Ys=(t,e)=>{let n=t[e+1];for(;n===" "||n===" ";){do n=t[e+=1];while(n&&n!==`
|
|
32997
|
+
`);n=t[e+1];}return e};function Wt(t,e,n,{indentAtStart:r,lineWidth:s=80,minContentWidth:i=20,onFold:o,onOverflow:a}){if(!s||s<0)return t;let c=Math.max(1+i,1+s-e.length);if(t.length<=c)return t;let l=[],f={},m=s-e.length;typeof r=="number"&&(r>s-Math.max(2,i)?l.push(0):m=s-r);let d,y,h=false,g=-1,w=-1,C=-1;n===Fn&&(g=Ys(t,g),g!==-1&&(m=g+c));for(let M;M=t[g+=1];){if(n===Ut&&M==="\\"){switch(w=g,t[g+1]){case "x":g+=3;break;case "u":g+=5;break;case "U":g+=9;break;default:g+=1;}C=g;}if(M===`
|
|
32998
|
+
`)n===Fn&&(g=Ys(t,g)),m=g+c,d=void 0;else {if(M===" "&&y&&y!==" "&&y!==`
|
|
32999
|
+
`&&y!==" "){let A=t[g+1];A&&A!==" "&&A!==`
|
|
33000
|
+
`&&A!==" "&&(d=g);}if(g>=m)if(d)l.push(d),m=d+c,d=void 0;else if(n===Ut){for(;y===" "||y===" ";)y=M,M=t[g+=1],h=true;let A=g>C+1?g-2:w-1;if(f[A])return t;l.push(A),f[A]=true,m=A+c,d=void 0;}else h=true;}y=M;}if(h&&a&&a(),l.length===0)return t;o&&o();let L=t.slice(0,l[0]);for(let M=0;M<l.length;++M){let A=l[M],_=l[M+1]||t.length;A===0?L=`
|
|
33001
|
+
${e}${t.slice(0,_)}`:(n===Ut&&f[A]&&(L+=`${t[A]}\\`),L+=`
|
|
33002
|
+
${e}${t.slice(A+1,_)}`);}return L}var Un=({indentAtStart:t})=>t?Object.assign({indentAtStart:t},Ne.fold):Ne.fold,jt=t=>/^(%|---|\.\.\.)/m.test(t);function $o(t,e,n){if(!e||e<0)return false;let r=e-n,s=t.length;if(s<=r)return false;for(let i=0,o=0;i<s;++i)if(t[i]===`
|
|
33003
|
+
`){if(i-o>r)return true;if(o=i+1,s-o<=r)return false}return true}function we(t,e){let{implicitKey:n}=e,{jsonEncoding:r,minMultiLineLength:s}=Ne.doubleQuoted,i=JSON.stringify(t);if(r)return i;let o=e.indent||(jt(t)?" ":""),a="",c=0;for(let l=0,f=i[l];f;f=i[++l])if(f===" "&&i[l+1]==="\\"&&i[l+2]==="n"&&(a+=i.slice(c,l)+"\\ ",l+=1,c=l,f="\\"),f==="\\")switch(i[l+1]){case "u":{a+=i.slice(c,l);let m=i.substr(l+2,4);switch(m){case "0000":a+="\\0";break;case "0007":a+="\\a";break;case "000b":a+="\\v";break;case "001b":a+="\\e";break;case "0085":a+="\\N";break;case "00a0":a+="\\_";break;case "2028":a+="\\L";break;case "2029":a+="\\P";break;default:m.substr(0,2)==="00"?a+="\\x"+m.substr(2):a+=i.substr(l,6);}l+=5,c=l+1;}break;case "n":if(n||i[l+2]==='"'||i.length<s)l+=1;else {for(a+=i.slice(c,l)+`
|
|
33004
|
+
|
|
33005
|
+
`;i[l+2]==="\\"&&i[l+3]==="n"&&i[l+4]!=='"';)a+=`
|
|
33006
|
+
`,l+=2;a+=o,i[l+2]===" "&&(a+="\\"),l+=1,c=l+1;}break;default:l+=1;}return a=c?a+i.slice(c):i,n?a:Wt(a,o,Ut,Un(e))}function Us(t,e){if(e.implicitKey){if(/\n/.test(t))return we(t,e)}else if(/[ \t]\n|\n[ \t]/.test(t))return we(t,e);let n=e.indent||(jt(t)?" ":""),r="'"+t.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
33007
|
+
${n}`)+"'";return e.implicitKey?r:Wt(r,n,qs,Un(e))}function Kt({comment:t,type:e,value:n},r,s,i){if(/\n[\t ]+$/.test(n)||/^\s*$/.test(n))return we(n,r);let o=r.indent||(r.forceBlockIndent||jt(n)?" ":""),a=o?"2":"1",c=e===p.Type.BLOCK_FOLDED?false:e===p.Type.BLOCK_LITERAL?true:!$o(n,Ne.fold.lineWidth,o.length),l=c?"|":">";if(!n)return l+`
|
|
33008
|
+
`;let f="",m="";if(n=n.replace(/[\n\t ]*$/,y=>{let h=y.indexOf(`
|
|
33009
|
+
`);return h===-1?l+="-":(n===y||h!==y.length-1)&&(l+="+",i&&i()),m=y.replace(/\n$/,""),""}).replace(/^[\n ]*/,y=>{y.indexOf(" ")!==-1&&(l+=a);let h=y.match(/ +$/);return h?(f=y.slice(0,-h[0].length),h[0]):(f=y,"")}),m&&(m=m.replace(/\n+(?!\n|$)/g,`$&${o}`)),f&&(f=f.replace(/\n+/g,`$&${o}`)),t&&(l+=" #"+t.replace(/ ?[\r\n]+/g," "),s&&s()),!n)return `${l}${a}
|
|
33010
|
+
${o}${m}`;if(c)return n=n.replace(/\n+/g,`$&${o}`),`${l}
|
|
33011
|
+
${o}${f}${n}${m}`;n=n.replace(/\n+/g,`
|
|
33012
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${o}`);let d=Wt(`${f}${n}${m}`,o,Fn,Ne.fold);return `${l}
|
|
33013
|
+
${o}${d}`}function Bo(t,e,n,r){let{comment:s,type:i,value:o}=t,{actualString:a,implicitKey:c,indent:l,inFlow:f}=e;if(c&&/[\n[\]{},]/.test(o)||f&&/[[\]{},]/.test(o))return we(o,e);if(!o||/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(o))return c||f||o.indexOf(`
|
|
33014
|
+
`)===-1?o.indexOf('"')!==-1&&o.indexOf("'")===-1?Us(o,e):we(o,e):Kt(t,e,n,r);if(!c&&!f&&i!==p.Type.PLAIN&&o.indexOf(`
|
|
33015
|
+
`)!==-1)return Kt(t,e,n,r);if(l===""&&jt(o))return e.forceBlockIndent=true,Kt(t,e,n,r);let m=o.replace(/\n+/g,`$&
|
|
33016
|
+
${l}`);if(a){let{tags:y}=e.doc.schema;if(typeof qn(m,y,y.scalarFallback).value!="string")return we(o,e)}let d=c?m:Wt(m,l,qs,Un(e));return s&&!f&&(d.indexOf(`
|
|
33017
|
+
`)!==-1||s.indexOf(`
|
|
33018
|
+
`)!==-1)?(n&&n(),Po(d,l,s)):d}function Fo(t,e,n,r){let{defaultType:s}=Ne,{implicitKey:i,inFlow:o}=e,{type:a,value:c}=t;typeof c!="string"&&(c=String(c),t=Object.assign({},t,{value:c}));let l=m=>{switch(m){case p.Type.BLOCK_FOLDED:case p.Type.BLOCK_LITERAL:return Kt(t,e,n,r);case p.Type.QUOTE_DOUBLE:return we(c,e);case p.Type.QUOTE_SINGLE:return Us(c,e);case p.Type.PLAIN:return Bo(t,e,n,r);default:return null}};(a!==p.Type.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f]/.test(c)||(i||o)&&(a===p.Type.BLOCK_FOLDED||a===p.Type.BLOCK_LITERAL))&&(a=p.Type.QUOTE_DOUBLE);let f=l(a);if(f===null&&(f=l(s),f===null))throw new Error(`Unsupported default string type ${s}`);return f}function qo({format:t,minFractionDigits:e,tag:n,value:r}){if(typeof r=="bigint")return String(r);if(!isFinite(r))return isNaN(r)?".nan":r<0?"-.inf":".inf";let s=JSON.stringify(r);if(!t&&e&&(!n||n==="tag:yaml.org,2002:float")&&/^\d/.test(s)){let i=s.indexOf(".");i<0&&(i=s.length,s+=".");let o=e-(s.length-i-1);for(;o-- >0;)s+="0";}return s}function Ks(t,e){let n,r;switch(e.type){case p.Type.FLOW_MAP:n="}",r="flow map";break;case p.Type.FLOW_SEQ:n="]",r="flow sequence";break;default:t.push(new p.YAMLSemanticError(e,"Not a flow collection!?"));return}let s;for(let i=e.items.length-1;i>=0;--i){let o=e.items[i];if(!o||o.type!==p.Type.COMMENT){s=o;break}}if(s&&s.char!==n){let i=`Expected ${r} to end with ${n}`,o;typeof s.offset=="number"?(o=new p.YAMLSemanticError(e,i),o.offset=s.offset+1):(o=new p.YAMLSemanticError(s,i),s.range&&s.range.end&&(o.offset=s.range.end-s.range.start)),t.push(o);}}function Vs(t,e){let n=e.context.src[e.range.start-1];if(n!==`
|
|
33019
|
+
`&&n!==" "&&n!==" "){let r="Comments must be separated from other tokens by white space characters";t.push(new p.YAMLSemanticError(e,r));}}function Ws(t,e){let n=String(e),r=n.substr(0,8)+"..."+n.substr(-8);return new p.YAMLSemanticError(t,`The "${r}" key is too long`)}function js(t,e){for(let{afterKey:n,before:r,comment:s}of e){let i=t.items[r];i?(n&&i.value&&(i=i.value),s===void 0?(n||!i.commentBefore)&&(i.spaceBefore=true):i.commentBefore?i.commentBefore+=`
|
|
33020
|
+
`+s:i.commentBefore=s):s!==void 0&&(t.comment?t.comment+=`
|
|
33021
|
+
`+s:t.comment=s);}}function Kn(t,e){let n=e.strValue;return n?typeof n=="string"?n:(n.errors.forEach(r=>{r.source||(r.source=e),t.errors.push(r);}),n.str):""}function Uo(t,e){let{handle:n,suffix:r}=e.tag,s=t.tagPrefixes.find(i=>i.handle===n);if(!s){let i=t.getDefaults().tagPrefixes;if(i&&(s=i.find(o=>o.handle===n)),!s)throw new p.YAMLSemanticError(e,`The ${n} tag handle is non-default and was not declared.`)}if(!r)throw new p.YAMLSemanticError(e,`The ${n} tag has no suffix.`);if(n==="!"&&(t.version||t.options.version)==="1.0"){if(r[0]==="^")return t.warnings.push(new p.YAMLWarning(e,"YAML 1.0 ^ tag expansion is not supported")),r;if(/[:/]/.test(r)){let i=r.match(/^([a-z0-9-]+)\/(.*)/i);return i?`tag:${i[1]}.yaml.org,2002:${i[2]}`:`tag:${r}`}}return s.prefix+decodeURIComponent(r)}function Ko(t,e){let{tag:n,type:r}=e,s=false;if(n){let{handle:i,suffix:o,verbatim:a}=n;if(a){if(a!=="!"&&a!=="!!")return a;let c=`Verbatim tags aren't resolved, so ${a} is invalid.`;t.errors.push(new p.YAMLSemanticError(e,c));}else if(i==="!"&&!o)s=true;else try{return Uo(t,e)}catch(c){t.errors.push(c);}}switch(r){case p.Type.BLOCK_FOLDED:case p.Type.BLOCK_LITERAL:case p.Type.QUOTE_DOUBLE:case p.Type.QUOTE_SINGLE:return p.defaultTags.STR;case p.Type.FLOW_MAP:case p.Type.MAP:return p.defaultTags.MAP;case p.Type.FLOW_SEQ:case p.Type.SEQ:return p.defaultTags.SEQ;case p.Type.PLAIN:return s?p.defaultTags.STR:null;default:return null}}function $s(t,e,n){let{tags:r}=t.schema,s=[];for(let o of r)if(o.tag===n)if(o.test)s.push(o);else {let a=o.resolve(t,e);return a instanceof j?a:new P(a)}let i=Kn(t,e);return typeof i=="string"&&s.length>0?qn(i,s,r.scalarFallback):null}function Vo({type:t}){switch(t){case p.Type.FLOW_MAP:case p.Type.MAP:return p.defaultTags.MAP;case p.Type.FLOW_SEQ:case p.Type.SEQ:return p.defaultTags.SEQ;default:return p.defaultTags.STR}}function Wo(t,e,n){try{let r=$s(t,e,n);if(r)return n&&e.tag&&(r.tag=n),r}catch(r){return r.source||(r.source=e),t.errors.push(r),null}try{let r=Vo(e);if(!r)throw new Error(`The tag ${n} is unavailable`);let s=`The tag ${n} is unavailable, falling back to ${r}`;t.warnings.push(new p.YAMLWarning(e,s));let i=$s(t,e,r);return i.tag=n,i}catch(r){let s=new p.YAMLReferenceError(e,r.message);return s.stack=r.stack,t.errors.push(s),null}}var jo=t=>{if(!t)return false;let{type:e}=t;return e===p.Type.MAP_KEY||e===p.Type.MAP_VALUE||e===p.Type.SEQ_ITEM};function Qo(t,e){let n={before:[],after:[]},r=false,s=false,i=jo(e.context.parent)?e.context.parent.props.concat(e.props):e.props;for(let{start:o,end:a}of i)switch(e.context.src[o]){case p.Char.COMMENT:{if(!e.commentHasRequiredWhitespace(o)){let m="Comments must be separated from other tokens by white space characters";t.push(new p.YAMLSemanticError(e,m));}let{header:c,valueRange:l}=e;(l&&(o>l.start||c&&o>c.start)?n.after:n.before).push(e.context.src.slice(o+1,a));break}case p.Char.ANCHOR:if(r){let c="A node can have at most one anchor";t.push(new p.YAMLSemanticError(e,c));}r=true;break;case p.Char.TAG:if(s){let c="A node can have at most one tag";t.push(new p.YAMLSemanticError(e,c));}s=true;break}return {comments:n,hasAnchor:r,hasTag:s}}function Jo(t,e){let{anchors:n,errors:r,schema:s}=t;if(e.type===p.Type.ALIAS){let o=e.rawValue,a=n.getNode(o);if(!a){let l=`Aliased anchor not found: ${o}`;return r.push(new p.YAMLReferenceError(e,l)),null}let c=new be(a);return n._cstAliases.push(c),c}let i=Ko(t,e);if(i)return Wo(t,e,i);if(e.type!==p.Type.PLAIN){let o=`Failed to resolve ${e.type} node here`;return r.push(new p.YAMLSyntaxError(e,o)),null}try{let o=Kn(t,e);return qn(o,s.tags,s.tags.scalarFallback)}catch(o){return o.source||(o.source=e),r.push(o),null}}function me(t,e){if(!e)return null;e.error&&t.errors.push(e.error);let{comments:n,hasAnchor:r,hasTag:s}=Qo(t.errors,e);if(r){let{anchors:o}=t,a=e.anchor,c=o.getNode(a);c&&(o.map[o.newName(a)]=c),o.map[a]=e;}if(e.type===p.Type.ALIAS&&(r||s)){let o="An alias node must not specify any properties";t.errors.push(new p.YAMLSemanticError(e,o));}let i=Jo(t,e);if(i){i.range=[e.range.start,e.range.end],t.options.keepCstNodes&&(i.cstNode=e),t.options.keepNodeTypes&&(i.type=e.type);let o=n.before.join(`
|
|
33022
|
+
`);o&&(i.commentBefore=i.commentBefore?`${i.commentBefore}
|
|
33023
|
+
${o}`:o);let a=n.after.join(`
|
|
33024
|
+
`);a&&(i.comment=i.comment?`${i.comment}
|
|
33025
|
+
${a}`:a);}return e.resolved=i}function Go(t,e){if(e.type!==p.Type.MAP&&e.type!==p.Type.FLOW_MAP){let o=`A ${e.type} node cannot be resolved as a mapping`;return t.errors.push(new p.YAMLSyntaxError(e,o)),null}let{comments:n,items:r}=e.type===p.Type.FLOW_MAP?Zo(t,e):zo(t,e),s=new mt;s.items=r,js(s,n);let i=false;for(let o=0;o<r.length;++o){let{key:a}=r[o];if(a instanceof j&&(i=true),t.schema.merge&&a&&a.value===Fs){r[o]=new Vt(r[o]);let c=r[o].value.items,l=null;c.some(f=>{if(f instanceof be){let{type:m}=f.source;return m===p.Type.MAP||m===p.Type.FLOW_MAP?false:l="Merge nodes aliases can only point to maps"}return l="Merge nodes can only have Alias nodes as values"}),l&&t.errors.push(new p.YAMLSemanticError(e,l));}else for(let c=o+1;c<r.length;++c){let{key:l}=r[c];if(a===l||a&&l&&Object.prototype.hasOwnProperty.call(a,"value")&&a.value===l.value){let f=`Map keys must be unique; "${a}" is repeated`;t.errors.push(new p.YAMLSemanticError(e,f));break}}}if(i&&!t.options.mapAsMap){let o="Keys with collection values will be stringified as YAML due to JS Object restrictions. Use mapAsMap: true to avoid this.";t.warnings.push(new p.YAMLWarning(e,o));}return e.resolved=s,s}var Ho=({context:{lineStart:t,node:e,src:n},props:r})=>{if(r.length===0)return false;let{start:s}=r[0];if(e&&s>e.valueRange.start||n[s]!==p.Char.COMMENT)return false;for(let i=t;i<s;++i)if(n[i]===`
|
|
33026
|
+
`)return false;return true};function Xo(t,e){if(!Ho(t))return;let n=t.getPropValue(0,p.Char.COMMENT,true),r=false,s=e.value.commentBefore;if(s&&s.startsWith(n))e.value.commentBefore=s.substr(n.length+1),r=true;else {let i=e.value.comment;!t.node&&i&&i.startsWith(n)&&(e.value.comment=i.substr(n.length+1),r=true);}r&&(e.comment=n);}function zo(t,e){let n=[],r=[],s,i=null;for(let o=0;o<e.items.length;++o){let a=e.items[o];switch(a.type){case p.Type.BLANK_LINE:n.push({afterKey:!!s,before:r.length});break;case p.Type.COMMENT:n.push({afterKey:!!s,before:r.length,comment:a.comment});break;case p.Type.MAP_KEY:s!==void 0&&r.push(new T(s)),a.error&&t.errors.push(a.error),s=me(t,a.node),i=null;break;case p.Type.MAP_VALUE:{if(s===void 0&&(s=null),a.error&&t.errors.push(a.error),!a.context.atLineStart&&a.node&&a.node.type===p.Type.MAP&&!a.node.context.atLineStart){let f="Nested mappings are not allowed in compact mappings";t.errors.push(new p.YAMLSemanticError(a.node,f));}let c=a.node;if(!c&&a.props.length>0){c=new p.PlainValue(p.Type.PLAIN,[]),c.context={parent:a,src:a.context.src};let f=a.range.start+1;if(c.range={start:f,end:f},c.valueRange={start:f,end:f},typeof a.range.origStart=="number"){let m=a.range.origStart+1;c.range.origStart=c.range.origEnd=m,c.valueRange.origStart=c.valueRange.origEnd=m;}}let l=new T(s,me(t,c));Xo(a,l),r.push(l),s&&typeof i=="number"&&a.range.start>i+1024&&t.errors.push(Ws(e,s)),s=void 0,i=null;}break;default:s!==void 0&&r.push(new T(s)),s=me(t,a),i=a.range.start,a.error&&t.errors.push(a.error);e:for(let c=o+1;;++c){let l=e.items[c];switch(l&&l.type){case p.Type.BLANK_LINE:case p.Type.COMMENT:continue e;case p.Type.MAP_VALUE:break e;default:{let f="Implicit map keys need to be followed by map values";t.errors.push(new p.YAMLSemanticError(a,f));break e}}}if(a.valueRangeContainsNewline){let c="Implicit map keys need to be on a single line";t.errors.push(new p.YAMLSemanticError(a,c));}}}return s!==void 0&&r.push(new T(s)),{comments:n,items:r}}function Zo(t,e){let n=[],r=[],s,i=false,o="{";for(let a=0;a<e.items.length;++a){let c=e.items[a];if(typeof c.char=="string"){let{char:l,offset:f}=c;if(l==="?"&&s===void 0&&!i){i=true,o=":";continue}if(l===":"){if(s===void 0&&(s=null),o===":"){o=",";continue}}else if(i&&(s===void 0&&l!==","&&(s=null),i=false),s!==void 0&&(r.push(new T(s)),s=void 0,l===",")){o=":";continue}if(l==="}"){if(a===e.items.length-1)continue}else if(l===o){o=":";continue}let m=`Flow map contains an unexpected ${l}`,d=new p.YAMLSyntaxError(e,m);d.offset=f,t.errors.push(d);}else c.type===p.Type.BLANK_LINE?n.push({afterKey:!!s,before:r.length}):c.type===p.Type.COMMENT?(Vs(t.errors,c),n.push({afterKey:!!s,before:r.length,comment:c.comment})):s===void 0?(o===","&&t.errors.push(new p.YAMLSemanticError(c,"Separator , missing in flow map")),s=me(t,c)):(o!==","&&t.errors.push(new p.YAMLSemanticError(c,"Indicator : missing in flow map entry")),r.push(new T(s,me(t,c))),s=void 0,i=false);}return Ks(t.errors,e),s!==void 0&&r.push(new T(s)),{comments:n,items:r}}function ea(t,e){if(e.type!==p.Type.SEQ&&e.type!==p.Type.FLOW_SEQ){let i=`A ${e.type} node cannot be resolved as a sequence`;return t.errors.push(new p.YAMLSyntaxError(e,i)),null}let{comments:n,items:r}=e.type===p.Type.FLOW_SEQ?na(t,e):ta(t,e),s=new pe;if(s.items=r,js(s,n),!t.options.mapAsMap&&r.some(i=>i instanceof T&&i.key instanceof j)){let i="Keys with collection values will be stringified as YAML due to JS Object restrictions. Use mapAsMap: true to avoid this.";t.warnings.push(new p.YAMLWarning(e,i));}return e.resolved=s,s}function ta(t,e){let n=[],r=[];for(let s=0;s<e.items.length;++s){let i=e.items[s];switch(i.type){case p.Type.BLANK_LINE:n.push({before:r.length});break;case p.Type.COMMENT:n.push({comment:i.comment,before:r.length});break;case p.Type.SEQ_ITEM:if(i.error&&t.errors.push(i.error),r.push(me(t,i.node)),i.hasProps){let o="Sequence items cannot have tags or anchors before the - indicator";t.errors.push(new p.YAMLSemanticError(i,o));}break;default:i.error&&t.errors.push(i.error),t.errors.push(new p.YAMLSyntaxError(i,`Unexpected ${i.type} node in sequence`));}}return {comments:n,items:r}}function na(t,e){let n=[],r=[],s=false,i,o=null,a="[",c=null;for(let l=0;l<e.items.length;++l){let f=e.items[l];if(typeof f.char=="string"){let{char:m,offset:d}=f;if(m!==":"&&(s||i!==void 0)&&(s&&i===void 0&&(i=a?r.pop():null),r.push(new T(i)),s=false,i=void 0,o=null),m===a)a=null;else if(!a&&m==="?")s=true;else if(a!=="["&&m===":"&&i===void 0){if(a===","){if(i=r.pop(),i instanceof T){let y="Chaining flow sequence pairs is invalid",h=new p.YAMLSemanticError(e,y);h.offset=d,t.errors.push(h);}if(!s&&typeof o=="number"){let y=f.range?f.range.start:f.offset;y>o+1024&&t.errors.push(Ws(e,i));let{src:h}=c.context;for(let g=o;g<y;++g)if(h[g]===`
|
|
33027
|
+
`){let w="Implicit keys of flow sequence pairs need to be on a single line";t.errors.push(new p.YAMLSemanticError(c,w));break}}}else i=null;o=null,s=false,a=null;}else if(a==="["||m!=="]"||l<e.items.length-1){let y=`Flow sequence contains an unexpected ${m}`,h=new p.YAMLSyntaxError(e,y);h.offset=d,t.errors.push(h);}}else if(f.type===p.Type.BLANK_LINE)n.push({before:r.length});else if(f.type===p.Type.COMMENT)Vs(t.errors,f),n.push({comment:f.comment,before:r.length});else {if(a){let d=`Expected a ${a} in flow sequence`;t.errors.push(new p.YAMLSemanticError(f,d));}let m=me(t,f);i===void 0?(r.push(m),c=f):(r.push(new T(i,m)),i=void 0),o=f.range.start,a=",";}}return Ks(t.errors,e),i!==void 0&&r.push(new T(i)),{comments:n,items:r}}k.Alias=be;k.Collection=j;k.Merge=Vt;k.Node=W;k.Pair=T;k.Scalar=P;k.YAMLMap=mt;k.YAMLSeq=pe;k.addComment=Fe;k.binaryOptions=xo;k.boolOptions=Ro;k.findPair=pt;k.intOptions=Do;k.isEmptyPath=Bs;k.nullOptions=Yo;k.resolveMap=Go;k.resolveNode=me;k.resolveSeq=ea;k.resolveString=Kn;k.strOptions=Ne;k.stringifyNumber=qo;k.stringifyString=Fo;k.toJSON=ue;});var Qn=te(z=>{var Q=le(),O=qe(),ra={identify:t=>t instanceof Uint8Array,default:false,tag:"tag:yaml.org,2002:binary",resolve:(t,e)=>{let n=O.resolveString(t,e);if(typeof Buffer=="function")return Buffer.from(n,"base64");if(typeof atob=="function"){let r=atob(n.replace(/[\n\r]/g,"")),s=new Uint8Array(r.length);for(let i=0;i<r.length;++i)s[i]=r.charCodeAt(i);return s}else {let r="This environment does not support reading binary tags; either Buffer or atob is required";return t.errors.push(new Q.YAMLReferenceError(e,r)),null}},options:O.binaryOptions,stringify:({comment:t,type:e,value:n},r,s,i)=>{let o;if(typeof Buffer=="function")o=n instanceof Buffer?n.toString("base64"):Buffer.from(n.buffer).toString("base64");else if(typeof btoa=="function"){let a="";for(let c=0;c<n.length;++c)a+=String.fromCharCode(n[c]);o=btoa(a);}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e||(e=O.binaryOptions.defaultType),e===Q.Type.QUOTE_DOUBLE)n=o;else {let{lineWidth:a}=O.binaryOptions,c=Math.ceil(o.length/a),l=new Array(c);for(let f=0,m=0;f<c;++f,m+=a)l[f]=o.substr(m,a);n=l.join(e===Q.Type.BLOCK_LITERAL?`
|
|
33028
|
+
`:" ");}return O.stringifyString({comment:t,type:e,value:n},r,s,i)}};function Js(t,e){let n=O.resolveSeq(t,e);for(let r=0;r<n.items.length;++r){let s=n.items[r];if(!(s instanceof O.Pair)){if(s instanceof O.YAMLMap){if(s.items.length>1){let o="Each pair must have its own sequence indicator";throw new Q.YAMLSemanticError(e,o)}let i=s.items[0]||new O.Pair;s.commentBefore&&(i.commentBefore=i.commentBefore?`${s.commentBefore}
|
|
33029
|
+
${i.commentBefore}`:s.commentBefore),s.comment&&(i.comment=i.comment?`${s.comment}
|
|
33030
|
+
${i.comment}`:s.comment),s=i;}n.items[r]=s instanceof O.Pair?s:new O.Pair(s);}}return n}function Gs(t,e,n){let r=new O.YAMLSeq(t);r.tag="tag:yaml.org,2002:pairs";for(let s of e){let i,o;if(Array.isArray(s))if(s.length===2)i=s[0],o=s[1];else throw new TypeError(`Expected [key, value] tuple: ${s}`);else if(s&&s instanceof Object){let c=Object.keys(s);if(c.length===1)i=c[0],o=s[i];else throw new TypeError(`Expected { key: value } tuple: ${s}`)}else i=s;let a=t.createPair(i,o,n);r.items.push(a);}return r}var sa={default:false,tag:"tag:yaml.org,2002:pairs",resolve:Js,createNode:Gs},Ue=class t extends O.YAMLSeq{constructor(){super(),Q._defineProperty(this,"add",O.YAMLMap.prototype.add.bind(this)),Q._defineProperty(this,"delete",O.YAMLMap.prototype.delete.bind(this)),Q._defineProperty(this,"get",O.YAMLMap.prototype.get.bind(this)),Q._defineProperty(this,"has",O.YAMLMap.prototype.has.bind(this)),Q._defineProperty(this,"set",O.YAMLMap.prototype.set.bind(this)),this.tag=t.tag;}toJSON(e,n){let r=new Map;n&&n.onCreate&&n.onCreate(r);for(let s of this.items){let i,o;if(s instanceof O.Pair?(i=O.toJSON(s.key,"",n),o=O.toJSON(s.value,i,n)):i=O.toJSON(s,"",n),r.has(i))throw new Error("Ordered maps must not include duplicate keys");r.set(i,o);}return r}};Q._defineProperty(Ue,"tag","tag:yaml.org,2002:omap");function ia(t,e){let n=Js(t,e),r=[];for(let{key:s}of n.items)if(s instanceof O.Scalar)if(r.includes(s.value)){let i="Ordered maps must not include duplicate keys";throw new Q.YAMLSemanticError(e,i)}else r.push(s.value);return Object.assign(new Ue,n)}function oa(t,e,n){let r=Gs(t,e,n),s=new Ue;return s.items=r.items,s}var aa={identify:t=>t instanceof Map,nodeClass:Ue,default:false,tag:"tag:yaml.org,2002:omap",resolve:ia,createNode:oa},Ke=class t extends O.YAMLMap{constructor(){super(),this.tag=t.tag;}add(e){let n=e instanceof O.Pair?e:new O.Pair(e);O.findPair(this.items,n.key)||this.items.push(n);}get(e,n){let r=O.findPair(this.items,e);return !n&&r instanceof O.Pair?r.key instanceof O.Scalar?r.key.value:r.key:r}set(e,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);let r=O.findPair(this.items,e);r&&!n?this.items.splice(this.items.indexOf(r),1):!r&&n&&this.items.push(new O.Pair(e));}toJSON(e,n){return super.toJSON(e,n,Set)}toString(e,n,r){if(!e)return JSON.stringify(this);if(this.hasAllNullValues())return super.toString(e,n,r);throw new Error("Set items must all have null values")}};Q._defineProperty(Ke,"tag","tag:yaml.org,2002:set");function ca(t,e){let n=O.resolveMap(t,e);if(!n.hasAllNullValues())throw new Q.YAMLSemanticError(e,"Set items must all have null values");return Object.assign(new Ke,n)}function la(t,e,n){let r=new Ke;for(let s of e)r.items.push(t.createPair(s,null,n));return r}var fa={identify:t=>t instanceof Set,nodeClass:Ke,default:false,tag:"tag:yaml.org,2002:set",resolve:ca,createNode:la},Vn=(t,e)=>{let n=e.split(":").reduce((r,s)=>r*60+Number(s),0);return t==="-"?-n:n},Hs=({value:t})=>{if(isNaN(t)||!isFinite(t))return O.stringifyNumber(t);let e="";t<0&&(e="-",t=Math.abs(t));let n=[t%60];return t<60?n.unshift(0):(t=Math.round((t-n[0])/60),n.unshift(t%60),t>=60&&(t=Math.round((t-n[0])/60),n.unshift(t))),e+n.map(r=>r<10?"0"+String(r):String(r)).join(":").replace(/000000\d*$/,"")},ua={identify:t=>typeof t=="number",default:true,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^([-+]?)([0-9][0-9_]*(?::[0-5]?[0-9])+)$/,resolve:(t,e,n)=>Vn(e,n.replace(/_/g,"")),stringify:Hs},pa={identify:t=>typeof t=="number",default:true,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^([-+]?)([0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*)$/,resolve:(t,e,n)=>Vn(e,n.replace(/_/g,"")),stringify:Hs},ma={identify:t=>t instanceof Date,default:true,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^(?:([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?)$"),resolve:(t,e,n,r,s,i,o,a,c)=>{a&&(a=(a+"00").substr(1,3));let l=Date.UTC(e,n-1,r,s||0,i||0,o||0,a||0);if(c&&c!=="Z"){let f=Vn(c[0],c.slice(1));Math.abs(f)<30&&(f*=60),l-=6e4*f;}return new Date(l)},stringify:({value:t})=>t.toISOString().replace(/((T00:00)?:00)?\.000Z$/,"")};function Wn(t){let e={};return t?typeof YAML_SILENCE_DEPRECATION_WARNINGS<"u"?!YAML_SILENCE_DEPRECATION_WARNINGS:!e.YAML_SILENCE_DEPRECATION_WARNINGS:typeof YAML_SILENCE_WARNINGS<"u"?!YAML_SILENCE_WARNINGS:!e.YAML_SILENCE_WARNINGS}function jn(t,e){Wn(false)&&console.warn(e?`${e}: ${t}`:t);}function ha(t){if(Wn(true)){let e=t.replace(/.*yaml[/\\]/i,"").replace(/\.js$/,"").replace(/\\/g,"/");jn(`The endpoint 'yaml/${e}' will be removed in a future release.`,"DeprecationWarning");}}var Qs={};function ga(t,e){if(!Qs[t]&&Wn(true)){Qs[t]=true;let n=`The option '${t}' will be removed in a future release`;n+=e?`, use '${e}' instead.`:".",jn(n,"DeprecationWarning");}}z.binary=ra;z.floatTime=pa;z.intTime=ua;z.omap=aa;z.pairs=sa;z.set=fa;z.timestamp=ma;z.warn=jn;z.warnFileDeprecation=ha;z.warnOptionDeprecation=ga;});var Xn=te(li=>{var Gt=le(),E=qe(),D=Qn();function da(t,e,n){let r=new E.YAMLMap(t);if(e instanceof Map)for(let[s,i]of e)r.items.push(t.createPair(s,i,n));else if(e&&typeof e=="object")for(let s of Object.keys(e))r.items.push(t.createPair(s,e[s],n));return typeof t.sortMapEntries=="function"&&r.items.sort(t.sortMapEntries),r}var gt={createNode:da,default:true,nodeClass:E.YAMLMap,tag:"tag:yaml.org,2002:map",resolve:E.resolveMap};function ya(t,e,n){let r=new E.YAMLSeq(t);if(e&&e[Symbol.iterator])for(let s of e){let i=t.createNode(s,n.wrapScalars,null,n);r.items.push(i);}return r}var Ht={createNode:ya,default:true,nodeClass:E.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve:E.resolveSeq},Ea={identify:t=>typeof t=="string",default:true,tag:"tag:yaml.org,2002:str",resolve:E.resolveString,stringify(t,e,n,r){return e=Object.assign({actualString:true},e),E.stringifyString(t,e,n,r)},options:E.strOptions},Gn=[gt,Ht,Ea],Xt=t=>typeof t=="bigint"||Number.isInteger(t),Hn=(t,e,n)=>E.intOptions.asBigInt?BigInt(t):parseInt(e,n);function Zs(t,e,n){let{value:r}=t;return Xt(r)&&r>=0?n+r.toString(e):E.stringifyNumber(t)}var ei={identify:t=>t==null,createNode:(t,e,n)=>n.wrapScalars?new E.Scalar(null):null,default:true,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>null,options:E.nullOptions,stringify:()=>E.nullOptions.nullStr},ti={identify:t=>typeof t=="boolean",default:true,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>t[0]==="t"||t[0]==="T",options:E.boolOptions,stringify:({value:t})=>t?E.boolOptions.trueStr:E.boolOptions.falseStr},ni={identify:t=>Xt(t)&&t>=0,default:true,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o([0-7]+)$/,resolve:(t,e)=>Hn(t,e,8),options:E.intOptions,stringify:t=>Zs(t,8,"0o")},ri={identify:Xt,default:true,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:t=>Hn(t,t,10),options:E.intOptions,stringify:E.stringifyNumber},si={identify:t=>Xt(t)&&t>=0,default:true,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x([0-9a-fA-F]+)$/,resolve:(t,e)=>Hn(t,e,16),options:E.intOptions,stringify:t=>Zs(t,16,"0x")},ii={identify:t=>typeof t=="number",default:true,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.inf|(\.nan))$/i,resolve:(t,e)=>e?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:E.stringifyNumber},oi={identify:t=>typeof t=="number",default:true,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t),stringify:({value:t})=>Number(t).toExponential()},ai={identify:t=>typeof t=="number",default:true,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.([0-9]+)|[0-9]+\.([0-9]*))$/,resolve(t,e,n){let r=e||n,s=new E.Scalar(parseFloat(t));return r&&r[r.length-1]==="0"&&(s.minFractionDigits=r.length),s},stringify:E.stringifyNumber},Sa=Gn.concat([ei,ti,ni,ri,si,ii,oi,ai]),Xs=t=>typeof t=="bigint"||Number.isInteger(t),Qt=({value:t})=>JSON.stringify(t),ci=[gt,Ht,{identify:t=>typeof t=="string",default:true,tag:"tag:yaml.org,2002:str",resolve:E.resolveString,stringify:Qt},{identify:t=>t==null,createNode:(t,e,n)=>n.wrapScalars?new E.Scalar(null):null,default:true,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Qt},{identify:t=>typeof t=="boolean",default:true,tag:"tag:yaml.org,2002:bool",test:/^true|false$/,resolve:t=>t==="true",stringify:Qt},{identify:Xs,default:true,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:t=>E.intOptions.asBigInt?BigInt(t):parseInt(t,10),stringify:({value:t})=>Xs(t)?t.toString():JSON.stringify(t)},{identify:t=>typeof t=="number",default:true,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:t=>parseFloat(t),stringify:Qt}];ci.scalarFallback=t=>{throw new SyntaxError(`Unresolved plain scalar ${JSON.stringify(t)}`)};var zs=({value:t})=>t?E.boolOptions.trueStr:E.boolOptions.falseStr,ht=t=>typeof t=="bigint"||Number.isInteger(t);function Jt(t,e,n){let r=e.replace(/_/g,"");if(E.intOptions.asBigInt){switch(n){case 2:r=`0b${r}`;break;case 8:r=`0o${r}`;break;case 16:r=`0x${r}`;break}let i=BigInt(r);return t==="-"?BigInt(-1)*i:i}let s=parseInt(r,n);return t==="-"?-1*s:s}function Jn(t,e,n){let{value:r}=t;if(ht(r)){let s=r.toString(e);return r<0?"-"+n+s.substr(1):n+s}return E.stringifyNumber(t)}var wa=Gn.concat([{identify:t=>t==null,createNode:(t,e,n)=>n.wrapScalars?new E.Scalar(null):null,default:true,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>null,options:E.nullOptions,stringify:()=>E.nullOptions.nullStr},{identify:t=>typeof t=="boolean",default:true,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>true,options:E.boolOptions,stringify:zs},{identify:t=>typeof t=="boolean",default:true,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/i,resolve:()=>false,options:E.boolOptions,stringify:zs},{identify:ht,default:true,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^([-+]?)0b([0-1_]+)$/,resolve:(t,e,n)=>Jt(e,n,2),stringify:t=>Jn(t,2,"0b")},{identify:ht,default:true,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^([-+]?)0([0-7_]+)$/,resolve:(t,e,n)=>Jt(e,n,8),stringify:t=>Jn(t,8,"0")},{identify:ht,default:true,tag:"tag:yaml.org,2002:int",test:/^([-+]?)([0-9][0-9_]*)$/,resolve:(t,e,n)=>Jt(e,n,10),stringify:E.stringifyNumber},{identify:ht,default:true,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^([-+]?)0x([0-9a-fA-F_]+)$/,resolve:(t,e,n)=>Jt(e,n,16),stringify:t=>Jn(t,16,"0x")},{identify:t=>typeof t=="number",default:true,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.inf|(\.nan))$/i,resolve:(t,e)=>e?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:E.stringifyNumber},{identify:t=>typeof t=="number",default:true,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?([0-9][0-9_]*)?(\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t.replace(/_/g,"")),stringify:({value:t})=>Number(t).toExponential()},{identify:t=>typeof t=="number",default:true,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.([0-9_]*)$/,resolve(t,e){let n=new E.Scalar(parseFloat(t.replace(/_/g,"")));if(e){let r=e.replace(/_/g,"");r[r.length-1]==="0"&&(n.minFractionDigits=r.length);}return n},stringify:E.stringifyNumber}],D.binary,D.omap,D.pairs,D.set,D.intTime,D.floatTime,D.timestamp),ba={core:Sa,failsafe:Gn,json:ci,yaml11:wa},Na={binary:D.binary,bool:ti,float:ai,floatExp:oi,floatNaN:ii,floatTime:D.floatTime,int:ri,intHex:si,intOct:ni,intTime:D.intTime,map:gt,null:ei,omap:D.omap,pairs:D.pairs,seq:Ht,set:D.set,timestamp:D.timestamp};function Oa(t,e,n){if(e){let r=n.filter(i=>i.tag===e),s=r.find(i=>!i.format)||r[0];if(!s)throw new Error(`Tag ${e} not found`);return s}return n.find(r=>(r.identify&&r.identify(t)||r.class&&t instanceof r.class)&&!r.format)}function La(t,e,n){if(t instanceof E.Node)return t;let{defaultPrefix:r,onTagObj:s,prevObjects:i,schema:o,wrapScalars:a}=n;e&&e.startsWith("!!")&&(e=r+e.slice(2));let c=Oa(t,e,o.tags);if(!c){if(typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object")return a?new E.Scalar(t):t;c=t instanceof Map?gt:t[Symbol.iterator]?Ht:gt;}s&&(s(c),delete n.onTagObj);let l={value:void 0,node:void 0};if(t&&typeof t=="object"&&i){let f=i.get(t);if(f){let m=new E.Alias(f);return n.aliasNodes.push(m),m}l.value=t,i.set(t,l);}return l.node=c.createNode?c.createNode(n.schema,t,n):a?new E.Scalar(t):t,e&&l.node instanceof E.Node&&(l.node.tag=e),l.node}function Aa(t,e,n,r){let s=t[r.replace(/\W/g,"")];if(!s){let i=Object.keys(t).map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${r}"; use one of ${i}`)}if(Array.isArray(n))for(let i of n)s=s.concat(i);else typeof n=="function"&&(s=n(s.slice()));for(let i=0;i<s.length;++i){let o=s[i];if(typeof o=="string"){let a=e[o];if(!a){let c=Object.keys(e).map(l=>JSON.stringify(l)).join(", ");throw new Error(`Unknown custom tag "${o}"; use one of ${c}`)}s[i]=a;}}return s}var Ta=(t,e)=>t.key<e.key?-1:t.key>e.key?1:0,dt=class t{constructor({customTags:e,merge:n,schema:r,sortMapEntries:s,tags:i}){this.merge=!!n,this.name=r,this.sortMapEntries=s===true?Ta:s||null,!e&&i&&D.warnOptionDeprecation("tags","customTags"),this.tags=Aa(ba,Na,e||i,r);}createNode(e,n,r,s){let i={defaultPrefix:t.defaultPrefix,schema:this,wrapScalars:n},o=s?Object.assign(s,i):i;return La(e,r,o)}createPair(e,n,r){r||(r={wrapScalars:true});let s=this.createNode(e,r.wrapScalars,null,r),i=this.createNode(n,r.wrapScalars,null,r);return new E.Pair(s,i)}};Gt._defineProperty(dt,"defaultPrefix",Gt.defaultTagPrefix);Gt._defineProperty(dt,"defaultTags",Gt.defaultTags);li.Schema=dt;});var mi=te(tn=>{var Y=le(),S=qe(),fi=Xn(),Ca={anchorPrefix:"a",customTags:null,indent:2,indentSeq:true,keepCstNodes:false,keepNodeTypes:true,keepBlobsInJSON:true,mapAsMap:false,maxAliasCount:100,prettyErrors:false,simpleKeys:false,version:"1.2"},Ma={get binary(){return S.binaryOptions},set binary(t){Object.assign(S.binaryOptions,t);},get bool(){return S.boolOptions},set bool(t){Object.assign(S.boolOptions,t);},get int(){return S.intOptions},set int(t){Object.assign(S.intOptions,t);},get null(){return S.nullOptions},set null(t){Object.assign(S.nullOptions,t);},get str(){return S.strOptions},set str(t){Object.assign(S.strOptions,t);}},pi={"1.0":{schema:"yaml-1.1",merge:true,tagPrefixes:[{handle:"!",prefix:Y.defaultTagPrefix},{handle:"!!",prefix:"tag:private.yaml.org,2002:"}]},1.1:{schema:"yaml-1.1",merge:true,tagPrefixes:[{handle:"!",prefix:"!"},{handle:"!!",prefix:Y.defaultTagPrefix}]},1.2:{schema:"core",merge:false,tagPrefixes:[{handle:"!",prefix:"!"},{handle:"!!",prefix:Y.defaultTagPrefix}]}};function ui(t,e){if((t.version||t.options.version)==="1.0"){let s=e.match(/^tag:private\.yaml\.org,2002:([^:/]+)$/);if(s)return "!"+s[1];let i=e.match(/^tag:([a-zA-Z0-9-]+)\.yaml\.org,2002:(.*)/);return i?`!${i[1]}/${i[2]}`:`!${e.replace(/^tag:/,"")}`}let n=t.tagPrefixes.find(s=>e.indexOf(s.prefix)===0);if(!n){let s=t.getDefaults().tagPrefixes;n=s&&s.find(i=>e.indexOf(i.prefix)===0);}if(!n)return e[0]==="!"?e:`!<${e}>`;let r=e.substr(n.prefix.length).replace(/[!,[\]{}]/g,s=>({"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"})[s]);return n.handle+r}function ka(t,e){if(e instanceof S.Alias)return S.Alias;if(e.tag){let s=t.filter(i=>i.tag===e.tag);if(s.length>0)return s.find(i=>i.format===e.format)||s[0]}let n,r;if(e instanceof S.Scalar){r=e.value;let s=t.filter(i=>i.identify&&i.identify(r)||i.class&&r instanceof i.class);n=s.find(i=>i.format===e.format)||s.find(i=>!i.format);}else r=e,n=t.find(s=>s.nodeClass&&r instanceof s.nodeClass);if(!n){let s=r&&r.constructor?r.constructor.name:typeof r;throw new Error(`Tag not resolved for ${s} value`)}return n}function va(t,e,{anchors:n,doc:r}){let s=[],i=r.anchors.getName(t);return i&&(n[i]=t,s.push(`&${i}`)),t.tag?s.push(ui(r,t.tag)):e.default||s.push(ui(r,e.tag)),s.join(" ")}function zt(t,e,n,r){let{anchors:s,schema:i}=e.doc,o;if(!(t instanceof S.Node)){let l={aliasNodes:[],onTagObj:f=>o=f,prevObjects:new Map};t=i.createNode(t,true,null,l);for(let f of l.aliasNodes){f.source=f.source.node;let m=s.getName(f.source);m||(m=s.newName(),s.map[m]=f.source);}}if(t instanceof S.Pair)return t.toString(e,n,r);o||(o=ka(i.tags,t));let a=va(t,o,e);a.length>0&&(e.indentAtStart=(e.indentAtStart||0)+a.length+1);let c=typeof o.stringify=="function"?o.stringify(t,e,n,r):t instanceof S.Scalar?S.stringifyString(t,e,n,r):t.toString(e,n,r);return a?t instanceof S.Scalar||c[0]==="{"||c[0]==="["?`${a} ${c}`:`${a}
|
|
33031
|
+
${e.indent}${c}`:c}var zn=class t{static validAnchorNode(e){return e instanceof S.Scalar||e instanceof S.YAMLSeq||e instanceof S.YAMLMap}constructor(e){Y._defineProperty(this,"map",Object.create(null)),this.prefix=e;}createAlias(e,n){return this.setAnchor(e,n),new S.Alias(e)}createMergePair(...e){let n=new S.Merge;return n.value.items=e.map(r=>{if(r instanceof S.Alias){if(r.source instanceof S.YAMLMap)return r}else if(r instanceof S.YAMLMap)return this.createAlias(r);throw new Error("Merge sources must be Map nodes or their Aliases")}),n}getName(e){let{map:n}=this;return Object.keys(n).find(r=>n[r]===e)}getNames(){return Object.keys(this.map)}getNode(e){return this.map[e]}newName(e){e||(e=this.prefix);let n=Object.keys(this.map);for(let r=1;;++r){let s=`${e}${r}`;if(!n.includes(s))return s}}resolveNodes(){let{map:e,_cstAliases:n}=this;Object.keys(e).forEach(r=>{e[r]=e[r].resolved;}),n.forEach(r=>{r.source=r.source.resolved;}),delete this._cstAliases;}setAnchor(e,n){if(e!=null&&!t.validAnchorNode(e))throw new Error("Anchors may only be set for Scalar, Seq and Map nodes");if(n&&/[\x00-\x19\s,[\]{}]/.test(n))throw new Error("Anchor names must not contain whitespace or control characters");let{map:r}=this,s=e&&Object.keys(r).find(i=>r[i]===e);if(s)if(n)s!==n&&(delete r[s],r[n]=e);else return s;else {if(!n){if(!e)return null;n=this.newName();}r[n]=e;}return n}},Zt=(t,e)=>{if(t&&typeof t=="object"){let{tag:n}=t;t instanceof S.Collection?(n&&(e[n]=true),t.items.forEach(r=>Zt(r,e))):t instanceof S.Pair?(Zt(t.key,e),Zt(t.value,e)):t instanceof S.Scalar&&n&&(e[n]=true);}return e},Ia=t=>Object.keys(Zt(t,{}));function Pa(t,e){let n={before:[],after:[]},r,s=false;for(let i of e)if(i.valueRange){if(r!==void 0){let a="Document contains trailing content not separated by a ... or --- line";t.errors.push(new Y.YAMLSyntaxError(i,a));break}let o=S.resolveNode(t,i);s&&(o.spaceBefore=true,s=false),r=o;}else i.comment!==null?(r===void 0?n.before:n.after).push(i.comment):i.type===Y.Type.BLANK_LINE&&(s=true,r===void 0&&n.before.length>0&&!t.commentBefore&&(t.commentBefore=n.before.join(`
|
|
33032
|
+
`),n.before=[]));if(t.contents=r||null,!r)t.comment=n.before.concat(n.after).join(`
|
|
33033
|
+
`)||null;else {let i=n.before.join(`
|
|
33034
|
+
`);if(i){let o=r instanceof S.Collection&&r.items[0]?r.items[0]:r;o.commentBefore=o.commentBefore?`${i}
|
|
33035
|
+
${o.commentBefore}`:i;}t.comment=n.after.join(`
|
|
33036
|
+
`)||null;}}function _a({tagPrefixes:t},e){let[n,r]=e.parameters;if(!n||!r){let s="Insufficient parameters given for %TAG directive";throw new Y.YAMLSemanticError(e,s)}if(t.some(s=>s.handle===n)){let s="The %TAG directive must only be given at most once per handle in the same document.";throw new Y.YAMLSemanticError(e,s)}return {handle:n,prefix:r}}function xa(t,e){let[n]=e.parameters;if(e.name==="YAML:1.0"&&(n="1.0"),!n){let r="Insufficient parameters given for %YAML directive";throw new Y.YAMLSemanticError(e,r)}if(!pi[n]){let s=`Document will be parsed as YAML ${t.version||t.options.version} rather than YAML ${n}`;t.warnings.push(new Y.YAMLWarning(e,s));}return n}function Ra(t,e,n){let r=[],s=false;for(let i of e){let{comment:o,name:a}=i;switch(a){case "TAG":try{t.tagPrefixes.push(_a(t,i));}catch(c){t.errors.push(c);}s=true;break;case "YAML":case "YAML:1.0":if(t.version){let c="The %YAML directive must only be given at most once per document.";t.errors.push(new Y.YAMLSemanticError(i,c));}try{t.version=xa(t,i);}catch(c){t.errors.push(c);}s=true;break;default:if(a){let c=`YAML only supports %TAG and %YAML directives, and not %${a}`;t.warnings.push(new Y.YAMLWarning(i,c));}}o&&r.push(o);}if(n&&!s&&(t.version||n.version||t.options.version)==="1.1"){let i=({handle:o,prefix:a})=>({handle:o,prefix:a});t.tagPrefixes=n.tagPrefixes.map(i),t.version=n.version;}t.commentBefore=r.join(`
|
|
33037
|
+
`)||null;}function Ve(t){if(t instanceof S.Collection)return true;throw new Error("Expected a YAML collection as document contents")}var en=class t{constructor(e){this.anchors=new zn(e.anchorPrefix),this.commentBefore=null,this.comment=null,this.contents=null,this.directivesEndMarker=null,this.errors=[],this.options=e,this.schema=null,this.tagPrefixes=[],this.version=null,this.warnings=[];}add(e){return Ve(this.contents),this.contents.add(e)}addIn(e,n){Ve(this.contents),this.contents.addIn(e,n);}delete(e){return Ve(this.contents),this.contents.delete(e)}deleteIn(e){return S.isEmptyPath(e)?this.contents==null?false:(this.contents=null,true):(Ve(this.contents),this.contents.deleteIn(e))}getDefaults(){return t.defaults[this.version]||t.defaults[this.options.version]||{}}get(e,n){return this.contents instanceof S.Collection?this.contents.get(e,n):void 0}getIn(e,n){return S.isEmptyPath(e)?!n&&this.contents instanceof S.Scalar?this.contents.value:this.contents:this.contents instanceof S.Collection?this.contents.getIn(e,n):void 0}has(e){return this.contents instanceof S.Collection?this.contents.has(e):false}hasIn(e){return S.isEmptyPath(e)?this.contents!==void 0:this.contents instanceof S.Collection?this.contents.hasIn(e):false}set(e,n){Ve(this.contents),this.contents.set(e,n);}setIn(e,n){S.isEmptyPath(e)?this.contents=n:(Ve(this.contents),this.contents.setIn(e,n));}setSchema(e,n){if(!e&&!n&&this.schema)return;typeof e=="number"&&(e=e.toFixed(1)),e==="1.0"||e==="1.1"||e==="1.2"?(this.version?this.version=e:this.options.version=e,delete this.options.schema):e&&typeof e=="string"&&(this.options.schema=e),Array.isArray(n)&&(this.options.customTags=n);let r=Object.assign({},this.getDefaults(),this.options);this.schema=new fi.Schema(r);}parse(e,n){this.options.keepCstNodes&&(this.cstNode=e),this.options.keepNodeTypes&&(this.type="DOCUMENT");let{directives:r=[],contents:s=[],directivesEndMarker:i,error:o,valueRange:a}=e;if(o&&(o.source||(o.source=this),this.errors.push(o)),Ra(this,r,n),i&&(this.directivesEndMarker=true),this.range=a?[a.start,a.end]:null,this.setSchema(),this.anchors._cstAliases=[],Pa(this,s),this.anchors.resolveNodes(),this.options.prettyErrors){for(let c of this.errors)c instanceof Y.YAMLError&&c.makePretty();for(let c of this.warnings)c instanceof Y.YAMLError&&c.makePretty();}return this}listNonDefaultTags(){return Ia(this.contents).filter(e=>e.indexOf(fi.Schema.defaultPrefix)!==0)}setTagPrefix(e,n){if(e[0]!=="!"||e[e.length-1]!=="!")throw new Error("Handle must start and end with !");if(n){let r=this.tagPrefixes.find(s=>s.handle===e);r?r.prefix=n:this.tagPrefixes.push({handle:e,prefix:n});}else this.tagPrefixes=this.tagPrefixes.filter(r=>r.handle!==e);}toJSON(e,n){let{keepBlobsInJSON:r,mapAsMap:s,maxAliasCount:i}=this.options,o=r&&(typeof e!="string"||!(this.contents instanceof S.Scalar)),a={doc:this,indentStep:" ",keep:o,mapAsMap:o&&!!s,maxAliasCount:i,stringify:zt},c=Object.keys(this.anchors.map);c.length>0&&(a.anchors=new Map(c.map(f=>[this.anchors.map[f],{alias:[],aliasCount:0,count:1}])));let l=S.toJSON(this.contents,e,a);if(typeof n=="function"&&a.anchors)for(let{count:f,res:m}of a.anchors.values())n(m,f);return l}toString(){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");let e=this.options.indent;if(!Number.isInteger(e)||e<=0){let c=JSON.stringify(e);throw new Error(`"indent" option must be a positive integer, not ${c}`)}this.setSchema();let n=[],r=false;if(this.version){let c="%YAML 1.2";this.schema.name==="yaml-1.1"&&(this.version==="1.0"?c="%YAML:1.0":this.version==="1.1"&&(c="%YAML 1.1")),n.push(c),r=true;}let s=this.listNonDefaultTags();this.tagPrefixes.forEach(({handle:c,prefix:l})=>{s.some(f=>f.indexOf(l)===0)&&(n.push(`%TAG ${c} ${l}`),r=true);}),(r||this.directivesEndMarker)&&n.push("---"),this.commentBefore&&((r||!this.directivesEndMarker)&&n.unshift(""),n.unshift(this.commentBefore.replace(/^/gm,"#")));let i={anchors:Object.create(null),doc:this,indent:"",indentStep:" ".repeat(e),stringify:zt},o=false,a=null;if(this.contents){this.contents instanceof S.Node&&(this.contents.spaceBefore&&(r||this.directivesEndMarker)&&n.push(""),this.contents.commentBefore&&n.push(this.contents.commentBefore.replace(/^/gm,"#")),i.forceBlockIndent=!!this.comment,a=this.contents.comment);let c=a?null:()=>o=true,l=zt(this.contents,i,()=>a=null,c);n.push(S.addComment(l,"",a));}else this.contents!==void 0&&n.push(zt(this.contents,i));return this.comment&&((!o||a)&&n[n.length-1]!==""&&n.push(""),n.push(this.comment.replace(/^/gm,"#"))),n.join(`
|
|
33038
|
+
`)+`
|
|
33039
|
+
`}};Y._defineProperty(en,"defaults",pi);tn.Document=en;tn.defaultOptions=Ca;tn.scalarOptions=Ma;});var di=te(gi=>{var Zn=Rs(),Oe=mi(),Da=Xn(),Ya=le(),$a=Qn();qe();function Ba(t,e=true,n){n===void 0&&typeof e=="string"&&(n=e,e=true);let r=Object.assign({},Oe.Document.defaults[Oe.defaultOptions.version],Oe.defaultOptions);return new Da.Schema(r).createNode(t,e,n)}var We=class extends Oe.Document{constructor(e){super(Object.assign({},Oe.defaultOptions,e));}};function Fa(t,e){let n=[],r;for(let s of Zn.parse(t)){let i=new We(e);i.parse(s,r),n.push(i),r=i;}return n}function hi(t,e){let n=Zn.parse(t),r=new We(e).parse(n[0]);if(n.length>1){let s="Source contains multiple documents; please use YAML.parseAllDocuments()";r.errors.unshift(new Ya.YAMLSemanticError(n[1],s));}return r}function qa(t,e){let n=hi(t,e);if(n.warnings.forEach(r=>$a.warn(r)),n.errors.length>0)throw n.errors[0];return n.toJSON()}function Ua(t,e){let n=new We(e);return n.contents=t,String(n)}var Ka={createNode:Ba,defaultOptions:Oe.defaultOptions,Document:We,parse:qa,parseAllDocuments:Fa,parseCST:Zn.parse,parseDocument:hi,scalarOptions:Oe.scalarOptions,stringify:Ua};gi.YAML=Ka;});var Ei=te((Um,yi)=>{yi.exports=di().YAML;});var Si=te(J=>{var je=qe(),Qe=le();J.findPair=je.findPair;J.parseMap=je.resolveMap;J.parseSeq=je.resolveSeq;J.stringifyNumber=je.stringifyNumber;J.stringifyString=je.stringifyString;J.toJSON=je.toJSON;J.Type=Qe.Type;J.YAMLError=Qe.YAMLError;J.YAMLReferenceError=Qe.YAMLReferenceError;J.YAMLSemanticError=Qe.YAMLSemanticError;J.YAMLSyntaxError=Qe.YAMLSyntaxError;J.YAMLWarning=Qe.YAMLWarning;});var Xa={};nr(Xa,{languages:()=>_r,options:()=>xr,parsers:()=>tr,printers:()=>Ha});var Pi=(t,e,n,r)=>{if(!(t&&e==null))return e.replaceAll?e.replaceAll(n,r):n.global?e.replace(n,r):e.split(n).join(r)},Et=Pi;var Le="string",Je="array",Ge="cursor",He="indent",Ae="align",Xe="trim",Te="group",Ce="fill",he="if-break",ze="indent-if-break",Me="line-suffix",Ze="line-suffix-boundary",Z="line",et="label",ke="break-parent",St=new Set([Ge,He,Ae,Xe,Te,Ce,he,ze,Me,Ze,Z,et,ke]);var _i=(t,e,n)=>{if(!(t&&e==null))return Array.isArray(e)||typeof e=="string"?e[n<0?e.length+n:n]:e.at(n)},x=_i;function xi(t){if(typeof t=="string")return Le;if(Array.isArray(t))return Je;if(!t)return;let{type:e}=t;if(St.has(e))return e}var ve=xi;var Ri=t=>new Intl.ListFormat("en-US",{type:"disjunction"}).format(t);function Di(t){let e=t===null?"null":typeof t;if(e!=="string"&&e!=="object")return `Unexpected doc '${e}',
|
|
33040
|
+
Expected it to be 'string' or 'object'.`;if(ve(t))throw new Error("doc is valid.");let n=Object.prototype.toString.call(t);if(n!=="[object Object]")return `Unexpected doc '${n}'.`;let r=Ri([...St].map(s=>`'${s}'`));return `Unexpected doc.type '${t.type}'.
|
|
33041
|
+
Expected it to be ${r}.`}var nn=class extends Error{name="InvalidDocError";constructor(e){super(Di(e)),this.doc=e;}},rn=nn;function $i(t,e){if(typeof t=="string")return e(t);let n=new Map;return r(t);function r(i){if(n.has(i))return n.get(i);let o=s(i);return n.set(i,o),o}function s(i){switch(ve(i)){case Je:return e(i.map(r));case Ce:return e({...i,parts:i.parts.map(r)});case he:return e({...i,breakContents:r(i.breakContents),flatContents:r(i.flatContents)});case Te:{let{expandedStates:o,contents:a}=i;return o?(o=o.map(r),a=o[0]):a=r(a),e({...i,contents:a,expandedStates:o})}case Ae:case He:case ze:case et:case Me:return e({...i,contents:r(i.contents)});case Le:case Ge:case Xe:case Ze:case Z:case ke:return e(i);default:throw new rn(i)}}}function ir(t,e=tt){return $i(t,n=>typeof n=="string"?v(e,n.split(`
|
|
33042
|
+
`)):n)}var sn=()=>{},on=sn;function nt(t,e){return {type:Ae,contents:e,n:t}}function Ie(t,e={}){return on(e.expandedStates),{type:Te,id:e.id,contents:t,break:!!e.shouldBreak,expandedStates:e.expandedStates}}function an(t){return nt(Number.NEGATIVE_INFINITY,t)}function ar(t){return nt({type:"root"},t)}function cr(t){return nt(-1,t)}function cn(t,e){return Ie(t[0],{...e,expandedStates:t})}function wt(t){return {type:Ce,parts:t}}function rt(t,e="",n={}){return {type:he,breakContents:t,flatContents:e,groupId:n.groupId}}function lr(t){return {type:Me,contents:t}}var bt={type:ke};var Bi={type:Z,hard:true},Fi={type:Z,hard:true,literal:true},ne={type:Z},Nt={type:Z,soft:true},N=[Bi,bt],tt=[Fi,bt];function v(t,e){let n=[];for(let r=0;r<e.length;r++)r!==0&&n.push(t),n.push(e[r]);return n}function Ot(t){return (e,n,r)=>{let s=!!(r!=null&&r.backwards);if(n===false)return false;let{length:i}=e,o=n;for(;o>=0&&o<i;){let a=e.charAt(o);if(t instanceof RegExp){if(!t.test(a))return o}else if(!t.includes(a))return o;s?o--:o++;}return o===-1||o===i?o:false}}var ln=Ot(" ");function qi(t,e,n){let r=!!(n!=null&&n.backwards);if(e===false)return false;let s=t.charAt(e);if(r){if(t.charAt(e-1)==="\r"&&s===`
|
|
33043
|
+
`)return e-2;if(s===`
|
|
33044
|
+
`||s==="\r"||s==="\u2028"||s==="\u2029")return e-1}else {if(s==="\r"&&t.charAt(e+1)===`
|
|
33045
|
+
`)return e+2;if(s===`
|
|
33046
|
+
`||s==="\r"||s==="\u2028"||s==="\u2029")return e+1}return e}var fn=qi;function Ui(t,e){let n=e-1;n=ln(t,n,{backwards:true}),n=fn(t,n,{backwards:true}),n=ln(t,n,{backwards:true});let r=fn(t,n,{backwards:true});return n!==r}var fr=Ui;var un=class extends Error{name="UnexpectedNodeError";constructor(e,n,r="type"){super(`Unexpected ${n} node ${r}: ${JSON.stringify(e[r])}.`),this.node=e;}},ur=un;function pr(t,e){let{node:n}=t;if(n.type==="root"&&e.filepath&&/(?:[/\\]|^)\.(?:prettier|stylelint|lintstaged)rc$/u.test(e.filepath))return async r=>{let s=await r(e.originalText,{parser:"json"});return s?[s,N]:void 0}}pr.getVisitorKeys=()=>[];var mr=pr;var st=null;function it(t){if(st!==null&&typeof st.property){let e=st;return st=it.prototype=null,e}return st=it.prototype=t??Object.create(null),new it}var Ki=10;for(let t=0;t<=Ki;t++)it();function pn(t){return it(t)}function Vi(t,e="type"){pn(t);function n(r){let s=r[e],i=t[s];if(!Array.isArray(i))throw Object.assign(new Error(`Missing visitor keys for '${s}'.`),{node:r});return i}return n}var hr=Vi;var Wi=Object.fromEntries(Object.entries({root:["children"],document:["head","body","children"],documentHead:["children"],documentBody:["children"],directive:[],alias:[],blockLiteral:[],blockFolded:["children"],plain:["children"],quoteSingle:[],quoteDouble:[],mapping:["children"],mappingItem:["key","value","children"],mappingKey:["content","children"],mappingValue:["content","children"],sequence:["children"],sequenceItem:["content","children"],flowMapping:["children"],flowMappingItem:["key","value","children"],flowSequence:["children"],flowSequenceItem:["content","children"],comment:[],tag:[],anchor:[]}).map(([t,e])=>[t,[...e,"anchor","tag","indicatorComment","leadingComments","middleComments","trailingComment","endComments"]])),gr=Wi;var ji=hr(gr),dr=ji;function Pe(t){return t.position.start.offset}function yr(t){return t.position.end.offset}function Er(t){return /^\s*@(?:prettier|format)\s*$/u.test(t)}function Sr(t){return /^\s*#[^\S\n]*@(?:prettier|format)\s*?(?:\n|$)/u.test(t)}function wr(t){return `# @format
|
|
33047
|
+
|
|
33048
|
+
${t}`}function Qi(t){return Array.isArray(t)&&t.length>0}var _e=Qi;function H(t,e){return typeof(t==null?void 0:t.type)=="string"&&(!e||e.includes(t.type))}function mn(t,e,n){return e("children"in t?{...t,children:t.children.map(r=>mn(r,e,t))}:t,n)}function xe(t,e,n){Object.defineProperty(t,e,{get:n,enumerable:false});}function Nr(t,e){let n=0,r=e.length;for(let s=t.position.end.offset-1;s<r;s++){let i=e[s];if(i===`
|
|
33049
|
+
`&&n++,n===1&&/\S/u.test(i))return false;if(n===2)return true}return false}function Lt(t){let{node:e}=t;switch(e.type){case "tag":case "anchor":case "comment":return false}let n=t.stack.length;for(let r=1;r<n;r++){let s=t.stack[r],i=t.stack[r-1];if(Array.isArray(i)&&typeof s=="number"&&s!==i.length-1)return false}return true}function At(t){return _e(t.children)?At(x(false,t.children,-1)):t}function br(t){return t.value.trim()==="prettier-ignore"}function Or(t){let{node:e}=t;if(e.type==="documentBody"){let n=t.parent.head;return R(n)&&br(x(false,n.endComments,-1))}return ee(e)&&br(x(false,e.leadingComments,-1))}function Re(t){return !_e(t.children)&&!Ji(t)}function Ji(t){return ee(t)||ie(t)||hn(t)||K(t)||R(t)}function ee(t){return _e(t==null?void 0:t.leadingComments)}function ie(t){return _e(t==null?void 0:t.middleComments)}function hn(t){return t==null?void 0:t.indicatorComment}function K(t){return t==null?void 0:t.trailingComment}function R(t){return _e(t==null?void 0:t.endComments)}function Lr(t){let e=[],n;for(let r of t.split(/( +)/u))r!==" "?n===" "?e.push(r):e.push((e.pop()||"")+r):n===void 0&&e.unshift(""),n=r;return n===" "&&e.push((e.pop()||"")+" "),e[0]===""&&(e.shift(),e.unshift(" "+(e.shift()||""))),e}function Ar(t,e,n){let r=e.split(`
|
|
33050
|
+
`).map((s,i,o)=>i===0&&i===o.length-1?s:i!==0&&i!==o.length-1?s.trim():i===0?s.trimEnd():s.trimStart());return n.proseWrap==="preserve"?r.map(s=>s.length===0?[]:[s]):r.map(s=>s.length===0?[]:Lr(s)).reduce((s,i,o)=>o!==0&&r[o-1].length>0&&i.length>0&&!(t==="quoteDouble"&&x(false,x(false,s,-1),-1).endsWith("\\"))?[...s.slice(0,-1),[...x(false,s,-1),...i]]:[...s,i],[]).map(s=>n.proseWrap==="never"?[s.join(" ")]:s)}function Tr(t,{parentIndent:e,isLastDescendant:n,options:r}){let s=t.position.start.line===t.position.end.line?"":r.originalText.slice(t.position.start.offset,t.position.end.offset).match(/^[^\n]*\n(.*)$/su)[1],i;if(t.indent===null){let c=s.match(/^(?<leadingSpace> *)[^\n\r ]/mu);i=c?c.groups.leadingSpace.length:Number.POSITIVE_INFINITY;}else i=t.indent-1+e;let o=s.split(`
|
|
33051
|
+
`).map(c=>c.slice(i));if(r.proseWrap==="preserve"||t.type==="blockLiteral")return a(o.map(c=>c.length===0?[]:[c]));return a(o.map(c=>c.length===0?[]:Lr(c)).reduce((c,l,f)=>f!==0&&o[f-1].length>0&&l.length>0&&!/^\s/u.test(l[0])&&!/^\s|\s$/u.test(x(false,c,-1))?[...c.slice(0,-1),[...x(false,c,-1),...l]]:[...c,l],[]).map(c=>c.reduce((l,f)=>l.length>0&&/\s$/u.test(x(false,l,-1))?[...l.slice(0,-1),x(false,l,-1)+" "+f]:[...l,f],[])).map(c=>r.proseWrap==="never"?[c.join(" ")]:c));function a(c){if(t.chomping==="keep")return x(false,c,-1).length===0?c.slice(0,-1):c;let l=0;for(let f=c.length-1;f>=0&&c[f].length===0;f--)l++;return l===0?c:l>=2&&!n?c.slice(0,-(l-1)):c.slice(0,-l)}}function ot(t){if(!t)return true;switch(t.type){case "plain":case "quoteDouble":case "quoteSingle":case "alias":case "flowMapping":case "flowSequence":return true;default:return false}}var gn=new WeakMap;function Tt(t,e){let{node:n,root:r}=t,s;return gn.has(r)?s=gn.get(r):(s=new Set,gn.set(r,s)),!s.has(n.position.end.line)&&(s.add(n.position.end.line),Nr(n,e)&&!dn(t.parent))?Nt:""}function dn(t){return R(t)&&!H(t,["documentHead","documentBody","flowMapping","flowSequence"])}function I(t,e){return nt(" ".repeat(t),e)}function Gi(t,e,n){let{node:r}=t,s=t.ancestors.filter(l=>l.type==="sequence"||l.type==="mapping").length,i=Lt(t),o=[r.type==="blockFolded"?">":"|"];r.indent!==null&&o.push(r.indent.toString()),r.chomping!=="clip"&&o.push(r.chomping==="keep"?"+":"-"),hn(r)&&o.push(" ",e("indicatorComment"));let a=Tr(r,{parentIndent:s,isLastDescendant:i,options:n}),c=[];for(let[l,f]of a.entries())l===0&&c.push(N),c.push(wt(v(ne,f))),l!==a.length-1?c.push(f.length===0?N:ar(tt)):r.chomping==="keep"&&i&&c.push(an(f.length===0?N:tt));return r.indent===null?o.push(cr(I(n.tabWidth,c))):o.push(an(I(r.indent-1+s,c))),o}var Cr=Gi;function Ct(t,e,n){let{node:r}=t,s=r.type==="flowMapping",i=s?"{":"[",o=s?"}":"]",a=Nt;s&&r.children.length>0&&n.bracketSpacing&&(a=ne);let c=x(false,r.children,-1),l=(c==null?void 0:c.type)==="flowMappingItem"&&Re(c.key)&&Re(c.value);return [i,I(n.tabWidth,[a,Hi(t,e,n),n.trailingComma==="none"?"":rt(","),R(r)?[N,v(N,t.map(e,"endComments"))]:""]),l?"":a,o]}function Hi(t,e,n){return t.map(({isLast:r,node:s,next:i})=>[e(),r?"":[",",ne,s.position.start.line!==i.position.start.line?Tt(t,n.originalText):""]],"children")}function Xi(t,e,n){var C;let{node:r,parent:s}=t,{key:i,value:o}=r,a=Re(i),c=Re(o);if(a&&c)return ": ";let l=e("key"),f=zi(r)?" ":"";if(c)return r.type==="flowMappingItem"&&s.type==="flowMapping"?l:r.type==="mappingItem"&&yn(i.content,n)&&!K(i.content)&&((C=s.tag)==null?void 0:C.value)!=="tag:yaml.org,2002:set"?[l,f,":"]:["? ",I(2,l)];let m=e("value");if(a)return [": ",I(2,m)];if(ee(o)||!ot(i.content))return ["? ",I(2,l),N,...t.map(()=>[e(),N],"value","leadingComments"),": ",I(2,m)];if(Zi(i.content)&&!ee(i.content)&&!ie(i.content)&&!K(i.content)&&!R(i)&&!ee(o.content)&&!ie(o.content)&&!R(o)&&yn(o.content,n))return [l,f,": ",m];let d=Symbol("mappingKey"),y=Ie([rt("? "),Ie(I(2,l),{id:d})]),h=[N,": ",I(2,m)],g=[f,":"];ee(o.content)||R(o)&&o.content&&!H(o.content,["mapping","sequence"])||s.type==="mapping"&&K(i.content)&&ot(o.content)||H(o.content,["mapping","sequence"])&&o.content.tag===null&&o.content.anchor===null?g.push(N):o.content?g.push(ne):K(o)&&g.push(" "),g.push(m);let w=I(n.tabWidth,g);return yn(i.content,n)&&!ee(i.content)&&!ie(i.content)&&!R(i)?cn([[l,w]]):cn([[y,rt(h,w,{groupId:d})]])}function yn(t,e){if(!t)return true;switch(t.type){case "plain":case "quoteSingle":case "quoteDouble":break;case "alias":return true;default:return false}if(e.proseWrap==="preserve")return t.position.start.line===t.position.end.line;if(/\\$/mu.test(e.originalText.slice(t.position.start.offset,t.position.end.offset)))return false;switch(e.proseWrap){case "never":return !t.value.includes(`
|
|
33052
|
+
`);case "always":return !/[\n ]/u.test(t.value);default:return false}}function zi(t){var e;return ((e=t.key.content)==null?void 0:e.type)==="alias"}function Zi(t){if(!t)return true;switch(t.type){case "plain":case "quoteDouble":case "quoteSingle":return t.position.start.line===t.position.end.line;case "alias":return true;default:return false}}var Mr=Xi;function eo(t){return mn(t,to)}function to(t){switch(t.type){case "document":xe(t,"head",()=>t.children[0]),xe(t,"body",()=>t.children[1]);break;case "documentBody":case "sequenceItem":case "flowSequenceItem":case "mappingKey":case "mappingValue":xe(t,"content",()=>t.children[0]);break;case "mappingItem":case "flowMappingItem":xe(t,"key",()=>t.children[0]),xe(t,"value",()=>t.children[1]);break}return t}var kr=eo;function no(t,e,n){let{node:r}=t,s=[];r.type!=="mappingValue"&&ee(r)&&s.push([v(N,t.map(n,"leadingComments")),N]);let{tag:i,anchor:o}=r;i&&s.push(n("tag")),i&&o&&s.push(" "),o&&s.push(n("anchor"));let a="";return H(r,["mapping","sequence","comment","directive","mappingItem","sequenceItem"])&&!Lt(t)&&(a=Tt(t,e.originalText)),(i||o)&&(H(r,["sequence","mapping"])&&!ie(r)?s.push(N):s.push(" ")),ie(r)&&s.push([r.middleComments.length===1?"":N,v(N,t.map(n,"middleComments")),N]),Or(t)?s.push(ir(e.originalText.slice(r.position.start.offset,r.position.end.offset).trimEnd())):s.push(Ie(ro(t,e,n))),K(r)&&!H(r,["document","documentHead"])&&s.push(lr([r.type==="mappingValue"&&!r.content?"":" ",t.parent.type==="mappingKey"&&t.getParentNode(2).type==="mapping"&&ot(r)?"":bt,n("trailingComment")])),dn(r)&&s.push(I(r.type==="sequenceItem"?2:0,[N,v(N,t.map(({node:c})=>[fr(e.originalText,Pe(c))?N:"",n()],"endComments"))])),s.push(a),s}function ro(t,e,n){let{node:r}=t;switch(r.type){case "root":{let s=[];t.each(({node:o,next:a,isFirst:c})=>{c||s.push(N),s.push(n()),vr(o,a)?(s.push(N,"..."),K(o)&&s.push(" ",n("trailingComment"))):a&&!K(a.head)&&s.push(N,"---");},"children");let i=At(r);return (!H(i,["blockLiteral","blockFolded"])||i.chomping!=="keep")&&s.push(N),s}case "document":{let s=[];return io(t,e)==="head"&&((r.head.children.length>0||r.head.endComments.length>0)&&s.push(n("head")),K(r.head)?s.push(["---"," ",n(["head","trailingComment"])]):s.push("---")),so(r)&&s.push(n("body")),v(N,s)}case "documentHead":return v(N,[...t.map(n,"children"),...t.map(n,"endComments")]);case "documentBody":{let{children:s,endComments:i}=r,o="";if(s.length>0&&i.length>0){let a=At(r);H(a,["blockFolded","blockLiteral"])?a.chomping!=="keep"&&(o=[N,N]):o=N;}return [v(N,t.map(n,"children")),o,v(N,t.map(n,"endComments"))]}case "directive":return ["%",v(" ",[r.name,...r.parameters])];case "comment":return ["#",r.value];case "alias":return ["*",r.value];case "tag":return e.originalText.slice(r.position.start.offset,r.position.end.offset);case "anchor":return ["&",r.value];case "plain":return at(r.type,e.originalText.slice(r.position.start.offset,r.position.end.offset),e);case "quoteDouble":case "quoteSingle":{let s="'",i='"',o=e.originalText.slice(r.position.start.offset+1,r.position.end.offset-1);if(r.type==="quoteSingle"&&o.includes("\\")||r.type==="quoteDouble"&&/\\[^"]/u.test(o)){let c=r.type==="quoteDouble"?i:s;return [c,at(r.type,o,e),c]}if(o.includes(i))return [s,at(r.type,r.type==="quoteDouble"?Et(false,Et(false,o,String.raw`\"`,i),"'",s.repeat(2)):o,e),s];if(o.includes(s))return [i,at(r.type,r.type==="quoteSingle"?Et(false,o,"''",s):o,e),i];let a=e.singleQuote?s:i;return [a,at(r.type,o,e),a]}case "blockFolded":case "blockLiteral":return Cr(t,n,e);case "mapping":case "sequence":return v(N,t.map(n,"children"));case "sequenceItem":return ["- ",I(2,r.content?n("content"):"")];case "mappingKey":case "mappingValue":return r.content?n("content"):"";case "mappingItem":case "flowMappingItem":return Mr(t,n,e);case "flowMapping":return Ct(t,n,e);case "flowSequence":return Ct(t,n,e);case "flowSequenceItem":return n("content");default:throw new ur(r,"YAML")}}function so(t){return t.body.children.length>0||R(t.body)}function vr(t,e){return K(t)||e&&(e.head.children.length>0||R(e.head))}function io(t,e){let n=t.node;if(t.isFirst&&/---(?:\s|$)/u.test(e.originalText.slice(Pe(n),Pe(n)+4))||n.head.children.length>0||R(n.head)||K(n.head))return "head";let r=t.next;return vr(n,r)?false:r?"root":false}function at(t,e,n){let r=Ar(t,e,n);return v(N,r.map(s=>wt(v(ne,s))))}function Ir(t,e){if(H(t))switch(t.type){case "comment":if(Er(t.value))return null;break;case "quoteDouble":case "quoteSingle":e.type="quote";break}}Ir.ignoredProperties=new Set(["position"]);var oo={preprocess:kr,embed:mr,print:no,massageAstNode:Ir,insertPragma:wr,getVisitorKeys:dr},Pr=oo;var _r=[{linguistLanguageId:407,name:"YAML",type:"data",color:"#cb171e",tmScope:"source.yaml",aliases:["yml"],extensions:[".yml",".mir",".reek",".rviz",".sublime-syntax",".syntax",".yaml",".yaml-tmlanguage",".yaml.sed",".yml.mysql"],filenames:[".clang-format",".clang-tidy",".gemrc","CITATION.cff","glide.lock",".prettierrc",".stylelintrc",".lintstagedrc"],aceMode:"yaml",codemirrorMode:"yaml",codemirrorMimeType:"text/x-yaml",parsers:["yaml"],vscodeLanguageIds:["yaml","ansible","dockercompose","github-actions-workflow","home-assistant"]}];var Mt={bracketSpacing:{category:"Common",type:"boolean",default:true,description:"Print spaces between brackets.",oppositeDescription:"Do not print spaces between brackets."},singleQuote:{category:"Common",type:"boolean",default:false,description:"Use single quotes instead of double quotes."},proseWrap:{category:"Common",type:"choice",default:"preserve",description:"How to wrap prose.",choices:[{value:"always",description:"Wrap prose if it exceeds the print width."},{value:"never",description:"Do not wrap prose."},{value:"preserve",description:"Wrap prose as-is."}]}};var ao={bracketSpacing:Mt.bracketSpacing,singleQuote:Mt.singleQuote,proseWrap:Mt.proseWrap},xr=ao;var tr={};nr(tr,{yaml:()=>Ga});var kt=`
|
|
33053
|
+
`,Rr="\r",Dr=function(){function t(e){this.length=e.length;for(var n=[0],r=0;r<e.length;)switch(e[r]){case kt:r+=kt.length,n.push(r);break;case Rr:r+=Rr.length,e[r]===kt&&(r+=kt.length),n.push(r);break;default:r++;break}this.offsets=n;}return t.prototype.locationForIndex=function(e){if(e<0||e>this.length)return null;for(var n=0,r=this.offsets;r[n+1]<=e;)n++;var s=e-r[n];return {line:n,column:s}},t.prototype.indexForLocation=function(e){var n=e.line,r=e.column;return n<0||n>=this.offsets.length||r<0||r>this.lengthOfLine(n)?null:this.offsets[n]+r},t.prototype.lengthOfLine=function(e){var n=this.offsets[e],r=e===this.offsets.length-1?this.length:this.offsets[e+1];return r-n},t}();function $(t,e=null){"children"in t&&t.children.forEach(n=>$(n,t)),"anchor"in t&&t.anchor&&$(t.anchor,t),"tag"in t&&t.tag&&$(t.tag,t),"leadingComments"in t&&t.leadingComments.forEach(n=>$(n,t)),"middleComments"in t&&t.middleComments.forEach(n=>$(n,t)),"indicatorComment"in t&&t.indicatorComment&&$(t.indicatorComment,t),"trailingComment"in t&&t.trailingComment&&$(t.trailingComment,t),"endComments"in t&&t.endComments.forEach(n=>$(n,t)),Object.defineProperty(t,"_parent",{value:e,enumerable:false});}function de(t){return `${t.line}:${t.column}`}function Yr(t){$(t);let e=co(t),n=t.children.slice();t.comments.sort((r,s)=>r.position.start.offset-s.position.end.offset).filter(r=>!r._parent).forEach(r=>{for(;n.length>1&&r.position.start.line>n[0].position.end.line;)n.shift();lo(r,e,n[0]);});}function co(t){let e=Array.from(new Array(t.position.end.line),()=>({}));for(let n of t.comments)e[n.position.start.line-1].comment=n;return $r(e,t),e}function $r(t,e){if(e.position.start.offset!==e.position.end.offset){if("leadingComments"in e){let{start:n}=e.position,{leadingAttachableNode:r}=t[n.line-1];(!r||n.column<r.position.start.column)&&(t[n.line-1].leadingAttachableNode=e);}if("trailingComment"in e&&e.position.end.column>1&&e.type!=="document"&&e.type!=="documentHead"){let{end:n}=e.position,{trailingAttachableNode:r}=t[n.line-1];(!r||n.column>=r.position.end.column)&&(t[n.line-1].trailingAttachableNode=e);}if(e.type!=="root"&&e.type!=="document"&&e.type!=="documentHead"&&e.type!=="documentBody"){let{start:n,end:r}=e.position,s=[r.line].concat(n.line===r.line?[]:n.line);for(let i of s){let o=t[i-1].trailingNode;(!o||r.column>=o.position.end.column)&&(t[i-1].trailingNode=e);}}"children"in e&&e.children.forEach(n=>{$r(t,n);});}}function lo(t,e,n){let r=t.position.start.line,{trailingAttachableNode:s}=e[r-1];if(s){if(s.trailingComment)throw new Error(`Unexpected multiple trailing comment at ${de(t.position.start)}`);$(t,s),s.trailingComment=t;return}for(let o=r;o>=n.position.start.line;o--){let{trailingNode:a}=e[o-1],c;if(a)c=a;else if(o!==r&&e[o-1].comment)c=e[o-1].comment._parent;else continue;if((c.type==="sequence"||c.type==="mapping")&&(c=c.children[0]),c.type==="mappingItem"){let[l,f]=c.children;c=Br(l)?l:f;}for(;;){if(fo(c,t)){$(t,c),c.endComments.push(t);return}if(!c._parent)break;c=c._parent;}break}for(let o=r+1;o<=n.position.end.line;o++){let{leadingAttachableNode:a}=e[o-1];if(a){$(t,a),a.leadingComments.push(t);return}}let i=n.children[1];$(t,i),i.endComments.push(t);}function fo(t,e){if(t.position.start.offset<e.position.start.offset&&t.position.end.offset>e.position.end.offset)switch(t.type){case "flowMapping":case "flowSequence":return t.children.length===0||e.position.start.line>t.children[t.children.length-1].position.end.line}if(e.position.end.offset<t.position.end.offset)return false;switch(t.type){case "sequenceItem":return e.position.start.column>t.position.start.column;case "mappingKey":case "mappingValue":return e.position.start.column>t._parent.position.start.column&&(t.children.length===0||t.children.length===1&&t.children[0].type!=="blockFolded"&&t.children[0].type!=="blockLiteral")&&(t.type==="mappingValue"||Br(t));default:return false}}function Br(t){return t.position.start!==t.position.end&&(t.children.length===0||t.position.start.offset!==t.children[0].position.start.offset)}function b(t,e){return {type:t,position:e}}function Fr(t,e,n){return {...b("root",t),children:e,comments:n}}function ct(t){switch(t.type){case "DOCUMENT":for(let e=t.contents.length-1;e>=0;e--)t.contents[e].type==="BLANK_LINE"?t.contents.splice(e,1):ct(t.contents[e]);for(let e=t.directives.length-1;e>=0;e--)t.directives[e].type==="BLANK_LINE"&&t.directives.splice(e,1);break;case "FLOW_MAP":case "FLOW_SEQ":case "MAP":case "SEQ":for(let e=t.items.length-1;e>=0;e--){let n=t.items[e];"char"in n||(n.type==="BLANK_LINE"?t.items.splice(e,1):ct(n));}break;case "MAP_KEY":case "MAP_VALUE":case "SEQ_ITEM":t.node&&ct(t.node);break;case "ALIAS":case "BLANK_LINE":case "BLOCK_FOLDED":case "BLOCK_LITERAL":case "COMMENT":case "DIRECTIVE":case "PLAIN":case "QUOTE_DOUBLE":case "QUOTE_SINGLE":break;default:throw new Error(`Unexpected node type ${JSON.stringify(t.type)}`)}}function X(){return {leadingComments:[]}}function oe(t=null){return {trailingComment:t}}function B(){return {...X(),...oe()}}function qr(t,e,n){return {...b("alias",t),...B(),...e,value:n}}function Ur(t,e){let n=t.cstNode;return qr(e.transformRange({origStart:n.valueRange.origStart-1,origEnd:n.valueRange.origEnd}),e.transformContent(t),n.rawValue)}function Kr(t){return {...t,type:"blockFolded"}}function Vr(t,e,n,r,s,i){return {...b("blockValue",t),...X(),...e,chomping:n,indent:r,value:s,indicatorComment:i}}var ae;(function(t){t.Tag="!",t.Anchor="&",t.Comment="#";})(ae||(ae={}));function Wr(t,e){return {...b("anchor",t),value:e}}function De(t,e){return {...b("comment",t),value:e}}function jr(t,e,n){return {anchor:e,tag:t,middleComments:n}}function Qr(t,e){return {...b("tag",t),value:e}}function vt(t,e,n=()=>false){let r=t.cstNode,s=[],i=null,o=null,a=null;for(let c of r.props){let l=e.text[c.origStart];switch(l){case ae.Tag:i=i||c,o=Qr(e.transformRange(c),t.tag);break;case ae.Anchor:i=i||c,a=Wr(e.transformRange(c),r.anchor);break;case ae.Comment:{let f=De(e.transformRange(c),e.text.slice(c.origStart+1,c.origEnd));e.comments.push(f),!n(f)&&i&&i.origEnd<=c.origStart&&c.origEnd<=r.valueRange.origStart&&s.push(f);break}default:throw new Error(`Unexpected leading character ${JSON.stringify(l)}`)}}return jr(o,a,s)}var En;(function(t){t.CLIP="clip",t.STRIP="strip",t.KEEP="keep";})(En||(En={}));function It(t,e){let n=t.cstNode,r=1,s=n.chomping==="CLIP"?0:1,o=n.header.origEnd-n.header.origStart-r-s!==0,a=e.transformRange({origStart:n.header.origStart,origEnd:n.valueRange.origEnd}),c=null,l=vt(t,e,f=>{if(!(a.start.offset<f.position.start.offset&&f.position.end.offset<a.end.offset))return false;if(c)throw new Error(`Unexpected multiple indicator comments at ${de(f.position.start)}`);return c=f,true});return Vr(a,l,En[n.chomping],o?n.blockIndent:null,n.strValue,c)}function Jr(t,e){return Kr(It(t,e))}function Gr(t){return {...t,type:"blockLiteral"}}function Hr(t,e){return Gr(It(t,e))}function Xr(t,e){return De(e.transformRange(t.range),t.comment)}function zr(t,e,n){return {...b("directive",t),...B(),name:e,parameters:n}}function Ye(t,e){for(let n of t.props){let r=e.text[n.origStart];switch(r){case ae.Comment:e.comments.push(De(e.transformRange(n),e.text.slice(n.origStart+1,n.origEnd)));break;default:throw new Error(`Unexpected leading character ${JSON.stringify(r)}`)}}}function Zr(t,e){return Ye(t,e),zr(e.transformRange(t.range),t.name,t.parameters)}function es(t,e,n,r){return {...b("document",t),...oe(r),children:[e,n]}}function V(t,e){return {start:t,end:e}}function Sn(t){return {start:t,end:t}}function F(t=[]){return {endComments:t}}function ts(t,e,n){return {...b("documentBody",t),...F(n),children:e?[e]:[]}}function q(t){return t[t.length-1]}function Pt(t,e){let n=t.match(e);return n?n.index:-1}function ns(t,e,n){let r=t.cstNode,{comments:s,endComments:i,documentTrailingComment:o,documentHeadTrailingComment:a}=uo(r,e,n),c=e.transformNode(t.contents),{position:l,documentEndPoint:f}=po(r,c,e);return e.comments.push(...s,...i),{documentBody:ts(l,c,i),documentEndPoint:f,documentTrailingComment:o,documentHeadTrailingComment:a}}function uo(t,e,n){let r=[],s=[],i=[],o=[],a=false;for(let c=t.contents.length-1;c>=0;c--){let l=t.contents[c];if(l.type==="COMMENT"){let f=e.transformNode(l);n&&n.line===f.position.start.line?o.unshift(f):a?r.unshift(f):f.position.start.offset>=t.valueRange.origEnd?i.unshift(f):r.unshift(f);}else a=true;}if(i.length>1)throw new Error(`Unexpected multiple document trailing comments at ${de(i[1].position.start)}`);if(o.length>1)throw new Error(`Unexpected multiple documentHead trailing comments at ${de(o[1].position.start)}`);return {comments:r,endComments:s,documentTrailingComment:q(i)||null,documentHeadTrailingComment:q(o)||null}}function po(t,e,n){let r=Pt(n.text.slice(t.valueRange.origEnd),/^\.\.\./),s=r===-1?t.valueRange.origEnd:Math.max(0,t.valueRange.origEnd-1);n.text[s-1]==="\r"&&s--;let i=n.transformRange({origStart:e!==null?e.position.start.offset:s,origEnd:s}),o=r===-1?i.end:n.transformOffset(t.valueRange.origEnd+3);return {position:i,documentEndPoint:o}}function rs(t,e,n,r){return {...b("documentHead",t),...F(n),...oe(r),children:e}}function ss(t,e){let n=t.cstNode,{directives:r,comments:s,endComments:i}=mo(n,e),{position:o,endMarkerPoint:a}=ho(n,r,e);return e.comments.push(...s,...i),{createDocumentHeadWithTrailingComment:l=>(l&&e.comments.push(l),rs(o,r,i,l)),documentHeadEndMarkerPoint:a}}function mo(t,e){let n=[],r=[],s=[],i=false;for(let o=t.directives.length-1;o>=0;o--){let a=e.transformNode(t.directives[o]);a.type==="comment"?i?r.unshift(a):s.unshift(a):(i=true,n.unshift(a));}return {directives:n,comments:r,endComments:s}}function ho(t,e,n){let r=Pt(n.text.slice(0,t.valueRange.origStart),/---\s*$/);r>0&&!/[\r\n]/.test(n.text[r-1])&&(r=-1);let s=r===-1?{origStart:t.valueRange.origStart,origEnd:t.valueRange.origStart}:{origStart:r,origEnd:r+3};return e.length!==0&&(s.origStart=e[0].position.start.offset),{position:n.transformRange(s),endMarkerPoint:r===-1?null:n.transformOffset(r)}}function is(t,e){let{createDocumentHeadWithTrailingComment:n,documentHeadEndMarkerPoint:r}=ss(t,e),{documentBody:s,documentEndPoint:i,documentTrailingComment:o,documentHeadTrailingComment:a}=ns(t,e,r),c=n(a);return o&&e.comments.push(o),es(V(c.position.start,i),c,s,o)}function _t(t,e,n){return {...b("flowCollection",t),...B(),...F(),...e,children:n}}function os(t,e,n){return {..._t(t,e,n),type:"flowMapping"}}function xt(t,e,n){return {...b("flowMappingItem",t),...X(),children:[e,n]}}function ce(t,e){let n=[];for(let r of t)r&&"type"in r&&r.type==="COMMENT"?e.comments.push(e.transformNode(r)):n.push(r);return n}function Rt(t){let[e,n]=["?",":"].map(r=>{let s=t.find(i=>"char"in i&&i.char===r);return s?{origStart:s.origOffset,origEnd:s.origOffset+1}:null});return {additionalKeyRange:e,additionalValueRange:n}}function Dt(t,e){let n=e;return r=>t.slice(n,n=r)}function Yt(t){let e=[],n=Dt(t,1),r=false;for(let s=1;s<t.length-1;s++){let i=t[s];if("char"in i&&i.char===","){e.push(n(s)),n(s+1),r=false;continue}r=true;}return r&&e.push(n(t.length-1)),e}function wn(t,e){return {...b("mappingKey",t),...oe(),...F(),children:e?[e]:[]}}function bn(t,e){return {...b("mappingValue",t),...B(),...F(),children:e?[e]:[]}}function $e(t,e,n,r,s){let i=e.transformNode(t.key),o=e.transformNode(t.value),a=i||r?wn(e.transformRange({origStart:r?r.origStart:i.position.start.offset,origEnd:i?i.position.end.offset:r.origStart+1}),i):null,c=o||s?bn(e.transformRange({origStart:s?s.origStart:o.position.start.offset,origEnd:o?o.position.end.offset:s.origStart+1}),o):null;return n(V(a?a.position.start:c.position.start,c?c.position.end:a.position.end),a||wn(Sn(c.position.start),null),c||bn(Sn(a.position.end),null))}function as(t,e){let n=ce(t.cstNode.items,e),r=Yt(n),s=t.items.map((a,c)=>{let l=r[c],{additionalKeyRange:f,additionalValueRange:m}=Rt(l);return $e(a,e,xt,f,m)}),i=n[0],o=q(n);return os(e.transformRange({origStart:i.origOffset,origEnd:o.origOffset+1}),e.transformContent(t),s)}function cs(t,e,n){return {..._t(t,e,n),type:"flowSequence"}}function ls(t,e){return {...b("flowSequenceItem",t),children:[e]}}function fs(t,e){let n=ce(t.cstNode.items,e),r=Yt(n),s=t.items.map((a,c)=>{if(a.type!=="PAIR"){let l=e.transformNode(a);return ls(V(l.position.start,l.position.end),l)}else {let l=r[c],{additionalKeyRange:f,additionalValueRange:m}=Rt(l);return $e(a,e,xt,f,m)}}),i=n[0],o=q(n);return cs(e.transformRange({origStart:i.origOffset,origEnd:o.origOffset+1}),e.transformContent(t),s)}function us(t,e,n){return {...b("mapping",t),...X(),...e,children:n}}function ps(t,e,n){return {...b("mappingItem",t),...X(),children:[e,n]}}function ms(t,e){let n=t.cstNode;n.items.filter(o=>o.type==="MAP_KEY"||o.type==="MAP_VALUE").forEach(o=>Ye(o,e));let r=ce(n.items,e),s=go(r),i=t.items.map((o,a)=>{let c=s[a],[l,f]=c[0].type==="MAP_VALUE"?[null,c[0].range]:[c[0].range,c.length===1?null:c[1].range];return $e(o,e,ps,l,f)});return us(V(i[0].position.start,q(i).position.end),e.transformContent(t),i)}function go(t){let e=[],n=Dt(t,0),r=false;for(let s=0;s<t.length;s++){if(t[s].type==="MAP_VALUE"){e.push(n(s+1)),r=false;continue}r&&e.push(n(s)),r=true;}return r&&e.push(n(1/0)),e}function hs(t,e,n){return {...b("plain",t),...B(),...e,value:n}}function gs(t,e,n){for(let r=e;r>=0;r--)if(n.test(t[r]))return r;return -1}function ds(t,e){let n=t.cstNode;return hs(e.transformRange({origStart:n.valueRange.origStart,origEnd:gs(e.text,n.valueRange.origEnd-1,/\S/)+1}),e.transformContent(t),n.strValue)}function ys(t){return {...t,type:"quoteDouble"}}function Es(t,e,n){return {...b("quoteValue",t),...e,...B(),value:n}}function $t(t,e){let n=t.cstNode;return Es(e.transformRange(n.valueRange),e.transformContent(t),n.strValue)}function Ss(t,e){return ys($t(t,e))}function ws(t){return {...t,type:"quoteSingle"}}function bs(t,e){return ws($t(t,e))}function Ns(t,e,n){return {...b("sequence",t),...X(),...F(),...e,children:n}}function Os(t,e){return {...b("sequenceItem",t),...B(),...F(),children:e?[e]:[]}}function Ls(t,e){let r=ce(t.cstNode.items,e).map((s,i)=>{Ye(s,e);let o=e.transformNode(t.items[i]);return Os(V(e.transformOffset(s.valueRange.origStart),o===null?e.transformOffset(s.valueRange.origStart+1):o.position.end),o)});return Ns(V(r[0].position.start,q(r).position.end),e.transformContent(t),r)}function As(t,e){if(t===null||t.type===void 0&&t.value===null)return null;switch(t.type){case "ALIAS":return Ur(t,e);case "BLOCK_FOLDED":return Jr(t,e);case "BLOCK_LITERAL":return Hr(t,e);case "COMMENT":return Xr(t,e);case "DIRECTIVE":return Zr(t,e);case "DOCUMENT":return is(t,e);case "FLOW_MAP":return as(t,e);case "FLOW_SEQ":return fs(t,e);case "MAP":return ms(t,e);case "PLAIN":return ds(t,e);case "QUOTE_DOUBLE":return Ss(t,e);case "QUOTE_SINGLE":return bs(t,e);case "SEQ":return Ls(t,e);default:throw new Error(`Unexpected node type ${t.type}`)}}function Ts(t,e,n){let r=new SyntaxError(t);return r.name="YAMLSyntaxError",r.source=e,r.position=n,r}function Cs(t,e){let n=t.source.range||t.source.valueRange;return Ts(t.message,e.text,e.transformRange(n))}function Ms(t,e,n){return {offset:t,line:e,column:n}}function ks(t,e){t<0?t=0:t>e.text.length&&(t=e.text.length);let n=e.locator.locationForIndex(t);return Ms(t,n.line+1,n.column+1)}function vs(t,e){return V(e.transformOffset(t.origStart),e.transformOffset(t.origEnd))}function Is(t){if(!t.setOrigRanges()){let e=n=>{if(yo(n))return n.origStart=n.start,n.origEnd=n.end,true;if(Eo(n))return n.origOffset=n.offset,true};t.forEach(n=>Nn(n,e));}}function Nn(t,e){if(!(!t||typeof t!="object")&&e(t)!==true)for(let n of Object.keys(t)){if(n==="context"||n==="error")continue;let r=t[n];Array.isArray(r)?r.forEach(s=>Nn(s,e)):Nn(r,e);}}function yo(t){return typeof t.start=="number"}function Eo(t){return typeof t.offset=="number"}function On(t){if("children"in t){if(t.children.length===1){let e=t.children[0];if(e.type==="plain"&&e.tag===null&&e.anchor===null&&e.value==="")return t.children.splice(0,1),t}t.children.forEach(On);}return t}function Ln(t,e,n,r){let s=e(t);return i=>{r(s,i)&&n(t,s=i);}}function An(t){if(t===null||!("children"in t))return;let e=t.children;if(e.forEach(An),t.type==="document"){let[i,o]=t.children;i.position.start.offset===i.position.end.offset?i.position.start=i.position.end=o.position.start:o.position.start.offset===o.position.end.offset&&(o.position.start=o.position.end=i.position.end);}let n=Ln(t.position,So,wo,Oo),r=Ln(t.position,bo,No,Lo);"endComments"in t&&t.endComments.length!==0&&(n(t.endComments[0].position.start),r(q(t.endComments).position.end));let s=e.filter(i=>i!==null);if(s.length!==0){let i=s[0],o=q(s);n(i.position.start),r(o.position.end),"leadingComments"in i&&i.leadingComments.length!==0&&n(i.leadingComments[0].position.start),"tag"in i&&i.tag&&n(i.tag.position.start),"anchor"in i&&i.anchor&&n(i.anchor.position.start),"trailingComment"in o&&o.trailingComment&&r(o.trailingComment.position.end);}}function So(t){return t.start}function wo(t,e){t.start=e;}function bo(t){return t.end}function No(t,e){t.end=e;}function Oo(t,e){return e.offset<t.offset}function Lo(t,e){return e.offset>t.offset}var wi=sr(Ei());var G=sr(Si());G.default.findPair;G.default.toJSON;G.default.parseMap;G.default.parseSeq;G.default.stringifyNumber;G.default.stringifyString;G.default.Type;G.default.YAMLError;G.default.YAMLReferenceError;var er=G.default.YAMLSemanticError;G.default.YAMLSyntaxError;G.default.YAMLWarning;var{Document:bi,parseCST:Ni}=wi.default;function Oi(t){let e=Ni(t);Is(e);let n=e.map(a=>new bi({merge:false,keepCstNodes:true}).parse(a)),r=new Dr(t),s=[],i={text:t,locator:r,comments:s,transformOffset:a=>ks(a,i),transformRange:a=>vs(a,i),transformNode:a=>As(a,i),transformContent:a=>vt(a,i)};for(let a of n)for(let c of a.errors)if(!(c instanceof er&&c.message==='Map keys must be unique; "<<" is repeated'))throw Cs(c,i);n.forEach(a=>ct(a.cstNode));let o=Fr(i.transformRange({origStart:0,origEnd:i.text.length}),n.map(i.transformNode),s);return Yr(o),An(o),On(o),o}function Qa(t,e){let n=new SyntaxError(t+" ("+e.loc.start.line+":"+e.loc.start.column+")");return Object.assign(n,e)}var Li=Qa;function Ja(t){try{let e=Oi(t);return delete e.comments,e}catch(e){throw e!=null&&e.position?Li(e.message,{loc:e.position,cause:e}):e}}var Ga={astFormat:"yaml",parse:Ja,hasPragma:Sr,locStart:Pe,locEnd:yr};var Ha={yaml:Pr};return Ii(Xa);});
|
|
33054
|
+
} (yaml));
|
|
33055
|
+
return yaml.exports;
|
|
33056
|
+
}
|
|
33057
|
+
|
|
33058
|
+
requireYaml();
|
|
33059
|
+
|
|
32876
33060
|
var Au=Object.create;var At=Object.defineProperty;var vu=Object.getOwnPropertyDescriptor;var Bu=Object.getOwnPropertyNames;var wu=Object.getPrototypeOf,_u=Object.prototype.hasOwnProperty;var dr=e=>{throw TypeError(e)};var pr=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),vt=(e,t)=>{for(var r in t)At(e,r,{get:t[r],enumerable:true});},xu=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let u of Bu(t))!_u.call(e,u)&&u!==r&&At(e,u,{get:()=>t[u],enumerable:!(n=vu(t,u))||n.enumerable});return e};var Me=(e,t,r)=>(r=e!=null?Au(wu(e)):{},xu(At(r,"default",{value:e,enumerable:true}),e));var bu=(e,t,r)=>t.has(e)||dr("Cannot "+r);var Fr=(e,t,r)=>t.has(e)?dr("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r);var pe=(e,t,r)=>(bu(e,t,"access private method"),r);var ot=pr((Da,mn)=>{var Fn=new Proxy(String,{get:()=>Fn});mn.exports=Fn;});var $n=pr(ur=>{Object.defineProperty(ur,"__esModule",{value:true});function wi(){return new Proxy({},{get:()=>e=>e})}var Wn=/\r\n|[\n\r\u2028\u2029]/;function _i(e,t,r){let n=Object.assign({column:0,line:-1},e.start),u=Object.assign({},n,e.end),{linesAbove:i=2,linesBelow:o=3}=r||{},s=n.line,a=n.column,D=u.line,l=u.column,p=Math.max(s-(i+1),0),f=Math.min(t.length,D+o);s===-1&&(p=0),D===-1&&(f=t.length);let d=D-s,c={};if(d)for(let F=0;F<=d;F++){let m=F+s;if(!a)c[m]=true;else if(F===0){let h=t[m-1].length;c[m]=[a,h-a+1];}else if(F===d)c[m]=[0,l];else {let h=t[m-F].length;c[m]=[0,h];}}else a===l?a?c[s]=[a,0]:c[s]=true:c[s]=[a,l-a];return {start:p,end:f,markerLines:c}}function xi(e,t,r={}){let u=wi(),i=e.split(Wn),{start:o,end:s,markerLines:a}=_i(t,i,r),D=t.start&&typeof t.start.column=="number",l=String(s).length,f=e.split(Wn,s).slice(o,s).map((d,c)=>{let F=o+1+c,h=` ${` ${F}`.slice(-l)} |`,C=a[F],v=!a[F+1];if(C){let E="";if(Array.isArray(C)){let g=d.slice(0,Math.max(C[0]-1,0)).replace(/[^\t]/g," "),j=C[1]||1;E=[`
|
|
32877
33061
|
`,u.gutter(h.replace(/\d/g," "))," ",g,u.marker("^").repeat(j)].join(""),v&&r.message&&(E+=" "+u.message(r.message));}return [u.marker(">"),u.gutter(h),d.length>0?` ${d}`:"",E].join("")}else return ` ${u.gutter(h)}${d.length>0?` ${d}`:""}`}).join(`
|
|
32878
33062
|
`);return r.message&&!D&&(f=`${" ".repeat(l+1)}${r.message}
|
|
@@ -34116,7 +34300,7 @@ let manifest;
|
|
|
34116
34300
|
try {
|
|
34117
34301
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
34118
34302
|
// @ts-ignore
|
|
34119
|
-
manifest = (await import('../manifest-
|
|
34303
|
+
manifest = (await import('../manifest-0K2D8hcR.js')).default;
|
|
34120
34304
|
}
|
|
34121
34305
|
catch {
|
|
34122
34306
|
const name = "../dist/manifest.js";
|