diff --git a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/Bird+Mock.graphql.swift b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/Bird+Mock.graphql.swift index 77dd55596..054dbcc92 100644 --- a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/Bird+Mock.graphql.swift +++ b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/Bird+Mock.graphql.swift @@ -2,7 +2,7 @@ // This file was automatically generated and should not be edited. import ApolloTestSupport -import AnimalKingdomAPI +@testable import AnimalKingdomAPI public class Bird: MockObject { public static let objectType: ApolloAPI.Object = AnimalKingdomAPI.Objects.Bird @@ -26,17 +26,17 @@ public class Bird: MockObject { public extension Mock where O == Bird { convenience init( - bodyTemperature: Int? = nil, - favoriteToy: String? = nil, - height: Mock? = nil, + bodyTemperature: Int = 0, + favoriteToy: String = "", + height: Mock = Mock(), humanName: String? = nil, - id: AnimalKingdomAPI.ID? = nil, - laysEggs: Bool? = nil, + id: AnimalKingdomAPI.ID = "", + laysEggs: Bool = false, owner: Mock? = nil, - predators: [(any AnyMock)]? = nil, + predators: [(any AnyMock)] = [], skinCovering: GraphQLEnum? = nil, - species: String? = nil, - wingspan: Double? = nil + species: String = "", + wingspan: Double = 0.0 ) { self.init() _setScalar(bodyTemperature, for: \.bodyTemperature) diff --git a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/Cat+Mock.graphql.swift b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/Cat+Mock.graphql.swift index 4505fa489..16211a8ca 100644 --- a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/Cat+Mock.graphql.swift +++ b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/Cat+Mock.graphql.swift @@ -2,7 +2,7 @@ // This file was automatically generated and should not be edited. import ApolloTestSupport -import AnimalKingdomAPI +@testable import AnimalKingdomAPI public class Cat: MockObject { public static let objectType: ApolloAPI.Object = AnimalKingdomAPI.Objects.Cat @@ -26,17 +26,17 @@ public class Cat: MockObject { public extension Mock where O == Cat { convenience init( - bodyTemperature: Int? = nil, - favoriteToy: String? = nil, - height: Mock? = nil, + bodyTemperature: Int = 0, + favoriteToy: String = "", + height: Mock = Mock(), humanName: String? = nil, - id: AnimalKingdomAPI.ID? = nil, - isJellicle: Bool? = nil, - laysEggs: Bool? = nil, + id: AnimalKingdomAPI.ID = "", + isJellicle: Bool = false, + laysEggs: Bool = false, owner: Mock? = nil, - predators: [(any AnyMock)]? = nil, + predators: [(any AnyMock)] = [], skinCovering: GraphQLEnum? = nil, - species: String? = nil + species: String = "" ) { self.init() _setScalar(bodyTemperature, for: \.bodyTemperature) diff --git a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/Crocodile+Mock.graphql.swift b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/Crocodile+Mock.graphql.swift index 216665346..6d7fe377b 100644 --- a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/Crocodile+Mock.graphql.swift +++ b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/Crocodile+Mock.graphql.swift @@ -2,7 +2,7 @@ // This file was automatically generated and should not be edited. import ApolloTestSupport -import AnimalKingdomAPI +@testable import AnimalKingdomAPI public class Crocodile: MockObject { public static let objectType: ApolloAPI.Object = AnimalKingdomAPI.Objects.Crocodile @@ -22,12 +22,12 @@ public class Crocodile: MockObject { public extension Mock where O == Crocodile { convenience init( - age: Int? = nil, - height: Mock? = nil, - id: AnimalKingdomAPI.ID? = nil, - predators: [(any AnyMock)]? = nil, + age: Int = 0, + height: Mock = Mock(), + id: AnimalKingdomAPI.ID = "", + predators: [(any AnyMock)] = [], skinCovering: GraphQLEnum? = nil, - species: String? = nil, + species: String = "", tag: String? = nil ) { self.init() diff --git a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/Dog+Mock.graphql.swift b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/Dog+Mock.graphql.swift index d01b7cbc2..1fdb4a3da 100644 --- a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/Dog+Mock.graphql.swift +++ b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/Dog+Mock.graphql.swift @@ -2,7 +2,7 @@ // This file was automatically generated and should not be edited. import ApolloTestSupport -import AnimalKingdomAPI +@testable import AnimalKingdomAPI public class Dog: MockObject { public static let objectType: ApolloAPI.Object = AnimalKingdomAPI.Objects.Dog @@ -28,17 +28,17 @@ public class Dog: MockObject { public extension Mock where O == Dog { convenience init( birthdate: AnimalKingdomAPI.CustomDate? = nil, - bodyTemperature: Int? = nil, - favoriteToy: String? = nil, - height: Mock? = nil, + bodyTemperature: Int = 0, + favoriteToy: String = "", + height: Mock = Mock(), houseDetails: AnimalKingdomAPI.Object? = nil, humanName: String? = nil, - id: AnimalKingdomAPI.ID? = nil, - laysEggs: Bool? = nil, + id: AnimalKingdomAPI.ID = "", + laysEggs: Bool = false, owner: Mock? = nil, - predators: [(any AnyMock)]? = nil, + predators: [(any AnyMock)] = [], skinCovering: GraphQLEnum? = nil, - species: String? = nil + species: String = "" ) { self.init() _setScalar(birthdate, for: \.birthdate) diff --git a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/Fish+Mock.graphql.swift b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/Fish+Mock.graphql.swift index 0228c48ad..5ca817c42 100644 --- a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/Fish+Mock.graphql.swift +++ b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/Fish+Mock.graphql.swift @@ -2,7 +2,7 @@ // This file was automatically generated and should not be edited. import ApolloTestSupport -import AnimalKingdomAPI +@testable import AnimalKingdomAPI public class Fish: MockObject { public static let objectType: ApolloAPI.Object = AnimalKingdomAPI.Objects.Fish @@ -23,14 +23,14 @@ public class Fish: MockObject { public extension Mock where O == Fish { convenience init( - favoriteToy: String? = nil, - height: Mock? = nil, + favoriteToy: String = "", + height: Mock = Mock(), humanName: String? = nil, - id: AnimalKingdomAPI.ID? = nil, + id: AnimalKingdomAPI.ID = "", owner: Mock? = nil, - predators: [(any AnyMock)]? = nil, + predators: [(any AnyMock)] = [], skinCovering: GraphQLEnum? = nil, - species: String? = nil + species: String = "" ) { self.init() _setScalar(favoriteToy, for: \.favoriteToy) diff --git a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/Height+Mock.graphql.swift b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/Height+Mock.graphql.swift index 27f919e55..d20d00ea4 100644 --- a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/Height+Mock.graphql.swift +++ b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/Height+Mock.graphql.swift @@ -2,7 +2,7 @@ // This file was automatically generated and should not be edited. import ApolloTestSupport -import AnimalKingdomAPI +@testable import AnimalKingdomAPI public class Height: MockObject { public static let objectType: ApolloAPI.Object = AnimalKingdomAPI.Objects.Height @@ -20,11 +20,11 @@ public class Height: MockObject { public extension Mock where O == Height { convenience init( - centimeters: Double? = nil, - feet: Int? = nil, + centimeters: Double = 0.0, + feet: Int = 0, inches: Int? = nil, - meters: Int? = nil, - relativeSize: GraphQLEnum? = nil + meters: Int = 0, + relativeSize: GraphQLEnum = .case(.large) ) { self.init() _setScalar(centimeters, for: \.centimeters) diff --git a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/Human+Mock.graphql.swift b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/Human+Mock.graphql.swift index 301408b6a..394996841 100644 --- a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/Human+Mock.graphql.swift +++ b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/Human+Mock.graphql.swift @@ -2,7 +2,7 @@ // This file was automatically generated and should not be edited. import ApolloTestSupport -import AnimalKingdomAPI +@testable import AnimalKingdomAPI public class Human: MockObject { public static let objectType: ApolloAPI.Object = AnimalKingdomAPI.Objects.Human @@ -23,14 +23,14 @@ public class Human: MockObject { public extension Mock where O == Human { convenience init( - bodyTemperature: Int? = nil, - firstName: String? = nil, - height: Mock? = nil, - id: AnimalKingdomAPI.ID? = nil, - laysEggs: Bool? = nil, - predators: [(any AnyMock)]? = nil, + bodyTemperature: Int = 0, + firstName: String = "", + height: Mock = Mock(), + id: AnimalKingdomAPI.ID = "", + laysEggs: Bool = false, + predators: [(any AnyMock)] = [], skinCovering: GraphQLEnum? = nil, - species: String? = nil + species: String = "" ) { self.init() _setScalar(bodyTemperature, for: \.bodyTemperature) diff --git a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/MockObject+Interfaces.graphql.swift b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/MockObject+Interfaces.graphql.swift index 0fcfc230e..166cb8787 100644 --- a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/MockObject+Interfaces.graphql.swift +++ b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/MockObject+Interfaces.graphql.swift @@ -2,7 +2,7 @@ // This file was automatically generated and should not be edited. import ApolloTestSupport -import AnimalKingdomAPI +@testable import AnimalKingdomAPI public extension MockObject { typealias Animal = Interface diff --git a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/MockObject+Unions.graphql.swift b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/MockObject+Unions.graphql.swift index d0935b93f..d69e15691 100644 --- a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/MockObject+Unions.graphql.swift +++ b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/MockObject+Unions.graphql.swift @@ -2,7 +2,7 @@ // This file was automatically generated and should not be edited. import ApolloTestSupport -import AnimalKingdomAPI +@testable import AnimalKingdomAPI public extension MockObject { typealias ClassroomPet = Union diff --git a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/Mutation+Mock.graphql.swift b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/Mutation+Mock.graphql.swift index 572ea857c..c60765ff2 100644 --- a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/Mutation+Mock.graphql.swift +++ b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/Mutation+Mock.graphql.swift @@ -2,7 +2,7 @@ // This file was automatically generated and should not be edited. import ApolloTestSupport -import AnimalKingdomAPI +@testable import AnimalKingdomAPI public class Mutation: MockObject { public static let objectType: ApolloAPI.Object = AnimalKingdomAPI.Objects.Mutation @@ -16,7 +16,7 @@ public class Mutation: MockObject { public extension Mock where O == Mutation { convenience init( - adoptPet: (any AnyMock)? = nil + adoptPet: (any AnyMock) = Mock() ) { self.init() _setEntity(adoptPet, for: \.adoptPet) diff --git a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/PetRock+Mock.graphql.swift b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/PetRock+Mock.graphql.swift index d1405035f..78974ff95 100644 --- a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/PetRock+Mock.graphql.swift +++ b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/PetRock+Mock.graphql.swift @@ -2,7 +2,7 @@ // This file was automatically generated and should not be edited. import ApolloTestSupport -import AnimalKingdomAPI +@testable import AnimalKingdomAPI public class PetRock: MockObject { public static let objectType: ApolloAPI.Object = AnimalKingdomAPI.Objects.PetRock @@ -19,9 +19,9 @@ public class PetRock: MockObject { public extension Mock where O == PetRock { convenience init( - favoriteToy: String? = nil, + favoriteToy: String = "", humanName: String? = nil, - id: AnimalKingdomAPI.ID? = nil, + id: AnimalKingdomAPI.ID = "", owner: Mock? = nil ) { self.init() diff --git a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/Query+Mock.graphql.swift b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/Query+Mock.graphql.swift index 8405fbed7..f93555408 100644 --- a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/Query+Mock.graphql.swift +++ b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/Query+Mock.graphql.swift @@ -2,7 +2,7 @@ // This file was automatically generated and should not be edited. import ApolloTestSupport -import AnimalKingdomAPI +@testable import AnimalKingdomAPI public class Query: MockObject { public static let objectType: ApolloAPI.Object = AnimalKingdomAPI.Objects.Query @@ -19,10 +19,10 @@ public class Query: MockObject { public extension Mock where O == Query { convenience init( - allAnimals: [(any AnyMock)]? = nil, + allAnimals: [(any AnyMock)] = [], classroomPets: [(any AnyMock)?]? = nil, - findPet: [(any AnyMock)]? = nil, - pets: [(any AnyMock)]? = nil + findPet: [(any AnyMock)] = [], + pets: [(any AnyMock)] = [] ) { self.init() _setList(allAnimals, for: \.allAnimals) diff --git a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/Rat+Mock.graphql.swift b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/Rat+Mock.graphql.swift index 351b82b29..da1cb1145 100644 --- a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/Rat+Mock.graphql.swift +++ b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/Rat+Mock.graphql.swift @@ -2,7 +2,7 @@ // This file was automatically generated and should not be edited. import ApolloTestSupport -import AnimalKingdomAPI +@testable import AnimalKingdomAPI public class Rat: MockObject { public static let objectType: ApolloAPI.Object = AnimalKingdomAPI.Objects.Rat @@ -23,14 +23,14 @@ public class Rat: MockObject { public extension Mock where O == Rat { convenience init( - favoriteToy: String? = nil, - height: Mock? = nil, + favoriteToy: String = "", + height: Mock = Mock(), humanName: String? = nil, - id: AnimalKingdomAPI.ID? = nil, + id: AnimalKingdomAPI.ID = "", owner: Mock? = nil, - predators: [(any AnyMock)]? = nil, + predators: [(any AnyMock)] = [], skinCovering: GraphQLEnum? = nil, - species: String? = nil + species: String = "" ) { self.init() _setScalar(favoriteToy, for: \.favoriteToy) diff --git a/Tests/ApolloTests/Cache/FieldPolicyTests.swift b/Tests/ApolloTests/Cache/FieldPolicyTests.swift new file mode 100644 index 000000000..f0e8b8aa0 --- /dev/null +++ b/Tests/ApolloTests/Cache/FieldPolicyTests.swift @@ -0,0 +1,1374 @@ +import XCTest +@testable import Apollo +import ApolloAPI +import ApolloInternalTestHelpers + +@MainActor +final class FieldPolicyTests: XCTestCase, CacheDependentTesting { + + var cacheType: any TestCacheProvider.Type { + InMemoryTestCacheProvider.self + } + + static let defaultWaitTimeout: TimeInterval = 1.0 + + var cache: (any NormalizedCache)! + var server: MockGraphQLServer! + var client: ApolloClient! + + override func setUp() async throws { + try await super.setUp() + + cache = try await makeNormalizedCache() + let store = ApolloStore(cache: cache) + + server = MockGraphQLServer() + let networkTransport = MockNetworkTransport(server: server, store: store) + + client = ApolloClient(networkTransport: networkTransport, store: store) + } + + override func tearDownWithError() throws { + cache = nil + server = nil + client = nil + + try super.tearDownWithError() + } + + // MARK: - Single Key Argument Tests + + func test_fieldPolicy_withStringKeyArgument_resolvesCorrectCacheKey() throws { + class HeroSelectionSet: AbstractMockSelectionSet { + override class var __selections: [Selection] { [ + .field("hero", Hero.self, arguments: ["name": .variable("name")], fieldPolicy: .init(keyArgs: ["name"])) + ]} + + class Hero: AbstractMockSelectionSet { + override class var __parentType: any ParentType { + Object(typename: "Hero", implementedInterfaces: []) + } + override class var __selections: [Selection] { [ + .field("__typename", String.self), + .field("age", Int.self), + .field("name", String.self), + .field("isJedi", Bool.self), + .field("weight", Double.self) + ]} + } + } + + let query = MockQuery() + query.__variables = ["name": "Luke"] + + mergeRecordsIntoCache([ + "QUERY_ROOT": ["Hero:Luke": CacheReference("Hero:Luke")], + "Hero:Luke": [ + "age": 19, + "isJedi": true, + "name": "Luke", + "weight": 175.2, + "__typename": "Hero", + ] + ]) + + let resultObserver = makeResultObserver(for: query) + + let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in + try XCTAssertSuccessResult(result) { graphQLResult in + XCTAssertEqual(graphQLResult.source, .cache) + XCTAssertNil(graphQLResult.errors) + + let data = try XCTUnwrap(graphQLResult.data) + XCTAssertEqual(data.hero?.name, "Luke") + XCTAssertEqual(data.hero?.age, 19) + XCTAssertEqual(data.hero?.isJedi, true) + XCTAssertEqual(data.hero?.weight, 175.2) + } + } + + client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) + + wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) + } + + func test_fieldPolicy_withIntKeyArgument_resolvesCorrectCacheKey() throws { + class HeroSelectionSet: AbstractMockSelectionSet { + override class var __selections: [Selection] { [ + .field("hero", Hero.self, arguments: ["age": .variable("age")], fieldPolicy: .init(keyArgs: ["age"])) + ]} + + class Hero: AbstractMockSelectionSet { + override class var __parentType: any ParentType { + Object(typename: "Hero", implementedInterfaces: []) + } + override class var __selections: [Selection] { [ + .field("__typename", String.self), + .field("age", Int.self), + .field("name", String.self), + .field("isJedi", Bool.self), + .field("weight", Double.self) + ]} + } + } + + let query = MockQuery() + query.__variables = ["age": 19] + + mergeRecordsIntoCache([ + "QUERY_ROOT": ["Hero:19": CacheReference("Hero:19")], + "Hero:19": [ + "age": 19, + "isJedi": true, + "name": "Luke", + "weight": 175.2, + "__typename": "Hero", + ] + ]) + + let resultObserver = makeResultObserver(for: query) + + let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in + try XCTAssertSuccessResult(result) { graphQLResult in + XCTAssertEqual(graphQLResult.source, .cache) + XCTAssertNil(graphQLResult.errors) + + let data = try XCTUnwrap(graphQLResult.data) + XCTAssertEqual(data.hero?.name, "Luke") + XCTAssertEqual(data.hero?.age, 19) + XCTAssertEqual(data.hero?.isJedi, true) + XCTAssertEqual(data.hero?.weight, 175.2) + } + } + + client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) + + wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) + } + + func test_fieldPolicy_withDoubleKeyArgument_resolvesCorrectCacheKey() throws { + class HeroSelectionSet: AbstractMockSelectionSet { + override class var __selections: [Selection] { [ + .field("hero", Hero.self, arguments: ["weight": .variable("weight")], fieldPolicy: .init(keyArgs: ["weight"])) + ]} + + class Hero: AbstractMockSelectionSet { + override class var __parentType: any ParentType { + Object(typename: "Hero", implementedInterfaces: []) + } + override class var __selections: [Selection] { [ + .field("__typename", String.self), + .field("age", Int.self), + .field("name", String.self), + .field("isJedi", Bool.self), + .field("weight", Double.self) + ]} + } + } + + let query = MockQuery() + query.__variables = ["weight": 175.2] + + mergeRecordsIntoCache([ + "QUERY_ROOT": ["Hero:175.2": CacheReference("Hero:175.2")], + "Hero:175.2": [ + "age": 19, + "isJedi": true, + "name": "Luke", + "weight": 175.2, + "__typename": "Hero", + ] + ]) + + let resultObserver = makeResultObserver(for: query) + + let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in + try XCTAssertSuccessResult(result) { graphQLResult in + XCTAssertEqual(graphQLResult.source, .cache) + XCTAssertNil(graphQLResult.errors) + + let data = try XCTUnwrap(graphQLResult.data) + XCTAssertEqual(data.hero?.name, "Luke") + XCTAssertEqual(data.hero?.age, 19) + XCTAssertEqual(data.hero?.isJedi, true) + XCTAssertEqual(data.hero?.weight, 175.2) + } + } + + client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) + + wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) + } + + func test_fieldPolicy_withBoolKeyArgument_resolvesCorrectCacheKey() throws { + class HeroSelectionSet: AbstractMockSelectionSet { + override class var __selections: [Selection] { [ + .field("hero", Hero.self, arguments: ["isJedi": .variable("isJedi")], fieldPolicy: .init(keyArgs: ["isJedi"])) + ]} + + class Hero: AbstractMockSelectionSet { + override class var __parentType: any ParentType { + Object(typename: "Hero", implementedInterfaces: []) + } + override class var __selections: [Selection] { [ + .field("__typename", String.self), + .field("age", Int.self), + .field("name", String.self), + .field("isJedi", Bool.self), + .field("weight", Double.self) + ]} + } + } + + let query = MockQuery() + query.__variables = ["isJedi": true] + + mergeRecordsIntoCache([ + "QUERY_ROOT": ["Hero:true": CacheReference("Hero:true")], + "Hero:true": [ + "age": 19, + "isJedi": true, + "name": "Luke", + "weight": 175.2, + "__typename": "Hero", + ] + ]) + + let resultObserver = makeResultObserver(for: query) + + let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in + try XCTAssertSuccessResult(result) { graphQLResult in + XCTAssertEqual(graphQLResult.source, .cache) + XCTAssertNil(graphQLResult.errors) + + let data = try XCTUnwrap(graphQLResult.data) + XCTAssertEqual(data.hero?.name, "Luke") + XCTAssertEqual(data.hero?.age, 19) + XCTAssertEqual(data.hero?.isJedi, true) + XCTAssertEqual(data.hero?.weight, 175.2) + } + } + + client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) + + wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) + } + + func test_fieldPolicy_withListKeyArgument_resolvesCorrectCacheKey() throws { + class HeroSelectionSet: AbstractMockSelectionSet { + override class var __selections: [Selection] { [ + .field("heroes", [Hero].self, arguments: ["names": .variable("names")], fieldPolicy: .init(keyArgs: ["names"])) + ]} + var heroes: [Hero] { __data["heroes"] } + + class Hero: AbstractMockSelectionSet { + override class var __parentType: any ParentType { + Object(typename: "Hero", implementedInterfaces: []) + } + override class var __selections: [Selection] { [ + .field("__typename", String.self), + .field("age", Int.self), + .field("name", String.self), + .field("isJedi", Bool.self), + .field("weight", Double.self) + ]} + } + } + + let query = MockQuery() + query.__variables = ["names": ["Anakin", "Obi-Wan", "Ahsoka"]] + + mergeRecordsIntoCache([ + "QUERY_ROOT": [ + "Hero:Anakin": CacheReference("Hero:Anakin"), + "Hero:Obi-Wan": CacheReference("Hero:Obi-Wan"), + "Hero:Ahsoka": CacheReference("Hero:Ahsoka") + ], + "Hero:Anakin": [ + "age": 23, + "isJedi": true, + "name": "Anakin", + "weight": 185.3, + "__typename": "Hero", + ], + "Hero:Obi-Wan": [ + "age": 30, + "isJedi": true, + "name": "Obi-Wan", + "weight": 179.7, + "__typename": "Hero", + ], + "Hero:Ahsoka": [ + "age": 17, + "isJedi": true, + "name": "Ahsoka", + "weight": 138.5, + "__typename": "Hero", + ] + ]) + + let resultObserver = makeResultObserver(for: query) + + let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in + try XCTAssertSuccessResult(result) { graphQLResult in + XCTAssertEqual(graphQLResult.source, .cache) + XCTAssertNil(graphQLResult.errors) + + let data = try XCTUnwrap(graphQLResult.data) + + XCTAssertEqual(data.heroes[0].name, "Anakin") + XCTAssertEqual(data.heroes[0].age, 23) + XCTAssertEqual(data.heroes[0].isJedi, true) + XCTAssertEqual(data.heroes[0].weight, 185.3) + + XCTAssertEqual(data.heroes[1].name, "Obi-Wan") + XCTAssertEqual(data.heroes[1].age, 30) + XCTAssertEqual(data.heroes[1].isJedi, true) + XCTAssertEqual(data.heroes[1].weight, 179.7) + + XCTAssertEqual(data.heroes[2].name, "Ahsoka") + XCTAssertEqual(data.heroes[2].age, 17) + XCTAssertEqual(data.heroes[2].isJedi, true) + XCTAssertEqual(data.heroes[2].weight, 138.5) + } + } + + client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) + + wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) + } + + func test_fieldPolicy_withObjectKeyArgument_resolvesCorrectCacheKey() { + struct HeroSearchInput: InputObject { + public private(set) var __data: InputDict + + public init(_ data: InputDict) { + __data = data + } + + public init(name: String) { + __data = InputDict([ + "name": name + ]) + } + + public var name: String { + get { __data["name"] } + set { __data["name"] = newValue } + } + } + + class HeroSelectionSet: AbstractMockSelectionSet { + override class var __selections: [Selection] { [ + .field("hero", Hero.self, arguments: ["input": .variable("input")], fieldPolicy: .init(keyArgs: ["input.name"])) + ]} + + class Hero: AbstractMockSelectionSet { + override class var __parentType: any ParentType { + Object(typename: "Hero", implementedInterfaces: []) + } + override class var __selections: [Selection] { [ + .field("__typename", String.self), + .field("age", Int.self), + .field("name", String.self), + .field("isJedi", Bool.self), + .field("weight", Double.self) + ]} + } + } + + let query = MockQuery() + query.__variables = ["input": HeroSearchInput(name: "Luke")] + + mergeRecordsIntoCache([ + "QUERY_ROOT": ["Hero:Luke": CacheReference("Hero:Luke")], + "Hero:Luke": [ + "age": 19, + "isJedi": true, + "name": "Luke", + "weight": 175.2, + "__typename": "Hero", + ] + ]) + + let resultObserver = makeResultObserver(for: query) + + let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in + try XCTAssertSuccessResult(result) { graphQLResult in + XCTAssertEqual(graphQLResult.source, .cache) + XCTAssertNil(graphQLResult.errors) + + let data = try XCTUnwrap(graphQLResult.data) + XCTAssertEqual(data.hero?.name, "Luke") + XCTAssertEqual(data.hero?.age, 19) + XCTAssertEqual(data.hero?.isJedi, true) + XCTAssertEqual(data.hero?.weight, 175.2) + } + } + + client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) + + wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) + } + + func test_fieldPolicy_withNestedObjectKeyArgument_resolvesCorrectCacheKey() { + struct NameInput: InputObject { + public private(set) var __data: InputDict + + public init(_ data: InputDict) { + __data = data + } + + public init (name: String) { + __data = InputDict([ + "name": name + ]) + } + + public var name: String { + get { __data["name"] } + set { __data["name"] = newValue } + } + } + + struct HeroSearchInput: InputObject { + public private(set) var __data: InputDict + + public init(_ data: InputDict) { + __data = data + } + + public init(nameInput: NameInput) { + __data = InputDict([ + "nameInput": nameInput + ]) + } + + public var nameInput: NameInput { + get { __data["nameInput"] } + set { __data["nameInput"] = newValue } + } + } + + class HeroSelectionSet: AbstractMockSelectionSet { + override class var __selections: [Selection] { [ + .field("hero", Hero.self, arguments: ["input": .variable("input")], fieldPolicy: .init(keyArgs: ["input.nameInput.name"])) + ]} + + class Hero: AbstractMockSelectionSet { + override class var __parentType: any ParentType { + Object(typename: "Hero", implementedInterfaces: []) + } + override class var __selections: [Selection] { [ + .field("__typename", String.self), + .field("age", Int.self), + .field("name", String.self), + .field("isJedi", Bool.self), + .field("weight", Double.self) + ]} + } + } + + let query = MockQuery() + query.__variables = ["input": HeroSearchInput(nameInput: NameInput(name: "Luke"))] + + mergeRecordsIntoCache([ + "QUERY_ROOT": ["Hero:Luke": CacheReference("Hero:Luke")], + "Hero:Luke": [ + "age": 19, + "isJedi": true, + "name": "Luke", + "weight": 175.2, + "__typename": "Hero", + ] + ]) + + let resultObserver = makeResultObserver(for: query) + + let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in + try XCTAssertSuccessResult(result) { graphQLResult in + XCTAssertEqual(graphQLResult.source, .cache) + XCTAssertNil(graphQLResult.errors) + + let data = try XCTUnwrap(graphQLResult.data) + XCTAssertEqual(data.hero?.name, "Luke") + XCTAssertEqual(data.hero?.age, 19) + XCTAssertEqual(data.hero?.isJedi, true) + XCTAssertEqual(data.hero?.weight, 175.2) + } + } + + client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) + + wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) + } + + func test_fieldPolicy_withNestedObjectListKeyArgument_resolvesCorrectCacheKey() { + struct NameInput: InputObject { + public private(set) var __data: InputDict + + public init(_ data: InputDict) { + __data = data + } + + public init (names: [String]) { + __data = InputDict([ + "names": names + ]) + } + + public var names: [String] { + get { __data["names"] } + set { __data["names"] = newValue } + } + } + + struct HeroSearchInput: InputObject { + public private(set) var __data: InputDict + + public init(_ data: InputDict) { + __data = data + } + + public init(nameInput: NameInput) { + __data = InputDict([ + "nameInput": nameInput + ]) + } + + public var nameInput: NameInput { + get { __data["nameInput"] } + set { __data["nameInput"] = newValue } + } + } + + class HeroSelectionSet: AbstractMockSelectionSet { + override class var __selections: [Selection] { [ + .field("heroes", [Hero].self, arguments: ["input": .variable("input")], fieldPolicy: .init(keyArgs: ["input.nameInput.names"])) + ]} + var heroes: [Hero] { __data["heroes"] } + + class Hero: AbstractMockSelectionSet { + override class var __parentType: any ParentType { + Object(typename: "Hero", implementedInterfaces: []) + } + override class var __selections: [Selection] { [ + .field("__typename", String.self), + .field("age", Int.self), + .field("name", String.self), + .field("isJedi", Bool.self), + .field("weight", Double.self) + ]} + } + } + + let query = MockQuery() + query.__variables = ["input": HeroSearchInput(nameInput: NameInput(names: ["Anakin", "Obi-Wan", "Ahsoka"]))] + + mergeRecordsIntoCache([ + "QUERY_ROOT": [ + "Hero:Anakin": CacheReference("Hero:Anakin"), + "Hero:Obi-Wan": CacheReference("Hero:Obi-Wan"), + "Hero:Ahsoka": CacheReference("Hero:Ahsoka") + ], + "Hero:Anakin": [ + "age": 23, + "isJedi": true, + "name": "Anakin", + "weight": 185.3, + "__typename": "Hero", + ], + "Hero:Obi-Wan": [ + "age": 30, + "isJedi": true, + "name": "Obi-Wan", + "weight": 179.7, + "__typename": "Hero", + ], + "Hero:Ahsoka": [ + "age": 17, + "isJedi": true, + "name": "Ahsoka", + "weight": 138.5, + "__typename": "Hero", + ] + ]) + + let resultObserver = makeResultObserver(for: query) + + let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in + try XCTAssertSuccessResult(result) { graphQLResult in + XCTAssertEqual(graphQLResult.source, .cache) + XCTAssertNil(graphQLResult.errors) + + let data = try XCTUnwrap(graphQLResult.data) + + XCTAssertEqual(data.heroes[0].name, "Anakin") + XCTAssertEqual(data.heroes[0].age, 23) + XCTAssertEqual(data.heroes[0].isJedi, true) + XCTAssertEqual(data.heroes[0].weight, 185.3) + + XCTAssertEqual(data.heroes[1].name, "Obi-Wan") + XCTAssertEqual(data.heroes[1].age, 30) + XCTAssertEqual(data.heroes[1].isJedi, true) + XCTAssertEqual(data.heroes[1].weight, 179.7) + + XCTAssertEqual(data.heroes[2].name, "Ahsoka") + XCTAssertEqual(data.heroes[2].age, 17) + XCTAssertEqual(data.heroes[2].isJedi, true) + XCTAssertEqual(data.heroes[2].weight, 138.5) + } + } + + client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) + + wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) + } + + // MARK: - Multiple Key Argument Tests + + func test_fieldPolicy_withMultipleKeyArguments_resolvesCorrectCacheKey() { + class HeroSelectionSet: AbstractMockSelectionSet { + override class var __selections: [Selection] { [ + .field("hero", Hero.self, arguments: ["name": .variable("name"), "age": .variable("age")], fieldPolicy: .init(keyArgs: ["name", "age"])) + ]} + + class Hero: AbstractMockSelectionSet { + override class var __parentType: any ParentType { + Object(typename: "Hero", implementedInterfaces: []) + } + override class var __selections: [Selection] { [ + .field("__typename", String.self), + .field("age", Int.self), + .field("name", String.self), + .field("isJedi", Bool.self), + .field("weight", Double.self) + ]} + } + } + + let query = MockQuery() + query.__variables = ["name": "Luke", "age": 19] + + mergeRecordsIntoCache([ + "QUERY_ROOT": ["Hero:Luke+19": CacheReference("Hero:Luke+19")], + "Hero:Luke+19": [ + "age": 19, + "isJedi": true, + "name": "Luke", + "weight": 175.2, + "__typename": "Hero", + ] + ]) + + let resultObserver = makeResultObserver(for: query) + + let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in + try XCTAssertSuccessResult(result) { graphQLResult in + XCTAssertEqual(graphQLResult.source, .cache) + XCTAssertNil(graphQLResult.errors) + + let data = try XCTUnwrap(graphQLResult.data) + XCTAssertEqual(data.hero?.name, "Luke") + XCTAssertEqual(data.hero?.age, 19) + XCTAssertEqual(data.hero?.isJedi, true) + XCTAssertEqual(data.hero?.weight, 175.2) + } + } + + client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) + + wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) + } + + func test_fieldPolicy_withMultipleKeyArguments_withDifferentOrder_resolvesCorrectCacheKey() { + class HeroSelectionSet: AbstractMockSelectionSet { + override class var __selections: [Selection] { [ + .field("hero", Hero.self, arguments: ["name": .variable("name"), "age": .variable("age")], fieldPolicy: .init(keyArgs: ["age", "name"])) + ]} + + class Hero: AbstractMockSelectionSet { + override class var __parentType: any ParentType { + Object(typename: "Hero", implementedInterfaces: []) + } + override class var __selections: [Selection] { [ + .field("__typename", String.self), + .field("age", Int.self), + .field("name", String.self), + .field("isJedi", Bool.self), + .field("weight", Double.self) + ]} + } + } + + let query = MockQuery() + query.__variables = ["name": "Luke", "age": 19] + + mergeRecordsIntoCache([ + "QUERY_ROOT": ["Hero:19+Luke": CacheReference("Hero:19+Luke")], + "Hero:19+Luke": [ + "age": 19, + "isJedi": true, + "name": "Luke", + "weight": 175.2, + "__typename": "Hero", + ] + ]) + + let resultObserver = makeResultObserver(for: query) + + let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in + try XCTAssertSuccessResult(result) { graphQLResult in + XCTAssertEqual(graphQLResult.source, .cache) + XCTAssertNil(graphQLResult.errors) + + let data = try XCTUnwrap(graphQLResult.data) + XCTAssertEqual(data.hero?.name, "Luke") + XCTAssertEqual(data.hero?.age, 19) + XCTAssertEqual(data.hero?.isJedi, true) + XCTAssertEqual(data.hero?.weight, 175.2) + } + } + + client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) + + wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) + } + + func test_fieldPolicy_withMultipleKeyArguments_includingList_resolvesCorrectCacheKey() { + class HeroSelectionSet: AbstractMockSelectionSet { + override class var __selections: [Selection] { [ + .field("heroes", [Hero].self, arguments: ["names": .variable("names"), "isJedi": .variable("isJedi")], fieldPolicy: .init(keyArgs: ["names", "isJedi"])) + ]} + var heroes: [Hero] { __data["heroes"] } + + class Hero: AbstractMockSelectionSet { + override class var __parentType: any ParentType { + Object(typename: "Hero", implementedInterfaces: []) + } + override class var __selections: [Selection] { [ + .field("__typename", String.self), + .field("age", Int.self), + .field("name", String.self), + .field("isJedi", Bool.self), + .field("weight", Double.self) + ]} + } + } + + let query = MockQuery() + query.__variables = ["names": ["Anakin", "Obi-Wan", "Ahsoka"], "isJedi": true] + + mergeRecordsIntoCache([ + "QUERY_ROOT": [ + "Hero:Anakin+true": CacheReference("Hero:Anakin+true"), + "Hero:Obi-Wan+true": CacheReference("Hero:Obi-Wan+true"), + "Hero:Ahsoka+true": CacheReference("Hero:Ahsoka+true") + ], + "Hero:Anakin+true": [ + "age": 23, + "isJedi": true, + "name": "Anakin", + "weight": 185.3, + "__typename": "Hero", + ], + "Hero:Obi-Wan+true": [ + "age": 30, + "isJedi": true, + "name": "Obi-Wan", + "weight": 179.7, + "__typename": "Hero", + ], + "Hero:Ahsoka+true": [ + "age": 17, + "isJedi": true, + "name": "Ahsoka", + "weight": 138.5, + "__typename": "Hero", + ] + ]) + + let resultObserver = makeResultObserver(for: query) + + let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in + try XCTAssertSuccessResult(result) { graphQLResult in + XCTAssertEqual(graphQLResult.source, .cache) + XCTAssertNil(graphQLResult.errors) + + let data = try XCTUnwrap(graphQLResult.data) + + XCTAssertEqual(data.heroes[0].name, "Anakin") + XCTAssertEqual(data.heroes[0].age, 23) + XCTAssertEqual(data.heroes[0].isJedi, true) + XCTAssertEqual(data.heroes[0].weight, 185.3) + + XCTAssertEqual(data.heroes[1].name, "Obi-Wan") + XCTAssertEqual(data.heroes[1].age, 30) + XCTAssertEqual(data.heroes[1].isJedi, true) + XCTAssertEqual(data.heroes[1].weight, 179.7) + + XCTAssertEqual(data.heroes[2].name, "Ahsoka") + XCTAssertEqual(data.heroes[2].age, 17) + XCTAssertEqual(data.heroes[2].isJedi, true) + XCTAssertEqual(data.heroes[2].weight, 138.5) + } + } + + client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) + + wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) + } + + func test_fieldPolicy_withMultipleKeyArguments_includingObject_resolvesCorrectCacheKey() { + struct HeroSearchInput: InputObject { + public private(set) var __data: InputDict + + public init(_ data: InputDict) { + __data = data + } + + public init( + name: String, + isJedi: Bool + ) { + __data = InputDict([ + "name": name, + "isJedi": true + ]) + } + + public var name: String { + get { __data["name"] } + set { __data["name"] = newValue } + } + + public var isJedi: Bool { + get { __data["isJedi"] } + set { __data["isJedi"] = newValue } + } + } + + class HeroSelectionSet: AbstractMockSelectionSet { + override class var __selections: [Selection] { [ + .field("hero", Hero.self, arguments: ["input": .variable("input")], fieldPolicy: .init(keyArgs: ["input.name", "input.isJedi"])) + ]} + + class Hero: AbstractMockSelectionSet { + override class var __parentType: any ParentType { + Object(typename: "Hero", implementedInterfaces: []) + } + override class var __selections: [Selection] { [ + .field("__typename", String.self), + .field("age", Int.self), + .field("name", String.self), + .field("isJedi", Bool.self), + .field("weight", Double.self) + ]} + } + } + + let query = MockQuery() + query.__variables = ["input": HeroSearchInput(name: "Luke", isJedi: true)] + + mergeRecordsIntoCache([ + "QUERY_ROOT": ["Hero:Luke+true": CacheReference("Hero:Luke+true")], + "Hero:Luke+true": [ + "age": 19, + "isJedi": true, + "name": "Luke", + "weight": 175.2, + "__typename": "Hero", + ] + ]) + + let resultObserver = makeResultObserver(for: query) + + let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in + try XCTAssertSuccessResult(result) { graphQLResult in + XCTAssertEqual(graphQLResult.source, .cache) + XCTAssertNil(graphQLResult.errors) + + let data = try XCTUnwrap(graphQLResult.data) + XCTAssertEqual(data.hero?.name, "Luke") + XCTAssertEqual(data.hero?.age, 19) + XCTAssertEqual(data.hero?.isJedi, true) + XCTAssertEqual(data.hero?.weight, 175.2) + } + } + + client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) + + wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) + } + + func test_fieldPolicy_withMultipleKeyArguments_includingNestedObject_resolvesCorrectCacheKey() { + struct NameInput: InputObject { + public private(set) var __data: InputDict + + public init(_ data: InputDict) { + __data = data + } + + public init( + name: String + ) { + __data = InputDict([ + "name": name + ]) + } + + public var name: String { + get { __data["name"] } + set { __data["name"] = newValue } + } + } + + struct HeroSearchInput: InputObject { + public private(set) var __data: InputDict + + public init(_ data: InputDict) { + __data = data + } + + public init( + nameInput: NameInput, + isJedi: Bool + ) { + __data = InputDict([ + "nameInput": nameInput, + "isJedi": isJedi + ]) + } + + public var nameInput: NameInput { + get { __data["nameInput"] } + set { __data["nameInput"] = newValue } + } + + public var isJedi: Bool { + get { __data["isJedi"] } + set { __data["isJedi"] = newValue } + } + } + + class HeroSelectionSet: AbstractMockSelectionSet { + override class var __selections: [Selection] { [ + .field("hero", Hero.self, arguments: ["input": .variable("input")], fieldPolicy: .init(keyArgs: ["input.nameInput.name", "input.isJedi"])) + ]} + + class Hero: AbstractMockSelectionSet { + override class var __parentType: any ParentType { + Object(typename: "Hero", implementedInterfaces: []) + } + override class var __selections: [Selection] { [ + .field("__typename", String.self), + .field("age", Int.self), + .field("name", String.self), + .field("isJedi", Bool.self), + .field("weight", Double.self) + ]} + } + } + + let query = MockQuery() + query.__variables = ["input": HeroSearchInput(nameInput: NameInput(name: "Luke"), isJedi: true)] + + mergeRecordsIntoCache([ + "QUERY_ROOT": ["Hero:Luke+true": CacheReference("Hero:Luke+true")], + "Hero:Luke+true": [ + "age": 19, + "isJedi": true, + "name": "Luke", + "weight": 175.2, + "__typename": "Hero", + ] + ]) + + let resultObserver = makeResultObserver(for: query) + + let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in + try XCTAssertSuccessResult(result) { graphQLResult in + XCTAssertEqual(graphQLResult.source, .cache) + XCTAssertNil(graphQLResult.errors) + + let data = try XCTUnwrap(graphQLResult.data) + XCTAssertEqual(data.hero?.name, "Luke") + XCTAssertEqual(data.hero?.age, 19) + XCTAssertEqual(data.hero?.isJedi, true) + XCTAssertEqual(data.hero?.weight, 175.2) + } + } + + client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) + + wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) + } + + func test_fieldPolicy_withMultipleKeyArguments_includingNestedObjectList_resolvesCorrectCacheKey() { + struct NameInput: InputObject { + public private(set) var __data: InputDict + + public init(_ data: InputDict) { + __data = data + } + + public init (names: [String]) { + __data = InputDict([ + "names": names + ]) + } + + public var names: [String] { + get { __data["names"] } + set { __data["names"] = newValue } + } + } + + struct HeroSearchInput: InputObject { + public private(set) var __data: InputDict + + public init(_ data: InputDict) { + __data = data + } + + public init( + nameInput: NameInput, + isJedi: Bool + ) { + __data = InputDict([ + "nameInput": nameInput, + "isJedi": isJedi + ]) + } + + public var nameInput: NameInput { + get { __data["nameInput"] } + set { __data["nameInput"] = newValue } + } + + public var isJedi: Bool { + get { __data["isJedi"] } + set { __data["isJedi"] = newValue } + } + } + + class HeroSelectionSet: AbstractMockSelectionSet { + override class var __selections: [Selection] { [ + .field("heroes", [Hero].self, arguments: ["input": .variable("input")], fieldPolicy: .init(keyArgs: ["input.nameInput.names", "input.isJedi"])) + ]} + var heroes: [Hero] { __data["heroes"] } + + class Hero: AbstractMockSelectionSet { + override class var __parentType: any ParentType { + Object(typename: "Hero", implementedInterfaces: []) + } + override class var __selections: [Selection] { [ + .field("__typename", String.self), + .field("age", Int.self), + .field("name", String.self), + .field("isJedi", Bool.self), + .field("weight", Double.self) + ]} + } + } + + let query = MockQuery() + query.__variables = ["input": HeroSearchInput(nameInput: NameInput(names: ["Anakin", "Obi-Wan", "Ahsoka"]), isJedi: true)] + + mergeRecordsIntoCache([ + "QUERY_ROOT": [ + "Hero:Anakin+true": CacheReference("Hero:Anakin+true"), + "Hero:Obi-Wan+true": CacheReference("Hero:Obi-Wan+true"), + "Hero:Ahsoka+true": CacheReference("Hero:Ahsoka+true") + ], + "Hero:Anakin+true": [ + "age": 23, + "isJedi": true, + "name": "Anakin", + "weight": 185.3, + "__typename": "Hero", + ], + "Hero:Obi-Wan+true": [ + "age": 30, + "isJedi": true, + "name": "Obi-Wan", + "weight": 179.7, + "__typename": "Hero", + ], + "Hero:Ahsoka+true": [ + "age": 17, + "isJedi": true, + "name": "Ahsoka", + "weight": 138.5, + "__typename": "Hero", + ] + ]) + + let resultObserver = makeResultObserver(for: query) + + let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in + try XCTAssertSuccessResult(result) { graphQLResult in + XCTAssertEqual(graphQLResult.source, .cache) + XCTAssertNil(graphQLResult.errors) + + let data = try XCTUnwrap(graphQLResult.data) + + XCTAssertEqual(data.heroes[0].name, "Anakin") + XCTAssertEqual(data.heroes[0].age, 23) + XCTAssertEqual(data.heroes[0].isJedi, true) + XCTAssertEqual(data.heroes[0].weight, 185.3) + + XCTAssertEqual(data.heroes[1].name, "Obi-Wan") + XCTAssertEqual(data.heroes[1].age, 30) + XCTAssertEqual(data.heroes[1].isJedi, true) + XCTAssertEqual(data.heroes[1].weight, 179.7) + + XCTAssertEqual(data.heroes[2].name, "Ahsoka") + XCTAssertEqual(data.heroes[2].age, 17) + XCTAssertEqual(data.heroes[2].isJedi, true) + XCTAssertEqual(data.heroes[2].weight, 138.5) + } + } + + client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) + + wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) + } + + // MARK: - FieldPolicyProvider Tests + + func test_schemaConfiguration_givenFieldPolicyProvider_returnsSingleCacheKeyInfo() { + class HeroSelectionSet: AbstractMockSelectionSet { + override class var __selections: [Selection] { [ + .field("hero", Hero.self, arguments: ["name": .variable("name")]) + ]} + + class Hero: AbstractMockSelectionSet { + override class var __parentType: any ParentType { + Object(typename: "Hero", implementedInterfaces: []) + } + override class var __selections: [Selection] { [ + .field("__typename", String.self), + .field("age", Int.self), + .field("name", String.self), + .field("isJedi", Bool.self), + .field("weight", Double.self) + ]} + } + } + + FieldPolicySchemaMetadata.stub_cacheKeyForField_SingleReturn { _, _, _ in + return CacheKeyInfo(id: "Luke") + } + + let query = MockQuery() + query.__variables = ["name": "Luke"] + + mergeRecordsIntoCache([ + "QUERY_ROOT": ["Hero:Luke": CacheReference("Hero:Luke")], + "Hero:Luke": [ + "age": 19, + "isJedi": true, + "name": "Luke", + "weight": 175.2, + "__typename": "Hero", + ] + ]) + + let resultObserver = makeResultObserver(for: query) + + let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in + try XCTAssertSuccessResult(result) { graphQLResult in + XCTAssertEqual(graphQLResult.source, .cache) + XCTAssertNil(graphQLResult.errors) + + let data = try XCTUnwrap(graphQLResult.data) + XCTAssertEqual(data.hero?.name, "Luke") + XCTAssertEqual(data.hero?.age, 19) + XCTAssertEqual(data.hero?.isJedi, true) + XCTAssertEqual(data.hero?.weight, 175.2) + } + } + + client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) + + wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) + } + + func test_schemaConfiguration_givenFieldPolicyProvider_returnsListOfCacheKeyInfo() throws { + class HeroSelectionSet: AbstractMockSelectionSet { + override class var __selections: [Selection] { [ + .field("heroes", [Hero].self, arguments: ["names": .variable("names")]) + ]} + var heroes: [Hero] { __data["heroes"] } + + class Hero: AbstractMockSelectionSet { + override class var __parentType: any ParentType { + Object(typename: "Hero", implementedInterfaces: []) + } + override class var __selections: [Selection] { [ + .field("__typename", String.self), + .field("age", Int.self), + .field("name", String.self), + .field("isJedi", Bool.self), + .field("weight", Double.self) + ]} + } + } + + FieldPolicySchemaMetadata.stub_cacheKeyForField_ListReturn { _, _, _ in + return [ + CacheKeyInfo(id: "Anakin"), + CacheKeyInfo(id: "Obi-Wan"), + CacheKeyInfo(id: "Ahsoka") + ] + } + + let query = MockQuery() + query.__variables = ["names": ["Anakin", "Obi-Wan", "Ahsoka"]] + + mergeRecordsIntoCache([ + "QUERY_ROOT": [ + "Hero:Anakin": CacheReference("Hero:Anakin"), + "Hero:Obi-Wan": CacheReference("Hero:Obi-Wan"), + "Hero:Ahsoka": CacheReference("Hero:Ahsoka") + ], + "Hero:Anakin": [ + "age": 23, + "isJedi": true, + "name": "Anakin", + "weight": 185.3, + "__typename": "Hero", + ], + "Hero:Obi-Wan": [ + "age": 30, + "isJedi": true, + "name": "Obi-Wan", + "weight": 179.7, + "__typename": "Hero", + ], + "Hero:Ahsoka": [ + "age": 17, + "isJedi": true, + "name": "Ahsoka", + "weight": 138.5, + "__typename": "Hero", + ] + ]) + + let resultObserver = makeResultObserver(for: query) + + let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in + try XCTAssertSuccessResult(result) { graphQLResult in + XCTAssertEqual(graphQLResult.source, .cache) + XCTAssertNil(graphQLResult.errors) + + let data = try XCTUnwrap(graphQLResult.data) + + XCTAssertEqual(data.heroes[0].name, "Anakin") + XCTAssertEqual(data.heroes[0].age, 23) + XCTAssertEqual(data.heroes[0].isJedi, true) + XCTAssertEqual(data.heroes[0].weight, 185.3) + + XCTAssertEqual(data.heroes[1].name, "Obi-Wan") + XCTAssertEqual(data.heroes[1].age, 30) + XCTAssertEqual(data.heroes[1].isJedi, true) + XCTAssertEqual(data.heroes[1].weight, 179.7) + + XCTAssertEqual(data.heroes[2].name, "Ahsoka") + XCTAssertEqual(data.heroes[2].age, 17) + XCTAssertEqual(data.heroes[2].isJedi, true) + XCTAssertEqual(data.heroes[2].weight, 138.5) + } + } + + client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) + + wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) + } + +} + +class FieldPolicySchemaMetadata: SchemaMetadata { + init() { } + + static var _configuration: SchemaConfiguration.Type = SchemaConfiguration.self + static let configuration: any ApolloAPI.SchemaConfiguration.Type = SchemaConfiguration.self + + @MainActor + private static let testObserver = TestObserver() { _ in + stub_objectTypeForTypeName(nil) + stub_cacheKeyInfoForType_Object(nil) + } + + private static var _objectTypeForTypeName: ((String) -> Object?)? + static var objectTypeForTypeName: ((String) -> Object?)? { + _objectTypeForTypeName + } + + @MainActor + static func stub_objectTypeForTypeName(_ stub: ((String) -> Object?)?) { + _objectTypeForTypeName = stub + if _objectTypeForTypeName != nil { + testObserver.start() + } + } + + @MainActor + static func stub_cacheKeyInfoForType_Object( + _ stub: ((Object, ObjectData) -> CacheKeyInfo?)? + ){ + _configuration.stub_cacheKeyInfoForType_Object = stub + if stub != nil { + testObserver.start() + } + } + + @MainActor + static func stub_cacheKeyForField_SingleReturn( + _ stub: ((Selection.Field, GraphQLOperation.Variables?, ResponsePath) -> CacheKeyInfo?)? + ) { + _configuration.stub_cacheKeyForField_SingleReturn = stub + if stub != nil { + testObserver.start() + } + } + + @MainActor + static func stub_cacheKeyForField_ListReturn( + _ stub: ((Selection.Field, GraphQLOperation.Variables?, ResponsePath) -> [CacheKeyInfo]?)? + ) { + _configuration.stub_cacheKeyForField_ListReturn = stub + if stub != nil { + testObserver.start() + } + } + + static func objectType(forTypename __typename: String) -> Object? { + if let stub = objectTypeForTypeName { + return stub(__typename) + } + + return Object(typename: __typename, implementedInterfaces: []) + } + + class SchemaConfiguration: ApolloAPI.SchemaConfiguration, ApolloAPI.FieldPolicyProvider { + static var stub_cacheKeyInfoForType_Object: ((Object, ObjectData) -> CacheKeyInfo?)? + + static var stub_cacheKeyForField_SingleReturn: ((Selection.Field, GraphQLOperation.Variables?, ResponsePath) -> CacheKeyInfo?)? + + static var stub_cacheKeyForField_ListReturn: ((Selection.Field, GraphQLOperation.Variables?, ResponsePath) -> [CacheKeyInfo]?)? + + public static func cacheKeyInfo(for type: Object, object: ObjectData) -> CacheKeyInfo? { + stub_cacheKeyInfoForType_Object?(type, object) + } + + public static func cacheKey(for field: Selection.Field, variables: GraphQLOperation.Variables?, path: ResponsePath) -> CacheKeyInfo? { + stub_cacheKeyForField_SingleReturn?(field, variables, path) + } + + public static func cacheKeyList(for listField: Selection.Field, variables: GraphQLOperation.Variables?, path: ResponsePath) -> [CacheKeyInfo]? { + stub_cacheKeyForField_ListReturn?(listField, variables, path) + } + } +} diff --git a/Tests/ApolloTests/ResponsePathTests.swift b/Tests/ApolloTests/ResponsePathTests.swift index f767b0dd6..677b16dcb 100644 --- a/Tests/ApolloTests/ResponsePathTests.swift +++ b/Tests/ApolloTests/ResponsePathTests.swift @@ -1,5 +1,6 @@ import XCTest @testable import Apollo +import ApolloAPI import Nimble class ResponsePathTests: XCTestCase { diff --git a/apollo-ios-codegen/.gitignore b/apollo-ios-codegen/.gitignore index 130007eea..0f43df261 100644 --- a/apollo-ios-codegen/.gitignore +++ b/apollo-ios-codegen/.gitignore @@ -87,3 +87,5 @@ Tests/TestCodeGenConfigurations/EmbeddedInTarget-RelativeAbsolute/PackageTwo/Sou !Tests/TestCodeGenConfigurations/**/SchemaConfiguration.swift !Tests/TestCodeGenConfigurations/Other-CustomTarget/AnimalKingdomAPI/AnimalKingdomAPI.h !Tests/TestCodeGenConfigurations/EmbeddedInTarget-RelativeAbsolute/PackageTwo/Sources/PackageTwo/PackageTwo.swift + +Sources/GraphQLCompiler/JavaScript/coverage/ \ No newline at end of file diff --git a/apollo-ios-codegen/Sources/ApolloCodegenLib/Templates/SelectionSetTemplate.swift b/apollo-ios-codegen/Sources/ApolloCodegenLib/Templates/SelectionSetTemplate.swift index b5bda9593..4719b1218 100644 --- a/apollo-ios-codegen/Sources/ApolloCodegenLib/Templates/SelectionSetTemplate.swift +++ b/apollo-ios-codegen/Sources/ApolloCodegenLib/Templates/SelectionSetTemplate.swift @@ -346,6 +346,10 @@ struct SelectionSetTemplate { where: { !$0.isEmpty }, { args in ", arguments: " + renderValue(for: args, onFieldNamed: field.name, &deprecatedArguments) })\ + \(ifLet: field.fieldPolicyKeys, + where: { !$0.isEmpty }, { keys in + ", fieldPolicy: .init(keyArgs: [\"\(keys.joined(separator: "\", \""))\"])" + })\ ) """ } diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/ApolloCodegenFrontendBundle.swift b/apollo-ios-codegen/Sources/GraphQLCompiler/ApolloCodegenFrontendBundle.swift index 49c28eb09..1c53b405a 100644 --- a/apollo-ios-codegen/Sources/GraphQLCompiler/ApolloCodegenFrontendBundle.swift +++ b/apollo-ios-codegen/Sources/GraphQLCompiler/ApolloCodegenFrontendBundle.swift @@ -1 +1 @@ -let ApolloCodegenFrontendBundle: String = #"var ApolloCodegenFrontend=function(e){"use strict";function t(e){return"object"==typeof e&&null!==e}function n(e,t){throw new Error(t??"Unexpected invariant triggered.")}const r=/\r\n|[\n\r]/g;function i(e,t){let i=0,o=1;for(const s of e.body.matchAll(r)){if("number"==typeof s.index||n(),s.index>=t)break;i=s.index+s[0].length,o+=1}return{line:o,column:t+1-i}}function o(e,t){const n=e.locationOffset.column-1,r="".padStart(n)+e.body,i=t.line-1,o=e.locationOffset.line-1,a=t.line+o,c=1===t.line?n:0,u=t.column+c,l=`${e.name}:${a}:${u}\n`,p=r.split(/\r\n|[\n\r]/g),d=p[i];if(d.length>120){const e=Math.floor(u/80),t=u%80,n=[];for(let e=0;e["|",e])),["|","^".padStart(t)],["|",n[e+1]]])}return l+s([[a-1+" |",p[i-1]],[`${a} |`,d],["|","^".padStart(u)],[`${a+1} |`,p[i+1]]])}function s(e){const t=e.filter((([e,t])=>void 0!==t)),n=Math.max(...t.map((([e])=>e.length)));return t.map((([e,t])=>e.padStart(n)+(t?" "+t:""))).join("\n")}class GraphQLError extends Error{constructor(e,n={}){const{nodes:r,source:o,positions:s,path:c,originalError:u,extensions:l}=n;super(e),this.name="GraphQLError",this.path=c??void 0,this.originalError=u??void 0,this.nodes=a(Array.isArray(r)?r:r?[r]:void 0);const p=a(this.nodes?.map((e=>e.loc)).filter((e=>null!=e)));this.source=o??p?.[0]?.source,this.positions=s??p?.map((e=>e.start)),this.locations=s&&o?s.map((e=>i(o,e))):p?.map((e=>i(e.source,e.start)));const d=t(u?.extensions)?u?.extensions:void 0;this.extensions=l??d??Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),null!=u?.stack?Object.defineProperty(this,"stack",{value:u.stack,writable:!0,configurable:!0}):null!=Error.captureStackTrace?Error.captureStackTrace(this,GraphQLError):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let e=this.message;if(this.nodes)for(const n of this.nodes)n.loc&&(e+="\n\n"+o((t=n.loc).source,i(t.source,t.start)));else if(this.source&&this.locations)for(const t of this.locations)e+="\n\n"+o(this.source,t);var t;return e}toJSON(){const e={message:this.message};return null!=this.locations&&(e.locations=this.locations),null!=this.path&&(e.path=this.path),null!=this.extensions&&Object.keys(this.extensions).length>0&&(e.extensions=this.extensions),e}}function a(e){return void 0===e||0===e.length?void 0:e}function c(e,t,n){return new GraphQLError(`Syntax Error: ${n}`,{source:e,positions:[t]})}class Location{constructor(e,t,n){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=n}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}}class Token{constructor(e,t,n,r,i,o){this.kind=e,this.start=t,this.end=n,this.line=r,this.column=i,this.value=o,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}}const u={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentArgument:["name","value"],FragmentSpread:["name","arguments","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},l=new Set(Object.keys(u));function p(e){const t=e?.kind;return"string"==typeof t&&l.has(t)}const d={QUERY:"query",MUTATION:"mutation",SUBSCRIPTION:"subscription"},f={QUERY:"QUERY",MUTATION:"MUTATION",SUBSCRIPTION:"SUBSCRIPTION",FIELD:"FIELD",FRAGMENT_DEFINITION:"FRAGMENT_DEFINITION",FRAGMENT_SPREAD:"FRAGMENT_SPREAD",INLINE_FRAGMENT:"INLINE_FRAGMENT",VARIABLE_DEFINITION:"VARIABLE_DEFINITION",SCHEMA:"SCHEMA",SCALAR:"SCALAR",OBJECT:"OBJECT",FIELD_DEFINITION:"FIELD_DEFINITION",ARGUMENT_DEFINITION:"ARGUMENT_DEFINITION",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",ENUM_VALUE:"ENUM_VALUE",INPUT_OBJECT:"INPUT_OBJECT",INPUT_FIELD_DEFINITION:"INPUT_FIELD_DEFINITION",FRAGMENT_VARIABLE_DEFINITION:"FRAGMENT_VARIABLE_DEFINITION"},h="Name",m="Document",v="OperationDefinition",y="VariableDefinition",g="SelectionSet",T="Field",E="Argument",b="FragmentArgument",N="FragmentSpread",S="InlineFragment",L="FragmentDefinition",w="Variable",I="IntValue",O="FloatValue",k="StringValue",_="BooleanValue",A="NullValue",D="EnumValue",x="ListValue",$="ObjectValue",F="ObjectField",G="Directive",Q="NamedType",C="ListType",R="NonNullType",V="SchemaDefinition",j="OperationTypeDefinition",M="ScalarTypeDefinition",U="ObjectTypeDefinition",P="FieldDefinition",B="InputValueDefinition",J="InterfaceTypeDefinition",q="UnionTypeDefinition",K="EnumTypeDefinition",z="EnumValueDefinition",Y="InputObjectTypeDefinition",H="DirectiveDefinition",W="SchemaExtension",X="ScalarTypeExtension",Z="ObjectTypeExtension",ee="InterfaceTypeExtension",te="UnionTypeExtension",ne="EnumTypeExtension",re="InputObjectTypeExtension";var ie=Object.freeze({__proto__:null,ARGUMENT:E,BOOLEAN:_,DIRECTIVE:G,DIRECTIVE_DEFINITION:H,DOCUMENT:m,ENUM:D,ENUM_TYPE_DEFINITION:K,ENUM_TYPE_EXTENSION:ne,ENUM_VALUE_DEFINITION:z,FIELD:T,FIELD_DEFINITION:P,FLOAT:O,FRAGMENT_ARGUMENT:b,FRAGMENT_DEFINITION:L,FRAGMENT_SPREAD:N,INLINE_FRAGMENT:S,INPUT_OBJECT_TYPE_DEFINITION:Y,INPUT_OBJECT_TYPE_EXTENSION:re,INPUT_VALUE_DEFINITION:B,INT:I,INTERFACE_TYPE_DEFINITION:J,INTERFACE_TYPE_EXTENSION:ee,LIST:x,LIST_TYPE:C,NAME:h,NAMED_TYPE:Q,NON_NULL_TYPE:R,NULL:A,OBJECT:$,OBJECT_FIELD:F,OBJECT_TYPE_DEFINITION:U,OBJECT_TYPE_EXTENSION:Z,OPERATION_DEFINITION:v,OPERATION_TYPE_DEFINITION:j,SCALAR_TYPE_DEFINITION:M,SCALAR_TYPE_EXTENSION:X,SCHEMA_DEFINITION:V,SCHEMA_EXTENSION:W,SELECTION_SET:g,STRING:k,UNION_TYPE_DEFINITION:q,UNION_TYPE_EXTENSION:te,VARIABLE:w,VARIABLE_DEFINITION:y});function oe(e){return 9===e||32===e}function se(e){return e>=48&&e<=57}function ae(e){return e>=97&&e<=122||e>=65&&e<=90}function ce(e){return ae(e)||95===e}function ue(e){return ae(e)||se(e)||95===e}function le(e){let t=Number.MAX_SAFE_INTEGER,n=null,r=-1;for(let i=0;i0===n?e:e.slice(t))).slice(n??0,r+1)}function pe(e){let t=0;for(;t",EOF:"",BANG:"!",DOLLAR:"$",AMP:"&",PAREN_L:"(",PAREN_R:")",SPREAD:"...",COLON:":",EQUALS:"=",AT:"@",BRACKET_L:"[",BRACKET_R:"]",BRACE_L:"{",PIPE:"|",BRACE_R:"}",NAME:"Name",INT:"Int",FLOAT:"Float",STRING:"String",BLOCK_STRING:"BlockString",COMMENT:"Comment"};class Lexer{constructor(e){const t=new Token(fe.SOF,0,0,0,0);this.source=e,this.lastToken=t,this.token=t,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){this.lastToken=this.token;return this.token=this.lookahead()}lookahead(){let e=this.token;if(e.kind!==fe.EOF)do{if(e.next)e=e.next;else{const t=Ee(this,e.end);e.next=t,t.prev=e,e=t}}while(e.kind===fe.COMMENT);return e}}function he(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function me(e,t){return ve(e.charCodeAt(t))&&ye(e.charCodeAt(t+1))}function ve(e){return e>=55296&&e<=56319}function ye(e){return e>=56320&&e<=57343}function ge(e,t){const n=e.source.body.codePointAt(t);if(void 0===n)return fe.EOF;if(n>=32&&n<=126){const e=String.fromCodePoint(n);return'"'===e?"'\"'":`"${e}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function Te(e,t,n,r,i){const o=e.line,s=1+n-e.lineStart;return new Token(t,n,r,o,s,i)}function Ee(e,t){const n=e.source.body,r=n.length;let i=t;for(;i=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function _e(e,t){const n=e.source.body;switch(n.charCodeAt(t+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:"\n",size:2};case 114:return{value:"\r",size:2};case 116:return{value:"\t",size:2}}throw c(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}function Ae(e,t){const n=e.source.body,r=n.length;let i=e.lineStart,o=t+3,s=o,a="";const u=[];for(;oFe)return"[Array]";const n=Math.min($e,e.length),r=e.length-n,i=[];for(let r=0;r1&&i.push(`... ${r} more items`);return"["+i.join(", ")+"]"}(e,n);return function(e,t){const n=Object.entries(e);if(0===n.length)return"{}";if(t.length>Fe)return"["+function(e){const t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){const t=e.constructor.name;if("string"==typeof t&&""!==t)return t}return t}(e)+"]";const r=n.map((([e,n])=>e+": "+Qe(n,t)));return"{ "+r.join(", ")+" }"}(e,n)}(e,t);default:return String(e)}}const Ce=null!=globalThis.process&&"production"===process.env.NODE_ENV?function(e,t){return e instanceof t}:function(e,t){if(e instanceof t)return!0;if("object"==typeof e&&null!==e){const n=t.prototype[Symbol.toStringTag];if(n===(Symbol.toStringTag in e?e[Symbol.toStringTag]:e.constructor?.name)){const t=Ge(e);throw new Error(`Cannot use ${n} "${t}" from another module or realm.\n\nEnsure that there is only one instance of "graphql" in the node_modules\ndirectory. If different versions of "graphql" are the dependencies of other\nrelied on modules, use "resolutions" to ensure only one version is installed.\n\nhttps://yarnpkg.com/en/docs/selective-version-resolutions\n\nDuplicate "graphql" modules cannot be used at the same time since different\nversions may have different capabilities and behavior. The data from one\nversion used in the function from another could produce confusing and\nspurious results.`)}}return!1};class Source{constructor(e,t="GraphQL request",n={line:1,column:1}){this.body=e,this.name=t,this.locationOffset=n,this.locationOffset.line>0||xe(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||xe(0,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}function Re(e,t){const n=new Parser(e,t),r=n.parseDocument();return Object.defineProperty(r,"tokenCount",{enumerable:!1,value:n.tokenCount}),r}function Ve(e,t){const n=new Parser(e,t);n.expectToken(fe.SOF);const r=n.parseConstValueLiteral();return n.expectToken(fe.EOF),r}class Parser{constructor(e,t={}){const n=function(e){return Ce(e,Source)}(e)?e:new Source(e);this._lexer=new Lexer(n),this._options=t,this._tokenCounter=0}get tokenCount(){return this._tokenCounter}parseName(){const e=this.expectToken(fe.NAME);return this.node(e,{kind:h,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:m,definitions:this.many(fe.SOF,this.parseDefinition,fe.EOF)})}parseDefinition(){if(this.peek(fe.BRACE_L))return this.parseOperationDefinition();const e=this.peekDescription(),t=e?this._lexer.lookahead():this._lexer.token;if(t.kind===fe.NAME){switch(t.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}if(e)throw c(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(t.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(t)}parseOperationDefinition(){const e=this._lexer.token;if(this.peek(fe.BRACE_L))return this.node(e,{kind:v,operation:d.QUERY,name:void 0,variableDefinitions:void 0,directives:void 0,selectionSet:this.parseSelectionSet()});const t=this.parseOperationType();let n;return this.peek(fe.NAME)&&(n=this.parseName()),this.node(e,{kind:v,operation:t,name:n,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const e=this.expectToken(fe.NAME);switch(e.value){case"query":return d.QUERY;case"mutation":return d.MUTATION;case"subscription":return d.SUBSCRIPTION}throw this.unexpected(e)}parseVariableDefinitions(){return this.optionalMany(fe.PAREN_L,this.parseVariableDefinition,fe.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:y,variable:this.parseVariable(),type:(this.expectToken(fe.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(fe.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const e=this._lexer.token;return this.expectToken(fe.DOLLAR),this.node(e,{kind:w,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:g,selections:this.many(fe.BRACE_L,this.parseSelection,fe.BRACE_R)})}parseSelection(){return this.peek(fe.SPREAD)?this.parseFragment():this.parseField()}parseField(){const e=this._lexer.token,t=this.parseName();let n,r;return this.expectOptionalToken(fe.COLON)?(n=t,r=this.parseName()):r=t,this.node(e,{kind:T,alias:n,name:r,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(fe.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(e){const t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(fe.PAREN_L,t,fe.PAREN_R)}parseFragmentArguments(){const e=this.parseFragmentArgument;return this.optionalMany(fe.PAREN_L,e,fe.PAREN_R)}parseArgument(e=!1){const t=this._lexer.token,n=this.parseName();return this.expectToken(fe.COLON),this.node(t,{kind:E,name:n,value:this.parseValueLiteral(e)})}parseConstArgument(){return this.parseArgument(!0)}parseFragmentArgument(){const e=this._lexer.token,t=this.parseName();return this.expectToken(fe.COLON),this.node(e,{kind:b,name:t,value:this.parseValueLiteral(!1)})}parseFragment(){const e=this._lexer.token;this.expectToken(fe.SPREAD);const t=this.expectOptionalKeyword("on");if(!t&&this.peek(fe.NAME)){const t=this.parseFragmentName();return this.peek(fe.PAREN_L)&&this._options.experimentalFragmentArguments?this.node(e,{kind:N,name:t,arguments:this.parseFragmentArguments(),directives:this.parseDirectives(!1)}):this.node(e,{kind:N,name:t,directives:this.parseDirectives(!1)})}return this.node(e,{kind:S,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const e=this._lexer.token;return this.expectKeyword("fragment"),!0===this._options.experimentalFragmentArguments?this.node(e,{kind:L,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(e,{kind:L,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if("on"===this._lexer.token.value)throw this.unexpected();return this.parseName()}parseValueLiteral(e){const t=this._lexer.token;switch(t.kind){case fe.BRACKET_L:return this.parseList(e);case fe.BRACE_L:return this.parseObject(e);case fe.INT:return this.advanceLexer(),this.node(t,{kind:I,value:t.value});case fe.FLOAT:return this.advanceLexer(),this.node(t,{kind:O,value:t.value});case fe.STRING:case fe.BLOCK_STRING:return this.parseStringLiteral();case fe.NAME:switch(this.advanceLexer(),t.value){case"true":return this.node(t,{kind:_,value:!0});case"false":return this.node(t,{kind:_,value:!1});case"null":return this.node(t,{kind:A});default:return this.node(t,{kind:D,value:t.value})}case fe.DOLLAR:if(e){if(this.expectToken(fe.DOLLAR),this._lexer.token.kind===fe.NAME){const e=this._lexer.token.value;throw c(this._lexer.source,t.start,`Unexpected variable "$${e}" in constant value.`)}throw this.unexpected(t)}return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){const e=this._lexer.token;return this.advanceLexer(),this.node(e,{kind:k,value:e.value,block:e.kind===fe.BLOCK_STRING})}parseList(e){return this.node(this._lexer.token,{kind:x,values:this.any(fe.BRACKET_L,(()=>this.parseValueLiteral(e)),fe.BRACKET_R)})}parseObject(e){return this.node(this._lexer.token,{kind:$,fields:this.any(fe.BRACE_L,(()=>this.parseObjectField(e)),fe.BRACE_R)})}parseObjectField(e){const t=this._lexer.token,n=this.parseName();return this.expectToken(fe.COLON),this.node(t,{kind:F,name:n,value:this.parseValueLiteral(e)})}parseDirectives(e){const t=[];for(;this.peek(fe.AT);)t.push(this.parseDirective(e));if(t.length)return t}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(e){const t=this._lexer.token;return this.expectToken(fe.AT),this.node(t,{kind:G,name:this.parseName(),arguments:this.parseArguments(e)})}parseTypeReference(){const e=this._lexer.token;let t;if(this.expectOptionalToken(fe.BRACKET_L)){const n=this.parseTypeReference();this.expectToken(fe.BRACKET_R),t=this.node(e,{kind:C,type:n})}else t=this.parseNamedType();return this.expectOptionalToken(fe.BANG)?this.node(e,{kind:R,type:t}):t}parseNamedType(){return this.node(this._lexer.token,{kind:Q,name:this.parseName()})}peekDescription(){return this.peek(fe.STRING)||this.peek(fe.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("schema");const n=this.parseConstDirectives(),r=this.many(fe.BRACE_L,this.parseOperationTypeDefinition,fe.BRACE_R);return this.node(e,{kind:V,description:t,directives:n,operationTypes:r})}parseOperationTypeDefinition(){const e=this._lexer.token,t=this.parseOperationType();this.expectToken(fe.COLON);const n=this.parseNamedType();return this.node(e,{kind:j,operation:t,type:n})}parseScalarTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("scalar");const n=this.parseName(),r=this.parseConstDirectives();return this.node(e,{kind:M,description:t,name:n,directives:r})}parseObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("type");const n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:U,description:t,name:n,interfaces:r,directives:i,fields:o})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(fe.AMP,this.parseNamedType):void 0}parseFieldsDefinition(){return this.optionalMany(fe.BRACE_L,this.parseFieldDefinition,fe.BRACE_R)}parseFieldDefinition(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseName(),r=this.parseArgumentDefs();this.expectToken(fe.COLON);const i=this.parseTypeReference(),o=this.parseConstDirectives();return this.node(e,{kind:P,description:t,name:n,arguments:r,type:i,directives:o})}parseArgumentDefs(){return this.optionalMany(fe.PAREN_L,this.parseInputValueDef,fe.PAREN_R)}parseInputValueDef(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseName();this.expectToken(fe.COLON);const r=this.parseTypeReference();let i;this.expectOptionalToken(fe.EQUALS)&&(i=this.parseConstValueLiteral());const o=this.parseConstDirectives();return this.node(e,{kind:B,description:t,name:n,type:r,defaultValue:i,directives:o})}parseInterfaceTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("interface");const n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:J,description:t,name:n,interfaces:r,directives:i,fields:o})}parseUnionTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("union");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseUnionMemberTypes();return this.node(e,{kind:q,description:t,name:n,directives:r,types:i})}parseUnionMemberTypes(){return this.expectOptionalToken(fe.EQUALS)?this.delimitedMany(fe.PIPE,this.parseNamedType):void 0}parseEnumTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("enum");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();return this.node(e,{kind:K,description:t,name:n,directives:r,values:i})}parseEnumValuesDefinition(){return this.optionalMany(fe.BRACE_L,this.parseEnumValueDefinition,fe.BRACE_R)}parseEnumValueDefinition(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseEnumValueName(),r=this.parseConstDirectives();return this.node(e,{kind:z,description:t,name:n,directives:r})}parseEnumValueName(){if("true"===this._lexer.token.value||"false"===this._lexer.token.value||"null"===this._lexer.token.value)throw c(this._lexer.source,this._lexer.token.start,`${je(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("input");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();return this.node(e,{kind:Y,description:t,name:n,directives:r,fields:i})}parseInputFieldsDefinition(){return this.optionalMany(fe.BRACE_L,this.parseInputValueDef,fe.BRACE_R)}parseTypeSystemExtension(){const e=this._lexer.lookahead();if(e.kind===fe.NAME)switch(e.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(e)}parseSchemaExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const t=this.parseConstDirectives(),n=this.optionalMany(fe.BRACE_L,this.parseOperationTypeDefinition,fe.BRACE_R);if(void 0===t&&void 0===n)throw this.unexpected();return this.node(e,{kind:W,directives:t,operationTypes:n})}parseScalarTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const t=this.parseName(),n=this.parseConstDirectives();if(void 0===n)throw this.unexpected();return this.node(e,{kind:X,name:t,directives:n})}parseObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(void 0===n&&void 0===r&&void 0===i)throw this.unexpected();return this.node(e,{kind:Z,name:t,interfaces:n,directives:r,fields:i})}parseInterfaceTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(void 0===n&&void 0===r&&void 0===i)throw this.unexpected();return this.node(e,{kind:ee,name:t,interfaces:n,directives:r,fields:i})}parseUnionTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const t=this.parseName(),n=this.parseConstDirectives(),r=this.parseUnionMemberTypes();if(void 0===n&&void 0===r)throw this.unexpected();return this.node(e,{kind:te,name:t,directives:n,types:r})}parseEnumTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const t=this.parseName(),n=this.parseConstDirectives(),r=this.parseEnumValuesDefinition();if(void 0===n&&void 0===r)throw this.unexpected();return this.node(e,{kind:ne,name:t,directives:n,values:r})}parseInputObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const t=this.parseName(),n=this.parseConstDirectives(),r=this.parseInputFieldsDefinition();if(void 0===n&&void 0===r)throw this.unexpected();return this.node(e,{kind:re,name:t,directives:n,fields:r})}parseDirectiveDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(fe.AT);const n=this.parseName(),r=this.parseArgumentDefs(),i=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const o=this.parseDirectiveLocations();return this.node(e,{kind:H,description:t,name:n,arguments:r,repeatable:i,locations:o})}parseDirectiveLocations(){return this.delimitedMany(fe.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const e=this._lexer.token,t=this.parseName();if(Object.hasOwn(f,t.value))return t;throw this.unexpected(e)}node(e,t){return!0!==this._options.noLocation&&(t.loc=new Location(e,this._lexer.lastToken,this._lexer.source)),t}peek(e){return this._lexer.token.kind===e}expectToken(e){const t=this._lexer.token;if(t.kind===e)return this.advanceLexer(),t;throw c(this._lexer.source,t.start,`Expected ${Me(e)}, found ${je(t)}.`)}expectOptionalToken(e){return this._lexer.token.kind===e&&(this.advanceLexer(),!0)}expectKeyword(e){const t=this._lexer.token;if(t.kind!==fe.NAME||t.value!==e)throw c(this._lexer.source,t.start,`Expected "${e}", found ${je(t)}.`);this.advanceLexer()}expectOptionalKeyword(e){const t=this._lexer.token;return t.kind===fe.NAME&&t.value===e&&(this.advanceLexer(),!0)}unexpected(e){const t=e??this._lexer.token;return c(this._lexer.source,t.start,`Unexpected ${je(t)}.`)}any(e,t,n){this.expectToken(e);const r=[];for(;!this.expectOptionalToken(n);)r.push(t.call(this));return r}optionalMany(e,t,n){if(this.expectOptionalToken(e)){const e=[];do{e.push(t.call(this))}while(!this.expectOptionalToken(n));return e}}many(e,t,n){this.expectToken(e);const r=[];do{r.push(t.call(this))}while(!this.expectOptionalToken(n));return r}delimitedMany(e,t){this.expectOptionalToken(e);const n=[];do{n.push(t.call(this))}while(this.expectOptionalToken(e));return n}advanceLexer(){const{maxTokens:e}=this._options,t=this._lexer.advance();if(t.kind!==fe.EOF&&(++this._tokenCounter,void 0!==e&&this._tokenCounter>e))throw c(this._lexer.source,t.start,`Document contains more than ${e} tokens. Parsing aborted.`)}}function je(e){const t=e.value;return Me(e.kind)+(null!=t?` "${t}"`:"")}function Me(e){return function(e){return e===fe.BANG||e===fe.DOLLAR||e===fe.AMP||e===fe.PAREN_L||e===fe.PAREN_R||e===fe.SPREAD||e===fe.COLON||e===fe.EQUALS||e===fe.AT||e===fe.BRACKET_L||e===fe.BRACKET_R||e===fe.BRACE_L||e===fe.PIPE||e===fe.BRACE_R}(e)?`"${e}"`:e}class AccumulatorMap extends Map{get[Symbol.toStringTag](){return"AccumulatorMap"}add(e,t){const n=this.get(e);void 0===n?this.set(e,[t]):n.push(t)}}function Ue(e){return e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}function Pe(e){return Be("and",e)}function Be(e,t){switch(0!==t.length||n(),t.length){case 1:return t[0];case 2:return t[0]+" "+e+" "+t[1]}const r=t.slice(0,-1),i=t.at(-1);return r.join(", ")+", "+e+" "+i}function Je(e){return"object"==typeof e&&"function"==typeof e?.[Symbol.iterator]}function qe(e,t){const n=Object.create(null);for(const r of e)n[t(r)]=r;return n}function Ke(e,t){const n=Object.create(null);for(const r of Object.keys(e))n[r]=t(e[r],r);return n}function ze(e){return 0===e.length?"":` at ${e.map((e=>"number"==typeof e?`[${e}]`:`.${e}`)).join("")}`}const Ye=5;function He(e,t){const[n,r]=t?[e,t]:[void 0,e];if(0===r.length)return"";let i=" Did you mean ";null!=n&&(i+=n+" ");return i+Be("or",r.slice(0,Ye).map((e=>`"${e}"`)))+"?"}function We(e){return e}function Xe(e,t,n){const r=Object.create(null);for(const i of e)r[t(i)]=n(i);return r}function Ze(e,t){let n=0,r=0;for(;n0);let a=0;do{++r,a=10*a+o-et,o=t.charCodeAt(r)}while(nt(o)&&a>0);if(sa)return 1}else{if(io)return 1;++n,++r}}return e.length-t.length}const et=48,tt=57;function nt(e){return!isNaN(e)&&et<=e&&e<=tt}function rt(e,t){const n=Object.create(null),r=new LexicalDistance(e),i=Math.floor(.4*e.length)+1;for(const e of t){const t=r.measure(e,i);void 0!==t&&(n[e]=t)}return Object.keys(n).sort(((e,t)=>{const r=n[e]-n[t];return 0!==r?r:Ze(e,t)}))}class LexicalDistance{constructor(e){this._input=e,this._inputLowerCase=e.toLowerCase(),this._inputArray=it(this._inputLowerCase),this._rows=[new Array(e.length+1).fill(0),new Array(e.length+1).fill(0),new Array(e.length+1).fill(0)]}measure(e,t){if(this._input===e)return 0;const n=e.toLowerCase();if(this._inputLowerCase===n)return 1;let r=it(n),i=this._inputArray;if(r.lengtht)return;const a=this._rows;for(let e=0;e<=s;e++)a[0][e]=e;for(let e=1;e<=o;e++){const n=a[(e-1)%3],o=a[e%3];let c=o[0]=e;for(let t=1;t<=s;t++){const s=r[e-1]===i[t-1]?0:1;let u=Math.min(n[t]+1,o[t-1]+1,n[t-1]+s);if(e>1&&t>1&&r[e-1]===i[t-2]&&r[e-2]===i[t-1]){const n=a[(e-2)%3][t-2];u=Math.min(u,n+1)}ut)return}const c=a[o%3][s];return c<=t?c:void 0}}function it(e){const t=e.length,n=new Array(t);for(let r=0;re.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>mt(e.definitions,"\n\n")},OperationDefinition:{leave(e){const t=yt("(",mt(e.variableDefinitions,", "),")"),n=mt([e.operation,mt([e.name,t]),mt(e.directives," ")]," ");return("query"===n?"":n+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:n,directives:r})=>e+": "+t+yt(" = ",n)+yt(" ",mt(r," "))},SelectionSet:{leave:({selections:e})=>vt(e)},Field:{leave({alias:e,name:t,arguments:n,directives:r,selectionSet:i}){const o=mt([yt("",e,": "),t],"");return mt([Et(o,n),yt(" ",mt(r," ")),yt(" ",i)])}},Argument:{leave:({name:e,value:t})=>e+": "+t},FragmentArgument:{leave:({name:e,value:t})=>e+": "+t},FragmentSpread:{leave:({name:e,arguments:t,directives:n})=>Et("..."+e,t)+yt(" ",mt(n," "))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:n})=>mt(["...",yt("on ",e),mt(t," "),n]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:n,directives:r,selectionSet:i})=>`fragment ${e}${yt("(",mt(n,", "),")")} on ${t} ${yt("",mt(r," ")," ")}`+i},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>!0===t?function(e){const t=e.replaceAll('"""','\\"""'),n=t.split(/\r\n|[\n\r]/g),r=1===n.length,i=n.length>1&&n.slice(1).every((e=>0===e.length||oe(e.charCodeAt(0)))),o=t.endsWith('\\"""'),s=e.endsWith('"')&&!o,a=e.endsWith("\\"),c=s||a,u=!r||e.length>70||c||i||o;let l="";const p=r&&oe(e.charCodeAt(0));return(u&&!p||i)&&(l+="\n"),l+=t,(u||c)&&(l+="\n"),'"""'+l+'"""'}(e):`"${e.replace(st,at)}"`},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>{const t="["+mt(e,", ")+"]";return t.length>80?"[\n"+gt(mt(e,"\n"))+"\n]":t}},ObjectValue:{leave:({fields:e})=>{const t="{ "+mt(e,", ")+" }";return t.length>80?vt(e):t}},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+yt("(",mt(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:n})=>yt("",e,"\n")+mt(["schema",mt(t," "),vt(n)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:n})=>yt("",e,"\n")+mt(["scalar",t,mt(n," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>yt("",e,"\n")+mt(["type",t,yt("implements ",mt(n," & ")),mt(r," "),vt(i)]," ")},FieldDefinition:{leave:({description:e,name:t,arguments:n,type:r,directives:i})=>yt("",e,"\n")+t+(Tt(n)?yt("(\n",gt(mt(n,"\n")),"\n)"):yt("(",mt(n,", "),")"))+": "+r+yt(" ",mt(i," "))},InputValueDefinition:{leave:({description:e,name:t,type:n,defaultValue:r,directives:i})=>yt("",e,"\n")+mt([t+": "+n,yt("= ",r),mt(i," ")]," ")},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>yt("",e,"\n")+mt(["interface",t,yt("implements ",mt(n," & ")),mt(r," "),vt(i)]," ")},UnionTypeDefinition:{leave:({description:e,name:t,directives:n,types:r})=>yt("",e,"\n")+mt(["union",t,mt(n," "),yt("= ",mt(r," | "))]," ")},EnumTypeDefinition:{leave:({description:e,name:t,directives:n,values:r})=>yt("",e,"\n")+mt(["enum",t,mt(n," "),vt(r)]," ")},EnumValueDefinition:{leave:({description:e,name:t,directives:n})=>yt("",e,"\n")+mt([t,mt(n," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:n,fields:r})=>yt("",e,"\n")+mt(["input",t,mt(n," "),vt(r)]," ")},DirectiveDefinition:{leave:({description:e,name:t,arguments:n,repeatable:r,locations:i})=>yt("",e,"\n")+"directive @"+t+(Tt(n)?yt("(\n",gt(mt(n,"\n")),"\n)"):yt("(",mt(n,", "),")"))+(r?" repeatable":"")+" on "+mt(i," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>mt(["extend schema",mt(e," "),vt(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>mt(["extend scalar",e,mt(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>mt(["extend type",e,yt("implements ",mt(t," & ")),mt(n," "),vt(r)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>mt(["extend interface",e,yt("implements ",mt(t," & ")),mt(n," "),vt(r)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:n})=>mt(["extend union",e,mt(t," "),yt("= ",mt(n," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:n})=>mt(["extend enum",e,mt(t," "),vt(n)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:n})=>mt(["extend input",e,mt(t," "),vt(n)]," ")}};function mt(e,t=""){return e?.filter((e=>e)).join(t)??""}function vt(e){return yt("{\n",gt(mt(e,"\n")),"\n}")}function yt(e,t,n=""){return null!=t&&""!==t?e+t+n:""}function gt(e){return yt(" ",e.replaceAll("\n","\n "))}function Tt(e){return e?.some((e=>e.includes("\n")))??!1}function Et(e,t){let n=e+yt("(",mt(t,", "),")");return n.length>80&&(n=e+yt("(\n",gt(mt(t,"\n")),"\n)")),n}function bt(e,t){switch(e.kind){case A:return null;case I:return parseInt(e.value,10);case O:return parseFloat(e.value);case k:case D:case _:return e.value;case x:return e.values.map((e=>bt(e,t)));case $:return Xe(e.fields,(e=>e.name.value),(e=>bt(e.value,t)));case w:return t?.[e.name.value]}}function Nt(e){if(0===e.length)throw new GraphQLError("Expected name to be a non-empty string.");for(let t=1;tthis.coerceInputValue(bt(e,t))),this.coerceOutputValue=e.coerceOutputValue??this.serialize,this.coerceInputValue=e.coerceInputValue??this.parseValue,this.coerceInputLiteral=e.coerceInputLiteral,this.valueToLiteral=e.valueToLiteral,this.extensions=ot(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],e.parseLiteral&&("function"==typeof e.parseValue&&"function"==typeof e.parseLiteral||xe(0,`${this.name} must provide both "parseValue" and "parseLiteral" functions.`)),e.coerceInputLiteral&&("function"==typeof e.coerceInputValue&&"function"==typeof e.coerceInputLiteral||xe(0,`${this.name} must provide both "coerceInputValue" and "coerceInputLiteral" functions.`))}get[Symbol.toStringTag](){return"GraphQLScalarType"}toConfig(){return{name:this.name,description:this.description,specifiedByURL:this.specifiedByURL,serialize:this.serialize,parseValue:this.parseValue,parseLiteral:this.parseLiteral,coerceOutputValue:this.coerceOutputValue,coerceInputValue:this.coerceInputValue,coerceInputLiteral:this.coerceInputLiteral,valueToLiteral:this.valueToLiteral,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}class GraphQLObjectType{constructor(e){this.name=Nt(e.name),this.description=e.description,this.isTypeOf=e.isTypeOf,this.extensions=ot(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._fields=qt.bind(void 0,this,e.fields),this._interfaces=Jt.bind(void 0,e.interfaces)}get[Symbol.toStringTag](){return"GraphQLObjectType"}getFields(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields}getInterfaces(){return"function"==typeof this._interfaces&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:Ke(this.getFields(),(e=>e.toConfig())),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function Jt(e){return Pt(e??[])}function qt(e,t){return Ke(Bt(t),((t,n)=>new GraphQLField(e,n,t)))}class GraphQLField{constructor(e,t,n){this.parentType=e,this.name=Nt(t),this.description=n.description,this.type=n.type;const r=n.args;this.args=r?Object.entries(r).map((([e,t])=>new GraphQLArgument(this,e,t))):[],this.resolve=n.resolve,this.subscribe=n.subscribe,this.deprecationReason=n.deprecationReason,this.extensions=ot(n.extensions),this.astNode=n.astNode}get[Symbol.toStringTag](){return"GraphQLField"}toConfig(){return{description:this.description,type:this.type,args:Xe(this.args,(e=>e.name),(e=>e.toConfig())),resolve:this.resolve,subscribe:this.subscribe,deprecationReason:this.deprecationReason,extensions:this.extensions,astNode:this.astNode}}toString(){return`${this.parentType??""}.${this.name}`}toJSON(){return this.toString()}}class GraphQLArgument{constructor(e,t,n){this.parent=e,this.name=Nt(t),this.description=n.description,this.type=n.type,this.defaultValue=n.defaultValue,this.default=n.default,this.deprecationReason=n.deprecationReason,this.extensions=ot(n.extensions),this.astNode=n.astNode}get[Symbol.toStringTag](){return"GraphQLArgument"}toConfig(){return{description:this.description,type:this.type,defaultValue:this.defaultValue,default:this.default,deprecationReason:this.deprecationReason,extensions:this.extensions,astNode:this.astNode}}toString(){return`${this.parent}(${this.name}:)`}toJSON(){return this.toString()}}function Kt(e){return xt(e.type)&&void 0===e.default&&void 0===e.defaultValue}class GraphQLInterfaceType{constructor(e){this.name=Nt(e.name),this.description=e.description,this.resolveType=e.resolveType,this.extensions=ot(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._fields=qt.bind(void 0,this,e.fields),this._interfaces=Jt.bind(void 0,e.interfaces)}get[Symbol.toStringTag](){return"GraphQLInterfaceType"}getFields(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields}getInterfaces(){return"function"==typeof this._interfaces&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:Ke(this.getFields(),(e=>e.toConfig())),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}class GraphQLUnionType{constructor(e){this.name=Nt(e.name),this.description=e.description,this.resolveType=e.resolveType,this.extensions=ot(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._types=zt.bind(void 0,e.types)}get[Symbol.toStringTag](){return"GraphQLUnionType"}getTypes(){return"function"==typeof this._types&&(this._types=this._types()),this._types}toConfig(){return{name:this.name,description:this.description,types:this.getTypes(),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function zt(e){return Pt(e)}class GraphQLEnumType{constructor(e){this.name=Nt(e.name),this.description=e.description,this.extensions=ot(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._values="function"==typeof e.values?e.values:Object.entries(e.values).map((([e,t])=>new GraphQLEnumValue(this,e,t))),this._valueLookup=null,this._nameLookup=null}get[Symbol.toStringTag](){return"GraphQLEnumType"}getValues(){return"function"==typeof this._values&&(this._values=Object.entries(this._values()).map((([e,t])=>new GraphQLEnumValue(this,e,t)))),this._values}getValue(e){return null===this._nameLookup&&(this._nameLookup=qe(this.getValues(),(e=>e.name))),this._nameLookup[e]}serialize(e){return this.coerceOutputValue(e)}coerceOutputValue(e){null===this._valueLookup&&(this._valueLookup=new Map(this.getValues().map((e=>[e.value,e]))));const t=this._valueLookup.get(e);if(void 0===t)throw new GraphQLError(`Enum "${this.name}" cannot represent value: ${Ge(e)}`);return t.name}parseValue(e,t){return this.coerceInputValue(e,t)}coerceInputValue(e,t){if("string"!=typeof e){const n=Ge(e);throw new GraphQLError(`Enum "${this.name}" cannot represent non-string value: ${n}.`+(t?"":Yt(this,n)))}const n=this.getValue(e);if(null==n)throw new GraphQLError(`Value "${e}" does not exist in "${this.name}" enum.`+(t?"":Yt(this,e)));return n.value}parseLiteral(e,t,n){return this.coerceInputLiteral(e,n)}coerceInputLiteral(e,t){if(e.kind!==D){const n=ft(e);throw new GraphQLError(`Enum "${this.name}" cannot represent non-enum value: ${n}.`+(t?"":Yt(this,n)),{nodes:e})}const n=this.getValue(e.value);if(null==n){const n=ft(e);throw new GraphQLError(`Value "${n}" does not exist in "${this.name}" enum.`+(t?"":Yt(this,n)),{nodes:e})}return n.value}valueToLiteral(e){if("string"==typeof e&&this.getValue(e))return{kind:D,value:e}}toConfig(){return{name:this.name,description:this.description,values:Xe(this.getValues(),(e=>e.name),(e=>e.toConfig())),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function Yt(e,t){return He("the enum value",rt(t,e.getValues().map((e=>e.name))))}class GraphQLEnumValue{constructor(e,t,n){this.parentEnum=e,this.name=function(e){if("true"===e||"false"===e||"null"===e)throw new GraphQLError(`Enum values cannot be named: ${e}`);return Nt(e)}(t),this.description=n.description,this.value=void 0!==n.value?n.value:t,this.deprecationReason=n.deprecationReason,this.extensions=ot(n.extensions),this.astNode=n.astNode}get[Symbol.toStringTag](){return"GraphQLEnumValue"}toConfig(){return{description:this.description,value:this.value,deprecationReason:this.deprecationReason,extensions:this.extensions,astNode:this.astNode}}toString(){return`${this.parentEnum.name}.${this.name}`}toJSON(){return this.toString()}}class GraphQLInputObjectType{constructor(e){this.name=Nt(e.name),this.description=e.description,this.extensions=ot(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this.isOneOf=e.isOneOf??!1,this._fields=Ht.bind(void 0,this,e.fields)}get[Symbol.toStringTag](){return"GraphQLInputObjectType"}getFields(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields}toConfig(){return{name:this.name,description:this.description,fields:Ke(this.getFields(),(e=>e.toConfig())),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,isOneOf:this.isOneOf}}toString(){return this.name}toJSON(){return this.toString()}}function Ht(e,t){return Ke(Bt(t),((t,n)=>new GraphQLInputField(e,n,t)))}class GraphQLInputField{constructor(e,t,n){!("resolve"in n)||xe(0,`${e}.${t} field has a resolve property, but Input Types cannot define resolvers.`),this.parentType=e,this.name=Nt(t),this.description=n.description,this.type=n.type,this.defaultValue=n.defaultValue,this.default=n.default,this.deprecationReason=n.deprecationReason,this.extensions=ot(n.extensions),this.astNode=n.astNode}get[Symbol.toStringTag](){return"GraphQLInputField"}toConfig(){return{description:this.description,type:this.type,defaultValue:this.defaultValue,default:this.default,deprecationReason:this.deprecationReason,extensions:this.extensions,astNode:this.astNode}}toString(){return`${this.parentType}.${this.name}`}toJSON(){return this.toString()}}function Wt(e){return xt(e.type)&&void 0===e.defaultValue&&void 0===e.default}function Xt(e,t){return e===t||(xt(e)&&xt(t)||!(!Dt(e)||!Dt(t)))&&Xt(e.ofType,t.ofType)}function Zt(e,t,n){return t===n||(xt(n)?!!xt(t)&&Zt(e,t.ofType,n.ofType):xt(t)?Zt(e,t.ofType,n):Dt(n)?!!Dt(t)&&Zt(e,t.ofType,n.ofType):!Dt(t)&&(Rt(n)&&(Ot(t)||wt(t))&&e.isSubType(n,t)))}function en(e,t,n){return t===n||(Rt(t)?Rt(n)?e.getPossibleTypes(t).some((t=>e.isSubType(n,t))):e.isSubType(t,n):!!Rt(n)&&e.isSubType(n,t))}function tn(e,t,n){return{prev:e,key:t,typename:n}}function nn(e){const t=[];let n=e;for(;n;)t.push(n.key),n=n.prev;return t.reverse()}function rn(e,n){if(xt(n)){if(null==e)return;return rn(e,n.ofType)}if(null==e)return{kind:A};if(Dt(n)){if(!Je(e))return rn(e,n.ofType);const t=[];for(const r of e){const e=rn(r,n.ofType);if(!e)return;t.push(e)}return{kind:x,values:t}}if(At(n)){if(!t(e))return;const r=[],i=n.getFields();if(Object.keys(e).some((e=>!Object.hasOwn(i,e))))return;for(const t of Object.values(n.getFields())){if(void 0===e[t.name]){if(Wt(t))return}else{const n=rn(e[t.name],t.type);if(!n)return;r.push({kind:F,name:{kind:h,value:t.name},value:n})}}return{kind:$,fields:r}}const r=Qt(n);if(r.valueToLiteral)try{return r.valueToLiteral(e)}catch(e){return}return on(e)}function on(e){if(null==e)return{kind:A};switch(typeof e){case"boolean":return{kind:_,value:e};case"string":return{kind:k,value:e,block:!1};case"number":{if(!Number.isFinite(e))return{kind:A};const t=String(e);return/^-?(?:0|[1-9][0-9]*)$/.test(t)?{kind:I,value:t}:{kind:O,value:t}}case"object":{if(Je(e))return{kind:x,values:Array.from(e,on)};const t=e,n=[];for(const e of Object.keys(t)){const r=t[e];void 0!==r&&n.push({kind:F,name:{kind:h,value:e},value:on(r)})}return{kind:$,fields:n}}}throw new TypeError(`Cannot convert value to AST: ${Ge(e)}.`)}function sn(e,t,n){switch(e.kind){case w:{const r=e.name.value,i=n?.sources[r];if(i){const e=i.value;if(void 0===e){const e=i.signature.default;return void 0!==e?e.literal:{kind:A}}return sn(e,t,i.fragmentVariableValues)}const o=t?.sources[r];if(null==o)return{kind:A};if(void 0===o.value){const e=o.signature.default;if(void 0!==e)return e.literal}return rn(o.value,o.signature.type)}case $:{const r=[];for(const i of e.fields){if(i.value.kind===w){const e=n?.sources[i.value.name.value]??t?.sources[i.value.name.value];if(void 0===e?.value&&void 0===e?.signature.default)continue}const e=sn(i.value,t,n);r.push({...i,value:e})}return{...e,fields:r}}case x:{const r=[];for(const i of e.values){const e=sn(i,t,n);r.push(e)}return{...e,values:r}}default:return e}}function an(e,t,n,r){return cn(e,t,n,r,void 0)}function cn(e,n,r,i,o){if(xt(n))return void 0===e?void un(r,`Expected a value of non-null type "${n}" to be provided.`,o):null===e?void un(r,`Expected value of non-null type "${n}" not to be null.`,o):cn(e,n.ofType,r,i,o);if(null!=e)if(Dt(n))if(Je(e)){let t=0;for(const s of e)cn(s,n.ofType,r,i,tn(o,t++,void 0))}else cn(e,n.ofType,r,i,o);else if(At(n)){if(!t(e)||Array.isArray(e))return void un(r,`Expected value of type "${n}" to be an object, found: ${Ge(e)}.`,o);const s=n.getFields();for(const t of Object.values(s)){const s=e[t.name];void 0===s?Wt(t)&&un(r,`Expected value of type "${n}" to include required field "${t.name}", found: ${Ge(e)}.`,o):cn(s,t.type,r,i,tn(o,t.name,n.name))}const a=Object.keys(e);for(const t of a)if(!Object.hasOwn(s,t)){const i=He(rt(t,Object.keys(s)));un(r,`Expected value of type "${n}" not to include unknown field "${t}"${i?`.${i} Found`:", found"}: ${Ge(e)}.`,o)}if(n.isOneOf){1!==a.length&&un(r,`Exactly one key must be specified for OneOf type "${n}".`,o);const t=a[0];null===e[t]&&un(r,`Field "${t}" for OneOf type "${n}" must be non-null.`,o)}}else{let t,s;Qt(n);try{t=n.coerceInputValue(e,i)}catch(e){if(e instanceof GraphQLError)return void r(e,nn(o));s=e}void 0===t&&un(r,`Expected value of type "${n}"${null!=s?`, but encountered error "${null!=s.message&&""!==s.message?s.message:s}"; found`:", found"}: ${Ge(e)}.`,o,s)}}function un(e,t,n,r){e(new GraphQLError(t,{originalError:r}),nn(n))}function ln(e,t,n,r,i,o){return pn({static:!r&&!i,onError:n,variables:r,fragmentVariableValues:i},e,t,o,void 0)}function pn(e,t,n,r,i){if(t.kind!==w){if(xt(n))return t.kind===A?void fn(e.onError,`Expected value of non-null type "${n}" not to be null.`,t,i):pn(e,t,n.ofType,r,i);if(t.kind!==A)if(Dt(n))if(t.kind!==x)pn(e,t,n.ofType,r,i);else{let o=0;for(const s of t.values)pn(e,s,n.ofType,r,tn(i,o++,void 0))}else if(At(n)){if(t.kind!==$)return void fn(e.onError,`Expected value of type "${n}" to be an object, found: ${ft(t)}.`,t,i);const o=n.getFields(),s=qe(t.fields,(e=>e.name.value));for(const a of Object.values(o)){const o=s[a.name];if(void 0===o)Wt(a)&&fn(e.onError,`Expected value of type "${n}" to include required field "${a.name}", found: ${ft(t)}.`,t,i);else{const s=o.value;if(s.kind===w&&!e.static){const r=dn(e,s),o=s.name.value,c=r?.coerced[o];if(n.isOneOf)void 0===c?fn(e.onError,`Expected variable "$${o}" provided to field "${a.name}" for OneOf Input Object type "${n}" to provide a runtime value.`,t,i):null===c&&fn(e.onError,`Expected variable "$${o}" provided to field "${a.name}" for OneOf Input Object type "${n}" not to be null.`,t,i);else if(void 0===c&&!Wt(a))continue}pn(e,s,a.type,r,tn(i,a.name,n.name))}}const a=t.fields;for(const s of a){const a=s.name.value;if(!Object.hasOwn(o,a)){const c=r?"":He(rt(a,Object.keys(o)));fn(e.onError,`Expected value of type "${n}" not to include unknown field "${a}"${c?`.${c} Found`:", found"}: ${ft(t)}.`,s,i)}}if(n.isOneOf){if(1!==a.length)return void fn(e.onError,`OneOf Input Object "${n}" must specify exactly one key.`,t,i);if(a[0].value.kind===A){const r=a[0].name.value;fn(e.onError,`Field "${n}.${r}" used for OneOf Input Object must be non-null.`,t,tn(i,r,void 0))}}}else{let o,s;Qt(n);try{o=n.coerceInputLiteral?n.coerceInputLiteral(sn(t,e.variables,e.fragmentVariableValues),r):n.parseLiteral(t,void 0,r)}catch(t){if(t instanceof GraphQLError)return void e.onError(t,nn(i));s=t}void 0===o&&fn(e.onError,`Expected value of type "${n}"${null!=s?`, but encountered error "${null!=s.message&&""!==s.message?s.message:s}"; found`:", found"}: ${ft(t)}.`,t,i,s)}}else{if(e.static)return;const r=dn(e,t),o=r?.coerced[t.name.value];xt(n)&&(void 0===o?fn(e.onError,`Expected variable "$${t.name.value}" provided to type "${n}" to provide a runtime value.`,t,i):null===o&&fn(e.onError,`Expected variable "$${t.name.value}" provided to non-null type "${n}" not to be null.`,t,i))}}function dn(e,t){const n=t.name.value,{fragmentVariableValues:r,variables:i}=e;return r?.sources[n]?r:i}function fn(e,t,n,r,i){e(new GraphQLError(t,{nodes:n,originalError:i}),nn(r))}const hn=2147483647,mn=-2147483648,vn=new GraphQLScalarType({name:"Int",description:"The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.",coerceOutputValue(e){const t=Sn(e);if("boolean"==typeof t)return t?1:0;let n=t;if("string"==typeof t&&""!==t&&(n=Number(t)),"number"!=typeof n||!Number.isInteger(n))throw new GraphQLError(`Int cannot represent non-integer value: ${Ge(t)}`);if(n>hn||nhn||ehn||t=mn)return{kind:I,value:String(e)}}}),yn=new GraphQLScalarType({name:"Float",description:"The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).",coerceOutputValue(e){const t=Sn(e);if("boolean"==typeof t)return t?1:0;let n=t;if("string"==typeof t&&""!==t&&(n=Number(t)),"number"!=typeof n||!Number.isFinite(n))throw new GraphQLError(`Float cannot represent non numeric value: ${Ge(t)}`);return n},coerceInputValue(e){if("number"!=typeof e||!Number.isFinite(e))throw new GraphQLError(`Float cannot represent non numeric value: ${Ge(e)}`);return e},coerceInputLiteral(e){if(e.kind!==O&&e.kind!==I)throw new GraphQLError(`Float cannot represent non numeric value: ${ft(e)}`,{nodes:e});return parseFloat(e.value)},valueToLiteral(e){const t=on(e);if(t.kind===O||t.kind===I)return t}}),gn=new GraphQLScalarType({name:"String",description:"The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.",coerceOutputValue(e){const t=Sn(e);if("string"==typeof t)return t;if("boolean"==typeof t)return t?"true":"false";if("number"==typeof t&&Number.isFinite(t))return t.toString();throw new GraphQLError(`String cannot represent value: ${Ge(e)}`)},coerceInputValue(e){if("string"!=typeof e)throw new GraphQLError(`String cannot represent a non string value: ${Ge(e)}`);return e},coerceInputLiteral(e){if(e.kind!==k)throw new GraphQLError(`String cannot represent a non string value: ${ft(e)}`,{nodes:e});return e.value},valueToLiteral(e){const t=on(e);if(t.kind===k)return t}}),Tn=new GraphQLScalarType({name:"Boolean",description:"The `Boolean` scalar type represents `true` or `false`.",coerceOutputValue(e){const t=Sn(e);if("boolean"==typeof t)return t;if(Number.isFinite(t))return 0!==t;throw new GraphQLError(`Boolean cannot represent a non boolean value: ${Ge(t)}`)},coerceInputValue(e){if("boolean"!=typeof e)throw new GraphQLError(`Boolean cannot represent a non boolean value: ${Ge(e)}`);return e},coerceInputLiteral(e){if(e.kind!==_)throw new GraphQLError(`Boolean cannot represent a non boolean value: ${ft(e)}`,{nodes:e});return e.value},valueToLiteral(e){const t=on(e);if(t.kind===_)return t}}),En=new GraphQLScalarType({name:"ID",description:'The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.',coerceOutputValue(e){const t=Sn(e);if("string"==typeof t)return t;if(Number.isInteger(t))return String(t);throw new GraphQLError(`ID cannot represent value: ${Ge(e)}`)},coerceInputValue(e){if("string"==typeof e)return e;if("number"==typeof e&&Number.isInteger(e))return e.toString();throw new GraphQLError(`ID cannot represent value: ${Ge(e)}`)},coerceInputLiteral(e){if(e.kind!==k&&e.kind!==I)throw new GraphQLError("ID cannot represent a non-string and non-integer value: "+ft(e),{nodes:e});return e.value},valueToLiteral(e){const t=Number.isInteger(e)?String(e):e;if("string"==typeof t)return/^-?(?:0|[1-9][0-9]*)$/.test(t)?{kind:I,value:t}:{kind:k,value:t,block:!1}}}),bn=Object.freeze([gn,vn,yn,Tn,En]);function Nn(e){return bn.some((({name:t})=>e.name===t))}function Sn(e){if(t(e)){if("function"==typeof e.valueOf){const n=e.valueOf();if(!t(n))return n}if("function"==typeof e.toJSON)return e.toJSON()}return e}function Ln(e){return Ce(e,GraphQLDirective)}class GraphQLDirective{constructor(e){this.name=Nt(e.name),this.description=e.description,this.locations=e.locations,this.isRepeatable=e.isRepeatable??!1,this.extensions=ot(e.extensions),this.astNode=e.astNode,Array.isArray(e.locations)||xe(0,`@${this.name} locations must be an Array.`);const n=e.args??{};t(n)&&!Array.isArray(n)||xe(0,`@${this.name} args must be an object with argument names as keys.`),this.args=Object.entries(n).map((([e,t])=>new GraphQLArgument(this,e,t)))}get[Symbol.toStringTag](){return"GraphQLDirective"}toConfig(){return{name:this.name,description:this.description,locations:this.locations,args:Xe(this.args,(e=>e.name),(e=>e.toConfig())),isRepeatable:this.isRepeatable,extensions:this.extensions,astNode:this.astNode}}toString(){return"@"+this.name}toJSON(){return this.toString()}}const wn=new GraphQLDirective({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[f.FIELD,f.FRAGMENT_SPREAD,f.INLINE_FRAGMENT],args:{if:{type:new GraphQLNonNull(Tn),description:"Included when true."}}}),In=new GraphQLDirective({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[f.FIELD,f.FRAGMENT_SPREAD,f.INLINE_FRAGMENT],args:{if:{type:new GraphQLNonNull(Tn),description:"Skipped when true."}}}),On=new GraphQLDirective({name:"defer",description:"Directs the executor to defer this fragment when the `if` argument is true or undefined.",locations:[f.FRAGMENT_SPREAD,f.INLINE_FRAGMENT],args:{if:{type:new GraphQLNonNull(Tn),description:"Deferred when true or undefined.",default:{value:!0}},label:{type:gn,description:"Unique name"}}}),kn=new GraphQLDirective({name:"stream",description:"Directs the executor to stream plural fields when the `if` argument is true or undefined.",locations:[f.FIELD],args:{initialCount:{default:{value:0},type:new GraphQLNonNull(vn),description:"Number of items to return immediately"},if:{type:new GraphQLNonNull(Tn),description:"Stream when true or undefined.",default:{value:!0}},label:{type:gn,description:"Unique name"}}}),_n="No longer supported",An=new GraphQLDirective({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[f.FIELD_DEFINITION,f.ARGUMENT_DEFINITION,f.INPUT_FIELD_DEFINITION,f.ENUM_VALUE],args:{reason:{type:new GraphQLNonNull(gn),description:"Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).",default:{value:_n}}}}),Dn=new GraphQLDirective({name:"specifiedBy",description:"Exposes a URL that specifies the behavior of this scalar.",locations:[f.SCALAR],args:{url:{type:new GraphQLNonNull(gn),description:"The URL that specifies the behavior of this scalar."}}}),xn=new GraphQLDirective({name:"oneOf",description:"Indicates exactly one field must be supplied and this field must not be `null`.",locations:[f.INPUT_OBJECT],args:{}});new GraphQLDirective({name:"experimental_disableErrorPropagation",description:"Disables error propagation.",locations:[f.QUERY,f.MUTATION,f.SUBSCRIPTION]});const $n=Object.freeze([wn,In,An,Dn,xn]);function Fn(e){return $n.some((({name:t})=>t===e.name))}function Gn(e,r){if(xt(r)){const t=Gn(e,r.ofType);return t?.kind===A?null:t}if(null===e)return{kind:A};if(void 0===e)return null;if(Dt(r)){const t=r.ofType;if(Je(e)){const n=[];for(const r of e){const e=Gn(r,t);null!=e&&n.push(e)}return{kind:x,values:n}}return Gn(e,t)}if(At(r)){if(!t(e))return null;const n=[];for(const t of Object.values(r.getFields())){const r=Gn(e[t.name],t.type);r&&n.push({kind:F,name:{kind:h,value:t.name},value:r})}return{kind:$,fields:n}}if(Gt(r)){const t=r.coerceOutputValue(e);if(null==t)return null;if("boolean"==typeof t)return{kind:_,value:t};if("number"==typeof t&&Number.isFinite(t)){const e=String(t);return Qn.test(e)?{kind:I,value:e}:{kind:O,value:e}}if("string"==typeof t)return _t(r)?{kind:D,value:t}:r===En&&Qn.test(t)?{kind:I,value:t}:{kind:k,value:t};throw new TypeError(`Cannot convert value to AST: ${Ge(t)}.`)}n(0,"Unexpected input type: "+Ge(r))}const Qn=/^-?(?:0|[1-9][0-9]*)$/;function Cn(e){const t=e.type,r=e.default;if(r){const e=r.literal??rn(r.value,t);return null!=e||n(0,"Invalid default value"),e}const i=e.defaultValue;if(void 0!==i){const e=Gn(i,t);return null!=e||n(0,"Invalid default value"),e}}const Rn=new GraphQLObjectType({name:"__Schema",description:"A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.",fields:()=>({description:{type:gn,resolve:e=>e.description},types:{description:"A list of all types supported by this server.",type:new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(Mn))),resolve:e=>Object.values(e.getTypeMap())},queryType:{description:"The type that query operations will be rooted at.",type:new GraphQLNonNull(Mn),resolve:e=>e.getQueryType()},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:Mn,resolve:e=>e.getMutationType()},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:Mn,resolve:e=>e.getSubscriptionType()},directives:{description:"A list of all directives supported by this server.",type:new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(Vn))),resolve:e=>e.getDirectives()}})}),Vn=new GraphQLObjectType({name:"__Directive",description:"A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.\n\nIn some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.",fields:()=>({name:{type:new GraphQLNonNull(gn),resolve:e=>e.name},description:{type:gn,resolve:e=>e.description},isRepeatable:{type:new GraphQLNonNull(Tn),resolve:e=>e.isRepeatable},locations:{type:new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(jn))),resolve:e=>e.locations},args:{type:new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(Pn))),args:{includeDeprecated:{type:new GraphQLNonNull(Tn),default:{value:!1}}},resolve:(e,{includeDeprecated:t})=>!0===t?e.args:e.args.filter((e=>null==e.deprecationReason))}})}),jn=new GraphQLEnumType({name:"__DirectiveLocation",description:"A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.",values:{QUERY:{value:f.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:f.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:f.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:f.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:f.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:f.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:f.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:f.VARIABLE_DEFINITION,description:"Location adjacent to an operation variable definition."},FRAGMENT_VARIABLE_DEFINITION:{value:f.FRAGMENT_VARIABLE_DEFINITION,description:"Location adjacent to a fragment variable definition."},SCHEMA:{value:f.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:f.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:f.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:f.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:f.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:f.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:f.UNION,description:"Location adjacent to a union definition."},ENUM:{value:f.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:f.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:f.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:f.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."}}}),Mn=new GraphQLObjectType({name:"__Type",description:"The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByURL`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.",fields:()=>({kind:{type:new GraphQLNonNull(qn),resolve:e=>Lt(e)?Jn.SCALAR:wt(e)?Jn.OBJECT:Ot(e)?Jn.INTERFACE:kt(e)?Jn.UNION:_t(e)?Jn.ENUM:At(e)?Jn.INPUT_OBJECT:Dt(e)?Jn.LIST:xt(e)?Jn.NON_NULL:void n(0,`Unexpected type: "${Ge(e)}".`)},name:{type:gn,resolve:e=>"name"in e?e.name:void 0},description:{type:gn,resolve:e=>"description"in e?e.description:void 0},specifiedByURL:{type:gn,resolve:e=>"specifiedByURL"in e?e.specifiedByURL:void 0},fields:{type:new GraphQLList(new GraphQLNonNull(Un)),args:{includeDeprecated:{type:new GraphQLNonNull(Tn),default:{value:!1}}},resolve(e,{includeDeprecated:t}){if(wt(e)||Ot(e)){const n=Object.values(e.getFields());return!0===t?n:n.filter((e=>null==e.deprecationReason))}}},interfaces:{type:new GraphQLList(new GraphQLNonNull(Mn)),resolve(e){if(wt(e)||Ot(e))return e.getInterfaces()}},possibleTypes:{type:new GraphQLList(new GraphQLNonNull(Mn)),resolve(e,t,n,{schema:r}){if(Rt(e))return r.getPossibleTypes(e)}},enumValues:{type:new GraphQLList(new GraphQLNonNull(Bn)),args:{includeDeprecated:{type:new GraphQLNonNull(Tn),default:{value:!1}}},resolve(e,{includeDeprecated:t}){if(_t(e)){const n=e.getValues();return!0===t?n:n.filter((e=>null==e.deprecationReason))}}},inputFields:{type:new GraphQLList(new GraphQLNonNull(Pn)),args:{includeDeprecated:{type:new GraphQLNonNull(Tn),default:{value:!1}}},resolve(e,{includeDeprecated:t}){if(At(e)){const n=Object.values(e.getFields());return!0===t?n:n.filter((e=>null==e.deprecationReason))}}},ofType:{type:Mn,resolve:e=>"ofType"in e?e.ofType:void 0},isOneOf:{type:Tn,resolve:e=>{if(At(e))return e.isOneOf}}})}),Un=new GraphQLObjectType({name:"__Field",description:"Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.",fields:()=>({name:{type:new GraphQLNonNull(gn),resolve:e=>e.name},description:{type:gn,resolve:e=>e.description},args:{type:new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(Pn))),args:{includeDeprecated:{type:new GraphQLNonNull(Tn),default:{value:!1}}},resolve:(e,{includeDeprecated:t})=>!0===t?e.args:e.args.filter((e=>null==e.deprecationReason))},type:{type:new GraphQLNonNull(Mn),resolve:e=>e.type},isDeprecated:{type:new GraphQLNonNull(Tn),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:gn,resolve:e=>e.deprecationReason}})}),Pn=new GraphQLObjectType({name:"__InputValue",description:"Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.",fields:()=>({name:{type:new GraphQLNonNull(gn),resolve:e=>e.name},description:{type:gn,resolve:e=>e.description},type:{type:new GraphQLNonNull(Mn),resolve:e=>e.type},defaultValue:{type:gn,description:"A GraphQL-formatted string representing the default value for this input value.",resolve(e){const t=Cn(e);return t?ft(t):null}},isDeprecated:{type:new GraphQLNonNull(Tn),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:gn,resolve:e=>e.deprecationReason}})}),Bn=new GraphQLObjectType({name:"__EnumValue",description:"One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.",fields:()=>({name:{type:new GraphQLNonNull(gn),resolve:e=>e.name},description:{type:gn,resolve:e=>e.description},isDeprecated:{type:new GraphQLNonNull(Tn),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:gn,resolve:e=>e.deprecationReason}})}),Jn={SCALAR:"SCALAR",OBJECT:"OBJECT",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",INPUT_OBJECT:"INPUT_OBJECT",LIST:"LIST",NON_NULL:"NON_NULL"},qn=new GraphQLEnumType({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:Jn.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:Jn.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:Jn.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:Jn.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:Jn.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:Jn.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:Jn.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:Jn.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}}),Kn=new GraphQLField(void 0,"__schema",{type:new GraphQLNonNull(Rn),description:"Access the current type schema of this server.",resolve:(e,t,n,{schema:r})=>r}),zn=new GraphQLField(void 0,"__type",{type:Mn,description:"Request the type information of a single type.",args:{name:{type:new GraphQLNonNull(gn)}},resolve:(e,{name:t},n,{schema:r})=>r.getType(t)}),Yn=new GraphQLField(void 0,"__typename",{type:new GraphQLNonNull(gn),description:"The name of the current Object type at runtime.",resolve:(e,t,n,{parentType:r})=>r.name}),Hn=Object.freeze([Rn,Vn,jn,Mn,Un,Pn,Bn,qn]);function Wn(e){return Hn.some((({name:t})=>e.name===t))}function Xn(e){if(!function(e){return Ce(e,GraphQLSchema)}(e))throw new Error(`Expected ${Ge(e)} to be a GraphQL schema.`);return e}class GraphQLSchema{constructor(e){this.assumeValid=e.assumeValid??!1,this.__validationErrors=!0===e.assumeValid?[]:void 0,this.description=e.description,this.extensions=ot(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._queryType=e.query,this._mutationType=e.mutation,this._subscriptionType=e.subscription,this._directives=e.directives??$n;const t=new Set(e.types);if(null!=e.types)for(const n of e.types)t.delete(n),Zn(n,t);null!=this._queryType&&Zn(this._queryType,t),null!=this._mutationType&&Zn(this._mutationType,t),null!=this._subscriptionType&&Zn(this._subscriptionType,t);for(const e of this._directives)if(Ln(e))for(const n of e.args)Zn(n.type,t);Zn(Rn,t),this._typeMap=Object.create(null),this._subTypeMap=new Map,this._implementationsMap=Object.create(null);for(const e of t){if(null==e)continue;const t=e.name;if(void 0!==this._typeMap[t])throw new Error(`Schema must contain uniquely named types but contains multiple types named "${t}".`);if(this._typeMap[t]=e,Ot(e)){for(const t of e.getInterfaces())if(Ot(t)){let n=this._implementationsMap[t.name];void 0===n&&(n=this._implementationsMap[t.name]={objects:[],interfaces:[]}),n.interfaces.push(e)}}else if(wt(e))for(const t of e.getInterfaces())if(Ot(t)){let n=this._implementationsMap[t.name];void 0===n&&(n=this._implementationsMap[t.name]={objects:[],interfaces:[]}),n.objects.push(e)}}}get[Symbol.toStringTag](){return"GraphQLSchema"}getQueryType(){return this._queryType}getMutationType(){return this._mutationType}getSubscriptionType(){return this._subscriptionType}getRootType(e){switch(e){case d.QUERY:return this.getQueryType();case d.MUTATION:return this.getMutationType();case d.SUBSCRIPTION:return this.getSubscriptionType()}}getTypeMap(){return this._typeMap}getType(e){return this.getTypeMap()[e]}getPossibleTypes(e){return kt(e)?e.getTypes():this.getImplementations(e).objects}getImplementations(e){return this._implementationsMap[e.name]??{objects:[],interfaces:[]}}isSubType(e,t){let n=this._subTypeMap.get(e);if(void 0===n){if(kt(e))n=new Set(e.getTypes());else{const t=this.getImplementations(e);n=new Set([...t.objects,...t.interfaces])}this._subTypeMap.set(e,n)}return n.has(t)}getDirectives(){return this._directives}getDirective(e){return this.getDirectives().find((t=>t.name===e))}getField(e,t){switch(t){case Kn.name:return this.getQueryType()===e?Kn:void 0;case zn.name:return this.getQueryType()===e?zn:void 0;case Yn.name:return Yn}if("getFields"in e)return e.getFields()[t]}toConfig(){return{description:this.description,query:this.getQueryType(),mutation:this.getMutationType(),subscription:this.getSubscriptionType(),types:Object.values(this.getTypeMap()),directives:this.getDirectives(),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,assumeValid:this.assumeValid}}}function Zn(e,t){const n=Ut(e);if(!t.has(n))if(t.add(n),kt(n))for(const e of n.getTypes())Zn(e,t);else if(wt(n)||Ot(n)){for(const e of n.getInterfaces())Zn(e,t);for(const e of Object.values(n.getFields())){Zn(e.type,t);for(const n of e.args)Zn(n.type,t)}}else if(At(n))for(const e of Object.values(n.getFields()))Zn(e.type,t);return t}function er(e){if(Xn(e),e.__validationErrors)return e.__validationErrors;const n=new SchemaValidationContext(e);!function(e){const t=e.schema;null==t.getQueryType()&&e.reportError("Query root type must be provided.",t.astNode);const n=new AccumulatorMap;for(const r of Object.values(d)){const i=t.getRootType(r);if(null!=i)if(wt(i))n.add(i,r);else{const n=Ue(r),o=Ge(i);e.reportError(r===d.QUERY?`${n} root type must be Object type, it cannot be ${o}.`:`${n} root type must be Object type if provided, it cannot be ${o}.`,tr(t,r)??i.astNode)}}for(const[r,i]of n)if(i.length>1){const n=Pe(i);e.reportError(`All root types must be different, "${r}" type is used as ${n} root types.`,i.map((e=>tr(t,e))))}}(n),function(e){for(const t of e.schema.getDirectives())if(Ln(t)){ir(e,t),0===t.locations.length&&e.reportError(`Directive ${t} must include 1 or more locations.`,t.astNode);for(const n of t.args)ir(e,n),$t(n.type)||e.reportError(`The type of ${n} must be Input Type but got: ${Ge(n.type)}.`,n.astNode),Kt(n)&&null!=n.deprecationReason&&e.reportError(`Required argument ${n} cannot be deprecated.`,[mr(n.astNode),n.astNode?.type]),nr(e,n)}else e.reportError(`Expected directive but got: ${Ge(t)}.`,t?.astNode)}(n),function(e){const n=function(e){const t=new Set,n=[],r=Object.create(null);return i;function i(o){if(t.has(o))return;t.add(o),r[o.name]=n.length;const s=Object.values(o.getFields());for(const t of s)if(xt(t.type)&&At(t.type.ofType)){const s=t.type.ofType,a=r[s.name];if(n.push({fieldStr:`${o}.${t.name}`,astNode:t.astNode}),void 0===a)i(s);else{const t=n.slice(a),r=t.map((e=>e.fieldStr)).join(", ");e.reportError(`Invalid circular reference. The Input Object ${s} references itself ${t.length>1?"via the non-null fields:":"in the non-null field"} ${r}.`,t.map((e=>e.astNode)))}n.pop()}r[o.name]=void 0}}(e),r=function(e){const n=Object.create(null),r=[],i=Object.create(null);return function(e){return o(e,Object.create(null))};function o(e,n){if(Je(n))for(const t of n)o(e,t);else if(t(n))for(const t of Object.values(e.getFields())){const r=Ut(t.type);At(r)&&(Object.hasOwn(n,t.name)?o(r,n[t.name]):a(t,r,`${e}.${t.name}`))}}function s(e,t){if(t.kind===x){for(const n of t.values)s(e,n);return}if(t.kind!==$)return;const n=qe(t.fields,(e=>e.name.value));for(const t of Object.values(e.getFields())){const r=Ut(t.type);At(r)&&(Object.hasOwn(n,t.name)?s(r,n[t.name].value):a(t,r,`${e}.${t.name}`))}}function a(t,a,c){const u=t.default;if(void 0===u)return;const l=i[c];void 0===l?void 0===n[c]&&(n[c]=!0,i[c]=r.push([c,t.astNode?.defaultValue]),u.literal?s(a,u.literal):o(a,u.value),r.pop(),i[c]=void 0):e.reportError(`Invalid circular reference. The default value of Input Object field ${c} references itself${le)).join(", ")}`:""}.`,r.slice(l-1).map((([,e])=>e)))}}(e),i=e.schema.getTypeMap();for(const t of Object.values(i))Mt(t)?(Wn(t)||ir(e,t),wt(t)||Ot(t)?(or(e,t),sr(e,t)):kt(t)?ur(e,t):_t(t)?lr(e,t):At(t)&&(pr(e,t),n(t),r(t))):e.reportError(`Expected GraphQL named type but got: ${Ge(t)}.`,t.astNode)}(n);const r=n.getErrors();return e.__validationErrors=r,r}class SchemaValidationContext{constructor(e){this._errors=[],this.schema=e}reportError(e,t){const n=Array.isArray(t)?t.filter(Boolean):t;this._errors.push(new GraphQLError(e,{nodes:n}))}getErrors(){return this._errors}}function tr(e,t){return[e.astNode,...e.extensionASTNodes].flatMap((e=>e?.operationTypes??[])).find((e=>e.operation===t))?.type}function nr(e,t){const n=t.default;if(n)if(n.literal)ln(n.literal,t.type,((n,r)=>{e.reportError(`${t} has invalid default value${ze(r)}: ${n.message}`,n.nodes)}));else{const r=[];if(an(n.value,t.type,((e,t)=>{r.push([e,t])})),r.length>0)try{const r=rr(n.value,t.type),i=[];if(an(r,t.type,((e,t)=>{i.push([e,t])})),0===i.length)return void e.reportError(`${t} has invalid default value: ${Ge(n.value)}. Did you mean: ${Ge(r)}?`,t.astNode?.defaultValue)}catch(e){}for(const[n,i]of r)e.reportError(`${t} has invalid default value${ze(i)}: ${n.message}`,t.astNode?.defaultValue)}}function rr(e,r){if(xt(r))return rr(e,r.ofType);if(null===e)return null;if(Dt(r))return Je(e)?Array.from(e,(e=>rr(e,r.ofType))):[rr(e,r.ofType)];if(At(r)){t(e)||n();const i=r.getFields();return Ke(e,((e,t)=>(t in i||n(),rr(e,i[t].type))))}return Qt(r),r.coerceOutputValue(e)}function ir(e,t){t.name.startsWith("__")&&e.reportError(`Name "${t.name}" must not begin with "__", which is reserved by GraphQL introspection.`,t.astNode)}function or(e,t){const n=Object.values(t.getFields());0===n.length&&e.reportError(`Type ${t} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]);for(const t of n){ir(e,t),Ft(t.type)||e.reportError(`The type of ${t} must be Output Type but got: ${Ge(t.type)}.`,t.astNode?.type);for(const n of t.args)ir(e,n),$t(n.type)||e.reportError(`The type of ${n} must be Input Type but got: ${Ge(n.type)}.`,n.astNode?.type),Kt(n)&&null!=n.deprecationReason&&e.reportError(`Required argument ${n} cannot be deprecated.`,[mr(n.astNode),n.astNode?.type]),nr(e,n)}}function sr(e,t){const n=new Set;for(const r of t.getInterfaces())Ot(r)?t!==r?n.has(r.name)?e.reportError(`Type ${t} can only implement ${r} once.`,fr(t,r)):(n.add(r.name),cr(e,t,r),ar(e,t,r)):e.reportError(`Type ${t} cannot implement itself because it would create a circular reference.`,fr(t,r)):e.reportError(`Type ${t} must only implement Interface types, it cannot implement ${Ge(r)}.`,fr(t,r))}function ar(e,t,n){const r=t.getFields();for(const i of Object.values(n.getFields())){const o=r[i.name];if(null!=o){Zt(e.schema,o.type,i.type)||e.reportError(`Interface field ${i} expects type ${i.type} but ${o} is type ${o.type}.`,[i.astNode?.type,o.astNode?.type]);for(const t of i.args){const n=o.args.find((e=>e.name===t.name));n?Xt(t.type,n.type)||e.reportError(`Interface field argument ${t} expects type ${t.type} but ${n} is type ${n.type}.`,[t.astNode?.type,n.astNode?.type]):e.reportError(`Interface field argument ${t} expected but ${o} does not provide it.`,[t.astNode,o.astNode])}for(const t of o.args)if(Kt(t)){i.args.find((e=>e.name===t.name))||e.reportError(`Argument "${t}" must not be required type "${t.type}" if not provided by the Interface field "${i}".`,[t.astNode,i.astNode])}null!=o.deprecationReason&&null==i.deprecationReason&&e.reportError(`Interface field ${n.name}.${i.name} is not deprecated, so implementation field ${t.name}.${o.name} must not be deprecated.`,[mr(o.astNode),o.astNode?.type])}else e.reportError(`Interface field ${i} expected but ${t} does not provide it.`,[i.astNode,t.astNode,...t.extensionASTNodes])}}function cr(e,t,n){const r=t.getInterfaces();for(const i of n.getInterfaces())r.includes(i)||e.reportError(i===t?`Type ${t} cannot implement ${n} because it would create a circular reference.`:`Type ${t} must implement ${i} because it is implemented by ${n}.`,[...fr(n,i),...fr(t,n)])}function ur(e,t){const n=t.getTypes();0===n.length&&e.reportError(`Union type ${t} must define one or more member types.`,[t.astNode,...t.extensionASTNodes]);const r=new Set;for(const i of n)r.has(i.name)?e.reportError(`Union type ${t} can only include type ${i} once.`,hr(t,i.name)):(r.add(i.name),wt(i)||e.reportError(`Union type ${t} can only include Object types, it cannot include ${Ge(i)}.`,hr(t,String(i))))}function lr(e,t){const n=t.getValues();0===n.length&&e.reportError(`Enum type ${t} must define one or more values.`,[t.astNode,...t.extensionASTNodes]);for(const t of n)ir(e,t)}function pr(e,t){const n=Object.values(t.getFields());0===n.length&&e.reportError(`Input Object type ${t} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]);for(const r of n)ir(e,r),$t(r.type)||e.reportError(`The type of ${r} must be Input Type but got: ${Ge(r.type)}.`,r.astNode?.type),Wt(r)&&null!=r.deprecationReason&&e.reportError(`Required input field ${r} cannot be deprecated.`,[mr(r.astNode),r.astNode?.type]),nr(e,r),t.isOneOf&&dr(t,r,e)}function dr(e,t,n){xt(t.type)&&n.reportError(`OneOf input field ${e}.${t.name} must be nullable.`,t.astNode?.type),void 0===t.default&&void 0===t.defaultValue||n.reportError(`OneOf input field ${e}.${t.name} cannot have a default value.`,t.astNode)}function fr(e,t){const{astNode:n,extensionASTNodes:r}=e;return(null!=n?[n,...r]:r).flatMap((e=>e.interfaces??[])).filter((e=>e.name.value===t.name))}function hr(e,t){const{astNode:n,extensionASTNodes:r}=e;return(null!=n?[n,...r]:r).flatMap((e=>e.types??[])).filter((e=>e.name.value===t))}function mr(e){return e?.directives?.find((e=>e.name.value===An.name))}function vr(e,t){switch(t.kind){case C:{const n=vr(e,t.type);return n&&new GraphQLList(n)}case R:{const n=vr(e,t.type);return n&&new GraphQLNonNull(n)}case Q:return e.getType(t.name.value)}}class TypeInfo{constructor(e,t,n){this._schema=e,this._typeStack=[],this._parentTypeStack=[],this._inputTypeStack=[],this._fieldDefStack=[],this._defaultValueStack=[],this._directive=null,this._argument=null,this._enumValue=null,this._fragmentSignaturesByName=n??(()=>null),this._fragmentSignature=null,this._fragmentArgument=null,t&&($t(t)&&this._inputTypeStack.push(t),Ct(t)&&this._parentTypeStack.push(t),Ft(t)&&this._typeStack.push(t))}get[Symbol.toStringTag](){return"TypeInfo"}getType(){return this._typeStack.at(-1)}getParentType(){return this._parentTypeStack.at(-1)}getInputType(){return this._inputTypeStack.at(-1)}getParentInputType(){return this._inputTypeStack.at(-2)}getFieldDef(){return this._fieldDefStack.at(-1)}getDefaultValue(){return this._defaultValueStack.at(-1)}getDirective(){return this._directive}getArgument(){return this._argument}getFragmentSignature(){return this._fragmentSignature}getFragmentSignatureByName(){return this._fragmentSignaturesByName}getFragmentArgument(){return this._fragmentArgument}getEnumValue(){return this._enumValue}enter(e){const t=this._schema;switch(e.kind){case m:{const t=function(e){const t=new Map;for(const n of e.definitions)if(n.kind===L){const e=new Map;if(n.variableDefinitions)for(const t of n.variableDefinitions)e.set(t.variable.name.value,t);const r={definition:n,variableDefinitions:e};t.set(n.name.value,r)}return t}(e);this._fragmentSignaturesByName=e=>t.get(e);break}case g:{const e=Ut(this.getType());this._parentTypeStack.push(Ct(e)?e:void 0);break}case T:{const n=this.getParentType();let r,i;n&&(r=t.getField(n,e.name.value),r&&(i=r.type)),this._fieldDefStack.push(r),this._typeStack.push(Ft(i)?i:void 0);break}case G:this._directive=t.getDirective(e.name.value);break;case v:{const n=t.getRootType(e.operation);this._typeStack.push(wt(n)?n:void 0);break}case N:this._fragmentSignature=this.getFragmentSignatureByName()(e.name.value);break;case S:case L:{const n=e.typeCondition,r=n?vr(t,n):Ut(this.getType());this._typeStack.push(Ft(r)?r:void 0);break}case y:{const n=vr(t,e.type);this._inputTypeStack.push($t(n)?n:void 0);break}case E:{let t,n;const r=this.getDirective()??this.getFieldDef();r&&(t=r.args.find((t=>t.name===e.name.value)),t&&(n=t.type)),this._argument=t,this._defaultValueStack.push(t?.default??t?.defaultValue??void 0),this._inputTypeStack.push($t(n)?n:void 0);break}case b:{const t=this.getFragmentSignature(),n=t?.variableDefinitions.get(e.name.value);let r;this._fragmentArgument=n,n&&(r=vr(this._schema,n.type)),this._inputTypeStack.push($t(r)?r:void 0);break}case x:{const e=function(e){if(e)return xt(e)?e.ofType:e}(this.getInputType()),t=Dt(e)?e.ofType:e;this._defaultValueStack.push(void 0),this._inputTypeStack.push($t(t)?t:void 0);break}case F:{const t=Ut(this.getInputType());let n,r;At(t)&&(r=t.getFields()[e.name.value],null!=r&&(n=r.type)),this._defaultValueStack.push(r?.default??r?.defaultValue??void 0),this._inputTypeStack.push($t(n)?n:void 0);break}case D:{const t=Ut(this.getInputType());let n;_t(t)&&(n=t.getValue(e.value)),this._enumValue=n;break}}}leave(e){switch(e.kind){case m:this._fragmentSignaturesByName=()=>null;break;case g:this._parentTypeStack.pop();break;case T:this._fieldDefStack.pop(),this._typeStack.pop();break;case G:this._directive=null;break;case N:this._fragmentSignature=null;break;case v:case S:case L:this._typeStack.pop();break;case y:this._inputTypeStack.pop();break;case E:this._argument=null,this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case b:this._fragmentArgument=null,this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case x:case F:this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case D:this._enumValue=null}}}function yr(e,t){return{enter(...n){const r=n[0];e.enter(r);const i=dt(t,r.kind).enter;if(i){const o=i.apply(t,n);return void 0!==o&&(e.leave(r),p(o)&&e.enter(o)),o}},leave(...n){const r=n[0],i=dt(t,r.kind).leave;let o;return i&&(o=i.apply(t,n)),e.leave(r),o}}}function gr(e){const t=e.arguments?.find((e=>"if"===e.name.value));if(!t)return!1;if(t.value.kind===_){if(t.value.value)return!1}else if(t.value.kind!==w)return!1;return!0}function Tr(e){return e.kind===v||e.kind===L}function Er(e){return e.kind===M||e.kind===U||e.kind===J||e.kind===q||e.kind===K||e.kind===Y}function br(e){return e.kind===X||e.kind===Z||e.kind===ee||e.kind===te||e.kind===ne||e.kind===re}function Nr(e){const t=new Map,n=e.getSchema(),r=n?n.getDirectives():$n;for(const e of r)t.set(e.name,e.args.map((e=>e.name)));const i=e.getDocument().definitions;for(const e of i)if(e.kind===H){const n=e.arguments??[];t.set(e.name.value,n.map((e=>e.name.value)))}return{Directive(n){const r=n.name.value,i=t.get(r);if(null!=n.arguments&&null!=i)for(const t of n.arguments){const n=t.name.value;if(!i.includes(n)){const o=rt(n,i);e.reportError(new GraphQLError(`Unknown argument "${n}" on directive "@${r}".`+(e.hideSuggestions?"":He(o)),{nodes:t}))}}return!1}}}function Sr(e){const t=new Map,r=e.getSchema(),i=r?r.getDirectives():$n;for(const e of i)t.set(e.name,e.locations);const o=e.getDocument().definitions;for(const e of o)e.kind===H&&t.set(e.name.value,e.locations.map((e=>e.value)));return{Directive(r,i,o,s,a){const c=r.name.value,u=t.get(c);if(null==u)return void e.reportError(new GraphQLError(`Unknown directive "@${c}".`,{nodes:r}));const l=function(e){const t=e.at(-1);switch(null!=t&&"kind"in t||n(),t.kind){case v:return function(e){switch(e){case d.QUERY:return f.QUERY;case d.MUTATION:return f.MUTATION;case d.SUBSCRIPTION:return f.SUBSCRIPTION}}(t.operation);case T:return f.FIELD;case N:return f.FRAGMENT_SPREAD;case S:return f.INLINE_FRAGMENT;case L:return f.FRAGMENT_DEFINITION;case y:{const t=e[e.length-3];return"kind"in t||n(),t.kind===v?f.VARIABLE_DEFINITION:f.FRAGMENT_VARIABLE_DEFINITION}case V:case W:return f.SCHEMA;case M:case X:return f.SCALAR;case U:case Z:return f.OBJECT;case P:return f.FIELD_DEFINITION;case J:case ee:return f.INTERFACE;case q:case te:return f.UNION;case K:case ne:return f.ENUM;case z:return f.ENUM_VALUE;case Y:case re:return f.INPUT_OBJECT;case B:{const t=e.at(-3);return null!=t&&"kind"in t||n(),t.kind===Y?f.INPUT_FIELD_DEFINITION:f.ARGUMENT_DEFINITION}default:n(0,"Unexpected kind: "+Ge(t.kind))}}(a);null==l||u.includes(l)||e.reportError(new GraphQLError(`Directive "@${c}" may not be used on ${l}.`,{nodes:r}))}}}function Lr(e){const{definitions:t}=e.getDocument(),n=e.getSchema()?.getTypeMap()??{},r=new Set([...Object.keys(n),...t.filter(Er).map((e=>e.name.value))]);return{NamedType(t,n,i,o,s){const a=t.name.value;if(!r.has(a)){const n=s[2]??i,o=null!=n&&("kind"in(c=n)&&(function(e){return e.kind===V||Er(e)||e.kind===H}(c)||function(e){return e.kind===W||br(e)}(c)));if(o&&wr.has(a))return;const u=e.hideSuggestions?[]:rt(a,o?[...wr,...r]:[...r]);e.reportError(new GraphQLError(`Unknown type "${a}".`+He(u),{nodes:t}))}var c}}}const wr=new Set([...bn,...Hn].map((e=>e.name)));function Ir(e){const t=new Set,n=[];return{OperationDefinition(n){for(const r of e.getRecursivelyReferencedFragments(n))t.add(r.name.value);return!1},FragmentDefinition:e=>(n.push(e),!1),Document:{leave(){for(const r of n){const n=r.name.value;t.has(n)||e.reportError(new GraphQLError(`Fragment "${n}" is never used.`,{nodes:r}))}}}}}function Or(e){switch(e.kind){case $:return{...e,fields:(t=e.fields,t.map((e=>({...e,value:Or(e.value)}))).sort(((e,t)=>Ze(e.name.value,t.name.value))))};case x:return{...e,values:e.values.map(Or)};case I:case O:case k:case _:case A:case D:case w:return e}var t}function kr(e){return Array.isArray(e)?e.map((([e,t])=>`subfields "${e}" conflict because `+kr(t))).join(" and "):e}function _r(e,t,n,r,i,o,s,a){if(r.has(s,a.key,o))return;r.add(s,a.key,o);const c=e.getFragment(a.node.name.value);if(!c)return;const[u,l]=Vr(e,n,c,a.varMap);if(s!==u){Dr(e,t,n,r,i,o,s,void 0,u,a.varMap);for(const a of l)_r(e,t,n,r,i,o,s,a)}}function Ar(e,t,n,r,i,o,s,a){if(s.key===a.key)return;if(s.node.name.value===a.node.name.value&&!$r(s.node.arguments,s.varMap,a.node.arguments,a.varMap))return void e.reportError(new GraphQLError(`Spreads "${s.node.name.value}" conflict because ${s.key} and ${a.key} have different fragment arguments.`,{nodes:[s.node,a.node]}));if(i.has(s.key,a.key,o))return;i.add(s.key,a.key,o);const c=e.getFragment(s.node.name.value),u=e.getFragment(a.node.name.value);if(!c||!u)return;const[l,p]=Vr(e,n,c,s.varMap),[d,f]=Vr(e,n,u,a.varMap);Dr(e,t,n,r,i,o,l,s.varMap,d,a.varMap);for(const a of f)Ar(e,t,n,r,i,o,s,a);for(const s of p)Ar(e,t,n,r,i,o,s,a)}function Dr(e,t,n,r,i,o,s,a,c,u){for(const[l,p]of s.entries()){const s=c.get(l);if(null!=s)for(const c of p)for(const p of s){const s=xr(e,n,r,i,o,l,c,a,p,u);s&&t.push(s)}}}function xr(e,t,n,r,i,o,s,a,c,u){const[l,p,d]=s,[f,h,m]=c,v=i||l!==f&&wt(l)&&wt(f);if(!v){const e=p.name.value,t=h.name.value;if(e!==t)return[[o,`"${e}" and "${t}" are different fields`],[p],[h]];if(!$r(p.arguments,a,h.arguments,u))return[[o,"they have differing arguments"],[p],[h]]}const y=function(e,t,n,r){const i=Qr(e),o=Qr(n);if(!i&&!o)return;if(i&&o)return $r(i.arguments,t,o.arguments,r)?"they have overlapping stream directives. See https://github.com/graphql/defer-stream-wg/discussions/100":"they have overlapping stream directives";return"they have overlapping stream directives"}(p.directives??[],a,h.directives??[],u);if(void 0!==y)return[[o,y],[p],[h]];const g=d?.type,T=m?.type;if(g&&T&&Cr(g,T))return[[o,`they return conflicting types "${Ge(g)}" and "${Ge(T)}"`],[p],[h]];const E=p.selectionSet,b=h.selectionSet;if(E&&b){const i=function(e,t,n,r,i,o,s,a,c,u,l){const p=[],[d,f]=Rr(e,t,o,s,a),[h,m]=Rr(e,t,c,u,l);Dr(e,p,t,n,r,i,d,a,h,l);for(const o of m)_r(e,p,t,n,r,i,d,o);for(const o of f)_r(e,p,t,n,r,i,h,o);for(const o of f)for(const s of m)Ar(e,p,t,n,r,i,o,s);return p}(e,t,n,r,v,Ut(g),E,a,Ut(T),b,u);return function(e,t,n,r){if(e.length>0)return[[t,e.map((([e])=>e))],[n,...e.map((([,e])=>e)).flat()],[r,...e.map((([,,e])=>e)).flat()]]}(i,o,p,h)}}function $r(e,t,n,r){if(void 0===e||0===e.length)return void 0===n||0===n.length;if(void 0===n||0===n.length)return!1;if(e.length!==n.length)return!1;const i=new Map(n.map((({name:e,value:t})=>[e.value,void 0===r?t:Fr(t,r)])));return e.every((e=>{let n=e.value;t&&(n=Fr(n,t));const r=i.get(e.name.value);return void 0!==r&&Gr(n)===Gr(r)}))}function Fr(e,t){switch(e.kind){case w:return t.get(e.name.value)??e;case x:return{...e,values:e.values.map((e=>Fr(e,t)))};case $:return{...e,fields:e.fields.map((e=>({...e,value:Fr(e.value,t)})))};default:return e}}function Gr(e){return ft(Or(e))}function Qr(e){return e.find((e=>"stream"===e.name.value))}function Cr(e,t){return Dt(e)?!Dt(t)||Cr(e.ofType,t.ofType):!!Dt(t)||(xt(e)?!xt(t)||Cr(e.ofType,t.ofType):!!xt(t)||!(!Gt(e)&&!Gt(t))&&e!==t)}function Rr(e,t,n,r,i){const o=t.get(r);if(o)return o;const s=new Map,a=new Map;jr(e,n,r,s,a,i);const c=[s,Array.from(a.values())];return t.set(r,c),c}function Vr(e,t,n,r){const i=t.get(n.selectionSet);if(i)return i;const o=vr(e.getSchema(),n.typeCondition);return Rr(e,t,o,n.selectionSet,r)}function jr(e,t,n,r,i,o){for(const s of n.selections)switch(s.kind){case T:{const e=s.name.value;let n;(wt(t)||Ot(t))&&(n=t.getFields()[e]);const i=s.alias?s.alias.value:e;let o=r.get(i);null==o&&(o=[],r.set(i,o)),o.push([t,s,n]);break}case N:{const t=Mr(e,s,o);i.set(t.key,t);break}case S:{const n=s.typeCondition,a=n?vr(e.getSchema(),n):t;jr(e,a,s.selectionSet,r,i,o);break}}}function Mr(e,t,n){let r="";const i=new Map,o=e.getFragmentSignatureByName()(t.name.value),s=new Map;if(t.arguments)for(const e of t.arguments)s.set(e.name.value,e.value);if(o?.variableDefinitions){r+=t.name.value+"(";for(const[e,t]of o.variableDefinitions){const o=s.get(e);o&&(r+=e+": "+ft(Or(o)));const a=s.get(e);void 0!==a?i.set(e,void 0!==n?Fr(a,n):a):t.defaultValue&&i.set(e,t.defaultValue)}r+=")"}return{key:r,node:t,varMap:i.size>0?i:void 0}}class OrderedPairSet{constructor(){this._data=new Map}has(e,t,n){const r=this._data.get(e)?.get(t);return void 0!==r&&(!!n||n===r)}add(e,t,n){const r=this._data.get(e);void 0===r?this._data.set(e,new Map([[t,n]])):r.set(t,n)}}class PairSet{constructor(){this._orderedPairSet=new OrderedPairSet}has(e,t,n){return e[e.name,e]))));const i=e.getDocument().definitions;for(const e of i)if(e.kind===H){const n=e.arguments??[];t.set(e.name.value,new Map(n.filter(Br).map((e=>[e.name.value,e]))))}return{Directive:{leave(n){const r=n.name.value,i=t.get(r);if(null!=i){const t=n.arguments??[],o=new Set(t.map((e=>e.name.value)));for(const[t,s]of i.entries())if(!o.has(t)){const i=St(s.type)?Ge(s.type):ft(s.type);e.reportError(new GraphQLError(`Argument "@${r}(${t}:)" of type "${i}" is required, but it was not provided.`,{nodes:n}))}}}}}}function Br(e){return e.type.kind===R&&null==e.defaultValue}function Jr(e,n){if(xt(n)){if(null==e)return;return Jr(e,n.ofType)}if(null==e)return null;if(Dt(n)){if(!Je(e)){const t=Jr(e,n.ofType);if(void 0===t)return;return[t]}const t=[];for(const r of e){const e=Jr(r,n.ofType);if(void 0===e)return;t.push(e)}return t}if(At(n)){if(!t(e)||Array.isArray(e))return;const r={},i=n.getFields();if(Object.keys(e).some((e=>!Object.hasOwn(i,e))))return;for(const t of Object.values(i)){const n=e[t.name];if(void 0===n){if(Wt(t))return;const e=zr(t);void 0!==e&&(r[t.name]=e)}else{const e=Jr(n,t.type);if(void 0===e)return;r[t.name]=e}}if(n.isOneOf){const e=Object.keys(r);if(1!==e.length)return;if(null===r[e[0]])return}return r}const r=Qt(n);try{return r.coerceInputValue(e)}catch(e){}}function qr(e,t,n,r){if(e.kind===w){const i=Kr(e,n,r);if(null==i&&xt(t))return;return i}if(xt(t)){if(e.kind===A)return;return qr(e,t.ofType,n,r)}if(e.kind===A)return null;if(Dt(t)){if(e.kind!==x){const i=qr(e,t.ofType,n,r);if(void 0===i)return;return[i]}const i=[];for(const o of e.values){let e=qr(o,t.ofType,n,r);if(void 0===e){if(o.kind!==w||null!=Kr(o,n,r)||xt(t.ofType))return;e=null}i.push(e)}return i}if(At(t)){if(e.kind!==$)return;const i={},o=t.getFields();if(e.fields.some((e=>!Object.hasOwn(o,e.name.value))))return;const s=new Map(e.fields.map((e=>[e.name.value,e])));for(const e of Object.values(o)){const t=s.get(e.name);if(!t||t.value.kind===w&&null==Kr(t.value,n,r)){if(Wt(e))return;const t=zr(e);void 0!==t&&(i[e.name]=t)}else{const o=qr(t.value,e.type,n,r);if(void 0===o)return;i[e.name]=o}}if(t.isOneOf){const e=Object.keys(i);if(1!==e.length)return;if(null===i[e[0]])return}return i}const i=Qt(t);try{return i.coerceInputLiteral?i.coerceInputLiteral(sn(e,n,r)):i.parseLiteral(e,n?.coerced)}catch(e){}}function Kr(e,t,n){const r=e.name.value;return void 0!==n?.sources[r]?n.coerced[r]:t?.coerced[r]}function zr(e){let t=e._memoizedCoercedDefaultValue;if(void 0!==t)return t;const r=e.default;if(void 0!==r)return t=r.literal?qr(r.literal,e.type):Jr(r.value,e.type),void 0!==t||n(),e._memoizedCoercedDefaultValue=t,t;const i=e.defaultValue;return void 0!==i&&(e._memoizedCoercedDefaultValue=i),i}function Yr(e,t,n,r,i){const o=e.arguments??[],s=new Map(o.map((e=>[e.name.value,e]))),a=Object.create(null),c=Object.create(null);for(const[o,u]of Object.entries(t)){a[o]={signature:u};const t=s.get(o);if(void 0!==t){const e=a[o];e.value=t.value,e.fragmentVariableValues=r}Wr(c,e,o,u,t,n,r,i)}return{sources:a,coerced:c}}function Hr(e,t,n,r,i){const o={},s=t.arguments??[],a=new Map(s.map((e=>[e.name.value,e])));for(const s of e.args){Wr(o,t,s.name,s,a.get(s.name),n,r,i)}return o}function Wr(e,t,r,i,o,s,a,c){const u=i.type;if(!o){if(Kt(i))throw new GraphQLError(`Argument "${It(i)?i:r}" of required type "${u}" was not provided.`,{nodes:t});const n=zr(i);return void(void 0!==n&&(e[r]=n))}const l=o.value;if(l.kind===w){const t=l.name.value,n=a?.sources[t]?a:s;if(!(null!=n&&Object.hasOwn(n.coerced,t)||Kt(i))){const t=zr(i);return void(void 0!==t&&(e[r]=t))}}const p=qr(l,u,s,a);void 0===p&&(ln(l,u,((e,t)=>{throw e.message=`Argument "${It(i)?i:i.name}" has invalid value${ze(t)}: ${e.message}`,e}),s,a,c),n(0,"Invalid argument")),e[r]=p}function Xr(e,t,n,r,i){const o=t.directives?.find((t=>t.name.value===e.name));if(o)return Hr(e,o,n,r,i)}function Zr(e,t,n,r,i,o,s=!1){const a=new AccumulatorMap,c=[],u={schema:e,fragments:t,variableValues:n,runtimeType:r,visitedFragmentNames:new Set,hideSuggestions:o,forbiddenDirectiveInstances:[],forbidSkipAndInclude:s};return ei(u,i,a,c),{groupedFieldSet:a,newDeferUsages:c,forbiddenDirectiveInstances:u.forbiddenDirectiveInstances}}function ei(e,t,n,r,i,o){const{schema:s,fragments:a,variableValues:c,runtimeType:u,visitedFragmentNames:l,hideSuggestions:p}=e;for(const f of t.selections)switch(f.kind){case T:if(!ni(e,f,c,o))continue;n.add((d=f).alias?d.alias.value:d.name.value,{node:f,deferUsage:i,fragmentVariableValues:o});break;case S:{if(!ni(e,f,c,o)||!ri(s,f,u))continue;const t=ti(c,o,f,i);t?(r.push(t),ei(e,f.selectionSet,n,r,t,o)):ei(e,f.selectionSet,n,r,i,o);break}case N:{const t=f.name.value;if(l.has(t)||!ni(e,f,c,o))continue;const d=a[t];if(null==d||!ri(s,d.definition,u))continue;const h=ti(c,o,f,i),m=d.variableSignatures;let v;m&&(v=Yr(f,m,c,o,p)),h?(r.push(h),ei(e,d.definition.selectionSet,n,r,h,v)):(l.add(t),ei(e,d.definition.selectionSet,n,r,i,v));break}}var d}function ti(e,t,n,r){const i=Xr(On,n,e,t);if(i&&!1!==i.if)return{label:"string"==typeof i.label?i.label:void 0,parentDeferUsage:r}}function ni(e,t,n,r){const i=t.directives?.find((e=>e.name.value===In.name));if(i&&e.forbidSkipAndInclude)return e.forbiddenDirectiveInstances.push(i),!1;const o=i?Hr(In,i,n,r,e.hideSuggestions):void 0;if(!0===o?.if)return!1;const s=t.directives?.find((e=>e.name.value===wn.name));if(s&&e.forbidSkipAndInclude)return e.forbiddenDirectiveInstances.push(s),!1;const a=s?Hr(wn,s,n,r,e.hideSuggestions):void 0;return!1!==a?.if}function ri(e,t,n){const r=t.typeCondition;if(!r)return!0;const i=vr(e,r);return i===n||!!Rt(i)&&e.isSubType(i,n)}function ii(e){return e.map((e=>e.node))}function oi(e,t){const n=new AccumulatorMap;for(const r of e)n.add(t(r),r);return n}function si(e){return{Field:t,Directive:t};function t(t){const n=oi(t.arguments??[],(e=>e.name.value));for(const[t,r]of n)r.length>1&&e.reportError(new GraphQLError(`There can be only one argument named "${t}".`,{nodes:r.map((e=>e.name))}))}}function ai(e){const t=new Map,n=e.getSchema(),r=n?n.getDirectives():$n;for(const e of r)t.set(e.name,!e.isRepeatable);const i=e.getDocument().definitions;for(const e of i)e.kind===H&&t.set(e.name.value,!e.repeatable);const o=new Map,s=new Map;return{enter(n){if(!("directives"in n)||!n.directives)return;let r;if(n.kind===V||n.kind===W)r=o;else if(Er(n)||br(n)){const e=n.name.value;r=s.get(e),void 0===r&&(r=new Map,s.set(e,r))}else r=new Map;for(const i of n.directives){const n=i.name.value;if(!0===t.get(n)){const t=r.get(n);null!=t?e.reportError(new GraphQLError(`The directive "@${n}" can only be used once at this location.`,{nodes:[t,i]})):r.set(n,i)}}}}}function ci(e,t){return!!(wt(e)||Ot(e)||At(e))&&null!=e.getFields()[t]}function ui(e){const t=[];let r=new Map;return{ObjectValue:{enter(){t.push(r),r=new Map},leave(){const e=t.pop();null!=e||n(),r=e}},ObjectField(t){const n=t.name.value,i=r.get(n);null!=i?e.reportError(new GraphQLError(`There can be only one input field named "${n}".`,{nodes:[i,t.name]})):r.set(n,t.name)}}}function li(e,t,n){return n&&ln(t,n,(t=>{e.reportError(t)}),void 0,void 0,e.hideSuggestions),!1}function pi(e,t,n,r,i){if(xt(r)&&!xt(t)){if(!(null!=n&&n.kind!==A)&&!(void 0!==i))return!1;return Zt(e,t,r.ofType)}return Zt(e,t,r)}const di=Object.freeze([function(e){function t(n,r=Object.create(null),i=0){if(n.kind===N){const o=n.name.value;if(!0===r[o])return!1;const s=e.getFragment(o);if(!s)return!1;try{return r[o]=!0,t(s,r,i)}finally{r[o]=void 0}}if(n.kind===T&&("fields"===n.name.value||"interfaces"===n.name.value||"possibleTypes"===n.name.value||"inputFields"===n.name.value)&&++i>=3)return!0;if("selectionSet"in n&&n.selectionSet)for(const e of n.selectionSet.selections)if(t(e,r,i))return!0;return!1}return{Field(n){if(("__schema"===n.name.value||"__type"===n.name.value)&&t(n))return e.reportError(new GraphQLError("Maximum introspection depth exceeded",{nodes:[n]})),!1}}}]),fi=Object.freeze([function(e){return{Document(t){for(const n of t.definitions)if(!Tr(n)){const t=n.kind===V||n.kind===W?"schema":'"'+n.name.value+'"';e.reportError(new GraphQLError(`The ${t} definition is not executable.`,{nodes:n}))}return!1}}},function(e){const t=e.getSchema();return{OperationDefinition(n){const r=n.operation;t.getRootType(r)||e.reportError(new GraphQLError(`The ${r} operation is not supported by the schema.`,{nodes:n}))}}},function(e){const t=new Map;return{OperationDefinition(n){const r=n.name;if(null!=r){const n=t.get(r.value);null!=n?e.reportError(new GraphQLError(`There can be only one operation named "${r.value}".`,{nodes:[n,r]})):t.set(r.value,r)}return!1},FragmentDefinition:()=>!1}},function(e){let t=0;return{Document(e){t=e.definitions.filter((e=>e.kind===v)).length},OperationDefinition(n){!n.name&&t>1&&e.reportError(new GraphQLError("This anonymous operation must be the only defined operation.",{nodes:n}))}}},function(e){return{OperationDefinition(t){if("subscription"===t.operation){const n=e.getSchema(),r=n.getSubscriptionType();if(r){const i=t.name?t.name.value:null,o=Object.create(null),s=e.getDocument(),a=Object.create(null);for(const e of s.definitions)e.kind===L&&(a[e.name.value]={definition:e});const{groupedFieldSet:c,forbiddenDirectiveInstances:u}=Zr(n,a,o,r,t.selectionSet,e.hideSuggestions,!0);if(u.length>0)return void e.reportError(new GraphQLError(null!=i?`Subscription "${i}" must not use \`@skip\` or \`@include\` directives in the top level selection.`:"Anonymous Subscription must not use `@skip` or `@include` directives in the top level selection.",{nodes:u}));if(c.size>1){const t=[...c.values()].slice(1).flatMap((e=>ii(e)));e.reportError(new GraphQLError(null!=i?`Subscription "${i}" must select only one top level field.`:"Anonymous Subscription must select only one top level field.",{nodes:t}))}for(const t of c.values()){ii(t)[0].name.value.startsWith("__")&&e.reportError(new GraphQLError(null!=i?`Subscription "${i}" must not select an introspection top level field.`:"Anonymous Subscription must not select an introspection top level field.",{nodes:ii(t)}))}}}}}},Lr,function(e){return{InlineFragment(t){const n=t.typeCondition;if(n){const t=vr(e.getSchema(),n);if(t&&!Ct(t)){const t=ft(n);e.reportError(new GraphQLError(`Fragment cannot condition on non composite type "${t}".`,{nodes:n}))}}},FragmentDefinition(t){const n=vr(e.getSchema(),t.typeCondition);if(n&&!Ct(n)){const n=ft(t.typeCondition);e.reportError(new GraphQLError(`Fragment "${t.name.value}" cannot condition on non composite type "${n}".`,{nodes:t.typeCondition}))}}}},function(e){return{VariableDefinition(t){const n=vr(e.getSchema(),t.type);if(void 0!==n&&!$t(n)){const n=t.variable.name.value,r=ft(t.type);e.reportError(new GraphQLError(`Variable "$${n}" cannot be non-input type "${r}".`,{nodes:t.type}))}}}},function(e){return{Field(t){const n=e.getType(),r=t.selectionSet;if(n)if(Gt(Ut(n))){if(r){const i=t.name.value,o=Ge(n);e.reportError(new GraphQLError(`Field "${i}" must not have a selection since type "${o}" has no subfields.`,{nodes:r}))}}else if(r){if(0===r.selections.length){const r=t.name.value,i=Ge(n);e.reportError(new GraphQLError(`Field "${r}" of type "${i}" must have at least one field selected.`,{nodes:t}))}}else{const r=t.name.value,i=Ge(n);e.reportError(new GraphQLError(`Field "${r}" of type "${i}" must have a selection of subfields. Did you mean "${r} { ... }"?`,{nodes:t}))}}}},function(e){return{Field(t){const n=e.getParentType();if(n){if(!e.getFieldDef()){const r=e.getSchema(),i=t.name.value;let o=He("to use an inline fragment on",e.hideSuggestions?[]:function(e,t,n){if(!Rt(t))return[];const r=new Set,i=Object.create(null);for(const o of e.getPossibleTypes(t))if(null!=o.getFields()[n]){r.add(o),i[o.name]=1;for(const e of o.getInterfaces())null!=e.getFields()[n]&&(r.add(e),i[e.name]=(i[e.name]??0)+1)}return[...r].sort(((t,n)=>{const r=i[n.name]-i[t.name];return 0!==r?r:Ot(t)&&e.isSubType(t,n)?-1:Ot(n)&&e.isSubType(n,t)?1:Ze(t.name,n.name)})).map((e=>e.name))}(r,n,i));""===o&&(o=He(e.hideSuggestions?[]:function(e,t){if(wt(e)||Ot(e)){return rt(t,Object.keys(e.getFields()))}return[]}(n,i))),e.reportError(new GraphQLError(`Cannot query field "${i}" on type "${n}".`+o,{nodes:t}))}}}}},function(e){const t=new Map;return{OperationDefinition:()=>!1,FragmentDefinition(n){const r=n.name.value,i=t.get(r);return null!=i?e.reportError(new GraphQLError(`There can be only one fragment named "${r}".`,{nodes:[i,n.name]})):t.set(r,n.name),!1}}},function(e){return{FragmentSpread(t){const n=t.name.value;e.getFragment(n)||e.reportError(new GraphQLError(`Unknown fragment "${n}".`,{nodes:t.name}))}}},Ir,function(e){return{InlineFragment(t){const n=e.getType(),r=e.getParentType();if(Ct(n)&&Ct(r)&&!en(e.getSchema(),n,r)){const i=Ge(r),o=Ge(n);e.reportError(new GraphQLError(`Fragment cannot be spread here as objects of type "${i}" can never be of type "${o}".`,{nodes:t}))}},FragmentSpread(t){const n=t.name.value,r=function(e,t){const n=e.getFragment(t);if(n){const t=vr(e.getSchema(),n.typeCondition);if(Ct(t))return t}}(e,n),i=e.getParentType();if(r&&i&&!en(e.getSchema(),r,i)){const o=Ge(i),s=Ge(r);e.reportError(new GraphQLError(`Fragment "${n}" cannot be spread here as objects of type "${o}" can never be of type "${s}".`,{nodes:t}))}}}},function(e){const t=new Set,n=[],r=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition:e=>(i(e),!1)};function i(o){if(t.has(o.name.value))return;const s=o.name.value;t.add(s);const a=e.getFragmentSpreads(o.selectionSet);if(0!==a.length){r[s]=n.length;for(const t of a){const o=t.name.value,s=r[o];if(n.push(t),void 0===s){const t=e.getFragment(o);t&&i(t)}else{const t=n.slice(s),r=t.slice(0,-1).map((e=>'"'+e.name.value+'"')).join(", ");e.reportError(new GraphQLError(`Cannot spread fragment "${o}" within itself`+(""!==r?` via ${r}.`:"."),{nodes:t}))}n.pop()}r[s]=void 0}}},function(e){return{OperationDefinition(t){const n=oi(t.variableDefinitions??[],(e=>e.variable.name.value));for(const[t,r]of n)r.length>1&&e.reportError(new GraphQLError(`There can be only one variable named "$${t}".`,{nodes:r.map((e=>e.variable.name))}))}}},function(e){return{OperationDefinition(t){const n=new Set(t.variableDefinitions?.map((e=>e.variable.name.value))),r=e.getRecursiveVariableUsages(t);for(const{node:i,fragmentVariableDefinition:o}of r){if(o)continue;const r=i.name.value;n.has(r)||e.reportError(new GraphQLError(t.name?`Variable "$${r}" is not defined by operation "${t.name.value}".`:`Variable "$${r}" is not defined.`,{nodes:[i,t]}))}}}},function(e){return{FragmentDefinition(t){const n=e.getVariableUsages(t),r=new Set(n.map((({node:e})=>e.name.value))),i=t.variableDefinitions??[];for(const n of i){const i=n.variable.name.value;r.has(i)||e.reportError(new GraphQLError(`Variable "$${i}" is never used in fragment "${t.name.value}".`,{nodes:n}))}},OperationDefinition(t){const n=e.getRecursiveVariableUsages(t),r=new Set;for(const{node:e,fragmentVariableDefinition:t}of n){const n=e.name.value;t||r.add(n)}const i=t.variableDefinitions??[];for(const n of i){const i=n.variable.name.value;r.has(i)||e.reportError(new GraphQLError(t.name?`Variable "$${i}" is never used in operation "${t.name.value}".`:`Variable "$${i}" is never used.`,{nodes:n}))}}}},Sr,ai,function(e){return{Directive(t){const n=e.getSchema().getMutationType(),r=e.getSchema().getSubscriptionType(),i=e.getParentType();i&&t.name.value===On.name&&(n&&i===n&&e.reportError(new GraphQLError(`Defer directive cannot be used on root mutation type "${i}".`,{nodes:t})),r&&i===r&&e.reportError(new GraphQLError(`Defer directive cannot be used on root subscription type "${i}".`,{nodes:t}))),i&&t.name.value===kn.name&&(n&&i===n&&e.reportError(new GraphQLError(`Stream directive cannot be used on root mutation type "${i}".`,{nodes:t})),r&&i===r&&e.reportError(new GraphQLError(`Stream directive cannot be used on root subscription type "${i}".`,{nodes:t})))}}},function(e){const t=new Set;return{OperationDefinition(n){if(n.operation===d.SUBSCRIPTION)for(const r of e.getRecursivelyReferencedFragments(n))t.add(r.name.value)},Directive(n,r,i,o,s){const a=s[2];"kind"in a&&(a.kind===L&&t.has(a.name.value)||a.kind===v&&a.operation===d.SUBSCRIPTION)&&(n.name.value===On.name?gr(n)||e.reportError(new GraphQLError("Defer directive not supported on subscription operations. Disable `@defer` by setting the `if` argument to `false`.",{nodes:n})):n.name.value===kn.name&&(gr(n)||e.reportError(new GraphQLError("Stream directive not supported on subscription operations. Disable `@stream` by setting the `if` argument to `false`.",{nodes:n}))))}}},function(e){const t=new Map;return{Directive(n){if(n.name.value===On.name||n.name.value===kn.name){const r=n.arguments?.find((e=>"label"===e.name.value)),i=r?.value;if(!i)return;if(i.kind!==k)return void e.reportError(new GraphQLError(`Argument "@${n.name.value}(label:)" must be a static string.`,{nodes:n}));const o=t.get(i.value);null!=o?e.reportError(new GraphQLError('Value for arguments "defer(label:)" and "stream(label:)" must be unique across all Defer/Stream directive usages.',{nodes:[o,n]})):t.set(i.value,n)}}}},function(e){return{Directive(t){const n=e.getFieldDef(),r=e.getParentType();n&&r&&t.name.value===kn.name&&!(Dt(n.type)||Vt(n.type)&&Dt(n.type.ofType))&&e.reportError(new GraphQLError(`Directive "@stream" cannot be used on non-list field "${r}.${n.name}".`,{nodes:t}))}}},function(e){return{...Nr(e),FragmentArgument(t){const n=e.getFragmentSignature();if(n){if(!n.variableDefinitions.get(t.name.value)){const r=t.name.value,i=e.hideSuggestions?[]:rt(r,Array.from(n.variableDefinitions.values()).map((e=>e.variable.name.value)));e.reportError(new GraphQLError(`Unknown argument "${r}" on fragment "${n.definition.name.value}".`+He(i),{nodes:t}))}}},Argument(t){const n=e.getArgument(),r=e.getFieldDef();if(!n&&r){const n=t.name.value,i=e.hideSuggestions?[]:rt(n,r.args.map((e=>e.name)));e.reportError(new GraphQLError(`Unknown argument "${n}" on field "${r}".`+He(i),{nodes:t}))}}}},si,function(e){return{NullValue:t=>li(e,t,e.getInputType()),ListValue:t=>li(e,t,e.getParentInputType()),ObjectValue:t=>li(e,t,e.getInputType()),EnumValue:t=>li(e,t,e.getInputType()),IntValue:t=>li(e,t,e.getInputType()),FloatValue:t=>li(e,t,e.getInputType()),StringValue:t=>li(e,t,e.getInputType()),BooleanValue:t=>li(e,t,e.getInputType())}},function(e){return{...Pr(e),Field:{leave(t){const n=e.getFieldDef();if(!n)return!1;const r=new Set(t.arguments?.map((e=>e.name.value)));for(const i of n.args)!r.has(i.name)&&Kt(i)&&e.reportError(new GraphQLError(`Argument "${i}" of type "${i.type}" is required, but it was not provided.`,{nodes:t}))}},FragmentSpread:{leave(t){const n=e.getFragmentSignature();if(!n)return!1;const r=new Set(t.arguments?.map((e=>e.name.value)));for(const[i,o]of n.variableDefinitions)if(!r.has(i)&&Br(o)){const n=Ge(vr(e.getSchema(),o.type));e.reportError(new GraphQLError(`Fragment "${t.name.value}" argument "${i}" of type "${n}" is required, but it was not provided.`,{nodes:t}))}}}}},function(e){let t;return{OperationDefinition:{enter(){t=new Map},leave(n){const r=e.getRecursiveVariableUsages(n);for(const{node:n,type:i,parentType:o,defaultValue:s,fragmentVariableDefinition:a}of r){const r=n.name.value;let c=a;if(c||(c=t.get(r)),c&&i){const t=e.getSchema(),a=vr(t,c.type);a&&!pi(t,a,c.defaultValue,i,s)&&e.reportError(new GraphQLError(`Variable "$${r}" of type "${a}" used in position expecting type "${i}".`,{nodes:[c,n]})),At(o)&&o.isOneOf&&jt(a)&&e.reportError(new GraphQLError(`Variable "$${r}" is of type "${a}" but must be non-nullable to be used for OneOf Input Object "${o}".`,{nodes:[c,n]}))}}}},VariableDefinition(e){t.set(e.variable.name.value,e)}}},function(e){const t=new OrderedPairSet,n=new PairSet,r=new Map;return{SelectionSet(i){const o=function(e,t,n,r,i,o){const s=[],[a,c]=Rr(e,t,i,o,void 0);if(function(e,t,n,r,i,o){for(const[s,a]of o.entries())if(a.length>1)for(let o=0;o0&&e.reportError(new GraphQLError("Must provide only one schema definition.",{nodes:t})),++r)}}},function(e){const t=e.getSchema(),n=new Map,r=t?{query:t.getQueryType(),mutation:t.getMutationType(),subscription:t.getSubscriptionType()}:{};return{SchemaDefinition:i,SchemaExtension:i};function i(t){const i=t.operationTypes??[];for(const t of i){const i=t.operation,o=n.get(i);r[i]?e.reportError(new GraphQLError(`Type for ${i} already defined in the schema. It cannot be redefined.`,{nodes:t})):o?e.reportError(new GraphQLError(`There can be only one ${i} type in schema.`,{nodes:[o,t]})):n.set(i,t)}return!1}},function(e){const t=new Map,n=e.getSchema();return{ScalarTypeDefinition:r,ObjectTypeDefinition:r,InterfaceTypeDefinition:r,UnionTypeDefinition:r,EnumTypeDefinition:r,InputObjectTypeDefinition:r};function r(r){const i=r.name.value;if(n?.getType(i))return void e.reportError(new GraphQLError(`Type "${i}" already exists in the schema. It cannot also be defined in this type definition.`,{nodes:r.name}));const o=t.get(i);return null!=o?e.reportError(new GraphQLError(`There can be only one type named "${i}".`,{nodes:[o,r.name]})):t.set(i,r.name),!1}},function(e){const t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),r=new Map;return{EnumTypeDefinition:i,EnumTypeExtension:i};function i(t){const i=t.name.value;let o=r.get(i);null==o&&(o=new Map,r.set(i,o));const s=t.values??[];for(const t of s){const r=t.name.value,s=n[i];if(_t(s)&&s.getValue(r)){e.reportError(new GraphQLError(`Enum value "${i}.${r}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:t.name}));continue}const a=o.get(r);null!=a?e.reportError(new GraphQLError(`Enum value "${i}.${r}" can only be defined once.`,{nodes:[a,t.name]})):o.set(r,t.name)}return!1}},function(e){const t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),r=new Map;return{InputObjectTypeDefinition:i,InputObjectTypeExtension:i,InterfaceTypeDefinition:i,InterfaceTypeExtension:i,ObjectTypeDefinition:i,ObjectTypeExtension:i};function i(t){const i=t.name.value;let o=r.get(i);null==o&&(o=new Map,r.set(i,o));const s=t.fields??[];for(const t of s){const r=t.name.value;if(ci(n[i],r)){e.reportError(new GraphQLError(`Field "${i}.${r}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:t.name}));continue}const s=o.get(r);null!=s?e.reportError(new GraphQLError(`Field "${i}.${r}" can only be defined once.`,{nodes:[s,t.name]})):o.set(r,t.name)}return!1}},function(e){return{DirectiveDefinition(e){const t=e.arguments??[];return n(`@${e.name.value}`,t)},InterfaceTypeDefinition:t,InterfaceTypeExtension:t,ObjectTypeDefinition:t,ObjectTypeExtension:t};function t(e){const t=e.name.value,r=e.fields??[];for(const e of r){n(`${t}.${e.name.value}`,e.arguments??[])}return!1}function n(t,n){const r=oi(n,(e=>e.name.value));for(const[n,i]of r)i.length>1&&e.reportError(new GraphQLError(`Argument "${t}(${n}:)" can only be defined once.`,{nodes:i.map((e=>e.name))}));return!1}},function(e){const t=new Map,n=e.getSchema();return{DirectiveDefinition(r){const i=r.name.value;if(n?.getDirective(i))return void e.reportError(new GraphQLError(`Directive "@${i}" already exists in the schema. It cannot be redefined.`,{nodes:r.name}));const o=t.get(i);return o?e.reportError(new GraphQLError(`There can be only one directive named "@${i}".`,{nodes:[o,r.name]})):t.set(i,r.name),!1}}},Lr,Sr,ai,function(e){const t=e.getSchema(),r=new Map;for(const t of e.getDocument().definitions)Er(t)&&r.set(t.name.value,t);return{ScalarTypeExtension:i,ObjectTypeExtension:i,InterfaceTypeExtension:i,UnionTypeExtension:i,EnumTypeExtension:i,InputObjectTypeExtension:i};function i(i){const o=i.name.value,s=r.get(o),a=t?.getType(o);let c;if(null!=s?c=Ur[s.kind]:a&&(c=function(e){if(Lt(e))return X;if(wt(e))return Z;if(Ot(e))return ee;if(kt(e))return te;if(_t(e))return ne;if(At(e))return re;n(0,"Unexpected type: "+Ge(e))}(a)),null!=c){if(c!==i.kind){const t=function(e){switch(e){case X:return"scalar";case Z:return"object";case ee:return"interface";case te:return"union";case ne:return"enum";case re:return"input object";default:n(0,"Unexpected kind: "+Ge(e))}}(i.kind);e.reportError(new GraphQLError(`Cannot extend non-${t} type "${o}".`,{nodes:s?[s,i]:i}))}}else{const n=[...r.keys(),...Object.keys(t?.getTypeMap()??{})];e.reportError(new GraphQLError(`Cannot extend type "${o}" because it is not defined.`+He(rt(o,n)),{nodes:i.name}))}}},Nr,si,ui,Pr]);class ASTValidationContext{constructor(e,t){this._ast=e,this._fragments=void 0,this._fragmentSpreads=new Map,this._recursivelyReferencedFragments=new Map,this._onError=t}get[Symbol.toStringTag](){return"ASTValidationContext"}reportError(e){this._onError(e)}getDocument(){return this._ast}getFragment(e){let t;if(this._fragments)t=this._fragments;else{t=Object.create(null);for(const e of this.getDocument().definitions)e.kind===L&&(t[e.name.value]=e);this._fragments=t}return t[e]}getFragmentSpreads(e){let t=this._fragmentSpreads.get(e);if(!t){t=[];const n=[e];let r;for(;r=n.pop();)for(const e of r.selections)e.kind===N?t.push(e):e.selectionSet&&n.push(e.selectionSet);this._fragmentSpreads.set(e,t)}return t}getRecursivelyReferencedFragments(e){let t=this._recursivelyReferencedFragments.get(e);if(!t){t=[];const n=new Set,r=[e.selectionSet];let i;for(;i=r.pop();)for(const e of this.getFragmentSpreads(i)){const i=e.name.value;if(!n.has(i)){n.add(i);const e=this.getFragment(i);e&&(t.push(e),r.push(e.selectionSet))}}this._recursivelyReferencedFragments.set(e,t)}return t}}class SDLValidationContext extends ASTValidationContext{constructor(e,t,n){super(e,n),this._schema=t}get hideSuggestions(){return!1}get[Symbol.toStringTag](){return"SDLValidationContext"}getSchema(){return this._schema}}class ValidationContext extends ASTValidationContext{constructor(e,t,n,r,i){super(t,r),this._schema=e,this._typeInfo=n,this._variableUsages=new Map,this._recursiveVariableUsages=new Map,this._hideSuggestions=i??!1}get[Symbol.toStringTag](){return"ValidationContext"}get hideSuggestions(){return this._hideSuggestions}getSchema(){return this._schema}getVariableUsages(e){let t=this._variableUsages.get(e);if(!t){const n=[],r=new TypeInfo(this._schema,void 0,this._typeInfo.getFragmentSignatureByName()),i=e.kind===L?e:void 0;lt(e,yr(r,{VariableDefinition:()=>!1,Variable(e){let t;if(i){const o=r.getFragmentSignatureByName()(i.name.value);t=o?.variableDefinitions.get(e.name.value),n.push({node:e,type:r.getInputType(),parentType:r.getParentInputType(),defaultValue:void 0,fragmentVariableDefinition:t})}else n.push({node:e,type:r.getInputType(),parentType:r.getParentInputType(),defaultValue:r.getDefaultValue(),fragmentVariableDefinition:void 0})}})),t=n,this._variableUsages.set(e,t)}return t}getRecursiveVariableUsages(e){let t=this._recursiveVariableUsages.get(e);if(!t){t=this.getVariableUsages(e);for(const n of this.getRecursivelyReferencedFragments(e))t=t.concat(this.getVariableUsages(n));this._recursiveVariableUsages.set(e,t)}return t}getType(){return this._typeInfo.getType()}getParentType(){return this._typeInfo.getParentType()}getInputType(){return this._typeInfo.getInputType()}getParentInputType(){return this._typeInfo.getParentInputType()}getFieldDef(){return this._typeInfo.getFieldDef()}getDirective(){return this._typeInfo.getDirective()}getArgument(){return this._typeInfo.getArgument()}getFragmentSignature(){return this._typeInfo.getFragmentSignature()}getFragmentSignatureByName(){return this._typeInfo.getFragmentSignatureByName()}getEnumValue(){return this._typeInfo.getEnumValue()}}function mi(e,t,n=fi,r){!function(e){const t=er(e);if(0!==t.length)throw new Error(t.map((e=>e.message)).join("\n\n"))}(e);const i=new GraphQLError("Too many validation errors, error limit reached. Validation aborted."),o=[],s=new TypeInfo(e),a=new ValidationContext(e,t,s,(e=>{if(o.length>=100)throw i;o.push(e)}),!1),c=pt(n.map((e=>e(a))));try{lt(t,yr(s,c))}catch(e){if(e!==i)throw e;o.push(i)}return o}function vi(e,n){t(e)&&t(e.__schema)||xe(0,`Invalid or incomplete introspection result. Ensure that you are passing "data" property of introspection response and no "errors" was returned alongside: ${Ge(e)}.`);const r=e.__schema,i=new Map(r.types.map((e=>[e.name,f(e)])));for(const e of[...bn,...Hn])i.has(e.name)&&i.set(e.name,e);const o=null!=r.queryType?p(r.queryType):null,s=null!=r.mutationType?p(r.mutationType):null,a=null!=r.subscriptionType?p(r.subscriptionType):null,c=null!=r.directives?r.directives.map((function(e){if(null==e.args){const t=Ge(e);throw new Error(`Introspection result missing directive args: ${t}.`)}if(null==e.locations){const t=Ge(e);throw new Error(`Introspection result missing directive locations: ${t}.`)}return new GraphQLDirective({name:e.name,description:e.description,isRepeatable:e.isRepeatable,locations:e.locations.slice(),args:y(e.args)})})):[];return new GraphQLSchema({description:r.description,query:o,mutation:s,subscription:a,types:[...i.values()],directives:c,assumeValid:n?.assumeValid});function u(e){if(e.kind===Jn.LIST){const t=e.ofType;if(null==t)throw new Error("Decorated type deeper than introspection query.");return new GraphQLList(u(t))}if(e.kind===Jn.NON_NULL){const t=e.ofType;if(null==t)throw new Error("Decorated type deeper than introspection query.");const n=u(t);return new GraphQLNonNull(function(e){if(!jt(e))throw new Error(`Expected ${Ge(e)} to be a GraphQL nullable type.`);return e}(n))}return l(e)}function l(e){const t=e.name;if(!t)throw new Error(`Unknown type reference: ${Ge(e)}.`);const n=i.get(t);if(null==n)throw new Error(`Invalid or incomplete schema, unknown type: ${t}. Ensure that a full introspection query is used in order to build a client schema.`);return n}function p(e){return function(e){if(!wt(e))throw new Error(`Expected ${Ge(e)} to be a GraphQL Object type.`);return e}(l(e))}function d(e){return function(e){if(!Ot(e))throw new Error(`Expected ${Ge(e)} to be a GraphQL Interface type.`);return e}(l(e))}function f(e){switch(e.kind){case Jn.SCALAR:return new GraphQLScalarType({name:(r=e).name,description:r.description,specifiedByURL:r.specifiedByURL});case Jn.OBJECT:return new GraphQLObjectType({name:(n=e).name,description:n.description,interfaces:()=>h(n),fields:()=>m(n)});case Jn.INTERFACE:return new GraphQLInterfaceType({name:(t=e).name,description:t.description,interfaces:()=>h(t),fields:()=>m(t)});case Jn.UNION:return function(e){if(null==e.possibleTypes){const t=Ge(e);throw new Error(`Introspection result missing possibleTypes: ${t}.`)}return new GraphQLUnionType({name:e.name,description:e.description,types:()=>e.possibleTypes.map(p)})}(e);case Jn.ENUM:return function(e){if(null==e.enumValues){const t=Ge(e);throw new Error(`Introspection result missing enumValues: ${t}.`)}return new GraphQLEnumType({name:e.name,description:e.description,values:Xe(e.enumValues,(e=>e.name),(e=>({description:e.description,deprecationReason:e.deprecationReason})))})}(e);case Jn.INPUT_OBJECT:return function(e){if(null==e.inputFields){const t=Ge(e);throw new Error(`Introspection result missing inputFields: ${t}.`)}return new GraphQLInputObjectType({name:e.name,description:e.description,fields:()=>y(e.inputFields),isOneOf:e.isOneOf})}(e)}var t,n,r;throw new Error(`Invalid or incomplete introspection result. Ensure that a full introspection query is used in order to build a client schema: ${Ge(e)}.`)}function h(e){if(null===e.interfaces&&e.kind===Jn.INTERFACE)return[];if(null==e.interfaces){const t=Ge(e);throw new Error(`Introspection result missing interfaces: ${t}.`)}return e.interfaces.map(d)}function m(e){if(null==e.fields)throw new Error(`Introspection result missing fields: ${Ge(e)}.`);return Xe(e.fields,(e=>e.name),v)}function v(e){const t=u(e.type);if(!Ft(t)){const e=Ge(t);throw new Error(`Introspection must provide output type for fields, but received: ${e}.`)}if(null==e.args){const t=Ge(e);throw new Error(`Introspection result missing field args: ${t}.`)}return{description:e.description,deprecationReason:e.deprecationReason,type:t,args:y(e.args)}}function y(e){return Xe(e,(e=>e.name),g)}function g(e){const t=u(e.type);if(!$t(t)){const e=Ge(t);throw new Error(`Introspection must provide input type for arguments, but received: ${e}.`)}return{description:e.description,type:t,default:null!=e.defaultValue?{literal:Ve(e.defaultValue)}:void 0,deprecationReason:e.deprecationReason}}}const yi={SCHEMA:"SCHEMA",SCALAR:"SCALAR",OBJECT:"OBJECT",FIELD:"FIELD",ARGUMENT:"ARGUMENT",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",ENUM_VALUE:"ENUM_VALUE",INPUT_OBJECT:"INPUT_OBJECT",INPUT_FIELD:"INPUT_FIELD",DIRECTIVE:"DIRECTIVE"};function gi(e,t){const r=t({getNamedType:u,setNamedType:function(e){i.set(e.name,e)},getNamedTypes:function(){return Array.from(i.values())}}),i=new Map;for(const t of e.types){const e=t.name,n=l(t);n&&i.set(e,n)}const o=[];for(const t of e.directives){if(Fn(t)){o.push(t);continue}const e=m(t.toConfig());e&&o.push(new GraphQLDirective(e))}const s={...e,query:e.query&&u(e.query.name),mutation:e.mutation&&u(e.mutation.name),subscription:e.subscription&&u(e.subscription.name),types:Array.from(i.values()),directives:o},a=r[yi.SCHEMA];return null==a?s:a(s);function c(e){return Dt(e)?new GraphQLList(c(e.ofType)):xt(e)?new GraphQLNonNull(c(e.ofType)):u(e.name)}function u(e){const t=Ti.get(e)??i.get(e);return void 0!==t||n(0,`Unknown type: "${e}".`),t}function l(e){return Wn(e)||Nn(e)?e:Lt(e)?function(e){let t=e.toConfig();const n=r[yi.SCALAR];return t=null==n?t:n(t),new GraphQLScalarType(t)}(e):wt(e)?function(e){const t=e.toConfig();let n={...t,interfaces:()=>t.interfaces.map((e=>u(e.name))),fields:()=>p(t.fields,e.name)};const i=r[yi.OBJECT];return n=null==i?n:i(n),new GraphQLObjectType(n)}(e):Ot(e)?function(e){const t=e.toConfig();let n={...t,interfaces:()=>t.interfaces.map((e=>u(e.name))),fields:()=>p(t.fields,e.name)};const i=r[yi.INTERFACE];return n=null==i?n:i(n),new GraphQLInterfaceType(n)}(e):kt(e)?function(e){const t=e.toConfig();let n={...t,types:()=>t.types.map((e=>u(e.name)))};const i=r[yi.UNION];return n=null==i?n:i(n),new GraphQLUnionType(n)}(e):_t(e)?function(e){const t=e.toConfig();let n={...t,values:()=>{const n=Object.create(null);for(const[r,i]of Object.entries(t.values)){const t=f(i,r,e.name);n[r]=t}return n}};const i=r[yi.ENUM];return n=null==i?n:i(n),new GraphQLEnumType(n)}(e):At(e)?function(e){const t=e.toConfig();let n={...t,fields:()=>{const n=Object.create(null);for(const[r,i]of Object.entries(t.fields)){const t=h(i,r,e.name);n[r]=t}return n}};const i=r[yi.INPUT_OBJECT];return n=null==i?n:i(n),new GraphQLInputObjectType(n)}(e):void n(0,"Unexpected type: "+Ge(e))}function p(e,t){const n=Object.create(null);for(const[i,o]of Object.entries(e)){let e={...o,type:c(o.type),args:d(o.args,t,i)};const s=r[yi.FIELD];s&&(e=s(e,t)),n[i]=e}return n}function d(e,t,n){const i=Object.create(null);for(const[o,s]of Object.entries(e)){let e={...s,type:c(s.type)};const a=r[yi.ARGUMENT];a&&(e=a(e,t,n)),i[o]=e}return i}function f(e,t,n){const i={...e},o=r[yi.ENUM_VALUE];return null==o?i:o(i,t,n)}function h(e,t,n){const i={...e,type:c(e.type)},o=r[yi.INPUT_FIELD];return null==o?i:o(i,t,n)}function m(e){const t={...e,args:d(e.args,e.name,void 0)},n=r[yi.DIRECTIVE];return null==n?t:n(t)}}const Ti=new Map([...bn,...Hn].map((e=>[e.name,e])));function Ei(e,t,r){const i=[],o=new AccumulatorMap,s=new AccumulatorMap,a=new AccumulatorMap,c=new AccumulatorMap,u=new AccumulatorMap,l=new AccumulatorMap,p=[];let d;const f=[];let h=!1;for(const e of t.definitions){switch(e.kind){case V:d=e;break;case W:f.push(e);break;case H:p.push(e);break;case M:case U:case J:case q:case K:case Y:i.push(e);break;case X:o.add(e.name.value,e);break;case Z:s.add(e.name.value,e);break;case ee:a.add(e.name.value,e);break;case te:c.add(e.name.value,e);break;case ne:u.add(e.name.value,e);break;case re:l.add(e.name.value,e);break;default:continue}h=!0}return h?gi(e,(e=>{const{getNamedType:t,setNamedType:h,getNamedTypes:m}=e;return{[yi.SCHEMA]:e=>{for(const e of i){const t=bi.get(e.name.value)??I(e);h(t)}const n={query:e.query&&t(e.query.name),mutation:e.mutation&&t(e.mutation.name),subscription:e.subscription&&t(e.subscription.name),...d&&v([d]),...v(f)};return{description:d?.description?.value??e.description,...n,types:m(),directives:[...e.directives,...p.map(T)],extensions:e.extensions,astNode:d??e.astNode,extensionASTNodes:e.extensionASTNodes.concat(f),assumeValid:r?.assumeValid??!1}},[yi.INPUT_OBJECT]:e=>{const t=l.get(e.name)??[];return{...e,fields:()=>({...e.fields(),...N(t)}),extensionASTNodes:e.extensionASTNodes.concat(t)}},[yi.ENUM]:e=>{const t=u.get(e.name)??[];return{...e,values:()=>({...e.values(),...S(t)}),extensionASTNodes:e.extensionASTNodes.concat(t)}},[yi.SCALAR]:e=>{const t=o.get(e.name)??[];let n=e.specifiedByURL;for(const e of t)n=Si(e)??n;return{...e,specifiedByURL:n,extensionASTNodes:e.extensionASTNodes.concat(t)}},[yi.OBJECT]:e=>{const t=s.get(e.name)??[];return{...e,interfaces:()=>[...e.interfaces(),...L(t)],fields:()=>({...e.fields(),...E(t)}),extensionASTNodes:e.extensionASTNodes.concat(t)}},[yi.INTERFACE]:e=>{const t=a.get(e.name)??[];return{...e,interfaces:()=>[...e.interfaces(),...L(t)],fields:()=>({...e.fields(),...E(t)}),extensionASTNodes:e.extensionASTNodes.concat(t)}},[yi.UNION]:e=>{const t=c.get(e.name)??[];return{...e,types:()=>[...e.types(),...w(t)],extensionASTNodes:e.extensionASTNodes.concat(t)}}};function v(e){const t={};for(const n of e){const e=n.operationTypes??[];for(const n of e)t[n.operation]=y(n.type)}return t}function y(e){const r=e.name.value,i=t(r);return void 0!==i||n(0,`Unknown type: "${r}".`),i}function g(e){return e.kind===C?new GraphQLList(g(e.type)):e.kind===R?new GraphQLNonNull(g(e.type)):y(e)}function T(e){return new GraphQLDirective({name:e.name.value,description:e.description?.value,locations:e.locations.map((({value:e})=>e)),isRepeatable:e.repeatable,args:b(e.arguments),astNode:e})}function E(e){const t=Object.create(null);for(const n of e){const e=n.fields??[];for(const n of e)t[n.name.value]={type:g(n.type),description:n.description?.value,args:b(n.arguments),deprecationReason:Ni(n),astNode:n}}return t}function b(e){const t=e??[],n=Object.create(null);for(const e of t){const t=g(e.type);n[e.name.value]={type:t,description:e.description?.value,default:e.defaultValue&&{literal:e.defaultValue},deprecationReason:Ni(e),astNode:e}}return n}function N(e){const t=Object.create(null);for(const n of e){const e=n.fields??[];for(const n of e){const e=g(n.type);t[n.name.value]={type:e,description:n.description?.value,default:n.defaultValue&&{literal:n.defaultValue},deprecationReason:Ni(n),astNode:n}}}return t}function S(e){const t=Object.create(null);for(const n of e){const e=n.values??[];for(const n of e)t[n.name.value]={description:n.description?.value,deprecationReason:Ni(n),astNode:n}}return t}function L(e){return e.flatMap((e=>e.interfaces?.map(y)??[]))}function w(e){return e.flatMap((e=>e.types?.map(y)??[]))}function I(e){const t=e.name.value;switch(e.kind){case U:{const n=s.get(t)??[],r=[e,...n];return new GraphQLObjectType({name:t,description:e.description?.value,interfaces:()=>L(r),fields:()=>E(r),astNode:e,extensionASTNodes:n})}case J:{const n=a.get(t)??[],r=[e,...n];return new GraphQLInterfaceType({name:t,description:e.description?.value,interfaces:()=>L(r),fields:()=>E(r),astNode:e,extensionASTNodes:n})}case K:{const n=u.get(t)??[],r=[e,...n];return new GraphQLEnumType({name:t,description:e.description?.value,values:()=>S(r),astNode:e,extensionASTNodes:n})}case q:{const n=c.get(t)??[],r=[e,...n];return new GraphQLUnionType({name:t,description:e.description?.value,types:()=>w(r),astNode:e,extensionASTNodes:n})}case M:{const n=o.get(t)??[];return new GraphQLScalarType({name:t,description:e.description?.value,specifiedByURL:Si(e),astNode:e,extensionASTNodes:n})}case Y:{const r=l.get(t)??[],i=[e,...r];return new GraphQLInputObjectType({name:t,description:e.description?.value,fields:()=>N(i),astNode:e,extensionASTNodes:r,isOneOf:(n=e,Boolean(Xr(xn,n)))})}}var n}})):e}const bi=new Map([...bn,...Hn].map((e=>[e.name,e])));function Ni(e){const t=Xr(An,e);return t?.reason}function Si(e){const t=Xr(Dn,e);return t?.url}function Li(e){return function(e,t,r){const i=e.getDirectives().filter(t),o=Object.values(e.getTypeMap()).filter(r);return[Ii(e),...i.map((e=>function(e){return $i(e)+`directive ${e}`+Ai(e.args)+(e.isRepeatable?" repeatable":"")+" on "+e.locations.join(" | ")}(e))),...o.map((e=>function(e){if(Lt(e))return function(e){return $i(e)+`scalar ${e}`+function(e){if(null==e.specifiedByURL)return"";return` @specifiedBy(url: ${ft({kind:k,value:e.specifiedByURL})})`}(e)}(e);if(wt(e))return function(e){return $i(e)+`type ${e}`+Oi(e)+ki(e)}(e);if(Ot(e))return function(e){return $i(e)+`interface ${e}`+Oi(e)+ki(e)}(e);if(kt(e))return function(e){const t=e.getTypes(),n=t.length?" = "+t.join(" | "):"";return $i(e)+`union ${e.name}`+n}(e);if(_t(e))return function(e){const t=e.getValues().map(((e,t)=>$i(e," ",!t)+" "+e.name+xi(e.deprecationReason)));return $i(e)+`enum ${e}`+_i(t)}(e);if(At(e))return function(e){const t=Object.values(e.getFields()).map(((e,t)=>$i(e," ",!t)+" "+Di(e)));return $i(e)+`input ${e}`+(e.isOneOf?" @oneOf":"")+_i(t)}(e);n(0,"Unexpected type: "+Ge(e))}(e)))].filter(Boolean).join("\n\n")}(e,(e=>!Fn(e)),wi)}function wi(e){return!Nn(e)&&!Wn(e)}function Ii(e){const t=e.getQueryType(),n=e.getMutationType(),r=e.getSubscriptionType();if(t||n||r)return null==e.description&&function(e){return e.getQueryType()==e.getType("Query")&&e.getMutationType()==e.getType("Mutation")&&e.getSubscriptionType()==e.getType("Subscription")}(e)?void 0:$i(e)+"schema {\n"+(t?` query: ${t}\n`:"")+(n?` mutation: ${n}\n`:"")+(r?` subscription: ${r}\n`:"")+"}"}function Oi(e){const t=e.getInterfaces();return t.length?" implements "+t.map((e=>e.name)).join(" & "):""}function ki(e){return _i(Object.values(e.getFields()).map(((e,t)=>$i(e," ",!t)+" "+e.name+Ai(e.args," ")+": "+String(e.type)+xi(e.deprecationReason))))}function _i(e){return 0!==e.length?" {\n"+e.join("\n")+"\n}":""}function Ai(e,t=""){return 0===e.length?"":e.every((e=>null==e.description))?"("+e.map(Di).join(", ")+")":"(\n"+e.map(((e,n)=>$i(e," "+t,!n)+" "+t+Di(e))).join("\n")+"\n"+t+")"}function Di(e){let t=e.name+": "+String(e.type);const n=Cn(e);return n&&(t+=` = ${ft(n)}`),t+xi(e.deprecationReason)}function xi(e){if(null==e)return"";if(e!==_n){return` @deprecated(reason: ${ft({kind:k,value:e})})`}return" @deprecated"}function $i(e,t="",n=!0){const{description:r}=e;if(null==r)return"";return(t&&!n?"\n"+t:t)+ft({kind:k,value:r,block:de(r)}).replaceAll("\n","\n"+t)+"\n"}function Fi(e){const t=[];for(const n of e)t.push(...n.definitions);return{kind:m,definitions:t}}const Gi=[Ir];function Qi(e){var t;const n=function(e){if(e)return function(t){const n=e;return{Field(e){var r;const i=(null!==(r=e.alias)&&void 0!==r?r:e.name).value,o=i.charAt(0).toLowerCase()+i.slice(1);n.includes(o)&&t.reportError(new GraphQLError(`Field name "${i}" is not allowed because it conflicts with generated object APIs. Please use an alias to change the field name.`,{nodes:e}))}}};return}(null===(t=e.disallowedFieldNames)||void 0===t?void 0:t.allFields),r=function(e){if(e)return function(t){const n=e;return{VariableDefinition(e){const r=e.variable.name.value,i=r.charAt(0).toLowerCase()+r.slice(1);n.includes(i)&&t.reportError(new GraphQLError(`Input Parameter name "${r}" is not allowed because it conflicts with generated object APIs.`,{nodes:e}))}}};return}(e.disallowedInputParameterNames);return[Ci,Ri,Vi,ji,...n?[n]:[],...r?[r]:[],...fi.filter((e=>!Gi.includes(e)))]}function Ci(e){return{OperationDefinition:t=>(t.name||e.reportError(new GraphQLError("Apollo does not support anonymous operations because operation names are used during code generation. Please give this operation a name.",{nodes:t})),!1)}}function Ri(e){return{Field(t){"__typename"==(t.alias&&t.alias.value)&&e.reportError(new GraphQLError("Apollo needs to be able to insert __typename when needed, so using it as an alias is not supported.",{nodes:t}))}}}function Vi(e){return{InlineFragment(t){if(t.directives)for(const n of t.directives)n.name.value==On.name&&null==t.typeCondition&&e.reportError(new GraphQLError("Apollo does not support deferred inline fragments without a type condition. Please add a type condition to this inline fragment.",{nodes:t}))}}}function ji(e){return{InlineFragment(t){var n;if(t.directives)for(const r of t.directives)r.name.value!=On.name||(null===(n=r.arguments)||void 0===n?void 0:n.find((e=>"label"==e.name.value)))||e.reportError(new GraphQLError("Apollo does not support deferred inline fragments without a 'label' argument. Please add a 'label' argument to the @defer directive on this inline fragment.",{nodes:t}))}}}function Mi(e){return{kind:h,value:e}}function Ui(e){return{kind:k,value:e}}function Pi(e){return{kind:H,description:e.description?Ui(e.description):void 0,name:Mi(e.name),repeatable:!1,locations:e.locations.map((e=>Mi(e))),arguments:e.args.map((e=>function(e){return{kind:B,description:Ui(e.description),name:Mi(e.name),type:Bi(Ut(e.type))}}(e)))}}function Bi(e){return{kind:Q,name:Mi(e.name)}}function Ji(e){return{kind:R,type:e}}const qi={kind:H,description:Ui("A directive used by the Apollo iOS client to annotate operations or fragments that should be used exclusively for generating local cache mutations instead of as standard operations."),name:Mi("apollo_client_ios_localCacheMutation"),repeatable:!1,locations:[Mi("QUERY"),Mi("MUTATION"),Mi("SUBSCRIPTION"),Mi("FRAGMENT_DEFINITION")]},Ki={kind:H,description:Ui("Attach extra information to a given type."),name:Mi("typePolicy"),arguments:[{kind:B,description:Ui("A selection set containing fields used to compute the cache key of an object. Referenced fields must have non-nullable scalar types. Order is important."),name:Mi("keyFields"),type:Ji(Bi(gn))}],repeatable:!1,locations:[Mi("OBJECT"),Mi("INTERFACE")]},zi={kind:H,description:Ui("A directive used by the Apollo iOS code generation engine to generate custom import statements in operation or fragment definition files. An import statement to import a module with the name provided in the `module` argument will be added to the generated definition file."),name:Mi("import"),arguments:[{kind:B,description:Ui("The name of the module to import."),name:Mi("module"),type:Ji(Bi(gn))}],repeatable:!0,locations:[Mi("QUERY"),Mi("MUTATION"),Mi("SUBSCRIPTION"),Mi("FRAGMENT_DEFINITION")]},Yi=[qi,zi,Ki];const Hi={kind:T,name:{kind:h,value:"__typename"}};class GraphQLSchemaValidationError extends Error{constructor(e){super(e.map((e=>e.message)).join("\n\n")),this.validationErrors=e,this.name="GraphQLSchemaValidationError"}}function Wi(e){const t=function(e,t,n=hi){const r=[],i=new SDLValidationContext(e,t,(e=>{r.push(e)}));return lt(e,pt(n.map((e=>e(i))))),r}(e);if(0!==t.length)throw new GraphQLSchemaValidationError(t)}function Xi(e){const t=er(e);if(0!==t.length)throw new GraphQLSchemaValidationError(t)}function Zi(e){return e.startsWith("__")}function eo(e){if(!e)return!1;for(const t of e)if(t.name.value==qi.name.value)return!0;return!1}const to={kind:T,name:{kind:h,value:"__typename"}};function no(e,t){return t&&(e=function(e){return lt(e,{enter:e=>e.kind!==g?void 0:{...e,selections:e.selections.filter((e=>!("Field"===e.kind&&"__typename"===e.name.value)))},leave(e){if((e.kind===T||e.kind===L||e.kind===S)&&e.selectionSet)return{...e,selectionSet:{...e.selectionSet,selections:[Hi,...e.selectionSet.selections]}}}})}(e)),lt(e,{SelectionSet:{leave:(e,t,n)=>p(n)&&![T,L].includes(n.kind)?e:function(e){const t=e.selections.find((e=>e.kind==to.kind&&e.name.value==to.name.value));return t?e:{...e,selections:[to,...e.selections]}}(e)},Field:{enter:e=>function(e){return e.name.value==to.name.value?{...e,alias:void 0,directives:void 0}:e}(e)},Directive:{enter:e=>function(e){const t=[qi,zi];for(const n of t)if(e.name.value==n.name.value)return null;return e}(e)}})}function ro(e){return null!=e}function io(e){switch(e.kind){case w:return{kind:e.kind,value:e.name.value};case x:return{kind:e.kind,value:e.values.map(io)};case $:return{kind:e.kind,value:e.fields.reduce(((e,t)=>(e[t.name.value]=io(t.value),e)),{})};default:return e}}function oo(e){var t,n;return null===(n=null===(t=e.loc)||void 0===t?void 0:t.source)||void 0===n?void 0:n.name}function so(e,t,n,r,i){var o,s,a;const c=new Map;for(const e of t.definitions)e.kind===L&&c.set(e.name.value,e);const u=[],l=new Map,p=new Set,d=r,f=e.getQueryType();if(void 0===f)throw new GraphQLError("GraphQL Schema must contain a 'query' root type definition.",{});const h={queryType:f,mutationType:null!==(o=e.getMutationType())&&void 0!==o?o:void 0,subscriptionType:null!==(s=e.getSubscriptionType())&&void 0!==s?s:void 0};for(const e of t.definitions)e.kind===v&&u.push(g(e));for(const[e,t]of c.entries())l.set(e,E(t));return{rootTypes:h,operations:u,fragments:Array.from(l.values()),referencedTypes:Array.from(p.values()),schemaDocumentation:null!==(a=e.description)&&void 0!==a?a:void 0};function m(t){if(!p.has(t)){if(p.add(t),Ot(t)){const n=e.getPossibleTypes(t);t._implementingObjects=n;for(const e of n)d&&!y(e)||m(Ut(e))}if(kt(t)){const e=t.getTypes();for(t of e)m(Ut(t))}if(At(t)&&function(e){const t=e.getFields();for(const e in t){m(Ut(t[e].type))}}(t),wt(t))for(const e of t.getInterfaces())m(Ut(e))}}function y(e){var t,n;const r=Ki.name.value;for(const i of null!==(n=null===(t=e.astNode)||void 0===t?void 0:t.directives)&&void 0!==n?n:[])if(i.name.value===r)return!0;return!1}function g(t){var r;if(!t.name)throw new GraphQLError("Operations should be named",{nodes:t});const i=oo(t),o=t.name.value,s=t.operation,a=new Set,c=(t.variableDefinitions||[]).map((t=>{const n=t.variable.name.value,r=t.defaultValue?io(t.defaultValue):void 0,i=vr(e,t.type);if(!i)throw new GraphQLError(`Couldn't get type from type node "${t.type}"`,{nodes:t});return m(Ut(i)),{name:n,type:i,defaultValue:r}})),u=ft(no(t,n)),l=e.getRootType(s),[p]=null!==(r=k(t.directives))&&void 0!==r?r:[void 0,void 0];m(l);const d=I(t.selectionSet,l,a),f=Array.from(a.values());return eo(t.directives)&&b(f),{name:o,operationType:s,variables:c,rootType:l,selectionSet:d,directives:p,referencedFragments:f,source:u,filePath:i}}function E(t){var r;const i=t.name.value,o=oo(t),s=ft(no(t,n)),a=new Set,c=vr(e,t.typeCondition),[u]=null!==(r=k(t.directives))&&void 0!==r?r:[void 0,void 0];m(Ut(c));const l=I(t.selectionSet,c,a),p=Array.from(a.values());return eo(t.directives)&&b(p),{name:i,filePath:o,source:s,typeCondition:c,selectionSet:l,directives:u,referencedFragments:p,overrideAsLocalCacheMutation:!1}}function b(e){e.forEach((e=>{e.overrideAsLocalCacheMutation=!0,b(e.referencedFragments)}))}function I(t,n,r){return{parentType:n,selections:t.selections.map((t=>function(t,n,r){var o,s,a,u;const[p,d]=null!==(o=k(t.directives))&&void 0!==o?o:[void 0,void 0];switch(t.kind){case T:{const f=t.name.value;if("__typename"==f)return;const h=null===(s=t.alias)||void 0===s?void 0:s.value,v=function(e,t,n){return n===Kn.name&&e.getQueryType()===t?Kn:n===zn.name&&e.getQueryType()===t?zn:n===Yn.name&&(wt(t)||Ot(t)||kt(t))?Yn:wt(t)||Ot(t)?t.getFields()[n]:void 0}(e,n,f);if(!v)throw new GraphQLError(`Cannot query field "${f}" on type "${String(n)}"`,{nodes:t});const y=v.type,g=Ut(v.type);m(Ut(g));const{description:b,deprecationReason:L}=v;let w={kind:"Field",name:f,alias:h,type:y,arguments:O(v,t.arguments),inclusionConditions:d,description:!Zi(f)&&b?b:void 0,deprecationReason:L||void 0,directives:p};function _(e,t,n){var r;if(t&&n){const i=(null!==(r=e.alias)&&void 0!==r?r:e.name).value,o=i.charAt(0).toLowerCase()+i.slice(1);if(null==t?void 0:t.includes(o))throw new GraphQLError(`Schema name "${n}" conflicts with name of a generated object API. Please choose a different schema name. Suggestions: "${n}Schema", "${n}GraphQL", "${n}API"`,{nodes:e})}}if(Dt(y)||xt(y)&&Dt(y.ofType)?_(t,null===(a=i.disallowedFieldNames)||void 0===a?void 0:a.entityList,i.schemaNamespace):Ct(g)&&_(t,null===(u=i.disallowedFieldNames)||void 0===u?void 0:u.entity,i.schemaNamespace),Ct(g)){const A=t.selectionSet;if(!A)throw new GraphQLError(`Composite field "${f}" on type "${String(n)}" requires selection set`,{nodes:t});w.selectionSet=I(A,g,r)}return w}case S:{const D=t.typeCondition,x=D?vr(e,D):n;return m(x),{kind:"InlineFragment",selectionSet:I(t.selectionSet,x,r),inclusionConditions:d,directives:p}}case N:{const $=t.name.value,F=function(e){let t=l.get(e);if(t)return t;const n=c.get(e);return n?(c.delete(e),t=E(n),l.set(e,t),t):void 0}($);if(!F)throw new GraphQLError(`Unknown fragment "${$}".`,{nodes:t.name});r.add(F);return{kind:"FragmentSpread",fragment:F,inclusionConditions:d,directives:p}}}}(t,n,r))).filter(ro)}}function O(...e){const t=e[0].args;return e[1]&&e[1].length>0?e[1].map((e=>{var n;const r=e.name.value,i=t.find((t=>t.name===e.name.value)),o=null==i?void 0:i.type;if(!o)throw new GraphQLError(`Cannot find directive argument type for argument "${r}".`,{nodes:[e]});return{name:r,value:io(e.value),type:o,deprecationReason:null!==(n=i.deprecationReason)&&void 0!==n?n:void 0}})):void 0}function k(t){if(t&&t.length>0){const n=[],r=[];for(const i of t){const t=i.name.value,o=e.getDirective(t);if(!o)throw new GraphQLError(`Cannot find directive "${t}".`,{nodes:i});n.push({name:t,arguments:O(o,i.arguments)});const s=A(i,o);s&&r.push(s)}return[n,r.length>0?r:void 0]}}function A(e,t){var n;if("include"==t.name||"skip"==t.name){const r=null===(n=e.arguments)||void 0===n?void 0:n[0].value,i="skip"==t.name;switch(null==r?void 0:r.kind){case _:return i?r.value?"SKIPPED":"INCLUDED":r.value?"INCLUDED":"SKIPPED";case w:return{variable:r.name.value,isInverted:i};default:throw new GraphQLError('Conditional inclusion directive has invalid "if" argument.',{nodes:e})}}}}function ao(e){return e.kind===H&&e.name.value===On.name}function co(){return{kind:m,definitions:[Pi(On)]}}const uo=Ki.name.value;function lo(e,t){var n,r;return(null!==(n=e.arguments)&&void 0!==n?n:[]).map((e=>JSON.stringify([e.name.value,bt(e.value)]))).sort().toString()===(null!==(r=t.arguments)&&void 0!==r?r:[]).map((e=>JSON.stringify([e.name.value,bt(e.value)]))).sort().toString()}function po(e){var t,n,r,i;if(kt(e))return;for(const r of null!==(t=e.extensionASTNodes)&&void 0!==t?t:[]){const t=null===(n=r.directives)||void 0===n?void 0:n.find((e=>e.name.value===uo));if(t)return{directive:t,source:e}}let o;for(const t of null!==(i=null===(r=e.astNode)||void 0===r?void 0:r.directives)&&void 0!==i?i:[])if(t.name.value===uo){o={directive:t,source:e};break}if("getInterfaces"in e)for(const t of e.getInterfaces()){const n=po(t);if(n)if(o){if(!lo(o.directive,n.directive))throw o.source===e?new GraphQLError(`Type "${e.name}" has a @typePolicy directive which conflicts with the @typePolicy directive on interface "${n.source.name}".`,{nodes:e.astNode}):new GraphQLError(`Type "${e.name}" inherits conflicting @typePolicy directives from interfaces "${o.source.name}" and "${n.source.name}".`,{nodes:e.astNode})}else o=n}return o}function fo(e){var t,n,r;const i=po(e);if(!i)return[];const o=null===(r=null===(n=null===(t=i.directive)||void 0===t?void 0:t.arguments)||void 0===n?void 0:n.find((e=>"keyFields"===e.name.value)))||void 0===r?void 0:r.value;if(!o||o.kind!==k)return[];const s=o.value.split(" ");return function(e,t){const{directive:n,source:r}=e;if(kt(r))return;const i=Ot(r)?"interface":"object";var o=r.getFields();for(const e of t){if(!e)throw new GraphQLError("Key fields must be a space-separated list of identifiers.",{nodes:n});const t=o[e];if(!t)throw new GraphQLError(`Key field "${e}" does not exist on ${i} "${r.name}".`,{nodes:r.astNode?[r.astNode,n]:n});if(!xt(t.type))throw new GraphQLError(`Key field "${e}" on ${i} "${r.name}" must be non-nullable.`,{nodes:t.astNode?[t.astNode,n]:n});if(!Lt(t.type.ofType))throw new GraphQLError(`Key field "${e}" on ${i} "${r.name}" must be a scalar type, got ${t.type}.`,{nodes:t.astNode?[t.astNode,n]:n})}}(i,s),s}function ho(e){const t=e.getTypeMap();for(const e in t){const n=t[e];(n instanceof GraphQLObjectType||n instanceof GraphQLInterfaceType)&&(n._apolloKeyFields=fo(n))}}return e.GraphQLEnumType=GraphQLEnumType,e.GraphQLError=GraphQLError,e.GraphQLInputObjectType=GraphQLInputObjectType,e.GraphQLInterfaceType=GraphQLInterfaceType,e.GraphQLObjectType=GraphQLObjectType,e.GraphQLScalarType=GraphQLScalarType,e.GraphQLSchema=GraphQLSchema,e.GraphQLSchemaValidationError=GraphQLSchemaValidationError,e.GraphQLUnionType=GraphQLUnionType,e.Source=Source,e.compileDocument=function(e,t,n,r,i){return so(e,t,n,r,i)},e.loadSchemaFromSources=function(e){var t,n=new Array;for(const r of e)if(r.name.endsWith(".json")){if(t)throw new Error(`Schema search paths can only include one JSON schema definition.\n Found "${t.name} & "${r.name}".`);t=r}else n.push(Re(r));var r=function(e){const t=Yi.filter((t=>!e.definitions.some((e=>e.kind==H&&e.name.value==t.name.value))));return Fi([e,{kind:m,definitions:t}])}(Fi(n));if(t){var i=function(e){let t=JSON.parse(e);t.data&&(t=t.data);const n=vi(t);return n}(t.body);return r=function(e,t){const n=e.getDirective(On.name);return n?function(e,t){return e.isRepeatable===t.isRepeatable&&e.locations.slice(0).sort().toString()===t.locations.slice(0).sort().toString()&&e.args.map((e=>e.name)).sort().toString()===t.args.map((e=>e.name)).sort().toString()}(n,On)?t:(console.warn(`Unsupported ${n.name} directive found. It will be replaced with a supported definition instead.`),Fi([t,co()])):Fi([t,co()])}(i,r),ho(i=function(e,t,n){Xn(e);const r=e.toConfig(),i=Ei(r,t,n);return r===i?e:new GraphQLSchema(i)}(i,r,{assumeValid:!0})),Xi(i),i}{Wi(r=function(e){const t=e.definitions.find(ao);if(!t)return Fi([e,co()]);const n=t;if(!function(e,t){var n;return e.repeatable===t.isRepeatable&&e.locations.map((e=>e.value)).sort().toString()===t.locations.slice(0).sort().toString()&&(null===(n=e.arguments)||void 0===n?void 0:n.map((e=>e.name.value)).sort().toString())===t.args.map((e=>e.name)).sort().toString()}(n,On))return console.warn(`Unsupported ${n.name.value} directive found. It will be replaced with a supported definition instead.`),{kind:m,definitions:e.definitions.filter((e=>ao(e)?void 0:e)).concat(Pi(On))};return e}(r));const e=function(e,t){const n=Ei({description:void 0,types:[],directives:[],extensions:Object.create(null),extensionASTNodes:[],assumeValid:!1},e,t);if(null==n.astNode)for(const e of n.types)switch(e.name){case"Query":n.query=e;break;case"Mutation":n.mutation=e;break;case"Subscription":n.subscription=e}const r=[...n.directives,...$n.filter((e=>n.directives.every((t=>t.name!==e.name))))];return new GraphQLSchema({...n,directives:r})}(r,{assumeValid:!0});return ho(e),Xi(e),e}},e.mergeDocuments=function(e){return Fi(e)},e.parseOperationDocument=function(e){return Re(e)},e.printSchemaToSDL=function(e){return Li(e)},e.validateDocument=function(e,t,n){return mi(e,t,Qi(n))},e}({});"# \ No newline at end of file +let ApolloCodegenFrontendBundle: String = #"var ApolloCodegenFrontend=function(e){"use strict";function t(e){return"object"==typeof e&&null!==e}function n(e,t){throw new Error(t??"Unexpected invariant triggered.")}const r=/\r\n|[\n\r]/g;function i(e,t){let i=0,o=1;for(const s of e.body.matchAll(r)){if("number"==typeof s.index||n(),s.index>=t)break;i=s.index+s[0].length,o+=1}return{line:o,column:t+1-i}}function o(e){return s(e.source,i(e.source,e.start))}function s(e,t){const n=e.locationOffset.column-1,r="".padStart(n)+e.body,i=t.line-1,o=e.locationOffset.line-1,s=t.line+o,c=1===t.line?n:0,u=t.column+c,l=`${e.name}:${s}:${u}\n`,p=r.split(/\r\n|[\n\r]/g),d=p[i];if(d.length>120){const e=Math.floor(u/80),t=u%80,n=[];for(let e=0;e["|",e]),["|","^".padStart(t)],["|",n[e+1]]])}return l+a([[s-1+" |",p[i-1]],[`${s} |`,d],["|","^".padStart(u)],[`${s+1} |`,p[i+1]]])}function a(e){const t=e.filter(([e,t])=>void 0!==t),n=Math.max(...t.map(([e])=>e.length));return t.map(([e,t])=>e.padStart(n)+(t?" "+t:"")).join("\n")}class GraphQLError extends Error{constructor(e,n={}){const{nodes:r,source:o,positions:s,path:a,originalError:u,extensions:l}=n;super(e),this.name="GraphQLError",this.path=a??void 0,this.originalError=u??void 0,this.nodes=c(Array.isArray(r)?r:r?[r]:void 0);const p=c(this.nodes?.map(e=>e.loc).filter(e=>null!=e));this.source=o??p?.[0]?.source,this.positions=s??p?.map(e=>e.start),this.locations=s&&o?s.map(e=>i(o,e)):p?.map(e=>i(e.source,e.start));const d=t(u?.extensions)?u?.extensions:void 0;this.extensions=l??d??Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),null!=u?.stack?Object.defineProperty(this,"stack",{value:u.stack,writable:!0,configurable:!0}):null!=Error.captureStackTrace?Error.captureStackTrace(this,GraphQLError):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let e=this.message;if(this.nodes)for(const t of this.nodes)t.loc&&(e+="\n\n"+o(t.loc));else if(this.source&&this.locations)for(const t of this.locations)e+="\n\n"+s(this.source,t);return e}toJSON(){const e={message:this.message};return null!=this.locations&&(e.locations=this.locations),null!=this.path&&(e.path=this.path),null!=this.extensions&&Object.keys(this.extensions).length>0&&(e.extensions=this.extensions),e}}function c(e){return void 0===e||0===e.length?void 0:e}function u(e,t,n){return new GraphQLError(`Syntax Error: ${n}`,{source:e,positions:[t]})}class Location{constructor(e,t,n){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=n}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}}class Token{constructor(e,t,n,r,i,o){this.kind=e,this.start=t,this.end=n,this.line=r,this.column=i,this.value=o,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}}const l={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentArgument:["name","value"],FragmentSpread:["name","arguments","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},p=new Set(Object.keys(l));function d(e){const t=e?.kind;return"string"==typeof t&&p.has(t)}const f={QUERY:"query",MUTATION:"mutation",SUBSCRIPTION:"subscription"},h={QUERY:"QUERY",MUTATION:"MUTATION",SUBSCRIPTION:"SUBSCRIPTION",FIELD:"FIELD",FRAGMENT_DEFINITION:"FRAGMENT_DEFINITION",FRAGMENT_SPREAD:"FRAGMENT_SPREAD",INLINE_FRAGMENT:"INLINE_FRAGMENT",VARIABLE_DEFINITION:"VARIABLE_DEFINITION",SCHEMA:"SCHEMA",SCALAR:"SCALAR",OBJECT:"OBJECT",FIELD_DEFINITION:"FIELD_DEFINITION",ARGUMENT_DEFINITION:"ARGUMENT_DEFINITION",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",ENUM_VALUE:"ENUM_VALUE",INPUT_OBJECT:"INPUT_OBJECT",INPUT_FIELD_DEFINITION:"INPUT_FIELD_DEFINITION",FRAGMENT_VARIABLE_DEFINITION:"FRAGMENT_VARIABLE_DEFINITION"},m="Name",v="Document",y="OperationDefinition",g="VariableDefinition",T="SelectionSet",b="Field",E="Argument",N="FragmentArgument",w="FragmentSpread",S="InlineFragment",I="FragmentDefinition",L="Variable",k="IntValue",O="FloatValue",_="StringValue",x="BooleanValue",D="NullValue",$="EnumValue",A="ListValue",G="ObjectValue",F="ObjectField",Q="Directive",V="NamedType",C="ListType",j="NonNullType",R="SchemaDefinition",M="OperationTypeDefinition",U="ScalarTypeDefinition",P="ObjectTypeDefinition",B="FieldDefinition",q="InputValueDefinition",J="InterfaceTypeDefinition",K="UnionTypeDefinition",z="EnumTypeDefinition",Y="EnumValueDefinition",H="InputObjectTypeDefinition",W="DirectiveDefinition",X="SchemaExtension",Z="ScalarTypeExtension",ee="ObjectTypeExtension",te="InterfaceTypeExtension",ne="UnionTypeExtension",re="EnumTypeExtension",ie="InputObjectTypeExtension";var oe=Object.freeze({__proto__:null,ARGUMENT:E,BOOLEAN:x,DIRECTIVE:Q,DIRECTIVE_DEFINITION:W,DOCUMENT:v,ENUM:$,ENUM_TYPE_DEFINITION:z,ENUM_TYPE_EXTENSION:re,ENUM_VALUE_DEFINITION:Y,FIELD:b,FIELD_DEFINITION:B,FLOAT:O,FRAGMENT_ARGUMENT:N,FRAGMENT_DEFINITION:I,FRAGMENT_SPREAD:w,INLINE_FRAGMENT:S,INPUT_OBJECT_TYPE_DEFINITION:H,INPUT_OBJECT_TYPE_EXTENSION:ie,INPUT_VALUE_DEFINITION:q,INT:k,INTERFACE_TYPE_DEFINITION:J,INTERFACE_TYPE_EXTENSION:te,LIST:A,LIST_TYPE:C,NAME:m,NAMED_TYPE:V,NON_NULL_TYPE:j,NULL:D,OBJECT:G,OBJECT_FIELD:F,OBJECT_TYPE_DEFINITION:P,OBJECT_TYPE_EXTENSION:ee,OPERATION_DEFINITION:y,OPERATION_TYPE_DEFINITION:M,SCALAR_TYPE_DEFINITION:U,SCALAR_TYPE_EXTENSION:Z,SCHEMA_DEFINITION:R,SCHEMA_EXTENSION:X,SELECTION_SET:T,STRING:_,UNION_TYPE_DEFINITION:K,UNION_TYPE_EXTENSION:ne,VARIABLE:L,VARIABLE_DEFINITION:g});function se(e){return 9===e||32===e}function ae(e){return e>=48&&e<=57}function ce(e){return e>=97&&e<=122||e>=65&&e<=90}function ue(e){return ce(e)||95===e}function le(e){return ce(e)||ae(e)||95===e}function pe(e){let t=Number.MAX_SAFE_INTEGER,n=null,r=-1;for(let i=0;i0===n?e:e.slice(t)).slice(n??0,r+1)}function de(e){let t=0;for(;t=0&&e<=55295||e>=57344&&e<=1114111}function Ve(e,t){return Ce(e.charCodeAt(t))&&je(e.charCodeAt(t+1))}function Ce(e){return e>=55296&&e<=56319}function je(e){return e>=56320&&e<=57343}function Re(e,t){const n=e.source.body.codePointAt(t);if(void 0===n)return me;if(n>=32&&n<=126){const e=String.fromCodePoint(n);return'"'===e?"'\"'":`"${e}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function Me(e,t,n,r,i){const o=e.line,s=1+n-e.lineStart;return new Token(t,n,r,o,s,i)}function Ue(e,t){const n=e.source.body,r=n.length;let i=t;for(;i=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function We(e,t){const n=e.source.body;switch(n.charCodeAt(t+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:"\n",size:2};case 114:return{value:"\r",size:2};case 116:return{value:"\t",size:2}}throw u(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}function Xe(e,t){const n=e.source.body,r=n.length;let i=e.lineStart,o=t+3,s=o,a="";const c=[];for(;o2)return"[Array]";const n=Math.min(10,e.length),r=e.length-n,i=[];for(let r=0;r1&&i.push(`... ${r} more items`);return"["+i.join(", ")+"]"}(e,n);return function(e,t){const n=Object.entries(e);if(0===n.length)return"{}";if(t.length>2)return"["+function(e){const t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){const t=e.constructor.name;if("string"==typeof t&&""!==t)return t}return t}(e)+"]";const r=n.map(([e,n])=>e+": "+nt(n,t));return"{ "+r.join(", ")+" }"}(e,n)}(e,t);default:return String(e)}}const rt=null!=globalThis.process&&"production"===process.env.NODE_ENV?function(e,t){return e instanceof t}:function(e,t){if(e instanceof t)return!0;if("object"==typeof e&&null!==e){const n=t.prototype[Symbol.toStringTag];if(n===(Symbol.toStringTag in e?e[Symbol.toStringTag]:e.constructor?.name)){const t=tt(e);throw new Error(`Cannot use ${n} "${t}" from another module or realm.\n\nEnsure that there is only one instance of "graphql" in the node_modules\ndirectory. If different versions of "graphql" are the dependencies of other\nrelied on modules, use "resolutions" to ensure only one version is installed.\n\nhttps://yarnpkg.com/en/docs/selective-version-resolutions\n\nDuplicate "graphql" modules cannot be used at the same time since different\nversions may have different capabilities and behavior. The data from one\nversion used in the function from another could produce confusing and\nspurious results.`)}}return!1};class Source{constructor(e,t="GraphQL request",n={line:1,column:1}){this.body=e,this.name=t,this.locationOffset=n,this.locationOffset.line>0||et(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||et(0,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}function it(e,t){const n=new Parser(e,t),r=n.parseDocument();return Object.defineProperty(r,"tokenCount",{enumerable:!1,value:n.tokenCount}),r}function ot(e,t){const n=new Parser(e,t);n.expectToken(he);const r=n.parseConstValueLiteral();return n.expectToken(me),r}class Parser{constructor(e,t={}){const n=function(e){return rt(e,Source)}(e)?e:new Source(e);this._lexer=new Lexer(n),this._options=t,this._tokenCounter=0}get tokenCount(){return this._tokenCounter}parseName(){const e=this.expectToken(xe);return this.node(e,{kind:m,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:v,definitions:this.many(he,this.parseDefinition,me)})}parseDefinition(){if(this.peek(ke))return this.parseOperationDefinition();const e=this.peekDescription(),t=e?this._lexer.lookahead():this._lexer.token;if(t.kind===xe){switch(t.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}if(e)throw u(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(t.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(t)}parseOperationDefinition(){const e=this._lexer.token;if(this.peek(ke))return this.node(e,{kind:y,operation:f.QUERY,name:void 0,variableDefinitions:void 0,directives:void 0,selectionSet:this.parseSelectionSet()});const t=this.parseOperationType();let n;return this.peek(xe)&&(n=this.parseName()),this.node(e,{kind:y,operation:t,name:n,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const e=this.expectToken(xe);switch(e.value){case"query":return f.QUERY;case"mutation":return f.MUTATION;case"subscription":return f.SUBSCRIPTION}throw this.unexpected(e)}parseVariableDefinitions(){return this.optionalMany(Te,this.parseVariableDefinition,be)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:g,variable:this.parseVariable(),type:(this.expectToken(Ne),this.parseTypeReference()),defaultValue:this.expectOptionalToken(we)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const e=this._lexer.token;return this.expectToken(ye),this.node(e,{kind:L,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:T,selections:this.many(ke,this.parseSelection,_e)})}parseSelection(){return this.peek(Ee)?this.parseFragment():this.parseField()}parseField(){const e=this._lexer.token,t=this.parseName();let n,r;return this.expectOptionalToken(Ne)?(n=t,r=this.parseName()):r=t,this.node(e,{kind:b,alias:n,name:r,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(ke)?this.parseSelectionSet():void 0})}parseArguments(e){const t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(Te,t,be)}parseFragmentArguments(){const e=this.parseFragmentArgument;return this.optionalMany(Te,e,be)}parseArgument(e=!1){const t=this._lexer.token,n=this.parseName();return this.expectToken(Ne),this.node(t,{kind:E,name:n,value:this.parseValueLiteral(e)})}parseConstArgument(){return this.parseArgument(!0)}parseFragmentArgument(){const e=this._lexer.token,t=this.parseName();return this.expectToken(Ne),this.node(e,{kind:N,name:t,value:this.parseValueLiteral(!1)})}parseFragment(){const e=this._lexer.token;this.expectToken(Ee);const t=this.expectOptionalKeyword("on");if(!t&&this.peek(xe)){const t=this.parseFragmentName();return this.peek(Te)&&this._options.experimentalFragmentArguments?this.node(e,{kind:w,name:t,arguments:this.parseFragmentArguments(),directives:this.parseDirectives(!1)}):this.node(e,{kind:w,name:t,directives:this.parseDirectives(!1)})}return this.node(e,{kind:S,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const e=this._lexer.token;return this.expectKeyword("fragment"),!0===this._options.experimentalFragmentArguments?this.node(e,{kind:I,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(e,{kind:I,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if("on"===this._lexer.token.value)throw this.unexpected();return this.parseName()}parseValueLiteral(e){const t=this._lexer.token;switch(t.kind){case Ie:return this.parseList(e);case ke:return this.parseObject(e);case De:return this.advanceLexer(),this.node(t,{kind:k,value:t.value});case $e:return this.advanceLexer(),this.node(t,{kind:O,value:t.value});case Ae:case Ge:return this.parseStringLiteral();case xe:switch(this.advanceLexer(),t.value){case"true":return this.node(t,{kind:x,value:!0});case"false":return this.node(t,{kind:x,value:!1});case"null":return this.node(t,{kind:D});default:return this.node(t,{kind:$,value:t.value})}case ye:if(e){if(this.expectToken(ye),this._lexer.token.kind===xe){const e=this._lexer.token.value;throw u(this._lexer.source,t.start,`Unexpected variable "$${e}" in constant value.`)}throw this.unexpected(t)}return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){const e=this._lexer.token;return this.advanceLexer(),this.node(e,{kind:_,value:e.value,block:e.kind===Ge})}parseList(e){return this.node(this._lexer.token,{kind:A,values:this.any(Ie,()=>this.parseValueLiteral(e),Le)})}parseObject(e){return this.node(this._lexer.token,{kind:G,fields:this.any(ke,()=>this.parseObjectField(e),_e)})}parseObjectField(e){const t=this._lexer.token,n=this.parseName();return this.expectToken(Ne),this.node(t,{kind:F,name:n,value:this.parseValueLiteral(e)})}parseDirectives(e){const t=[];for(;this.peek(Se);)t.push(this.parseDirective(e));if(t.length)return t}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(e){const t=this._lexer.token;return this.expectToken(Se),this.node(t,{kind:Q,name:this.parseName(),arguments:this.parseArguments(e)})}parseTypeReference(){const e=this._lexer.token;let t;if(this.expectOptionalToken(Ie)){const n=this.parseTypeReference();this.expectToken(Le),t=this.node(e,{kind:C,type:n})}else t=this.parseNamedType();return this.expectOptionalToken(ve)?this.node(e,{kind:j,type:t}):t}parseNamedType(){return this.node(this._lexer.token,{kind:V,name:this.parseName()})}peekDescription(){return this.peek(Ae)||this.peek(Ge)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("schema");const n=this.parseConstDirectives(),r=this.many(ke,this.parseOperationTypeDefinition,_e);return this.node(e,{kind:R,description:t,directives:n,operationTypes:r})}parseOperationTypeDefinition(){const e=this._lexer.token,t=this.parseOperationType();this.expectToken(Ne);const n=this.parseNamedType();return this.node(e,{kind:M,operation:t,type:n})}parseScalarTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("scalar");const n=this.parseName(),r=this.parseConstDirectives();return this.node(e,{kind:U,description:t,name:n,directives:r})}parseObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("type");const n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:P,description:t,name:n,interfaces:r,directives:i,fields:o})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(ge,this.parseNamedType):void 0}parseFieldsDefinition(){return this.optionalMany(ke,this.parseFieldDefinition,_e)}parseFieldDefinition(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseName(),r=this.parseArgumentDefs();this.expectToken(Ne);const i=this.parseTypeReference(),o=this.parseConstDirectives();return this.node(e,{kind:B,description:t,name:n,arguments:r,type:i,directives:o})}parseArgumentDefs(){return this.optionalMany(Te,this.parseInputValueDef,be)}parseInputValueDef(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseName();this.expectToken(Ne);const r=this.parseTypeReference();let i;this.expectOptionalToken(we)&&(i=this.parseConstValueLiteral());const o=this.parseConstDirectives();return this.node(e,{kind:q,description:t,name:n,type:r,defaultValue:i,directives:o})}parseInterfaceTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("interface");const n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:J,description:t,name:n,interfaces:r,directives:i,fields:o})}parseUnionTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("union");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseUnionMemberTypes();return this.node(e,{kind:K,description:t,name:n,directives:r,types:i})}parseUnionMemberTypes(){return this.expectOptionalToken(we)?this.delimitedMany(Oe,this.parseNamedType):void 0}parseEnumTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("enum");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();return this.node(e,{kind:z,description:t,name:n,directives:r,values:i})}parseEnumValuesDefinition(){return this.optionalMany(ke,this.parseEnumValueDefinition,_e)}parseEnumValueDefinition(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseEnumValueName(),r=this.parseConstDirectives();return this.node(e,{kind:Y,description:t,name:n,directives:r})}parseEnumValueName(){if("true"===this._lexer.token.value||"false"===this._lexer.token.value||"null"===this._lexer.token.value)throw u(this._lexer.source,this._lexer.token.start,`${st(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("input");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();return this.node(e,{kind:H,description:t,name:n,directives:r,fields:i})}parseInputFieldsDefinition(){return this.optionalMany(ke,this.parseInputValueDef,_e)}parseTypeSystemExtension(){const e=this._lexer.lookahead();if(e.kind===xe)switch(e.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(e)}parseSchemaExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const t=this.parseConstDirectives(),n=this.optionalMany(ke,this.parseOperationTypeDefinition,_e);if(void 0===t&&void 0===n)throw this.unexpected();return this.node(e,{kind:X,directives:t,operationTypes:n})}parseScalarTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const t=this.parseName(),n=this.parseConstDirectives();if(void 0===n)throw this.unexpected();return this.node(e,{kind:Z,name:t,directives:n})}parseObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(void 0===n&&void 0===r&&void 0===i)throw this.unexpected();return this.node(e,{kind:ee,name:t,interfaces:n,directives:r,fields:i})}parseInterfaceTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(void 0===n&&void 0===r&&void 0===i)throw this.unexpected();return this.node(e,{kind:te,name:t,interfaces:n,directives:r,fields:i})}parseUnionTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const t=this.parseName(),n=this.parseConstDirectives(),r=this.parseUnionMemberTypes();if(void 0===n&&void 0===r)throw this.unexpected();return this.node(e,{kind:ne,name:t,directives:n,types:r})}parseEnumTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const t=this.parseName(),n=this.parseConstDirectives(),r=this.parseEnumValuesDefinition();if(void 0===n&&void 0===r)throw this.unexpected();return this.node(e,{kind:re,name:t,directives:n,values:r})}parseInputObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const t=this.parseName(),n=this.parseConstDirectives(),r=this.parseInputFieldsDefinition();if(void 0===n&&void 0===r)throw this.unexpected();return this.node(e,{kind:ie,name:t,directives:n,fields:r})}parseDirectiveDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(Se);const n=this.parseName(),r=this.parseArgumentDefs(),i=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const o=this.parseDirectiveLocations();return this.node(e,{kind:W,description:t,name:n,arguments:r,repeatable:i,locations:o})}parseDirectiveLocations(){return this.delimitedMany(Oe,this.parseDirectiveLocation)}parseDirectiveLocation(){const e=this._lexer.token,t=this.parseName();if(Object.hasOwn(h,t.value))return t;throw this.unexpected(e)}node(e,t){return!0!==this._options.noLocation&&(t.loc=new Location(e,this._lexer.lastToken,this._lexer.source)),t}peek(e){return this._lexer.token.kind===e}expectToken(e){const t=this._lexer.token;if(t.kind===e)return this.advanceLexer(),t;throw u(this._lexer.source,t.start,`Expected ${at(e)}, found ${st(t)}.`)}expectOptionalToken(e){return this._lexer.token.kind===e&&(this.advanceLexer(),!0)}expectKeyword(e){const t=this._lexer.token;if(t.kind!==xe||t.value!==e)throw u(this._lexer.source,t.start,`Expected "${e}", found ${st(t)}.`);this.advanceLexer()}expectOptionalKeyword(e){const t=this._lexer.token;return t.kind===xe&&t.value===e&&(this.advanceLexer(),!0)}unexpected(e){const t=e??this._lexer.token;return u(this._lexer.source,t.start,`Unexpected ${st(t)}.`)}any(e,t,n){this.expectToken(e);const r=[];for(;!this.expectOptionalToken(n);)r.push(t.call(this));return r}optionalMany(e,t,n){if(this.expectOptionalToken(e)){const e=[];do{e.push(t.call(this))}while(!this.expectOptionalToken(n));return e}}many(e,t,n){this.expectToken(e);const r=[];do{r.push(t.call(this))}while(!this.expectOptionalToken(n));return r}delimitedMany(e,t){this.expectOptionalToken(e);const n=[];do{n.push(t.call(this))}while(this.expectOptionalToken(e));return n}advanceLexer(){const{maxTokens:e}=this._options,t=this._lexer.advance();if(t.kind!==me&&(++this._tokenCounter,void 0!==e&&this._tokenCounter>e))throw u(this._lexer.source,t.start,`Document contains more than ${e} tokens. Parsing aborted.`)}}function st(e){const t=e.value;return at(e.kind)+(null!=t?` "${t}"`:"")}function at(e){return function(e){return e===ve||e===ye||e===ge||e===Te||e===be||e===Ee||e===Ne||e===we||e===Se||e===Ie||e===Le||e===ke||e===Oe||e===_e}(e)?`"${e}"`:e}class AccumulatorMap extends Map{get[Symbol.toStringTag](){return"AccumulatorMap"}add(e,t){const n=this.get(e);void 0===n?this.set(e,[t]):n.push(t)}}function ct(e){return e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}function ut(e){return lt("and",e)}function lt(e,t){switch(0!==t.length||n(),t.length){case 1:return t[0];case 2:return t[0]+" "+e+" "+t[1]}const r=t.slice(0,-1),i=t.at(-1);return r.join(", ")+", "+e+" "+i}function pt(e){return"object"==typeof e&&"function"==typeof e?.[Symbol.iterator]}function dt(e,t){const n=Object.create(null);for(const r of e)n[t(r)]=r;return n}function ft(e,t){const n=Object.create(null);for(const r of Object.keys(e))n[r]=t(e[r],r);return n}function ht(e){return 0===e.length?"":` at ${e.map(e=>"number"==typeof e?`[${e}]`:`.${e}`).join("")}`}function mt(e,t){const[n,r]=t?[e,t]:[void 0,e];if(0===r.length)return"";let i=" Did you mean ";null!=n&&(i+=n+" ");return i+lt("or",r.slice(0,5).map(e=>`"${e}"`))+"?"}function vt(e){return e}function yt(e,t,n){const r=Object.create(null);for(const i of e)r[t(i)]=n(i);return r}function gt(e,t){let n=0,r=0;for(;n0);let a=0;do{++r,a=10*a+o-Tt,o=t.charCodeAt(r)}while(Et(o)&&a>0);if(sa)return 1}else{if(io)return 1;++n,++r}}return e.length-t.length}const Tt=48,bt=57;function Et(e){return!isNaN(e)&&Tt<=e&&e<=bt}function Nt(e,t){const n=Object.create(null),r=new LexicalDistance(e),i=Math.floor(.4*e.length)+1;for(const e of t){const t=r.measure(e,i);void 0!==t&&(n[e]=t)}return Object.keys(n).sort((e,t)=>{const r=n[e]-n[t];return 0!==r?r:gt(e,t)})}class LexicalDistance{constructor(e){this._input=e,this._inputLowerCase=e.toLowerCase(),this._inputArray=wt(this._inputLowerCase),this._rows=[new Array(e.length+1).fill(0),new Array(e.length+1).fill(0),new Array(e.length+1).fill(0)]}measure(e,t){if(this._input===e)return 0;const n=e.toLowerCase();if(this._inputLowerCase===n)return 1;let r=wt(n),i=this._inputArray;if(r.lengtht)return;const a=this._rows;for(let e=0;e<=s;e++)a[0][e]=e;for(let e=1;e<=o;e++){const n=a[(e-1)%3],o=a[e%3];let c=o[0]=e;for(let t=1;t<=s;t++){const s=r[e-1]===i[t-1]?0:1;let u=Math.min(n[t]+1,o[t-1]+1,n[t-1]+s);if(e>1&&t>1&&r[e-1]===i[t-2]&&r[e-2]===i[t-1]){const n=a[(e-2)%3][t-2];u=Math.min(u,n+1)}ut)return}const c=a[o%3][s];return c<=t?c:void 0}}function wt(e){const t=e.length,n=new Array(t);for(let r=0;re.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>Gt(e.definitions,"\n\n")},OperationDefinition:{leave(e){const t=Qt("(",Gt(e.variableDefinitions,", "),")"),n=Gt([e.operation,Gt([e.name,t]),Gt(e.directives," ")]," ");return("query"===n?"":n+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:n,directives:r})=>e+": "+t+Qt(" = ",n)+Qt(" ",Gt(r," "))},SelectionSet:{leave:({selections:e})=>Ft(e)},Field:{leave({alias:e,name:t,arguments:n,directives:r,selectionSet:i}){const o=Gt([Qt("",e,": "),t],"");return Gt([jt(o,n),Qt(" ",Gt(r," ")),Qt(" ",i)])}},Argument:{leave:({name:e,value:t})=>e+": "+t},FragmentArgument:{leave:({name:e,value:t})=>e+": "+t},FragmentSpread:{leave:({name:e,arguments:t,directives:n})=>jt("..."+e,t)+Qt(" ",Gt(n," "))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:n})=>Gt(["...",Qt("on ",e),Gt(t," "),n]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:n,directives:r,selectionSet:i})=>`fragment ${e}${Qt("(",Gt(n,", "),")")} on ${t} ${Qt("",Gt(r," ")," ")}`+i},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>!0===t?function(e){const t=e.replaceAll('"""','\\"""'),n=t.split(/\r\n|[\n\r]/g),r=1===n.length,i=n.length>1&&n.slice(1).every(e=>0===e.length||se(e.charCodeAt(0))),o=t.endsWith('\\"""'),s=e.endsWith('"')&&!o,a=e.endsWith("\\"),c=s||a,u=!r||e.length>70||c||i||o;let l="";const p=r&&se(e.charCodeAt(0));return(u&&!p||i)&&(l+="\n"),l+=t,(u||c)&&(l+="\n"),'"""'+l+'"""'}(e):`"${e.replace(It,Lt)}"`},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>{const t="["+Gt(e,", ")+"]";return t.length>80?"[\n"+Vt(Gt(e,"\n"))+"\n]":t}},ObjectValue:{leave:({fields:e})=>{const t="{ "+Gt(e,", ")+" }";return t.length>80?Ft(e):t}},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+Qt("(",Gt(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:n})=>Qt("",e,"\n")+Gt(["schema",Gt(t," "),Ft(n)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:n})=>Qt("",e,"\n")+Gt(["scalar",t,Gt(n," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>Qt("",e,"\n")+Gt(["type",t,Qt("implements ",Gt(n," & ")),Gt(r," "),Ft(i)]," ")},FieldDefinition:{leave:({description:e,name:t,arguments:n,type:r,directives:i})=>Qt("",e,"\n")+t+(Ct(n)?Qt("(\n",Vt(Gt(n,"\n")),"\n)"):Qt("(",Gt(n,", "),")"))+": "+r+Qt(" ",Gt(i," "))},InputValueDefinition:{leave:({description:e,name:t,type:n,defaultValue:r,directives:i})=>Qt("",e,"\n")+Gt([t+": "+n,Qt("= ",r),Gt(i," ")]," ")},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>Qt("",e,"\n")+Gt(["interface",t,Qt("implements ",Gt(n," & ")),Gt(r," "),Ft(i)]," ")},UnionTypeDefinition:{leave:({description:e,name:t,directives:n,types:r})=>Qt("",e,"\n")+Gt(["union",t,Gt(n," "),Qt("= ",Gt(r," | "))]," ")},EnumTypeDefinition:{leave:({description:e,name:t,directives:n,values:r})=>Qt("",e,"\n")+Gt(["enum",t,Gt(n," "),Ft(r)]," ")},EnumValueDefinition:{leave:({description:e,name:t,directives:n})=>Qt("",e,"\n")+Gt([t,Gt(n," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:n,fields:r})=>Qt("",e,"\n")+Gt(["input",t,Gt(n," "),Ft(r)]," ")},DirectiveDefinition:{leave:({description:e,name:t,arguments:n,repeatable:r,locations:i})=>Qt("",e,"\n")+"directive @"+t+(Ct(n)?Qt("(\n",Vt(Gt(n,"\n")),"\n)"):Qt("(",Gt(n,", "),")"))+(r?" repeatable":"")+" on "+Gt(i," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>Gt(["extend schema",Gt(e," "),Ft(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>Gt(["extend scalar",e,Gt(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>Gt(["extend type",e,Qt("implements ",Gt(t," & ")),Gt(n," "),Ft(r)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>Gt(["extend interface",e,Qt("implements ",Gt(t," & ")),Gt(n," "),Ft(r)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:n})=>Gt(["extend union",e,Gt(t," "),Qt("= ",Gt(n," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:n})=>Gt(["extend enum",e,Gt(t," "),Ft(n)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:n})=>Gt(["extend input",e,Gt(t," "),Ft(n)]," ")}};function Gt(e,t=""){return e?.filter(e=>e).join(t)??""}function Ft(e){return Qt("{\n",Vt(Gt(e,"\n")),"\n}")}function Qt(e,t,n=""){return null!=t&&""!==t?e+t+n:""}function Vt(e){return Qt(" ",e.replaceAll("\n","\n "))}function Ct(e){return e?.some(e=>e.includes("\n"))??!1}function jt(e,t){let n=e+Qt("(",Gt(t,", "),")");return n.length>80&&(n=e+Qt("(\n",Vt(Gt(t,"\n")),"\n)")),n}function Rt(e,t){switch(e.kind){case D:return null;case k:return parseInt(e.value,10);case O:return parseFloat(e.value);case _:case $:case x:return e.value;case A:return e.values.map(e=>Rt(e,t));case G:return yt(e.fields,e=>e.name.value,e=>Rt(e.value,t));case L:return t?.[e.name.value]}}function Mt(e){if(0===e.length)throw new GraphQLError("Expected name to be a non-empty string.");for(let t=1;tthis.coerceInputValue(Rt(e,t))),this.coerceOutputValue=e.coerceOutputValue??this.serialize,this.coerceInputValue=e.coerceInputValue??this.parseValue,this.coerceInputLiteral=e.coerceInputLiteral,this.valueToLiteral=e.valueToLiteral,this.extensions=St(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],e.parseLiteral&&("function"==typeof e.parseValue&&"function"==typeof e.parseLiteral||et(0,`${this.name} must provide both "parseValue" and "parseLiteral" functions.`)),e.coerceInputLiteral&&("function"==typeof e.coerceInputValue&&"function"==typeof e.coerceInputLiteral||et(0,`${this.name} must provide both "coerceInputValue" and "coerceInputLiteral" functions.`))}get[Symbol.toStringTag](){return"GraphQLScalarType"}toConfig(){return{name:this.name,description:this.description,specifiedByURL:this.specifiedByURL,serialize:this.serialize,parseValue:this.parseValue,parseLiteral:this.parseLiteral,coerceOutputValue:this.coerceOutputValue,coerceInputValue:this.coerceInputValue,coerceInputLiteral:this.coerceInputLiteral,valueToLiteral:this.valueToLiteral,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}class GraphQLObjectType{constructor(e){this.name=Mt(e.name),this.description=e.description,this.isTypeOf=e.isTypeOf,this.extensions=St(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._fields=fn.bind(void 0,this,e.fields),this._interfaces=dn.bind(void 0,e.interfaces)}get[Symbol.toStringTag](){return"GraphQLObjectType"}getFields(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields}getInterfaces(){return"function"==typeof this._interfaces&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:ft(this.getFields(),e=>e.toConfig()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function dn(e){return ln(e??[])}function fn(e,t){return ft(pn(t),(t,n)=>new GraphQLField(e,n,t))}class GraphQLField{constructor(e,t,n){this.parentType=e,this.name=Mt(t),this.description=n.description,this.type=n.type;const r=n.args;this.args=r?Object.entries(r).map(([e,t])=>new GraphQLArgument(this,e,t)):[],this.resolve=n.resolve,this.subscribe=n.subscribe,this.deprecationReason=n.deprecationReason,this.extensions=St(n.extensions),this.astNode=n.astNode}get[Symbol.toStringTag](){return"GraphQLField"}toConfig(){return{description:this.description,type:this.type,args:yt(this.args,e=>e.name,e=>e.toConfig()),resolve:this.resolve,subscribe:this.subscribe,deprecationReason:this.deprecationReason,extensions:this.extensions,astNode:this.astNode}}toString(){return`${this.parentType??""}.${this.name}`}toJSON(){return this.toString()}}class GraphQLArgument{constructor(e,t,n){this.parent=e,this.name=Mt(t),this.description=n.description,this.type=n.type,this.defaultValue=n.defaultValue,this.default=n.default,this.deprecationReason=n.deprecationReason,this.extensions=St(n.extensions),this.astNode=n.astNode}get[Symbol.toStringTag](){return"GraphQLArgument"}toConfig(){return{description:this.description,type:this.type,defaultValue:this.defaultValue,default:this.default,deprecationReason:this.deprecationReason,extensions:this.extensions,astNode:this.astNode}}toString(){return`${this.parent}(${this.name}:)`}toJSON(){return this.toString()}}function hn(e){return Wt(e.type)&&void 0===e.default&&void 0===e.defaultValue}class GraphQLInterfaceType{constructor(e){this.name=Mt(e.name),this.description=e.description,this.resolveType=e.resolveType,this.extensions=St(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._fields=fn.bind(void 0,this,e.fields),this._interfaces=dn.bind(void 0,e.interfaces)}get[Symbol.toStringTag](){return"GraphQLInterfaceType"}getFields(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields}getInterfaces(){return"function"==typeof this._interfaces&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:ft(this.getFields(),e=>e.toConfig()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}class GraphQLUnionType{constructor(e){this.name=Mt(e.name),this.description=e.description,this.resolveType=e.resolveType,this.extensions=St(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._types=mn.bind(void 0,e.types)}get[Symbol.toStringTag](){return"GraphQLUnionType"}getTypes(){return"function"==typeof this._types&&(this._types=this._types()),this._types}toConfig(){return{name:this.name,description:this.description,types:this.getTypes(),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function mn(e){return ln(e)}class GraphQLEnumType{constructor(e){this.name=Mt(e.name),this.description=e.description,this.extensions=St(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._values="function"==typeof e.values?e.values:Object.entries(e.values).map(([e,t])=>new GraphQLEnumValue(this,e,t)),this._valueLookup=null,this._nameLookup=null}get[Symbol.toStringTag](){return"GraphQLEnumType"}getValues(){return"function"==typeof this._values&&(this._values=Object.entries(this._values()).map(([e,t])=>new GraphQLEnumValue(this,e,t))),this._values}getValue(e){return null===this._nameLookup&&(this._nameLookup=dt(this.getValues(),e=>e.name)),this._nameLookup[e]}serialize(e){return this.coerceOutputValue(e)}coerceOutputValue(e){null===this._valueLookup&&(this._valueLookup=new Map(this.getValues().map(e=>[e.value,e])));const t=this._valueLookup.get(e);if(void 0===t)throw new GraphQLError(`Enum "${this.name}" cannot represent value: ${tt(e)}`);return t.name}parseValue(e,t){return this.coerceInputValue(e,t)}coerceInputValue(e,t){if("string"!=typeof e){const n=tt(e);throw new GraphQLError(`Enum "${this.name}" cannot represent non-string value: ${n}.`+(t?"":vn(this,n)))}const n=this.getValue(e);if(null==n)throw new GraphQLError(`Value "${e}" does not exist in "${this.name}" enum.`+(t?"":vn(this,e)));return n.value}parseLiteral(e,t,n){return this.coerceInputLiteral(e,n)}coerceInputLiteral(e,t){if(e.kind!==$){const n=$t(e);throw new GraphQLError(`Enum "${this.name}" cannot represent non-enum value: ${n}.`+(t?"":vn(this,n)),{nodes:e})}const n=this.getValue(e.value);if(null==n){const n=$t(e);throw new GraphQLError(`Value "${n}" does not exist in "${this.name}" enum.`+(t?"":vn(this,n)),{nodes:e})}return n.value}valueToLiteral(e){if("string"==typeof e&&this.getValue(e))return{kind:$,value:e}}toConfig(){return{name:this.name,description:this.description,values:yt(this.getValues(),e=>e.name,e=>e.toConfig()),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function vn(e,t){return mt("the enum value",Nt(t,e.getValues().map(e=>e.name)))}class GraphQLEnumValue{constructor(e,t,n){this.parentEnum=e,this.name=function(e){if("true"===e||"false"===e||"null"===e)throw new GraphQLError(`Enum values cannot be named: ${e}`);return Mt(e)}(t),this.description=n.description,this.value=void 0!==n.value?n.value:t,this.deprecationReason=n.deprecationReason,this.extensions=St(n.extensions),this.astNode=n.astNode}get[Symbol.toStringTag](){return"GraphQLEnumValue"}toConfig(){return{description:this.description,value:this.value,deprecationReason:this.deprecationReason,extensions:this.extensions,astNode:this.astNode}}toString(){return`${this.parentEnum.name}.${this.name}`}toJSON(){return this.toString()}}class GraphQLInputObjectType{constructor(e){this.name=Mt(e.name),this.description=e.description,this.extensions=St(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this.isOneOf=e.isOneOf??!1,this._fields=yn.bind(void 0,this,e.fields)}get[Symbol.toStringTag](){return"GraphQLInputObjectType"}getFields(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields}toConfig(){return{name:this.name,description:this.description,fields:ft(this.getFields(),e=>e.toConfig()),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,isOneOf:this.isOneOf}}toString(){return this.name}toJSON(){return this.toString()}}function yn(e,t){return ft(pn(t),(t,n)=>new GraphQLInputField(e,n,t))}class GraphQLInputField{constructor(e,t,n){!("resolve"in n)||et(0,`${e}.${t} field has a resolve property, but Input Types cannot define resolvers.`),this.parentType=e,this.name=Mt(t),this.description=n.description,this.type=n.type,this.defaultValue=n.defaultValue,this.default=n.default,this.deprecationReason=n.deprecationReason,this.extensions=St(n.extensions),this.astNode=n.astNode}get[Symbol.toStringTag](){return"GraphQLInputField"}toConfig(){return{description:this.description,type:this.type,defaultValue:this.defaultValue,default:this.default,deprecationReason:this.deprecationReason,extensions:this.extensions,astNode:this.astNode}}toString(){return`${this.parentType}.${this.name}`}toJSON(){return this.toString()}}function gn(e){return Wt(e.type)&&void 0===e.defaultValue&&void 0===e.default}function Tn(e,t){return e===t||(Wt(e)&&Wt(t)||!(!Ht(e)||!Ht(t)))&&Tn(e.ofType,t.ofType)}function bn(e,t,n){return t===n||(Wt(n)?!!Wt(t)&&bn(e,t.ofType,n.ofType):Wt(t)?bn(e,t.ofType,n):Ht(n)?!!Ht(t)&&bn(e,t.ofType,n.ofType):!Ht(t)&&(rn(n)&&(Jt(t)||Bt(t))&&e.isSubType(n,t)))}function En(e,t,n){return t===n||(rn(t)?rn(n)?e.getPossibleTypes(t).some(t=>e.isSubType(n,t)):e.isSubType(t,n):!!rn(n)&&e.isSubType(n,t))}function Nn(e,t,n){return{prev:e,key:t,typename:n}}function wn(e){const t=[];let n=e;for(;n;)t.push(n.key),n=n.prev;return t.reverse()}function Sn(e,n){if(Wt(n)){if(null==e)return;return Sn(e,n.ofType)}if(null==e)return{kind:D};if(Ht(n)){if(!pt(e))return Sn(e,n.ofType);const t=[];for(const r of e){const e=Sn(r,n.ofType);if(!e)return;t.push(e)}return{kind:A,values:t}}if(Yt(n)){if(!t(e))return;const r=[],i=n.getFields();if(Object.keys(e).some(e=>!Object.hasOwn(i,e)))return;for(const t of Object.values(n.getFields())){if(void 0===e[t.name]){if(gn(t))return}else{const n=Sn(e[t.name],t.type);if(!n)return;r.push({kind:F,name:{kind:m,value:t.name},value:n})}}return{kind:G,fields:r}}const r=tn(n);if(r.valueToLiteral)try{return r.valueToLiteral(e)}catch(e){return}return In(e)}function In(e){if(null==e)return{kind:D};switch(typeof e){case"boolean":return{kind:x,value:e};case"string":return{kind:_,value:e,block:!1};case"number":{if(!Number.isFinite(e))return{kind:D};const t=String(e);return/^-?(?:0|[1-9][0-9]*)$/.test(t)?{kind:k,value:t}:{kind:O,value:t}}case"object":{if(pt(e))return{kind:A,values:Array.from(e,In)};const t=e,n=[];for(const e of Object.keys(t)){const r=t[e];void 0!==r&&n.push({kind:F,name:{kind:m,value:e},value:In(r)})}return{kind:G,fields:n}}}throw new TypeError(`Cannot convert value to AST: ${tt(e)}.`)}function Ln(e,t,n){switch(e.kind){case L:{const r=e.name.value,i=n?.sources[r];if(i){const e=i.value;if(void 0===e){const e=i.signature.default;return void 0!==e?e.literal:{kind:D}}return Ln(e,t,i.fragmentVariableValues)}const o=t?.sources[r];if(null==o)return{kind:D};if(void 0===o.value){const e=o.signature.default;if(void 0!==e)return e.literal}return Sn(o.value,o.signature.type)}case G:{const r=[];for(const i of e.fields){if(i.value.kind===L){const e=n?.sources[i.value.name.value]??t?.sources[i.value.name.value];if(void 0===e?.value&&void 0===e?.signature.default)continue}const e=Ln(i.value,t,n);r.push({...i,value:e})}return{...e,fields:r}}case A:{const r=[];for(const i of e.values){const e=Ln(i,t,n);r.push(e)}return{...e,values:r}}default:return e}}function kn(e,t,n,r){return On(e,t,n,r,void 0)}function On(e,n,r,i,o){if(Wt(n))return void 0===e?void _n(r,`Expected a value of non-null type "${n}" to be provided.`,o):null===e?void _n(r,`Expected value of non-null type "${n}" not to be null.`,o):On(e,n.ofType,r,i,o);if(null!=e)if(Ht(n))if(pt(e)){let t=0;for(const s of e)On(s,n.ofType,r,i,Nn(o,t++,void 0))}else On(e,n.ofType,r,i,o);else if(Yt(n)){if(!t(e)||Array.isArray(e))return void _n(r,`Expected value of type "${n}" to be an object, found: ${tt(e)}.`,o);const s=n.getFields();for(const t of Object.values(s)){const s=e[t.name];void 0===s?gn(t)&&_n(r,`Expected value of type "${n}" to include required field "${t.name}", found: ${tt(e)}.`,o):On(s,t.type,r,i,Nn(o,t.name,n.name))}const a=Object.keys(e);for(const t of a)if(!Object.hasOwn(s,t)){const i=mt(Nt(t,Object.keys(s)));_n(r,`Expected value of type "${n}" not to include unknown field "${t}"${i?`.${i} Found`:", found"}: ${tt(e)}.`,o)}if(n.isOneOf){1!==a.length&&_n(r,`Exactly one key must be specified for OneOf type "${n}".`,o);const t=a[0];null===e[t]&&_n(r,`Field "${t}" for OneOf type "${n}" must be non-null.`,o)}}else{let t,s;tn(n);try{t=n.coerceInputValue(e,i)}catch(e){if(e instanceof GraphQLError)return void r(e,wn(o));s=e}void 0===t&&_n(r,`Expected value of type "${n}"${null!=s?`, but encountered error "${null!=s.message&&""!==s.message?s.message:s}"; found`:", found"}: ${tt(e)}.`,o,s)}}function _n(e,t,n,r){e(new GraphQLError(t,{originalError:r}),wn(n))}function xn(e,t,n,r,i,o){return Dn({static:!r&&!i,onError:n,variables:r,fragmentVariableValues:i},e,t,o,void 0)}function Dn(e,t,n,r,i){if(t.kind===L){if(e.static)return;const r=$n(e,t),o=r?.coerced[t.name.value];return void(Wt(n)&&(void 0===o?An(e.onError,`Expected variable "$${t.name.value}" provided to type "${n}" to provide a runtime value.`,t,i):null===o&&An(e.onError,`Expected variable "$${t.name.value}" provided to non-null type "${n}" not to be null.`,t,i)))}if(Wt(n))return t.kind===D?void An(e.onError,`Expected value of non-null type "${n}" not to be null.`,t,i):Dn(e,t,n.ofType,r,i);if(t.kind!==D)if(Ht(n))if(t.kind!==A)Dn(e,t,n.ofType,r,i);else{let o=0;for(const s of t.values)Dn(e,s,n.ofType,r,Nn(i,o++,void 0))}else if(Yt(n)){if(t.kind!==G)return void An(e.onError,`Expected value of type "${n}" to be an object, found: ${$t(t)}.`,t,i);const o=n.getFields(),s=dt(t.fields,e=>e.name.value);for(const a of Object.values(o)){const o=s[a.name];if(void 0===o)gn(a)&&An(e.onError,`Expected value of type "${n}" to include required field "${a.name}", found: ${$t(t)}.`,t,i);else{const s=o.value;if(s.kind===L&&!e.static){const r=$n(e,s),o=s.name.value,c=r?.coerced[o];if(n.isOneOf)void 0===c?An(e.onError,`Expected variable "$${o}" provided to field "${a.name}" for OneOf Input Object type "${n}" to provide a runtime value.`,t,i):null===c&&An(e.onError,`Expected variable "$${o}" provided to field "${a.name}" for OneOf Input Object type "${n}" not to be null.`,t,i);else if(void 0===c&&!gn(a))continue}Dn(e,s,a.type,r,Nn(i,a.name,n.name))}}const a=t.fields;for(const s of a){const a=s.name.value;if(!Object.hasOwn(o,a)){const c=r?"":mt(Nt(a,Object.keys(o)));An(e.onError,`Expected value of type "${n}" not to include unknown field "${a}"${c?`.${c} Found`:", found"}: ${$t(t)}.`,s,i)}}if(n.isOneOf){if(1!==a.length)return void An(e.onError,`OneOf Input Object "${n}" must specify exactly one key.`,t,i);if(a[0].value.kind===D){const r=a[0].name.value;An(e.onError,`Field "${n}.${r}" used for OneOf Input Object must be non-null.`,t,Nn(i,r,void 0))}}}else{let o,s;tn(n);try{o=n.coerceInputLiteral?n.coerceInputLiteral(Ln(t,e.variables,e.fragmentVariableValues),r):n.parseLiteral(t,void 0,r)}catch(t){if(t instanceof GraphQLError)return void e.onError(t,wn(i));s=t}void 0===o&&An(e.onError,`Expected value of type "${n}"${null!=s?`, but encountered error "${null!=s.message&&""!==s.message?s.message:s}"; found`:", found"}: ${$t(t)}.`,t,i,s)}}function $n(e,t){const n=t.name.value,{fragmentVariableValues:r,variables:i}=e;return r?.sources[n]?r:i}function An(e,t,n,r,i){e(new GraphQLError(t,{nodes:n,originalError:i}),wn(r))}const Gn=2147483647,Fn=-2147483648,Qn=new GraphQLScalarType({name:"Int",description:"The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.",coerceOutputValue(e){const t=Pn(e);if("boolean"==typeof t)return t?1:0;let n=t;if("string"==typeof t&&""!==t&&(n=Number(t)),"number"!=typeof n||!Number.isInteger(n))throw new GraphQLError(`Int cannot represent non-integer value: ${tt(t)}`);if(n>Gn||nGn||eGn||t=Fn)return{kind:k,value:String(e)}}}),Vn=new GraphQLScalarType({name:"Float",description:"The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).",coerceOutputValue(e){const t=Pn(e);if("boolean"==typeof t)return t?1:0;let n=t;if("string"==typeof t&&""!==t&&(n=Number(t)),"number"!=typeof n||!Number.isFinite(n))throw new GraphQLError(`Float cannot represent non numeric value: ${tt(t)}`);return n},coerceInputValue(e){if("number"!=typeof e||!Number.isFinite(e))throw new GraphQLError(`Float cannot represent non numeric value: ${tt(e)}`);return e},coerceInputLiteral(e){if(e.kind!==O&&e.kind!==k)throw new GraphQLError(`Float cannot represent non numeric value: ${$t(e)}`,{nodes:e});return parseFloat(e.value)},valueToLiteral(e){const t=In(e);if(t.kind===O||t.kind===k)return t}}),Cn=new GraphQLScalarType({name:"String",description:"The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.",coerceOutputValue(e){const t=Pn(e);if("string"==typeof t)return t;if("boolean"==typeof t)return t?"true":"false";if("number"==typeof t&&Number.isFinite(t))return t.toString();throw new GraphQLError(`String cannot represent value: ${tt(e)}`)},coerceInputValue(e){if("string"!=typeof e)throw new GraphQLError(`String cannot represent a non string value: ${tt(e)}`);return e},coerceInputLiteral(e){if(e.kind!==_)throw new GraphQLError(`String cannot represent a non string value: ${$t(e)}`,{nodes:e});return e.value},valueToLiteral(e){const t=In(e);if(t.kind===_)return t}}),jn=new GraphQLScalarType({name:"Boolean",description:"The `Boolean` scalar type represents `true` or `false`.",coerceOutputValue(e){const t=Pn(e);if("boolean"==typeof t)return t;if(Number.isFinite(t))return 0!==t;throw new GraphQLError(`Boolean cannot represent a non boolean value: ${tt(t)}`)},coerceInputValue(e){if("boolean"!=typeof e)throw new GraphQLError(`Boolean cannot represent a non boolean value: ${tt(e)}`);return e},coerceInputLiteral(e){if(e.kind!==x)throw new GraphQLError(`Boolean cannot represent a non boolean value: ${$t(e)}`,{nodes:e});return e.value},valueToLiteral(e){const t=In(e);if(t.kind===x)return t}}),Rn=new GraphQLScalarType({name:"ID",description:'The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.',coerceOutputValue(e){const t=Pn(e);if("string"==typeof t)return t;if(Number.isInteger(t))return String(t);throw new GraphQLError(`ID cannot represent value: ${tt(e)}`)},coerceInputValue(e){if("string"==typeof e)return e;if("number"==typeof e&&Number.isInteger(e))return e.toString();throw new GraphQLError(`ID cannot represent value: ${tt(e)}`)},coerceInputLiteral(e){if(e.kind!==_&&e.kind!==k)throw new GraphQLError("ID cannot represent a non-string and non-integer value: "+$t(e),{nodes:e});return e.value},valueToLiteral(e){const t=Number.isInteger(e)?String(e):e;if("string"==typeof t)return/^-?(?:0|[1-9][0-9]*)$/.test(t)?{kind:k,value:t}:{kind:_,value:t,block:!1}}}),Mn=Object.freeze([Cn,Qn,Vn,jn,Rn]);function Un(e){return Mn.some(({name:t})=>e.name===t)}function Pn(e){if(t(e)){if("function"==typeof e.valueOf){const n=e.valueOf();if(!t(n))return n}if("function"==typeof e.toJSON)return e.toJSON()}return e}function Bn(e){return rt(e,GraphQLDirective)}class GraphQLDirective{constructor(e){this.name=Mt(e.name),this.description=e.description,this.locations=e.locations,this.isRepeatable=e.isRepeatable??!1,this.extensions=St(e.extensions),this.astNode=e.astNode,Array.isArray(e.locations)||et(0,`@${this.name} locations must be an Array.`);const n=e.args??{};t(n)&&!Array.isArray(n)||et(0,`@${this.name} args must be an object with argument names as keys.`),this.args=Object.entries(n).map(([e,t])=>new GraphQLArgument(this,e,t))}get[Symbol.toStringTag](){return"GraphQLDirective"}toConfig(){return{name:this.name,description:this.description,locations:this.locations,args:yt(this.args,e=>e.name,e=>e.toConfig()),isRepeatable:this.isRepeatable,extensions:this.extensions,astNode:this.astNode}}toString(){return"@"+this.name}toJSON(){return this.toString()}}const qn=new GraphQLDirective({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[h.FIELD,h.FRAGMENT_SPREAD,h.INLINE_FRAGMENT],args:{if:{type:new GraphQLNonNull(jn),description:"Included when true."}}}),Jn=new GraphQLDirective({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[h.FIELD,h.FRAGMENT_SPREAD,h.INLINE_FRAGMENT],args:{if:{type:new GraphQLNonNull(jn),description:"Skipped when true."}}}),Kn=new GraphQLDirective({name:"defer",description:"Directs the executor to defer this fragment when the `if` argument is true or undefined.",locations:[h.FRAGMENT_SPREAD,h.INLINE_FRAGMENT],args:{if:{type:new GraphQLNonNull(jn),description:"Deferred when true or undefined.",default:{value:!0}},label:{type:Cn,description:"Unique name"}}}),zn=new GraphQLDirective({name:"stream",description:"Directs the executor to stream plural fields when the `if` argument is true or undefined.",locations:[h.FIELD],args:{initialCount:{default:{value:0},type:new GraphQLNonNull(Qn),description:"Number of items to return immediately"},if:{type:new GraphQLNonNull(jn),description:"Stream when true or undefined.",default:{value:!0}},label:{type:Cn,description:"Unique name"}}}),Yn="No longer supported",Hn=new GraphQLDirective({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[h.FIELD_DEFINITION,h.ARGUMENT_DEFINITION,h.INPUT_FIELD_DEFINITION,h.ENUM_VALUE],args:{reason:{type:new GraphQLNonNull(Cn),description:"Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).",default:{value:Yn}}}}),Wn=new GraphQLDirective({name:"specifiedBy",description:"Exposes a URL that specifies the behavior of this scalar.",locations:[h.SCALAR],args:{url:{type:new GraphQLNonNull(Cn),description:"The URL that specifies the behavior of this scalar."}}}),Xn=new GraphQLDirective({name:"oneOf",description:"Indicates exactly one field must be supplied and this field must not be `null`.",locations:[h.INPUT_OBJECT],args:{}});new GraphQLDirective({name:"experimental_disableErrorPropagation",description:"Disables error propagation.",locations:[h.QUERY,h.MUTATION,h.SUBSCRIPTION]});const Zn=Object.freeze([qn,Jn,Hn,Wn,Xn]);function er(e){return Zn.some(({name:t})=>t===e.name)}function tr(e,r){if(Wt(r)){const t=tr(e,r.ofType);return t?.kind===D?null:t}if(null===e)return{kind:D};if(void 0===e)return null;if(Ht(r)){const t=r.ofType;if(pt(e)){const n=[];for(const r of e){const e=tr(r,t);null!=e&&n.push(e)}return{kind:A,values:n}}return tr(e,t)}if(Yt(r)){if(!t(e))return null;const n=[];for(const t of Object.values(r.getFields())){const r=tr(e[t.name],t.type);r&&n.push({kind:F,name:{kind:m,value:t.name},value:r})}return{kind:G,fields:n}}if(en(r)){const t=r.coerceOutputValue(e);if(null==t)return null;if("boolean"==typeof t)return{kind:x,value:t};if("number"==typeof t&&Number.isFinite(t)){const e=String(t);return nr.test(e)?{kind:k,value:e}:{kind:O,value:e}}if("string"==typeof t)return zt(r)?{kind:$,value:t}:r===Rn&&nr.test(t)?{kind:k,value:t}:{kind:_,value:t};throw new TypeError(`Cannot convert value to AST: ${tt(t)}.`)}n(0,"Unexpected input type: "+tt(r))}const nr=/^-?(?:0|[1-9][0-9]*)$/;function rr(e){const t=e.type,r=e.default;if(r){const e=r.literal??Sn(r.value,t);return null!=e||n(0,"Invalid default value"),e}const i=e.defaultValue;if(void 0!==i){const e=tr(i,t);return null!=e||n(0,"Invalid default value"),e}}const ir=new GraphQLObjectType({name:"__Schema",description:"A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.",fields:()=>({description:{type:Cn,resolve:e=>e.description},types:{description:"A list of all types supported by this server.",type:new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(ar))),resolve:e=>Object.values(e.getTypeMap())},queryType:{description:"The type that query operations will be rooted at.",type:new GraphQLNonNull(ar),resolve:e=>e.getQueryType()},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:ar,resolve:e=>e.getMutationType()},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:ar,resolve:e=>e.getSubscriptionType()},directives:{description:"A list of all directives supported by this server.",type:new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(or))),resolve:e=>e.getDirectives()}})}),or=new GraphQLObjectType({name:"__Directive",description:"A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.\n\nIn some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.",fields:()=>({name:{type:new GraphQLNonNull(Cn),resolve:e=>e.name},description:{type:Cn,resolve:e=>e.description},isRepeatable:{type:new GraphQLNonNull(jn),resolve:e=>e.isRepeatable},locations:{type:new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(sr))),resolve:e=>e.locations},args:{type:new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(ur))),args:{includeDeprecated:{type:new GraphQLNonNull(jn),default:{value:!1}}},resolve:(e,{includeDeprecated:t})=>!0===t?e.args:e.args.filter(e=>null==e.deprecationReason)}})}),sr=new GraphQLEnumType({name:"__DirectiveLocation",description:"A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.",values:{QUERY:{value:h.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:h.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:h.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:h.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:h.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:h.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:h.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:h.VARIABLE_DEFINITION,description:"Location adjacent to an operation variable definition."},FRAGMENT_VARIABLE_DEFINITION:{value:h.FRAGMENT_VARIABLE_DEFINITION,description:"Location adjacent to a fragment variable definition."},SCHEMA:{value:h.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:h.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:h.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:h.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:h.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:h.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:h.UNION,description:"Location adjacent to a union definition."},ENUM:{value:h.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:h.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:h.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:h.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."}}}),ar=new GraphQLObjectType({name:"__Type",description:"The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByURL`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.",fields:()=>({kind:{type:new GraphQLNonNull(dr),resolve:e=>Pt(e)?pr.SCALAR:Bt(e)?pr.OBJECT:Jt(e)?pr.INTERFACE:Kt(e)?pr.UNION:zt(e)?pr.ENUM:Yt(e)?pr.INPUT_OBJECT:Ht(e)?pr.LIST:Wt(e)?pr.NON_NULL:void n(0,`Unexpected type: "${tt(e)}".`)},name:{type:Cn,resolve:e=>"name"in e?e.name:void 0},description:{type:Cn,resolve:e=>"description"in e?e.description:void 0},specifiedByURL:{type:Cn,resolve:e=>"specifiedByURL"in e?e.specifiedByURL:void 0},fields:{type:new GraphQLList(new GraphQLNonNull(cr)),args:{includeDeprecated:{type:new GraphQLNonNull(jn),default:{value:!1}}},resolve(e,{includeDeprecated:t}){if(Bt(e)||Jt(e)){const n=Object.values(e.getFields());return!0===t?n:n.filter(e=>null==e.deprecationReason)}}},interfaces:{type:new GraphQLList(new GraphQLNonNull(ar)),resolve(e){if(Bt(e)||Jt(e))return e.getInterfaces()}},possibleTypes:{type:new GraphQLList(new GraphQLNonNull(ar)),resolve(e,t,n,{schema:r}){if(rn(e))return r.getPossibleTypes(e)}},enumValues:{type:new GraphQLList(new GraphQLNonNull(lr)),args:{includeDeprecated:{type:new GraphQLNonNull(jn),default:{value:!1}}},resolve(e,{includeDeprecated:t}){if(zt(e)){const n=e.getValues();return!0===t?n:n.filter(e=>null==e.deprecationReason)}}},inputFields:{type:new GraphQLList(new GraphQLNonNull(ur)),args:{includeDeprecated:{type:new GraphQLNonNull(jn),default:{value:!1}}},resolve(e,{includeDeprecated:t}){if(Yt(e)){const n=Object.values(e.getFields());return!0===t?n:n.filter(e=>null==e.deprecationReason)}}},ofType:{type:ar,resolve:e=>"ofType"in e?e.ofType:void 0},isOneOf:{type:jn,resolve:e=>{if(Yt(e))return e.isOneOf}}})}),cr=new GraphQLObjectType({name:"__Field",description:"Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.",fields:()=>({name:{type:new GraphQLNonNull(Cn),resolve:e=>e.name},description:{type:Cn,resolve:e=>e.description},args:{type:new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(ur))),args:{includeDeprecated:{type:new GraphQLNonNull(jn),default:{value:!1}}},resolve:(e,{includeDeprecated:t})=>!0===t?e.args:e.args.filter(e=>null==e.deprecationReason)},type:{type:new GraphQLNonNull(ar),resolve:e=>e.type},isDeprecated:{type:new GraphQLNonNull(jn),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:Cn,resolve:e=>e.deprecationReason}})}),ur=new GraphQLObjectType({name:"__InputValue",description:"Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.",fields:()=>({name:{type:new GraphQLNonNull(Cn),resolve:e=>e.name},description:{type:Cn,resolve:e=>e.description},type:{type:new GraphQLNonNull(ar),resolve:e=>e.type},defaultValue:{type:Cn,description:"A GraphQL-formatted string representing the default value for this input value.",resolve(e){const t=rr(e);return t?$t(t):null}},isDeprecated:{type:new GraphQLNonNull(jn),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:Cn,resolve:e=>e.deprecationReason}})}),lr=new GraphQLObjectType({name:"__EnumValue",description:"One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.",fields:()=>({name:{type:new GraphQLNonNull(Cn),resolve:e=>e.name},description:{type:Cn,resolve:e=>e.description},isDeprecated:{type:new GraphQLNonNull(jn),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:Cn,resolve:e=>e.deprecationReason}})}),pr={SCALAR:"SCALAR",OBJECT:"OBJECT",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",INPUT_OBJECT:"INPUT_OBJECT",LIST:"LIST",NON_NULL:"NON_NULL"},dr=new GraphQLEnumType({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:pr.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:pr.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:pr.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:pr.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:pr.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:pr.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:pr.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:pr.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}}),fr=new GraphQLField(void 0,"__schema",{type:new GraphQLNonNull(ir),description:"Access the current type schema of this server.",resolve:(e,t,n,{schema:r})=>r}),hr=new GraphQLField(void 0,"__type",{type:ar,description:"Request the type information of a single type.",args:{name:{type:new GraphQLNonNull(Cn)}},resolve:(e,{name:t},n,{schema:r})=>r.getType(t)}),mr=new GraphQLField(void 0,"__typename",{type:new GraphQLNonNull(Cn),description:"The name of the current Object type at runtime.",resolve:(e,t,n,{parentType:r})=>r.name}),vr=Object.freeze([ir,or,sr,ar,cr,ur,lr,dr]);function yr(e){return vr.some(({name:t})=>e.name===t)}function gr(e){if(!function(e){return rt(e,GraphQLSchema)}(e))throw new Error(`Expected ${tt(e)} to be a GraphQL schema.`);return e}class GraphQLSchema{constructor(e){this.assumeValid=e.assumeValid??!1,this.__validationErrors=!0===e.assumeValid?[]:void 0,this.description=e.description,this.extensions=St(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._queryType=e.query,this._mutationType=e.mutation,this._subscriptionType=e.subscription,this._directives=e.directives??Zn;const t=new Set(e.types);if(null!=e.types)for(const n of e.types)t.delete(n),Tr(n,t);null!=this._queryType&&Tr(this._queryType,t),null!=this._mutationType&&Tr(this._mutationType,t),null!=this._subscriptionType&&Tr(this._subscriptionType,t);for(const e of this._directives)if(Bn(e))for(const n of e.args)Tr(n.type,t);Tr(ir,t),this._typeMap=Object.create(null),this._subTypeMap=new Map,this._implementationsMap=Object.create(null);for(const e of t){if(null==e)continue;const t=e.name;if(void 0!==this._typeMap[t])throw new Error(`Schema must contain uniquely named types but contains multiple types named "${t}".`);if(this._typeMap[t]=e,Jt(e)){for(const t of e.getInterfaces())if(Jt(t)){let n=this._implementationsMap[t.name];void 0===n&&(n=this._implementationsMap[t.name]={objects:[],interfaces:[]}),n.interfaces.push(e)}}else if(Bt(e))for(const t of e.getInterfaces())if(Jt(t)){let n=this._implementationsMap[t.name];void 0===n&&(n=this._implementationsMap[t.name]={objects:[],interfaces:[]}),n.objects.push(e)}}}get[Symbol.toStringTag](){return"GraphQLSchema"}getQueryType(){return this._queryType}getMutationType(){return this._mutationType}getSubscriptionType(){return this._subscriptionType}getRootType(e){switch(e){case f.QUERY:return this.getQueryType();case f.MUTATION:return this.getMutationType();case f.SUBSCRIPTION:return this.getSubscriptionType()}}getTypeMap(){return this._typeMap}getType(e){return this.getTypeMap()[e]}getPossibleTypes(e){return Kt(e)?e.getTypes():this.getImplementations(e).objects}getImplementations(e){return this._implementationsMap[e.name]??{objects:[],interfaces:[]}}isSubType(e,t){let n=this._subTypeMap.get(e);if(void 0===n){if(Kt(e))n=new Set(e.getTypes());else{const t=this.getImplementations(e);n=new Set([...t.objects,...t.interfaces])}this._subTypeMap.set(e,n)}return n.has(t)}getDirectives(){return this._directives}getDirective(e){return this.getDirectives().find(t=>t.name===e)}getField(e,t){switch(t){case fr.name:return this.getQueryType()===e?fr:void 0;case hr.name:return this.getQueryType()===e?hr:void 0;case mr.name:return mr}if("getFields"in e)return e.getFields()[t]}toConfig(){return{description:this.description,query:this.getQueryType(),mutation:this.getMutationType(),subscription:this.getSubscriptionType(),types:Object.values(this.getTypeMap()),directives:this.getDirectives(),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,assumeValid:this.assumeValid}}}function Tr(e,t){const n=un(e);if(!t.has(n))if(t.add(n),Kt(n))for(const e of n.getTypes())Tr(e,t);else if(Bt(n)||Jt(n)){for(const e of n.getInterfaces())Tr(e,t);for(const e of Object.values(n.getFields())){Tr(e.type,t);for(const n of e.args)Tr(n.type,t)}}else if(Yt(n))for(const e of Object.values(n.getFields()))Tr(e.type,t);return t}function br(e){if(gr(e),e.__validationErrors)return e.__validationErrors;const n=new SchemaValidationContext(e);!function(e){const t=e.schema;null==t.getQueryType()&&e.reportError("Query root type must be provided.",t.astNode);const n=new AccumulatorMap;for(const r of Object.values(f)){const i=t.getRootType(r);if(null!=i)if(Bt(i))n.add(i,r);else{const n=ct(r),o=tt(i);e.reportError(r===f.QUERY?`${n} root type must be Object type, it cannot be ${o}.`:`${n} root type must be Object type if provided, it cannot be ${o}.`,Er(t,r)??i.astNode)}}for(const[r,i]of n)if(i.length>1){const n=ut(i);e.reportError(`All root types must be different, "${r}" type is used as ${n} root types.`,i.map(e=>Er(t,e)))}}(n),function(e){for(const t of e.schema.getDirectives())if(Bn(t)){Sr(e,t),0===t.locations.length&&e.reportError(`Directive ${t} must include 1 or more locations.`,t.astNode);for(const n of t.args)Sr(e,n),Xt(n.type)||e.reportError(`The type of ${n} must be Input Type but got: ${tt(n.type)}.`,n.astNode),hn(n)&&null!=n.deprecationReason&&e.reportError(`Required argument ${n} cannot be deprecated.`,[Fr(n.astNode),n.astNode?.type]),Nr(e,n)}else e.reportError(`Expected directive but got: ${tt(t)}.`,t?.astNode)}(n),function(e){const n=function(e){const t=new Set,n=[],r=Object.create(null);return i;function i(o){if(t.has(o))return;t.add(o),r[o.name]=n.length;const s=Object.values(o.getFields());for(const t of s)if(Wt(t.type)&&Yt(t.type.ofType)){const s=t.type.ofType,a=r[s.name];if(n.push({fieldStr:`${o}.${t.name}`,astNode:t.astNode}),void 0===a)i(s);else{const t=n.slice(a),r=t.map(e=>e.fieldStr).join(", ");e.reportError(`Invalid circular reference. The Input Object ${s} references itself ${t.length>1?"via the non-null fields:":"in the non-null field"} ${r}.`,t.map(e=>e.astNode))}n.pop()}r[o.name]=void 0}}(e),r=function(e){const n=Object.create(null),r=[],i=Object.create(null);return function(e){return o(e,Object.create(null))};function o(e,n){if(pt(n))for(const t of n)o(e,t);else if(t(n))for(const t of Object.values(e.getFields())){const r=un(t.type);Yt(r)&&(Object.hasOwn(n,t.name)?o(r,n[t.name]):a(t,r,`${e}.${t.name}`))}}function s(e,t){if(t.kind===A){for(const n of t.values)s(e,n);return}if(t.kind!==G)return;const n=dt(t.fields,e=>e.name.value);for(const t of Object.values(e.getFields())){const r=un(t.type);Yt(r)&&(Object.hasOwn(n,t.name)?s(r,n[t.name].value):a(t,r,`${e}.${t.name}`))}}function a(t,a,c){const u=t.default;if(void 0===u)return;const l=i[c];void 0===l?void 0===n[c]&&(n[c]=!0,i[c]=r.push([c,t.astNode?.defaultValue]),u.literal?s(a,u.literal):o(a,u.value),r.pop(),i[c]=void 0):e.reportError(`Invalid circular reference. The default value of Input Object field ${c} references itself${le).join(", ")}`:""}.`,r.slice(l-1).map(([,e])=>e))}}(e),i=e.schema.getTypeMap();for(const t of Object.values(i))cn(t)?(yr(t)||Sr(e,t),Bt(t)||Jt(t)?(Ir(e,t),Lr(e,t)):Kt(t)?_r(e,t):zt(t)?xr(e,t):Yt(t)&&(Dr(e,t),n(t),r(t))):e.reportError(`Expected GraphQL named type but got: ${tt(t)}.`,t.astNode)}(n);const r=n.getErrors();return e.__validationErrors=r,r}class SchemaValidationContext{constructor(e){this._errors=[],this.schema=e}reportError(e,t){const n=Array.isArray(t)?t.filter(Boolean):t;this._errors.push(new GraphQLError(e,{nodes:n}))}getErrors(){return this._errors}}function Er(e,t){return[e.astNode,...e.extensionASTNodes].flatMap(e=>e?.operationTypes??[]).find(e=>e.operation===t)?.type}function Nr(e,t){const n=t.default;if(n)if(n.literal)xn(n.literal,t.type,(n,r)=>{e.reportError(`${t} has invalid default value${ht(r)}: ${n.message}`,n.nodes)});else{const r=[];if(kn(n.value,t.type,(e,t)=>{r.push([e,t])}),r.length>0)try{const r=wr(n.value,t.type),i=[];if(kn(r,t.type,(e,t)=>{i.push([e,t])}),0===i.length)return void e.reportError(`${t} has invalid default value: ${tt(n.value)}. Did you mean: ${tt(r)}?`,t.astNode?.defaultValue)}catch(e){}for(const[n,i]of r)e.reportError(`${t} has invalid default value${ht(i)}: ${n.message}`,t.astNode?.defaultValue)}}function wr(e,r){if(Wt(r))return wr(e,r.ofType);if(null===e)return null;if(Ht(r))return pt(e)?Array.from(e,e=>wr(e,r.ofType)):[wr(e,r.ofType)];if(Yt(r)){t(e)||n();const i=r.getFields();return ft(e,(e,t)=>(t in i||n(),wr(e,i[t].type)))}return tn(r),r.coerceOutputValue(e)}function Sr(e,t){t.name.startsWith("__")&&e.reportError(`Name "${t.name}" must not begin with "__", which is reserved by GraphQL introspection.`,t.astNode)}function Ir(e,t){const n=Object.values(t.getFields());0===n.length&&e.reportError(`Type ${t} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]);for(const t of n){Sr(e,t),Zt(t.type)||e.reportError(`The type of ${t} must be Output Type but got: ${tt(t.type)}.`,t.astNode?.type);for(const n of t.args)Sr(e,n),Xt(n.type)||e.reportError(`The type of ${n} must be Input Type but got: ${tt(n.type)}.`,n.astNode?.type),hn(n)&&null!=n.deprecationReason&&e.reportError(`Required argument ${n} cannot be deprecated.`,[Fr(n.astNode),n.astNode?.type]),Nr(e,n)}}function Lr(e,t){const n=new Set;for(const r of t.getInterfaces())Jt(r)?t!==r?n.has(r.name)?e.reportError(`Type ${t} can only implement ${r} once.`,Ar(t,r)):(n.add(r.name),Or(e,t,r),kr(e,t,r)):e.reportError(`Type ${t} cannot implement itself because it would create a circular reference.`,Ar(t,r)):e.reportError(`Type ${t} must only implement Interface types, it cannot implement ${tt(r)}.`,Ar(t,r))}function kr(e,t,n){const r=t.getFields();for(const i of Object.values(n.getFields())){const o=r[i.name];if(null!=o){bn(e.schema,o.type,i.type)||e.reportError(`Interface field ${i} expects type ${i.type} but ${o} is type ${o.type}.`,[i.astNode?.type,o.astNode?.type]);for(const t of i.args){const n=o.args.find(e=>e.name===t.name);n?Tn(t.type,n.type)||e.reportError(`Interface field argument ${t} expects type ${t.type} but ${n} is type ${n.type}.`,[t.astNode?.type,n.astNode?.type]):e.reportError(`Interface field argument ${t} expected but ${o} does not provide it.`,[t.astNode,o.astNode])}for(const t of o.args)if(hn(t)){i.args.find(e=>e.name===t.name)||e.reportError(`Argument "${t}" must not be required type "${t.type}" if not provided by the Interface field "${i}".`,[t.astNode,i.astNode])}null!=o.deprecationReason&&null==i.deprecationReason&&e.reportError(`Interface field ${n.name}.${i.name} is not deprecated, so implementation field ${t.name}.${o.name} must not be deprecated.`,[Fr(o.astNode),o.astNode?.type])}else e.reportError(`Interface field ${i} expected but ${t} does not provide it.`,[i.astNode,t.astNode,...t.extensionASTNodes])}}function Or(e,t,n){const r=t.getInterfaces();for(const i of n.getInterfaces())r.includes(i)||e.reportError(i===t?`Type ${t} cannot implement ${n} because it would create a circular reference.`:`Type ${t} must implement ${i} because it is implemented by ${n}.`,[...Ar(n,i),...Ar(t,n)])}function _r(e,t){const n=t.getTypes();0===n.length&&e.reportError(`Union type ${t} must define one or more member types.`,[t.astNode,...t.extensionASTNodes]);const r=new Set;for(const i of n)r.has(i.name)?e.reportError(`Union type ${t} can only include type ${i} once.`,Gr(t,i.name)):(r.add(i.name),Bt(i)||e.reportError(`Union type ${t} can only include Object types, it cannot include ${tt(i)}.`,Gr(t,String(i))))}function xr(e,t){const n=t.getValues();0===n.length&&e.reportError(`Enum type ${t} must define one or more values.`,[t.astNode,...t.extensionASTNodes]);for(const t of n)Sr(e,t)}function Dr(e,t){const n=Object.values(t.getFields());0===n.length&&e.reportError(`Input Object type ${t} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]);for(const r of n)Sr(e,r),Xt(r.type)||e.reportError(`The type of ${r} must be Input Type but got: ${tt(r.type)}.`,r.astNode?.type),gn(r)&&null!=r.deprecationReason&&e.reportError(`Required input field ${r} cannot be deprecated.`,[Fr(r.astNode),r.astNode?.type]),Nr(e,r),t.isOneOf&&$r(t,r,e)}function $r(e,t,n){Wt(t.type)&&n.reportError(`OneOf input field ${e}.${t.name} must be nullable.`,t.astNode?.type),void 0===t.default&&void 0===t.defaultValue||n.reportError(`OneOf input field ${e}.${t.name} cannot have a default value.`,t.astNode)}function Ar(e,t){const{astNode:n,extensionASTNodes:r}=e;return(null!=n?[n,...r]:r).flatMap(e=>e.interfaces??[]).filter(e=>e.name.value===t.name)}function Gr(e,t){const{astNode:n,extensionASTNodes:r}=e;return(null!=n?[n,...r]:r).flatMap(e=>e.types??[]).filter(e=>e.name.value===t)}function Fr(e){return e?.directives?.find(e=>e.name.value===Hn.name)}function Qr(e,t){switch(t.kind){case C:{const n=Qr(e,t.type);return n&&new GraphQLList(n)}case j:{const n=Qr(e,t.type);return n&&new GraphQLNonNull(n)}case V:return e.getType(t.name.value)}}class TypeInfo{constructor(e,t,n){this._schema=e,this._typeStack=[],this._parentTypeStack=[],this._inputTypeStack=[],this._fieldDefStack=[],this._defaultValueStack=[],this._directive=null,this._argument=null,this._enumValue=null,this._fragmentSignaturesByName=n??(()=>null),this._fragmentSignature=null,this._fragmentArgument=null,t&&(Xt(t)&&this._inputTypeStack.push(t),nn(t)&&this._parentTypeStack.push(t),Zt(t)&&this._typeStack.push(t))}get[Symbol.toStringTag](){return"TypeInfo"}getType(){return this._typeStack.at(-1)}getParentType(){return this._parentTypeStack.at(-1)}getInputType(){return this._inputTypeStack.at(-1)}getParentInputType(){return this._inputTypeStack.at(-2)}getFieldDef(){return this._fieldDefStack.at(-1)}getDefaultValue(){return this._defaultValueStack.at(-1)}getDirective(){return this._directive}getArgument(){return this._argument}getFragmentSignature(){return this._fragmentSignature}getFragmentSignatureByName(){return this._fragmentSignaturesByName}getFragmentArgument(){return this._fragmentArgument}getEnumValue(){return this._enumValue}enter(e){const t=this._schema;switch(e.kind){case v:{const t=function(e){const t=new Map;for(const n of e.definitions)if(n.kind===I){const e=new Map;if(n.variableDefinitions)for(const t of n.variableDefinitions)e.set(t.variable.name.value,t);const r={definition:n,variableDefinitions:e};t.set(n.name.value,r)}return t}(e);this._fragmentSignaturesByName=e=>t.get(e);break}case T:{const e=un(this.getType());this._parentTypeStack.push(nn(e)?e:void 0);break}case b:{const n=this.getParentType();let r,i;n&&(r=t.getField(n,e.name.value),r&&(i=r.type)),this._fieldDefStack.push(r),this._typeStack.push(Zt(i)?i:void 0);break}case Q:this._directive=t.getDirective(e.name.value);break;case y:{const n=t.getRootType(e.operation);this._typeStack.push(Bt(n)?n:void 0);break}case w:this._fragmentSignature=this.getFragmentSignatureByName()(e.name.value);break;case S:case I:{const n=e.typeCondition,r=n?Qr(t,n):un(this.getType());this._typeStack.push(Zt(r)?r:void 0);break}case g:{const n=Qr(t,e.type);this._inputTypeStack.push(Xt(n)?n:void 0);break}case E:{let t,n;const r=this.getDirective()??this.getFieldDef();r&&(t=r.args.find(t=>t.name===e.name.value),t&&(n=t.type)),this._argument=t,this._defaultValueStack.push(t?.default??t?.defaultValue??void 0),this._inputTypeStack.push(Xt(n)?n:void 0);break}case N:{const t=this.getFragmentSignature(),n=t?.variableDefinitions.get(e.name.value);let r;this._fragmentArgument=n,n&&(r=Qr(this._schema,n.type)),this._inputTypeStack.push(Xt(r)?r:void 0);break}case A:{const e=an(this.getInputType()),t=Ht(e)?e.ofType:e;this._defaultValueStack.push(void 0),this._inputTypeStack.push(Xt(t)?t:void 0);break}case F:{const t=un(this.getInputType());let n,r;Yt(t)&&(r=t.getFields()[e.name.value],null!=r&&(n=r.type)),this._defaultValueStack.push(r?.default??r?.defaultValue??void 0),this._inputTypeStack.push(Xt(n)?n:void 0);break}case $:{const t=un(this.getInputType());let n;zt(t)&&(n=t.getValue(e.value)),this._enumValue=n;break}}}leave(e){switch(e.kind){case v:this._fragmentSignaturesByName=()=>null;break;case T:this._parentTypeStack.pop();break;case b:this._fieldDefStack.pop(),this._typeStack.pop();break;case Q:this._directive=null;break;case w:this._fragmentSignature=null;break;case y:case S:case I:this._typeStack.pop();break;case g:this._inputTypeStack.pop();break;case E:this._argument=null,this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case N:this._fragmentArgument=null,this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case A:case F:this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case $:this._enumValue=null}}}function Vr(e,t){return{enter(...n){const r=n[0];e.enter(r);const i=Dt(t,r.kind).enter;if(i){const o=i.apply(t,n);return void 0!==o&&(e.leave(r),d(o)&&e.enter(o)),o}},leave(...n){const r=n[0],i=Dt(t,r.kind).leave;let o;return i&&(o=i.apply(t,n)),e.leave(r),o}}}function Cr(e){const t=e.arguments?.find(e=>"if"===e.name.value);if(!t)return!1;if(t.value.kind===x){if(t.value.value)return!1}else if(t.value.kind!==L)return!1;return!0}function jr(e){return e.kind===y||e.kind===I}function Rr(e){return e.kind===U||e.kind===P||e.kind===J||e.kind===K||e.kind===z||e.kind===H}function Mr(e){return e.kind===Z||e.kind===ee||e.kind===te||e.kind===ne||e.kind===re||e.kind===ie}function Ur(e){const t=new Map,n=e.getSchema(),r=n?n.getDirectives():Zn;for(const e of r)t.set(e.name,e.args.map(e=>e.name));const i=e.getDocument().definitions;for(const e of i)if(e.kind===W){const n=e.arguments??[];t.set(e.name.value,n.map(e=>e.name.value))}return{Directive(n){const r=n.name.value,i=t.get(r);if(null!=n.arguments&&null!=i)for(const t of n.arguments){const n=t.name.value;if(!i.includes(n)){const o=Nt(n,i);e.reportError(new GraphQLError(`Unknown argument "${n}" on directive "@${r}".`+(e.hideSuggestions?"":mt(o)),{nodes:t}))}}return!1}}}function Pr(e){const t=new Map,r=e.getSchema(),i=r?r.getDirectives():Zn;for(const e of i)t.set(e.name,e.locations);const o=e.getDocument().definitions;for(const e of o)e.kind===W&&t.set(e.name.value,e.locations.map(e=>e.value));return{Directive(r,i,o,s,a){const c=r.name.value,u=t.get(c);if(null==u)return void e.reportError(new GraphQLError(`Unknown directive "@${c}".`,{nodes:r}));const l=function(e){const t=e.at(-1);switch(null!=t&&"kind"in t||n(),t.kind){case y:return function(e){switch(e){case f.QUERY:return h.QUERY;case f.MUTATION:return h.MUTATION;case f.SUBSCRIPTION:return h.SUBSCRIPTION}}(t.operation);case b:return h.FIELD;case w:return h.FRAGMENT_SPREAD;case S:return h.INLINE_FRAGMENT;case I:return h.FRAGMENT_DEFINITION;case g:{const t=e[e.length-3];return"kind"in t||n(),t.kind===y?h.VARIABLE_DEFINITION:h.FRAGMENT_VARIABLE_DEFINITION}case R:case X:return h.SCHEMA;case U:case Z:return h.SCALAR;case P:case ee:return h.OBJECT;case B:return h.FIELD_DEFINITION;case J:case te:return h.INTERFACE;case K:case ne:return h.UNION;case z:case re:return h.ENUM;case Y:return h.ENUM_VALUE;case H:case ie:return h.INPUT_OBJECT;case q:{const t=e.at(-3);return null!=t&&"kind"in t||n(),t.kind===H?h.INPUT_FIELD_DEFINITION:h.ARGUMENT_DEFINITION}default:n(0,"Unexpected kind: "+tt(t.kind))}}(a);null==l||u.includes(l)||e.reportError(new GraphQLError(`Directive "@${c}" may not be used on ${l}.`,{nodes:r}))}}}function Br(e){const{definitions:t}=e.getDocument(),n=e.getSchema()?.getTypeMap()??{},r=new Set([...Object.keys(n),...t.filter(Rr).map(e=>e.name.value)]);return{NamedType(t,n,i,o,s){const a=t.name.value;if(!r.has(a)){const n=s[2]??i,o=null!=n&&("kind"in(c=n)&&(function(e){return e.kind===R||Rr(e)||e.kind===W}(c)||function(e){return e.kind===X||Mr(e)}(c)));if(o&&qr.has(a))return;const u=e.hideSuggestions?[]:Nt(a,o?[...qr,...r]:[...r]);e.reportError(new GraphQLError(`Unknown type "${a}".`+mt(u),{nodes:t}))}var c}}}const qr=new Set([...Mn,...vr].map(e=>e.name));function Jr(e){const t=new Set,n=[];return{OperationDefinition(n){for(const r of e.getRecursivelyReferencedFragments(n))t.add(r.name.value);return!1},FragmentDefinition:e=>(n.push(e),!1),Document:{leave(){for(const r of n){const n=r.name.value;t.has(n)||e.reportError(new GraphQLError(`Fragment "${n}" is never used.`,{nodes:r}))}}}}}function Kr(e){switch(e.kind){case G:return{...e,fields:(t=e.fields,t.map(e=>({...e,value:Kr(e.value)})).sort((e,t)=>gt(e.name.value,t.name.value)))};case A:return{...e,values:e.values.map(Kr)};case k:case O:case _:case x:case D:case $:case L:return e}var t}function zr(e){return Array.isArray(e)?e.map(([e,t])=>`subfields "${e}" conflict because `+zr(t)).join(" and "):e}function Yr(e,t,n,r,i,o,s,a){if(r.has(s,a.key,o))return;r.add(s,a.key,o);const c=e.getFragment(a.node.name.value);if(!c)return;const[u,l]=oi(e,n,c,a.varMap);if(s!==u){Wr(e,t,n,r,i,o,s,void 0,u,a.varMap);for(const a of l)Yr(e,t,n,r,i,o,s,a)}}function Hr(e,t,n,r,i,o,s,a){if(s.key===a.key)return;if(s.node.name.value===a.node.name.value&&!Zr(s.node.arguments,s.varMap,a.node.arguments,a.varMap))return void e.reportError(new GraphQLError(`Spreads "${s.node.name.value}" conflict because ${s.key} and ${a.key} have different fragment arguments.`,{nodes:[s.node,a.node]}));if(i.has(s.key,a.key,o))return;i.add(s.key,a.key,o);const c=e.getFragment(s.node.name.value),u=e.getFragment(a.node.name.value);if(!c||!u)return;const[l,p]=oi(e,n,c,s.varMap),[d,f]=oi(e,n,u,a.varMap);Wr(e,t,n,r,i,o,l,s.varMap,d,a.varMap);for(const a of f)Hr(e,t,n,r,i,o,s,a);for(const s of p)Hr(e,t,n,r,i,o,s,a)}function Wr(e,t,n,r,i,o,s,a,c,u){for(const[l,p]of s.entries()){const s=c.get(l);if(null!=s)for(const c of p)for(const p of s){const s=Xr(e,n,r,i,o,l,c,a,p,u);s&&t.push(s)}}}function Xr(e,t,n,r,i,o,s,a,c,u){const[l,p,d]=s,[f,h,m]=c,v=i||l!==f&&Bt(l)&&Bt(f);if(!v){const e=p.name.value,t=h.name.value;if(e!==t)return[[o,`"${e}" and "${t}" are different fields`],[p],[h]];if(!Zr(p.arguments,a,h.arguments,u))return[[o,"they have differing arguments"],[p],[h]]}const y=function(e,t,n,r){const i=ni(e),o=ni(n);if(!i&&!o)return;if(i&&o)return Zr(i.arguments,t,o.arguments,r)?"they have overlapping stream directives. See https://github.com/graphql/defer-stream-wg/discussions/100":"they have overlapping stream directives";return"they have overlapping stream directives"}(p.directives??[],a,h.directives??[],u);if(void 0!==y)return[[o,y],[p],[h]];const g=d?.type,T=m?.type;if(g&&T&&ri(g,T))return[[o,`they return conflicting types "${tt(g)}" and "${tt(T)}"`],[p],[h]];const b=p.selectionSet,E=h.selectionSet;if(b&&E){const i=function(e,t,n,r,i,o,s,a,c,u,l){const p=[],[d,f]=ii(e,t,o,s,a),[h,m]=ii(e,t,c,u,l);Wr(e,p,t,n,r,i,d,a,h,l);for(const o of m)Yr(e,p,t,n,r,i,d,o);for(const o of f)Yr(e,p,t,n,r,i,h,o);for(const o of f)for(const s of m)Hr(e,p,t,n,r,i,o,s);return p}(e,t,n,r,v,un(g),b,a,un(T),E,u);return function(e,t,n,r){if(e.length>0)return[[t,e.map(([e])=>e)],[n,...e.map(([,e])=>e).flat()],[r,...e.map(([,,e])=>e).flat()]]}(i,o,p,h)}}function Zr(e,t,n,r){if(void 0===e||0===e.length)return void 0===n||0===n.length;if(void 0===n||0===n.length)return!1;if(e.length!==n.length)return!1;const i=new Map(n.map(({name:e,value:t})=>[e.value,void 0===r?t:ei(t,r)]));return e.every(e=>{let n=e.value;t&&(n=ei(n,t));const r=i.get(e.name.value);return void 0!==r&&ti(n)===ti(r)})}function ei(e,t){switch(e.kind){case L:return t.get(e.name.value)??e;case A:return{...e,values:e.values.map(e=>ei(e,t))};case G:return{...e,fields:e.fields.map(e=>({...e,value:ei(e.value,t)}))};default:return e}}function ti(e){return $t(Kr(e))}function ni(e){return e.find(e=>"stream"===e.name.value)}function ri(e,t){return Ht(e)?!Ht(t)||ri(e.ofType,t.ofType):!!Ht(t)||(Wt(e)?!Wt(t)||ri(e.ofType,t.ofType):!!Wt(t)||!(!en(e)&&!en(t))&&e!==t)}function ii(e,t,n,r,i){const o=t.get(r);if(o)return o;const s=new Map,a=new Map;si(e,n,r,s,a,i);const c=[s,Array.from(a.values())];return t.set(r,c),c}function oi(e,t,n,r){const i=t.get(n.selectionSet);if(i)return i;const o=Qr(e.getSchema(),n.typeCondition);return ii(e,t,o,n.selectionSet,r)}function si(e,t,n,r,i,o){for(const s of n.selections)switch(s.kind){case b:{const e=s.name.value;let n;(Bt(t)||Jt(t))&&(n=t.getFields()[e]);const i=s.alias?s.alias.value:e;let o=r.get(i);null==o&&(o=[],r.set(i,o)),o.push([t,s,n]);break}case w:{const t=ai(e,s,o);i.set(t.key,t);break}case S:{const n=s.typeCondition,a=n?Qr(e.getSchema(),n):t;si(e,a,s.selectionSet,r,i,o);break}}}function ai(e,t,n){let r="";const i=new Map,o=e.getFragmentSignatureByName()(t.name.value),s=new Map;if(t.arguments)for(const e of t.arguments)s.set(e.name.value,e.value);if(o?.variableDefinitions){r+=t.name.value+"(";for(const[e,t]of o.variableDefinitions){const o=s.get(e);o&&(r+=e+": "+$t(Kr(o)));const a=s.get(e);void 0!==a?i.set(e,void 0!==n?ei(a,n):a):t.defaultValue&&i.set(e,t.defaultValue)}r+=")"}return{key:r,node:t,varMap:i.size>0?i:void 0}}class OrderedPairSet{constructor(){this._data=new Map}has(e,t,n){const r=this._data.get(e)?.get(t);return void 0!==r&&(!!n||n===r)}add(e,t,n){const r=this._data.get(e);void 0===r?this._data.set(e,new Map([[t,n]])):r.set(t,n)}}class PairSet{constructor(){this._orderedPairSet=new OrderedPairSet}has(e,t,n){return e[e.name,e])));const i=e.getDocument().definitions;for(const e of i)if(e.kind===W){const n=e.arguments??[];t.set(e.name.value,new Map(n.filter(li).map(e=>[e.name.value,e])))}return{Directive:{leave(n){const r=n.name.value,i=t.get(r);if(null!=i){const t=n.arguments??[],o=new Set(t.map(e=>e.name.value));for(const[t,s]of i.entries())if(!o.has(t)){const i=Ut(s.type)?tt(s.type):$t(s.type);e.reportError(new GraphQLError(`Argument "@${r}(${t}:)" of type "${i}" is required, but it was not provided.`,{nodes:n}))}}}}}}function li(e){return e.type.kind===j&&null==e.defaultValue}function pi(e,n){if(Wt(n)){if(null==e)return;return pi(e,n.ofType)}if(null==e)return null;if(Ht(n)){if(!pt(e)){const t=pi(e,n.ofType);if(void 0===t)return;return[t]}const t=[];for(const r of e){const e=pi(r,n.ofType);if(void 0===e)return;t.push(e)}return t}if(Yt(n)){if(!t(e)||Array.isArray(e))return;const r={},i=n.getFields();if(Object.keys(e).some(e=>!Object.hasOwn(i,e)))return;for(const t of Object.values(i)){const n=e[t.name];if(void 0===n){if(gn(t))return;const e=hi(t);void 0!==e&&(r[t.name]=e)}else{const e=pi(n,t.type);if(void 0===e)return;r[t.name]=e}}if(n.isOneOf){const e=Object.keys(r);if(1!==e.length)return;if(null===r[e[0]])return}return r}const r=tn(n);try{return r.coerceInputValue(e)}catch(e){}}function di(e,t,n,r){if(e.kind===L){const i=fi(e,n,r);if(null==i&&Wt(t))return;return i}if(Wt(t)){if(e.kind===D)return;return di(e,t.ofType,n,r)}if(e.kind===D)return null;if(Ht(t)){if(e.kind!==A){const i=di(e,t.ofType,n,r);if(void 0===i)return;return[i]}const i=[];for(const o of e.values){let e=di(o,t.ofType,n,r);if(void 0===e){if(o.kind!==L||null!=fi(o,n,r)||Wt(t.ofType))return;e=null}i.push(e)}return i}if(Yt(t)){if(e.kind!==G)return;const i={},o=t.getFields();if(e.fields.some(e=>!Object.hasOwn(o,e.name.value)))return;const s=new Map(e.fields.map(e=>[e.name.value,e]));for(const e of Object.values(o)){const t=s.get(e.name);if(!t||t.value.kind===L&&null==fi(t.value,n,r)){if(gn(e))return;const t=hi(e);void 0!==t&&(i[e.name]=t)}else{const o=di(t.value,e.type,n,r);if(void 0===o)return;i[e.name]=o}}if(t.isOneOf){const e=Object.keys(i);if(1!==e.length)return;if(null===i[e[0]])return}return i}const i=tn(t);try{return i.coerceInputLiteral?i.coerceInputLiteral(Ln(e,n,r)):i.parseLiteral(e,n?.coerced)}catch(e){}}function fi(e,t,n){const r=e.name.value;return void 0!==n?.sources[r]?n.coerced[r]:t?.coerced[r]}function hi(e){let t=e._memoizedCoercedDefaultValue;if(void 0!==t)return t;const r=e.default;if(void 0!==r)return t=r.literal?di(r.literal,e.type):pi(r.value,e.type),void 0!==t||n(),e._memoizedCoercedDefaultValue=t,t;const i=e.defaultValue;return void 0!==i&&(e._memoizedCoercedDefaultValue=i),i}function mi(e,t,n,r,i){const o=e.arguments??[],s=new Map(o.map(e=>[e.name.value,e])),a=Object.create(null),c=Object.create(null);for(const[o,u]of Object.entries(t)){a[o]={signature:u};const t=s.get(o);if(void 0!==t){const e=a[o];e.value=t.value,e.fragmentVariableValues=r}yi(c,e,o,u,t,n,r,i)}return{sources:a,coerced:c}}function vi(e,t,n,r,i){const o={},s=t.arguments??[],a=new Map(s.map(e=>[e.name.value,e]));for(const s of e.args){yi(o,t,s.name,s,a.get(s.name),n,r,i)}return o}function yi(e,t,r,i,o,s,a,c){const u=i.type;if(!o){if(hn(i))throw new GraphQLError(`Argument "${qt(i)?i:r}" of required type "${u}" was not provided.`,{nodes:t});const n=hi(i);return void(void 0!==n&&(e[r]=n))}const l=o.value;if(l.kind===L){const t=l.name.value,n=a?.sources[t]?a:s;if(!(null!=n&&Object.hasOwn(n.coerced,t)||hn(i))){const t=hi(i);return void(void 0!==t&&(e[r]=t))}}const p=di(l,u,s,a);void 0===p&&(xn(l,u,(e,t)=>{throw e.message=`Argument "${qt(i)?i:i.name}" has invalid value${ht(t)}: ${e.message}`,e},s,a,c),n(0,"Invalid argument")),e[r]=p}function gi(e,t,n,r,i){const o=t.directives?.find(t=>t.name.value===e.name);if(o)return vi(e,o,n,r,i)}function Ti(e,t,n,r,i,o,s=!1){const a=new AccumulatorMap,c=[],u={schema:e,fragments:t,variableValues:n,runtimeType:r,visitedFragmentNames:new Set,hideSuggestions:o,forbiddenDirectiveInstances:[],forbidSkipAndInclude:s};return bi(u,i,a,c),{groupedFieldSet:a,newDeferUsages:c,forbiddenDirectiveInstances:u.forbiddenDirectiveInstances}}function bi(e,t,n,r,i,o){const{schema:s,fragments:a,variableValues:c,runtimeType:u,visitedFragmentNames:l,hideSuggestions:p}=e;for(const d of t.selections)switch(d.kind){case b:if(!Ni(e,d,c,o))continue;n.add(Si(d),{node:d,deferUsage:i,fragmentVariableValues:o});break;case S:{if(!Ni(e,d,c,o)||!wi(s,d,u))continue;const t=Ei(c,o,d,i);t?(r.push(t),bi(e,d.selectionSet,n,r,t,o)):bi(e,d.selectionSet,n,r,i,o);break}case w:{const t=d.name.value;if(l.has(t)||!Ni(e,d,c,o))continue;const f=a[t];if(null==f||!wi(s,f.definition,u))continue;const h=Ei(c,o,d,i),m=f.variableSignatures;let v;m&&(v=mi(d,m,c,o,p)),h?(r.push(h),bi(e,f.definition.selectionSet,n,r,h,v)):(l.add(t),bi(e,f.definition.selectionSet,n,r,i,v));break}}}function Ei(e,t,n,r){const i=gi(Kn,n,e,t);if(i&&!1!==i.if)return{label:"string"==typeof i.label?i.label:void 0,parentDeferUsage:r}}function Ni(e,t,n,r){const i=t.directives?.find(e=>e.name.value===Jn.name);if(i&&e.forbidSkipAndInclude)return e.forbiddenDirectiveInstances.push(i),!1;const o=i?vi(Jn,i,n,r,e.hideSuggestions):void 0;if(!0===o?.if)return!1;const s=t.directives?.find(e=>e.name.value===qn.name);if(s&&e.forbidSkipAndInclude)return e.forbiddenDirectiveInstances.push(s),!1;const a=s?vi(qn,s,n,r,e.hideSuggestions):void 0;return!1!==a?.if}function wi(e,t,n){const r=t.typeCondition;if(!r)return!0;const i=Qr(e,r);return i===n||!!rn(i)&&e.isSubType(i,n)}function Si(e){return e.alias?e.alias.value:e.name.value}function Ii(e){return e.map(e=>e.node)}function Li(e,t){const n=new AccumulatorMap;for(const r of e)n.add(t(r),r);return n}function ki(e){return{Field:t,Directive:t};function t(t){const n=Li(t.arguments??[],e=>e.name.value);for(const[t,r]of n)r.length>1&&e.reportError(new GraphQLError(`There can be only one argument named "${t}".`,{nodes:r.map(e=>e.name)}))}}function Oi(e){const t=new Map,n=e.getSchema(),r=n?n.getDirectives():Zn;for(const e of r)t.set(e.name,!e.isRepeatable);const i=e.getDocument().definitions;for(const e of i)e.kind===W&&t.set(e.name.value,!e.repeatable);const o=new Map,s=new Map;return{enter(n){if(!("directives"in n)||!n.directives)return;let r;if(n.kind===R||n.kind===X)r=o;else if(Rr(n)||Mr(n)){const e=n.name.value;r=s.get(e),void 0===r&&(r=new Map,s.set(e,r))}else r=new Map;for(const i of n.directives){const n=i.name.value;if(!0===t.get(n)){const t=r.get(n);null!=t?e.reportError(new GraphQLError(`The directive "@${n}" can only be used once at this location.`,{nodes:[t,i]})):r.set(n,i)}}}}}function _i(e,t){return!!(Bt(e)||Jt(e)||Yt(e))&&null!=e.getFields()[t]}function xi(e){const t=[];let r=new Map;return{ObjectValue:{enter(){t.push(r),r=new Map},leave(){const e=t.pop();null!=e||n(),r=e}},ObjectField(t){const n=t.name.value,i=r.get(n);null!=i?e.reportError(new GraphQLError(`There can be only one input field named "${n}".`,{nodes:[i,t.name]})):r.set(n,t.name)}}}function Di(e,t,n){return n&&xn(t,n,t=>{e.reportError(t)},void 0,void 0,e.hideSuggestions),!1}function $i(e,t,n,r,i){if(Wt(r)&&!Wt(t)){if(!(null!=n&&n.kind!==D)&&!(void 0!==i))return!1;return bn(e,t,r.ofType)}return bn(e,t,r)}const Ai=Object.freeze([function(e){function t(n,r=Object.create(null),i=0){if(n.kind===w){const o=n.name.value;if(!0===r[o])return!1;const s=e.getFragment(o);if(!s)return!1;try{return r[o]=!0,t(s,r,i)}finally{r[o]=void 0}}if(n.kind===b&&("fields"===n.name.value||"interfaces"===n.name.value||"possibleTypes"===n.name.value||"inputFields"===n.name.value)&&++i>=3)return!0;if("selectionSet"in n&&n.selectionSet)for(const e of n.selectionSet.selections)if(t(e,r,i))return!0;return!1}return{Field(n){if(("__schema"===n.name.value||"__type"===n.name.value)&&t(n))return e.reportError(new GraphQLError("Maximum introspection depth exceeded",{nodes:[n]})),!1}}}]),Gi=Object.freeze([function(e){return{Document(t){for(const n of t.definitions)if(!jr(n)){const t=n.kind===R||n.kind===X?"schema":'"'+n.name.value+'"';e.reportError(new GraphQLError(`The ${t} definition is not executable.`,{nodes:n}))}return!1}}},function(e){const t=e.getSchema();return{OperationDefinition(n){const r=n.operation;t.getRootType(r)||e.reportError(new GraphQLError(`The ${r} operation is not supported by the schema.`,{nodes:n}))}}},function(e){const t=new Map;return{OperationDefinition(n){const r=n.name;if(null!=r){const n=t.get(r.value);null!=n?e.reportError(new GraphQLError(`There can be only one operation named "${r.value}".`,{nodes:[n,r]})):t.set(r.value,r)}return!1},FragmentDefinition:()=>!1}},function(e){let t=0;return{Document(e){t=e.definitions.filter(e=>e.kind===y).length},OperationDefinition(n){!n.name&&t>1&&e.reportError(new GraphQLError("This anonymous operation must be the only defined operation.",{nodes:n}))}}},function(e){return{OperationDefinition(t){if("subscription"===t.operation){const n=e.getSchema(),r=n.getSubscriptionType();if(r){const i=t.name?t.name.value:null,o=Object.create(null),s=e.getDocument(),a=Object.create(null);for(const e of s.definitions)e.kind===I&&(a[e.name.value]={definition:e});const{groupedFieldSet:c,forbiddenDirectiveInstances:u}=Ti(n,a,o,r,t.selectionSet,e.hideSuggestions,!0);if(u.length>0)return void e.reportError(new GraphQLError(null!=i?`Subscription "${i}" must not use \`@skip\` or \`@include\` directives in the top level selection.`:"Anonymous Subscription must not use `@skip` or `@include` directives in the top level selection.",{nodes:u}));if(c.size>1){const t=[...c.values()].slice(1).flatMap(e=>Ii(e));e.reportError(new GraphQLError(null!=i?`Subscription "${i}" must select only one top level field.`:"Anonymous Subscription must select only one top level field.",{nodes:t}))}for(const t of c.values()){Ii(t)[0].name.value.startsWith("__")&&e.reportError(new GraphQLError(null!=i?`Subscription "${i}" must not select an introspection top level field.`:"Anonymous Subscription must not select an introspection top level field.",{nodes:Ii(t)}))}}}}}},Br,function(e){return{InlineFragment(t){const n=t.typeCondition;if(n){const t=Qr(e.getSchema(),n);if(t&&!nn(t)){const t=$t(n);e.reportError(new GraphQLError(`Fragment cannot condition on non composite type "${t}".`,{nodes:n}))}}},FragmentDefinition(t){const n=Qr(e.getSchema(),t.typeCondition);if(n&&!nn(n)){const n=$t(t.typeCondition);e.reportError(new GraphQLError(`Fragment "${t.name.value}" cannot condition on non composite type "${n}".`,{nodes:t.typeCondition}))}}}},function(e){return{VariableDefinition(t){const n=Qr(e.getSchema(),t.type);if(void 0!==n&&!Xt(n)){const n=t.variable.name.value,r=$t(t.type);e.reportError(new GraphQLError(`Variable "$${n}" cannot be non-input type "${r}".`,{nodes:t.type}))}}}},function(e){return{Field(t){const n=e.getType(),r=t.selectionSet;if(n)if(en(un(n))){if(r){const i=t.name.value,o=tt(n);e.reportError(new GraphQLError(`Field "${i}" must not have a selection since type "${o}" has no subfields.`,{nodes:r}))}}else if(r){if(0===r.selections.length){const r=t.name.value,i=tt(n);e.reportError(new GraphQLError(`Field "${r}" of type "${i}" must have at least one field selected.`,{nodes:t}))}}else{const r=t.name.value,i=tt(n);e.reportError(new GraphQLError(`Field "${r}" of type "${i}" must have a selection of subfields. Did you mean "${r} { ... }"?`,{nodes:t}))}}}},function(e){return{Field(t){const n=e.getParentType();if(n){if(!e.getFieldDef()){const r=e.getSchema(),i=t.name.value;let o=mt("to use an inline fragment on",e.hideSuggestions?[]:function(e,t,n){if(!rn(t))return[];const r=new Set,i=Object.create(null);for(const o of e.getPossibleTypes(t))if(null!=o.getFields()[n]){r.add(o),i[o.name]=1;for(const e of o.getInterfaces())null!=e.getFields()[n]&&(r.add(e),i[e.name]=(i[e.name]??0)+1)}return[...r].sort((t,n)=>{const r=i[n.name]-i[t.name];return 0!==r?r:Jt(t)&&e.isSubType(t,n)?-1:Jt(n)&&e.isSubType(n,t)?1:gt(t.name,n.name)}).map(e=>e.name)}(r,n,i));""===o&&(o=mt(e.hideSuggestions?[]:function(e,t){if(Bt(e)||Jt(e)){return Nt(t,Object.keys(e.getFields()))}return[]}(n,i))),e.reportError(new GraphQLError(`Cannot query field "${i}" on type "${n}".`+o,{nodes:t}))}}}}},function(e){const t=new Map;return{OperationDefinition:()=>!1,FragmentDefinition(n){const r=n.name.value,i=t.get(r);return null!=i?e.reportError(new GraphQLError(`There can be only one fragment named "${r}".`,{nodes:[i,n.name]})):t.set(r,n.name),!1}}},function(e){return{FragmentSpread(t){const n=t.name.value;e.getFragment(n)||e.reportError(new GraphQLError(`Unknown fragment "${n}".`,{nodes:t.name}))}}},Jr,function(e){return{InlineFragment(t){const n=e.getType(),r=e.getParentType();if(nn(n)&&nn(r)&&!En(e.getSchema(),n,r)){const i=tt(r),o=tt(n);e.reportError(new GraphQLError(`Fragment cannot be spread here as objects of type "${i}" can never be of type "${o}".`,{nodes:t}))}},FragmentSpread(t){const n=t.name.value,r=function(e,t){const n=e.getFragment(t);if(n){const t=Qr(e.getSchema(),n.typeCondition);if(nn(t))return t}}(e,n),i=e.getParentType();if(r&&i&&!En(e.getSchema(),r,i)){const o=tt(i),s=tt(r);e.reportError(new GraphQLError(`Fragment "${n}" cannot be spread here as objects of type "${o}" can never be of type "${s}".`,{nodes:t}))}}}},function(e){const t=new Set,n=[],r=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition:e=>(i(e),!1)};function i(o){if(t.has(o.name.value))return;const s=o.name.value;t.add(s);const a=e.getFragmentSpreads(o.selectionSet);if(0!==a.length){r[s]=n.length;for(const t of a){const o=t.name.value,s=r[o];if(n.push(t),void 0===s){const t=e.getFragment(o);t&&i(t)}else{const t=n.slice(s),r=t.slice(0,-1).map(e=>'"'+e.name.value+'"').join(", ");e.reportError(new GraphQLError(`Cannot spread fragment "${o}" within itself`+(""!==r?` via ${r}.`:"."),{nodes:t}))}n.pop()}r[s]=void 0}}},function(e){return{OperationDefinition(t){const n=Li(t.variableDefinitions??[],e=>e.variable.name.value);for(const[t,r]of n)r.length>1&&e.reportError(new GraphQLError(`There can be only one variable named "$${t}".`,{nodes:r.map(e=>e.variable.name)}))}}},function(e){return{OperationDefinition(t){const n=new Set(t.variableDefinitions?.map(e=>e.variable.name.value)),r=e.getRecursiveVariableUsages(t);for(const{node:i,fragmentVariableDefinition:o}of r){if(o)continue;const r=i.name.value;n.has(r)||e.reportError(new GraphQLError(t.name?`Variable "$${r}" is not defined by operation "${t.name.value}".`:`Variable "$${r}" is not defined.`,{nodes:[i,t]}))}}}},function(e){return{FragmentDefinition(t){const n=e.getVariableUsages(t),r=new Set(n.map(({node:e})=>e.name.value)),i=t.variableDefinitions??[];for(const n of i){const i=n.variable.name.value;r.has(i)||e.reportError(new GraphQLError(`Variable "$${i}" is never used in fragment "${t.name.value}".`,{nodes:n}))}},OperationDefinition(t){const n=e.getRecursiveVariableUsages(t),r=new Set;for(const{node:e,fragmentVariableDefinition:t}of n){const n=e.name.value;t||r.add(n)}const i=t.variableDefinitions??[];for(const n of i){const i=n.variable.name.value;r.has(i)||e.reportError(new GraphQLError(t.name?`Variable "$${i}" is never used in operation "${t.name.value}".`:`Variable "$${i}" is never used.`,{nodes:n}))}}}},Pr,Oi,function(e){return{Directive(t){const n=e.getSchema().getMutationType(),r=e.getSchema().getSubscriptionType(),i=e.getParentType();i&&t.name.value===Kn.name&&(n&&i===n&&e.reportError(new GraphQLError(`Defer directive cannot be used on root mutation type "${i}".`,{nodes:t})),r&&i===r&&e.reportError(new GraphQLError(`Defer directive cannot be used on root subscription type "${i}".`,{nodes:t}))),i&&t.name.value===zn.name&&(n&&i===n&&e.reportError(new GraphQLError(`Stream directive cannot be used on root mutation type "${i}".`,{nodes:t})),r&&i===r&&e.reportError(new GraphQLError(`Stream directive cannot be used on root subscription type "${i}".`,{nodes:t})))}}},function(e){const t=new Set;return{OperationDefinition(n){if(n.operation===f.SUBSCRIPTION)for(const r of e.getRecursivelyReferencedFragments(n))t.add(r.name.value)},Directive(n,r,i,o,s){const a=s[2];"kind"in a&&(a.kind===I&&t.has(a.name.value)||a.kind===y&&a.operation===f.SUBSCRIPTION)&&(n.name.value===Kn.name?Cr(n)||e.reportError(new GraphQLError("Defer directive not supported on subscription operations. Disable `@defer` by setting the `if` argument to `false`.",{nodes:n})):n.name.value===zn.name&&(Cr(n)||e.reportError(new GraphQLError("Stream directive not supported on subscription operations. Disable `@stream` by setting the `if` argument to `false`.",{nodes:n}))))}}},function(e){const t=new Map;return{Directive(n){if(n.name.value===Kn.name||n.name.value===zn.name){const r=n.arguments?.find(e=>"label"===e.name.value),i=r?.value;if(!i)return;if(i.kind!==_)return void e.reportError(new GraphQLError(`Argument "@${n.name.value}(label:)" must be a static string.`,{nodes:n}));const o=t.get(i.value);null!=o?e.reportError(new GraphQLError('Value for arguments "defer(label:)" and "stream(label:)" must be unique across all Defer/Stream directive usages.',{nodes:[o,n]})):t.set(i.value,n)}}}},function(e){return{Directive(t){const n=e.getFieldDef(),r=e.getParentType();n&&r&&t.name.value===zn.name&&!(Ht(n.type)||on(n.type)&&Ht(n.type.ofType))&&e.reportError(new GraphQLError(`Directive "@stream" cannot be used on non-list field "${r}.${n.name}".`,{nodes:t}))}}},function(e){return{...Ur(e),FragmentArgument(t){const n=e.getFragmentSignature();if(n){if(!n.variableDefinitions.get(t.name.value)){const r=t.name.value,i=e.hideSuggestions?[]:Nt(r,Array.from(n.variableDefinitions.values()).map(e=>e.variable.name.value));e.reportError(new GraphQLError(`Unknown argument "${r}" on fragment "${n.definition.name.value}".`+mt(i),{nodes:t}))}}},Argument(t){const n=e.getArgument(),r=e.getFieldDef();if(!n&&r){const n=t.name.value,i=e.hideSuggestions?[]:Nt(n,r.args.map(e=>e.name));e.reportError(new GraphQLError(`Unknown argument "${n}" on field "${r}".`+mt(i),{nodes:t}))}}}},ki,function(e){return{NullValue:t=>Di(e,t,e.getInputType()),ListValue:t=>Di(e,t,e.getParentInputType()),ObjectValue:t=>Di(e,t,e.getInputType()),EnumValue:t=>Di(e,t,e.getInputType()),IntValue:t=>Di(e,t,e.getInputType()),FloatValue:t=>Di(e,t,e.getInputType()),StringValue:t=>Di(e,t,e.getInputType()),BooleanValue:t=>Di(e,t,e.getInputType())}},function(e){return{...ui(e),Field:{leave(t){const n=e.getFieldDef();if(!n)return!1;const r=new Set(t.arguments?.map(e=>e.name.value));for(const i of n.args)!r.has(i.name)&&hn(i)&&e.reportError(new GraphQLError(`Argument "${i}" of type "${i.type}" is required, but it was not provided.`,{nodes:t}))}},FragmentSpread:{leave(t){const n=e.getFragmentSignature();if(!n)return!1;const r=new Set(t.arguments?.map(e=>e.name.value));for(const[i,o]of n.variableDefinitions)if(!r.has(i)&&li(o)){const n=tt(Qr(e.getSchema(),o.type));e.reportError(new GraphQLError(`Fragment "${t.name.value}" argument "${i}" of type "${n}" is required, but it was not provided.`,{nodes:t}))}}}}},function(e){let t;return{OperationDefinition:{enter(){t=new Map},leave(n){const r=e.getRecursiveVariableUsages(n);for(const{node:n,type:i,parentType:o,defaultValue:s,fragmentVariableDefinition:a}of r){const r=n.name.value;let c=a;if(c||(c=t.get(r)),c&&i){const t=e.getSchema(),a=Qr(t,c.type);a&&!$i(t,a,c.defaultValue,i,s)&&e.reportError(new GraphQLError(`Variable "$${r}" of type "${a}" used in position expecting type "${i}".`,{nodes:[c,n]})),Yt(o)&&o.isOneOf&&sn(a)&&e.reportError(new GraphQLError(`Variable "$${r}" is of type "${a}" but must be non-nullable to be used for OneOf Input Object "${o}".`,{nodes:[c,n]}))}}}},VariableDefinition(e){t.set(e.variable.name.value,e)}}},function(e){const t=new OrderedPairSet,n=new PairSet,r=new Map;return{SelectionSet(i){const o=function(e,t,n,r,i,o){const s=[],[a,c]=ii(e,t,i,o,void 0);if(function(e,t,n,r,i,o){for(const[s,a]of o.entries())if(a.length>1)for(let o=0;o0&&e.reportError(new GraphQLError("Must provide only one schema definition.",{nodes:t})),++r)}}},function(e){const t=e.getSchema(),n=new Map,r=t?{query:t.getQueryType(),mutation:t.getMutationType(),subscription:t.getSubscriptionType()}:{};return{SchemaDefinition:i,SchemaExtension:i};function i(t){const i=t.operationTypes??[];for(const t of i){const i=t.operation,o=n.get(i);r[i]?e.reportError(new GraphQLError(`Type for ${i} already defined in the schema. It cannot be redefined.`,{nodes:t})):o?e.reportError(new GraphQLError(`There can be only one ${i} type in schema.`,{nodes:[o,t]})):n.set(i,t)}return!1}},function(e){const t=new Map,n=e.getSchema();return{ScalarTypeDefinition:r,ObjectTypeDefinition:r,InterfaceTypeDefinition:r,UnionTypeDefinition:r,EnumTypeDefinition:r,InputObjectTypeDefinition:r};function r(r){const i=r.name.value;if(n?.getType(i))return void e.reportError(new GraphQLError(`Type "${i}" already exists in the schema. It cannot also be defined in this type definition.`,{nodes:r.name}));const o=t.get(i);return null!=o?e.reportError(new GraphQLError(`There can be only one type named "${i}".`,{nodes:[o,r.name]})):t.set(i,r.name),!1}},function(e){const t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),r=new Map;return{EnumTypeDefinition:i,EnumTypeExtension:i};function i(t){const i=t.name.value;let o=r.get(i);null==o&&(o=new Map,r.set(i,o));const s=t.values??[];for(const t of s){const r=t.name.value,s=n[i];if(zt(s)&&s.getValue(r)){e.reportError(new GraphQLError(`Enum value "${i}.${r}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:t.name}));continue}const a=o.get(r);null!=a?e.reportError(new GraphQLError(`Enum value "${i}.${r}" can only be defined once.`,{nodes:[a,t.name]})):o.set(r,t.name)}return!1}},function(e){const t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),r=new Map;return{InputObjectTypeDefinition:i,InputObjectTypeExtension:i,InterfaceTypeDefinition:i,InterfaceTypeExtension:i,ObjectTypeDefinition:i,ObjectTypeExtension:i};function i(t){const i=t.name.value;let o=r.get(i);null==o&&(o=new Map,r.set(i,o));const s=t.fields??[];for(const t of s){const r=t.name.value;if(_i(n[i],r)){e.reportError(new GraphQLError(`Field "${i}.${r}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:t.name}));continue}const s=o.get(r);null!=s?e.reportError(new GraphQLError(`Field "${i}.${r}" can only be defined once.`,{nodes:[s,t.name]})):o.set(r,t.name)}return!1}},function(e){return{DirectiveDefinition(e){const t=e.arguments??[];return n(`@${e.name.value}`,t)},InterfaceTypeDefinition:t,InterfaceTypeExtension:t,ObjectTypeDefinition:t,ObjectTypeExtension:t};function t(e){const t=e.name.value,r=e.fields??[];for(const e of r){n(`${t}.${e.name.value}`,e.arguments??[])}return!1}function n(t,n){const r=Li(n,e=>e.name.value);for(const[n,i]of r)i.length>1&&e.reportError(new GraphQLError(`Argument "${t}(${n}:)" can only be defined once.`,{nodes:i.map(e=>e.name)}));return!1}},function(e){const t=new Map,n=e.getSchema();return{DirectiveDefinition(r){const i=r.name.value;if(n?.getDirective(i))return void e.reportError(new GraphQLError(`Directive "@${i}" already exists in the schema. It cannot be redefined.`,{nodes:r.name}));const o=t.get(i);return o?e.reportError(new GraphQLError(`There can be only one directive named "@${i}".`,{nodes:[o,r.name]})):t.set(i,r.name),!1}}},Br,Pr,Oi,function(e){const t=e.getSchema(),r=new Map;for(const t of e.getDocument().definitions)Rr(t)&&r.set(t.name.value,t);return{ScalarTypeExtension:i,ObjectTypeExtension:i,InterfaceTypeExtension:i,UnionTypeExtension:i,EnumTypeExtension:i,InputObjectTypeExtension:i};function i(i){const o=i.name.value,s=r.get(o),a=t?.getType(o);let c;if(null!=s?c=ci[s.kind]:a&&(c=function(e){if(Pt(e))return Z;if(Bt(e))return ee;if(Jt(e))return te;if(Kt(e))return ne;if(zt(e))return re;if(Yt(e))return ie;n(0,"Unexpected type: "+tt(e))}(a)),null!=c){if(c!==i.kind){const t=function(e){switch(e){case Z:return"scalar";case ee:return"object";case te:return"interface";case ne:return"union";case re:return"enum";case ie:return"input object";default:n(0,"Unexpected kind: "+tt(e))}}(i.kind);e.reportError(new GraphQLError(`Cannot extend non-${t} type "${o}".`,{nodes:s?[s,i]:i}))}}else{const n=[...r.keys(),...Object.keys(t?.getTypeMap()??{})];e.reportError(new GraphQLError(`Cannot extend type "${o}" because it is not defined.`+mt(Nt(o,n)),{nodes:i.name}))}}},Ur,ki,xi,ui]);class ASTValidationContext{constructor(e,t){this._ast=e,this._fragments=void 0,this._fragmentSpreads=new Map,this._recursivelyReferencedFragments=new Map,this._onError=t}get[Symbol.toStringTag](){return"ASTValidationContext"}reportError(e){this._onError(e)}getDocument(){return this._ast}getFragment(e){let t;if(this._fragments)t=this._fragments;else{t=Object.create(null);for(const e of this.getDocument().definitions)e.kind===I&&(t[e.name.value]=e);this._fragments=t}return t[e]}getFragmentSpreads(e){let t=this._fragmentSpreads.get(e);if(!t){t=[];const n=[e];let r;for(;r=n.pop();)for(const e of r.selections)e.kind===w?t.push(e):e.selectionSet&&n.push(e.selectionSet);this._fragmentSpreads.set(e,t)}return t}getRecursivelyReferencedFragments(e){let t=this._recursivelyReferencedFragments.get(e);if(!t){t=[];const n=new Set,r=[e.selectionSet];let i;for(;i=r.pop();)for(const e of this.getFragmentSpreads(i)){const i=e.name.value;if(!n.has(i)){n.add(i);const e=this.getFragment(i);e&&(t.push(e),r.push(e.selectionSet))}}this._recursivelyReferencedFragments.set(e,t)}return t}}class SDLValidationContext extends ASTValidationContext{constructor(e,t,n){super(e,n),this._schema=t}get hideSuggestions(){return!1}get[Symbol.toStringTag](){return"SDLValidationContext"}getSchema(){return this._schema}}class ValidationContext extends ASTValidationContext{constructor(e,t,n,r,i){super(t,r),this._schema=e,this._typeInfo=n,this._variableUsages=new Map,this._recursiveVariableUsages=new Map,this._hideSuggestions=i??!1}get[Symbol.toStringTag](){return"ValidationContext"}get hideSuggestions(){return this._hideSuggestions}getSchema(){return this._schema}getVariableUsages(e){let t=this._variableUsages.get(e);if(!t){const n=[],r=new TypeInfo(this._schema,void 0,this._typeInfo.getFragmentSignatureByName()),i=e.kind===I?e:void 0;_t(e,Vr(r,{VariableDefinition:()=>!1,Variable(e){let t;if(i){const o=r.getFragmentSignatureByName()(i.name.value);t=o?.variableDefinitions.get(e.name.value),n.push({node:e,type:r.getInputType(),parentType:r.getParentInputType(),defaultValue:void 0,fragmentVariableDefinition:t})}else n.push({node:e,type:r.getInputType(),parentType:r.getParentInputType(),defaultValue:r.getDefaultValue(),fragmentVariableDefinition:void 0})}})),t=n,this._variableUsages.set(e,t)}return t}getRecursiveVariableUsages(e){let t=this._recursiveVariableUsages.get(e);if(!t){t=this.getVariableUsages(e);for(const n of this.getRecursivelyReferencedFragments(e))t=t.concat(this.getVariableUsages(n));this._recursiveVariableUsages.set(e,t)}return t}getType(){return this._typeInfo.getType()}getParentType(){return this._typeInfo.getParentType()}getInputType(){return this._typeInfo.getInputType()}getParentInputType(){return this._typeInfo.getParentInputType()}getFieldDef(){return this._typeInfo.getFieldDef()}getDirective(){return this._typeInfo.getDirective()}getArgument(){return this._typeInfo.getArgument()}getFragmentSignature(){return this._typeInfo.getFragmentSignature()}getFragmentSignatureByName(){return this._typeInfo.getFragmentSignatureByName()}getEnumValue(){return this._typeInfo.getEnumValue()}}function Qi(e,t,n=Gi,r){!function(e){const t=br(e);if(0!==t.length)throw new Error(t.map(e=>e.message).join("\n\n"))}(e);const i=new GraphQLError("Too many validation errors, error limit reached. Validation aborted."),o=[],s=new TypeInfo(e),a=new ValidationContext(e,t,s,e=>{if(o.length>=100)throw i;o.push(e)},!1),c=xt(n.map(e=>e(a)));try{_t(t,Vr(s,c))}catch(e){if(e!==i)throw e;o.push(i)}return o}function Vi(e,n){t(e)&&t(e.__schema)||et(0,`Invalid or incomplete introspection result. Ensure that you are passing "data" property of introspection response and no "errors" was returned alongside: ${tt(e)}.`);const r=e.__schema,i=new Map(r.types.map(e=>[e.name,f(e)]));for(const e of[...Mn,...vr])i.has(e.name)&&i.set(e.name,e);const o=null!=r.queryType?p(r.queryType):null,s=null!=r.mutationType?p(r.mutationType):null,a=null!=r.subscriptionType?p(r.subscriptionType):null,c=null!=r.directives?r.directives.map(function(e){if(null==e.args){const t=tt(e);throw new Error(`Introspection result missing directive args: ${t}.`)}if(null==e.locations){const t=tt(e);throw new Error(`Introspection result missing directive locations: ${t}.`)}return new GraphQLDirective({name:e.name,description:e.description,isRepeatable:e.isRepeatable,locations:e.locations.slice(),args:y(e.args)})}):[];return new GraphQLSchema({description:r.description,query:o,mutation:s,subscription:a,types:[...i.values()],directives:c,assumeValid:n?.assumeValid});function u(e){if(e.kind===pr.LIST){const t=e.ofType;if(null==t)throw new Error("Decorated type deeper than introspection query.");return new GraphQLList(u(t))}if(e.kind===pr.NON_NULL){const t=e.ofType;if(null==t)throw new Error("Decorated type deeper than introspection query.");const n=u(t);return new GraphQLNonNull(function(e){if(!sn(e))throw new Error(`Expected ${tt(e)} to be a GraphQL nullable type.`);return e}(n))}return l(e)}function l(e){const t=e.name;if(!t)throw new Error(`Unknown type reference: ${tt(e)}.`);const n=i.get(t);if(null==n)throw new Error(`Invalid or incomplete schema, unknown type: ${t}. Ensure that a full introspection query is used in order to build a client schema.`);return n}function p(e){return function(e){if(!Bt(e))throw new Error(`Expected ${tt(e)} to be a GraphQL Object type.`);return e}(l(e))}function d(e){return function(e){if(!Jt(e))throw new Error(`Expected ${tt(e)} to be a GraphQL Interface type.`);return e}(l(e))}function f(e){switch(e.kind){case pr.SCALAR:return new GraphQLScalarType({name:(r=e).name,description:r.description,specifiedByURL:r.specifiedByURL});case pr.OBJECT:return new GraphQLObjectType({name:(n=e).name,description:n.description,interfaces:()=>h(n),fields:()=>m(n)});case pr.INTERFACE:return new GraphQLInterfaceType({name:(t=e).name,description:t.description,interfaces:()=>h(t),fields:()=>m(t)});case pr.UNION:return function(e){if(null==e.possibleTypes){const t=tt(e);throw new Error(`Introspection result missing possibleTypes: ${t}.`)}return new GraphQLUnionType({name:e.name,description:e.description,types:()=>e.possibleTypes.map(p)})}(e);case pr.ENUM:return function(e){if(null==e.enumValues){const t=tt(e);throw new Error(`Introspection result missing enumValues: ${t}.`)}return new GraphQLEnumType({name:e.name,description:e.description,values:yt(e.enumValues,e=>e.name,e=>({description:e.description,deprecationReason:e.deprecationReason}))})}(e);case pr.INPUT_OBJECT:return function(e){if(null==e.inputFields){const t=tt(e);throw new Error(`Introspection result missing inputFields: ${t}.`)}return new GraphQLInputObjectType({name:e.name,description:e.description,fields:()=>y(e.inputFields),isOneOf:e.isOneOf})}(e)}var t,n,r;throw new Error(`Invalid or incomplete introspection result. Ensure that a full introspection query is used in order to build a client schema: ${tt(e)}.`)}function h(e){if(null===e.interfaces&&e.kind===pr.INTERFACE)return[];if(null==e.interfaces){const t=tt(e);throw new Error(`Introspection result missing interfaces: ${t}.`)}return e.interfaces.map(d)}function m(e){if(null==e.fields)throw new Error(`Introspection result missing fields: ${tt(e)}.`);return yt(e.fields,e=>e.name,v)}function v(e){const t=u(e.type);if(!Zt(t)){const e=tt(t);throw new Error(`Introspection must provide output type for fields, but received: ${e}.`)}if(null==e.args){const t=tt(e);throw new Error(`Introspection result missing field args: ${t}.`)}return{description:e.description,deprecationReason:e.deprecationReason,type:t,args:y(e.args)}}function y(e){return yt(e,e=>e.name,g)}function g(e){const t=u(e.type);if(!Xt(t)){const e=tt(t);throw new Error(`Introspection must provide input type for arguments, but received: ${e}.`)}return{description:e.description,type:t,default:null!=e.defaultValue?{literal:ot(e.defaultValue)}:void 0,deprecationReason:e.deprecationReason}}}const Ci="SCHEMA",ji="SCALAR",Ri="OBJECT",Mi="FIELD",Ui="ARGUMENT",Pi="INTERFACE",Bi="UNION",qi="ENUM",Ji="ENUM_VALUE",Ki="INPUT_OBJECT",zi="INPUT_FIELD",Yi="DIRECTIVE";function Hi(e,t){const r=t({getNamedType:u,setNamedType:function(e){i.set(e.name,e)},getNamedTypes:function(){return Array.from(i.values())}}),i=new Map;for(const t of e.types){const e=t.name,n=l(t);n&&i.set(e,n)}const o=[];for(const t of e.directives){if(er(t)){o.push(t);continue}const e=m(t.toConfig());e&&o.push(new GraphQLDirective(e))}const s={...e,query:e.query&&u(e.query.name),mutation:e.mutation&&u(e.mutation.name),subscription:e.subscription&&u(e.subscription.name),types:Array.from(i.values()),directives:o},a=r[Ci];return null==a?s:a(s);function c(e){return Ht(e)?new GraphQLList(c(e.ofType)):Wt(e)?new GraphQLNonNull(c(e.ofType)):u(e.name)}function u(e){const t=Wi.get(e)??i.get(e);return void 0!==t||n(0,`Unknown type: "${e}".`),t}function l(e){return yr(e)||Un(e)?e:Pt(e)?function(e){let t=e.toConfig();const n=r[ji];return t=null==n?t:n(t),new GraphQLScalarType(t)}(e):Bt(e)?function(e){const t=e.toConfig();let n={...t,interfaces:()=>t.interfaces.map(e=>u(e.name)),fields:()=>p(t.fields,e.name)};const i=r[Ri];return n=null==i?n:i(n),new GraphQLObjectType(n)}(e):Jt(e)?function(e){const t=e.toConfig();let n={...t,interfaces:()=>t.interfaces.map(e=>u(e.name)),fields:()=>p(t.fields,e.name)};const i=r[Pi];return n=null==i?n:i(n),new GraphQLInterfaceType(n)}(e):Kt(e)?function(e){const t=e.toConfig();let n={...t,types:()=>t.types.map(e=>u(e.name))};const i=r[Bi];return n=null==i?n:i(n),new GraphQLUnionType(n)}(e):zt(e)?function(e){const t=e.toConfig();let n={...t,values:()=>{const n=Object.create(null);for(const[r,i]of Object.entries(t.values)){const t=f(i,r,e.name);n[r]=t}return n}};const i=r[qi];return n=null==i?n:i(n),new GraphQLEnumType(n)}(e):Yt(e)?function(e){const t=e.toConfig();let n={...t,fields:()=>{const n=Object.create(null);for(const[r,i]of Object.entries(t.fields)){const t=h(i,r,e.name);n[r]=t}return n}};const i=r[Ki];return n=null==i?n:i(n),new GraphQLInputObjectType(n)}(e):void n(0,"Unexpected type: "+tt(e))}function p(e,t){const n=Object.create(null);for(const[i,o]of Object.entries(e)){let e={...o,type:c(o.type),args:d(o.args,t,i)};const s=r[Mi];s&&(e=s(e,t)),n[i]=e}return n}function d(e,t,n){const i=Object.create(null);for(const[o,s]of Object.entries(e)){let e={...s,type:c(s.type)};const a=r[Ui];a&&(e=a(e,t,n)),i[o]=e}return i}function f(e,t,n){const i={...e},o=r[Ji];return null==o?i:o(i,t,n)}function h(e,t,n){const i={...e,type:c(e.type)},o=r[zi];return null==o?i:o(i,t,n)}function m(e){const t={...e,args:d(e.args,e.name,void 0)},n=r[Yi];return null==n?t:n(t)}}const Wi=new Map([...Mn,...vr].map(e=>[e.name,e]));function Xi(e,t,r){const i=[],o=new AccumulatorMap,s=new AccumulatorMap,a=new AccumulatorMap,c=new AccumulatorMap,u=new AccumulatorMap,l=new AccumulatorMap,p=[];let d;const f=[];let h=!1;for(const e of t.definitions){switch(e.kind){case R:d=e;break;case X:f.push(e);break;case W:p.push(e);break;case U:case P:case J:case K:case z:case H:i.push(e);break;case Z:o.add(e.name.value,e);break;case ee:s.add(e.name.value,e);break;case te:a.add(e.name.value,e);break;case ne:c.add(e.name.value,e);break;case re:u.add(e.name.value,e);break;case ie:l.add(e.name.value,e);break;default:continue}h=!0}return h?Hi(e,e=>{const{getNamedType:t,setNamedType:h,getNamedTypes:m}=e;return{[Ci]:e=>{for(const e of i){const t=Zi.get(e.name.value)??L(e);h(t)}const n={query:e.query&&t(e.query.name),mutation:e.mutation&&t(e.mutation.name),subscription:e.subscription&&t(e.subscription.name),...d&&v([d]),...v(f)};return{description:d?.description?.value??e.description,...n,types:m(),directives:[...e.directives,...p.map(T)],extensions:e.extensions,astNode:d??e.astNode,extensionASTNodes:e.extensionASTNodes.concat(f),assumeValid:r?.assumeValid??!1}},[Ki]:e=>{const t=l.get(e.name)??[];return{...e,fields:()=>({...e.fields(),...N(t)}),extensionASTNodes:e.extensionASTNodes.concat(t)}},[qi]:e=>{const t=u.get(e.name)??[];return{...e,values:()=>({...e.values(),...w(t)}),extensionASTNodes:e.extensionASTNodes.concat(t)}},[ji]:e=>{const t=o.get(e.name)??[];let n=e.specifiedByURL;for(const e of t)n=to(e)??n;return{...e,specifiedByURL:n,extensionASTNodes:e.extensionASTNodes.concat(t)}},[Ri]:e=>{const t=s.get(e.name)??[];return{...e,interfaces:()=>[...e.interfaces(),...S(t)],fields:()=>({...e.fields(),...b(t)}),extensionASTNodes:e.extensionASTNodes.concat(t)}},[Pi]:e=>{const t=a.get(e.name)??[];return{...e,interfaces:()=>[...e.interfaces(),...S(t)],fields:()=>({...e.fields(),...b(t)}),extensionASTNodes:e.extensionASTNodes.concat(t)}},[Bi]:e=>{const t=c.get(e.name)??[];return{...e,types:()=>[...e.types(),...I(t)],extensionASTNodes:e.extensionASTNodes.concat(t)}}};function v(e){const t={};for(const n of e){const e=n.operationTypes??[];for(const n of e)t[n.operation]=y(n.type)}return t}function y(e){const r=e.name.value,i=t(r);return void 0!==i||n(0,`Unknown type: "${r}".`),i}function g(e){return e.kind===C?new GraphQLList(g(e.type)):e.kind===j?new GraphQLNonNull(g(e.type)):y(e)}function T(e){return new GraphQLDirective({name:e.name.value,description:e.description?.value,locations:e.locations.map(({value:e})=>e),isRepeatable:e.repeatable,args:E(e.arguments),astNode:e})}function b(e){const t=Object.create(null);for(const n of e){const e=n.fields??[];for(const n of e)t[n.name.value]={type:g(n.type),description:n.description?.value,args:E(n.arguments),deprecationReason:eo(n),astNode:n}}return t}function E(e){const t=e??[],n=Object.create(null);for(const e of t){const t=g(e.type);n[e.name.value]={type:t,description:e.description?.value,default:e.defaultValue&&{literal:e.defaultValue},deprecationReason:eo(e),astNode:e}}return n}function N(e){const t=Object.create(null);for(const n of e){const e=n.fields??[];for(const n of e){const e=g(n.type);t[n.name.value]={type:e,description:n.description?.value,default:n.defaultValue&&{literal:n.defaultValue},deprecationReason:eo(n),astNode:n}}}return t}function w(e){const t=Object.create(null);for(const n of e){const e=n.values??[];for(const n of e)t[n.name.value]={description:n.description?.value,deprecationReason:eo(n),astNode:n}}return t}function S(e){return e.flatMap(e=>e.interfaces?.map(y)??[])}function I(e){return e.flatMap(e=>e.types?.map(y)??[])}function L(e){const t=e.name.value;switch(e.kind){case P:{const n=s.get(t)??[],r=[e,...n];return new GraphQLObjectType({name:t,description:e.description?.value,interfaces:()=>S(r),fields:()=>b(r),astNode:e,extensionASTNodes:n})}case J:{const n=a.get(t)??[],r=[e,...n];return new GraphQLInterfaceType({name:t,description:e.description?.value,interfaces:()=>S(r),fields:()=>b(r),astNode:e,extensionASTNodes:n})}case z:{const n=u.get(t)??[],r=[e,...n];return new GraphQLEnumType({name:t,description:e.description?.value,values:()=>w(r),astNode:e,extensionASTNodes:n})}case K:{const n=c.get(t)??[],r=[e,...n];return new GraphQLUnionType({name:t,description:e.description?.value,types:()=>I(r),astNode:e,extensionASTNodes:n})}case U:{const n=o.get(t)??[];return new GraphQLScalarType({name:t,description:e.description?.value,specifiedByURL:to(e),astNode:e,extensionASTNodes:n})}case H:{const r=l.get(t)??[],i=[e,...r];return new GraphQLInputObjectType({name:t,description:e.description?.value,fields:()=>N(i),astNode:e,extensionASTNodes:r,isOneOf:(n=e,Boolean(gi(Xn,n)))})}}var n}}):e}const Zi=new Map([...Mn,...vr].map(e=>[e.name,e]));function eo(e){const t=gi(Hn,e);return t?.reason}function to(e){const t=gi(Wn,e);return t?.url}function no(e){return function(e,t,r){const i=e.getDirectives().filter(t),o=Object.values(e.getTypeMap()).filter(r);return[io(e),...i.map(e=>function(e){return po(e)+`directive ${e}`+co(e.args)+(e.isRepeatable?" repeatable":"")+" on "+e.locations.join(" | ")}(e)),...o.map(e=>function(e){if(Pt(e))return function(e){return po(e)+`scalar ${e}`+function(e){if(null==e.specifiedByURL)return"";return` @specifiedBy(url: ${$t({kind:_,value:e.specifiedByURL})})`}(e)}(e);if(Bt(e))return function(e){return po(e)+`type ${e}`+oo(e)+so(e)}(e);if(Jt(e))return function(e){return po(e)+`interface ${e}`+oo(e)+so(e)}(e);if(Kt(e))return function(e){const t=e.getTypes(),n=t.length?" = "+t.join(" | "):"";return po(e)+`union ${e.name}`+n}(e);if(zt(e))return function(e){const t=e.getValues().map((e,t)=>po(e," ",!t)+" "+e.name+lo(e.deprecationReason));return po(e)+`enum ${e}`+ao(t)}(e);if(Yt(e))return function(e){const t=Object.values(e.getFields()).map((e,t)=>po(e," ",!t)+" "+uo(e));return po(e)+`input ${e}`+(e.isOneOf?" @oneOf":"")+ao(t)}(e);n(0,"Unexpected type: "+tt(e))}(e))].filter(Boolean).join("\n\n")}(e,e=>!er(e),ro)}function ro(e){return!Un(e)&&!yr(e)}function io(e){const t=e.getQueryType(),n=e.getMutationType(),r=e.getSubscriptionType();if(t||n||r)return null==e.description&&function(e){return e.getQueryType()==e.getType("Query")&&e.getMutationType()==e.getType("Mutation")&&e.getSubscriptionType()==e.getType("Subscription")}(e)?void 0:po(e)+"schema {\n"+(t?` query: ${t}\n`:"")+(n?` mutation: ${n}\n`:"")+(r?` subscription: ${r}\n`:"")+"}"}function oo(e){const t=e.getInterfaces();return t.length?" implements "+t.map(e=>e.name).join(" & "):""}function so(e){return ao(Object.values(e.getFields()).map((e,t)=>po(e," ",!t)+" "+e.name+co(e.args," ")+": "+String(e.type)+lo(e.deprecationReason)))}function ao(e){return 0!==e.length?" {\n"+e.join("\n")+"\n}":""}function co(e,t=""){return 0===e.length?"":e.every(e=>null==e.description)?"("+e.map(uo).join(", ")+")":"(\n"+e.map((e,n)=>po(e," "+t,!n)+" "+t+uo(e)).join("\n")+"\n"+t+")"}function uo(e){let t=e.name+": "+String(e.type);const n=rr(e);return n&&(t+=` = ${$t(n)}`),t+lo(e.deprecationReason)}function lo(e){if(null==e)return"";if(e!==Yn){return` @deprecated(reason: ${$t({kind:_,value:e})})`}return" @deprecated"}function po(e,t="",n=!0){const{description:r}=e;if(null==r)return"";return(t&&!n?"\n"+t:t)+$t({kind:_,value:r,block:fe(r)}).replaceAll("\n","\n"+t)+"\n"}function fo(e){const t=[];for(const n of e)t.push(...n.definitions);return{kind:v,definitions:t}}const ho=[Jr];function mo(e){var t;const n=function(e){if(e)return function(t){const n=e;return{Field(e){var r;const i=(null!==(r=e.alias)&&void 0!==r?r:e.name).value,o=i.charAt(0).toLowerCase()+i.slice(1);n.includes(o)&&t.reportError(new GraphQLError(`Field name "${i}" is not allowed because it conflicts with generated object APIs. Please use an alias to change the field name.`,{nodes:e}))}}};return}(null===(t=e.disallowedFieldNames)||void 0===t?void 0:t.allFields),r=function(e){if(e)return function(t){const n=e;return{VariableDefinition(e){const r=e.variable.name.value,i=r.charAt(0).toLowerCase()+r.slice(1);n.includes(i)&&t.reportError(new GraphQLError(`Input Parameter name "${r}" is not allowed because it conflicts with generated object APIs.`,{nodes:e}))}}};return}(e.disallowedInputParameterNames);return[vo,yo,go,To,...n?[n]:[],...r?[r]:[],...Gi.filter(e=>!ho.includes(e))]}function vo(e){return{OperationDefinition:t=>(t.name||e.reportError(new GraphQLError("Apollo does not support anonymous operations because operation names are used during code generation. Please give this operation a name.",{nodes:t})),!1)}}function yo(e){return{Field(t){"__typename"==(t.alias&&t.alias.value)&&e.reportError(new GraphQLError("Apollo needs to be able to insert __typename when needed, so using it as an alias is not supported.",{nodes:t}))}}}function go(e){return{InlineFragment(t){if(t.directives)for(const n of t.directives)n.name.value==Kn.name&&null==t.typeCondition&&e.reportError(new GraphQLError("Apollo does not support deferred inline fragments without a type condition. Please add a type condition to this inline fragment.",{nodes:t}))}}}function To(e){return{InlineFragment(t){var n;if(t.directives)for(const r of t.directives)r.name.value!=Kn.name||(null===(n=r.arguments)||void 0===n?void 0:n.find(e=>"label"==e.name.value))||e.reportError(new GraphQLError("Apollo does not support deferred inline fragments without a 'label' argument. Please add a 'label' argument to the @defer directive on this inline fragment.",{nodes:t}))}}}function bo(e){return{kind:m,value:e}}function Eo(e){return{kind:_,value:e}}function No(e){return{kind:W,description:e.description?Eo(e.description):void 0,name:bo(e.name),repeatable:!1,locations:e.locations.map(e=>bo(e)),arguments:e.args.map(e=>function(e){return{kind:q,description:Eo(e.description),name:bo(e.name),type:wo(un(e.type))}}(e))}}function wo(e){return{kind:V,name:bo(e.name)}}function So(e){return{kind:j,type:e}}const Io={kind:W,description:Eo("A directive used by the Apollo iOS client to annotate operations or fragments that should be used exclusively for generating local cache mutations instead of as standard operations."),name:bo("apollo_client_ios_localCacheMutation"),repeatable:!1,locations:[bo("QUERY"),bo("MUTATION"),bo("SUBSCRIPTION"),bo("FRAGMENT_DEFINITION")]},Lo={kind:W,description:Eo("Attach extra information to a given type."),name:bo("typePolicy"),arguments:[{kind:q,description:Eo("A selection set containing fields used to compute the cache key of an object. Referenced fields must have non-nullable scalar types. Order is important."),name:bo("keyFields"),type:So(wo(Cn))}],repeatable:!1,locations:[bo("OBJECT"),bo("INTERFACE")]},ko={kind:W,description:Eo("A directive used by Apollo iOS to map query input data to cache keys of objects."),name:bo("fieldPolicy"),arguments:[{kind:q,description:Eo("The field you are setting the @fieldPolicy for."),name:bo("forField"),type:So(wo(Cn))},{kind:q,description:Eo("Set of fields used to compute the cache key."),name:bo("keyArgs"),type:So(wo(Cn))}],repeatable:!0,locations:[bo("OBJECT"),bo("INTERFACE")]},Oo={kind:W,description:Eo("A directive used by the Apollo iOS code generation engine to generate custom import statements in operation or fragment definition files. An import statement to import a module with the name provided in the `module` argument will be added to the generated definition file."),name:bo("import"),arguments:[{kind:q,description:Eo("The name of the module to import."),name:bo("module"),type:So(wo(Cn))}],repeatable:!0,locations:[bo("QUERY"),bo("MUTATION"),bo("SUBSCRIPTION"),bo("FRAGMENT_DEFINITION")]},_o=[Io,Oo,Lo,ko];const xo={kind:b,name:{kind:m,value:"__typename"}};class GraphQLSchemaValidationError extends Error{constructor(e){super(e.map(e=>e.message).join("\n\n")),this.validationErrors=e,this.name="GraphQLSchemaValidationError"}}function Do(e){const t=function(e,t,n=Fi){const r=[],i=new SDLValidationContext(e,t,e=>{r.push(e)});return _t(e,xt(n.map(e=>e(i)))),r}(e);if(0!==t.length)throw new GraphQLSchemaValidationError(t)}function $o(e){const t=br(e);if(0!==t.length)throw new GraphQLSchemaValidationError(t)}function Ao(e){return e.startsWith("__")}function Go(e){if(!e)return!1;for(const t of e)if(t.name.value==Io.name.value)return!0;return!1}const Fo={kind:b,name:{kind:m,value:"__typename"}};function Qo(e,t){return t&&(e=function(e){return _t(e,{enter:e=>e.kind!==T?void 0:{...e,selections:e.selections.filter(e=>!("Field"===e.kind&&"__typename"===e.name.value))},leave(e){if((e.kind===b||e.kind===I||e.kind===S)&&e.selectionSet)return{...e,selectionSet:{...e.selectionSet,selections:[xo,...e.selectionSet.selections]}}}})}(e)),_t(e,{SelectionSet:{leave:(e,t,n)=>d(n)&&![b,I].includes(n.kind)?e:function(e){const t=e.selections.find(e=>e.kind==Fo.kind&&e.name.value==Fo.name.value);return t?e:{...e,selections:[Fo,...e.selections]}}(e)},Field:{enter:e=>function(e){return e.name.value==Fo.name.value?{...e,alias:void 0,directives:void 0}:e}(e)},Directive:{enter:e=>function(e){const t=[Io,Oo];for(const n of t)if(e.name.value==n.name.value)return null;return e}(e)}})}function Vo(e){return null!=e}function Co(e){switch(e.kind){case L:return{kind:e.kind,value:e.name.value};case A:return{kind:e.kind,value:e.values.map(Co)};case G:return{kind:e.kind,value:e.fields.reduce((e,t)=>(e[t.name.value]=Co(t.value),e),{})};default:return e}}function jo(e){var t,n;return null===(n=null===(t=e.loc)||void 0===t?void 0:t.source)||void 0===n?void 0:n.name}function Ro(e,t,n,r,i){var o,s,a;const c=new Map;for(const e of t.definitions)e.kind===I&&c.set(e.name.value,e);const u=[],l=new Map,p=new Set,d=r,f=e.getQueryType();if(void 0===f)throw new GraphQLError("GraphQL Schema must contain a 'query' root type definition.",{});const h={queryType:f,mutationType:null!==(o=e.getMutationType())&&void 0!==o?o:void 0,subscriptionType:null!==(s=e.getSubscriptionType())&&void 0!==s?s:void 0};for(const e of t.definitions)e.kind===y&&u.push(g(e));for(const[e,t]of c.entries())l.set(e,T(t));return{rootTypes:h,operations:u,fragments:Array.from(l.values()),referencedTypes:Array.from(p.values()),schemaDocumentation:null!==(a=e.description)&&void 0!==a?a:void 0};function m(t){if(!p.has(t)){if(p.add(t),Jt(t)){const n=e.getPossibleTypes(t);t._implementingObjects=n;for(const e of n)d&&!v(e)||m(un(e))}if(Kt(t)){const e=t.getTypes();for(t of e)m(un(t))}if(Yt(t)&&function(e){const t=e.getFields();for(const e in t){m(un(t[e].type))}}(t),Bt(t))for(const e of t.getInterfaces())m(un(e))}}function v(e){var t,n;const r=Lo.name.value;for(const i of null!==(n=null===(t=e.astNode)||void 0===t?void 0:t.directives)&&void 0!==n?n:[])if(i.name.value===r)return!0;return!1}function g(t){var r;if(!t.name)throw new GraphQLError("Operations should be named",{nodes:t});const i=jo(t),o=t.name.value,s=t.operation,a=new Set,c=(t.variableDefinitions||[]).map(t=>{const n=t.variable.name.value,r=t.defaultValue?Co(t.defaultValue):void 0,i=Qr(e,t.type);if(!i)throw new GraphQLError(`Couldn't get type from type node "${t.type}"`,{nodes:t});return m(un(i)),{name:n,type:i,defaultValue:r}}),u=$t(Qo(t,n)),l=e.getRootType(s),[p]=null!==(r=O(t.directives))&&void 0!==r?r:[void 0,void 0];m(l);const d=N(t.selectionSet,l,a),f=Array.from(a.values());return Go(t.directives)&&E(f),{name:o,operationType:s,variables:c,rootType:l,selectionSet:d,directives:p,referencedFragments:f,source:u,filePath:i}}function T(t){var r;const i=t.name.value,o=jo(t),s=$t(Qo(t,n)),a=new Set,c=Qr(e,t.typeCondition),[u]=null!==(r=O(t.directives))&&void 0!==r?r:[void 0,void 0];m(un(c));const l=N(t.selectionSet,c,a),p=Array.from(a.values());return Go(t.directives)&&E(p),{name:i,filePath:o,source:s,typeCondition:c,selectionSet:l,directives:u,referencedFragments:p,overrideAsLocalCacheMutation:!1}}function E(e){e.forEach(e=>{e.overrideAsLocalCacheMutation=!0,E(e.referencedFragments)})}function N(t,n,r){return{parentType:n,selections:t.selections.map(t=>function(t,n,r){var o,s,a,u;const[p,d]=null!==(o=O(t.directives))&&void 0!==o?o:[void 0,void 0];switch(t.kind){case b:{const f=t.name.value;if("__typename"==f)return;const h=null===(s=t.alias)||void 0===s?void 0:s.value,v=function(e,t,n){return n===fr.name&&e.getQueryType()===t?fr:n===hr.name&&e.getQueryType()===t?hr:n===mr.name&&(Bt(t)||Jt(t)||Kt(t))?mr:Bt(t)||Jt(t)?t.getFields()[n]:void 0}(e,n,f);if(!v)throw new GraphQLError(`Cannot query field "${f}" on type "${String(n)}"`,{nodes:t});const y=v.type,g=un(v.type);m(un(g));const{description:E,deprecationReason:I}=v;let L={kind:"Field",name:f,alias:h,type:y,arguments:k(v,t.arguments),inclusionConditions:d,description:!Ao(f)&&E?E:void 0,deprecationReason:I||void 0,directives:p,fieldPolicyKeys:v._apolloFieldPolicies||void 0};function _(e,t,n){var r;if(t&&n){const i=(null!==(r=e.alias)&&void 0!==r?r:e.name).value,o=i.charAt(0).toLowerCase()+i.slice(1);if(null==t?void 0:t.includes(o))throw new GraphQLError(`Schema name "${n}" conflicts with name of a generated object API. Please choose a different schema name. Suggestions: "${n}Schema", "${n}GraphQL", "${n}API"`,{nodes:e})}}if(Ht(y)||Wt(y)&&Ht(y.ofType)?_(t,null===(a=i.disallowedFieldNames)||void 0===a?void 0:a.entityList,i.schemaNamespace):nn(g)&&_(t,null===(u=i.disallowedFieldNames)||void 0===u?void 0:u.entity,i.schemaNamespace),nn(g)){const x=t.selectionSet;if(!x)throw new GraphQLError(`Composite field "${f}" on type "${String(n)}" requires selection set`,{nodes:t});L.selectionSet=N(x,g,r)}return L}case S:{const D=t.typeCondition,$=D?Qr(e,D):n;return m($),{kind:"InlineFragment",selectionSet:N(t.selectionSet,$,r),inclusionConditions:d,directives:p}}case w:{const A=t.name.value,G=function(e){let t=l.get(e);if(t)return t;const n=c.get(e);return n?(c.delete(e),t=T(n),l.set(e,t),t):void 0}(A);if(!G)throw new GraphQLError(`Unknown fragment "${A}".`,{nodes:t.name});r.add(G);return{kind:"FragmentSpread",fragment:G,inclusionConditions:d,directives:p}}}}(t,n,r)).filter(Vo)}}function k(...e){const t=e[0].args;return e[1]&&e[1].length>0?e[1].map(e=>{var n;const r=e.name.value,i=t.find(t=>t.name===e.name.value),o=null==i?void 0:i.type;if(!o)throw new GraphQLError(`Cannot find directive argument type for argument "${r}".`,{nodes:[e]});return{name:r,value:Co(e.value),type:o,deprecationReason:null!==(n=i.deprecationReason)&&void 0!==n?n:void 0}}):void 0}function O(t){if(t&&t.length>0){const n=[],r=[];for(const i of t){const t=i.name.value,o=e.getDirective(t);if(!o)throw new GraphQLError(`Cannot find directive "${t}".`,{nodes:i});n.push({name:t,arguments:k(o,i.arguments)});const s=_(i,o);s&&r.push(s)}return[n,r.length>0?r:void 0]}}function _(e,t){var n;if("include"==t.name||"skip"==t.name){const r=null===(n=e.arguments)||void 0===n?void 0:n[0].value,i="skip"==t.name;switch(null==r?void 0:r.kind){case x:return i?r.value?"SKIPPED":"INCLUDED":r.value?"INCLUDED":"SKIPPED";case L:return{variable:r.name.value,isInverted:i};default:throw new GraphQLError('Conditional inclusion directive has invalid "if" argument.',{nodes:e})}}}}function Mo(e){return e.kind===W&&e.name.value===Kn.name}function Uo(){return{kind:v,definitions:[No(Kn)]}}const Po=Lo.name.value;function Bo(e,t){var n,r;return(null!==(n=e.arguments)&&void 0!==n?n:[]).map(e=>JSON.stringify([e.name.value,Rt(e.value)])).sort().toString()===(null!==(r=t.arguments)&&void 0!==r?r:[]).map(e=>JSON.stringify([e.name.value,Rt(e.value)])).sort().toString()}function qo(e){var t,n,r,i;if(Kt(e))return;for(const r of null!==(t=e.extensionASTNodes)&&void 0!==t?t:[]){const t=null===(n=r.directives)||void 0===n?void 0:n.find(e=>e.name.value===Po);if(t)return{directive:t,source:e}}let o;for(const t of null!==(i=null===(r=e.astNode)||void 0===r?void 0:r.directives)&&void 0!==i?i:[])if(t.name.value===Po){o={directive:t,source:e};break}if("getInterfaces"in e)for(const t of e.getInterfaces()){const n=qo(t);if(n)if(o){if(!Bo(o.directive,n.directive))throw o.source===e?new GraphQLError(`Type "${e.name}" has a @typePolicy directive which conflicts with the @typePolicy directive on interface "${n.source.name}".`,{nodes:e.astNode}):new GraphQLError(`Type "${e.name}" inherits conflicting @typePolicy directives from interfaces "${o.source.name}" and "${n.source.name}".`,{nodes:e.astNode})}else o=n}return o}function Jo(e){var t,n,r;const i=qo(e);if(!i)return[];const o=null===(r=null===(n=null===(t=i.directive)||void 0===t?void 0:t.arguments)||void 0===n?void 0:n.find(e=>"keyFields"===e.name.value))||void 0===r?void 0:r.value;if(!o||o.kind!==_)return[];const s=o.value.split(" ");return function(e,t){const{directive:n,source:r}=e;if(Kt(r))return;const i=Jt(r)?"interface":"object";var o=r.getFields();for(const e of t){if(!e)throw new GraphQLError("Key fields must be a space-separated list of identifiers.",{nodes:n});const t=o[e];if(!t)throw new GraphQLError(`Key field "${e}" does not exist on ${i} "${r.name}".`,{nodes:r.astNode?[r.astNode,n]:n});if(!Wt(t.type))throw new GraphQLError(`Key field "${e}" on ${i} "${r.name}" must be non-nullable.`,{nodes:t.astNode?[t.astNode,n]:n});if(!Pt(t.type.ofType))throw new GraphQLError(`Key field "${e}" on ${i} "${r.name}" must be a scalar type, got ${t.type}.`,{nodes:t.astNode?[t.astNode,n]:n})}}(i,s),s}function Ko(e){const t=e.getTypeMap();for(const e in t){const n=t[e];(n instanceof GraphQLObjectType||n instanceof GraphQLInterfaceType)&&(n._apolloKeyFields=Jo(n))}}const zo=ko.name.value;function Yo(e){const t=e.getTypeMap();for(const e in t){const n=t[e];(n instanceof GraphQLObjectType||n instanceof GraphQLInterfaceType)&&Ho(n)}}function Ho(e){var t,n,r,i;const o=Wo(e);if(!o||Kt(e))return;const s=e.getFields();for(const a of o){const o=null===(n=null===(t=a.arguments)||void 0===t?void 0:t.find(e=>"forField"===e.name.value))||void 0===n?void 0:n.value;let c;if((null==o?void 0:o.kind)===_&&(c=o.value),!c)throw new GraphQLError("@fieldPolicy directive must have a 'forField' value.",{nodes:a});const u=null===(i=null===(r=a.arguments)||void 0===r?void 0:r.find(e=>"keyArgs"===e.name.value))||void 0===i?void 0:i.value;let l=[];if((null==u?void 0:u.kind)===_){const e=u.value.split(/\s+/);l=[...new Set(e.filter(Boolean))]}if(0===l.length)throw new GraphQLError("'keyArgs' must be a space-separated list of identifiers.",{nodes:a});const p=s[c];if(!p)throw new GraphQLError(`Field "${c}" does not exist on type "${e.name}".`,{nodes:e.astNode?[e.astNode,a]:a});Zo(p,l),is(p),p._apolloFieldPolicies=l}}function Wo(e){var t,n,r,i;if(!Bt(e)&&!Jt(e))return;const o=[];for(const r of null!==(t=e.extensionASTNodes)&&void 0!==t?t:[]){const e=null===(n=r.directives)||void 0===n?void 0:n.find(e=>e.name.value===zo);e&&o.push(e)}for(const t of null!==(i=null===(r=e.astNode)||void 0===r?void 0:r.directives)&&void 0!==i?i:[])t.name.value===zo&&o.push(t);if("getInterfaces"in e)for(const t of e.getInterfaces()){const e=Wo(t);if(e)for(const t of e){var s=!1;for(const e of o)if(Xo(e,t)){s=!0;break}s||o.push(t)}}return o}function Xo(e,t){var n,r;return(null!==(n=e.arguments)&&void 0!==n?n:[]).map(e=>JSON.stringify([e.name.value,Rt(e.value)])).sort().toString()===(null!==(r=t.arguments)&&void 0!==r?r:[]).map(e=>JSON.stringify([e.name.value,Rt(e.value)])).sort().toString()}function Zo(e,t){for(const n of t)es(e,n)}function es(e,t){const n=t.split(".").filter(Boolean),[r,...i]=n,o=e.args.find(e=>e.name===r);if(!o)throw new GraphQLError(`@fieldPolicy key argument "${t}" does not exist as an input argument of field "${e.name}".`,{nodes:e.astNode});let s=ts(o.type);for(let n=0;n1)throw new GraphQLError("@fieldPolicy can only have at most 1 List type input parameter.",{nodes:e.astNode});if(t&&1!==n||!t&&0!==n)throw new GraphQLError("@fieldPolicy requires either both a List return type and exactly 1 List input parameter, or neither.",{nodes:e.astNode})}return e.GraphQLEnumType=GraphQLEnumType,e.GraphQLError=GraphQLError,e.GraphQLInputObjectType=GraphQLInputObjectType,e.GraphQLInterfaceType=GraphQLInterfaceType,e.GraphQLObjectType=GraphQLObjectType,e.GraphQLScalarType=GraphQLScalarType,e.GraphQLSchema=GraphQLSchema,e.GraphQLSchemaValidationError=GraphQLSchemaValidationError,e.GraphQLUnionType=GraphQLUnionType,e.Source=Source,e.compileDocument=function(e,t,n,r,i){return Ro(e,t,n,r,i)},e.loadSchemaFromSources=function(e){var t,n=new Array;for(const r of e)if(r.name.endsWith(".json")){if(t)throw new Error(`Schema search paths can only include one JSON schema definition.\n Found "${t.name} & "${r.name}".`);t=r}else n.push(it(r));var r=function(e){const t=_o.filter(t=>!e.definitions.some(e=>e.kind==W&&e.name.value==t.name.value));return fo([e,{kind:v,definitions:t}])}(fo(n));if(t){var i=function(e){let t=JSON.parse(e);t.data&&(t=t.data);const n=Vi(t);return n}(t.body);return r=function(e,t){const n=e.getDirective(Kn.name);return n?function(e,t){return e.isRepeatable===t.isRepeatable&&e.locations.slice(0).sort().toString()===t.locations.slice(0).sort().toString()&&e.args.map(e=>e.name).sort().toString()===t.args.map(e=>e.name).sort().toString()}(n,Kn)?t:(console.warn(`Unsupported ${n.name} directive found. It will be replaced with a supported definition instead.`),fo([t,Uo()])):fo([t,Uo()])}(i,r),Ko(i=function(e,t,n){gr(e);const r=e.toConfig(),i=Xi(r,t,n);return r===i?e:new GraphQLSchema(i)}(i,r,{assumeValid:!0})),Yo(i),$o(i),i}{Do(r=function(e){const t=e.definitions.find(Mo);if(!t)return fo([e,Uo()]);const n=t;if(!function(e,t){var n;return e.repeatable===t.isRepeatable&&e.locations.map(e=>e.value).sort().toString()===t.locations.slice(0).sort().toString()&&(null===(n=e.arguments)||void 0===n?void 0:n.map(e=>e.name.value).sort().toString())===t.args.map(e=>e.name).sort().toString()}(n,Kn))return console.warn(`Unsupported ${n.name.value} directive found. It will be replaced with a supported definition instead.`),{kind:v,definitions:e.definitions.filter(e=>Mo(e)?void 0:e).concat(No(Kn))};return e}(r));const e=function(e,t){const n=Xi({description:void 0,types:[],directives:[],extensions:Object.create(null),extensionASTNodes:[],assumeValid:!1},e,t);if(null==n.astNode)for(const e of n.types)switch(e.name){case"Query":n.query=e;break;case"Mutation":n.mutation=e;break;case"Subscription":n.subscription=e}const r=[...n.directives,...Zn.filter(e=>n.directives.every(t=>t.name!==e.name))];return new GraphQLSchema({...n,directives:r})}(r,{assumeValid:!0});return Ko(e),Yo(e),$o(e),e}},e.mergeDocuments=function(e){return fo(e)},e.parseOperationDocument=function(e){return it(e)},e.printSchemaToSDL=function(e){return no(e)},e.validateDocument=function(e,t,n){return Qi(e,t,mo(n))},e}({});"# \ No newline at end of file diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/CompilationResult.swift b/apollo-ios-codegen/Sources/GraphQLCompiler/CompilationResult.swift index bd449cb54..7eb2b685f 100644 --- a/apollo-ios-codegen/Sources/GraphQLCompiler/CompilationResult.swift +++ b/apollo-ios-codegen/Sources/GraphQLCompiler/CompilationResult.swift @@ -492,6 +492,8 @@ public final class CompilationResult: JavaScriptObjectDecodable { public let type: GraphQLType public let arguments: [Argument]? + + public let fieldPolicyKeys: [String]? public let inclusionConditions: [InclusionCondition]? @@ -515,6 +517,7 @@ public final class CompilationResult: JavaScriptObjectDecodable { name: String, alias: String? = nil, arguments: [Argument]? = nil, + fieldPolicyKeys: [String]? = nil, inclusionConditions: [InclusionCondition]? = nil, directives: [Directive]? = nil, type: GraphQLType, @@ -526,6 +529,7 @@ public final class CompilationResult: JavaScriptObjectDecodable { self.alias = alias self.type = type self.arguments = arguments + self.fieldPolicyKeys = fieldPolicyKeys self.inclusionConditions = inclusionConditions self.directives = directives self.selectionSet = selectionSet @@ -533,11 +537,12 @@ public final class CompilationResult: JavaScriptObjectDecodable { self.documentation = documentation } - static func fromJSValue(_ jsValue: JSValue, bridge: isolated JavaScriptBridge) -> Self { - self.init( + static func fromJSValue(_ jsValue: JSValue, bridge: isolated JavaScriptBridge) -> Self { + return self.init( name: jsValue["name"], alias: jsValue["alias"], arguments: .fromJSValue(jsValue["arguments"], bridge: bridge), + fieldPolicyKeys: jsValue["fieldPolicyKeys"], inclusionConditions: jsValue["inclusionConditions"], directives: .fromJSValue(jsValue["directives"], bridge: bridge), type: .fromJSValue(jsValue["type"], bridge: bridge), @@ -560,6 +565,7 @@ public final class CompilationResult: JavaScriptObjectDecodable { hasher.combine(alias) hasher.combine(type) hasher.combine(arguments) + hasher.combine(fieldPolicyKeys) hasher.combine(directives) hasher.combine(selectionSet) } @@ -569,6 +575,7 @@ public final class CompilationResult: JavaScriptObjectDecodable { lhs.alias == rhs.alias && lhs.type == rhs.type && lhs.arguments == rhs.arguments && + lhs.fieldPolicyKeys == rhs.fieldPolicyKeys && lhs.directives == rhs.directives && lhs.selectionSet == rhs.selectionSet } diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/GraphQLSchema.swift b/apollo-ios-codegen/Sources/GraphQLCompiler/GraphQLSchema.swift index d16a0c0bc..c092b35ed 100644 --- a/apollo-ios-codegen/Sources/GraphQLCompiler/GraphQLSchema.swift +++ b/apollo-ios-codegen/Sources/GraphQLCompiler/GraphQLSchema.swift @@ -64,7 +64,7 @@ public class GraphQLNamedType: } } -public final class GraphQLScalarType: GraphQLNamedType { +public final class GraphQLScalarType: GraphQLNamedType, @unchecked Sendable { public let specifiedByURL: String? public var isCustomScalar: Bool { @@ -95,7 +95,7 @@ public final class GraphQLScalarType: GraphQLNamedType { } -public final class GraphQLEnumType: GraphQLNamedType { +public final class GraphQLEnumType: GraphQLNamedType, @unchecked Sendable { public private(set) var values: [GraphQLEnumValue]! required init(_ jsValue: JSValue, bridge: isolated JavaScriptBridge) { @@ -151,7 +151,7 @@ public struct GraphQLEnumValue: JavaScriptObjectDecodable, GraphQLNamedItem { public typealias GraphQLInputFieldDictionary = OrderedDictionary -public final class GraphQLInputObjectType: GraphQLNamedType { +public final class GraphQLInputObjectType: GraphQLNamedType, @unchecked Sendable { public private(set) var fields: GraphQLInputFieldDictionary! public let isOneOf: Bool @@ -217,7 +217,7 @@ public class GraphQLInputField: JavaScriptObjectDecodable, GraphQLNamedItem { } } -public class GraphQLCompositeType: GraphQLNamedType { +public class GraphQLCompositeType: GraphQLNamedType, @unchecked Sendable { public override var debugDescription: String { "Type - \(name)" } @@ -233,7 +233,7 @@ public extension GraphQLInterfaceImplementingType { } } -public final class GraphQLObjectType: GraphQLCompositeType, GraphQLInterfaceImplementingType { +public final class GraphQLObjectType: GraphQLCompositeType, GraphQLInterfaceImplementingType, @unchecked Sendable { public private(set) var fields: [String: GraphQLField]! @@ -270,10 +270,10 @@ public final class GraphQLObjectType: GraphQLCompositeType, GraphQLInterfaceImpl } } -public class GraphQLAbstractType: GraphQLCompositeType { +public class GraphQLAbstractType: GraphQLCompositeType, @unchecked Sendable { } -public final class GraphQLInterfaceType: GraphQLAbstractType, GraphQLInterfaceImplementingType { +public final class GraphQLInterfaceType: GraphQLAbstractType, GraphQLInterfaceImplementingType, @unchecked Sendable { public private(set) var fields: [String: GraphQLField]! @@ -315,7 +315,7 @@ public final class GraphQLInterfaceType: GraphQLAbstractType, GraphQLInterfaceIm } } -public final class GraphQLUnionType: GraphQLAbstractType { +public final class GraphQLUnionType: GraphQLAbstractType, @unchecked Sendable { public let types: [GraphQLObjectType] required init(_ jsValue: JSValue, bridge: isolated JavaScriptBridge) { diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/package-lock.json b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/package-lock.json index 66b0d849f..2e4628333 100644 --- a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/package-lock.json +++ b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/package-lock.json @@ -29,25 +29,11 @@ "npm": ">=7" } }, - "node_modules/@ampproject/remapping": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz", - "integrity": "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==", - "dev": true, - "dependencies": { - "@jridgewell/gen-mapping": "^0.3.5", - "@jridgewell/trace-mapping": "^0.3.24" - }, - "engines": { - "node": ">=6.0.0" - } - }, "node_modules/@babel/code-frame": { "version": "7.27.1", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.27.1.tgz", "integrity": "sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg==", "dev": true, - "license": "MIT", "dependencies": { "@babel/helper-validator-identifier": "^7.27.1", "js-tokens": "^4.0.0", @@ -58,32 +44,30 @@ } }, "node_modules/@babel/compat-data": { - "version": "7.27.5", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.27.5.tgz", - "integrity": "sha512-KiRAp/VoJaWkkte84TvUd9qjdbZAdiqyvMxrGl1N6vzFogKmaLgoM3L1kgtLicp2HP5fBJS8JrZKLVIZGVJAVg==", + "version": "7.28.4", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.28.4.tgz", + "integrity": "sha512-YsmSKC29MJwf0gF8Rjjrg5LQCmyh+j/nD8/eP7f+BeoQTKYqs9RoWbjGOdy0+1Ekr68RJZMUOPVQaQisnIo4Rw==", "dev": true, - "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/core": { - "version": "7.27.4", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.27.4.tgz", - "integrity": "sha512-bXYxrXFubeYdvB0NhD/NBB3Qi6aZeV20GOWVI47t2dkecCEoneR4NPVcb7abpXDEvejgrUfFtG6vG/zxAKmg+g==", + "version": "7.28.4", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.28.4.tgz", + "integrity": "sha512-2BCOP7TN8M+gVDj7/ht3hsaO/B/n5oDbiAyyvnRlNOs+u1o+JWNYTQrmpuNp1/Wq2gcFrI01JAW+paEKDMx/CA==", "dev": true, - "license": "MIT", "dependencies": { - "@ampproject/remapping": "^2.2.0", "@babel/code-frame": "^7.27.1", - "@babel/generator": "^7.27.3", + "@babel/generator": "^7.28.3", "@babel/helper-compilation-targets": "^7.27.2", - "@babel/helper-module-transforms": "^7.27.3", - "@babel/helpers": "^7.27.4", - "@babel/parser": "^7.27.4", + "@babel/helper-module-transforms": "^7.28.3", + "@babel/helpers": "^7.28.4", + "@babel/parser": "^7.28.4", "@babel/template": "^7.27.2", - "@babel/traverse": "^7.27.4", - "@babel/types": "^7.27.3", + "@babel/traverse": "^7.28.4", + "@babel/types": "^7.28.4", + "@jridgewell/remapping": "^2.3.5", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", @@ -99,16 +83,15 @@ } }, "node_modules/@babel/generator": { - "version": "7.27.5", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.27.5.tgz", - "integrity": "sha512-ZGhA37l0e/g2s1Cnzdix0O3aLYm66eF8aufiVteOgnwxgnRP8GoyMj7VWsgWnQbVKXyge7hqrFh2K2TQM6t1Hw==", + "version": "7.28.3", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.28.3.tgz", + "integrity": "sha512-3lSpxGgvnmZznmBkCRnVREPUFJv2wrv9iAoFDvADJc0ypmdOxdUtcLeBgBJ6zE0PMeTKnxeQzyk0xTBq4Ep7zw==", "dev": true, - "license": "MIT", "dependencies": { - "@babel/parser": "^7.27.5", - "@babel/types": "^7.27.3", - "@jridgewell/gen-mapping": "^0.3.5", - "@jridgewell/trace-mapping": "^0.3.25", + "@babel/parser": "^7.28.3", + "@babel/types": "^7.28.2", + "@jridgewell/gen-mapping": "^0.3.12", + "@jridgewell/trace-mapping": "^0.3.28", "jsesc": "^3.0.2" }, "engines": { @@ -120,7 +103,6 @@ "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.27.2.tgz", "integrity": "sha512-2+1thGUUWWjLTYTHZWK1n8Yga0ijBz1XAhUXcKy81rd5g6yh7hGqMp45v7cadSbEHc9G3OTv45SyneRN3ps4DQ==", "dev": true, - "license": "MIT", "dependencies": { "@babel/compat-data": "^7.27.2", "@babel/helper-validator-option": "^7.27.1", @@ -132,12 +114,20 @@ "node": ">=6.9.0" } }, + "node_modules/@babel/helper-globals": { + "version": "7.28.0", + "resolved": "https://registry.npmjs.org/@babel/helper-globals/-/helper-globals-7.28.0.tgz", + "integrity": "sha512-+W6cISkXFa1jXsDEdYA8HeevQT/FULhxzR99pxphltZcVaugps53THCeiWA8SguxxpSp3gKPiuYfSWopkLQ4hw==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, "node_modules/@babel/helper-module-imports": { "version": "7.27.1", "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.27.1.tgz", "integrity": "sha512-0gSFWUPNXNopqtIPQvlD5WgXYI5GY2kP2cCvoT8kczjbfcfuIljTbcWrulD1CIPIX2gt1wghbDy08yE1p+/r3w==", "dev": true, - "license": "MIT", "dependencies": { "@babel/traverse": "^7.27.1", "@babel/types": "^7.27.1" @@ -147,15 +137,14 @@ } }, "node_modules/@babel/helper-module-transforms": { - "version": "7.27.3", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.27.3.tgz", - "integrity": "sha512-dSOvYwvyLsWBeIRyOeHXp5vPj5l1I011r52FM1+r1jCERv+aFXYk4whgQccYEGYxK2H3ZAIA8nuPkQ0HaUo3qg==", + "version": "7.28.3", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.28.3.tgz", + "integrity": "sha512-gytXUbs8k2sXS9PnQptz5o0QnpLL51SwASIORY6XaBKF88nsOT0Zw9szLqlSGQDP/4TljBAD5y98p2U1fqkdsw==", "dev": true, - "license": "MIT", "dependencies": { "@babel/helper-module-imports": "^7.27.1", "@babel/helper-validator-identifier": "^7.27.1", - "@babel/traverse": "^7.27.3" + "@babel/traverse": "^7.28.3" }, "engines": { "node": ">=6.9.0" @@ -169,7 +158,6 @@ "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.27.1.tgz", "integrity": "sha512-1gn1Up5YXka3YYAHGKpbideQ5Yjf1tDa9qYcgysz+cNCXukyLl6DjPXhD3VRwSb8c0J9tA4b2+rHEZtc6R0tlw==", "dev": true, - "license": "MIT", "engines": { "node": ">=6.9.0" } @@ -179,7 +167,6 @@ "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz", "integrity": "sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==", "dev": true, - "license": "MIT", "engines": { "node": ">=6.9.0" } @@ -189,7 +176,6 @@ "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.27.1.tgz", "integrity": "sha512-D2hP9eA+Sqx1kBZgzxZh0y1trbuU+JoDkiEwqhQ36nodYqJwyEIhPSdMNd7lOm/4io72luTPWH20Yda0xOuUow==", "dev": true, - "license": "MIT", "engines": { "node": ">=6.9.0" } @@ -199,33 +185,30 @@ "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.27.1.tgz", "integrity": "sha512-YvjJow9FxbhFFKDSuFnVCe2WxXk1zWc22fFePVNEaWJEu8IrZVlda6N0uHwzZrUM1il7NC9Mlp4MaJYbYd9JSg==", "dev": true, - "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helpers": { - "version": "7.27.6", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.27.6.tgz", - "integrity": "sha512-muE8Tt8M22638HU31A3CgfSUciwz1fhATfoVai05aPXGor//CdWDCbnlY1yvBPo07njuVOCNGCSp/GTt12lIug==", + "version": "7.28.4", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.28.4.tgz", + "integrity": "sha512-HFN59MmQXGHVyYadKLVumYsA9dBFun/ldYxipEjzA4196jpLZd8UjEEBLkbEkvfYreDqJhZxYAWFPtrfhNpj4w==", "dev": true, - "license": "MIT", "dependencies": { "@babel/template": "^7.27.2", - "@babel/types": "^7.27.6" + "@babel/types": "^7.28.4" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/parser": { - "version": "7.27.5", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.27.5.tgz", - "integrity": "sha512-OsQd175SxWkGlzbny8J3K8TnnDD0N3lrIUtB92xwyRpzaenGZhxDvxN/JgU00U3CDZNj9tPuDJ5H0WS4Nt3vKg==", + "version": "7.28.4", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.28.4.tgz", + "integrity": "sha512-yZbBqeM6TkpP9du/I2pUZnJsRMGGvOuIrhjzC1AwHwW+6he4mni6Bp/m8ijn0iOuZuPI2BfkCoSRunpyjnrQKg==", "dev": true, - "license": "MIT", "dependencies": { - "@babel/types": "^7.27.3" + "@babel/types": "^7.28.4" }, "bin": { "parser": "bin/babel-parser.js" @@ -275,7 +258,6 @@ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-static-block/-/plugin-syntax-class-static-block-7.14.5.tgz", "integrity": "sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw==", "dev": true, - "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.14.5" }, @@ -291,7 +273,6 @@ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.27.1.tgz", "integrity": "sha512-oFT0FrKHgF53f4vOsZGi2Hh3I35PfSmVs4IBFLFj4dnafP+hIWDLg3VyKmUHfLoLHlyxY4C7DGtmHuJgn+IGww==", "dev": true, - "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.27.1" }, @@ -331,7 +312,6 @@ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.27.1.tgz", "integrity": "sha512-y8YTNIeKoyhGd9O0Jiyzyyqk8gdjnumGTQPsz0xOZOQ2RmkVJeZ1vmmfIvFEKqucBG6axJGBZDE/7iI5suUI/w==", "dev": true, - "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.27.1" }, @@ -419,7 +399,6 @@ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-private-property-in-object/-/plugin-syntax-private-property-in-object-7.14.5.tgz", "integrity": "sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg==", "dev": true, - "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.14.5" }, @@ -450,7 +429,6 @@ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.27.1.tgz", "integrity": "sha512-xfYCBMxveHrRMnAWl1ZlPXOZjzkN82THFvLhQhFXFt81Z5HnN+EtUkZhv/zcKpmT3fzmWZB0ywiBrbC3vogbwQ==", "dev": true, - "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.27.1" }, @@ -466,7 +444,6 @@ "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.27.2.tgz", "integrity": "sha512-LPDZ85aEJyYSd18/DkjNh4/y1ntkE5KwUHWTiqgRxruuZL2F1yuHligVHLvcHY2vMHXttKFpJn6LwfI7cw7ODw==", "dev": true, - "license": "MIT", "dependencies": { "@babel/code-frame": "^7.27.1", "@babel/parser": "^7.27.2", @@ -477,30 +454,28 @@ } }, "node_modules/@babel/traverse": { - "version": "7.27.4", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.27.4.tgz", - "integrity": "sha512-oNcu2QbHqts9BtOWJosOVJapWjBDSxGCpFvikNR5TGDYDQf3JwpIoMzIKrvfoti93cLfPJEG4tH9SPVeyCGgdA==", + "version": "7.28.4", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.28.4.tgz", + "integrity": "sha512-YEzuboP2qvQavAcjgQNVgsvHIDv6ZpwXvcvjmyySP2DIMuByS/6ioU5G9pYrWHM6T2YDfc7xga9iNzYOs12CFQ==", "dev": true, - "license": "MIT", "dependencies": { "@babel/code-frame": "^7.27.1", - "@babel/generator": "^7.27.3", - "@babel/parser": "^7.27.4", + "@babel/generator": "^7.28.3", + "@babel/helper-globals": "^7.28.0", + "@babel/parser": "^7.28.4", "@babel/template": "^7.27.2", - "@babel/types": "^7.27.3", - "debug": "^4.3.1", - "globals": "^11.1.0" + "@babel/types": "^7.28.4", + "debug": "^4.3.1" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/types": { - "version": "7.27.6", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.27.6.tgz", - "integrity": "sha512-ETyHEk2VHHvl9b9jZP5IHPavHYk57EhanlRRuae9XCpb/j5bDCbPPMOBfCWhnl/7EDJz0jEMCi/RhccCE8r1+Q==", + "version": "7.28.4", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.28.4.tgz", + "integrity": "sha512-bkFqkLhh3pMBUQQkpVgWDWq/lqzc2678eUyDlTBhRqhCHFguYYGM0Efga7tYk4TogG/3x0EEl66/OQ+WGbWB/Q==", "dev": true, - "license": "MIT", "dependencies": { "@babel/helper-string-parser": "^7.27.1", "@babel/helper-validator-identifier": "^7.27.1" @@ -513,15 +488,13 @@ "version": "0.2.3", "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/@emnapi/core": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.5.0.tgz", "integrity": "sha512-sbP8GzB1WDzacS8fgNPpHlp6C9VZe+SJP3F90W9rLemaQj2PzIuTEl1qDOYQf58YIpyjViI24y9aPWCjEzY2cg==", "dev": true, - "license": "MIT", "optional": true, "dependencies": { "@emnapi/wasi-threads": "1.1.0", @@ -533,7 +506,6 @@ "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.5.0.tgz", "integrity": "sha512-97/BJ3iXHww3djw6hYIfErCZFee7qCtrneuLa20UXFCOTCfBM2cvQHjWJ2EG0s0MtdNwInarqCTz35i4wWXHsQ==", "dev": true, - "license": "MIT", "optional": true, "dependencies": { "tslib": "^2.4.0" @@ -544,7 +516,6 @@ "resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.1.0.tgz", "integrity": "sha512-WI0DdZ8xFSbgMjR1sFsKABJ/C5OnRrjT06JXbZKexJGrDuPTzZdDYfFlsgcCXCyf+suG5QU2e/y1Wo2V/OapLQ==", "dev": true, - "license": "MIT", "optional": true, "dependencies": { "tslib": "^2.4.0" @@ -555,7 +526,6 @@ "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", "dev": true, - "license": "ISC", "dependencies": { "string-width": "^5.1.2", "string-width-cjs": "npm:string-width@^4.2.0", @@ -598,7 +568,6 @@ "resolved": "https://registry.npmjs.org/@jest/console/-/console-30.1.2.tgz", "integrity": "sha512-BGMAxj8VRmoD0MoA/jo9alMXSRoqW8KPeqOfEo1ncxnRLatTBCpRoOwlwlEMdudp68Q6WSGwYrrLtTGOh8fLzw==", "dev": true, - "license": "MIT", "dependencies": { "@jest/types": "30.0.5", "@types/node": "*", @@ -616,7 +585,6 @@ "resolved": "https://registry.npmjs.org/@jest/core/-/core-30.1.2.tgz", "integrity": "sha512-iSLOojkYgM7Lw0FF5egecZh+CiLWe4xICM3WOMjFbewhbWn+ixEoPwY7oK9jSCnLLphMFAjussXp7CE3tHa5EA==", "dev": true, - "license": "MIT", "dependencies": { "@jest/console": "30.1.2", "@jest/pattern": "30.0.1", @@ -664,7 +632,6 @@ "resolved": "https://registry.npmjs.org/@jest/diff-sequences/-/diff-sequences-30.0.1.tgz", "integrity": "sha512-n5H8QLDJ47QqbCNn5SuFjCRDrOLEZ0h8vAHCK5RL9Ls7Xa8AQLa/YxAc9UjFqoEDM48muwtBGjtMY5cr0PLDCw==", "dev": true, - "license": "MIT", "engines": { "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } @@ -674,7 +641,6 @@ "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-30.1.2.tgz", "integrity": "sha512-N8t1Ytw4/mr9uN28OnVf0SYE2dGhaIxOVYcwsf9IInBKjvofAjbFRvedvBBlyTYk2knbJTiEjEJ2PyyDIBnd9w==", "dev": true, - "license": "MIT", "dependencies": { "@jest/fake-timers": "30.1.2", "@jest/types": "30.0.5", @@ -690,7 +656,6 @@ "resolved": "https://registry.npmjs.org/@jest/expect/-/expect-30.1.2.tgz", "integrity": "sha512-tyaIExOwQRCxPCGNC05lIjWJztDwk2gPDNSDGg1zitXJJ8dC3++G/CRjE5mb2wQsf89+lsgAgqxxNpDLiCViTA==", "dev": true, - "license": "MIT", "dependencies": { "expect": "30.1.2", "jest-snapshot": "30.1.2" @@ -704,7 +669,6 @@ "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-30.1.2.tgz", "integrity": "sha512-HXy1qT/bfdjCv7iC336ExbqqYtZvljrV8odNdso7dWK9bSeHtLlvwWWC3YSybSPL03Gg5rug6WLCZAZFH72m0A==", "dev": true, - "license": "MIT", "dependencies": { "@jest/get-type": "30.1.0" }, @@ -717,7 +681,6 @@ "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-30.1.2.tgz", "integrity": "sha512-Beljfv9AYkr9K+ETX9tvV61rJTY706BhBUtiaepQHeEGfe0DbpvUA5Z3fomwc5Xkhns6NWrcFDZn+72fLieUnA==", "dev": true, - "license": "MIT", "dependencies": { "@jest/types": "30.0.5", "@sinonjs/fake-timers": "^13.0.0", @@ -735,7 +698,6 @@ "resolved": "https://registry.npmjs.org/@jest/get-type/-/get-type-30.1.0.tgz", "integrity": "sha512-eMbZE2hUnx1WV0pmURZY9XoXPkUYjpc55mb0CrhtdWLtzMQPFvu/rZkTLZFTsdaVQa+Tr4eWAteqcUzoawq/uA==", "dev": true, - "license": "MIT", "engines": { "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } @@ -745,7 +707,6 @@ "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-30.1.2.tgz", "integrity": "sha512-teNTPZ8yZe3ahbYnvnVRDeOjr+3pu2uiAtNtrEsiMjVPPj+cXd5E/fr8BL7v/T7F31vYdEHrI5cC/2OoO/vM9A==", "dev": true, - "license": "MIT", "dependencies": { "@jest/environment": "30.1.2", "@jest/expect": "30.1.2", @@ -774,7 +735,6 @@ "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-30.1.2.tgz", "integrity": "sha512-8Jd7y3DUFBn8dG/bNJ2blmaJmT2Up74WAXkUJsbL0OuEZHDRRMnS4JmRtLArW2d0H5k8RDdhNN7j70Ki16Zr5g==", "dev": true, - "license": "MIT", "dependencies": { "@bcoe/v8-coverage": "^0.2.3", "@jest/console": "30.1.2", @@ -817,7 +777,6 @@ "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-30.0.5.tgz", "integrity": "sha512-DmdYgtezMkh3cpU8/1uyXakv3tJRcmcXxBOcO0tbaozPwpmh4YMsnWrQm9ZmZMfa5ocbxzbFk6O4bDPEc/iAnA==", "dev": true, - "license": "MIT", "dependencies": { "@sinclair/typebox": "^0.34.0" }, @@ -830,7 +789,6 @@ "resolved": "https://registry.npmjs.org/@jest/snapshot-utils/-/snapshot-utils-30.1.2.tgz", "integrity": "sha512-vHoMTpimcPSR7OxS2S0V1Cpg8eKDRxucHjoWl5u4RQcnxqQrV3avETiFpl8etn4dqxEGarBeHbIBety/f8mLXw==", "dev": true, - "license": "MIT", "dependencies": { "@jest/types": "30.0.5", "chalk": "^4.1.2", @@ -846,7 +804,6 @@ "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-30.0.1.tgz", "integrity": "sha512-MIRWMUUR3sdbP36oyNyhbThLHyJ2eEDClPCiHVbrYAe5g3CHRArIVpBw7cdSB5fr+ofSfIb2Tnsw8iEHL0PYQg==", "dev": true, - "license": "MIT", "dependencies": { "@jridgewell/trace-mapping": "^0.3.25", "callsites": "^3.1.0", @@ -861,7 +818,6 @@ "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-30.1.2.tgz", "integrity": "sha512-mpKFr8DEpfG5aAfQYA5+3KneAsRBXhF7zwtwqT4UeYBckoOPD1MzVxU6gDHwx4gRB7I1MKL6owyJzr8QRq402Q==", "dev": true, - "license": "MIT", "dependencies": { "@jest/console": "30.1.2", "@jest/types": "30.0.5", @@ -877,7 +833,6 @@ "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-30.1.2.tgz", "integrity": "sha512-v3vawuj2LC0XjpzF4q0pI0ZlQvMBDNqfRZZ2yHqcsGt7JEYsDK2L1WwrybEGlnOaEvnDFML/Y9xWLiW47Dda8A==", "dev": true, - "license": "MIT", "dependencies": { "@jest/test-result": "30.1.2", "graceful-fs": "^4.2.11", @@ -893,7 +848,6 @@ "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-30.1.2.tgz", "integrity": "sha512-UYYFGifSgfjujf1Cbd3iU/IQoSd6uwsj8XHj5DSDf5ERDcWMdJOPTkHWXj4U+Z/uMagyOQZ6Vne8C4nRIrCxqA==", "dev": true, - "license": "MIT", "dependencies": { "@babel/core": "^7.27.4", "@jest/types": "30.0.5", @@ -920,7 +874,6 @@ "resolved": "https://registry.npmjs.org/@jest/types/-/types-30.0.5.tgz", "integrity": "sha512-aREYa3aku9SSnea4aX6bhKn4bgv3AXkgijoQgbYV3yvbiGt6z+MQ85+6mIhx9DsKW2BuB/cLR/A+tcMThx+KLQ==", "dev": true, - "license": "MIT", "dependencies": { "@jest/pattern": "30.0.1", "@jest/schemas": "30.0.5", @@ -935,17 +888,23 @@ } }, "node_modules/@jridgewell/gen-mapping": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", - "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", + "version": "0.3.13", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", + "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", "dev": true, "dependencies": { - "@jridgewell/set-array": "^1.2.1", - "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/sourcemap-codec": "^1.5.0", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/remapping": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz", + "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==", + "dev": true, + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", "@jridgewell/trace-mapping": "^0.3.24" - }, - "engines": { - "node": ">=6.0.0" } }, "node_modules/@jridgewell/resolve-uri": { @@ -957,19 +916,10 @@ "node": ">=6.0.0" } }, - "node_modules/@jridgewell/set-array": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", - "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", - "dev": true, - "engines": { - "node": ">=6.0.0" - } - }, "node_modules/@jridgewell/source-map": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.6.tgz", - "integrity": "sha512-1ZJTZebgqllO79ue2bm3rIGud/bOe0pP5BjSRCRxxYkEZS8STV7zN84UBbiYu7jy+eCKSnVIUgoWWE/tt+shMQ==", + "version": "0.3.11", + "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.11.tgz", + "integrity": "sha512-ZMp1V8ZFcPG5dIWnQLr3NSI1MiCU7UETdS/A0G8V/XWHvJv3ZsFqutJn1Y5RPmAPX6F3BiE397OqveU/9NCuIA==", "dev": true, "dependencies": { "@jridgewell/gen-mapping": "^0.3.5", @@ -977,15 +927,15 @@ } }, "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", - "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==", + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", + "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", "dev": true }, "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.25", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", - "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", + "version": "0.3.30", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.30.tgz", + "integrity": "sha512-GQ7Nw5G2lTu/BtHTKfXhKHok2WGetd4XYcVKGx00SjAk8GMwgJM3zr6zORiPGuOE+/vkc90KtTosSSvaCjKb2Q==", "dev": true, "dependencies": { "@jridgewell/resolve-uri": "^3.1.0", @@ -997,7 +947,6 @@ "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-0.2.12.tgz", "integrity": "sha512-ZVWUcfwY4E/yPitQJl481FjFo3K22D6qF0DuFH6Y/nbnE11GY5uguDxZMGXPQ8WQ0128MXQD7TnfHyK4oWoIJQ==", "dev": true, - "license": "MIT", "optional": true, "dependencies": { "@emnapi/core": "^1.4.3", @@ -1010,7 +959,6 @@ "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", "dev": true, - "license": "MIT", "optional": true, "engines": { "node": ">=14" @@ -1021,7 +969,6 @@ "resolved": "https://registry.npmjs.org/@pkgr/core/-/core-0.2.9.tgz", "integrity": "sha512-QNqXyfVS2wm9hweSYD2O7F0G06uurj9kZ96TRQE5Y9hU7+tgdZwIkbAKc5Ocy1HxEY2kuDQa6cQ1WRs/O5LFKA==", "dev": true, - "license": "MIT", "engines": { "node": "^12.20.0 || ^14.18.0 || >=16.0.0" }, @@ -1034,7 +981,6 @@ "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-16.0.1.tgz", "integrity": "sha512-tk5YCxJWIG81umIvNkSod2qK5KyQW19qcBF/B78n1bjtOON6gzKoVeSzAE8yHCZEDmqkHKkxplExA8KzdJLJpA==", "dev": true, - "license": "MIT", "dependencies": { "@rollup/pluginutils": "^5.0.1", "@types/resolve": "1.20.2", @@ -1059,7 +1005,6 @@ "resolved": "https://registry.npmjs.org/@rollup/plugin-replace/-/plugin-replace-6.0.2.tgz", "integrity": "sha512-7QaYCf8bqF04dOy7w/eHmJeNExxTYwvKAmlSAH/EaWWUzbT0h5sbF6bktFoX/0F/0qwng5/dWFMyf3gzaM8DsQ==", "dev": true, - "license": "MIT", "dependencies": { "@rollup/pluginutils": "^5.0.1", "magic-string": "^0.30.3" @@ -1103,7 +1048,6 @@ "resolved": "https://registry.npmjs.org/@rollup/plugin-typescript/-/plugin-typescript-12.1.4.tgz", "integrity": "sha512-s5Hx+EtN60LMlDBvl5f04bEiFZmAepk27Q+mr85L/00zPDn1jtzlTV6FWn81MaIwqfWzKxmOJrBWHU6vtQyedQ==", "dev": true, - "license": "MIT", "dependencies": { "@rollup/pluginutils": "^5.1.0", "resolve": "^1.22.1" @@ -1126,14 +1070,14 @@ } }, "node_modules/@rollup/pluginutils": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.1.0.tgz", - "integrity": "sha512-XTIWOPPcpvyKI6L1NHo0lFlCyznUEyPmPY1mc3KpPVDYulHSTvyeLNVW00QTLIAFNhR3kYnJTQHeGqU4M3n09g==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.3.0.tgz", + "integrity": "sha512-5EdhGZtnu3V88ces7s53hhfK5KSASnJZv8Lulpc04cWO3REESroJXg73DFsOmgbU2BhwV0E20bu2IDZb3VKW4Q==", "dev": true, "dependencies": { "@types/estree": "^1.0.0", "estree-walker": "^2.0.2", - "picomatch": "^2.3.1" + "picomatch": "^4.0.2" }, "engines": { "node": ">=14.0.0" @@ -1155,7 +1099,6 @@ "arm" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "android" @@ -1169,7 +1112,6 @@ "arm64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "android" @@ -1183,7 +1125,6 @@ "arm64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "darwin" @@ -1197,7 +1138,6 @@ "x64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "darwin" @@ -1211,7 +1151,6 @@ "arm64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "freebsd" @@ -1225,7 +1164,6 @@ "x64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "freebsd" @@ -1239,7 +1177,6 @@ "arm" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" @@ -1253,7 +1190,6 @@ "arm" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" @@ -1267,7 +1203,6 @@ "arm64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" @@ -1281,7 +1216,6 @@ "arm64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" @@ -1295,7 +1229,6 @@ "loong64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" @@ -1309,7 +1242,6 @@ "ppc64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" @@ -1323,7 +1255,6 @@ "riscv64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" @@ -1337,7 +1268,6 @@ "riscv64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" @@ -1351,7 +1281,6 @@ "s390x" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" @@ -1365,7 +1294,6 @@ "x64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" @@ -1379,7 +1307,6 @@ "x64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" @@ -1393,7 +1320,6 @@ "arm64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "openharmony" @@ -1407,7 +1333,6 @@ "arm64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "win32" @@ -1421,7 +1346,6 @@ "ia32" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "win32" @@ -1435,25 +1359,22 @@ "x64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "win32" ] }, "node_modules/@sinclair/typebox": { - "version": "0.34.38", - "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.34.38.tgz", - "integrity": "sha512-HpkxMmc2XmZKhvaKIZZThlHmx1L0I/V1hWK1NubtlFnr6ZqdiOpV72TKudZUNQjZNsyDBay72qFEhEvb+bcwcA==", - "dev": true, - "license": "MIT" + "version": "0.34.41", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.34.41.tgz", + "integrity": "sha512-6gS8pZzSXdyRHTIqoqSVknxolr1kzfy4/CeDnrzsVz8TTIWUbOBr6gnzOmTYJ3eXQNh4IYHIGi5aIL7sOZ2G/g==", + "dev": true }, "node_modules/@sinonjs/commons": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.1.tgz", "integrity": "sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ==", "dev": true, - "license": "BSD-3-Clause", "dependencies": { "type-detect": "4.0.8" } @@ -1463,7 +1384,6 @@ "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-13.0.5.tgz", "integrity": "sha512-36/hTbH2uaWuGVERyC6da9YwGWnzUZXuPro/F2LfsdOsLnCojz/iSH8MxUt/FD2S5XBSVPhmArFUXcpCQ2Hkiw==", "dev": true, - "license": "BSD-3-Clause", "dependencies": { "@sinonjs/commons": "^3.0.1" } @@ -1473,7 +1393,6 @@ "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.0.tgz", "integrity": "sha512-VyyPYFlOMNylG45GoAe0xDoLwWuowvf92F9kySqzYh8vmYm7D2u4iUJKa1tOUpS70Ku13ASrOkS4ScXFsTaCNQ==", "dev": true, - "license": "MIT", "optional": true, "dependencies": { "tslib": "^2.4.0" @@ -1512,12 +1431,12 @@ } }, "node_modules/@types/babel__traverse": { - "version": "7.20.7", - "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.20.7.tgz", - "integrity": "sha512-dkO5fhS7+/oos4ciWxyEyjWe48zmG6wbCheo/G2ZnHx4fs3EU6YC6UM8rk56gAjNJ9P3MTH2jo5jb92/K6wbng==", + "version": "7.28.0", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.28.0.tgz", + "integrity": "sha512-8PvcXf70gTDZBgt9ptxJ8elBeBjcLOAcOtoO/mPJjtji1+CdGbHgm77om1GrsPxsiE+uXIpNSK64UYaIwQXd4Q==", "dev": true, "dependencies": { - "@babel/types": "^7.20.7" + "@babel/types": "^7.28.2" } }, "node_modules/@types/common-tags": { @@ -1561,19 +1480,18 @@ "resolved": "https://registry.npmjs.org/@types/jest/-/jest-30.0.0.tgz", "integrity": "sha512-XTYugzhuwqWjws0CVz8QpM36+T+Dz5mTEBKhNs/esGLnCIlGdRy+Dq78NRjd7ls7r8BC8ZRMOrKlkO1hU0JOwA==", "dev": true, - "license": "MIT", "dependencies": { "expect": "^30.0.0", "pretty-format": "^30.0.0" } }, "node_modules/@types/node": { - "version": "20.14.11", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.11.tgz", - "integrity": "sha512-kprQpL8MMeszbz6ojB5/tU8PLN4kesnN8Gjzw349rDlNgsSzg90lAVj3llK99Dh7JON+t9AuscPPFW6mPbTnSA==", + "version": "24.3.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-24.3.1.tgz", + "integrity": "sha512-3vXmQDXy+woz+gnrTvuvNrPzekOi+Ds0ReMxw0LzBiK3a+1k0kQn9f2NWk+lgD4rJehFUmYy2gMhJ2ZI+7YP9g==", "dev": true, "dependencies": { - "undici-types": "~5.26.4" + "undici-types": "~7.10.0" } }, "node_modules/@types/resolve": { @@ -1593,7 +1511,6 @@ "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.33.tgz", "integrity": "sha512-WpxBCKWPLr4xSsHgz511rFJAM+wS28w2zEO1QDNY5zM/S8ok70NNfztH0xwhqKyaK0OHCbN98LDAZuy1ctxDkA==", "dev": true, - "license": "MIT", "dependencies": { "@types/yargs-parser": "*" } @@ -1618,7 +1535,6 @@ "arm" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "android" @@ -1632,7 +1548,6 @@ "arm64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "android" @@ -1646,7 +1561,6 @@ "arm64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "darwin" @@ -1660,7 +1574,6 @@ "x64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "darwin" @@ -1674,7 +1587,6 @@ "x64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "freebsd" @@ -1688,7 +1600,6 @@ "arm" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" @@ -1702,7 +1613,6 @@ "arm" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" @@ -1716,7 +1626,6 @@ "arm64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" @@ -1730,7 +1639,6 @@ "arm64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" @@ -1744,7 +1652,6 @@ "ppc64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" @@ -1758,7 +1665,6 @@ "riscv64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" @@ -1772,7 +1678,6 @@ "riscv64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" @@ -1786,7 +1691,6 @@ "s390x" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" @@ -1800,7 +1704,6 @@ "x64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" @@ -1814,7 +1717,6 @@ "x64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" @@ -1828,7 +1730,6 @@ "wasm32" ], "dev": true, - "license": "MIT", "optional": true, "dependencies": { "@napi-rs/wasm-runtime": "^0.2.11" @@ -1845,7 +1746,6 @@ "arm64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "win32" @@ -1859,7 +1759,6 @@ "ia32" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "win32" @@ -1873,16 +1772,15 @@ "x64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "win32" ] }, "node_modules/acorn": { - "version": "8.12.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz", - "integrity": "sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==", + "version": "8.15.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz", + "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", "dev": true, "bin": { "acorn": "bin/acorn" @@ -1907,11 +1805,10 @@ } }, "node_modules/ansi-regex": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.0.tgz", - "integrity": "sha512-TKY5pyBkHyADOPYlRT9Lx6F544mPl0vS5Ew7BJ45hA08Q+t3GjbueLliBWN3sMICk6+y7HdyxSzC4bWS8baBdg==", + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", + "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", "dev": true, - "license": "MIT", "engines": { "node": ">=12" }, @@ -1947,6 +1844,18 @@ "node": ">= 8" } }, + "node_modules/anymatch/node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, "node_modules/argparse": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", @@ -1961,7 +1870,6 @@ "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-30.1.2.tgz", "integrity": "sha512-IQCus1rt9kaSh7PQxLYRY5NmkNrNlU2TpabzwV7T2jljnpdHOcmnYYv8QmE04Li4S3a2Lj8/yXyET5pBarPr6g==", "dev": true, - "license": "MIT", "dependencies": { "@jest/transform": "30.1.2", "@types/babel__core": "^7.20.5", @@ -1979,9 +1887,9 @@ } }, "node_modules/babel-plugin-istanbul": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-7.0.0.tgz", - "integrity": "sha512-C5OzENSx/A+gt7t4VH1I2XsflxyPUmXRFPKBxt33xncdOmq7oROVM3bZv9Ysjjkv8OJYDMa+tKuKMvqU/H3xdw==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-7.0.1.tgz", + "integrity": "sha512-D8Z6Qm8jCvVXtIRkBnqNHX0zJ37rQcFJ9u8WOS6tkYOsRdHBzypCstaxWiu5ZIlqQtviRYbgnRLSoCEvjqcqbA==", "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.0.0", @@ -2009,11 +1917,10 @@ } }, "node_modules/babel-preset-current-node-syntax": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.1.0.tgz", - "integrity": "sha512-ldYss8SbBlWva1bs28q78Ju5Zq1F+8BrqBZZ0VFhLBvhh6lCpC2o3gDJi/5DRLs9FgYZCnmPYIVFU4lRXCkyUw==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.2.0.tgz", + "integrity": "sha512-E/VlAEzRrsLEb2+dv8yp3bo4scof3l9nR4lrld+Iy5NyVqgVYUJnDAmunkhPMisRI32Qc4iRiz425d8vM++2fg==", "dev": true, - "license": "MIT", "dependencies": { "@babel/plugin-syntax-async-generators": "^7.8.4", "@babel/plugin-syntax-bigint": "^7.8.3", @@ -2032,7 +1939,7 @@ "@babel/plugin-syntax-top-level-await": "^7.14.5" }, "peerDependencies": { - "@babel/core": "^7.0.0" + "@babel/core": "^7.0.0 || ^8.0.0-0" } }, "node_modules/babel-preset-jest": { @@ -2058,13 +1965,12 @@ "dev": true }, "node_modules/brace-expansion": { - "version": "1.1.12", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", - "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", + "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", "dev": true, "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" + "balanced-match": "^1.0.0" } }, "node_modules/braces": { @@ -2080,9 +1986,9 @@ } }, "node_modules/browserslist": { - "version": "4.25.0", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.25.0.tgz", - "integrity": "sha512-PJ8gYKeS5e/whHBh8xrwYK+dAvEj7JXtz6uTucnMRB8OiGTsKccFekoRrjajPBHV8oOY+2tI4uxeceSimKwMFA==", + "version": "4.25.4", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.25.4.tgz", + "integrity": "sha512-4jYpcjabC606xJ3kw2QwGEZKX0Aw7sgQdZCvIK9dhVSPh76BKo+C+btT1RRofH7B+8iNpEbgGNVWiLki5q93yg==", "dev": true, "funding": [ { @@ -2098,10 +2004,9 @@ "url": "https://github.com/sponsors/ai" } ], - "license": "MIT", "dependencies": { - "caniuse-lite": "^1.0.30001718", - "electron-to-chromium": "^1.5.160", + "caniuse-lite": "^1.0.30001737", + "electron-to-chromium": "^1.5.211", "node-releases": "^2.0.19", "update-browserslist-db": "^1.1.3" }, @@ -2144,7 +2049,6 @@ "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=6" } @@ -2159,9 +2063,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001723", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001723.tgz", - "integrity": "sha512-1R/elMjtehrFejxwmexeXAtae5UO9iSyFn6G/I806CYC/BLyyBk1EPhrKBkWhy6wM6Xnm47dSJQec+tLJ39WHw==", + "version": "1.0.30001741", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001741.tgz", + "integrity": "sha512-QGUGitqsc8ARjLdgAfxETDhRbJ0REsP6O3I96TAth/mVjh2cYzN2u+3AzPP3aVSm2FehEItaJw1xd+IGBXWeSw==", "dev": true, "funding": [ { @@ -2176,8 +2080,7 @@ "type": "github", "url": "https://github.com/sponsors/ai" } - ], - "license": "CC-BY-4.0" + ] }, "node_modules/chalk": { "version": "4.1.2", @@ -2200,15 +2103,14 @@ "resolved": "https://registry.npmjs.org/char-regex/-/char-regex-1.0.2.tgz", "integrity": "sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==", "dev": true, - "license": "MIT", "engines": { "node": ">=10" } }, "node_modules/ci-info": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-4.2.0.tgz", - "integrity": "sha512-cYY9mypksY8NRqgDB1XD1RiJL338v/551niynFTGkZOO2LHuB2OmOYxDIe/ttN9AHwrqdum1360G3ald0W9kCg==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-4.3.0.tgz", + "integrity": "sha512-l+2bNRMiQgcfILUi33labAZYIWlH1kWDp+ecNo5iisRKrbm0xcRyCww71/YU0Fkw0mAFpz9bJayXPjey6vkmaQ==", "dev": true, "funding": [ { @@ -2224,8 +2126,7 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-2.1.0.tgz", "integrity": "sha512-UX0OwmYRYQQetfrLEZeewIFFI+wSTofC+pMBLNuH3RUuu/xzG1oz84UCEDOSoQlN3fZ4+AzmV50ZYvGqkMh9yA==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/cliui": { "version": "8.0.1", @@ -2304,7 +2205,6 @@ "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", "integrity": "sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==", "dev": true, - "license": "MIT", "engines": { "iojs": ">= 1.0.0", "node": ">= 0.12.0" @@ -2314,8 +2214,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.2.tgz", "integrity": "sha512-lHl4d5/ONEbLlJvaJNtsF/Lz+WvB07u2ycqTYbdrq7UypDXailES4valYb2eWiJFxZlVmpGekfqoxQhzyFdT4Q==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/color-convert": { "version": "2.0.1", @@ -2367,7 +2266,6 @@ "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", "dev": true, - "license": "MIT", "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", @@ -2378,12 +2276,12 @@ } }, "node_modules/debug": { - "version": "4.3.5", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.5.tgz", - "integrity": "sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==", + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.1.tgz", + "integrity": "sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==", "dev": true, "dependencies": { - "ms": "2.1.2" + "ms": "^2.1.3" }, "engines": { "node": ">=6.0" @@ -2399,7 +2297,6 @@ "resolved": "https://registry.npmjs.org/dedent/-/dedent-1.7.0.tgz", "integrity": "sha512-HGFtf8yhuhGhqO07SV79tRp+br4MnbdjeVxotpn1QBl30pcLLCQjX5b2295ll0fv8RKDKsmWYrl05usHM9CewQ==", "dev": true, - "license": "MIT", "peerDependencies": { "babel-plugin-macros": "^3.1.0" }, @@ -2423,7 +2320,6 @@ "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz", "integrity": "sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" } @@ -2432,22 +2328,19 @@ "version": "0.2.0", "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/electron-to-chromium": { - "version": "1.5.167", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.167.tgz", - "integrity": "sha512-LxcRvnYO5ez2bMOFpbuuVuAI5QNeY1ncVytE/KXaL6ZNfzX1yPlAO0nSOyIHx2fVAuUprMqPs/TdVhUFZy7SIQ==", - "dev": true, - "license": "ISC" + "version": "1.5.215", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.215.tgz", + "integrity": "sha512-TIvGp57UpeNetj/wV/xpFNpWGb0b/ROw372lHPx5Aafx02gjTBtWnEEcaSX3W2dLM3OSdGGyHX/cHl01JQsLaQ==", + "dev": true }, "node_modules/emittery": { "version": "0.13.1", "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.13.1.tgz", "integrity": "sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=12" }, @@ -2459,15 +2352,13 @@ "version": "9.2.2", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/error-ex": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", "dev": true, - "license": "MIT", "dependencies": { "is-arrayish": "^0.2.1" } @@ -2477,7 +2368,6 @@ "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", "dev": true, - "license": "MIT", "engines": { "node": ">=6" } @@ -2515,7 +2405,6 @@ "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", "dev": true, - "license": "MIT", "dependencies": { "cross-spawn": "^7.0.3", "get-stream": "^6.0.0", @@ -2538,8 +2427,7 @@ "version": "3.0.7", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", - "dev": true, - "license": "ISC" + "dev": true }, "node_modules/exit-x": { "version": "0.2.2", @@ -2555,7 +2443,6 @@ "resolved": "https://registry.npmjs.org/expect/-/expect-30.1.2.tgz", "integrity": "sha512-xvHszRavo28ejws8FpemjhwswGj4w/BetHIL8cU49u4sGyXDw2+p3YbeDbj6xzlxi6kWTjIRSTJ+9sNXPnF0Zg==", "dev": true, - "license": "MIT", "dependencies": { "@jest/expect-utils": "30.1.2", "@jest/get-type": "30.1.0", @@ -2613,7 +2500,6 @@ "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.1.tgz", "integrity": "sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==", "dev": true, - "license": "ISC", "dependencies": { "cross-spawn": "^7.0.6", "signal-exit": "^4.0.1" @@ -2686,7 +2572,6 @@ "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", "dev": true, - "license": "MIT", "engines": { "node": ">=10" }, @@ -2699,7 +2584,6 @@ "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", "dev": true, - "license": "ISC", "dependencies": { "foreground-child": "^3.1.0", "jackspeak": "^3.1.2", @@ -2715,42 +2599,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/glob/node_modules/brace-expansion": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", - "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/glob/node_modules/minimatch": { - "version": "9.0.5", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", - "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", - "dev": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/globals": { - "version": "11.12.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", - "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=4" - } - }, "node_modules/graceful-fs": { "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", @@ -2761,7 +2609,6 @@ "version": "17.0.0-alpha.9", "resolved": "https://registry.npmjs.org/graphql/-/graphql-17.0.0-alpha.9.tgz", "integrity": "sha512-jVK1BsvX5pUIEpRDlEgeKJr80GAxl3B8ISsFDjXHtl2xAxMXVGTEFF4Q4R8NH0Gw7yMwcHDndkNjoNT5CbwHKA==", - "license": "MIT", "engines": { "node": "^16.19.0 || ^18.14.0 || >=19.7.0" } @@ -2771,7 +2618,6 @@ "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.8.tgz", "integrity": "sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==", "dev": true, - "license": "MIT", "dependencies": { "minimist": "^1.2.5", "neo-async": "^2.6.2", @@ -2813,15 +2659,13 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/human-signals": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", "dev": true, - "license": "Apache-2.0", "engines": { "node": ">=10.17.0" } @@ -2875,13 +2719,12 @@ "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/is-core-module": { - "version": "2.14.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.14.0.tgz", - "integrity": "sha512-a5dFJih5ZLYlRtDc0dZWP7RiKr6xIKzmn/oAYCDvdLThadVgyJwlaoQPmRtMSpz+rk0OGAgIu+TcM9HUF0fk1A==", + "version": "2.16.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.1.tgz", + "integrity": "sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==", "dev": true, "dependencies": { "hasown": "^2.0.2" @@ -2907,7 +2750,6 @@ "resolved": "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-2.1.0.tgz", "integrity": "sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=6" } @@ -2932,7 +2774,6 @@ "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" }, @@ -2944,8 +2785,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true, - "license": "ISC" + "dev": true }, "node_modules/istanbul-lib-coverage": { "version": "3.2.2", @@ -2989,7 +2829,6 @@ "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==", "dev": true, - "license": "BSD-3-Clause", "dependencies": { "istanbul-lib-coverage": "^3.0.0", "make-dir": "^4.0.0", @@ -3004,7 +2843,6 @@ "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-5.0.6.tgz", "integrity": "sha512-yg2d+Em4KizZC5niWhQaIomgf5WlL4vOOjZ5xGCmF8SnPE/mDWWXgvRExdcpCgh9lLRRa1/fSYp2ymmbJ1pI+A==", "dev": true, - "license": "BSD-3-Clause", "dependencies": { "@jridgewell/trace-mapping": "^0.3.23", "debug": "^4.1.1", @@ -3019,7 +2857,6 @@ "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.2.0.tgz", "integrity": "sha512-HGYWWS/ehqTV3xN10i23tkPkpH46MLCIMFNCaaKNavAXTF1RkqxawEPtnjnGZ6XKSInBKkiOA5BKS+aZiY3AvA==", "dev": true, - "license": "BSD-3-Clause", "dependencies": { "html-escaper": "^2.0.0", "istanbul-lib-report": "^3.0.0" @@ -3033,7 +2870,6 @@ "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", "dev": true, - "license": "BlueOak-1.0.0", "dependencies": { "@isaacs/cliui": "^8.0.2" }, @@ -3049,7 +2885,6 @@ "resolved": "https://registry.npmjs.org/jest/-/jest-30.1.2.tgz", "integrity": "sha512-iLreJmUWdANLD2UIbebrXxQqU9jIxv2ahvrBNfff55deL9DtVxm8ZJBLk/kmn0AQ+FyCTrNSlGbMdTgSasldYA==", "dev": true, - "license": "MIT", "dependencies": { "@jest/core": "30.1.2", "@jest/types": "30.0.5", @@ -3076,7 +2911,6 @@ "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-30.0.5.tgz", "integrity": "sha512-bGl2Ntdx0eAwXuGpdLdVYVr5YQHnSZlQ0y9HVDu565lCUAe9sj6JOtBbMmBBikGIegne9piDDIOeiLVoqTkz4A==", "dev": true, - "license": "MIT", "dependencies": { "execa": "^5.1.1", "jest-util": "30.0.5", @@ -3091,7 +2925,6 @@ "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-30.1.2.tgz", "integrity": "sha512-pyqgRv00fPbU3QBjN9I5QRd77eCWA19NA7BLgI1veFvbUIFpeDCKbnG1oyRr6q5/jPEW2zDfqZ/r6fvfE85vrA==", "dev": true, - "license": "MIT", "dependencies": { "@jest/environment": "30.1.2", "@jest/expect": "30.1.2", @@ -3123,7 +2956,6 @@ "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-30.1.2.tgz", "integrity": "sha512-Q7H6GGo/0TBB8Mhm3Ab7KKJHn6GeMVff+/8PVCQ7vXXahvr5sRERnNbxuVJAMiVY2JQm5roA7CHYOYlH+gzmUg==", "dev": true, - "license": "MIT", "dependencies": { "@jest/core": "30.1.2", "@jest/test-result": "30.1.2", @@ -3156,7 +2988,6 @@ "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-30.1.2.tgz", "integrity": "sha512-gCuBeE/cksjQ3e1a8H4YglZJuVPcnLZQK9jC70E6GbkHNQKPasnOO+r9IYdsUbAekb6c7eVRR8laGLMF06gMqg==", "dev": true, - "license": "MIT", "dependencies": { "@babel/core": "^7.27.4", "@jest/get-type": "30.1.0", @@ -3208,7 +3039,6 @@ "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-30.1.2.tgz", "integrity": "sha512-4+prq+9J61mOVXCa4Qp8ZjavdxzrWQXrI80GNxP8f4tkI2syPuPrJgdRPZRrfUTRvIoUwcmNLbqEJy9W800+NQ==", "dev": true, - "license": "MIT", "dependencies": { "@jest/diff-sequences": "30.0.1", "@jest/get-type": "30.1.0", @@ -3224,7 +3054,6 @@ "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-30.0.1.tgz", "integrity": "sha512-/vF78qn3DYphAaIc3jy4gA7XSAz167n9Bm/wn/1XhTLW7tTBIzXtCJpb/vcmc73NIIeeohCbdL94JasyXUZsGA==", "dev": true, - "license": "MIT", "dependencies": { "detect-newline": "^3.1.0" }, @@ -3237,7 +3066,6 @@ "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-30.1.0.tgz", "integrity": "sha512-A+9FKzxPluqogNahpCv04UJvcZ9B3HamqpDNWNKDjtxVRYB8xbZLFuCr8JAJFpNp83CA0anGQFlpQna9Me+/tQ==", "dev": true, - "license": "MIT", "dependencies": { "@jest/get-type": "30.1.0", "@jest/types": "30.0.5", @@ -3254,7 +3082,6 @@ "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-30.1.2.tgz", "integrity": "sha512-w8qBiXtqGWJ9xpJIA98M0EIoq079GOQRQUyse5qg1plShUCQ0Ek1VTTcczqKrn3f24TFAgFtT+4q3aOXvjbsuA==", "dev": true, - "license": "MIT", "dependencies": { "@jest/environment": "30.1.2", "@jest/fake-timers": "30.1.2", @@ -3273,7 +3100,6 @@ "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-30.1.0.tgz", "integrity": "sha512-JLeM84kNjpRkggcGpQLsV7B8W4LNUWz7oDNVnY1Vjj22b5/fAb3kk3htiD+4Na8bmJmjJR7rBtS2Rmq/NEcADg==", "dev": true, - "license": "MIT", "dependencies": { "@jest/types": "30.0.5", "@types/node": "*", @@ -3298,7 +3124,6 @@ "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-30.1.0.tgz", "integrity": "sha512-AoFvJzwxK+4KohH60vRuHaqXfWmeBATFZpzpmzNmYTtmRMiyGPVhkXpBqxUQunw+dQB48bDf4NpUs6ivVbRv1g==", "dev": true, - "license": "MIT", "dependencies": { "@jest/get-type": "30.1.0", "pretty-format": "30.0.5" @@ -3312,7 +3137,6 @@ "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-30.1.2.tgz", "integrity": "sha512-7ai16hy4rSbDjvPTuUhuV8nyPBd6EX34HkBsBcBX2lENCuAQ0qKCPb/+lt8OSWUa9WWmGYLy41PrEzkwRwoGZQ==", "dev": true, - "license": "MIT", "dependencies": { "@jest/get-type": "30.1.0", "chalk": "^4.1.2", @@ -3328,7 +3152,6 @@ "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-30.1.0.tgz", "integrity": "sha512-HizKDGG98cYkWmaLUHChq4iN+oCENohQLb7Z5guBPumYs+/etonmNFlg1Ps6yN9LTPyZn+M+b/9BbnHx3WTMDg==", "dev": true, - "license": "MIT", "dependencies": { "@babel/code-frame": "^7.27.1", "@jest/types": "30.0.5", @@ -3349,7 +3172,6 @@ "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-30.0.5.tgz", "integrity": "sha512-Od7TyasAAQX/6S+QCbN6vZoWOMwlTtzzGuxJku1GhGanAjz9y+QsQkpScDmETvdc9aSXyJ/Op4rhpMYBWW91wQ==", "dev": true, - "license": "MIT", "dependencies": { "@jest/types": "30.0.5", "@types/node": "*", @@ -3364,7 +3186,6 @@ "resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.3.tgz", "integrity": "sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w==", "dev": true, - "license": "MIT", "engines": { "node": ">=6" }, @@ -3391,7 +3212,6 @@ "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-30.1.0.tgz", "integrity": "sha512-hASe7D/wRtZw8Cm607NrlF7fi3HWC5wmA5jCVc2QjQAB2pTwP9eVZILGEi6OeSLNUtE1zb04sXRowsdh5CUjwA==", "dev": true, - "license": "MIT", "dependencies": { "chalk": "^4.1.2", "graceful-fs": "^4.2.11", @@ -3411,7 +3231,6 @@ "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-30.1.2.tgz", "integrity": "sha512-HJjyoaedY4wrwda+eqvgjbwFykrAnQEmhuT0bMyOV3GQIyLPcunZcjfkm77Zr11ujwl34ySdc4qYnm7SG75TjA==", "dev": true, - "license": "MIT", "dependencies": { "jest-regex-util": "30.0.1", "jest-snapshot": "30.1.2" @@ -3425,7 +3244,6 @@ "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-30.1.2.tgz", "integrity": "sha512-eu9AzpDY/QV+7NuMg6fZMpQ7M24cBkl5dyS1Xj7iwDPDriOmLUXR8rLojESibcIX+sCDTO4KvUeaxWCH1fbTvg==", "dev": true, - "license": "MIT", "dependencies": { "@jest/console": "30.1.2", "@jest/environment": "30.1.2", @@ -3459,7 +3277,6 @@ "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-30.1.2.tgz", "integrity": "sha512-zU02si+lAITgyRmVRgJn/AB4cnakq8+o7bP+5Z+N1A4r2mq40zGbmrg3UpYQWCkeim17tx8w1Tnmt6tQ6y9PGA==", "dev": true, - "license": "MIT", "dependencies": { "@jest/environment": "30.1.2", "@jest/fake-timers": "30.1.2", @@ -3493,7 +3310,6 @@ "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-30.1.2.tgz", "integrity": "sha512-4q4+6+1c8B6Cy5pGgFvjDy/Pa6VYRiGu0yQafKkJ9u6wQx4G5PqI2QR6nxTl43yy7IWsINwz6oT4o6tD12a8Dg==", "dev": true, - "license": "MIT", "dependencies": { "@babel/core": "^7.27.4", "@babel/generator": "^7.27.5", @@ -3526,7 +3342,6 @@ "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.2.tgz", "integrity": "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==", "dev": true, - "license": "ISC", "bin": { "semver": "bin/semver.js" }, @@ -3539,7 +3354,6 @@ "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-30.0.5.tgz", "integrity": "sha512-pvyPWssDZR0FlfMxCBoc0tvM8iUEskaRFALUtGQYzVEAqisAztmy+R8LnU14KT4XA0H/a5HMVTXat1jLne010g==", "dev": true, - "license": "MIT", "dependencies": { "@jest/types": "30.0.5", "@types/node": "*", @@ -3552,24 +3366,11 @@ "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, - "node_modules/jest-util/node_modules/picomatch": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", - "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, "node_modules/jest-validate": { "version": "30.1.0", "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-30.1.0.tgz", "integrity": "sha512-7P3ZlCFW/vhfQ8pE7zW6Oi4EzvuB4sgR72Q1INfW9m0FGo0GADYlPwIkf4CyPq7wq85g+kPMtPOHNAdWHeBOaA==", "dev": true, - "license": "MIT", "dependencies": { "@jest/get-type": "30.1.0", "@jest/types": "30.0.5", @@ -3587,7 +3388,6 @@ "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", "dev": true, - "license": "MIT", "engines": { "node": ">=10" }, @@ -3600,7 +3400,6 @@ "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-30.1.2.tgz", "integrity": "sha512-MtoGuEgqsBM8Jkn52oEj+mXLtF94+njPlHI5ydfduZL5MHrTFr14ZG1CUX1xAbY23dbSZCCEkEPhBM3cQd12Jg==", "dev": true, - "license": "MIT", "dependencies": { "@jest/test-result": "30.1.2", "@jest/types": "30.0.5", @@ -3620,7 +3419,6 @@ "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-30.1.0.tgz", "integrity": "sha512-uvWcSjlwAAgIu133Tt77A05H7RIk3Ho8tZL50bQM2AkvLdluw9NG48lRCl3Dt+MOH719n/0nnb5YxUwcuJiKRA==", "dev": true, - "license": "MIT", "dependencies": { "@types/node": "*", "@ungap/structured-clone": "^1.3.0", @@ -3637,7 +3435,6 @@ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", "dev": true, - "license": "MIT", "dependencies": { "has-flag": "^4.0.0" }, @@ -3652,8 +3449,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/js-yaml": { "version": "3.14.1", @@ -3673,7 +3469,6 @@ "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==", "dev": true, - "license": "MIT", "bin": { "jsesc": "bin/jsesc" }, @@ -3685,8 +3480,7 @@ "version": "2.3.1", "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/json5": { "version": "2.2.3", @@ -3705,7 +3499,6 @@ "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==", "dev": true, - "license": "MIT", "engines": { "node": ">=6" } @@ -3714,8 +3507,7 @@ "version": "1.2.4", "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/locate-path": { "version": "5.0.0", @@ -3740,18 +3532,17 @@ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", "dev": true, - "license": "ISC", "dependencies": { "yallist": "^3.0.2" } }, "node_modules/magic-string": { - "version": "0.30.10", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.10.tgz", - "integrity": "sha512-iIRwTIf0QKV3UAnYK4PU8uiEc4SRh5jX0mwpIwETPpHdhVM4f53RSwS/vXvN1JhGX+Cs7B8qIq3d6AH49O5fAQ==", + "version": "0.30.19", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.19.tgz", + "integrity": "sha512-2N21sPY9Ws53PZvsEpVtNuSW+ScYbQdp4b9qUaL+9QkHUrGFKo56Lg9Emg5s9V/qrtNBmiR01sYhUOwu3H+VOw==", "dev": true, "dependencies": { - "@jridgewell/sourcemap-codec": "^1.4.15" + "@jridgewell/sourcemap-codec": "^1.5.5" } }, "node_modules/make-dir": { @@ -3759,7 +3550,6 @@ "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", "dev": true, - "license": "MIT", "dependencies": { "semver": "^7.5.3" }, @@ -3775,7 +3565,6 @@ "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.2.tgz", "integrity": "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==", "dev": true, - "license": "ISC", "bin": { "semver": "bin/semver.js" }, @@ -3809,7 +3598,6 @@ "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", "dev": true, - "license": "MIT", "dependencies": { "braces": "^3.0.3", "picomatch": "^2.3.1" @@ -3818,26 +3606,40 @@ "node": ">=8.6" } }, + "node_modules/micromatch/node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, "node_modules/mimic-fn": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", "dev": true, - "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", "dev": true, "dependencies": { - "brace-expansion": "^1.1.7" + "brace-expansion": "^2.0.1" }, "engines": { - "node": "*" + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, "node_modules/minimist": { @@ -3845,7 +3647,6 @@ "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", "dev": true, - "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -3855,15 +3656,14 @@ "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", "dev": true, - "license": "ISC", "engines": { "node": ">=16 || 14 >=14.17" } }, "node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "dev": true }, "node_modules/napi-postinstall": { @@ -3871,7 +3671,6 @@ "resolved": "https://registry.npmjs.org/napi-postinstall/-/napi-postinstall-0.3.3.tgz", "integrity": "sha512-uTp172LLXSxuSYHv/kou+f6KW3SMppU9ivthaVTXian9sOt3XM/zHYHpRZiLgQoxeWfYUnslNWQHF1+G71xcow==", "dev": true, - "license": "MIT", "bin": { "napi-postinstall": "lib/cli.js" }, @@ -3886,15 +3685,13 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/neo-async": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/node-int64": { "version": "0.4.0", @@ -3903,11 +3700,10 @@ "dev": true }, "node_modules/node-releases": { - "version": "2.0.19", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.19.tgz", - "integrity": "sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw==", - "dev": true, - "license": "MIT" + "version": "2.0.20", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.20.tgz", + "integrity": "sha512-7gK6zSXEH6neM212JgfYFXe+GmZQM+fia5SsusuBIUgnPheLFBmIPhtFoAQRj8/7wASYQnbDlHPVwY0BefoFgA==", + "dev": true }, "node_modules/normalize-path": { "version": "3.0.0", @@ -3923,7 +3719,6 @@ "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", "dev": true, - "license": "MIT", "dependencies": { "path-key": "^3.0.0" }, @@ -3945,7 +3740,6 @@ "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", "dev": true, - "license": "MIT", "dependencies": { "mimic-fn": "^2.1.0" }, @@ -3961,7 +3755,6 @@ "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", "dev": true, - "license": "MIT", "dependencies": { "yocto-queue": "^0.1.0" }, @@ -4012,15 +3805,13 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==", - "dev": true, - "license": "BlueOak-1.0.0" + "dev": true }, "node_modules/parse-json": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", "dev": true, - "license": "MIT", "dependencies": { "@babel/code-frame": "^7.0.0", "error-ex": "^1.3.1", @@ -4057,7 +3848,6 @@ "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" } @@ -4073,7 +3863,6 @@ "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", "dev": true, - "license": "BlueOak-1.0.0", "dependencies": { "lru-cache": "^10.2.0", "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" @@ -4089,23 +3878,21 @@ "version": "10.4.3", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", - "dev": true, - "license": "ISC" + "dev": true }, "node_modules/picocolors": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", - "dev": true, - "license": "ISC" + "dev": true }, "node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", + "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", "dev": true, "engines": { - "node": ">=8.6" + "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/jonschlinkert" @@ -4116,7 +3903,6 @@ "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.7.tgz", "integrity": "sha512-TfySrs/5nm8fQJDcBDuUng3VOUKsd7S+zqvbOTiGXHfxX4wK31ard+hoNuvkicM/2YFzlpDgABOevKSsB4G/FA==", "dev": true, - "license": "MIT", "engines": { "node": ">= 6" } @@ -4138,7 +3924,6 @@ "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-30.0.5.tgz", "integrity": "sha512-D1tKtYvByrBkFLe2wHJl2bwMJIiT8rW+XA+TiataH79/FszLQMrpGEvzUVkzPau7OCO0Qnrhpe87PqtOAIB8Yw==", "dev": true, - "license": "MIT", "dependencies": { "@jest/schemas": "30.0.5", "ansi-styles": "^5.2.0", @@ -4153,7 +3938,6 @@ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", "dev": true, - "license": "MIT", "engines": { "node": ">=10" }, @@ -4175,8 +3959,7 @@ "type": "opencollective", "url": "https://opencollective.com/fast-check" } - ], - "license": "MIT" + ] }, "node_modules/randombytes": { "version": "2.1.0", @@ -4203,18 +3986,21 @@ } }, "node_modules/resolve": { - "version": "1.22.8", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", - "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", + "version": "1.22.10", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.10.tgz", + "integrity": "sha512-NPRy+/ncIMeDlTAsuqwKIiferiawhefFJtkNSW0qZJEqMEb+qBt/77B/jGeeek+F0uOeN05CDa6HXbbIgtVX4w==", "dev": true, "dependencies": { - "is-core-module": "^2.13.0", + "is-core-module": "^2.16.0", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" }, "bin": { "resolve": "bin/resolve" }, + "engines": { + "node": ">= 0.4" + }, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -4245,7 +4031,6 @@ "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.50.0.tgz", "integrity": "sha512-/Zl4D8zPifNmyGzJS+3kVoyXeDeT/GrsJM94sACNg9RtUE0hrHa1bNPtRSrfHTMH5HjRzce6K7rlTh3Khiw+pw==", "dev": true, - "license": "MIT", "dependencies": { "@types/estree": "1.0.8" }, @@ -4324,7 +4109,6 @@ "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", "dev": true, - "license": "MIT", "dependencies": { "shebang-regex": "^3.0.0" }, @@ -4337,7 +4121,6 @@ "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" } @@ -4347,7 +4130,6 @@ "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", "dev": true, - "license": "ISC", "engines": { "node": ">=14" }, @@ -4384,7 +4166,6 @@ "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.13.tgz", "integrity": "sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==", "dev": true, - "license": "MIT", "dependencies": { "buffer-from": "^1.0.0", "source-map": "^0.6.0" @@ -4413,7 +4194,6 @@ "resolved": "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz", "integrity": "sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ==", "dev": true, - "license": "MIT", "dependencies": { "char-regex": "^1.0.2", "strip-ansi": "^6.0.0" @@ -4427,7 +4207,6 @@ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" } @@ -4437,7 +4216,6 @@ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, - "license": "MIT", "dependencies": { "ansi-regex": "^5.0.1" }, @@ -4450,7 +4228,6 @@ "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", "dev": true, - "license": "MIT", "dependencies": { "eastasianwidth": "^0.2.0", "emoji-regex": "^9.2.2", @@ -4469,7 +4246,6 @@ "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, - "license": "MIT", "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -4484,7 +4260,6 @@ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" } @@ -4493,15 +4268,13 @@ "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/string-width-cjs/node_modules/strip-ansi": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, - "license": "MIT", "dependencies": { "ansi-regex": "^5.0.1" }, @@ -4510,11 +4283,10 @@ } }, "node_modules/strip-ansi": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", - "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.2.tgz", + "integrity": "sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==", "dev": true, - "license": "MIT", "dependencies": { "ansi-regex": "^6.0.1" }, @@ -4531,7 +4303,6 @@ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, - "license": "MIT", "dependencies": { "ansi-regex": "^5.0.1" }, @@ -4544,7 +4315,6 @@ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" } @@ -4554,7 +4324,6 @@ "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" } @@ -4564,7 +4333,6 @@ "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", "dev": true, - "license": "MIT", "engines": { "node": ">=6" } @@ -4574,7 +4342,6 @@ "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" }, @@ -4611,7 +4378,6 @@ "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.11.11.tgz", "integrity": "sha512-MeQTA1r0litLUf0Rp/iisCaL8761lKAZHaimlbGK4j0HysC4PLfqygQj9srcs0m2RdtDYnF8UuYyKpbjHYp7Jw==", "dev": true, - "license": "MIT", "dependencies": { "@pkgr/core": "^0.2.9" }, @@ -4623,13 +4389,13 @@ } }, "node_modules/terser": { - "version": "5.31.3", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.31.3.tgz", - "integrity": "sha512-pAfYn3NIZLyZpa83ZKigvj6Rn9c/vd5KfYGX7cN1mnzqgDcxWvrU5ZtAfIKhEXz9nRecw4z3LXkjaq96/qZqAA==", + "version": "5.44.0", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.44.0.tgz", + "integrity": "sha512-nIVck8DK+GM/0Frwd+nIhZ84pR/BX7rmXMfYwyg+Sri5oGVE99/E3KvXqpC2xHFxyqXyGHTKBSioxxplrO4I4w==", "dev": true, "dependencies": { "@jridgewell/source-map": "^0.3.3", - "acorn": "^8.8.2", + "acorn": "^8.15.0", "commander": "^2.20.0", "source-map-support": "~0.5.20" }, @@ -4664,6 +4430,16 @@ "node": ">=8" } }, + "node_modules/test-exclude/node_modules/brace-expansion": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, "node_modules/test-exclude/node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -4685,6 +4461,18 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/test-exclude/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, "node_modules/tmpl": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", @@ -4708,7 +4496,6 @@ "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.4.1.tgz", "integrity": "sha512-SaeUtjfpg9Uqu8IbeDKtdaS0g8lS6FT6OzM3ezrDfErPJPHNDo/Ey+VFGP1bQIDfagYDLyRpd7O15XpG1Es2Uw==", "dev": true, - "license": "MIT", "dependencies": { "bs-logger": "^0.2.6", "fast-json-stable-stringify": "^2.1.0", @@ -4761,7 +4548,6 @@ "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.2.tgz", "integrity": "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==", "dev": true, - "license": "ISC", "bin": { "semver": "bin/semver.js" }, @@ -4774,7 +4560,6 @@ "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.41.0.tgz", "integrity": "sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA==", "dev": true, - "license": "(MIT OR CC0-1.0)", "engines": { "node": ">=16" }, @@ -4783,16 +4568,15 @@ } }, "node_modules/tslib": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.3.tgz", - "integrity": "sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==" + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==" }, "node_modules/type-detect": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", "dev": true, - "license": "MIT", "engines": { "node": ">=4" } @@ -4814,7 +4598,6 @@ "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.2.tgz", "integrity": "sha512-CWBzXQrc/qOkhidw1OzBTQuYRbfyxDXJMVJ1XNwUHGROVmuaeiEm3OslpZ1RV96d7SKKjZKrSJu3+t/xlw3R9A==", "dev": true, - "license": "Apache-2.0", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -4828,7 +4611,6 @@ "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.19.3.tgz", "integrity": "sha512-v3Xu+yuwBXisp6QYTcH4UbH+xYJXqnq2m/LtQVWKWzYc1iehYnLixoQDN9FH6/j9/oybfd6W9Ghwkl8+UMKTKQ==", "dev": true, - "license": "BSD-2-Clause", "optional": true, "bin": { "uglifyjs": "bin/uglifyjs" @@ -4838,9 +4620,9 @@ } }, "node_modules/undici-types": { - "version": "5.26.5", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", - "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "version": "7.10.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.10.0.tgz", + "integrity": "sha512-t5Fy/nfn+14LuOc2KNYg75vZqClpAiqscVvMygNnlsHBFpSXdJaYtXMcdNLpl/Qvc3P2cB3s6lOV51nqsFq4ag==", "dev": true }, "node_modules/unrs-resolver": { @@ -4849,7 +4631,6 @@ "integrity": "sha512-bSjt9pjaEBnNiGgc9rUiHGKv5l4/TGzDmYw3RhnkJGtLhbnnA/5qJj7x3dNDCRx/PJxu774LlH8lCOlB4hEfKg==", "dev": true, "hasInstallScript": true, - "license": "MIT", "dependencies": { "napi-postinstall": "^0.3.0" }, @@ -4897,7 +4678,6 @@ "url": "https://github.com/sponsors/ai" } ], - "license": "MIT", "dependencies": { "escalade": "^3.2.0", "picocolors": "^1.1.1" @@ -4914,7 +4694,6 @@ "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.3.0.tgz", "integrity": "sha512-kiGUalWN+rgBJ/1OHZsBtU4rXZOfj/7rKQxULKlIzwzQSvMJUUNgPwJEEh7gU6xEVxC0ahoOBvN2YI8GH6FNgA==", "dev": true, - "license": "ISC", "dependencies": { "@jridgewell/trace-mapping": "^0.3.12", "@types/istanbul-lib-coverage": "^2.0.1", @@ -4938,7 +4717,6 @@ "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "dev": true, - "license": "ISC", "dependencies": { "isexe": "^2.0.0" }, @@ -4953,15 +4731,13 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", "integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/wrap-ansi": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", "dev": true, - "license": "MIT", "dependencies": { "ansi-styles": "^6.1.0", "string-width": "^5.0.1", @@ -4980,7 +4756,6 @@ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", "dev": true, - "license": "MIT", "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", @@ -4998,7 +4773,6 @@ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" } @@ -5007,15 +4781,13 @@ "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/wrap-ansi-cjs/node_modules/string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, - "license": "MIT", "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -5030,7 +4802,6 @@ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, - "license": "MIT", "dependencies": { "ansi-regex": "^5.0.1" }, @@ -5039,11 +4810,10 @@ } }, "node_modules/wrap-ansi/node_modules/ansi-styles": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", - "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz", + "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==", "dev": true, - "license": "MIT", "engines": { "node": ">=12" }, @@ -5083,8 +4853,7 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", - "dev": true, - "license": "ISC" + "dev": true }, "node_modules/yargs": { "version": "17.7.2", @@ -5159,7 +4928,6 @@ "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", "dev": true, - "license": "MIT", "engines": { "node": ">=10" }, diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/package.json b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/package.json index 2cbabc4c7..91afb8f8d 100644 --- a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/package.json +++ b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/package.json @@ -20,6 +20,7 @@ "@rollup/plugin-node-resolve": "16.0.1", "@rollup/plugin-typescript": "12.1.4", "@rollup/plugin-replace": "6.0.2", + "@rollup/plugin-terser": "0.4.4", "@types/common-tags": "1.8.4", "@types/jest": "30.0.0", "common-tags": "1.8.2", diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/__tests__/fieldPolicyDirectiveTests.ts b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/__tests__/fieldPolicyDirectiveTests.ts new file mode 100644 index 000000000..e4f1b68a6 --- /dev/null +++ b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/__tests__/fieldPolicyDirectiveTests.ts @@ -0,0 +1,525 @@ +import { + GraphQLError, + GraphQLField, + type GraphQLSchema, + Source, +} from "graphql"; +import { loadSchemaFromSources } from ".."; +// import { Field } from "../compiler/ir"; + +type FieldWithMeta = GraphQLField & { + _apolloFieldPolicies: string[]; +}; + +describe("given SDL without fieldPolicy", () => { + const schemaSDL: string = ` + type Query { + allRectangles(ids: [ID!]): [Rectangle!] + } + + interface Shape { + surface: Int! + } + + type Rectangle { + width: Int! + height: Int! + } + `; + + it("should set empty _apolloFieldPolicies property", () => { + const schema: GraphQLSchema = loadSchemaFromSources([ + new Source(schemaSDL, "Test Schema", { line: 1, column: 1 }), + ]); + + const rectType = schema.getTypeMap()["Rectangle"]; + if (!rectType || !("getFields" in rectType)) throw new Error("Missing Rectangle type."); + + const rectFields = rectType.getFields(); + for (const fieldName in rectFields) { + const field = rectFields[fieldName] as FieldWithMeta; + expect(field._apolloFieldPolicies ?? []).toEqual([]); + } + + const shape = schema.getTypeMap()["Shape"]; + if (!shape || !("getFields" in shape)) throw new Error("Missing Shape type."); + + const shapeFields = shape.getFields(); + for (const fieldName in shapeFields) { + const field = shapeFields[fieldName] as FieldWithMeta; + expect(field._apolloFieldPolicies ?? []).toEqual([]); + } + }); +}); + +describe("given SDL with valid fieldPolicy", () => { + const schemaSDL: string = ` + type Query { + rectangle(withWidth: Int!): Rectangle! + } + + type Rectangle { + width: Int! + height: Int! + } + + extend type Query @fieldPolicy(forField: "rectangle", keyArgs: "withWidth") + `; + + it("should set _apolloFieldPolicies property", () => { + const schema: GraphQLSchema = loadSchemaFromSources([ + new Source(schemaSDL, "Test Schema", { line: 1, column: 1 }), + ]); + + const queryType = schema.getTypeMap()["Query"]; + if (!queryType || !("getFields" in queryType)) throw new Error("Missing Query type."); + + const queryFields = queryType.getFields(); + for (const fieldName in queryFields) { + const field = queryFields[fieldName] as FieldWithMeta; + expect(fieldName).toEqual("rectangle"); + expect(field._apolloFieldPolicies).toHaveLength(1); + expect(field._apolloFieldPolicies).toContain("withWidth"); + } + }); +}); + +describe("given fieldPolicy on interface extension", () => { + const schemaSDL: string = ` + interface Animal { + animal(withName: String): Animal! + + id: ID! + species: String! + } + + type Dog implements Animal { + animal(withName: String): Animal! + + id: ID! + species: String! + owner: String + } + + extend interface Animal @fieldPolicy(forField: "animal", keyArgs: "withName") + `; + + it("should set _apolloFieldPolicies property", () => { + const schema: GraphQLSchema = loadSchemaFromSources([ + new Source(schemaSDL, "Test Schema", { line: 1, column: 1 }), + ]); + + const animalType = schema.getTypeMap()["Animal"]; + if (!animalType || !("getFields" in animalType)) throw new Error("Missing Animal type."); + + const animalFields = animalType.getFields(); + for (const fieldName in animalFields) { + const field = animalFields[fieldName] as FieldWithMeta; + if (fieldName == "animal") { + expect(field._apolloFieldPolicies).toHaveLength(1); + expect(field._apolloFieldPolicies).toContain("withName") + } else { + expect(field._apolloFieldPolicies ?? []).toEqual([]); + } + } + + const dogType = schema.getTypeMap()["Dog"]; + if (!dogType || !("getFields" in dogType)) throw new Error("Missing Dog type."); + + const dogFields = dogType.getFields(); + for (const fieldName in dogFields) { + const field = dogFields[fieldName] as FieldWithMeta; + if (fieldName == "animal") { + expect(field._apolloFieldPolicies).toHaveLength(1); + expect(field._apolloFieldPolicies).toContain("withName") + } else { + expect(field._apolloFieldPolicies ?? []).toEqual([]); + } + } + }); +}); + +describe("given fieldPolicy on interface and object extensions", () => { + const schemaSDL: string = ` + interface Animal { + animal(withName: String): Animal! + + id: ID! + species: String! + } + + type Dog implements Animal { + animal(withName: String): Animal! + + id: ID! + species: String! + owner: String + } + + extend interface Animal @fieldPolicy(forField: "animal", keyArgs: "withName") + extend type Dog @fieldPolicy(forField: "animal", keyArgs: "withName") + `; + + it("should set _apolloFieldPolicies property without duplicates.", () => { + const schema: GraphQLSchema = loadSchemaFromSources([ + new Source(schemaSDL, "Test Schema", { line: 1, column: 1 }), + ]); + + const animalType = schema.getTypeMap()["Animal"]; + if (!animalType || !("getFields" in animalType)) throw new Error("Missing Animal type."); + + const animalFields = animalType.getFields(); + for (const fieldName in animalFields) { + const field = animalFields[fieldName] as FieldWithMeta; + if (fieldName == "animal") { + expect(field._apolloFieldPolicies).toHaveLength(1); + expect(field._apolloFieldPolicies).toContain("withName") + } else { + expect(field._apolloFieldPolicies ?? []).toEqual([]); + } + } + + const dogType = schema.getTypeMap()["Dog"]; + if (!dogType || !("getFields" in dogType)) throw new Error("Missing Dog type."); + + const dogFields = dogType.getFields(); + for (const fieldName in dogFields) { + const field = dogFields[fieldName] as FieldWithMeta; + if (fieldName == "animal") { + expect(field._apolloFieldPolicies).toHaveLength(1); + expect(field._apolloFieldPolicies).toContain("withName") + } else { + expect(field._apolloFieldPolicies ?? []).toEqual([]); + } + } + }); +}); + +describe("given fieldPolicy on interface", () => { + const schemaSDL: string = ` + interface Animal @fieldPolicy(forField: "animal", keyArgs: "withName") { + animal(withName: String): Animal! + + id: ID! + species: String! + } + + type Dog implements Animal { + animal(withName: String): Animal! + + id: ID! + species: String! + owner: String + } + `; + + it("should set _apolloFieldPolicies property", () => { + const schema: GraphQLSchema = loadSchemaFromSources([ + new Source(schemaSDL, "Test Schema", { line: 1, column: 1 }), + ]); + + const animalType = schema.getTypeMap()["Animal"]; + if (!animalType || !("getFields" in animalType)) throw new Error("Missing Animal type."); + + const animalFields = animalType.getFields(); + for (const fieldName in animalFields) { + const field = animalFields[fieldName] as FieldWithMeta; + if (fieldName == "animal") { + expect(field._apolloFieldPolicies).toHaveLength(1); + expect(field._apolloFieldPolicies).toContain("withName") + } else { + expect(field._apolloFieldPolicies ?? []).toEqual([]); + } + } + + const dogType = schema.getTypeMap()["Dog"]; + if (!dogType || !("getFields" in dogType)) throw new Error("Missing Dog type."); + + const dogFields = dogType.getFields(); + for (const fieldName in dogFields) { + const field = dogFields[fieldName] as FieldWithMeta; + if (fieldName == "animal") { + expect(field._apolloFieldPolicies).toHaveLength(1); + expect(field._apolloFieldPolicies).toContain("withName") + } else { + expect(field._apolloFieldPolicies ?? []).toEqual([]); + } + } + }); +}); + +describe("given fieldPolicy on interface and object", () => { + const schemaSDL: string = ` + interface Animal @fieldPolicy(forField: "animal", keyArgs: "withName") { + animal(withName: String): Animal! + + id: ID! + species: String! + } + + type Dog implements Animal @fieldPolicy(forField: "animal", keyArgs: "withName") { + animal(withName: String): Animal! + + id: ID! + species: String! + owner: String + } + `; + + it("should set _apolloFieldPolicies property", () => { + const schema: GraphQLSchema = loadSchemaFromSources([ + new Source(schemaSDL, "Test Schema", { line: 1, column: 1 }), + ]); + + const animalType = schema.getTypeMap()["Animal"]; + if (!animalType || !("getFields" in animalType)) throw new Error("Missing Animal type."); + + const animalFields = animalType.getFields(); + for (const fieldName in animalFields) { + const field = animalFields[fieldName] as FieldWithMeta; + if (fieldName == "animal") { + expect(field._apolloFieldPolicies).toHaveLength(1); + expect(field._apolloFieldPolicies).toContain("withName") + } else { + expect(field._apolloFieldPolicies ?? []).toEqual([]); + } + } + + const dogType = schema.getTypeMap()["Dog"]; + if (!dogType || !("getFields" in dogType)) throw new Error("Missing Dog type."); + + const dogFields = dogType.getFields(); + for (const fieldName in dogFields) { + const field = dogFields[fieldName] as FieldWithMeta; + if (fieldName == "animal") { + expect(field._apolloFieldPolicies).toHaveLength(1); + expect(field._apolloFieldPolicies).toContain("withName") + } else { + expect(field._apolloFieldPolicies ?? []).toEqual([]); + } + } + }); +}); + +describe("given field with list input and non-list return type", () => { + const schemaSDL: string = ` + type Query { + allAnimals(withIds: [ID!]): Animal! + } + + type Animal { + id: ID! + name: String! + } + + extend type Query @fieldPolicy(forField: "allAnimals", keyArgs: "withIds") + `; + + it("should throw error requiring List return type", () => { + expect(() => + loadSchemaFromSources([ + new Source(schemaSDL, "Test Schema", { line: 1, column: 1 }), + ]) + ).toThrow(GraphQLError); + }); +}); + +describe("given field with list return type and non-list input type", () => { + const schemaSDL: string = ` + type Query { + allAnimals(withId: ID!): [Animal!] + } + + type Animal { + id: ID! + name: String! + } + + extend type Query @fieldPolicy(forField: "allAnimals", keyArgs: "withId") + `; + + it("should throw error requiring List input type", () => { + expect(() => + loadSchemaFromSources([ + new Source(schemaSDL, "Test Schema", { line: 1, column: 1 }), + ]) + ).toThrow(GraphQLError); + }); +}); + +describe("given field with list return type and multiple list input types", () => { + const schemaSDL: string = ` + type Query { + allAnimals(withIds: [ID!], andNames: [String!]): [Animal!] + } + + type Animal { + id: ID! + name: String! + } + + extend type Query @fieldPolicy(forField: "allAnimals", keyArgs: "withIds andNames") + `; + + it("should throw error requiring only 1 List input type", () => { + expect(() => + loadSchemaFromSources([ + new Source(schemaSDL, "Test Schema", { line: 1, column: 1 }), + ]) + ).toThrow(GraphQLError); + }); +}); + +describe("given field with list inputs and list return type", () => { + const schemaSDL: string = ` + type Query { + allAnimals(withIds: [ID!]): [Animal!] + } + + type Animal { + id: ID! + name: String! + } + + extend type Query @fieldPolicy(forField: "allAnimals", keyArgs: "withIds") + `; + + it("should set _apolloFieldPolicies on field ", () => { + const schema: GraphQLSchema = loadSchemaFromSources([ + new Source(schemaSDL, "Test Schema", { line: 1, column: 1 }), + ]); + + const queryType = schema.getTypeMap()["Query"]; + if (!queryType || !("getFields" in queryType)) throw new Error("Missing Query type."); + + const queryFields = queryType.getFields(); + for (const fieldName in queryFields) { + const field = queryFields[fieldName] as FieldWithMeta; + expect(fieldName).toEqual("allAnimals"); + expect(field._apolloFieldPolicies).toHaveLength(1); + expect(field._apolloFieldPolicies).toContain("withIds"); + } + }); +}); + +describe("given field policy with multiple valid keyArgs", () => { + const schemaSDL: string = ` + type Query { + allAnimals(withIds: [ID!], andSpecies: String!): [Animal!] + } + + type Animal { + id: ID! + name: String! + species: String! + } + + extend type Query @fieldPolicy(forField: "allAnimals", keyArgs: "withIds andSpecies") + `; + + it("should set _apolloFieldPolicies property", () => { + const schema: GraphQLSchema = loadSchemaFromSources([ + new Source(schemaSDL, "Test Schema", { line: 1, column: 1 }), + ]); + + const queryType = schema.getTypeMap()["Query"]; + if (!queryType || !("getFields" in queryType)) throw new Error("Missing Query type."); + + const queryFields = queryType.getFields(); + for (const fieldName in queryFields) { + const field = queryFields[fieldName] as FieldWithMeta; + expect(fieldName).toEqual("allAnimals"); + expect(field._apolloFieldPolicies).toHaveLength(2); + expect(field._apolloFieldPolicies).toEqual(["withIds", "andSpecies"]); + } + }); +}); + +describe("given field policy with one invalid keyArg", () => { + const schemaSDL: string = ` + type Query { + allAnimals(withIds: [ID]!, andSpecies: String!): [Animal!] + } + + type Animal { + id: ID! + name: String! + species: String! + } + + extend type Query @fieldPolicy(forField: "allAnimals", keyArgs: "withIds andName") + `; + + it("should throw error for invalid keyArgs", () => { + expect(() => + loadSchemaFromSources([ + new Source(schemaSDL, "Test Schema", { line: 1, column: 1 }), + ]) + ).toThrow(GraphQLError); + }); +}); + +describe("given field policy with nested list parameter", () => { + const schemaSDL: string = ` + type Query { + allAnimals(withIds: [[ID]!]!, andSpecies: String!): [Animal!] + } + + type Animal { + id: ID! + name: String! + species: String! + } + + extend type Query @fieldPolicy(forField: "allAnimals", keyArgs: "withIds andSpecies") + `; + + it("should throw error for nested list", () => { + expect(() => + loadSchemaFromSources([ + new Source(schemaSDL, "Test Schema", { line: 1, column: 1 }), + ]) + ).toThrow(GraphQLError); + }); +}); + +describe("given field policy with input object", () => { + const schemaSDL: string = ` + type Query { + allAnimals(withName: AnimalInput!, andSpecies: String!): Animal! + } + + input AnimalInput { + dog: DogInput + } + + input DogInput { + name: String! + } + + type Animal { + id: ID! + name: String! + species: String! + } + + extend type Query @fieldPolicy(forField: "allAnimals", keyArgs: "withName.dog.name andSpecies") + `; + + it("should validate dot notation nested values", () => { + const schema: GraphQLSchema = loadSchemaFromSources([ + new Source(schemaSDL, "Test Schema", { line: 1, column: 1 }), + ]); + + const queryType = schema.getTypeMap()["Query"]; + if (!queryType || !("getFields" in queryType)) throw new Error("Missing Query type."); + + const queryFields = queryType.getFields(); + for (const fieldName in queryFields) { + const field = queryFields[fieldName] as FieldWithMeta; + expect(fieldName).toEqual("allAnimals"); + expect(field._apolloFieldPolicies).toHaveLength(2); + expect(field._apolloFieldPolicies).toEqual(["withName.dog.name", "andSpecies"]); + } + }); +}); \ No newline at end of file diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/__tests__/sourceDefinitionTransformTests.ts b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/__tests__/sourceDefinitionTransformTests.ts index fe6f1270b..d56f3bfc5 100644 --- a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/__tests__/sourceDefinitionTransformTests.ts +++ b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/__tests__/sourceDefinitionTransformTests.ts @@ -27,7 +27,8 @@ interface Animal { interface Pet { name: String! -}`; +} +`; const schema: GraphQLSchema = loadSchemaFromSources([new Source(schemaSDL, "Test Schema", { line: 1, column: 1 })]); diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/compiler/index.ts b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/compiler/index.ts index c6a120497..09674a82e 100644 --- a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/compiler/index.ts +++ b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/compiler/index.ts @@ -353,6 +353,7 @@ export function compileToIR( description: !isMetaFieldName(name) && description ? description : undefined, deprecationReason: deprecationReason || undefined, directives: directives, + fieldPolicyKeys: (fieldDef as any)._apolloFieldPolicies || undefined }; function validateFieldName(node: FieldNode, disallowedNames?: Array, schemaNamespace?: string) { diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/compiler/ir.ts b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/compiler/ir.ts index 3b0233def..c6f835074 100644 --- a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/compiler/ir.ts +++ b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/compiler/ir.ts @@ -63,6 +63,7 @@ export interface Field { deprecationReason?: string; selectionSet?: SelectionSet; directives?: Directive[]; + fieldPolicyKeys?: string[]; } export interface Argument { diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/index.ts b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/index.ts index 8c2d65204..9018a6213 100644 --- a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/index.ts +++ b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/index.ts @@ -22,6 +22,7 @@ import { addExperimentalDeferDirectiveToIntrospectionSchema } from "./utilities/experimentalDeferDirective"; import { addTypePolicyDirectivesToSchema } from "./utilities/typePolicyDirective"; +import { addFieldPolicyDirectivesToSchema } from "./utilities/fieldPolicyDirective"; // We need to export all the classes we want to map to native objects, // so we have access to the constructor functions for type checks. @@ -63,6 +64,7 @@ export function loadSchemaFromSources(sources: Source[]): GraphQLSchema { const schema = buildASTSchema(document, { assumeValid: true, assumeValidSDL: true }) addTypePolicyDirectivesToSchema(schema) + addFieldPolicyDirectivesToSchema(schema) assertValidSchema(schema) return schema @@ -72,7 +74,7 @@ export function loadSchemaFromSources(sources: Source[]): GraphQLSchema { document = addExperimentalDeferDirectiveToIntrospectionSchema(schema, document) schema = extendSchema(schema, document, { assumeValid: true, assumeValidSDL: true }) addTypePolicyDirectivesToSchema(schema) - + addFieldPolicyDirectivesToSchema(schema) assertValidSchema(schema) return schema diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/utilities/apolloCodegenSchemaExtension.ts b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/utilities/apolloCodegenSchemaExtension.ts index 7ef8cbd51..95b3b8ddf 100644 --- a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/utilities/apolloCodegenSchemaExtension.ts +++ b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/utilities/apolloCodegenSchemaExtension.ts @@ -25,6 +25,28 @@ export const directive_typePolicy: DirectiveDefinitionNode = { locations: [nameNode("OBJECT"), nameNode("INTERFACE")] } +export const directive_fieldPolicy: DirectiveDefinitionNode = { + kind: Kind.DIRECTIVE_DEFINITION, + description: stringNode("A directive used by Apollo iOS to map query input data to cache keys of objects."), + name: nameNode("fieldPolicy"), + arguments: [ + { + kind: Kind.INPUT_VALUE_DEFINITION, + description: stringNode("The field you are setting the @fieldPolicy for."), + name: nameNode("forField"), + type: nonNullNode(typeNode(GraphQLString)) + }, + { + kind: Kind.INPUT_VALUE_DEFINITION, + description: stringNode("Set of fields used to compute the cache key."), + name: nameNode("keyArgs"), + type: nonNullNode(typeNode(GraphQLString)) + } + ], + repeatable: true, + locations: [nameNode("OBJECT"), nameNode("INTERFACE")] +} + export const directive_import_statement: DirectiveDefinitionNode = { kind: Kind.DIRECTIVE_DEFINITION, description: stringNode("A directive used by the Apollo iOS code generation engine to generate custom import statements in operation or fragment definition files. An import statement to import a module with the name provided in the `module` argument will be added to the generated definition file."), @@ -45,6 +67,7 @@ const apolloDirectives = [ directive_apollo_client_ios_localCacheMutation, directive_import_statement, directive_typePolicy, + directive_fieldPolicy ] export function addApolloCodegenSchemaExtensionToDocument(document: DocumentNode): DocumentNode { diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/utilities/fieldPolicyDirective.ts b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/utilities/fieldPolicyDirective.ts new file mode 100644 index 000000000..47fc290b1 --- /dev/null +++ b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/utilities/fieldPolicyDirective.ts @@ -0,0 +1,272 @@ +import { + DirectiveNode, + getNamedType, + getNullableType, + GraphQLCompositeType, + GraphQLError, + GraphQLField, + GraphQLInputType, + GraphQLInterfaceType, + GraphQLObjectType, + GraphQLSchema, + isInputObjectType, + isInterfaceType, + isListType, + isNonNullType, + isObjectType, + isUnionType, + Kind, + valueFromASTUntyped, +} from "graphql"; +import { directive_fieldPolicy } from "./apolloCodegenSchemaExtension"; + +const directiveName = directive_fieldPolicy.name.value + +export function addFieldPolicyDirectivesToSchema( + schema: GraphQLSchema +) { + const types = schema.getTypeMap(); + + for (const t in types) { + const type = types[t]; + + if (type instanceof GraphQLObjectType || type instanceof GraphQLInterfaceType) { + applyFieldPoliciesFor(type); + } + } +} + +export function applyFieldPoliciesFor( + type: GraphQLCompositeType +) { + const directives = fieldPolicyDirectivesFor(type) + if (!directives || isUnionType(type)) { + return; + } + + const typeFields = type.getFields() + + for (const directive of directives) { + const forFieldValueNode = directive.arguments?.find( + (b) => b.name.value === "forField" + )?.value + let forField: string | undefined = undefined; + if (forFieldValueNode?.kind === Kind.STRING) { + forField = forFieldValueNode.value + } + + if (!forField) { + throw new GraphQLError( + `@fieldPolicy directive must have a 'forField' value.`, + { nodes: directive } + ); + } + + const keyArgsValueNode = directive.arguments?.find( + (b) => b.name.value === "keyArgs" + )?.value + let keyArgs: string[] = []; + if (keyArgsValueNode?.kind === Kind.STRING) { + const rawArgs = keyArgsValueNode.value.split(/\s+/); + keyArgs = [...new Set(rawArgs.filter(Boolean))]; + } + + if (keyArgs.length === 0) { + throw new GraphQLError( + `'keyArgs' must be a space-separated list of identifiers.`, + { nodes: directive } + ); + } + + // check that the field exists + const actualField = typeFields[forField] + if (!actualField) { + throw new GraphQLError( + `Field "${forField}" does not exist on type "${type.name}".`, + { nodes: type.astNode ? [type.astNode, directive] : directive} + ); + } + + // validate the provided key args match an input parameter + validateKeyArgs(actualField, keyArgs); + + // List input and return type validation + validateListRules(actualField); + + (actualField as any)._apolloFieldPolicies = keyArgs; + } +} + +function fieldPolicyDirectivesFor( + type: GraphQLCompositeType +): DirectiveNode[] | undefined { + if(!isObjectType(type) && !isInterfaceType(type)) { + return undefined; + } + + const result: DirectiveNode[] = []; + + for (const extension of type.extensionASTNodes ?? []) { + const directive = extension.directives?.find( + (d) => d.name.value === directiveName + ); + if (directive) { + result.push(directive) + } + } + + for (const directive of type.astNode?.directives ?? []) { + if (directive.name.value === directiveName) { + result.push(directive); + } + } + + if("getInterfaces" in type) { + for (const interfaceType of type.getInterfaces()) { + const found = fieldPolicyDirectivesFor(interfaceType); + if (!found) { + continue; + } + + for (const foundDirective of found) { + var duplicate = false; + for (const directive of result) { + if (matchDirectiveArguments(directive, foundDirective)) { + duplicate = true; + break; + } + } + + if (!duplicate) { + result.push(foundDirective); + } + } + } + } + + return result +} + +function matchDirectiveArguments( + first: DirectiveNode, + second: DirectiveNode +): boolean { + return ( + (first.arguments ?? []) + .map((node) => + JSON.stringify([node.name.value, valueFromASTUntyped(node.value)]) + ) + .sort() + .toString() === + (second.arguments ?? []) + .map((node) => + JSON.stringify([node.name.value, valueFromASTUntyped(node.value)]) + ) + .sort() + .toString() + ); +} + +function validateKeyArgs( + actualField: GraphQLField, + keyArgs: string[] +): void { + for (const keyArg of keyArgs) { + validateKeyArgPath(actualField, keyArg); + } +} + +function validateKeyArgPath( + field: GraphQLField, + keyArg: string +): void { + const parts = keyArg.split(".").filter(Boolean); + const [argName, ...path] = parts; + + const arg = field.args.find(a => a.name === argName); + if (!arg) { + throw new GraphQLError( + `@fieldPolicy key argument "${keyArg}" does not exist as an input argument of field "${field.name}".`, + { nodes: field.astNode } + ); + } + + let currentType: GraphQLInputType = getBaseInputType(arg.type); + + for (let i = 0; i < path.length; i++) { + const segment = path[i]; + if (!isInputObjectType(currentType)) { + throw new GraphQLError( + `@fieldPolicy key "${keyArg}" traverses "${segment}" on non-object input type "${String(currentType)}".`, + { nodes: field.astNode } + ); + } + const fieldMap = currentType.getFields(); + const nextField = fieldMap[segment]; + if (!nextField) { + const suggestions = Object.keys(fieldMap).join(", "); + throw new GraphQLError( + `@fieldPolicy key "${keyArg}" refers to unknown input field "${segment}" on "${currentType.name}". Known fields: ${suggestions}`, + { nodes: field.astNode } + ); + } + currentType = getBaseInputType(nextField.type); + } + + if (!parts.length || isInputObjectType(currentType)) { + throw new GraphQLError( + `@fieldPolicy key "${keyArg}" must resolve to a leaf input type (scalar/enum), got "${String(currentType)}".`, + { nodes: field.astNode } + ); + } +} + +function getBaseInputType(type: GraphQLInputType): GraphQLInputType { + return getNamedType(type) as GraphQLInputType; +} + +function isListArg(t: GraphQLInputType): boolean { + return isListType(getNullableType(t)); +} + +function hasNestedList(t: GraphQLInputType): boolean { + let outer: any = isNonNullType(t) ? t.ofType : t; + if (!isListType(outer)) return false; + + let inner: any = isNonNullType(outer.ofType) ? outer.ofType.ofType : outer.ofType; + return isListType(inner); +} + +function validateListRules(field: GraphQLField) { + const hasListReturnType = isListType(getNullableType(field.type)); + + let numListInputs = 0; + + for (const arg of field.args) { + if (isListArg(arg.type)) { + numListInputs += 1; + + if (hasNestedList(arg.type)) { + throw new GraphQLError( + `@fieldPolicy does not allow nested list input parameters. Argument "${arg.name}" has type "${String(arg.type)}".`, + { nodes: field.astNode } + ); + } + } + } + + if (numListInputs > 1) { + throw new GraphQLError( + `@fieldPolicy can only have at most 1 List type input parameter.`, + { nodes: field.astNode } + ); + } + + if ((hasListReturnType && numListInputs !== 1) || + (!hasListReturnType && numListInputs !== 0)) { + throw new GraphQLError( + `@fieldPolicy requires either both a List return type and exactly 1 List input parameter, or neither.`, + { nodes: field.astNode } + ); + } +} \ No newline at end of file diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/tsconfig.base.json b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/tsconfig.base.json index f85872ce1..60ab9fdd9 100644 --- a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/tsconfig.base.json +++ b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/tsconfig.base.json @@ -15,6 +15,6 @@ "noImplicitReturns": true, "noUnusedLocals": true, "noUnusedParameters": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true }, } \ No newline at end of file diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/tsconfig.test.base.json b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/tsconfig.test.base.json index 54a491bc8..493d773e1 100644 --- a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/tsconfig.test.base.json +++ b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/tsconfig.test.base.json @@ -3,5 +3,5 @@ "compilerOptions": { "types": ["node", "jest"], }, - "files": ["./src/__testUtils__/matchers.ts"], + "files": ["./src/__testUtils__/matchers.ts"] } diff --git a/apollo-ios-codegen/Sources/IR/IR+Fields.swift b/apollo-ios-codegen/Sources/IR/IR+Fields.swift index 720b3bccc..8f54b3aa9 100644 --- a/apollo-ios-codegen/Sources/IR/IR+Fields.swift +++ b/apollo-ios-codegen/Sources/IR/IR+Fields.swift @@ -12,6 +12,9 @@ public class Field: Equatable, CustomDebugStringConvertible { public var responseKey: String { underlyingField.responseKey } public var type: GraphQLType { underlyingField.type } public var arguments: [CompilationResult.Argument]? { underlyingField.arguments } + + /// The `keyArgs` from the `@fieldPolicy` directive applied to this field in the schema + public var fieldPolicyKeys: [String]? { underlyingField.fieldPolicyKeys } fileprivate init( _ field: CompilationResult.Field, diff --git a/apollo-ios/Sources/Apollo/ExecutionSources/CacheDataExecutionSource.swift b/apollo-ios/Sources/Apollo/ExecutionSources/CacheDataExecutionSource.swift index 1050924f1..c6d959947 100644 --- a/apollo-ios/Sources/Apollo/ExecutionSources/CacheDataExecutionSource.swift +++ b/apollo-ios/Sources/Apollo/ExecutionSources/CacheDataExecutionSource.swift @@ -34,8 +34,9 @@ struct CacheDataExecutionSource: GraphQLExecutionSource { with info: FieldExecutionInfo, on object: Record ) -> PossiblyDeferred { - PossiblyDeferred { - let value = try object[info.cacheKeyForField()] + PossiblyDeferred { + + let value = try resolveCacheKey(with: info, on: object) switch value { case let reference as CacheReference: @@ -67,6 +68,73 @@ struct CacheDataExecutionSource: GraphQLExecutionSource { } } } + + private func resolveCacheKey( + with info: FieldExecutionInfo, + on object: Record + ) throws -> AnyHashable? { + if let fieldPolicyResult = resolveProgrammaticFieldPolicy(with: info, and: info.field.type) ?? + FieldPolicyDirectiveEvaluator(field: info.field, variables: info.parentInfo.variables)?.resolveFieldPolicy(), + let returnTypename = typename(for: info.field) { + + switch fieldPolicyResult { + case .single(let key): + return object[formatCacheKey(withInfo: key, andTypename: returnTypename)] + case .list(let keys): + return keys.map { object[formatCacheKey(withInfo: $0, andTypename: returnTypename)] } + } + } + + let key = try info.cacheKeyForField() + return object[key] + } + + private func resolveProgrammaticFieldPolicy( + with info: FieldExecutionInfo, + and type: Selection.Field.OutputType + ) -> FieldPolicyResult? { + guard let provider = info.parentInfo.schema.configuration.self as? (any FieldPolicyProvider.Type) else { + return nil + } + + switch type { + case .nonNull(let innerType): + return resolveProgrammaticFieldPolicy(with: info, and: innerType) + case .list(_): + if let keys = provider.cacheKeyList( + for: info.field, + variables: info.parentInfo.variables, + path: info.responsePath + ) { + return .list(keys) + } + default: + if let key = provider.cacheKey( + for: info.field, + variables: info.parentInfo.variables, + path: info.responsePath + ) { + return .single(key) + } + } + return nil + } + + private func formatCacheKey( + withInfo info: CacheKeyInfo, + andTypename typename: String + ) -> String { + return "\(info.uniqueKeyGroup ?? typename):\(info.id)" + } + + private func typename(for field: Selection.Field) -> String? { + switch field.type.namedType { + case .object(let selectionSetType): + return selectionSetType.__parentType.__typename + default: + return nil + } + } private func deferredResolve(reference: CacheReference) -> PossiblyDeferred { guard let transaction else { @@ -102,5 +170,3 @@ struct CacheDataExecutionSource: GraphQLExecutionSource { } } } - - diff --git a/apollo-ios/Sources/Apollo/FieldPolicyDirectiveEvaluator.swift b/apollo-ios/Sources/Apollo/FieldPolicyDirectiveEvaluator.swift new file mode 100644 index 000000000..d7891bab9 --- /dev/null +++ b/apollo-ios/Sources/Apollo/FieldPolicyDirectiveEvaluator.swift @@ -0,0 +1,234 @@ +import Foundation +#if !COCOAPODS +import ApolloAPI +#endif + +enum FieldPolicyResult { + case single(CacheKeyInfo) + case list([CacheKeyInfo]) +} + +struct FieldPolicyDirectiveEvaluator { + let field: Selection.Field + let fieldPolicy: Selection.FieldPolicy + let arguments: [String: InputValue] + let variables: GraphQLOperation.Variables? + + init?( + field: Selection.Field, + variables: GraphQLOperation.Variables? + ) { + self.field = field + self.variables = variables + + guard let fieldPolicy = field.fieldPolicy else { + return nil + } + self.fieldPolicy = fieldPolicy + + guard let arguments = field.arguments else { + return nil + } + self.arguments = arguments + } + + func resolveFieldPolicy() -> FieldPolicyResult? { + let keyArgs = parseKeyArgs(for: fieldPolicy) + + var singleValueArgs = [String?](repeating: nil, count: keyArgs.count) + var listArgIndex: Int? = nil + var listArgValues: [String] = [] + + for (index, arg) in keyArgs.enumerated() { + guard let argVal = arguments[arg.name] else { + return nil + } + + guard let resolved = argVal.resolveValue( + keyPath: arg.path, + variables: variables + ), !resolved.isEmpty else { + return nil + } + + if resolved.count > 1 { + listArgIndex = index + listArgValues = resolved + } else { + guard let value = resolved.first else { + return nil + } + singleValueArgs[index] = value + } + } + + if let listArgIndex = listArgIndex { + guard let cacheKeyList = processKeyList( + listArgIndex: listArgIndex, + listArgValues: listArgValues, + singleValueArgs: singleValueArgs, + keyArgs: keyArgs + ) else { + return nil + } + return .list(cacheKeyList) + } else { + let parts = singleValueArgs.compactMap { $0 } + return .single(CacheKeyInfo(id: parts.joined(separator: "+"))) + } + } + + private func processKeyList( + listArgIndex: Int, + listArgValues: [String], + singleValueArgs: [String?], + keyArgs: [ParsedKey] + ) -> [CacheKeyInfo]? { + var keys: [CacheKeyInfo] = [] + keys.reserveCapacity(listArgValues.count) + for value in listArgValues { + var parts = [String]() + parts.reserveCapacity(keyArgs.count) + for keyIndex in 0.. [ParsedKey] { + fieldPolicy.keyArgs.map { key in + if let dot = key.firstIndex(of: ".") { + let name = String(key[.. [String]? { + switch self { + case let strVal as String: + return [strVal] + + case let boolVal as Bool: + return boolVal ? ["true"] : ["false"] + + case let intVal as Int: + return [String(intVal)] + + case let doubleVal as Double: + return [String(doubleVal)] + + case let floatVal as Float: + return [String(floatVal)] + + case let arrVal as [JSONValue]: + let values: [String] = arrVal.compactMap { $0.cacheKeyComponentStringValue()?.first } + guard !values.isEmpty else { return nil } + return values + + case let objVal as JSONObject: + guard let keyPath, !keyPath.isEmpty else { return nil } + guard let targetValue = objVal.traverse(to: keyPath[...]) else { return nil } + return targetValue.cacheKeyComponentStringValue() + + default: + return [String(describing: self)] + } + } +} + +extension JSONObject { + fileprivate func traverse( + to path: ArraySlice + ) -> JSONValue? { + guard let head = path.first else { return self } + guard let next = self[head] else { return nil } + if path.count == 1 { return next } + if let nested = next as? JSONObject { + return nested.traverse(to: path.dropFirst()) + } + return nil + } +} + +extension InputValue { + fileprivate func resolveValue(keyPath: [String]? = nil, variables: [String: (any GraphQLOperationVariableValue)]? = nil) -> [String]? { + switch self { + case .scalar(let scalar): + return [scalar.cacheKeyComponentStringValue] + case .variable(let varName): + guard let varValue = variables?[varName] else { + return nil + } + return varValue._jsonEncodableValue?._jsonValue.cacheKeyComponentStringValue(keyPath: keyPath) + case .list(let list): + if list.contains(where: { if case .list = $0 { return true } else { return false } }) { + return nil + } + let values = list.compactMap { $0.resolveValue()?.first } + guard !values.isEmpty else { return nil } + return values + case .object(let dict): + guard let keyPath, !keyPath.isEmpty else { return nil } + guard let targetValue = self.traverse(through: dict, to: keyPath[...]) else { return nil } + return targetValue.resolveValue() + default: + return nil + } + } + + fileprivate func traverse( + through dict: [String: InputValue], + to path: ArraySlice + ) -> InputValue? { + guard let head = path.first else { return .object(dict) } + guard let next = dict[head] else { return nil } + if path.count == 1 { return next } + if case .object(let nested) = next { + return traverse(through: nested, to: path.dropFirst()) + } + return nil + } +} diff --git a/apollo-ios/Sources/ApolloAPI/FieldPolicyProvider.swift b/apollo-ios/Sources/ApolloAPI/FieldPolicyProvider.swift new file mode 100644 index 000000000..597572dec --- /dev/null +++ b/apollo-ios/Sources/ApolloAPI/FieldPolicyProvider.swift @@ -0,0 +1,25 @@ +/// A protocol that can be added to the ``SchemaConfiguration`` in order to provide custom field policy configuration. +/// +/// This protocol should be applied to your existing ``SchemaConfiguration`` and provides a way to provide custom +/// field policy cache keys in lieu of using the @fieldPolicy directive. +public protocol FieldPolicyProvider { + /// The entry point for resolving a cache key to read an object from the `NormalizedCache` for a field + /// that returns a single object. + /// + /// - Parameters: + /// - field: The ``Selection.Field`` of the operation being executed. + /// - variables: Optional ``GraphQLOperation.Variables`` input values provided to the operation. + /// - path: The ``ResponsePath`` representing the path within operation to get to the given field. + /// - Returns: A ``CacheKeyInfo`` describing the computed cache key. + static func cacheKey(for field: Selection.Field, variables: GraphQLOperation.Variables?, path: ResponsePath) -> CacheKeyInfo? + + /// The entry point for resolving cache keys to read objects from the `NormalizedCache` for a field + /// that returns a list of objects. + /// + /// - Parameters: + /// - field: The ``Selection.Field`` of the operation being executed. + /// - variables: Optional ``GraphQLOperation.Variables`` input values provided to the operation. + /// - path: The ``ResponsePath`` representing the path within operation to get to the given field. + /// - Returns: An array of ``CacheKeyInfo`` describing the computed cache keys. + static func cacheKeyList(for listField: Selection.Field, variables: GraphQLOperation.Variables?, path: ResponsePath) -> [CacheKeyInfo]? +} diff --git a/apollo-ios/Sources/Apollo/ResponsePath.swift b/apollo-ios/Sources/ApolloAPI/ResponsePath.swift similarity index 100% rename from apollo-ios/Sources/Apollo/ResponsePath.swift rename to apollo-ios/Sources/ApolloAPI/ResponsePath.swift diff --git a/apollo-ios/Sources/ApolloAPI/SchemaConfiguration.swift b/apollo-ios/Sources/ApolloAPI/SchemaConfiguration.swift index b0c9473f7..a448dea10 100644 --- a/apollo-ios/Sources/ApolloAPI/SchemaConfiguration.swift +++ b/apollo-ios/Sources/ApolloAPI/SchemaConfiguration.swift @@ -39,5 +39,4 @@ public protocol SchemaConfiguration { /// Represented as a ``ObjectData`` dictionary. /// - Returns: A ``CacheKeyInfo`` describing the computed cache key for the response object. static func cacheKeyInfo(for type: Object, object: ObjectData) -> CacheKeyInfo? - } diff --git a/apollo-ios/Sources/ApolloAPI/Selection.swift b/apollo-ios/Sources/ApolloAPI/Selection.swift index f8cc3390c..dc60e23ff 100644 --- a/apollo-ios/Sources/ApolloAPI/Selection.swift +++ b/apollo-ios/Sources/ApolloAPI/Selection.swift @@ -15,6 +15,7 @@ public enum Selection { public let alias: String? public let arguments: [String: InputValue]? public let type: OutputType + public let fieldPolicy: FieldPolicy? public var responseKey: String { return alias ?? name @@ -24,12 +25,14 @@ public enum Selection { _ name: String, alias: String? = nil, type: OutputType, - arguments: [String: InputValue]? = nil + arguments: [String: InputValue]? = nil, + fieldPolicy: FieldPolicy? = nil ) { self.name = name self.alias = alias self.arguments = arguments self.type = type + self.fieldPolicy = fieldPolicy } public indirect enum OutputType { @@ -54,6 +57,17 @@ public enum Selection { } } } + + public struct FieldPolicy: Hashable { + public let keyArgs: [String] + + public init( + keyArgs: [String] + ) { + self.keyArgs = keyArgs + } + + } // MARK: - Convenience Initializers @@ -61,9 +75,10 @@ public enum Selection { _ name: String, alias: String? = nil, _ type: any OutputTypeConvertible.Type, - arguments: [String: InputValue]? = nil + arguments: [String: InputValue]? = nil, + fieldPolicy: FieldPolicy? = nil ) -> Selection { - .field(.init(name, alias: alias, type: type._asOutputType, arguments: arguments)) + .field(.init(name, alias: alias, type: type._asOutputType, arguments: arguments, fieldPolicy: fieldPolicy)) } @inlinable static public func include(