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N,IAAI,EACJ,KAAM,EAAO,KACb,WAEF,CAAE,MAAO,GACR,MAAM,EAAQ,aAAe,MAAQ,EAAM,IAAI,MAAM,OAAO,IAC5D,GAAI,KAAK,QAAS,IACjB,KAAK,QAAQ,EACd,CAAE,MACD,MAAO,CACN,IAAI,EACJ,QACA,cAEF,CACA,MAAO,CACN,IAAI,EACJ,QACA,cAEF,CACD,CAWA,aAAM,CAAQ,EAAO,EAAW,GAC/B,MAAM,QAAe,KAAK,YAAY,EAAO,EAAW,GACxD,IAAK,EAAO,GAAI,MAAM,EAAO,MAC7B,OAAO,EAAO,IACf,GAYD,MAAM,IAAM,CAAC,KAAY,KACxB,IAAI,EAAS,GACb,IAAK,MAAO,EAAO,KAAW,EAAQ,UAAW,GAAU,GAAG,IAAS,KAAS,EAAS,EAAO,GAAS,KACzG,OAAO,EAAO,MAAM,SAIZ,qBAAsB,oBAAqB,IAAK","file":"/npm/awesome-graphql-client@3.0.0/dist/awesome-graphql-client.mjs","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/awesome-graphql-client@3.0.0/dist/awesome-graphql-client.mjs\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","//#region src/GraphQLRequestError.ts\nvar GraphQLRequestError = class extends Error {\n\tquery;\n\tvariables;\n\tresponse;\n\textensions;\n\tfieldErrors;\n\tconstructor({ query, variables, response, message, extensions, fieldErrors }) {\n\t\tsuper(`GraphQL Request Error: ${message}`);\n\t\tthis.query = query;\n\t\tif (variables) this.variables = variables;\n\t\tif (extensions) this.extensions = extensions;\n\t\tif (fieldErrors) this.fieldErrors = fieldErrors;\n\t\tObject.defineProperty(this, \"response\", {\n\t\t\tenumerable: false,\n\t\t\tvalue: response\n\t\t});\n\t}\n};\n\n//#endregion\n//#region src/util/assert.ts\nfunction assert(condition, msg) {\n\tif (!condition) throw new Error(msg);\n}\n\n//#endregion\n//#region src/util/extractFiles.ts\nconst isIterable = (value) => Array.isArray(value) || typeof FileList !== \"undefined\" && value instanceof FileList;\nfunction isPlainObject(value) {\n\tif (typeof value !== \"object\" || value === null) return false;\n\tconst prototype = Object.getPrototypeOf(value);\n\treturn (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in value) && !(Symbol.iterator in value);\n}\n/**\n* Parses object and detects files according to GraphQL Upload Spec:\n* https://github.com/jaydenseric/graphql-multipart-request-spec\n*\n* @param operation GraphQL-operation\n* @param isUpload predicate for checking if value is a file\n*/\nfunction extractFiles(operation, isUpload) {\n\tconst clone = {};\n\tconst files = /* @__PURE__ */ new Map();\n\tconst stackSet = /* @__PURE__ */ new Set();\n\tfunction extract(paths, value, target) {\n\t\tconst currentPath = paths.at(-1);\n\t\tif (isUpload(value)) {\n\t\t\tlet saved = files.get(value);\n\t\t\tif (!saved) {\n\t\t\t\tsaved = [];\n\t\t\t\tfiles.set(value, saved);\n\t\t\t}\n\t\t\tsaved.push(paths.join(\".\"));\n\t\t\ttarget[currentPath] = null;\n\t\t} else if (isIterable(value) || isPlainObject(value)) {\n\t\t\tif (stackSet.has(value)) throw new Error(`Circular dependency detected in ${paths.join(\".\")}`);\n\t\t\tstackSet.add(value);\n\t\t\tlet newObj;\n\t\t\tif (isIterable(value)) {\n\t\t\t\tnewObj = [];\n\t\t\t\tfor (let i = 0; i < value.length; i++) extract([...paths, String(i)], value[i], newObj);\n\t\t\t} else {\n\t\t\t\tnewObj = {};\n\t\t\t\tfor (const [key, item] of Object.entries(value)) extract([...paths, key], item, newObj);\n\t\t\t}\n\t\t\ttarget[currentPath] = newObj;\n\t\t\tstackSet.delete(value);\n\t\t} else target[currentPath] = value;\n\t}\n\tfor (const [key, item] of Object.entries(operation)) extract([key], item, clone);\n\treturn {\n\t\tclone,\n\t\tfiles\n\t};\n}\n\n//#endregion\n//#region src/util/formatGetRequestUrl.ts\n/**\n* Returns URL for GraphQL GET Requests:\n* https://graphql.org/learn/serving-over-http/#get-request\n*/\nfunction formatGetRequestUrl({ endpoint, query, variables }) {\n\tconst searchParams = new URLSearchParams();\n\tsearchParams.set(\"query\", query);\n\tif (variables && Object.keys(variables).length > 0) searchParams.set(\"variables\", JSON.stringify(variables));\n\treturn `${endpoint}?${searchParams.toString()}`;\n}\n\n//#endregion\n//#region src/util/isFileUpload.ts\n/**\n* Duck-typing if value is a stream\n* https://github.com/sindresorhus/is-stream/blob/3750505b0727f6df54324784fe369365ef78841e/index.js#L3\n*\n* @param value incoming value\n*/\nconst isStreamLike = (value) => typeof value === \"object\" && value !== null && typeof value.pipe === \"function\";\n/**\n* Duck-typing if value is a promise\n*\n* @param value incoming value\n*/\nconst isPromiseLike = (value) => typeof value === \"object\" && value !== null && typeof value.then === \"function\";\n/**\n* Returns true if value is a file.\n* Supports File, Blob, Buffer and stream-like instances\n*\n* @param value incoming value\n*/\nconst isFileUpload = (value) => typeof File !== \"undefined\" && value instanceof File || typeof Blob !== \"undefined\" && value instanceof Blob || typeof Buffer !== \"undefined\" && value instanceof Buffer || isStreamLike(value) || isPromiseLike(value);\n\n//#endregion\n//#region src/util/isResponseJSON.ts\nconst isResponseJSON = (response) => (response.headers.get(\"Content-Type\") ?? \"\").includes(\"application/json\");\n\n//#endregion\n//#region src/util/normalizeHeaders.ts\nconst isHeaders = (headers) => typeof headers.get === \"function\";\nconst isIterableHeaders = (headers) => typeof headers[Symbol.iterator] === \"function\";\n/**\n* This function will convert headers to { [key: string]: string }\n* and make header keys lowercase (as per https://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2)\n*\n* @param headers request headers\n*/\nfunction normalizeHeaders(headers) {\n\tif (headers === void 0) return {};\n\tif (isHeaders(headers)) {\n\t\tconst newHeaders = {};\n\t\theaders.forEach((value, key) => {\n\t\t\tnewHeaders[key] = value;\n\t\t});\n\t\treturn newHeaders;\n\t}\n\tif (isIterableHeaders(headers)) {\n\t\tconst newHeaders = {};\n\t\tfor (const [key, value] of headers) newHeaders[key.toLowerCase()] = value;\n\t\treturn newHeaders;\n\t}\n\treturn Object.fromEntries(Object.entries(headers).map(([key, value]) => [key.toLowerCase(), value]));\n}\n\n//#endregion\n//#region src/AwesomeGraphQLClient.ts\nvar AwesomeGraphQLClient = class {\n\tendpoint;\n\tfetch;\n\tfetchOptions;\n\tformatQuery;\n\tFormData;\n\tonError;\n\tisFileUpload;\n\tconstructor(config) {\n\t\tassert(config.endpoint !== void 0, \"endpoint is required\");\n\t\tassert(config.fetch !== void 0 || typeof fetch !== \"undefined\", \"Fetch must be polyfilled or passed in new AwesomeGraphQLClient({ fetch })\");\n\t\tassert(!config.formatQuery || typeof config.formatQuery === \"function\", \"Invalid config value: `formatQuery` must be a function\");\n\t\tassert(!config.onError || typeof config.onError === \"function\", \"Invalid config value: `onError` must be a function\");\n\t\tassert(!config.isFileUpload || typeof config.isFileUpload === \"function\", \"Invalid config value: `isFileUpload` should be a function\");\n\t\tthis.endpoint = config.endpoint;\n\t\tthis.fetch = config.fetch || fetch.bind(null);\n\t\tthis.fetchOptions = config.fetchOptions;\n\t\tthis.FormData = config.FormData !== void 0 ? config.FormData : typeof FormData !== \"undefined\" ? FormData : void 0;\n\t\tthis.formatQuery = config.formatQuery;\n\t\tthis.onError = config.onError;\n\t\tthis.isFileUpload = config.isFileUpload || isFileUpload;\n\t}\n\tcreateRequestBody(query, variables) {\n\t\tconst { clone, files } = extractFiles({\n\t\t\tquery,\n\t\t\tvariables\n\t\t}, this.isFileUpload);\n\t\tconst operationJSON = JSON.stringify(clone);\n\t\tif (files.size === 0) return operationJSON;\n\t\tassert(this.FormData !== void 0, \"FormData must be polyfilled or passed in new AwesomeGraphQLClient({ FormData })\");\n\t\tconst form = new this.FormData();\n\t\tform.append(\"operations\", operationJSON);\n\t\tconst map = {};\n\t\tlet i = 0;\n\t\tfor (const paths of files.values()) map[++i] = paths;\n\t\tform.append(\"map\", JSON.stringify(map));\n\t\ti = 0;\n\t\tfor (const file of files.keys()) form.append(`${++i}`, file);\n\t\treturn form;\n\t}\n\t/**\n\t* Sets a new GraphQL endpoint\n\t*\n\t* @param endpoint new overrides for endpoint\n\t*/\n\tsetEndpoint(endpoint) {\n\t\tassert(endpoint !== void 0, \"endpoint is required\");\n\t\tthis.endpoint = endpoint;\n\t}\n\t/**\n\t* Returns current GraphQL endpoint\n\t*/\n\tgetEndpoint() {\n\t\treturn this.endpoint;\n\t}\n\t/**\n\t* Sets new overrides for fetch options\n\t*\n\t* @param fetchOptions new overrides for fetch options\n\t*/\n\tsetFetchOptions(fetchOptions) {\n\t\tthis.fetchOptions = fetchOptions;\n\t}\n\t/**\n\t* Returns current overrides for fetch options\n\t*/\n\tgetFetchOptions() {\n\t\treturn this.fetchOptions;\n\t}\n\t/**\n\t* Sends GraphQL Request and returns object with 'ok: true', 'data' and 'response' fields\n\t* or with 'ok: false' and 'error' fields.\n\t* Notice: this function never throws\n\t*\n\t* @example\n\t* const result = await requestSafe(...)\n\t* if (!result.ok) {\n\t*   throw result.error\n\t* }\n\t* console.log(result.data)\n\t*\n\t* @param query query\n\t* @param variables variables\n\t* @param fetchOptions overrides for fetch options\n\t*/\n\tasync requestSafe(query, variables, fetchOptions) {\n\t\tlet partialData = void 0;\n\t\ttry {\n\t\t\tconst queryAsString = this.formatQuery ? this.formatQuery(query) : query;\n\t\t\tassert(typeof queryAsString === \"string\", `Query should be a string, not ${typeof queryAsString}. Otherwise provide formatQuery option`);\n\t\t\tconst options = {\n\t\t\t\tmethod: \"POST\",\n\t\t\t\t...this.fetchOptions,\n\t\t\t\t...fetchOptions,\n\t\t\t\theaders: {\n\t\t\t\t\t...normalizeHeaders(this.fetchOptions?.headers),\n\t\t\t\t\t...normalizeHeaders(fetchOptions?.headers)\n\t\t\t\t}\n\t\t\t};\n\t\t\tlet response;\n\t\t\tif (options.method?.toUpperCase() === \"GET\") {\n\t\t\t\tconst url = formatGetRequestUrl({\n\t\t\t\t\tendpoint: this.endpoint,\n\t\t\t\t\tquery: queryAsString,\n\t\t\t\t\tvariables\n\t\t\t\t});\n\t\t\t\tresponse = await this.fetch(url, options);\n\t\t\t} else {\n\t\t\t\tconst body = this.createRequestBody(queryAsString, variables);\n\t\t\t\tresponse = await this.fetch(this.endpoint, {\n\t\t\t\t\t...options,\n\t\t\t\t\tbody,\n\t\t\t\t\theaders: typeof body === \"string\" ? {\n\t\t\t\t\t\t...options.headers,\n\t\t\t\t\t\t\"Content-Type\": \"application/json\"\n\t\t\t\t\t} : options.headers\n\t\t\t\t});\n\t\t\t}\n\t\t\tif (!response.ok) {\n\t\t\t\tif (isResponseJSON(response)) {\n\t\t\t\t\tconst { data, errors } = await response.json();\n\t\t\t\t\tif (errors?.[0] !== void 0) {\n\t\t\t\t\t\tpartialData = data;\n\t\t\t\t\t\tthrow new GraphQLRequestError({\n\t\t\t\t\t\t\tquery: queryAsString,\n\t\t\t\t\t\t\tvariables,\n\t\t\t\t\t\t\tresponse,\n\t\t\t\t\t\t\tmessage: errors[0].message,\n\t\t\t\t\t\t\textensions: errors[0].extensions,\n\t\t\t\t\t\t\tfieldErrors: errors\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthrow new GraphQLRequestError({\n\t\t\t\t\tquery: queryAsString,\n\t\t\t\t\tvariables,\n\t\t\t\t\tresponse,\n\t\t\t\t\tmessage: `Http Status ${response.status}`\n\t\t\t\t});\n\t\t\t}\n\t\t\tconst result = await response.json();\n\t\t\tif (result.errors?.[0] !== void 0) {\n\t\t\t\tpartialData = result.data;\n\t\t\t\tthrow new GraphQLRequestError({\n\t\t\t\t\tquery: queryAsString,\n\t\t\t\t\tvariables,\n\t\t\t\t\tresponse,\n\t\t\t\t\tmessage: result.errors[0].message,\n\t\t\t\t\textensions: result.errors[0].extensions,\n\t\t\t\t\tfieldErrors: result.errors\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tok: true,\n\t\t\t\tdata: result.data,\n\t\t\t\tresponse\n\t\t\t};\n\t\t} catch (err) {\n\t\t\tconst error = err instanceof Error ? err : new Error(String(err));\n\t\t\tif (this.onError) try {\n\t\t\t\tthis.onError(error);\n\t\t\t} catch {\n\t\t\t\treturn {\n\t\t\t\t\tok: false,\n\t\t\t\t\terror,\n\t\t\t\t\tpartialData\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tok: false,\n\t\t\t\terror,\n\t\t\t\tpartialData\n\t\t\t};\n\t\t}\n\t}\n\t/**\n\t* Makes GraphQL request and returns data or throws an error\n\t*\n\t* @example\n\t* const data = await request(...)\n\t*\n\t* @param query query\n\t* @param variables variables\n\t* @param fetchOptions overrides for fetch options\n\t*/\n\tasync request(query, variables, fetchOptions) {\n\t\tconst result = await this.requestSafe(query, variables, fetchOptions);\n\t\tif (!result.ok) throw result.error;\n\t\treturn result.data;\n\t}\n};\n\n//#endregion\n//#region src/util/gql.ts\n/**\n* Fake `graphql-tag`.\n* Recommended if you're using `graphql-tag` only for syntax highlighting\n* and static analysis such as linting and types generation.\n* It has less computational cost and makes overall smaller bundles. See:\n* https://github.com/lynxtaa/awesome-graphql-client#approach-2-use-fake-graphql-tag\n*/\nconst gql = (strings, ...values) => {\n\tlet result = \"\";\n\tfor (const [index, string] of strings.entries()) result += `${string}${index in values ? values[index] : \"\"}`;\n\treturn result.trim();\n};\n\n//#endregion\nexport { AwesomeGraphQLClient, GraphQLRequestError, gql, isFileUpload };"]}