511 lines
16 KiB
Plaintext
511 lines
16 KiB
Plaintext
import {
|
|
PROTOCOL_ERRORS_SYMBOL
|
|
} from "/_nuxt/node_modules/.cache/vite/client/deps/chunk-FPKJQCEC.js?v=e4f18c29";
|
|
import {
|
|
throwServerError
|
|
} from "/_nuxt/node_modules/.cache/vite/client/deps/chunk-CMZTALHI.js?v=e4f18c29";
|
|
import {
|
|
canUseAsyncIteratorSymbol,
|
|
isApolloPayloadResult,
|
|
print
|
|
} from "/_nuxt/node_modules/.cache/vite/client/deps/chunk-5GBHNPGF.js?v=e4f18c29";
|
|
import {
|
|
__assign,
|
|
__awaiter,
|
|
__generator,
|
|
__spreadArray,
|
|
newInvariantError
|
|
} from "/_nuxt/node_modules/.cache/vite/client/deps/chunk-VGPSIDND.js?v=e4f18c29";
|
|
|
|
// node_modules/@apollo/client/link/http/iterators/async.js
|
|
function asyncIterator(source) {
|
|
var _a;
|
|
var iterator = source[Symbol.asyncIterator]();
|
|
return _a = {
|
|
next: function() {
|
|
return iterator.next();
|
|
}
|
|
}, _a[Symbol.asyncIterator] = function() {
|
|
return this;
|
|
}, _a;
|
|
}
|
|
|
|
// node_modules/@apollo/client/link/http/iterators/nodeStream.js
|
|
function nodeStreamIterator(stream) {
|
|
var cleanup = null;
|
|
var error = null;
|
|
var done = false;
|
|
var data = [];
|
|
var waiting = [];
|
|
function onData(chunk) {
|
|
if (error)
|
|
return;
|
|
if (waiting.length) {
|
|
var shiftedArr = waiting.shift();
|
|
if (Array.isArray(shiftedArr) && shiftedArr[0]) {
|
|
return shiftedArr[0]({ value: chunk, done: false });
|
|
}
|
|
}
|
|
data.push(chunk);
|
|
}
|
|
function onError(err) {
|
|
error = err;
|
|
var all = waiting.slice();
|
|
all.forEach(function(pair) {
|
|
pair[1](err);
|
|
});
|
|
!cleanup || cleanup();
|
|
}
|
|
function onEnd() {
|
|
done = true;
|
|
var all = waiting.slice();
|
|
all.forEach(function(pair) {
|
|
pair[0]({ value: void 0, done: true });
|
|
});
|
|
!cleanup || cleanup();
|
|
}
|
|
cleanup = function() {
|
|
cleanup = null;
|
|
stream.removeListener("data", onData);
|
|
stream.removeListener("error", onError);
|
|
stream.removeListener("end", onEnd);
|
|
stream.removeListener("finish", onEnd);
|
|
stream.removeListener("close", onEnd);
|
|
};
|
|
stream.on("data", onData);
|
|
stream.on("error", onError);
|
|
stream.on("end", onEnd);
|
|
stream.on("finish", onEnd);
|
|
stream.on("close", onEnd);
|
|
function getNext() {
|
|
return new Promise(function(resolve, reject) {
|
|
if (error)
|
|
return reject(error);
|
|
if (data.length)
|
|
return resolve({ value: data.shift(), done: false });
|
|
if (done)
|
|
return resolve({ value: void 0, done: true });
|
|
waiting.push([resolve, reject]);
|
|
});
|
|
}
|
|
var iterator = {
|
|
next: function() {
|
|
return getNext();
|
|
}
|
|
};
|
|
if (canUseAsyncIteratorSymbol) {
|
|
iterator[Symbol.asyncIterator] = function() {
|
|
return this;
|
|
};
|
|
}
|
|
return iterator;
|
|
}
|
|
|
|
// node_modules/@apollo/client/link/http/iterators/promise.js
|
|
function promiseIterator(promise) {
|
|
var resolved = false;
|
|
var iterator = {
|
|
next: function() {
|
|
if (resolved)
|
|
return Promise.resolve({
|
|
value: void 0,
|
|
done: true
|
|
});
|
|
resolved = true;
|
|
return new Promise(function(resolve, reject) {
|
|
promise.then(function(value) {
|
|
resolve({ value, done: false });
|
|
}).catch(reject);
|
|
});
|
|
}
|
|
};
|
|
if (canUseAsyncIteratorSymbol) {
|
|
iterator[Symbol.asyncIterator] = function() {
|
|
return this;
|
|
};
|
|
}
|
|
return iterator;
|
|
}
|
|
|
|
// node_modules/@apollo/client/link/http/iterators/reader.js
|
|
function readerIterator(reader) {
|
|
var iterator = {
|
|
next: function() {
|
|
return reader.read();
|
|
}
|
|
};
|
|
if (canUseAsyncIteratorSymbol) {
|
|
iterator[Symbol.asyncIterator] = function() {
|
|
return this;
|
|
};
|
|
}
|
|
return iterator;
|
|
}
|
|
|
|
// node_modules/@apollo/client/link/http/responseIterator.js
|
|
function isNodeResponse(value) {
|
|
return !!value.body;
|
|
}
|
|
function isReadableStream(value) {
|
|
return !!value.getReader;
|
|
}
|
|
function isAsyncIterableIterator(value) {
|
|
return !!(canUseAsyncIteratorSymbol && value[Symbol.asyncIterator]);
|
|
}
|
|
function isStreamableBlob(value) {
|
|
return !!value.stream;
|
|
}
|
|
function isBlob(value) {
|
|
return !!value.arrayBuffer;
|
|
}
|
|
function isNodeReadableStream(value) {
|
|
return !!value.pipe;
|
|
}
|
|
function responseIterator(response) {
|
|
var body = response;
|
|
if (isNodeResponse(response))
|
|
body = response.body;
|
|
if (isAsyncIterableIterator(body))
|
|
return asyncIterator(body);
|
|
if (isReadableStream(body))
|
|
return readerIterator(body.getReader());
|
|
if (isStreamableBlob(body)) {
|
|
return readerIterator(body.stream().getReader());
|
|
}
|
|
if (isBlob(body))
|
|
return promiseIterator(body.arrayBuffer());
|
|
if (isNodeReadableStream(body))
|
|
return nodeStreamIterator(body);
|
|
throw new Error("Unknown body type for responseIterator. Please pass a streamable response.");
|
|
}
|
|
|
|
// node_modules/@apollo/client/link/http/parseAndCheckHttpResponse.js
|
|
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
function readMultipartBody(response, nextValue) {
|
|
return __awaiter(this, void 0, void 0, function() {
|
|
var decoder, contentType, delimiter, boundaryVal, boundary, buffer, iterator, running, _a, value, done, chunk, searchFrom, bi, message, i, headers, contentType_1, body, result, next;
|
|
var _b, _c;
|
|
var _d;
|
|
return __generator(this, function(_e) {
|
|
switch (_e.label) {
|
|
case 0:
|
|
if (TextDecoder === void 0) {
|
|
throw new Error("TextDecoder must be defined in the environment: please import a polyfill.");
|
|
}
|
|
decoder = new TextDecoder("utf-8");
|
|
contentType = (_d = response.headers) === null || _d === void 0 ? void 0 : _d.get("content-type");
|
|
delimiter = "boundary=";
|
|
boundaryVal = (contentType === null || contentType === void 0 ? void 0 : contentType.includes(delimiter)) ? contentType === null || contentType === void 0 ? void 0 : contentType.substring((contentType === null || contentType === void 0 ? void 0 : contentType.indexOf(delimiter)) + delimiter.length).replace(/['"]/g, "").replace(/\;(.*)/gm, "").trim() : "-";
|
|
boundary = "\r\n--".concat(boundaryVal);
|
|
buffer = "";
|
|
iterator = responseIterator(response);
|
|
running = true;
|
|
_e.label = 1;
|
|
case 1:
|
|
if (!running) return [3, 3];
|
|
return [4, iterator.next()];
|
|
case 2:
|
|
_a = _e.sent(), value = _a.value, done = _a.done;
|
|
chunk = typeof value === "string" ? value : decoder.decode(value);
|
|
searchFrom = buffer.length - boundary.length + 1;
|
|
running = !done;
|
|
buffer += chunk;
|
|
bi = buffer.indexOf(boundary, searchFrom);
|
|
while (bi > -1) {
|
|
message = void 0;
|
|
_b = [
|
|
buffer.slice(0, bi),
|
|
buffer.slice(bi + boundary.length)
|
|
], message = _b[0], buffer = _b[1];
|
|
i = message.indexOf("\r\n\r\n");
|
|
headers = parseHeaders(message.slice(0, i));
|
|
contentType_1 = headers["content-type"];
|
|
if (contentType_1 && contentType_1.toLowerCase().indexOf("application/json") === -1) {
|
|
throw new Error("Unsupported patch content type: application/json is required.");
|
|
}
|
|
body = message.slice(i);
|
|
if (body) {
|
|
result = parseJsonBody(response, body);
|
|
if (Object.keys(result).length > 1 || "data" in result || "incremental" in result || "errors" in result || "payload" in result) {
|
|
if (isApolloPayloadResult(result)) {
|
|
next = {};
|
|
if ("payload" in result) {
|
|
if (Object.keys(result).length === 1 && result.payload === null) {
|
|
return [
|
|
2
|
|
/*return*/
|
|
];
|
|
}
|
|
next = __assign({}, result.payload);
|
|
}
|
|
if ("errors" in result) {
|
|
next = __assign(__assign({}, next), { extensions: __assign(__assign({}, "extensions" in next ? next.extensions : null), (_c = {}, _c[PROTOCOL_ERRORS_SYMBOL] = result.errors, _c)) });
|
|
}
|
|
nextValue(next);
|
|
} else {
|
|
nextValue(result);
|
|
}
|
|
} else if (
|
|
// If the chunk contains only a "hasNext: false", we can call
|
|
// observer.complete() immediately.
|
|
Object.keys(result).length === 1 && "hasNext" in result && !result.hasNext
|
|
) {
|
|
return [
|
|
2
|
|
/*return*/
|
|
];
|
|
}
|
|
}
|
|
bi = buffer.indexOf(boundary);
|
|
}
|
|
return [3, 1];
|
|
case 3:
|
|
return [
|
|
2
|
|
/*return*/
|
|
];
|
|
}
|
|
});
|
|
});
|
|
}
|
|
function parseHeaders(headerText) {
|
|
var headersInit = {};
|
|
headerText.split("\n").forEach(function(line) {
|
|
var i = line.indexOf(":");
|
|
if (i > -1) {
|
|
var name_1 = line.slice(0, i).trim().toLowerCase();
|
|
var value = line.slice(i + 1).trim();
|
|
headersInit[name_1] = value;
|
|
}
|
|
});
|
|
return headersInit;
|
|
}
|
|
function parseJsonBody(response, bodyText) {
|
|
if (response.status >= 300) {
|
|
var getResult = function() {
|
|
try {
|
|
return JSON.parse(bodyText);
|
|
} catch (err) {
|
|
return bodyText;
|
|
}
|
|
};
|
|
throwServerError(response, getResult(), "Response not successful: Received status code ".concat(response.status));
|
|
}
|
|
try {
|
|
return JSON.parse(bodyText);
|
|
} catch (err) {
|
|
var parseError = err;
|
|
parseError.name = "ServerParseError";
|
|
parseError.response = response;
|
|
parseError.statusCode = response.status;
|
|
parseError.bodyText = bodyText;
|
|
throw parseError;
|
|
}
|
|
}
|
|
function handleError(err, observer) {
|
|
if (err.result && err.result.errors && err.result.data) {
|
|
observer.next(err.result);
|
|
}
|
|
observer.error(err);
|
|
}
|
|
function parseAndCheckHttpResponse(operations) {
|
|
return function(response) {
|
|
return response.text().then(function(bodyText) {
|
|
return parseJsonBody(response, bodyText);
|
|
}).then(function(result) {
|
|
if (!Array.isArray(result) && !hasOwnProperty.call(result, "data") && !hasOwnProperty.call(result, "errors")) {
|
|
throwServerError(response, result, "Server response was missing for query '".concat(Array.isArray(operations) ? operations.map(function(op) {
|
|
return op.operationName;
|
|
}) : operations.operationName, "'."));
|
|
}
|
|
return result;
|
|
});
|
|
};
|
|
}
|
|
|
|
// node_modules/@apollo/client/link/http/serializeFetchParameter.js
|
|
var serializeFetchParameter = function(p, label) {
|
|
var serialized;
|
|
try {
|
|
serialized = JSON.stringify(p);
|
|
} catch (e) {
|
|
var parseError = newInvariantError(42, label, e.message);
|
|
parseError.parseError = e;
|
|
throw parseError;
|
|
}
|
|
return serialized;
|
|
};
|
|
|
|
// node_modules/@apollo/client/link/http/selectHttpOptionsAndBody.js
|
|
var defaultHttpOptions = {
|
|
includeQuery: true,
|
|
includeExtensions: false,
|
|
preserveHeaderCase: false
|
|
};
|
|
var defaultHeaders = {
|
|
// headers are case insensitive (https://stackoverflow.com/a/5259004)
|
|
accept: "*/*",
|
|
// The content-type header describes the type of the body of the request, and
|
|
// so it typically only is sent with requests that actually have bodies. One
|
|
// could imagine that Apollo Client would remove this header when constructing
|
|
// a GET request (which has no body), but we historically have not done that.
|
|
// This means that browsers will preflight all Apollo Client requests (even
|
|
// GET requests). Apollo Server's CSRF prevention feature (introduced in
|
|
// AS3.7) takes advantage of this fact and does not block requests with this
|
|
// header. If you want to drop this header from GET requests, then you should
|
|
// probably replace it with a `apollo-require-preflight` header, or servers
|
|
// with CSRF prevention enabled might block your GET request. See
|
|
// https://www.apollographql.com/docs/apollo-server/security/cors/#preventing-cross-site-request-forgery-csrf
|
|
// for more details.
|
|
"content-type": "application/json"
|
|
};
|
|
var defaultOptions = {
|
|
method: "POST"
|
|
};
|
|
var fallbackHttpConfig = {
|
|
http: defaultHttpOptions,
|
|
headers: defaultHeaders,
|
|
options: defaultOptions
|
|
};
|
|
var defaultPrinter = function(ast, printer) {
|
|
return printer(ast);
|
|
};
|
|
function selectHttpOptionsAndBody(operation, fallbackConfig) {
|
|
var configs = [];
|
|
for (var _i = 2; _i < arguments.length; _i++) {
|
|
configs[_i - 2] = arguments[_i];
|
|
}
|
|
configs.unshift(fallbackConfig);
|
|
return selectHttpOptionsAndBodyInternal.apply(void 0, __spreadArray([
|
|
operation,
|
|
defaultPrinter
|
|
], configs, false));
|
|
}
|
|
function selectHttpOptionsAndBodyInternal(operation, printer) {
|
|
var configs = [];
|
|
for (var _i = 2; _i < arguments.length; _i++) {
|
|
configs[_i - 2] = arguments[_i];
|
|
}
|
|
var options = {};
|
|
var http = {};
|
|
configs.forEach(function(config) {
|
|
options = __assign(__assign(__assign({}, options), config.options), { headers: __assign(__assign({}, options.headers), config.headers) });
|
|
if (config.credentials) {
|
|
options.credentials = config.credentials;
|
|
}
|
|
http = __assign(__assign({}, http), config.http);
|
|
});
|
|
if (options.headers) {
|
|
options.headers = removeDuplicateHeaders(options.headers, http.preserveHeaderCase);
|
|
}
|
|
var operationName = operation.operationName, extensions = operation.extensions, variables = operation.variables, query = operation.query;
|
|
var body = { operationName, variables };
|
|
if (http.includeExtensions)
|
|
body.extensions = extensions;
|
|
if (http.includeQuery)
|
|
body.query = printer(query, print);
|
|
return {
|
|
options,
|
|
body
|
|
};
|
|
}
|
|
function removeDuplicateHeaders(headers, preserveHeaderCase) {
|
|
if (!preserveHeaderCase) {
|
|
var normalizedHeaders_1 = {};
|
|
Object.keys(Object(headers)).forEach(function(name) {
|
|
normalizedHeaders_1[name.toLowerCase()] = headers[name];
|
|
});
|
|
return normalizedHeaders_1;
|
|
}
|
|
var headerData = {};
|
|
Object.keys(Object(headers)).forEach(function(name) {
|
|
headerData[name.toLowerCase()] = {
|
|
originalName: name,
|
|
value: headers[name]
|
|
};
|
|
});
|
|
var normalizedHeaders = {};
|
|
Object.keys(headerData).forEach(function(name) {
|
|
normalizedHeaders[headerData[name].originalName] = headerData[name].value;
|
|
});
|
|
return normalizedHeaders;
|
|
}
|
|
|
|
// node_modules/@apollo/client/link/http/createSignalIfSupported.js
|
|
var createSignalIfSupported = function() {
|
|
if (typeof AbortController === "undefined")
|
|
return { controller: false, signal: false };
|
|
var controller = new AbortController();
|
|
var signal = controller.signal;
|
|
return { controller, signal };
|
|
};
|
|
|
|
// node_modules/@apollo/client/link/http/selectURI.js
|
|
var selectURI = function(operation, fallbackURI) {
|
|
var context = operation.getContext();
|
|
var contextURI = context.uri;
|
|
if (contextURI) {
|
|
return contextURI;
|
|
} else if (typeof fallbackURI === "function") {
|
|
return fallbackURI(operation);
|
|
} else {
|
|
return fallbackURI || "/graphql";
|
|
}
|
|
};
|
|
|
|
// node_modules/@apollo/client/link/http/rewriteURIForGET.js
|
|
function rewriteURIForGET(chosenURI, body) {
|
|
var queryParams = [];
|
|
var addQueryParam = function(key, value) {
|
|
queryParams.push("".concat(key, "=").concat(encodeURIComponent(value)));
|
|
};
|
|
if ("query" in body) {
|
|
addQueryParam("query", body.query);
|
|
}
|
|
if (body.operationName) {
|
|
addQueryParam("operationName", body.operationName);
|
|
}
|
|
if (body.variables) {
|
|
var serializedVariables = void 0;
|
|
try {
|
|
serializedVariables = serializeFetchParameter(body.variables, "Variables map");
|
|
} catch (parseError) {
|
|
return { parseError };
|
|
}
|
|
addQueryParam("variables", serializedVariables);
|
|
}
|
|
if (body.extensions) {
|
|
var serializedExtensions = void 0;
|
|
try {
|
|
serializedExtensions = serializeFetchParameter(body.extensions, "Extensions map");
|
|
} catch (parseError) {
|
|
return { parseError };
|
|
}
|
|
addQueryParam("extensions", serializedExtensions);
|
|
}
|
|
var fragment = "", preFragment = chosenURI;
|
|
var fragmentStart = chosenURI.indexOf("#");
|
|
if (fragmentStart !== -1) {
|
|
fragment = chosenURI.substr(fragmentStart);
|
|
preFragment = chosenURI.substr(0, fragmentStart);
|
|
}
|
|
var queryParamsPrefix = preFragment.indexOf("?") === -1 ? "?" : "&";
|
|
var newURI = preFragment + queryParamsPrefix + queryParams.join("&") + fragment;
|
|
return { newURI };
|
|
}
|
|
|
|
export {
|
|
readMultipartBody,
|
|
handleError,
|
|
parseAndCheckHttpResponse,
|
|
serializeFetchParameter,
|
|
fallbackHttpConfig,
|
|
defaultPrinter,
|
|
selectHttpOptionsAndBody,
|
|
selectHttpOptionsAndBodyInternal,
|
|
createSignalIfSupported,
|
|
selectURI,
|
|
rewriteURIForGET
|
|
};
|
|
//# sourceMappingURL=chunk-QTIE55V7.js.map
|