Files
erp-system/.next/dev/server/chunks/[root-of-the-server]__0_zxh-o._.js
T
2026-05-20 18:58:23 +00:00

5559 lines
226 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
module.exports = [
"[externals]/@prisma/client [external] (@prisma/client, cjs, [project]/node_modules/@prisma/client)", ((__turbopack_context__, module, exports) => {
const mod = __turbopack_context__.x("@prisma/client-2c3a283f134fdcb6", () => require("@prisma/client-2c3a283f134fdcb6"));
module.exports = mod;
}),
"[project]/node_modules/@prisma/debug/dist/index.mjs [app-route] (ecmascript)", ((__turbopack_context__) => {
"use strict";
__turbopack_context__.s([
"Debug",
()=>Debug,
"clearLogs",
()=>clearLogs,
"default",
()=>index_default,
"getLogs",
()=>getLogs
]);
var __defProp = Object.defineProperty;
var __export = (target, all)=>{
for(var name in all)__defProp(target, name, {
get: all[name],
enumerable: true
});
};
// ../../node_modules/.pnpm/kleur@4.1.5/node_modules/kleur/colors.mjs
var colors_exports = {};
__export(colors_exports, {
$: ()=>$,
bgBlack: ()=>bgBlack,
bgBlue: ()=>bgBlue,
bgCyan: ()=>bgCyan,
bgGreen: ()=>bgGreen,
bgMagenta: ()=>bgMagenta,
bgRed: ()=>bgRed,
bgWhite: ()=>bgWhite,
bgYellow: ()=>bgYellow,
black: ()=>black,
blue: ()=>blue,
bold: ()=>bold,
cyan: ()=>cyan,
dim: ()=>dim,
gray: ()=>gray,
green: ()=>green,
grey: ()=>grey,
hidden: ()=>hidden,
inverse: ()=>inverse,
italic: ()=>italic,
magenta: ()=>magenta,
red: ()=>red,
reset: ()=>reset,
strikethrough: ()=>strikethrough,
underline: ()=>underline,
white: ()=>white,
yellow: ()=>yellow
});
var FORCE_COLOR;
var NODE_DISABLE_COLORS;
var NO_COLOR;
var TERM;
var isTTY = true;
if (typeof process !== "undefined") {
({ FORCE_COLOR, NODE_DISABLE_COLORS, NO_COLOR, TERM } = process.env || {});
isTTY = process.stdout && process.stdout.isTTY;
}
var $ = {
enabled: !NODE_DISABLE_COLORS && NO_COLOR == null && TERM !== "dumb" && (FORCE_COLOR != null && FORCE_COLOR !== "0" || isTTY)
};
function init(x, y) {
let rgx = new RegExp(`\\x1b\\[${y}m`, "g");
let open = `\x1B[${x}m`, close = `\x1B[${y}m`;
return function(txt) {
if (!$.enabled || txt == null) return txt;
return open + (!!~("" + txt).indexOf(close) ? txt.replace(rgx, close + open) : txt) + close;
};
}
var reset = init(0, 0);
var bold = init(1, 22);
var dim = init(2, 22);
var italic = init(3, 23);
var underline = init(4, 24);
var inverse = init(7, 27);
var hidden = init(8, 28);
var strikethrough = init(9, 29);
var black = init(30, 39);
var red = init(31, 39);
var green = init(32, 39);
var yellow = init(33, 39);
var blue = init(34, 39);
var magenta = init(35, 39);
var cyan = init(36, 39);
var white = init(37, 39);
var gray = init(90, 39);
var grey = init(90, 39);
var bgBlack = init(40, 49);
var bgRed = init(41, 49);
var bgGreen = init(42, 49);
var bgYellow = init(43, 49);
var bgBlue = init(44, 49);
var bgMagenta = init(45, 49);
var bgCyan = init(46, 49);
var bgWhite = init(47, 49);
// src/index.ts
var MAX_ARGS_HISTORY = 100;
var COLORS = [
"green",
"yellow",
"blue",
"magenta",
"cyan",
"red"
];
var argsHistory = [];
var lastTimestamp = Date.now();
var lastColor = 0;
var processEnv = typeof process !== "undefined" ? process.env : {};
globalThis.DEBUG ??= processEnv.DEBUG ?? "";
globalThis.DEBUG_COLORS ??= processEnv.DEBUG_COLORS ? processEnv.DEBUG_COLORS === "true" : true;
var topProps = {
enable (namespace) {
if (typeof namespace === "string") {
globalThis.DEBUG = namespace;
}
},
disable () {
const prev = globalThis.DEBUG;
globalThis.DEBUG = "";
return prev;
},
// this is the core logic to check if logging should happen or not
enabled (namespace) {
const listenedNamespaces = globalThis.DEBUG.split(",").map((s)=>{
return s.replace(/[.+?^${}()|[\]\\]/g, "\\$&");
});
const isListened = listenedNamespaces.some((listenedNamespace)=>{
if (listenedNamespace === "" || listenedNamespace[0] === "-") return false;
return namespace.match(RegExp(listenedNamespace.split("*").join(".*") + "$"));
});
const isExcluded = listenedNamespaces.some((listenedNamespace)=>{
if (listenedNamespace === "" || listenedNamespace[0] !== "-") return false;
return namespace.match(RegExp(listenedNamespace.slice(1).split("*").join(".*") + "$"));
});
return isListened && !isExcluded;
},
log: (...args)=>{
const [namespace, format, ...rest] = args;
const logWithFormatting = console.warn ?? console.log;
logWithFormatting(`${namespace} ${format}`, ...rest);
},
formatters: {}
};
function debugCreate(namespace) {
const instanceProps = {
color: COLORS[lastColor++ % COLORS.length],
enabled: topProps.enabled(namespace),
namespace,
log: topProps.log,
extend: ()=>{}
};
const debugCall = (...args)=>{
const { enabled, namespace: namespace2, color, log } = instanceProps;
if (args.length !== 0) {
argsHistory.push([
namespace2,
...args
]);
}
if (argsHistory.length > MAX_ARGS_HISTORY) {
argsHistory.shift();
}
if (topProps.enabled(namespace2) || enabled) {
const stringArgs = args.map((arg)=>{
if (typeof arg === "string") {
return arg;
}
return safeStringify(arg);
});
const ms = `+${Date.now() - lastTimestamp}ms`;
lastTimestamp = Date.now();
if (globalThis.DEBUG_COLORS) {
log(colors_exports[color](bold(namespace2)), ...stringArgs, colors_exports[color](ms));
} else {
log(namespace2, ...stringArgs, ms);
}
}
};
return new Proxy(debugCall, {
get: (_, prop)=>instanceProps[prop],
set: (_, prop, value)=>instanceProps[prop] = value
});
}
var Debug = new Proxy(debugCreate, {
get: (_, prop)=>topProps[prop],
set: (_, prop, value)=>topProps[prop] = value
});
function safeStringify(value, indent = 2) {
const cache = /* @__PURE__ */ new Set();
return JSON.stringify(value, (key, value2)=>{
if (typeof value2 === "object" && value2 !== null) {
if (cache.has(value2)) {
return `[Circular *]`;
}
cache.add(value2);
} else if (typeof value2 === "bigint") {
return value2.toString();
}
return value2;
}, indent);
}
function getLogs(numChars = 7500) {
const logs = argsHistory.map(([namespace, ...args])=>{
return `${namespace} ${args.map((arg)=>{
if (typeof arg === "string") {
return arg;
} else {
return JSON.stringify(arg);
}
}).join(" ")}`;
}).join("\n");
if (logs.length < numChars) {
return logs;
}
return logs.slice(-numChars);
}
function clearLogs() {
argsHistory.length = 0;
}
var index_default = Debug;
;
}),
"[project]/node_modules/@prisma/driver-adapter-utils/dist/index.mjs [app-route] (ecmascript) <locals>", ((__turbopack_context__) => {
"use strict";
__turbopack_context__.s([
"ColumnTypeEnum",
()=>ColumnTypeEnum,
"DriverAdapterError",
()=>DriverAdapterError,
"bindAdapter",
()=>bindAdapter,
"bindMigrationAwareSqlAdapterFactory",
()=>bindMigrationAwareSqlAdapterFactory,
"bindSqlAdapterFactory",
()=>bindSqlAdapterFactory,
"err",
()=>err,
"isDriverAdapterError",
()=>isDriverAdapterError,
"mockAdapter",
()=>mockAdapter,
"mockAdapterErrors",
()=>mockAdapterErrors,
"mockAdapterFactory",
()=>mockAdapterFactory,
"mockMigrationAwareAdapterFactory",
()=>mockMigrationAwareAdapterFactory,
"ok",
()=>ok
]);
// src/debug.ts
var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f40$prisma$2f$debug$2f$dist$2f$index$2e$mjs__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/@prisma/debug/dist/index.mjs [app-route] (ecmascript)");
;
// src/error.ts
var DriverAdapterError = class extends Error {
name = "DriverAdapterError";
cause;
constructor(payload){
super(typeof payload["message"] === "string" ? payload["message"] : payload.kind);
this.cause = payload;
}
};
function isDriverAdapterError(error) {
return error["name"] === "DriverAdapterError" && typeof error["cause"] === "object";
}
// src/result.ts
function ok(value) {
return {
ok: true,
value,
map (fn) {
return ok(fn(value));
},
flatMap (fn) {
return fn(value);
}
};
}
function err(error) {
return {
ok: false,
error,
map () {
return err(error);
},
flatMap () {
return err(error);
}
};
}
// src/binder.ts
var debug = (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f40$prisma$2f$debug$2f$dist$2f$index$2e$mjs__$5b$app$2d$route$5d$__$28$ecmascript$29$__["Debug"])("driver-adapter-utils");
var ErrorRegistryInternal = class {
registeredErrors = [];
consumeError(id) {
return this.registeredErrors[id];
}
registerNewError(error) {
let i = 0;
while(this.registeredErrors[i] !== void 0){
i++;
}
this.registeredErrors[i] = {
error
};
return i;
}
};
function copySymbolsFromSource(source, target) {
const symbols = Object.getOwnPropertySymbols(source);
const symbolObject = Object.fromEntries(symbols.map((symbol)=>[
symbol,
true
]));
Object.assign(target, symbolObject);
}
var bindMigrationAwareSqlAdapterFactory = (adapterFactory)=>{
const errorRegistry = new ErrorRegistryInternal();
const boundFactory = {
adapterName: adapterFactory.adapterName,
provider: adapterFactory.provider,
errorRegistry,
connect: async (...args)=>{
const ctx = await wrapAsync(errorRegistry, adapterFactory.connect.bind(adapterFactory))(...args);
return ctx.map((ctx2)=>bindAdapter(ctx2, errorRegistry));
},
connectToShadowDb: async (...args)=>{
const ctx = await wrapAsync(errorRegistry, adapterFactory.connectToShadowDb.bind(adapterFactory))(...args);
return ctx.map((ctx2)=>bindAdapter(ctx2, errorRegistry));
}
};
copySymbolsFromSource(adapterFactory, boundFactory);
return boundFactory;
};
var bindSqlAdapterFactory = (adapterFactory)=>{
const errorRegistry = new ErrorRegistryInternal();
const boundFactory = {
adapterName: adapterFactory.adapterName,
provider: adapterFactory.provider,
errorRegistry,
connect: async (...args)=>{
const ctx = await wrapAsync(errorRegistry, adapterFactory.connect.bind(adapterFactory))(...args);
return ctx.map((ctx2)=>bindAdapter(ctx2, errorRegistry));
}
};
copySymbolsFromSource(adapterFactory, boundFactory);
return boundFactory;
};
var bindAdapter = (adapter, errorRegistry = new ErrorRegistryInternal())=>{
const boundAdapter = {
adapterName: adapter.adapterName,
errorRegistry,
queryRaw: wrapAsync(errorRegistry, adapter.queryRaw.bind(adapter)),
executeRaw: wrapAsync(errorRegistry, adapter.executeRaw.bind(adapter)),
executeScript: wrapAsync(errorRegistry, adapter.executeScript.bind(adapter)),
dispose: wrapAsync(errorRegistry, adapter.dispose.bind(adapter)),
provider: adapter.provider,
startTransaction: async (...args)=>{
const ctx = await wrapAsync(errorRegistry, adapter.startTransaction.bind(adapter))(...args);
return ctx.map((ctx2)=>bindTransaction(errorRegistry, ctx2));
}
};
if (adapter.getConnectionInfo) {
boundAdapter.getConnectionInfo = wrapSync(errorRegistry, adapter.getConnectionInfo.bind(adapter));
}
return boundAdapter;
};
var bindTransaction = (errorRegistry, transaction)=>{
const boundTransaction = {
adapterName: transaction.adapterName,
provider: transaction.provider,
options: transaction.options,
queryRaw: wrapAsync(errorRegistry, transaction.queryRaw.bind(transaction)),
executeRaw: wrapAsync(errorRegistry, transaction.executeRaw.bind(transaction)),
commit: wrapAsync(errorRegistry, transaction.commit.bind(transaction)),
rollback: wrapAsync(errorRegistry, transaction.rollback.bind(transaction))
};
if (transaction.createSavepoint) {
boundTransaction.createSavepoint = wrapAsync(errorRegistry, transaction.createSavepoint.bind(transaction));
}
if (transaction.rollbackToSavepoint) {
boundTransaction.rollbackToSavepoint = wrapAsync(errorRegistry, transaction.rollbackToSavepoint.bind(transaction));
}
if (transaction.releaseSavepoint) {
boundTransaction.releaseSavepoint = wrapAsync(errorRegistry, transaction.releaseSavepoint.bind(transaction));
}
return boundTransaction;
};
function wrapAsync(registry, fn) {
return async (...args)=>{
try {
return ok(await fn(...args));
} catch (error) {
debug("[error@wrapAsync]", error);
if (isDriverAdapterError(error)) {
return err(error.cause);
}
const id = registry.registerNewError(error);
return err({
kind: "GenericJs",
id
});
}
};
}
function wrapSync(registry, fn) {
return (...args)=>{
try {
return ok(fn(...args));
} catch (error) {
debug("[error@wrapSync]", error);
if (isDriverAdapterError(error)) {
return err(error.cause);
}
const id = registry.registerNewError(error);
return err({
kind: "GenericJs",
id
});
}
};
}
// src/const.ts
var ColumnTypeEnum = {
// Scalars
Int32: 0,
Int64: 1,
Float: 2,
Double: 3,
Numeric: 4,
Boolean: 5,
Character: 6,
Text: 7,
Date: 8,
Time: 9,
DateTime: 10,
Json: 11,
Enum: 12,
Bytes: 13,
Set: 14,
Uuid: 15,
// Arrays
Int32Array: 64,
Int64Array: 65,
FloatArray: 66,
DoubleArray: 67,
NumericArray: 68,
BooleanArray: 69,
CharacterArray: 70,
TextArray: 71,
DateArray: 72,
TimeArray: 73,
DateTimeArray: 74,
JsonArray: 75,
EnumArray: 76,
BytesArray: 77,
UuidArray: 78,
// Custom
UnknownNumber: 128
};
// src/mock.ts
var mockAdapterErrors = {
queryRaw: new Error("Not implemented: queryRaw"),
executeRaw: new Error("Not implemented: executeRaw"),
startTransaction: new Error("Not implemented: startTransaction"),
executeScript: new Error("Not implemented: executeScript"),
dispose: new Error("Not implemented: dispose")
};
function mockAdapter(provider) {
return {
provider,
adapterName: "@prisma/adapter-mock",
queryRaw: ()=>Promise.reject(mockAdapterErrors.queryRaw),
executeRaw: ()=>Promise.reject(mockAdapterErrors.executeRaw),
startTransaction: ()=>Promise.reject(mockAdapterErrors.startTransaction),
executeScript: ()=>Promise.reject(mockAdapterErrors.executeScript),
dispose: ()=>Promise.reject(mockAdapterErrors.dispose),
[Symbol.for("adapter.mockAdapter")]: true
};
}
function mockAdapterFactory(provider) {
return {
provider,
adapterName: "@prisma/adapter-mock",
connect: ()=>Promise.resolve(mockAdapter(provider)),
[Symbol.for("adapter.mockAdapterFactory")]: true
};
}
function mockMigrationAwareAdapterFactory(provider) {
return {
provider,
adapterName: "@prisma/adapter-mock",
connect: ()=>Promise.resolve(mockAdapter(provider)),
connectToShadowDb: ()=>Promise.resolve(mockAdapter(provider)),
[Symbol.for("adapter.mockMigrationAwareAdapterFactory")]: true
};
}
;
}),
"[externals]/pg [external] (pg, esm_import, [project]/node_modules/pg)", ((__turbopack_context__) => {
"use strict";
return __turbopack_context__.a(async (__turbopack_handle_async_dependencies__, __turbopack_async_result__) => { try {
const mod = await __turbopack_context__.y("pg-587764f78a6c7a9c");
__turbopack_context__.n(mod);
__turbopack_async_result__();
} catch(e) { __turbopack_async_result__(e); } }, true);}),
"[project]/node_modules/postgres-array/index.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => {
"use strict";
const BACKSLASH = '\\';
const DQUOT = '"';
const LBRACE = '{';
const RBRACE = '}';
const LBRACKET = '[';
const EQUALS = '=';
const COMMA = ',';
/** When the raw value is this, it means a literal `null` */ const NULL_STRING = 'NULL';
/**
* Parses an array according to
* https://www.postgresql.org/docs/17/arrays.html#ARRAYS-IO
*
* Trusts the data (mostly), so only hook up to trusted Postgres servers.
*/ function makeParseArrayWithTransform(transform) {
const haveTransform = transform != null;
return function parseArray(str) {
const rbraceIndex = str.length - 1;
if (rbraceIndex === 1) {
return [];
}
if (str[rbraceIndex] !== RBRACE) {
throw new Error('Invalid array text - must end with }');
}
// If starts with `[`, it is specifying the index boundas. Skip past first `=`.
let position = 0;
if (str[position] === LBRACKET) {
position = str.indexOf(EQUALS) + 1;
}
if (str[position++] !== LBRACE) {
throw new Error('Invalid array text - must start with {');
}
const output = [];
let current = output;
const stack = [];
let currentStringStart = position;
let currentString = '';
let expectValue = true;
for(; position < rbraceIndex; ++position){
let char = str[position];
// > The array output routine will put double quotes around element values if
// > they are empty strings, contain curly braces, delimiter characters, double
// > quotes, backslashes, or white space, or match the word NULL. Double quotes
// > and backslashes embedded in element values will be backslash-escaped.
if (char === DQUOT) {
// It's escaped
currentStringStart = ++position;
let dquot = str.indexOf(DQUOT, currentStringStart);
let backSlash = str.indexOf(BACKSLASH, currentStringStart);
while(backSlash !== -1 && backSlash < dquot){
position = backSlash;
const part = str.slice(currentStringStart, position);
currentString += part;
currentStringStart = ++position;
if (dquot === position++) {
// This was an escaped doublequote; find the next one!
dquot = str.indexOf(DQUOT, position);
}
// Either way, find the next backslash
backSlash = str.indexOf(BACKSLASH, position);
}
position = dquot;
const part = str.slice(currentStringStart, position);
currentString += part;
current.push(haveTransform ? transform(currentString) : currentString);
currentString = '';
expectValue = false;
} else if (char === LBRACE) {
const newArray = [];
current.push(newArray);
stack.push(current);
current = newArray;
currentStringStart = position + 1;
expectValue = true;
} else if (char === COMMA) {
expectValue = true;
} else if (char === RBRACE) {
expectValue = false;
const arr = stack.pop();
if (arr === undefined) {
throw new Error("Invalid array text - too many '}'");
}
current = arr;
} else if (expectValue) {
currentStringStart = position;
while((char = str[position]) !== COMMA && char !== RBRACE && position < rbraceIndex){
++position;
}
const part = str.slice(currentStringStart, position--);
current.push(part === NULL_STRING ? null : haveTransform ? transform(part) : part);
expectValue = false;
} else {
throw new Error('Was expecting delimeter');
}
}
return output;
};
}
const parseArray = makeParseArrayWithTransform();
exports.parse = (source, transform)=>transform != null ? makeParseArrayWithTransform(transform)(source) : parseArray(source);
}),
"[project]/node_modules/@prisma/adapter-pg/dist/index.mjs [app-route] (ecmascript)", ((__turbopack_context__) => {
"use strict";
return __turbopack_context__.a(async (__turbopack_handle_async_dependencies__, __turbopack_async_result__) => { try {
__turbopack_context__.s([
"PrismaPg",
()=>PrismaPgAdapterFactory
]);
// src/pg.ts
var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f40$prisma$2f$debug$2f$dist$2f$index$2e$mjs__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/@prisma/debug/dist/index.mjs [app-route] (ecmascript)");
var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f40$prisma$2f$driver$2d$adapter$2d$utils$2f$dist$2f$index$2e$mjs__$5b$app$2d$route$5d$__$28$ecmascript$29$__$3c$locals$3e$__ = __turbopack_context__.i("[project]/node_modules/@prisma/driver-adapter-utils/dist/index.mjs [app-route] (ecmascript) <locals>");
var __TURBOPACK__imported__module__$5b$externals$5d2f$pg__$5b$external$5d$__$28$pg$2c$__esm_import$2c$__$5b$project$5d2f$node_modules$2f$pg$29$__ = __turbopack_context__.i("[externals]/pg [external] (pg, esm_import, [project]/node_modules/pg)");
var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$postgres$2d$array$2f$index$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/postgres-array/index.js [app-route] (ecmascript)");
var __turbopack_async_dependencies__ = __turbopack_handle_async_dependencies__([
__TURBOPACK__imported__module__$5b$externals$5d2f$pg__$5b$external$5d$__$28$pg$2c$__esm_import$2c$__$5b$project$5d2f$node_modules$2f$pg$29$__
]);
[__TURBOPACK__imported__module__$5b$externals$5d2f$pg__$5b$external$5d$__$28$pg$2c$__esm_import$2c$__$5b$project$5d2f$node_modules$2f$pg$29$__] = __turbopack_async_dependencies__.then ? (await __turbopack_async_dependencies__)() : __turbopack_async_dependencies__;
;
;
// package.json
var name = "@prisma/adapter-pg";
// src/constants.ts
var FIRST_NORMAL_OBJECT_ID = 16384;
;
;
;
var { types } = __TURBOPACK__imported__module__$5b$externals$5d2f$pg__$5b$external$5d$__$28$pg$2c$__esm_import$2c$__$5b$project$5d2f$node_modules$2f$pg$29$__["default"];
var { builtins: ScalarColumnType, getTypeParser } = types;
var AdditionalScalarColumnType = {
NAME: 19
};
var ArrayColumnType = {
BIT_ARRAY: 1561,
BOOL_ARRAY: 1e3,
BYTEA_ARRAY: 1001,
BPCHAR_ARRAY: 1014,
CHAR_ARRAY: 1002,
CIDR_ARRAY: 651,
DATE_ARRAY: 1182,
FLOAT4_ARRAY: 1021,
FLOAT8_ARRAY: 1022,
INET_ARRAY: 1041,
INT2_ARRAY: 1005,
INT4_ARRAY: 1007,
INT8_ARRAY: 1016,
JSONB_ARRAY: 3807,
JSON_ARRAY: 199,
MONEY_ARRAY: 791,
NUMERIC_ARRAY: 1231,
OID_ARRAY: 1028,
TEXT_ARRAY: 1009,
TIMESTAMP_ARRAY: 1115,
TIMESTAMPTZ_ARRAY: 1185,
TIME_ARRAY: 1183,
UUID_ARRAY: 2951,
VARBIT_ARRAY: 1563,
VARCHAR_ARRAY: 1015,
XML_ARRAY: 143
};
var UnsupportedNativeDataType = class _UnsupportedNativeDataType extends Error {
// map of type codes to type names
static typeNames = {
16: "bool",
17: "bytea",
18: "char",
19: "name",
20: "int8",
21: "int2",
22: "int2vector",
23: "int4",
24: "regproc",
25: "text",
26: "oid",
27: "tid",
28: "xid",
29: "cid",
30: "oidvector",
32: "pg_ddl_command",
71: "pg_type",
75: "pg_attribute",
81: "pg_proc",
83: "pg_class",
114: "json",
142: "xml",
194: "pg_node_tree",
269: "table_am_handler",
325: "index_am_handler",
600: "point",
601: "lseg",
602: "path",
603: "box",
604: "polygon",
628: "line",
650: "cidr",
700: "float4",
701: "float8",
705: "unknown",
718: "circle",
774: "macaddr8",
790: "money",
829: "macaddr",
869: "inet",
1033: "aclitem",
1042: "bpchar",
1043: "varchar",
1082: "date",
1083: "time",
1114: "timestamp",
1184: "timestamptz",
1186: "interval",
1266: "timetz",
1560: "bit",
1562: "varbit",
1700: "numeric",
1790: "refcursor",
2202: "regprocedure",
2203: "regoper",
2204: "regoperator",
2205: "regclass",
2206: "regtype",
2249: "record",
2275: "cstring",
2276: "any",
2277: "anyarray",
2278: "void",
2279: "trigger",
2280: "language_handler",
2281: "internal",
2283: "anyelement",
2287: "_record",
2776: "anynonarray",
2950: "uuid",
2970: "txid_snapshot",
3115: "fdw_handler",
3220: "pg_lsn",
3310: "tsm_handler",
3361: "pg_ndistinct",
3402: "pg_dependencies",
3500: "anyenum",
3614: "tsvector",
3615: "tsquery",
3642: "gtsvector",
3734: "regconfig",
3769: "regdictionary",
3802: "jsonb",
3831: "anyrange",
3838: "event_trigger",
3904: "int4range",
3906: "numrange",
3908: "tsrange",
3910: "tstzrange",
3912: "daterange",
3926: "int8range",
4072: "jsonpath",
4089: "regnamespace",
4096: "regrole",
4191: "regcollation",
4451: "int4multirange",
4532: "nummultirange",
4533: "tsmultirange",
4534: "tstzmultirange",
4535: "datemultirange",
4536: "int8multirange",
4537: "anymultirange",
4538: "anycompatiblemultirange",
4600: "pg_brin_bloom_summary",
4601: "pg_brin_minmax_multi_summary",
5017: "pg_mcv_list",
5038: "pg_snapshot",
5069: "xid8",
5077: "anycompatible",
5078: "anycompatiblearray",
5079: "anycompatiblenonarray",
5080: "anycompatiblerange"
};
type;
constructor(code){
super();
this.type = _UnsupportedNativeDataType.typeNames[code] || "Unknown";
this.message = `Unsupported column type ${this.type}`;
}
};
function fieldToColumnType(fieldTypeId) {
switch(fieldTypeId){
case ScalarColumnType.INT2:
case ScalarColumnType.INT4:
return __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f40$prisma$2f$driver$2d$adapter$2d$utils$2f$dist$2f$index$2e$mjs__$5b$app$2d$route$5d$__$28$ecmascript$29$__$3c$locals$3e$__["ColumnTypeEnum"].Int32;
case ScalarColumnType.INT8:
return __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f40$prisma$2f$driver$2d$adapter$2d$utils$2f$dist$2f$index$2e$mjs__$5b$app$2d$route$5d$__$28$ecmascript$29$__$3c$locals$3e$__["ColumnTypeEnum"].Int64;
case ScalarColumnType.FLOAT4:
return __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f40$prisma$2f$driver$2d$adapter$2d$utils$2f$dist$2f$index$2e$mjs__$5b$app$2d$route$5d$__$28$ecmascript$29$__$3c$locals$3e$__["ColumnTypeEnum"].Float;
case ScalarColumnType.FLOAT8:
return __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f40$prisma$2f$driver$2d$adapter$2d$utils$2f$dist$2f$index$2e$mjs__$5b$app$2d$route$5d$__$28$ecmascript$29$__$3c$locals$3e$__["ColumnTypeEnum"].Double;
case ScalarColumnType.BOOL:
return __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f40$prisma$2f$driver$2d$adapter$2d$utils$2f$dist$2f$index$2e$mjs__$5b$app$2d$route$5d$__$28$ecmascript$29$__$3c$locals$3e$__["ColumnTypeEnum"].Boolean;
case ScalarColumnType.DATE:
return __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f40$prisma$2f$driver$2d$adapter$2d$utils$2f$dist$2f$index$2e$mjs__$5b$app$2d$route$5d$__$28$ecmascript$29$__$3c$locals$3e$__["ColumnTypeEnum"].Date;
case ScalarColumnType.TIME:
case ScalarColumnType.TIMETZ:
return __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f40$prisma$2f$driver$2d$adapter$2d$utils$2f$dist$2f$index$2e$mjs__$5b$app$2d$route$5d$__$28$ecmascript$29$__$3c$locals$3e$__["ColumnTypeEnum"].Time;
case ScalarColumnType.TIMESTAMP:
case ScalarColumnType.TIMESTAMPTZ:
return __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f40$prisma$2f$driver$2d$adapter$2d$utils$2f$dist$2f$index$2e$mjs__$5b$app$2d$route$5d$__$28$ecmascript$29$__$3c$locals$3e$__["ColumnTypeEnum"].DateTime;
case ScalarColumnType.NUMERIC:
case ScalarColumnType.MONEY:
return __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f40$prisma$2f$driver$2d$adapter$2d$utils$2f$dist$2f$index$2e$mjs__$5b$app$2d$route$5d$__$28$ecmascript$29$__$3c$locals$3e$__["ColumnTypeEnum"].Numeric;
case ScalarColumnType.JSON:
case ScalarColumnType.JSONB:
return __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f40$prisma$2f$driver$2d$adapter$2d$utils$2f$dist$2f$index$2e$mjs__$5b$app$2d$route$5d$__$28$ecmascript$29$__$3c$locals$3e$__["ColumnTypeEnum"].Json;
case ScalarColumnType.UUID:
return __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f40$prisma$2f$driver$2d$adapter$2d$utils$2f$dist$2f$index$2e$mjs__$5b$app$2d$route$5d$__$28$ecmascript$29$__$3c$locals$3e$__["ColumnTypeEnum"].Uuid;
case ScalarColumnType.OID:
return __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f40$prisma$2f$driver$2d$adapter$2d$utils$2f$dist$2f$index$2e$mjs__$5b$app$2d$route$5d$__$28$ecmascript$29$__$3c$locals$3e$__["ColumnTypeEnum"].Int64;
case ScalarColumnType.BPCHAR:
case ScalarColumnType.TEXT:
case ScalarColumnType.VARCHAR:
case ScalarColumnType.BIT:
case ScalarColumnType.VARBIT:
case ScalarColumnType.INET:
case ScalarColumnType.CIDR:
case ScalarColumnType.XML:
case AdditionalScalarColumnType.NAME:
return __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f40$prisma$2f$driver$2d$adapter$2d$utils$2f$dist$2f$index$2e$mjs__$5b$app$2d$route$5d$__$28$ecmascript$29$__$3c$locals$3e$__["ColumnTypeEnum"].Text;
case ScalarColumnType.BYTEA:
return __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f40$prisma$2f$driver$2d$adapter$2d$utils$2f$dist$2f$index$2e$mjs__$5b$app$2d$route$5d$__$28$ecmascript$29$__$3c$locals$3e$__["ColumnTypeEnum"].Bytes;
case ArrayColumnType.INT2_ARRAY:
case ArrayColumnType.INT4_ARRAY:
return __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f40$prisma$2f$driver$2d$adapter$2d$utils$2f$dist$2f$index$2e$mjs__$5b$app$2d$route$5d$__$28$ecmascript$29$__$3c$locals$3e$__["ColumnTypeEnum"].Int32Array;
case ArrayColumnType.FLOAT4_ARRAY:
return __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f40$prisma$2f$driver$2d$adapter$2d$utils$2f$dist$2f$index$2e$mjs__$5b$app$2d$route$5d$__$28$ecmascript$29$__$3c$locals$3e$__["ColumnTypeEnum"].FloatArray;
case ArrayColumnType.FLOAT8_ARRAY:
return __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f40$prisma$2f$driver$2d$adapter$2d$utils$2f$dist$2f$index$2e$mjs__$5b$app$2d$route$5d$__$28$ecmascript$29$__$3c$locals$3e$__["ColumnTypeEnum"].DoubleArray;
case ArrayColumnType.NUMERIC_ARRAY:
case ArrayColumnType.MONEY_ARRAY:
return __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f40$prisma$2f$driver$2d$adapter$2d$utils$2f$dist$2f$index$2e$mjs__$5b$app$2d$route$5d$__$28$ecmascript$29$__$3c$locals$3e$__["ColumnTypeEnum"].NumericArray;
case ArrayColumnType.BOOL_ARRAY:
return __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f40$prisma$2f$driver$2d$adapter$2d$utils$2f$dist$2f$index$2e$mjs__$5b$app$2d$route$5d$__$28$ecmascript$29$__$3c$locals$3e$__["ColumnTypeEnum"].BooleanArray;
case ArrayColumnType.CHAR_ARRAY:
return __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f40$prisma$2f$driver$2d$adapter$2d$utils$2f$dist$2f$index$2e$mjs__$5b$app$2d$route$5d$__$28$ecmascript$29$__$3c$locals$3e$__["ColumnTypeEnum"].CharacterArray;
case ArrayColumnType.BPCHAR_ARRAY:
case ArrayColumnType.TEXT_ARRAY:
case ArrayColumnType.VARCHAR_ARRAY:
case ArrayColumnType.VARBIT_ARRAY:
case ArrayColumnType.BIT_ARRAY:
case ArrayColumnType.INET_ARRAY:
case ArrayColumnType.CIDR_ARRAY:
case ArrayColumnType.XML_ARRAY:
return __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f40$prisma$2f$driver$2d$adapter$2d$utils$2f$dist$2f$index$2e$mjs__$5b$app$2d$route$5d$__$28$ecmascript$29$__$3c$locals$3e$__["ColumnTypeEnum"].TextArray;
case ArrayColumnType.DATE_ARRAY:
return __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f40$prisma$2f$driver$2d$adapter$2d$utils$2f$dist$2f$index$2e$mjs__$5b$app$2d$route$5d$__$28$ecmascript$29$__$3c$locals$3e$__["ColumnTypeEnum"].DateArray;
case ArrayColumnType.TIME_ARRAY:
return __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f40$prisma$2f$driver$2d$adapter$2d$utils$2f$dist$2f$index$2e$mjs__$5b$app$2d$route$5d$__$28$ecmascript$29$__$3c$locals$3e$__["ColumnTypeEnum"].TimeArray;
case ArrayColumnType.TIMESTAMP_ARRAY:
return __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f40$prisma$2f$driver$2d$adapter$2d$utils$2f$dist$2f$index$2e$mjs__$5b$app$2d$route$5d$__$28$ecmascript$29$__$3c$locals$3e$__["ColumnTypeEnum"].DateTimeArray;
case ArrayColumnType.TIMESTAMPTZ_ARRAY:
return __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f40$prisma$2f$driver$2d$adapter$2d$utils$2f$dist$2f$index$2e$mjs__$5b$app$2d$route$5d$__$28$ecmascript$29$__$3c$locals$3e$__["ColumnTypeEnum"].DateTimeArray;
case ArrayColumnType.JSON_ARRAY:
case ArrayColumnType.JSONB_ARRAY:
return __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f40$prisma$2f$driver$2d$adapter$2d$utils$2f$dist$2f$index$2e$mjs__$5b$app$2d$route$5d$__$28$ecmascript$29$__$3c$locals$3e$__["ColumnTypeEnum"].JsonArray;
case ArrayColumnType.BYTEA_ARRAY:
return __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f40$prisma$2f$driver$2d$adapter$2d$utils$2f$dist$2f$index$2e$mjs__$5b$app$2d$route$5d$__$28$ecmascript$29$__$3c$locals$3e$__["ColumnTypeEnum"].BytesArray;
case ArrayColumnType.UUID_ARRAY:
return __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f40$prisma$2f$driver$2d$adapter$2d$utils$2f$dist$2f$index$2e$mjs__$5b$app$2d$route$5d$__$28$ecmascript$29$__$3c$locals$3e$__["ColumnTypeEnum"].UuidArray;
case ArrayColumnType.INT8_ARRAY:
case ArrayColumnType.OID_ARRAY:
return __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f40$prisma$2f$driver$2d$adapter$2d$utils$2f$dist$2f$index$2e$mjs__$5b$app$2d$route$5d$__$28$ecmascript$29$__$3c$locals$3e$__["ColumnTypeEnum"].Int64Array;
default:
if (fieldTypeId >= FIRST_NORMAL_OBJECT_ID) {
return __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f40$prisma$2f$driver$2d$adapter$2d$utils$2f$dist$2f$index$2e$mjs__$5b$app$2d$route$5d$__$28$ecmascript$29$__$3c$locals$3e$__["ColumnTypeEnum"].Text;
}
throw new UnsupportedNativeDataType(fieldTypeId);
}
}
function normalize_array(element_normalizer) {
return (str)=>(0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$postgres$2d$array$2f$index$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["parse"])(str, element_normalizer);
}
function normalize_numeric(numeric) {
return numeric;
}
function normalize_date(date) {
return date;
}
function normalize_timestamp(time) {
return `${time.replace(" ", "T")}+00:00`;
}
function normalize_timestamptz(time) {
return time.replace(" ", "T").replace(/[+-]\d{2}(:\d{2})?$/, "+00:00");
}
function normalize_time(time) {
return time;
}
function normalize_timez(time) {
return time.replace(/[+-]\d{2}(:\d{2})?$/, "");
}
function normalize_money(money) {
return money.slice(1);
}
function normalize_xml(xml) {
return xml;
}
function toJson(json) {
return json;
}
var parsePgBytes = getTypeParser(ScalarColumnType.BYTEA);
var normalizeByteaArray = getTypeParser(ArrayColumnType.BYTEA_ARRAY);
function convertBytes(serializedBytes) {
return parsePgBytes(serializedBytes);
}
function normalizeBit(bit) {
return bit;
}
var customParsers = {
[ScalarColumnType.NUMERIC]: normalize_numeric,
[ArrayColumnType.NUMERIC_ARRAY]: normalize_array(normalize_numeric),
[ScalarColumnType.TIME]: normalize_time,
[ArrayColumnType.TIME_ARRAY]: normalize_array(normalize_time),
[ScalarColumnType.TIMETZ]: normalize_timez,
[ScalarColumnType.DATE]: normalize_date,
[ArrayColumnType.DATE_ARRAY]: normalize_array(normalize_date),
[ScalarColumnType.TIMESTAMP]: normalize_timestamp,
[ArrayColumnType.TIMESTAMP_ARRAY]: normalize_array(normalize_timestamp),
[ScalarColumnType.TIMESTAMPTZ]: normalize_timestamptz,
[ArrayColumnType.TIMESTAMPTZ_ARRAY]: normalize_array(normalize_timestamptz),
[ScalarColumnType.MONEY]: normalize_money,
[ArrayColumnType.MONEY_ARRAY]: normalize_array(normalize_money),
[ScalarColumnType.JSON]: toJson,
[ArrayColumnType.JSON_ARRAY]: normalize_array(toJson),
[ScalarColumnType.JSONB]: toJson,
[ArrayColumnType.JSONB_ARRAY]: normalize_array(toJson),
[ScalarColumnType.BYTEA]: convertBytes,
[ArrayColumnType.BYTEA_ARRAY]: normalizeByteaArray,
[ArrayColumnType.BIT_ARRAY]: normalize_array(normalizeBit),
[ArrayColumnType.VARBIT_ARRAY]: normalize_array(normalizeBit),
[ArrayColumnType.XML_ARRAY]: normalize_array(normalize_xml)
};
function mapArg(arg, argType) {
if (arg === null) {
return null;
}
if (Array.isArray(arg) && argType.arity === "list") {
return arg.map((value)=>mapArg(value, argType));
}
if (typeof arg === "string" && argType.scalarType === "datetime") {
arg = new Date(arg);
}
if (arg instanceof Date) {
switch(argType.dbType){
case "TIME":
case "TIMETZ":
return formatTime(arg);
case "DATE":
return formatDate(arg);
default:
return formatDateTime(arg);
}
}
if (typeof arg === "string" && argType.scalarType === "bytes") {
return Buffer.from(arg, "base64");
}
if (ArrayBuffer.isView(arg)) {
return new Uint8Array(arg.buffer, arg.byteOffset, arg.byteLength);
}
return arg;
}
function formatDateTime(date) {
const pad = (n, z = 2)=>String(n).padStart(z, "0");
const ms = date.getUTCMilliseconds();
return pad(date.getUTCFullYear(), 4) + "-" + pad(date.getUTCMonth() + 1) + "-" + pad(date.getUTCDate()) + " " + pad(date.getUTCHours()) + ":" + pad(date.getUTCMinutes()) + ":" + pad(date.getUTCSeconds()) + (ms ? "." + String(ms).padStart(3, "0") : "");
}
function formatDate(date) {
const pad = (n, z = 2)=>String(n).padStart(z, "0");
return pad(date.getUTCFullYear(), 4) + "-" + pad(date.getUTCMonth() + 1) + "-" + pad(date.getUTCDate());
}
function formatTime(date) {
const pad = (n, z = 2)=>String(n).padStart(z, "0");
const ms = date.getUTCMilliseconds();
return pad(date.getUTCHours()) + ":" + pad(date.getUTCMinutes()) + ":" + pad(date.getUTCSeconds()) + (ms ? "." + String(ms).padStart(3, "0") : "");
}
// src/errors.ts
var TLS_ERRORS = /* @__PURE__ */ new Set([
"UNABLE_TO_GET_ISSUER_CERT",
"UNABLE_TO_GET_CRL",
"UNABLE_TO_DECRYPT_CERT_SIGNATURE",
"UNABLE_TO_DECRYPT_CRL_SIGNATURE",
"UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY",
"CERT_SIGNATURE_FAILURE",
"CRL_SIGNATURE_FAILURE",
"CERT_NOT_YET_VALID",
"CERT_HAS_EXPIRED",
"CRL_NOT_YET_VALID",
"CRL_HAS_EXPIRED",
"ERROR_IN_CERT_NOT_BEFORE_FIELD",
"ERROR_IN_CERT_NOT_AFTER_FIELD",
"ERROR_IN_CRL_LAST_UPDATE_FIELD",
"ERROR_IN_CRL_NEXT_UPDATE_FIELD",
"DEPTH_ZERO_SELF_SIGNED_CERT",
"SELF_SIGNED_CERT_IN_CHAIN",
"UNABLE_TO_GET_ISSUER_CERT_LOCALLY",
"UNABLE_TO_VERIFY_LEAF_SIGNATURE",
"CERT_CHAIN_TOO_LONG",
"CERT_REVOKED",
"INVALID_CA",
"INVALID_PURPOSE",
"CERT_UNTRUSTED",
"CERT_REJECTED",
"HOSTNAME_MISMATCH",
"ERR_TLS_CERT_ALTNAME_FORMAT",
"ERR_TLS_CERT_ALTNAME_INVALID"
]);
var SOCKET_ERRORS = /* @__PURE__ */ new Set([
"ENOTFOUND",
"ECONNREFUSED",
"ECONNRESET",
"ETIMEDOUT"
]);
function convertDriverError(error) {
if (isSocketError(error)) {
return mapSocketError(error);
}
if (isTlsError(error)) {
return {
kind: "TlsConnectionError",
reason: error.message
};
}
if (isDriverError(error)) {
return {
originalCode: error.code,
originalMessage: error.message,
...mapDriverError(error)
};
}
throw error;
}
function mapDriverError(error) {
switch(error.code){
case "22001":
return {
kind: "LengthMismatch",
column: error.column
};
case "22003":
return {
kind: "ValueOutOfRange",
cause: error.message
};
case "22P02":
return {
kind: "InvalidInputValue",
message: error.message
};
case "23505":
{
const fields = error.detail?.match(/Key \(([^)]+)\)/)?.at(1)?.split(", ");
return {
kind: "UniqueConstraintViolation",
constraint: fields !== void 0 ? {
fields
} : void 0
};
}
case "23502":
{
const fields = error.detail?.match(/Key \(([^)]+)\)/)?.at(1)?.split(", ");
return {
kind: "NullConstraintViolation",
constraint: fields !== void 0 ? {
fields
} : void 0
};
}
case "23503":
{
let constraint;
if (error.column) {
constraint = {
fields: [
error.column
]
};
} else if (error.constraint) {
constraint = {
index: error.constraint
};
}
return {
kind: "ForeignKeyConstraintViolation",
constraint
};
}
case "3D000":
return {
kind: "DatabaseDoesNotExist",
db: error.message.split(" ").at(1)?.split('"').at(1)
};
case "28000":
return {
kind: "DatabaseAccessDenied",
db: error.message.split(",").find((s)=>s.startsWith(" database"))?.split('"').at(1)
};
case "28P01":
return {
kind: "AuthenticationFailed",
user: error.message.split(" ").pop()?.split('"').at(1)
};
case "40001":
return {
kind: "TransactionWriteConflict"
};
case "42P01":
return {
kind: "TableDoesNotExist",
table: error.message.split(" ").at(1)?.split('"').at(1)
};
case "42703":
{
const rawColumn = error.message.match(/^column (.+) does not exist$/)?.at(1);
return {
kind: "ColumnNotFound",
column: rawColumn?.replace(/"((?:""|[^"])*)"/g, (_, id)=>id.replaceAll('""', '"'))
};
}
case "42P04":
return {
kind: "DatabaseAlreadyExists",
db: error.message.split(" ").at(1)?.split('"').at(1)
};
case "53300":
return {
kind: "TooManyConnections",
cause: error.message
};
default:
return {
kind: "postgres",
code: error.code ?? "N/A",
severity: error.severity ?? "N/A",
message: error.message,
detail: error.detail,
column: error.column,
hint: error.hint
};
}
}
function isDriverError(error) {
return typeof error.code === "string" && typeof error.message === "string" && typeof error.severity === "string" && (typeof error.detail === "string" || error.detail === void 0) && (typeof error.column === "string" || error.column === void 0) && (typeof error.hint === "string" || error.hint === void 0);
}
function mapSocketError(error) {
switch(error.code){
case "ENOTFOUND":
case "ECONNREFUSED":
return {
kind: "DatabaseNotReachable",
host: error.address ?? error.hostname,
port: error.port
};
case "ECONNRESET":
return {
kind: "ConnectionClosed"
};
case "ETIMEDOUT":
return {
kind: "SocketTimeout"
};
}
}
function isSocketError(error) {
return typeof error.code === "string" && typeof error.syscall === "string" && typeof error.errno === "number" && SOCKET_ERRORS.has(error.code);
}
function isTlsError(error) {
if (typeof error.code === "string") {
return TLS_ERRORS.has(error.code);
}
switch(error.message){
case "The server does not support SSL connections":
case "There was an error establishing an SSL connection":
return true;
}
return false;
}
// src/pg.ts
var types2 = __TURBOPACK__imported__module__$5b$externals$5d2f$pg__$5b$external$5d$__$28$pg$2c$__esm_import$2c$__$5b$project$5d2f$node_modules$2f$pg$29$__["default"].types;
var debug = (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f40$prisma$2f$debug$2f$dist$2f$index$2e$mjs__$5b$app$2d$route$5d$__$28$ecmascript$29$__["Debug"])("prisma:driver-adapter:pg");
var PgQueryable = class {
constructor(client, pgOptions){
this.client = client;
this.pgOptions = pgOptions;
}
provider = "postgres";
adapterName = name;
/**
* Execute a query given as SQL, interpolating the given parameters.
*/ async queryRaw(query) {
const tag = "[js::query_raw]";
debug(`${tag} %O`, query);
const { fields, rows } = await this.performIO(query);
const columnNames = fields.map((field)=>field.name);
let columnTypes = [];
try {
columnTypes = fields.map((field)=>fieldToColumnType(field.dataTypeID));
} catch (e) {
if (e instanceof UnsupportedNativeDataType) {
throw new __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f40$prisma$2f$driver$2d$adapter$2d$utils$2f$dist$2f$index$2e$mjs__$5b$app$2d$route$5d$__$28$ecmascript$29$__$3c$locals$3e$__["DriverAdapterError"]({
kind: "UnsupportedNativeDataType",
type: e.type
});
}
throw e;
}
const udtParser = this.pgOptions?.userDefinedTypeParser;
if (udtParser) {
for(let i = 0; i < fields.length; i++){
const field = fields[i];
if (field.dataTypeID >= FIRST_NORMAL_OBJECT_ID && !Object.hasOwn(customParsers, field.dataTypeID)) {
for(let j = 0; j < rows.length; j++){
rows[j][i] = await udtParser(field.dataTypeID, rows[j][i], this);
}
}
}
}
return {
columnNames,
columnTypes,
rows
};
}
/**
* Execute a query given as SQL, interpolating the given parameters and
* returning the number of affected rows.
* Note: Queryable expects a u64, but napi.rs only supports u32.
*/ async executeRaw(query) {
const tag = "[js::execute_raw]";
debug(`${tag} %O`, query);
return (await this.performIO(query)).rowCount ?? 0;
}
/**
* Run a query against the database, returning the result set.
* Should the query fail due to a connection error, the connection is
* marked as unhealthy.
*/ async performIO(query) {
const { sql, args } = query;
const values = args.map((arg, i)=>mapArg(arg, query.argTypes[i]));
try {
const result = await this.client.query({
name: this.pgOptions?.statementNameGenerator?.(query),
text: sql,
values,
rowMode: "array",
types: {
getTypeParser: (oid, format)=>{
if (format === "text" && customParsers[oid]) {
return customParsers[oid];
}
return types2.getTypeParser(oid, format);
}
}
}, values);
return result;
} catch (e) {
this.onError(e);
}
}
onError(error) {
debug("Error in performIO: %O", error);
throw new __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f40$prisma$2f$driver$2d$adapter$2d$utils$2f$dist$2f$index$2e$mjs__$5b$app$2d$route$5d$__$28$ecmascript$29$__$3c$locals$3e$__["DriverAdapterError"](convertDriverError(error));
}
};
var PgTransaction = class extends PgQueryable {
constructor(client, options, pgOptions, cleanup){
super(client, pgOptions);
this.options = options;
this.pgOptions = pgOptions;
this.cleanup = cleanup;
}
async commit() {
debug(`[js::commit]`);
this.cleanup?.();
this.client.release();
}
async rollback() {
debug(`[js::rollback]`);
this.cleanup?.();
this.client.release();
}
async createSavepoint(name2) {
await this.executeRaw({
sql: `SAVEPOINT ${name2}`,
args: [],
argTypes: []
});
}
async rollbackToSavepoint(name2) {
await this.executeRaw({
sql: `ROLLBACK TO SAVEPOINT ${name2}`,
args: [],
argTypes: []
});
}
async releaseSavepoint(name2) {
await this.executeRaw({
sql: `RELEASE SAVEPOINT ${name2}`,
args: [],
argTypes: []
});
}
};
var PrismaPgAdapter = class extends PgQueryable {
constructor(client, pgOptions, release){
super(client);
this.pgOptions = pgOptions;
this.release = release;
}
async startTransaction(isolationLevel) {
const options = {
usePhantomQuery: false
};
const tag = "[js::startTransaction]";
debug("%s options: %O", tag, options);
const conn = await this.client.connect().catch((error)=>this.onError(error));
const onError = (err)=>{
debug(`Error from pool connection: ${err.message} %O`, err);
this.pgOptions?.onConnectionError?.(err);
};
conn.on("error", onError);
const cleanup = ()=>{
conn.removeListener("error", onError);
};
try {
const tx = new PgTransaction(conn, options, this.pgOptions, cleanup);
await tx.executeRaw({
sql: "BEGIN",
args: [],
argTypes: []
});
if (isolationLevel) {
await tx.executeRaw({
sql: `SET TRANSACTION ISOLATION LEVEL ${isolationLevel}`,
args: [],
argTypes: []
});
}
return tx;
} catch (error) {
cleanup();
conn.release(error);
this.onError(error);
}
}
async executeScript(script) {
const statements = script.split(";").map((stmt)=>stmt.trim()).filter((stmt)=>stmt.length > 0);
for (const stmt of statements){
try {
await this.client.query(stmt);
} catch (error) {
this.onError(error);
}
}
}
getConnectionInfo() {
return {
schemaName: this.pgOptions?.schema,
supportsRelationJoins: true
};
}
async dispose() {
return this.release?.();
}
underlyingDriver() {
return this.client;
}
};
var PrismaPgAdapterFactory = class {
constructor(poolOrConfig, options){
this.options = options;
if (poolOrConfig instanceof __TURBOPACK__imported__module__$5b$externals$5d2f$pg__$5b$external$5d$__$28$pg$2c$__esm_import$2c$__$5b$project$5d2f$node_modules$2f$pg$29$__["default"].Pool) {
this.externalPool = poolOrConfig;
this.config = poolOrConfig.options;
} else if (typeof poolOrConfig === "string") {
this.externalPool = null;
this.config = {
connectionString: poolOrConfig
};
} else {
this.externalPool = null;
this.config = poolOrConfig;
}
}
provider = "postgres";
adapterName = name;
config;
externalPool;
async connect() {
const client = this.externalPool ?? new __TURBOPACK__imported__module__$5b$externals$5d2f$pg__$5b$external$5d$__$28$pg$2c$__esm_import$2c$__$5b$project$5d2f$node_modules$2f$pg$29$__["default"].Pool(this.config);
const onIdleClientError = (err)=>{
debug(`Error from idle pool client: ${err.message} %O`, err);
this.options?.onPoolError?.(err);
};
client.on("error", onIdleClientError);
return new PrismaPgAdapter(client, this.options, async ()=>{
if (this.externalPool) {
if (this.options?.disposeExternalPool) {
await this.externalPool.end();
this.externalPool = null;
} else {
this.externalPool.removeListener("error", onIdleClientError);
}
} else {
await client.end();
}
});
}
async connectToShadowDb() {
const conn = await this.connect();
const database = `prisma_migrate_shadow_db_${globalThis.crypto.randomUUID()}`;
await conn.executeScript(`CREATE DATABASE "${database}"`);
const client = new __TURBOPACK__imported__module__$5b$externals$5d2f$pg__$5b$external$5d$__$28$pg$2c$__esm_import$2c$__$5b$project$5d2f$node_modules$2f$pg$29$__["default"].Pool({
...this.config,
database
});
return new PrismaPgAdapter(client, void 0, async ()=>{
await conn.executeScript(`DROP DATABASE "${database}"`);
await client.end();
});
}
};
;
__turbopack_async_result__();
} catch(e) { __turbopack_async_result__(e); } }, false);}),
"[project]/node_modules/@babel/runtime/helpers/interopRequireDefault.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => {
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
"default": e
};
}
module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
}),
"[project]/node_modules/@babel/runtime/helpers/OverloadYield.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => {
function _OverloadYield(e, d) {
this.v = e, this.k = d;
}
module.exports = _OverloadYield, module.exports.__esModule = true, module.exports["default"] = module.exports;
}),
"[project]/node_modules/@babel/runtime/helpers/regeneratorDefine.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => {
function _regeneratorDefine(e, r, n, t) {
var i = Object.defineProperty;
try {
i({}, "", {});
} catch (e) {
i = 0;
}
module.exports = _regeneratorDefine = function regeneratorDefine(e, r, n, t) {
function o(r, n) {
_regeneratorDefine(e, r, function(e) {
return this._invoke(r, n, e);
});
}
r ? i ? i(e, r, {
value: n,
enumerable: !t,
configurable: !t,
writable: !t
}) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2));
}, module.exports.__esModule = true, module.exports["default"] = module.exports, _regeneratorDefine(e, r, n, t);
}
module.exports = _regeneratorDefine, module.exports.__esModule = true, module.exports["default"] = module.exports;
}),
"[project]/node_modules/@babel/runtime/helpers/regenerator.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => {
var regeneratorDefine = __turbopack_context__.r("[project]/node_modules/@babel/runtime/helpers/regeneratorDefine.js [app-route] (ecmascript)");
function _regenerator() {
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag";
function i(r, n, o, i) {
var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype);
return regeneratorDefine(u, "_invoke", function(r, n, o) {
var i, c, u, f = 0, p = o || [], y = !1, G = {
p: 0,
n: 0,
v: e,
a: d,
f: d.bind(e, 4),
d: function d(t, r) {
return i = t, c = 0, u = e, G.n = r, a;
}
};
function d(r, n) {
for(c = r, u = n, t = 0; !y && f && !o && t < p.length; t++){
var o, i = p[t], d = G.p, l = i[2];
r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0));
}
if (o || r > 1) return a;
throw y = !0, n;
}
return function(o, p, l) {
if (f > 1) throw TypeError("Generator is already running");
for(y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;){
i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u);
try {
if (f = 2, i) {
if (c || (o = "next"), t = i[o]) {
if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object");
if (!t.done) return t;
u = t.value, c < 2 && (c = 0);
} else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1);
i = e;
} else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break;
} catch (t) {
i = e, c = 1, u = t;
} finally{
f = 1;
}
}
return {
value: t,
done: y
};
};
}(r, o, i), !0), u;
}
var a = {};
function Generator() {}
function GeneratorFunction() {}
function GeneratorFunctionPrototype() {}
t = Object.getPrototypeOf;
var c = [][n] ? t(t([][n]())) : (regeneratorDefine(t = {}, n, function() {
return this;
}), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c);
function f(e) {
return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, regeneratorDefine(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e;
}
return GeneratorFunction.prototype = GeneratorFunctionPrototype, regeneratorDefine(u, "constructor", GeneratorFunctionPrototype), regeneratorDefine(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", regeneratorDefine(GeneratorFunctionPrototype, o, "GeneratorFunction"), regeneratorDefine(u), regeneratorDefine(u, o, "Generator"), regeneratorDefine(u, n, function() {
return this;
}), regeneratorDefine(u, "toString", function() {
return "[object Generator]";
}), (module.exports = _regenerator = function _regenerator() {
return {
w: i,
m: f
};
}, module.exports.__esModule = true, module.exports["default"] = module.exports)();
}
module.exports = _regenerator, module.exports.__esModule = true, module.exports["default"] = module.exports;
}),
"[project]/node_modules/@babel/runtime/helpers/regeneratorAsyncIterator.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => {
var OverloadYield = __turbopack_context__.r("[project]/node_modules/@babel/runtime/helpers/OverloadYield.js [app-route] (ecmascript)");
var regeneratorDefine = __turbopack_context__.r("[project]/node_modules/@babel/runtime/helpers/regeneratorDefine.js [app-route] (ecmascript)");
function AsyncIterator(t, e) {
function n(r, o, i, f) {
try {
var c = t[r](o), u = c.value;
return u instanceof OverloadYield ? e.resolve(u.v).then(function(t) {
n("next", t, i, f);
}, function(t) {
n("throw", t, i, f);
}) : e.resolve(u).then(function(t) {
c.value = t, i(c);
}, function(t) {
return n("throw", t, i, f);
});
} catch (t) {
f(t);
}
}
var r;
this.next || (regeneratorDefine(AsyncIterator.prototype), regeneratorDefine(AsyncIterator.prototype, "function" == typeof Symbol && Symbol.asyncIterator || "@asyncIterator", function() {
return this;
})), regeneratorDefine(this, "_invoke", function(t, o, i) {
function f() {
return new e(function(e, r) {
n(t, i, e, r);
});
}
return r = r ? r.then(f, f) : f();
}, !0);
}
module.exports = AsyncIterator, module.exports.__esModule = true, module.exports["default"] = module.exports;
}),
"[project]/node_modules/@babel/runtime/helpers/regeneratorAsyncGen.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => {
var regenerator = __turbopack_context__.r("[project]/node_modules/@babel/runtime/helpers/regenerator.js [app-route] (ecmascript)");
var regeneratorAsyncIterator = __turbopack_context__.r("[project]/node_modules/@babel/runtime/helpers/regeneratorAsyncIterator.js [app-route] (ecmascript)");
function _regeneratorAsyncGen(r, e, t, o, n) {
return new regeneratorAsyncIterator(regenerator().w(r, e, t, o), n || Promise);
}
module.exports = _regeneratorAsyncGen, module.exports.__esModule = true, module.exports["default"] = module.exports;
}),
"[project]/node_modules/@babel/runtime/helpers/regeneratorAsync.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => {
var regeneratorAsyncGen = __turbopack_context__.r("[project]/node_modules/@babel/runtime/helpers/regeneratorAsyncGen.js [app-route] (ecmascript)");
function _regeneratorAsync(n, e, r, t, o) {
var a = regeneratorAsyncGen(n, e, r, t, o);
return a.next().then(function(n) {
return n.done ? n.value : a.next();
});
}
module.exports = _regeneratorAsync, module.exports.__esModule = true, module.exports["default"] = module.exports;
}),
"[project]/node_modules/@babel/runtime/helpers/regeneratorKeys.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => {
function _regeneratorKeys(e) {
var n = Object(e), r = [];
for(var t in n)r.unshift(t);
return function e() {
for(; r.length;)if ((t = r.pop()) in n) return e.value = t, e.done = !1, e;
return e.done = !0, e;
};
}
module.exports = _regeneratorKeys, module.exports.__esModule = true, module.exports["default"] = module.exports;
}),
"[project]/node_modules/@babel/runtime/helpers/typeof.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => {
function _typeof(o) {
"@babel/helpers - typeof";
return module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
return typeof o;
} : function(o) {
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
}, module.exports.__esModule = true, module.exports["default"] = module.exports, _typeof(o);
}
module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
}),
"[project]/node_modules/@babel/runtime/helpers/regeneratorValues.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => {
var _typeof = __turbopack_context__.r("[project]/node_modules/@babel/runtime/helpers/typeof.js [app-route] (ecmascript)")["default"];
function _regeneratorValues(e) {
if (null != e) {
var t = e["function" == typeof Symbol && Symbol.iterator || "@@iterator"], r = 0;
if (t) return t.call(e);
if ("function" == typeof e.next) return e;
if (!isNaN(e.length)) return {
next: function next() {
return e && r >= e.length && (e = void 0), {
value: e && e[r++],
done: !e
};
}
};
}
throw new TypeError(_typeof(e) + " is not iterable");
}
module.exports = _regeneratorValues, module.exports.__esModule = true, module.exports["default"] = module.exports;
}),
"[project]/node_modules/@babel/runtime/helpers/regeneratorRuntime.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => {
var OverloadYield = __turbopack_context__.r("[project]/node_modules/@babel/runtime/helpers/OverloadYield.js [app-route] (ecmascript)");
var regenerator = __turbopack_context__.r("[project]/node_modules/@babel/runtime/helpers/regenerator.js [app-route] (ecmascript)");
var regeneratorAsync = __turbopack_context__.r("[project]/node_modules/@babel/runtime/helpers/regeneratorAsync.js [app-route] (ecmascript)");
var regeneratorAsyncGen = __turbopack_context__.r("[project]/node_modules/@babel/runtime/helpers/regeneratorAsyncGen.js [app-route] (ecmascript)");
var regeneratorAsyncIterator = __turbopack_context__.r("[project]/node_modules/@babel/runtime/helpers/regeneratorAsyncIterator.js [app-route] (ecmascript)");
var regeneratorKeys = __turbopack_context__.r("[project]/node_modules/@babel/runtime/helpers/regeneratorKeys.js [app-route] (ecmascript)");
var regeneratorValues = __turbopack_context__.r("[project]/node_modules/@babel/runtime/helpers/regeneratorValues.js [app-route] (ecmascript)");
function _regeneratorRuntime() {
"use strict";
var r = regenerator(), e = r.m(_regeneratorRuntime), t = (Object.getPrototypeOf ? Object.getPrototypeOf(e) : e.__proto__).constructor;
function n(r) {
var e = "function" == typeof r && r.constructor;
return !!e && (e === t || "GeneratorFunction" === (e.displayName || e.name));
}
var o = {
"throw": 1,
"return": 2,
"break": 3,
"continue": 3
};
function a(r) {
var e, t;
return function(n) {
e || (e = {
stop: function stop() {
return t(n.a, 2);
},
"catch": function _catch() {
return n.v;
},
abrupt: function abrupt(r, e) {
return t(n.a, o[r], e);
},
delegateYield: function delegateYield(r, o, a) {
return e.resultName = o, t(n.d, regeneratorValues(r), a);
},
finish: function finish(r) {
return t(n.f, r);
}
}, t = function t(r, _t, o) {
n.p = e.prev, n.n = e.next;
try {
return r(_t, o);
} finally{
e.next = n.n;
}
}), e.resultName && (e[e.resultName] = n.v, e.resultName = void 0), e.sent = n.v, e.next = n.n;
try {
return r.call(this, e);
} finally{
n.p = e.prev, n.n = e.next;
}
};
}
return (module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
return {
wrap: function wrap(e, t, n, o) {
return r.w(a(e), t, n, o && o.reverse());
},
isGeneratorFunction: n,
mark: r.m,
awrap: function awrap(r, e) {
return new OverloadYield(r, e);
},
AsyncIterator: regeneratorAsyncIterator,
async: function async(r, e, t, o, u) {
return (n(e) ? regeneratorAsyncGen : regeneratorAsync)(a(r), e, t, o, u);
},
keys: regeneratorKeys,
values: regeneratorValues
};
}, module.exports.__esModule = true, module.exports["default"] = module.exports)();
}
module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
}),
"[project]/node_modules/@babel/runtime/regenerator/index.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => {
// TODO(Babel 8): Remove this file.
var runtime = __turbopack_context__.r("[project]/node_modules/@babel/runtime/helpers/regeneratorRuntime.js [app-route] (ecmascript)")();
module.exports = runtime;
// Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736=
try {
regeneratorRuntime = runtime;
} catch (accidentalStrictMode) {
if (typeof globalThis === "object") {
globalThis.regeneratorRuntime = runtime;
} else {
Function("r", "regeneratorRuntime = r")(runtime);
}
}
}),
"[project]/node_modules/@babel/runtime/helpers/toPrimitive.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => {
var _typeof = __turbopack_context__.r("[project]/node_modules/@babel/runtime/helpers/typeof.js [app-route] (ecmascript)")["default"];
function toPrimitive(t, r) {
if ("object" != _typeof(t) || !t) return t;
var e = t[Symbol.toPrimitive];
if (void 0 !== e) {
var i = e.call(t, r || "default");
if ("object" != _typeof(i)) return i;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return ("string" === r ? String : Number)(t);
}
module.exports = toPrimitive, module.exports.__esModule = true, module.exports["default"] = module.exports;
}),
"[project]/node_modules/@babel/runtime/helpers/toPropertyKey.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => {
var _typeof = __turbopack_context__.r("[project]/node_modules/@babel/runtime/helpers/typeof.js [app-route] (ecmascript)")["default"];
var toPrimitive = __turbopack_context__.r("[project]/node_modules/@babel/runtime/helpers/toPrimitive.js [app-route] (ecmascript)");
function toPropertyKey(t) {
var i = toPrimitive(t, "string");
return "symbol" == _typeof(i) ? i : i + "";
}
module.exports = toPropertyKey, module.exports.__esModule = true, module.exports["default"] = module.exports;
}),
"[project]/node_modules/@babel/runtime/helpers/defineProperty.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => {
var toPropertyKey = __turbopack_context__.r("[project]/node_modules/@babel/runtime/helpers/toPropertyKey.js [app-route] (ecmascript)");
function _defineProperty(e, r, t) {
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
value: t,
enumerable: !0,
configurable: !0,
writable: !0
}) : e[r] = t, e;
}
module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
}),
"[project]/node_modules/@babel/runtime/helpers/asyncToGenerator.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => {
function asyncGeneratorStep(n, t, e, r, o, a, c) {
try {
var i = n[a](c), u = i.value;
} catch (n) {
return void e(n);
}
i.done ? t(u) : Promise.resolve(u).then(r, o);
}
function _asyncToGenerator(n) {
return function() {
var t = this, e = arguments;
return new Promise(function(r, o) {
var a = n.apply(t, e);
function _next(n) {
asyncGeneratorStep(a, r, o, _next, _throw, "next", n);
}
function _throw(n) {
asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);
}
_next(void 0);
});
};
}
module.exports = _asyncToGenerator, module.exports.__esModule = true, module.exports["default"] = module.exports;
}),
"[project]/node_modules/@babel/runtime/helpers/classCallCheck.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => {
function _classCallCheck(a, n) {
if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
}
module.exports = _classCallCheck, module.exports.__esModule = true, module.exports["default"] = module.exports;
}),
"[project]/node_modules/@babel/runtime/helpers/createClass.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => {
var toPropertyKey = __turbopack_context__.r("[project]/node_modules/@babel/runtime/helpers/toPropertyKey.js [app-route] (ecmascript)");
function _defineProperties(e, r) {
for(var t = 0; t < r.length; t++){
var o = r[t];
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, toPropertyKey(o.key), o);
}
}
function _createClass(e, r, t) {
return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", {
writable: !1
}), e;
}
module.exports = _createClass, module.exports.__esModule = true, module.exports["default"] = module.exports;
}),
"[project]/node_modules/@babel/runtime/helpers/assertThisInitialized.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => {
function _assertThisInitialized(e) {
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return e;
}
module.exports = _assertThisInitialized, module.exports.__esModule = true, module.exports["default"] = module.exports;
}),
"[project]/node_modules/@babel/runtime/helpers/possibleConstructorReturn.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => {
var _typeof = __turbopack_context__.r("[project]/node_modules/@babel/runtime/helpers/typeof.js [app-route] (ecmascript)")["default"];
var assertThisInitialized = __turbopack_context__.r("[project]/node_modules/@babel/runtime/helpers/assertThisInitialized.js [app-route] (ecmascript)");
function _possibleConstructorReturn(t, e) {
if (e && ("object" == _typeof(e) || "function" == typeof e)) return e;
if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
return assertThisInitialized(t);
}
module.exports = _possibleConstructorReturn, module.exports.__esModule = true, module.exports["default"] = module.exports;
}),
"[project]/node_modules/@babel/runtime/helpers/getPrototypeOf.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => {
function _getPrototypeOf(t) {
return module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(t) {
return t.__proto__ || Object.getPrototypeOf(t);
}, module.exports.__esModule = true, module.exports["default"] = module.exports, _getPrototypeOf(t);
}
module.exports = _getPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
}),
"[project]/node_modules/@babel/runtime/helpers/setPrototypeOf.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => {
function _setPrototypeOf(t, e) {
return module.exports = _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t, e) {
return t.__proto__ = e, t;
}, module.exports.__esModule = true, module.exports["default"] = module.exports, _setPrototypeOf(t, e);
}
module.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
}),
"[project]/node_modules/@babel/runtime/helpers/inherits.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => {
var setPrototypeOf = __turbopack_context__.r("[project]/node_modules/@babel/runtime/helpers/setPrototypeOf.js [app-route] (ecmascript)");
function _inherits(t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
t.prototype = Object.create(e && e.prototype, {
constructor: {
value: t,
writable: !0,
configurable: !0
}
}), Object.defineProperty(t, "prototype", {
writable: !1
}), e && setPrototypeOf(t, e);
}
module.exports = _inherits, module.exports.__esModule = true, module.exports["default"] = module.exports;
}),
"[project]/node_modules/@babel/runtime/helpers/isNativeFunction.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => {
function _isNativeFunction(t) {
try {
return -1 !== Function.toString.call(t).indexOf("[native code]");
} catch (n) {
return "function" == typeof t;
}
}
module.exports = _isNativeFunction, module.exports.__esModule = true, module.exports["default"] = module.exports;
}),
"[project]/node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => {
function _isNativeReflectConstruct() {
try {
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
} catch (t) {}
return (module.exports = _isNativeReflectConstruct = function _isNativeReflectConstruct() {
return !!t;
}, module.exports.__esModule = true, module.exports["default"] = module.exports)();
}
module.exports = _isNativeReflectConstruct, module.exports.__esModule = true, module.exports["default"] = module.exports;
}),
"[project]/node_modules/@babel/runtime/helpers/construct.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => {
var isNativeReflectConstruct = __turbopack_context__.r("[project]/node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js [app-route] (ecmascript)");
var setPrototypeOf = __turbopack_context__.r("[project]/node_modules/@babel/runtime/helpers/setPrototypeOf.js [app-route] (ecmascript)");
function _construct(t, e, r) {
if (isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments);
var o = [
null
];
o.push.apply(o, e);
var p = new (t.bind.apply(t, o))();
return r && setPrototypeOf(p, r.prototype), p;
}
module.exports = _construct, module.exports.__esModule = true, module.exports["default"] = module.exports;
}),
"[project]/node_modules/@babel/runtime/helpers/wrapNativeSuper.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => {
var getPrototypeOf = __turbopack_context__.r("[project]/node_modules/@babel/runtime/helpers/getPrototypeOf.js [app-route] (ecmascript)");
var setPrototypeOf = __turbopack_context__.r("[project]/node_modules/@babel/runtime/helpers/setPrototypeOf.js [app-route] (ecmascript)");
var isNativeFunction = __turbopack_context__.r("[project]/node_modules/@babel/runtime/helpers/isNativeFunction.js [app-route] (ecmascript)");
var construct = __turbopack_context__.r("[project]/node_modules/@babel/runtime/helpers/construct.js [app-route] (ecmascript)");
function _wrapNativeSuper(t) {
var r = "function" == typeof Map ? new Map() : void 0;
return module.exports = _wrapNativeSuper = function _wrapNativeSuper(t) {
if (null === t || !isNativeFunction(t)) return t;
if ("function" != typeof t) throw new TypeError("Super expression must either be null or a function");
if (void 0 !== r) {
if (r.has(t)) return r.get(t);
r.set(t, Wrapper);
}
function Wrapper() {
return construct(t, arguments, getPrototypeOf(this).constructor);
}
return Wrapper.prototype = Object.create(t.prototype, {
constructor: {
value: Wrapper,
enumerable: !1,
writable: !0,
configurable: !0
}
}), setPrototypeOf(Wrapper, t);
}, module.exports.__esModule = true, module.exports["default"] = module.exports, _wrapNativeSuper(t);
}
module.exports = _wrapNativeSuper, module.exports.__esModule = true, module.exports["default"] = module.exports;
}),
"[project]/node_modules/@babel/runtime/helpers/extends.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => {
function _extends() {
return module.exports = _extends = ("TURBOPACK compile-time truthy", 1) ? Object.assign.bind() : "TURBOPACK unreachable", module.exports.__esModule = true, module.exports["default"] = module.exports, _extends.apply(null, arguments);
}
module.exports = _extends, module.exports.__esModule = true, module.exports["default"] = module.exports;
}),
"[project]/node_modules/oidc-token-hash/lib/index.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => {
const { strict: assert } = __turbopack_context__.r("[externals]/assert [external] (assert, cjs)");
const { createHash } = __turbopack_context__.r("[externals]/crypto [external] (crypto, cjs)");
const { format } = __turbopack_context__.r("[externals]/util [external] (util, cjs)");
let encode;
if (Buffer.isEncoding('base64url')) {
encode = (input)=>input.toString('base64url');
} else {
const fromBase64 = (base64)=>base64.replace(/=/g, '').replace(/\+/g, '-').replace(/\//g, '_');
encode = (input)=>fromBase64(input.toString('base64'));
}
/** SPECIFICATION
* Its (_hash) value is the base64url encoding of the left-most half of the hash of the octets of
* the ASCII representation of the token value, where the hash algorithm used is the hash algorithm
* used in the alg Header Parameter of the ID Token's JOSE Header. For instance, if the alg is
* RS256, hash the token value with SHA-256, then take the left-most 128 bits and base64url encode
* them. The _hash value is a case sensitive string.
*/ /**
* @name getHash
* @api private
*
* returns the sha length based off the JOSE alg heade value, defaults to sha256
*
* @param token {String} token value to generate the hash from
* @param alg {String} ID Token JOSE header alg value (i.e. RS256, HS384, ES512, PS256)
* @param [crv] {String} For EdDSA the curve decides what hash algorithm is used. Required for EdDSA
*/ function getHash(alg, crv) {
switch(alg){
case 'HS256':
case 'RS256':
case 'PS256':
case 'ES256':
case 'ES256K':
return createHash('sha256');
case 'HS384':
case 'RS384':
case 'PS384':
case 'ES384':
return createHash('sha384');
case 'HS512':
case 'RS512':
case 'PS512':
case 'ES512':
case 'Ed25519':
return createHash('sha512');
case 'Ed448':
return createHash('shake256', {
outputLength: 114
});
case 'ML-DSA-44':
case 'ML-DSA-65':
case 'ML-DSA-87':
return createHash('shake256', {
outputLength: 64
});
case 'EdDSA':
switch(crv){
case 'Ed25519':
return createHash('sha512');
case 'Ed448':
return createHash('shake256', {
outputLength: 114
});
default:
throw new TypeError('unrecognized or invalid EdDSA curve provided');
}
default:
throw new TypeError('unrecognized or invalid JWS algorithm provided');
}
}
function generate(token, alg, crv) {
const digest = getHash(alg, crv).update(token).digest();
return encode(digest.slice(0, digest.length / 2));
}
function validate(names, actual, source, alg, crv) {
if (typeof names.claim !== 'string' || !names.claim) {
throw new TypeError('names.claim must be a non-empty string');
}
if (typeof names.source !== 'string' || !names.source) {
throw new TypeError('names.source must be a non-empty string');
}
assert(typeof actual === 'string' && actual, `${names.claim} must be a non-empty string`);
assert(typeof source === 'string' && source, `${names.source} must be a non-empty string`);
let expected;
let msg;
try {
expected = generate(source, alg, crv);
} catch (err) {
msg = format('%s could not be validated (%s)', names.claim, err.message);
}
msg = msg || format('%s mismatch, expected %s, got: %s', names.claim, expected, actual);
assert.equal(expected, actual, msg);
}
module.exports = {
validate,
generate
};
}),
"[project]/node_modules/openid-client/node_modules/yallist/iterator.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => {
"use strict";
module.exports = function(Yallist) {
Yallist.prototype[Symbol.iterator] = function*() {
for(let walker = this.head; walker; walker = walker.next){
yield walker.value;
}
};
};
}),
"[project]/node_modules/openid-client/node_modules/yallist/yallist.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => {
"use strict";
module.exports = Yallist;
Yallist.Node = Node;
Yallist.create = Yallist;
function Yallist(list) {
var self = this;
if (!(self instanceof Yallist)) {
self = new Yallist();
}
self.tail = null;
self.head = null;
self.length = 0;
if (list && typeof list.forEach === 'function') {
list.forEach(function(item) {
self.push(item);
});
} else if (arguments.length > 0) {
for(var i = 0, l = arguments.length; i < l; i++){
self.push(arguments[i]);
}
}
return self;
}
Yallist.prototype.removeNode = function(node) {
if (node.list !== this) {
throw new Error('removing node which does not belong to this list');
}
var next = node.next;
var prev = node.prev;
if (next) {
next.prev = prev;
}
if (prev) {
prev.next = next;
}
if (node === this.head) {
this.head = next;
}
if (node === this.tail) {
this.tail = prev;
}
node.list.length--;
node.next = null;
node.prev = null;
node.list = null;
return next;
};
Yallist.prototype.unshiftNode = function(node) {
if (node === this.head) {
return;
}
if (node.list) {
node.list.removeNode(node);
}
var head = this.head;
node.list = this;
node.next = head;
if (head) {
head.prev = node;
}
this.head = node;
if (!this.tail) {
this.tail = node;
}
this.length++;
};
Yallist.prototype.pushNode = function(node) {
if (node === this.tail) {
return;
}
if (node.list) {
node.list.removeNode(node);
}
var tail = this.tail;
node.list = this;
node.prev = tail;
if (tail) {
tail.next = node;
}
this.tail = node;
if (!this.head) {
this.head = node;
}
this.length++;
};
Yallist.prototype.push = function() {
for(var i = 0, l = arguments.length; i < l; i++){
push(this, arguments[i]);
}
return this.length;
};
Yallist.prototype.unshift = function() {
for(var i = 0, l = arguments.length; i < l; i++){
unshift(this, arguments[i]);
}
return this.length;
};
Yallist.prototype.pop = function() {
if (!this.tail) {
return undefined;
}
var res = this.tail.value;
this.tail = this.tail.prev;
if (this.tail) {
this.tail.next = null;
} else {
this.head = null;
}
this.length--;
return res;
};
Yallist.prototype.shift = function() {
if (!this.head) {
return undefined;
}
var res = this.head.value;
this.head = this.head.next;
if (this.head) {
this.head.prev = null;
} else {
this.tail = null;
}
this.length--;
return res;
};
Yallist.prototype.forEach = function(fn, thisp) {
thisp = thisp || this;
for(var walker = this.head, i = 0; walker !== null; i++){
fn.call(thisp, walker.value, i, this);
walker = walker.next;
}
};
Yallist.prototype.forEachReverse = function(fn, thisp) {
thisp = thisp || this;
for(var walker = this.tail, i = this.length - 1; walker !== null; i--){
fn.call(thisp, walker.value, i, this);
walker = walker.prev;
}
};
Yallist.prototype.get = function(n) {
for(var i = 0, walker = this.head; walker !== null && i < n; i++){
// abort out of the list early if we hit a cycle
walker = walker.next;
}
if (i === n && walker !== null) {
return walker.value;
}
};
Yallist.prototype.getReverse = function(n) {
for(var i = 0, walker = this.tail; walker !== null && i < n; i++){
// abort out of the list early if we hit a cycle
walker = walker.prev;
}
if (i === n && walker !== null) {
return walker.value;
}
};
Yallist.prototype.map = function(fn, thisp) {
thisp = thisp || this;
var res = new Yallist();
for(var walker = this.head; walker !== null;){
res.push(fn.call(thisp, walker.value, this));
walker = walker.next;
}
return res;
};
Yallist.prototype.mapReverse = function(fn, thisp) {
thisp = thisp || this;
var res = new Yallist();
for(var walker = this.tail; walker !== null;){
res.push(fn.call(thisp, walker.value, this));
walker = walker.prev;
}
return res;
};
Yallist.prototype.reduce = function(fn, initial) {
var acc;
var walker = this.head;
if (arguments.length > 1) {
acc = initial;
} else if (this.head) {
walker = this.head.next;
acc = this.head.value;
} else {
throw new TypeError('Reduce of empty list with no initial value');
}
for(var i = 0; walker !== null; i++){
acc = fn(acc, walker.value, i);
walker = walker.next;
}
return acc;
};
Yallist.prototype.reduceReverse = function(fn, initial) {
var acc;
var walker = this.tail;
if (arguments.length > 1) {
acc = initial;
} else if (this.tail) {
walker = this.tail.prev;
acc = this.tail.value;
} else {
throw new TypeError('Reduce of empty list with no initial value');
}
for(var i = this.length - 1; walker !== null; i--){
acc = fn(acc, walker.value, i);
walker = walker.prev;
}
return acc;
};
Yallist.prototype.toArray = function() {
var arr = new Array(this.length);
for(var i = 0, walker = this.head; walker !== null; i++){
arr[i] = walker.value;
walker = walker.next;
}
return arr;
};
Yallist.prototype.toArrayReverse = function() {
var arr = new Array(this.length);
for(var i = 0, walker = this.tail; walker !== null; i++){
arr[i] = walker.value;
walker = walker.prev;
}
return arr;
};
Yallist.prototype.slice = function(from, to) {
to = to || this.length;
if (to < 0) {
to += this.length;
}
from = from || 0;
if (from < 0) {
from += this.length;
}
var ret = new Yallist();
if (to < from || to < 0) {
return ret;
}
if (from < 0) {
from = 0;
}
if (to > this.length) {
to = this.length;
}
for(var i = 0, walker = this.head; walker !== null && i < from; i++){
walker = walker.next;
}
for(; walker !== null && i < to; i++, walker = walker.next){
ret.push(walker.value);
}
return ret;
};
Yallist.prototype.sliceReverse = function(from, to) {
to = to || this.length;
if (to < 0) {
to += this.length;
}
from = from || 0;
if (from < 0) {
from += this.length;
}
var ret = new Yallist();
if (to < from || to < 0) {
return ret;
}
if (from < 0) {
from = 0;
}
if (to > this.length) {
to = this.length;
}
for(var i = this.length, walker = this.tail; walker !== null && i > to; i--){
walker = walker.prev;
}
for(; walker !== null && i > from; i--, walker = walker.prev){
ret.push(walker.value);
}
return ret;
};
Yallist.prototype.splice = function(start, deleteCount, ...nodes) {
if (start > this.length) {
start = this.length - 1;
}
if (start < 0) {
start = this.length + start;
}
for(var i = 0, walker = this.head; walker !== null && i < start; i++){
walker = walker.next;
}
var ret = [];
for(var i = 0; walker && i < deleteCount; i++){
ret.push(walker.value);
walker = this.removeNode(walker);
}
if (walker === null) {
walker = this.tail;
}
if (walker !== this.head && walker !== this.tail) {
walker = walker.prev;
}
for(var i = 0; i < nodes.length; i++){
walker = insert(this, walker, nodes[i]);
}
return ret;
};
Yallist.prototype.reverse = function() {
var head = this.head;
var tail = this.tail;
for(var walker = head; walker !== null; walker = walker.prev){
var p = walker.prev;
walker.prev = walker.next;
walker.next = p;
}
this.head = tail;
this.tail = head;
return this;
};
function insert(self, node, value) {
var inserted = node === self.head ? new Node(value, null, node, self) : new Node(value, node, node.next, self);
if (inserted.next === null) {
self.tail = inserted;
}
if (inserted.prev === null) {
self.head = inserted;
}
self.length++;
return inserted;
}
function push(self, item) {
self.tail = new Node(item, self.tail, null, self);
if (!self.head) {
self.head = self.tail;
}
self.length++;
}
function unshift(self, item) {
self.head = new Node(item, null, self.head, self);
if (!self.tail) {
self.tail = self.head;
}
self.length++;
}
function Node(value, prev, next, list) {
if (!(this instanceof Node)) {
return new Node(value, prev, next, list);
}
this.list = list;
this.value = value;
if (prev) {
prev.next = this;
this.prev = prev;
} else {
this.prev = null;
}
if (next) {
next.prev = this;
this.next = next;
} else {
this.next = null;
}
}
try {
// add if support for Symbol.iterator is present
__turbopack_context__.r("[project]/node_modules/openid-client/node_modules/yallist/iterator.js [app-route] (ecmascript)")(Yallist);
} catch (er) {}
}),
"[project]/node_modules/openid-client/node_modules/lru-cache/index.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => {
"use strict";
// A linked list to keep track of recently-used-ness
const Yallist = __turbopack_context__.r("[project]/node_modules/openid-client/node_modules/yallist/yallist.js [app-route] (ecmascript)");
const MAX = Symbol('max');
const LENGTH = Symbol('length');
const LENGTH_CALCULATOR = Symbol('lengthCalculator');
const ALLOW_STALE = Symbol('allowStale');
const MAX_AGE = Symbol('maxAge');
const DISPOSE = Symbol('dispose');
const NO_DISPOSE_ON_SET = Symbol('noDisposeOnSet');
const LRU_LIST = Symbol('lruList');
const CACHE = Symbol('cache');
const UPDATE_AGE_ON_GET = Symbol('updateAgeOnGet');
const naiveLength = ()=>1;
// lruList is a yallist where the head is the youngest
// item, and the tail is the oldest. the list contains the Hit
// objects as the entries.
// Each Hit object has a reference to its Yallist.Node. This
// never changes.
//
// cache is a Map (or PseudoMap) that matches the keys to
// the Yallist.Node object.
class LRUCache {
constructor(options){
if (typeof options === 'number') options = {
max: options
};
if (!options) options = {};
if (options.max && (typeof options.max !== 'number' || options.max < 0)) throw new TypeError('max must be a non-negative number');
// Kind of weird to have a default max of Infinity, but oh well.
const max = this[MAX] = options.max || Infinity;
const lc = options.length || naiveLength;
this[LENGTH_CALCULATOR] = typeof lc !== 'function' ? naiveLength : lc;
this[ALLOW_STALE] = options.stale || false;
if (options.maxAge && typeof options.maxAge !== 'number') throw new TypeError('maxAge must be a number');
this[MAX_AGE] = options.maxAge || 0;
this[DISPOSE] = options.dispose;
this[NO_DISPOSE_ON_SET] = options.noDisposeOnSet || false;
this[UPDATE_AGE_ON_GET] = options.updateAgeOnGet || false;
this.reset();
}
// resize the cache when the max changes.
set max(mL) {
if (typeof mL !== 'number' || mL < 0) throw new TypeError('max must be a non-negative number');
this[MAX] = mL || Infinity;
trim(this);
}
get max() {
return this[MAX];
}
set allowStale(allowStale) {
this[ALLOW_STALE] = !!allowStale;
}
get allowStale() {
return this[ALLOW_STALE];
}
set maxAge(mA) {
if (typeof mA !== 'number') throw new TypeError('maxAge must be a non-negative number');
this[MAX_AGE] = mA;
trim(this);
}
get maxAge() {
return this[MAX_AGE];
}
// resize the cache when the lengthCalculator changes.
set lengthCalculator(lC) {
if (typeof lC !== 'function') lC = naiveLength;
if (lC !== this[LENGTH_CALCULATOR]) {
this[LENGTH_CALCULATOR] = lC;
this[LENGTH] = 0;
this[LRU_LIST].forEach((hit)=>{
hit.length = this[LENGTH_CALCULATOR](hit.value, hit.key);
this[LENGTH] += hit.length;
});
}
trim(this);
}
get lengthCalculator() {
return this[LENGTH_CALCULATOR];
}
get length() {
return this[LENGTH];
}
get itemCount() {
return this[LRU_LIST].length;
}
rforEach(fn, thisp) {
thisp = thisp || this;
for(let walker = this[LRU_LIST].tail; walker !== null;){
const prev = walker.prev;
forEachStep(this, fn, walker, thisp);
walker = prev;
}
}
forEach(fn, thisp) {
thisp = thisp || this;
for(let walker = this[LRU_LIST].head; walker !== null;){
const next = walker.next;
forEachStep(this, fn, walker, thisp);
walker = next;
}
}
keys() {
return this[LRU_LIST].toArray().map((k)=>k.key);
}
values() {
return this[LRU_LIST].toArray().map((k)=>k.value);
}
reset() {
if (this[DISPOSE] && this[LRU_LIST] && this[LRU_LIST].length) {
this[LRU_LIST].forEach((hit)=>this[DISPOSE](hit.key, hit.value));
}
this[CACHE] = new Map(); // hash of items by key
this[LRU_LIST] = new Yallist(); // list of items in order of use recency
this[LENGTH] = 0; // length of items in the list
}
dump() {
return this[LRU_LIST].map((hit)=>isStale(this, hit) ? false : {
k: hit.key,
v: hit.value,
e: hit.now + (hit.maxAge || 0)
}).toArray().filter((h)=>h);
}
dumpLru() {
return this[LRU_LIST];
}
set(key, value, maxAge) {
maxAge = maxAge || this[MAX_AGE];
if (maxAge && typeof maxAge !== 'number') throw new TypeError('maxAge must be a number');
const now = maxAge ? Date.now() : 0;
const len = this[LENGTH_CALCULATOR](value, key);
if (this[CACHE].has(key)) {
if (len > this[MAX]) {
del(this, this[CACHE].get(key));
return false;
}
const node = this[CACHE].get(key);
const item = node.value;
// dispose of the old one before overwriting
// split out into 2 ifs for better coverage tracking
if (this[DISPOSE]) {
if (!this[NO_DISPOSE_ON_SET]) this[DISPOSE](key, item.value);
}
item.now = now;
item.maxAge = maxAge;
item.value = value;
this[LENGTH] += len - item.length;
item.length = len;
this.get(key);
trim(this);
return true;
}
const hit = new Entry(key, value, len, now, maxAge);
// oversized objects fall out of cache automatically.
if (hit.length > this[MAX]) {
if (this[DISPOSE]) this[DISPOSE](key, value);
return false;
}
this[LENGTH] += hit.length;
this[LRU_LIST].unshift(hit);
this[CACHE].set(key, this[LRU_LIST].head);
trim(this);
return true;
}
has(key) {
if (!this[CACHE].has(key)) return false;
const hit = this[CACHE].get(key).value;
return !isStale(this, hit);
}
get(key) {
return get(this, key, true);
}
peek(key) {
return get(this, key, false);
}
pop() {
const node = this[LRU_LIST].tail;
if (!node) return null;
del(this, node);
return node.value;
}
del(key) {
del(this, this[CACHE].get(key));
}
load(arr) {
// reset the cache
this.reset();
const now = Date.now();
// A previous serialized cache has the most recent items first
for(let l = arr.length - 1; l >= 0; l--){
const hit = arr[l];
const expiresAt = hit.e || 0;
if (expiresAt === 0) // the item was created without expiration in a non aged cache
this.set(hit.k, hit.v);
else {
const maxAge = expiresAt - now;
// dont add already expired items
if (maxAge > 0) {
this.set(hit.k, hit.v, maxAge);
}
}
}
}
prune() {
this[CACHE].forEach((value, key)=>get(this, key, false));
}
}
const get = (self, key, doUse)=>{
const node = self[CACHE].get(key);
if (node) {
const hit = node.value;
if (isStale(self, hit)) {
del(self, node);
if (!self[ALLOW_STALE]) return undefined;
} else {
if (doUse) {
if (self[UPDATE_AGE_ON_GET]) node.value.now = Date.now();
self[LRU_LIST].unshiftNode(node);
}
}
return hit.value;
}
};
const isStale = (self, hit)=>{
if (!hit || !hit.maxAge && !self[MAX_AGE]) return false;
const diff = Date.now() - hit.now;
return hit.maxAge ? diff > hit.maxAge : self[MAX_AGE] && diff > self[MAX_AGE];
};
const trim = (self)=>{
if (self[LENGTH] > self[MAX]) {
for(let walker = self[LRU_LIST].tail; self[LENGTH] > self[MAX] && walker !== null;){
// We know that we're about to delete this one, and also
// what the next least recently used key will be, so just
// go ahead and set it now.
const prev = walker.prev;
del(self, walker);
walker = prev;
}
}
};
const del = (self, node)=>{
if (node) {
const hit = node.value;
if (self[DISPOSE]) self[DISPOSE](hit.key, hit.value);
self[LENGTH] -= hit.length;
self[CACHE].delete(hit.key);
self[LRU_LIST].removeNode(node);
}
};
class Entry {
constructor(key, value, length, now, maxAge){
this.key = key;
this.value = value;
this.length = length;
this.now = now;
this.maxAge = maxAge || 0;
}
}
const forEachStep = (self, fn, node, thisp)=>{
let hit = node.value;
if (isStale(self, hit)) {
del(self, node);
if (!self[ALLOW_STALE]) hit = undefined;
}
if (hit) fn.call(thisp, hit.value, hit.key, self);
};
module.exports = LRUCache;
}),
"[project]/node_modules/object-hash/index.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => {
"use strict";
var crypto = __turbopack_context__.r("[externals]/crypto [external] (crypto, cjs)");
/**
* Exported function
*
* Options:
*
* - `algorithm` hash algo to be used by this instance: *'sha1', 'md5'
* - `excludeValues` {true|*false} hash object keys, values ignored
* - `encoding` hash encoding, supports 'buffer', '*hex', 'binary', 'base64'
* - `ignoreUnknown` {true|*false} ignore unknown object types
* - `replacer` optional function that replaces values before hashing
* - `respectFunctionProperties` {*true|false} consider function properties when hashing
* - `respectFunctionNames` {*true|false} consider 'name' property of functions for hashing
* - `respectType` {*true|false} Respect special properties (prototype, constructor)
* when hashing to distinguish between types
* - `unorderedArrays` {true|*false} Sort all arrays before hashing
* - `unorderedSets` {*true|false} Sort `Set` and `Map` instances before hashing
* * = default
*
* @param {object} object value to hash
* @param {object} options hashing options
* @return {string} hash value
* @api public
*/ exports = module.exports = objectHash;
function objectHash(object, options) {
options = applyDefaults(object, options);
return hash(object, options);
}
/**
* Exported sugar methods
*
* @param {object} object value to hash
* @return {string} hash value
* @api public
*/ exports.sha1 = function(object) {
return objectHash(object);
};
exports.keys = function(object) {
return objectHash(object, {
excludeValues: true,
algorithm: 'sha1',
encoding: 'hex'
});
};
exports.MD5 = function(object) {
return objectHash(object, {
algorithm: 'md5',
encoding: 'hex'
});
};
exports.keysMD5 = function(object) {
return objectHash(object, {
algorithm: 'md5',
encoding: 'hex',
excludeValues: true
});
};
// Internals
var hashes = crypto.getHashes ? crypto.getHashes().slice() : [
'sha1',
'md5'
];
hashes.push('passthrough');
var encodings = [
'buffer',
'hex',
'binary',
'base64'
];
function applyDefaults(object, sourceOptions) {
sourceOptions = sourceOptions || {};
// create a copy rather than mutating
var options = {};
options.algorithm = sourceOptions.algorithm || 'sha1';
options.encoding = sourceOptions.encoding || 'hex';
options.excludeValues = sourceOptions.excludeValues ? true : false;
options.algorithm = options.algorithm.toLowerCase();
options.encoding = options.encoding.toLowerCase();
options.ignoreUnknown = sourceOptions.ignoreUnknown !== true ? false : true; // default to false
options.respectType = sourceOptions.respectType === false ? false : true; // default to true
options.respectFunctionNames = sourceOptions.respectFunctionNames === false ? false : true;
options.respectFunctionProperties = sourceOptions.respectFunctionProperties === false ? false : true;
options.unorderedArrays = sourceOptions.unorderedArrays !== true ? false : true; // default to false
options.unorderedSets = sourceOptions.unorderedSets === false ? false : true; // default to false
options.unorderedObjects = sourceOptions.unorderedObjects === false ? false : true; // default to true
options.replacer = sourceOptions.replacer || undefined;
options.excludeKeys = sourceOptions.excludeKeys || undefined;
if (typeof object === 'undefined') {
throw new Error('Object argument required.');
}
// if there is a case-insensitive match in the hashes list, accept it
// (i.e. SHA256 for sha256)
for(var i = 0; i < hashes.length; ++i){
if (hashes[i].toLowerCase() === options.algorithm.toLowerCase()) {
options.algorithm = hashes[i];
}
}
if (hashes.indexOf(options.algorithm) === -1) {
throw new Error('Algorithm "' + options.algorithm + '" not supported. ' + 'supported values: ' + hashes.join(', '));
}
if (encodings.indexOf(options.encoding) === -1 && options.algorithm !== 'passthrough') {
throw new Error('Encoding "' + options.encoding + '" not supported. ' + 'supported values: ' + encodings.join(', '));
}
return options;
}
/** Check if the given function is a native function */ function isNativeFunction(f) {
if (typeof f !== 'function') {
return false;
}
var exp = /^function\s+\w*\s*\(\s*\)\s*{\s+\[native code\]\s+}$/i;
return exp.exec(Function.prototype.toString.call(f)) != null;
}
function hash(object, options) {
var hashingStream;
if (options.algorithm !== 'passthrough') {
hashingStream = crypto.createHash(options.algorithm);
} else {
hashingStream = new PassThrough();
}
if (typeof hashingStream.write === 'undefined') {
hashingStream.write = hashingStream.update;
hashingStream.end = hashingStream.update;
}
var hasher = typeHasher(options, hashingStream);
hasher.dispatch(object);
if (!hashingStream.update) {
hashingStream.end('');
}
if (hashingStream.digest) {
return hashingStream.digest(options.encoding === 'buffer' ? undefined : options.encoding);
}
var buf = hashingStream.read();
if (options.encoding === 'buffer') {
return buf;
}
return buf.toString(options.encoding);
}
/**
* Expose streaming API
*
* @param {object} object Value to serialize
* @param {object} options Options, as for hash()
* @param {object} stream A stream to write the serializiation to
* @api public
*/ exports.writeToStream = function(object, options, stream) {
if (typeof stream === 'undefined') {
stream = options;
options = {};
}
options = applyDefaults(object, options);
return typeHasher(options, stream).dispatch(object);
};
function typeHasher(options, writeTo, context) {
context = context || [];
var write = function(str) {
if (writeTo.update) {
return writeTo.update(str, 'utf8');
} else {
return writeTo.write(str, 'utf8');
}
};
return {
dispatch: function(value) {
if (options.replacer) {
value = options.replacer(value);
}
var type = typeof value;
if (value === null) {
type = 'null';
}
//console.log("[DEBUG] Dispatch: ", value, "->", type, " -> ", "_" + type);
return this['_' + type](value);
},
_object: function(object) {
var pattern = /\[object (.*)\]/i;
var objString = Object.prototype.toString.call(object);
var objType = pattern.exec(objString);
if (!objType) {
objType = 'unknown:[' + objString + ']';
} else {
objType = objType[1]; // take only the class name
}
objType = objType.toLowerCase();
var objectNumber = null;
if ((objectNumber = context.indexOf(object)) >= 0) {
return this.dispatch('[CIRCULAR:' + objectNumber + ']');
} else {
context.push(object);
}
if (typeof Buffer !== 'undefined' && Buffer.isBuffer && Buffer.isBuffer(object)) {
write('buffer:');
return write(object);
}
if (objType !== 'object' && objType !== 'function' && objType !== 'asyncfunction') {
if (this['_' + objType]) {
this['_' + objType](object);
} else if (options.ignoreUnknown) {
return write('[' + objType + ']');
} else {
throw new Error('Unknown object type "' + objType + '"');
}
} else {
var keys = Object.keys(object);
if (options.unorderedObjects) {
keys = keys.sort();
}
// Make sure to incorporate special properties, so
// Types with different prototypes will produce
// a different hash and objects derived from
// different functions (`new Foo`, `new Bar`) will
// produce different hashes.
// We never do this for native functions since some
// seem to break because of that.
if (options.respectType !== false && !isNativeFunction(object)) {
keys.splice(0, 0, 'prototype', '__proto__', 'constructor');
}
if (options.excludeKeys) {
keys = keys.filter(function(key) {
return !options.excludeKeys(key);
});
}
write('object:' + keys.length + ':');
var self = this;
return keys.forEach(function(key) {
self.dispatch(key);
write(':');
if (!options.excludeValues) {
self.dispatch(object[key]);
}
write(',');
});
}
},
_array: function(arr, unordered) {
unordered = typeof unordered !== 'undefined' ? unordered : options.unorderedArrays !== false; // default to options.unorderedArrays
var self = this;
write('array:' + arr.length + ':');
if (!unordered || arr.length <= 1) {
return arr.forEach(function(entry) {
return self.dispatch(entry);
});
}
// the unordered case is a little more complicated:
// since there is no canonical ordering on objects,
// i.e. {a:1} < {a:2} and {a:1} > {a:2} are both false,
// we first serialize each entry using a PassThrough stream
// before sorting.
// also: we cant use the same context array for all entries
// since the order of hashing should *not* matter. instead,
// we keep track of the additions to a copy of the context array
// and add all of them to the global context array when were done
var contextAdditions = [];
var entries = arr.map(function(entry) {
var strm = new PassThrough();
var localContext = context.slice(); // make copy
var hasher = typeHasher(options, strm, localContext);
hasher.dispatch(entry);
// take only what was added to localContext and append it to contextAdditions
contextAdditions = contextAdditions.concat(localContext.slice(context.length));
return strm.read().toString();
});
context = context.concat(contextAdditions);
entries.sort();
return this._array(entries, false);
},
_date: function(date) {
return write('date:' + date.toJSON());
},
_symbol: function(sym) {
return write('symbol:' + sym.toString());
},
_error: function(err) {
return write('error:' + err.toString());
},
_boolean: function(bool) {
return write('bool:' + bool.toString());
},
_string: function(string) {
write('string:' + string.length + ':');
write(string.toString());
},
_function: function(fn) {
write('fn:');
if (isNativeFunction(fn)) {
this.dispatch('[native]');
} else {
this.dispatch(fn.toString());
}
if (options.respectFunctionNames !== false) {
// Make sure we can still distinguish native functions
// by their name, otherwise String and Function will
// have the same hash
this.dispatch("function-name:" + String(fn.name));
}
if (options.respectFunctionProperties) {
this._object(fn);
}
},
_number: function(number) {
return write('number:' + number.toString());
},
_xml: function(xml) {
return write('xml:' + xml.toString());
},
_null: function() {
return write('Null');
},
_undefined: function() {
return write('Undefined');
},
_regexp: function(regex) {
return write('regex:' + regex.toString());
},
_uint8array: function(arr) {
write('uint8array:');
return this.dispatch(Array.prototype.slice.call(arr));
},
_uint8clampedarray: function(arr) {
write('uint8clampedarray:');
return this.dispatch(Array.prototype.slice.call(arr));
},
_int8array: function(arr) {
write('uint8array:');
return this.dispatch(Array.prototype.slice.call(arr));
},
_uint16array: function(arr) {
write('uint16array:');
return this.dispatch(Array.prototype.slice.call(arr));
},
_int16array: function(arr) {
write('uint16array:');
return this.dispatch(Array.prototype.slice.call(arr));
},
_uint32array: function(arr) {
write('uint32array:');
return this.dispatch(Array.prototype.slice.call(arr));
},
_int32array: function(arr) {
write('uint32array:');
return this.dispatch(Array.prototype.slice.call(arr));
},
_float32array: function(arr) {
write('float32array:');
return this.dispatch(Array.prototype.slice.call(arr));
},
_float64array: function(arr) {
write('float64array:');
return this.dispatch(Array.prototype.slice.call(arr));
},
_arraybuffer: function(arr) {
write('arraybuffer:');
return this.dispatch(new Uint8Array(arr));
},
_url: function(url) {
return write('url:' + url.toString(), 'utf8');
},
_map: function(map) {
write('map:');
var arr = Array.from(map);
return this._array(arr, options.unorderedSets !== false);
},
_set: function(set) {
write('set:');
var arr = Array.from(set);
return this._array(arr, options.unorderedSets !== false);
},
_file: function(file) {
write('file:');
return this.dispatch([
file.name,
file.size,
file.type,
file.lastModfied
]);
},
_blob: function() {
if (options.ignoreUnknown) {
return write('[blob]');
}
throw Error('Hashing Blob objects is currently not supported\n' + '(see https://github.com/puleos/object-hash/issues/26)\n' + 'Use "options.replacer" or "options.ignoreUnknown"\n');
},
_domwindow: function() {
return write('domwindow');
},
_bigint: function(number) {
return write('bigint:' + number.toString());
},
/* Node.js standard native objects */ _process: function() {
return write('process');
},
_timer: function() {
return write('timer');
},
_pipe: function() {
return write('pipe');
},
_tcp: function() {
return write('tcp');
},
_udp: function() {
return write('udp');
},
_tty: function() {
return write('tty');
},
_statwatcher: function() {
return write('statwatcher');
},
_securecontext: function() {
return write('securecontext');
},
_connection: function() {
return write('connection');
},
_zlib: function() {
return write('zlib');
},
_context: function() {
return write('context');
},
_nodescript: function() {
return write('nodescript');
},
_httpparser: function() {
return write('httpparser');
},
_dataview: function() {
return write('dataview');
},
_signal: function() {
return write('signal');
},
_fsevent: function() {
return write('fsevent');
},
_tlswrap: function() {
return write('tlswrap');
}
};
}
// Mini-implementation of stream.PassThrough
// We are far from having need for the full implementation, and we can
// make assumptions like "many writes, then only one final read"
// and we can ignore encoding specifics
function PassThrough() {
return {
buf: '',
write: function(b) {
this.buf += b;
},
end: function(b) {
this.buf += b;
},
read: function() {
return this.buf;
}
};
}
}),
"[project]/node_modules/oauth/lib/sha1.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => {
/*
* A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined
* in FIPS 180-1
* Version 2.2 Copyright Paul Johnston 2000 - 2009.
* Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
* Distributed under the BSD License
* See http://pajhome.org.uk/crypt/md5 for details.
*/ /*
* Configurable variables. You may need to tweak these to be compatible with
* the server-side, but the defaults work in most cases.
*/ var hexcase = 1; /* hex output format. 0 - lowercase; 1 - uppercase */
var b64pad = "="; /* base-64 pad character. "=" for strict RFC compliance */
/*
* These are the functions you'll usually want to call
* They take string arguments and return either hex or base-64 encoded strings
*/ function hex_sha1(s) {
return rstr2hex(rstr_sha1(str2rstr_utf8(s)));
}
function b64_sha1(s) {
return rstr2b64(rstr_sha1(str2rstr_utf8(s)));
}
function any_sha1(s, e) {
return rstr2any(rstr_sha1(str2rstr_utf8(s)), e);
}
function hex_hmac_sha1(k, d) {
return rstr2hex(rstr_hmac_sha1(str2rstr_utf8(k), str2rstr_utf8(d)));
}
function b64_hmac_sha1(k, d) {
return rstr2b64(rstr_hmac_sha1(str2rstr_utf8(k), str2rstr_utf8(d)));
}
function any_hmac_sha1(k, d, e) {
return rstr2any(rstr_hmac_sha1(str2rstr_utf8(k), str2rstr_utf8(d)), e);
}
/*
* Perform a simple self-test to see if the VM is working
*/ function sha1_vm_test() {
return hex_sha1("abc").toLowerCase() == "a9993e364706816aba3e25717850c26c9cd0d89d";
}
/*
* Calculate the SHA1 of a raw string
*/ function rstr_sha1(s) {
return binb2rstr(binb_sha1(rstr2binb(s), s.length * 8));
}
/*
* Calculate the HMAC-SHA1 of a key and some data (raw strings)
*/ function rstr_hmac_sha1(key, data) {
var bkey = rstr2binb(key);
if (bkey.length > 16) bkey = binb_sha1(bkey, key.length * 8);
var ipad = Array(16), opad = Array(16);
for(var i = 0; i < 16; i++){
ipad[i] = bkey[i] ^ 0x36363636;
opad[i] = bkey[i] ^ 0x5C5C5C5C;
}
var hash = binb_sha1(ipad.concat(rstr2binb(data)), 512 + data.length * 8);
return binb2rstr(binb_sha1(opad.concat(hash), 512 + 160));
}
/*
* Convert a raw string to a hex string
*/ function rstr2hex(input) {
try {
hexcase;
} catch (e) {
hexcase = 0;
}
var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef";
var output = "";
var x;
for(var i = 0; i < input.length; i++){
x = input.charCodeAt(i);
output += hex_tab.charAt(x >>> 4 & 0x0F) + hex_tab.charAt(x & 0x0F);
}
return output;
}
/*
* Convert a raw string to a base-64 string
*/ function rstr2b64(input) {
try {
b64pad;
} catch (e) {
b64pad = '';
}
var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
var output = "";
var len = input.length;
for(var i = 0; i < len; i += 3){
var triplet = input.charCodeAt(i) << 16 | (i + 1 < len ? input.charCodeAt(i + 1) << 8 : 0) | (i + 2 < len ? input.charCodeAt(i + 2) : 0);
for(var j = 0; j < 4; j++){
if (i * 8 + j * 6 > input.length * 8) output += b64pad;
else output += tab.charAt(triplet >>> 6 * (3 - j) & 0x3F);
}
}
return output;
}
/*
* Convert a raw string to an arbitrary string encoding
*/ function rstr2any(input, encoding) {
var divisor = encoding.length;
var remainders = Array();
var i, q, x, quotient;
/* Convert to an array of 16-bit big-endian values, forming the dividend */ var dividend = Array(Math.ceil(input.length / 2));
for(i = 0; i < dividend.length; i++){
dividend[i] = input.charCodeAt(i * 2) << 8 | input.charCodeAt(i * 2 + 1);
}
/*
* Repeatedly perform a long division. The binary array forms the dividend,
* the length of the encoding is the divisor. Once computed, the quotient
* forms the dividend for the next step. We stop when the dividend is zero.
* All remainders are stored for later use.
*/ while(dividend.length > 0){
quotient = Array();
x = 0;
for(i = 0; i < dividend.length; i++){
x = (x << 16) + dividend[i];
q = Math.floor(x / divisor);
x -= q * divisor;
if (quotient.length > 0 || q > 0) quotient[quotient.length] = q;
}
remainders[remainders.length] = x;
dividend = quotient;
}
/* Convert the remainders to the output string */ var output = "";
for(i = remainders.length - 1; i >= 0; i--)output += encoding.charAt(remainders[i]);
/* Append leading zero equivalents */ var full_length = Math.ceil(input.length * 8 / (Math.log(encoding.length) / Math.log(2)));
for(i = output.length; i < full_length; i++)output = encoding[0] + output;
return output;
}
/*
* Encode a string as utf-8.
* For efficiency, this assumes the input is valid utf-16.
*/ function str2rstr_utf8(input) {
var output = "";
var i = -1;
var x, y;
while(++i < input.length){
/* Decode utf-16 surrogate pairs */ x = input.charCodeAt(i);
y = i + 1 < input.length ? input.charCodeAt(i + 1) : 0;
if (0xD800 <= x && x <= 0xDBFF && 0xDC00 <= y && y <= 0xDFFF) {
x = 0x10000 + ((x & 0x03FF) << 10) + (y & 0x03FF);
i++;
}
/* Encode output as utf-8 */ if (x <= 0x7F) output += String.fromCharCode(x);
else if (x <= 0x7FF) output += String.fromCharCode(0xC0 | x >>> 6 & 0x1F, 0x80 | x & 0x3F);
else if (x <= 0xFFFF) output += String.fromCharCode(0xE0 | x >>> 12 & 0x0F, 0x80 | x >>> 6 & 0x3F, 0x80 | x & 0x3F);
else if (x <= 0x1FFFFF) output += String.fromCharCode(0xF0 | x >>> 18 & 0x07, 0x80 | x >>> 12 & 0x3F, 0x80 | x >>> 6 & 0x3F, 0x80 | x & 0x3F);
}
return output;
}
/*
* Encode a string as utf-16
*/ function str2rstr_utf16le(input) {
var output = "";
for(var i = 0; i < input.length; i++)output += String.fromCharCode(input.charCodeAt(i) & 0xFF, input.charCodeAt(i) >>> 8 & 0xFF);
return output;
}
function str2rstr_utf16be(input) {
var output = "";
for(var i = 0; i < input.length; i++)output += String.fromCharCode(input.charCodeAt(i) >>> 8 & 0xFF, input.charCodeAt(i) & 0xFF);
return output;
}
/*
* Convert a raw string to an array of big-endian words
* Characters >255 have their high-byte silently ignored.
*/ function rstr2binb(input) {
var output = Array(input.length >> 2);
for(var i = 0; i < output.length; i++)output[i] = 0;
for(var i = 0; i < input.length * 8; i += 8)output[i >> 5] |= (input.charCodeAt(i / 8) & 0xFF) << 24 - i % 32;
return output;
}
/*
* Convert an array of big-endian words to a string
*/ function binb2rstr(input) {
var output = "";
for(var i = 0; i < input.length * 32; i += 8)output += String.fromCharCode(input[i >> 5] >>> 24 - i % 32 & 0xFF);
return output;
}
/*
* Calculate the SHA-1 of an array of big-endian words, and a bit length
*/ function binb_sha1(x, len) {
/* append padding */ x[len >> 5] |= 0x80 << 24 - len % 32;
x[(len + 64 >> 9 << 4) + 15] = len;
var w = Array(80);
var a = 1732584193;
var b = -271733879;
var c = -1732584194;
var d = 271733878;
var e = -1009589776;
for(var i = 0; i < x.length; i += 16){
var olda = a;
var oldb = b;
var oldc = c;
var oldd = d;
var olde = e;
for(var j = 0; j < 80; j++){
if (j < 16) w[j] = x[i + j];
else w[j] = bit_rol(w[j - 3] ^ w[j - 8] ^ w[j - 14] ^ w[j - 16], 1);
var t = safe_add(safe_add(bit_rol(a, 5), sha1_ft(j, b, c, d)), safe_add(safe_add(e, w[j]), sha1_kt(j)));
e = d;
d = c;
c = bit_rol(b, 30);
b = a;
a = t;
}
a = safe_add(a, olda);
b = safe_add(b, oldb);
c = safe_add(c, oldc);
d = safe_add(d, oldd);
e = safe_add(e, olde);
}
return Array(a, b, c, d, e);
}
/*
* Perform the appropriate triplet combination function for the current
* iteration
*/ function sha1_ft(t, b, c, d) {
if (t < 20) return b & c | ~b & d;
if (t < 40) return b ^ c ^ d;
if (t < 60) return b & c | b & d | c & d;
return b ^ c ^ d;
}
/*
* Determine the appropriate additive constant for the current iteration
*/ function sha1_kt(t) {
return t < 20 ? 1518500249 : t < 40 ? 1859775393 : t < 60 ? -1894007588 : -899497514;
}
/*
* Add integers, wrapping at 2^32. This uses 16-bit operations internally
* to work around bugs in some JS interpreters.
*/ function safe_add(x, y) {
var lsw = (x & 0xFFFF) + (y & 0xFFFF);
var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
return msw << 16 | lsw & 0xFFFF;
}
/*
* Bitwise rotate a 32-bit number to the left.
*/ function bit_rol(num, cnt) {
return num << cnt | num >>> 32 - cnt;
}
exports.HMACSHA1 = function(key, data) {
return b64_hmac_sha1(key, data);
};
}),
"[project]/node_modules/oauth/lib/_utils.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => {
// Returns true if this is a host that closes *before* it ends?!?!
module.exports.isAnEarlyCloseHost = function(hostName) {
return hostName && hostName.match(".*google(apis)?.com$");
};
}),
"[project]/node_modules/oauth/lib/oauth.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => {
var crypto = __turbopack_context__.r("[externals]/crypto [external] (crypto, cjs)"), sha1 = __turbopack_context__.r("[project]/node_modules/oauth/lib/sha1.js [app-route] (ecmascript)"), http = __turbopack_context__.r("[externals]/http [external] (http, cjs)"), https = __turbopack_context__.r("[externals]/https [external] (https, cjs)"), URL = __turbopack_context__.r("[externals]/url [external] (url, cjs)"), querystring = __turbopack_context__.r("[externals]/querystring [external] (querystring, cjs)"), OAuthUtils = __turbopack_context__.r("[project]/node_modules/oauth/lib/_utils.js [app-route] (ecmascript)");
exports.OAuth = function(requestUrl, accessUrl, consumerKey, consumerSecret, version, authorize_callback, signatureMethod, nonceSize, customHeaders) {
this._isEcho = false;
this._requestUrl = requestUrl;
this._accessUrl = accessUrl;
this._consumerKey = consumerKey;
this._consumerSecret = this._encodeData(consumerSecret);
if (signatureMethod == "RSA-SHA1") {
this._privateKey = consumerSecret;
}
this._version = version;
if (authorize_callback === undefined) {
this._authorize_callback = "oob";
} else {
this._authorize_callback = authorize_callback;
}
if (signatureMethod != "PLAINTEXT" && signatureMethod != "HMAC-SHA1" && signatureMethod != "RSA-SHA1") throw new Error("Un-supported signature method: " + signatureMethod);
this._signatureMethod = signatureMethod;
this._nonceSize = nonceSize || 32;
this._headers = customHeaders || {
"Accept": "*/*",
"Connection": "close",
"User-Agent": "Node authentication"
};
this._clientOptions = this._defaultClientOptions = {
"requestTokenHttpMethod": "POST",
"accessTokenHttpMethod": "POST",
"followRedirects": true
};
this._oauthParameterSeperator = ",";
};
exports.OAuthEcho = function(realm, verify_credentials, consumerKey, consumerSecret, version, signatureMethod, nonceSize, customHeaders) {
this._isEcho = true;
this._realm = realm;
this._verifyCredentials = verify_credentials;
this._consumerKey = consumerKey;
this._consumerSecret = this._encodeData(consumerSecret);
if (signatureMethod == "RSA-SHA1") {
this._privateKey = consumerSecret;
}
this._version = version;
if (signatureMethod != "PLAINTEXT" && signatureMethod != "HMAC-SHA1" && signatureMethod != "RSA-SHA1") throw new Error("Un-supported signature method: " + signatureMethod);
this._signatureMethod = signatureMethod;
this._nonceSize = nonceSize || 32;
this._headers = customHeaders || {
"Accept": "*/*",
"Connection": "close",
"User-Agent": "Node authentication"
};
this._oauthParameterSeperator = ",";
};
exports.OAuthEcho.prototype = exports.OAuth.prototype;
exports.OAuth.prototype._getTimestamp = function() {
return Math.floor(new Date().getTime() / 1000);
};
exports.OAuth.prototype._encodeData = function(toEncode) {
if (toEncode == null || toEncode == "") return "";
else {
var result = encodeURIComponent(toEncode);
// Fix the mismatch between OAuth's RFC3986's and Javascript's beliefs in what is right and wrong ;)
return result.replace(/\!/g, "%21").replace(/\'/g, "%27").replace(/\(/g, "%28").replace(/\)/g, "%29").replace(/\*/g, "%2A");
}
};
exports.OAuth.prototype._decodeData = function(toDecode) {
if (toDecode != null) {
toDecode = toDecode.replace(/\+/g, " ");
}
return decodeURIComponent(toDecode);
};
exports.OAuth.prototype._getSignature = function(method, url, parameters, tokenSecret) {
var signatureBase = this._createSignatureBase(method, url, parameters);
return this._createSignature(signatureBase, tokenSecret);
};
exports.OAuth.prototype._normalizeUrl = function(url) {
var parsedUrl = URL.parse(url, true);
var port = "";
if (parsedUrl.port) {
if (parsedUrl.protocol == "http:" && parsedUrl.port != "80" || parsedUrl.protocol == "https:" && parsedUrl.port != "443") {
port = ":" + parsedUrl.port;
}
}
if (!parsedUrl.pathname || parsedUrl.pathname == "") parsedUrl.pathname = "/";
return parsedUrl.protocol + "//" + parsedUrl.hostname + port + parsedUrl.pathname;
};
// Is the parameter considered an OAuth parameter
exports.OAuth.prototype._isParameterNameAnOAuthParameter = function(parameter) {
var m = parameter.match('^oauth_');
if (m && m[0] === "oauth_") {
return true;
} else {
return false;
}
};
// build the OAuth request authorization header
exports.OAuth.prototype._buildAuthorizationHeaders = function(orderedParameters) {
var authHeader = "OAuth ";
if (this._isEcho) {
authHeader += 'realm="' + this._realm + '",';
}
for(var i = 0; i < orderedParameters.length; i++){
// Whilst the all the parameters should be included within the signature, only the oauth_ arguments
// should appear within the authorization header.
if (this._isParameterNameAnOAuthParameter(orderedParameters[i][0])) {
authHeader += "" + this._encodeData(orderedParameters[i][0]) + "=\"" + this._encodeData(orderedParameters[i][1]) + "\"" + this._oauthParameterSeperator;
}
}
authHeader = authHeader.substring(0, authHeader.length - this._oauthParameterSeperator.length);
return authHeader;
};
// Takes an object literal that represents the arguments, and returns an array
// of argument/value pairs.
exports.OAuth.prototype._makeArrayOfArgumentsHash = function(argumentsHash) {
var argument_pairs = [];
for(var key in argumentsHash){
if (argumentsHash.hasOwnProperty(key)) {
var value = argumentsHash[key];
if (Array.isArray(value)) {
for(var i = 0; i < value.length; i++){
argument_pairs[argument_pairs.length] = [
key,
value[i]
];
}
} else {
argument_pairs[argument_pairs.length] = [
key,
value
];
}
}
}
return argument_pairs;
};
// Sorts the encoded key value pairs by encoded name, then encoded value
exports.OAuth.prototype._sortRequestParams = function(argument_pairs) {
// Sort by name, then value.
argument_pairs.sort(function(a, b) {
if (a[0] == b[0]) {
return a[1] < b[1] ? -1 : 1;
} else return a[0] < b[0] ? -1 : 1;
});
return argument_pairs;
};
exports.OAuth.prototype._normaliseRequestParams = function(args) {
var argument_pairs = this._makeArrayOfArgumentsHash(args);
// First encode them #3.4.1.3.2 .1
for(var i = 0; i < argument_pairs.length; i++){
argument_pairs[i][0] = this._encodeData(argument_pairs[i][0]);
argument_pairs[i][1] = this._encodeData(argument_pairs[i][1]);
}
// Then sort them #3.4.1.3.2 .2
argument_pairs = this._sortRequestParams(argument_pairs);
// Then concatenate together #3.4.1.3.2 .3 & .4
var args = "";
for(var i = 0; i < argument_pairs.length; i++){
args += argument_pairs[i][0];
args += "=";
args += argument_pairs[i][1];
if (i < argument_pairs.length - 1) args += "&";
}
return args;
};
exports.OAuth.prototype._createSignatureBase = function(method, url, parameters) {
url = this._encodeData(this._normalizeUrl(url));
parameters = this._encodeData(parameters);
return method.toUpperCase() + "&" + url + "&" + parameters;
};
exports.OAuth.prototype._createSignature = function(signatureBase, tokenSecret) {
if (tokenSecret === undefined) var tokenSecret = "";
else tokenSecret = this._encodeData(tokenSecret);
// consumerSecret is already encoded
var key = this._consumerSecret + "&" + tokenSecret;
var hash = "";
if (this._signatureMethod == "PLAINTEXT") {
hash = key;
} else if (this._signatureMethod == "RSA-SHA1") {
key = this._privateKey || "";
hash = crypto.createSign("RSA-SHA1").update(signatureBase).sign(key, 'base64');
} else {
if (crypto.Hmac) {
hash = crypto.createHmac("sha1", key).update(signatureBase).digest("base64");
} else {
hash = sha1.HMACSHA1(key, signatureBase);
}
}
return hash;
};
exports.OAuth.prototype.NONCE_CHARS = [
'a',
'b',
'c',
'd',
'e',
'f',
'g',
'h',
'i',
'j',
'k',
'l',
'm',
'n',
'o',
'p',
'q',
'r',
's',
't',
'u',
'v',
'w',
'x',
'y',
'z',
'A',
'B',
'C',
'D',
'E',
'F',
'G',
'H',
'I',
'J',
'K',
'L',
'M',
'N',
'O',
'P',
'Q',
'R',
'S',
'T',
'U',
'V',
'W',
'X',
'Y',
'Z',
'0',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9'
];
exports.OAuth.prototype._getNonce = function(nonceSize) {
var result = [];
var chars = this.NONCE_CHARS;
var char_pos;
var nonce_chars_length = chars.length;
for(var i = 0; i < nonceSize; i++){
char_pos = Math.floor(Math.random() * nonce_chars_length);
result[i] = chars[char_pos];
}
return result.join('');
};
exports.OAuth.prototype._createClient = function(port, hostname, method, path, headers, sslEnabled) {
var options = {
host: hostname,
port: port,
path: path,
method: method,
headers: headers
};
var httpModel;
if (sslEnabled) {
httpModel = https;
} else {
httpModel = http;
}
return httpModel.request(options);
};
exports.OAuth.prototype._prepareParameters = function(oauth_token, oauth_token_secret, method, url, extra_params) {
var oauthParameters = {
"oauth_timestamp": this._getTimestamp(),
"oauth_nonce": this._getNonce(this._nonceSize),
"oauth_version": this._version,
"oauth_signature_method": this._signatureMethod,
"oauth_consumer_key": this._consumerKey
};
if (oauth_token) {
oauthParameters["oauth_token"] = oauth_token;
}
var sig;
if (this._isEcho) {
sig = this._getSignature("GET", this._verifyCredentials, this._normaliseRequestParams(oauthParameters), oauth_token_secret);
} else {
if (extra_params) {
for(var key in extra_params){
if (extra_params.hasOwnProperty(key)) oauthParameters[key] = extra_params[key];
}
}
var parsedUrl = URL.parse(url, false);
if (parsedUrl.query) {
var key2;
var extraParameters = querystring.parse(parsedUrl.query);
for(var key in extraParameters){
var value = extraParameters[key];
if (typeof value == "object") {
// TODO: This probably should be recursive
for(key2 in value){
oauthParameters[key + "[" + key2 + "]"] = value[key2];
}
} else {
oauthParameters[key] = value;
}
}
}
sig = this._getSignature(method, url, this._normaliseRequestParams(oauthParameters), oauth_token_secret);
}
var orderedParameters = this._sortRequestParams(this._makeArrayOfArgumentsHash(oauthParameters));
orderedParameters[orderedParameters.length] = [
"oauth_signature",
sig
];
return orderedParameters;
};
exports.OAuth.prototype._performSecureRequest = function(oauth_token, oauth_token_secret, method, url, extra_params, post_body, post_content_type, callback) {
var orderedParameters = this._prepareParameters(oauth_token, oauth_token_secret, method, url, extra_params);
if (!post_content_type) {
post_content_type = "application/x-www-form-urlencoded";
}
var parsedUrl = URL.parse(url, false);
if (parsedUrl.protocol == "http:" && !parsedUrl.port) parsedUrl.port = 80;
if (parsedUrl.protocol == "https:" && !parsedUrl.port) parsedUrl.port = 443;
var headers = {};
var authorization = this._buildAuthorizationHeaders(orderedParameters);
if (this._isEcho) {
headers["X-Verify-Credentials-Authorization"] = authorization;
} else {
headers["Authorization"] = authorization;
}
headers["Host"] = parsedUrl.host;
for(var key in this._headers){
if (this._headers.hasOwnProperty(key)) {
headers[key] = this._headers[key];
}
}
// Filter out any passed extra_params that are really to do with OAuth
for(var key in extra_params){
if (this._isParameterNameAnOAuthParameter(key)) {
delete extra_params[key];
}
}
if ((method == "POST" || method == "PUT") && post_body == null && extra_params != null) {
// Fix the mismatch between the output of querystring.stringify() and this._encodeData()
post_body = querystring.stringify(extra_params).replace(/\!/g, "%21").replace(/\'/g, "%27").replace(/\(/g, "%28").replace(/\)/g, "%29").replace(/\*/g, "%2A");
}
if (post_body) {
if (Buffer.isBuffer(post_body)) {
headers["Content-length"] = post_body.length;
} else {
headers["Content-length"] = Buffer.byteLength(post_body);
}
} else {
headers["Content-length"] = 0;
}
headers["Content-Type"] = post_content_type;
var path;
if (!parsedUrl.pathname || parsedUrl.pathname == "") parsedUrl.pathname = "/";
if (parsedUrl.query) path = parsedUrl.pathname + "?" + parsedUrl.query;
else path = parsedUrl.pathname;
var request;
if (parsedUrl.protocol == "https:") {
request = this._createClient(parsedUrl.port, parsedUrl.hostname, method, path, headers, true);
} else {
request = this._createClient(parsedUrl.port, parsedUrl.hostname, method, path, headers);
}
var clientOptions = this._clientOptions;
if (callback) {
var data = "";
var self = this;
// Some hosts *cough* google appear to close the connection early / send no content-length header
// allow this behaviour.
var allowEarlyClose = OAuthUtils.isAnEarlyCloseHost(parsedUrl.hostname);
var callbackCalled = false;
var passBackControl = function(response) {
if (!callbackCalled) {
callbackCalled = true;
if (response.statusCode >= 200 && response.statusCode <= 299) {
callback(null, data, response);
} else {
// Follow 301 or 302 redirects with Location HTTP header
if ((response.statusCode == 301 || response.statusCode == 302) && clientOptions.followRedirects && response.headers && response.headers.location) {
self._performSecureRequest(oauth_token, oauth_token_secret, method, response.headers.location, extra_params, post_body, post_content_type, callback);
} else {
callback({
statusCode: response.statusCode,
data: data
}, data, response);
}
}
}
};
request.on('response', function(response) {
response.setEncoding('utf8');
response.on('data', function(chunk) {
data += chunk;
});
response.on('end', function() {
passBackControl(response);
});
response.on('close', function() {
if (allowEarlyClose) {
passBackControl(response);
}
});
});
request.on("error", function(err) {
if (!callbackCalled) {
callbackCalled = true;
callback(err);
}
});
if ((method == "POST" || method == "PUT") && post_body != null && post_body != "") {
request.write(post_body);
}
request.end();
} else {
if ((method == "POST" || method == "PUT") && post_body != null && post_body != "") {
request.write(post_body);
}
return request;
}
return;
};
exports.OAuth.prototype.setClientOptions = function(options) {
var key, mergedOptions = {}, hasOwnProperty = Object.prototype.hasOwnProperty;
for(key in this._defaultClientOptions){
if (!hasOwnProperty.call(options, key)) {
mergedOptions[key] = this._defaultClientOptions[key];
} else {
mergedOptions[key] = options[key];
}
}
this._clientOptions = mergedOptions;
};
exports.OAuth.prototype.getOAuthAccessToken = function(oauth_token, oauth_token_secret, oauth_verifier, callback) {
var extraParams = {};
if (typeof oauth_verifier == "function") {
callback = oauth_verifier;
} else {
extraParams.oauth_verifier = oauth_verifier;
}
this._performSecureRequest(oauth_token, oauth_token_secret, this._clientOptions.accessTokenHttpMethod, this._accessUrl, extraParams, null, null, function(error, data, response) {
if (error) callback(error);
else {
var results = querystring.parse(data);
var oauth_access_token = results["oauth_token"];
delete results["oauth_token"];
var oauth_access_token_secret = results["oauth_token_secret"];
delete results["oauth_token_secret"];
callback(null, oauth_access_token, oauth_access_token_secret, results);
}
});
};
// Deprecated
exports.OAuth.prototype.getProtectedResource = function(url, method, oauth_token, oauth_token_secret, callback) {
this._performSecureRequest(oauth_token, oauth_token_secret, method, url, null, "", null, callback);
};
exports.OAuth.prototype.delete = function(url, oauth_token, oauth_token_secret, callback) {
return this._performSecureRequest(oauth_token, oauth_token_secret, "DELETE", url, null, "", null, callback);
};
exports.OAuth.prototype.get = function(url, oauth_token, oauth_token_secret, callback) {
return this._performSecureRequest(oauth_token, oauth_token_secret, "GET", url, null, "", null, callback);
};
exports.OAuth.prototype._putOrPost = function(method, url, oauth_token, oauth_token_secret, post_body, post_content_type, callback) {
var extra_params = null;
if (typeof post_content_type == "function") {
callback = post_content_type;
post_content_type = null;
}
if (typeof post_body != "string" && !Buffer.isBuffer(post_body)) {
post_content_type = "application/x-www-form-urlencoded";
extra_params = post_body;
post_body = null;
}
return this._performSecureRequest(oauth_token, oauth_token_secret, method, url, extra_params, post_body, post_content_type, callback);
};
exports.OAuth.prototype.put = function(url, oauth_token, oauth_token_secret, post_body, post_content_type, callback) {
return this._putOrPost("PUT", url, oauth_token, oauth_token_secret, post_body, post_content_type, callback);
};
exports.OAuth.prototype.post = function(url, oauth_token, oauth_token_secret, post_body, post_content_type, callback) {
return this._putOrPost("POST", url, oauth_token, oauth_token_secret, post_body, post_content_type, callback);
};
/**
* Gets a request token from the OAuth provider and passes that information back
* to the calling code.
*
* The callback should expect a function of the following form:
*
* function(err, token, token_secret, parsedQueryString) {}
*
* This method has optional parameters so can be called in the following 2 ways:
*
* 1) Primary use case: Does a basic request with no extra parameters
* getOAuthRequestToken( callbackFunction )
*
* 2) As above but allows for provision of extra parameters to be sent as part of the query to the server.
* getOAuthRequestToken( extraParams, callbackFunction )
*
* N.B. This method will HTTP POST verbs by default, if you wish to override this behaviour you will
* need to provide a requestTokenHttpMethod option when creating the client.
*
**/ exports.OAuth.prototype.getOAuthRequestToken = function(extraParams, callback) {
if (typeof extraParams == "function") {
callback = extraParams;
extraParams = {};
}
// Callbacks are 1.0A related
if (this._authorize_callback) {
extraParams["oauth_callback"] = this._authorize_callback;
}
this._performSecureRequest(null, null, this._clientOptions.requestTokenHttpMethod, this._requestUrl, extraParams, null, null, function(error, data, response) {
if (error) callback(error);
else {
var results = querystring.parse(data);
var oauth_token = results["oauth_token"];
var oauth_token_secret = results["oauth_token_secret"];
delete results["oauth_token"];
delete results["oauth_token_secret"];
callback(null, oauth_token, oauth_token_secret, results);
}
});
};
exports.OAuth.prototype.signUrl = function(url, oauth_token, oauth_token_secret, method) {
if (method === undefined) {
var method = "GET";
}
var orderedParameters = this._prepareParameters(oauth_token, oauth_token_secret, method, url, {});
var parsedUrl = URL.parse(url, false);
var query = "";
for(var i = 0; i < orderedParameters.length; i++){
query += orderedParameters[i][0] + "=" + this._encodeData(orderedParameters[i][1]) + "&";
}
query = query.substring(0, query.length - 1);
return parsedUrl.protocol + "//" + parsedUrl.host + parsedUrl.pathname + "?" + query;
};
exports.OAuth.prototype.authHeader = function(url, oauth_token, oauth_token_secret, method) {
if (method === undefined) {
var method = "GET";
}
var orderedParameters = this._prepareParameters(oauth_token, oauth_token_secret, method, url, {});
return this._buildAuthorizationHeaders(orderedParameters);
};
}),
"[project]/node_modules/oauth/lib/oauth2.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => {
var querystring = __turbopack_context__.r("[externals]/querystring [external] (querystring, cjs)"), crypto = __turbopack_context__.r("[externals]/crypto [external] (crypto, cjs)"), https = __turbopack_context__.r("[externals]/https [external] (https, cjs)"), http = __turbopack_context__.r("[externals]/http [external] (http, cjs)"), URL = __turbopack_context__.r("[externals]/url [external] (url, cjs)"), OAuthUtils = __turbopack_context__.r("[project]/node_modules/oauth/lib/_utils.js [app-route] (ecmascript)");
exports.OAuth2 = function(clientId, clientSecret, baseSite, authorizePath, accessTokenPath, customHeaders) {
this._clientId = clientId;
this._clientSecret = clientSecret;
this._baseSite = baseSite;
this._authorizeUrl = authorizePath || "/oauth/authorize";
this._accessTokenUrl = accessTokenPath || "/oauth/access_token";
this._accessTokenName = "access_token";
this._authMethod = "Bearer";
this._customHeaders = customHeaders || {};
this._useAuthorizationHeaderForGET = false;
//our agent
this._agent = undefined;
};
// Allows you to set an agent to use instead of the default HTTP or
// HTTPS agents. Useful when dealing with your own certificates.
exports.OAuth2.prototype.setAgent = function(agent) {
this._agent = agent;
};
// This 'hack' method is required for sites that don't use
// 'access_token' as the name of the access token (for requests).
// ( http://tools.ietf.org/html/draft-ietf-oauth-v2-16#section-7 )
// it isn't clear what the correct value should be atm, so allowing
// for specific (temporary?) override for now.
exports.OAuth2.prototype.setAccessTokenName = function(name) {
this._accessTokenName = name;
};
// Sets the authorization method for Authorization header.
// e.g. Authorization: Bearer <token> # "Bearer" is the authorization method.
exports.OAuth2.prototype.setAuthMethod = function(authMethod) {
this._authMethod = authMethod;
};
// If you use the OAuth2 exposed 'get' method (and don't construct your own _request call )
// this will specify whether to use an 'Authorize' header instead of passing the access_token as a query parameter
exports.OAuth2.prototype.useAuthorizationHeaderforGET = function(useIt) {
this._useAuthorizationHeaderForGET = useIt;
};
exports.OAuth2.prototype._getAccessTokenUrl = function() {
return this._baseSite + this._accessTokenUrl; /* + "?" + querystring.stringify(params); */
};
// Build the authorization header. In particular, build the part after the colon.
// e.g. Authorization: Bearer <token> # Build "Bearer <token>"
exports.OAuth2.prototype.buildAuthHeader = function(token) {
return this._authMethod + ' ' + token;
};
exports.OAuth2.prototype._chooseHttpLibrary = function(parsedUrl) {
var http_library = https;
// As this is OAUth2, we *assume* https unless told explicitly otherwise.
if (parsedUrl.protocol != "https:") {
http_library = http;
}
return http_library;
};
exports.OAuth2.prototype._request = function(method, url, headers, post_body, access_token, callback) {
var parsedUrl = URL.parse(url, true);
if (parsedUrl.protocol == "https:" && !parsedUrl.port) {
parsedUrl.port = 443;
}
var http_library = this._chooseHttpLibrary(parsedUrl);
var realHeaders = {};
for(var key in this._customHeaders){
realHeaders[key] = this._customHeaders[key];
}
if (headers) {
for(var key in headers){
realHeaders[key] = headers[key];
}
}
realHeaders['Host'] = parsedUrl.host;
if (!realHeaders['User-Agent']) {
realHeaders['User-Agent'] = 'Node-oauth';
}
if (post_body) {
if (Buffer.isBuffer(post_body)) {
realHeaders["Content-Length"] = post_body.length;
} else {
realHeaders["Content-Length"] = Buffer.byteLength(post_body);
}
} else {
realHeaders["Content-length"] = 0;
}
if (access_token && !('Authorization' in realHeaders)) {
if (!parsedUrl.query) parsedUrl.query = {};
parsedUrl.query[this._accessTokenName] = access_token;
}
var queryStr = querystring.stringify(parsedUrl.query);
if (queryStr) queryStr = "?" + queryStr;
var options = {
host: parsedUrl.hostname,
port: parsedUrl.port,
path: parsedUrl.pathname + queryStr,
method: method,
headers: realHeaders
};
this._executeRequest(http_library, options, post_body, callback);
};
exports.OAuth2.prototype._executeRequest = function(http_library, options, post_body, callback) {
// Some hosts *cough* google appear to close the connection early / send no content-length header
// allow this behaviour.
var allowEarlyClose = OAuthUtils.isAnEarlyCloseHost(options.host);
var callbackCalled = false;
function passBackControl(response, result) {
if (!callbackCalled) {
callbackCalled = true;
if (!(response.statusCode >= 200 && response.statusCode <= 299) && response.statusCode != 301 && response.statusCode != 302) {
callback({
statusCode: response.statusCode,
data: result
});
} else {
callback(null, result, response);
}
}
}
var result = "";
//set the agent on the request options
if (this._agent) {
options.agent = this._agent;
}
var request = http_library.request(options);
request.on('response', function(response) {
response.on("data", function(chunk) {
result += chunk;
});
response.on("close", function(err) {
if (allowEarlyClose) {
passBackControl(response, result);
}
});
response.addListener("end", function() {
passBackControl(response, result);
});
});
request.on('error', function(e) {
callbackCalled = true;
callback(e);
});
if ((options.method == 'POST' || options.method == 'PUT') && post_body) {
request.write(post_body);
}
request.end();
};
exports.OAuth2.prototype.getAuthorizeUrl = function(params) {
var params = params || {};
params['client_id'] = this._clientId;
return this._baseSite + this._authorizeUrl + "?" + querystring.stringify(params);
};
exports.OAuth2.prototype.getOAuthAccessToken = function(code, params, callback) {
var params = params || {};
params['client_id'] = this._clientId;
params['client_secret'] = this._clientSecret;
var codeParam = params.grant_type === 'refresh_token' ? 'refresh_token' : 'code';
params[codeParam] = code;
var post_data = querystring.stringify(params);
var post_headers = {
'Content-Type': 'application/x-www-form-urlencoded'
};
this._request("POST", this._getAccessTokenUrl(), post_headers, post_data, null, function(error, data, response) {
if (error) callback(error);
else {
var results;
try {
// As of http://tools.ietf.org/html/draft-ietf-oauth-v2-07
// responses should be in JSON
results = JSON.parse(data);
} catch (e) {
// .... However both Facebook + Github currently use rev05 of the spec
// and neither seem to specify a content-type correctly in their response headers :(
// clients of these services will suffer a *minor* performance cost of the exception
// being thrown
results = querystring.parse(data);
}
var access_token = results["access_token"];
var refresh_token = results["refresh_token"];
delete results["refresh_token"];
callback(null, access_token, refresh_token, results); // callback results =-=
}
});
};
// Deprecated
exports.OAuth2.prototype.getProtectedResource = function(url, access_token, callback) {
this._request("GET", url, {}, "", access_token, callback);
};
exports.OAuth2.prototype.get = function(url, access_token, callback) {
if (this._useAuthorizationHeaderForGET) {
var headers = {
'Authorization': this.buildAuthHeader(access_token)
};
access_token = null;
} else {
headers = {};
}
this._request("GET", url, headers, "", access_token, callback);
};
}),
"[project]/node_modules/oauth/index.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => {
exports.OAuth = __turbopack_context__.r("[project]/node_modules/oauth/lib/oauth.js [app-route] (ecmascript)").OAuth;
exports.OAuthEcho = __turbopack_context__.r("[project]/node_modules/oauth/lib/oauth.js [app-route] (ecmascript)").OAuthEcho;
exports.OAuth2 = __turbopack_context__.r("[project]/node_modules/oauth/lib/oauth2.js [app-route] (ecmascript)").OAuth2;
}),
"[project]/node_modules/@panva/hkdf/dist/node/cjs/runtime/fallback.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
const crypto_1 = __turbopack_context__.r("[externals]/crypto [external] (crypto, cjs)");
exports.default = (digest, ikm, salt, info, keylen)=>{
const hashlen = parseInt(digest.substr(3), 10) >> 3 || 20;
const prk = (0, crypto_1.createHmac)(digest, salt.byteLength ? salt : new Uint8Array(hashlen)).update(ikm).digest();
const N = Math.ceil(keylen / hashlen);
const T = new Uint8Array(hashlen * N + info.byteLength + 1);
let prev = 0;
let start = 0;
for(let c = 1; c <= N; c++){
T.set(info, start);
T[start + info.byteLength] = c;
T.set((0, crypto_1.createHmac)(digest, prk).update(T.subarray(prev, start + info.byteLength + 1)).digest(), start);
prev = start;
start += hashlen;
}
return T.slice(0, keylen);
};
}),
"[project]/node_modules/@panva/hkdf/dist/node/cjs/runtime/hkdf.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
const crypto = __turbopack_context__.r("[externals]/crypto [external] (crypto, cjs)");
const fallback_js_1 = __turbopack_context__.r("[project]/node_modules/@panva/hkdf/dist/node/cjs/runtime/fallback.js [app-route] (ecmascript)");
let hkdf;
if (typeof crypto.hkdf === 'function' && !process.versions.electron) {
hkdf = async (...args)=>new Promise((resolve, reject)=>{
crypto.hkdf(...args, (err, arrayBuffer)=>{
if (err) reject(err);
else resolve(new Uint8Array(arrayBuffer));
});
});
}
exports.default = async (digest, ikm, salt, info, keylen)=>(hkdf || fallback_js_1.default)(digest, ikm, salt, info, keylen);
}),
"[project]/node_modules/@panva/hkdf/dist/node/cjs/index.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = exports.hkdf = void 0;
const hkdf_js_1 = __turbopack_context__.r("[project]/node_modules/@panva/hkdf/dist/node/cjs/runtime/hkdf.js [app-route] (ecmascript)");
function normalizeDigest(digest) {
switch(digest){
case 'sha256':
case 'sha384':
case 'sha512':
case 'sha1':
return digest;
default:
throw new TypeError('unsupported "digest" value');
}
}
function normalizeUint8Array(input, label) {
if (typeof input === 'string') return new TextEncoder().encode(input);
if (!(input instanceof Uint8Array)) throw new TypeError(`"${label}"" must be an instance of Uint8Array or a string`);
return input;
}
function normalizeIkm(input) {
const ikm = normalizeUint8Array(input, 'ikm');
if (!ikm.byteLength) throw new TypeError(`"ikm" must be at least one byte in length`);
return ikm;
}
function normalizeInfo(input) {
const info = normalizeUint8Array(input, 'info');
if (info.byteLength > 1024) {
throw TypeError('"info" must not contain more than 1024 bytes');
}
return info;
}
function normalizeKeylen(input, digest) {
if (typeof input !== 'number' || !Number.isInteger(input) || input < 1) {
throw new TypeError('"keylen" must be a positive integer');
}
const hashlen = parseInt(digest.substr(3), 10) >> 3 || 20;
if (input > 255 * hashlen) {
throw new TypeError('"keylen" too large');
}
return input;
}
async function hkdf(digest, ikm, salt, info, keylen) {
return (0, hkdf_js_1.default)(normalizeDigest(digest), normalizeIkm(ikm), normalizeUint8Array(salt, 'salt'), normalizeInfo(info), normalizeKeylen(keylen, digest));
}
exports.hkdf = hkdf;
exports.default = hkdf;
}),
"[project]/node_modules/uuid/dist/esm-node/index.js [app-route] (ecmascript) <locals>", ((__turbopack_context__) => {
"use strict";
__turbopack_context__.s([]);
;
;
;
;
;
;
;
;
;
}),
"[project]/node_modules/uuid/dist/esm-node/rng.js [app-route] (ecmascript)", ((__turbopack_context__) => {
"use strict";
__turbopack_context__.s([
"default",
()=>rng
]);
var __TURBOPACK__imported__module__$5b$externals$5d2f$crypto__$5b$external$5d$__$28$crypto$2c$__cjs$29$__ = __turbopack_context__.i("[externals]/crypto [external] (crypto, cjs)");
;
const rnds8Pool = new Uint8Array(256); // # of random values to pre-allocate
let poolPtr = rnds8Pool.length;
function rng() {
if (poolPtr > rnds8Pool.length - 16) {
__TURBOPACK__imported__module__$5b$externals$5d2f$crypto__$5b$external$5d$__$28$crypto$2c$__cjs$29$__["default"].randomFillSync(rnds8Pool);
poolPtr = 0;
}
return rnds8Pool.slice(poolPtr, poolPtr += 16);
}
}),
"[project]/node_modules/uuid/dist/esm-node/regex.js [app-route] (ecmascript)", ((__turbopack_context__) => {
"use strict";
__turbopack_context__.s([
"default",
()=>__TURBOPACK__default__export__
]);
const __TURBOPACK__default__export__ = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
}),
"[project]/node_modules/uuid/dist/esm-node/validate.js [app-route] (ecmascript)", ((__turbopack_context__) => {
"use strict";
__turbopack_context__.s([
"default",
()=>__TURBOPACK__default__export__
]);
var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$uuid$2f$dist$2f$esm$2d$node$2f$regex$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/uuid/dist/esm-node/regex.js [app-route] (ecmascript)");
;
function validate(uuid) {
return typeof uuid === 'string' && __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$uuid$2f$dist$2f$esm$2d$node$2f$regex$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["default"].test(uuid);
}
const __TURBOPACK__default__export__ = validate;
}),
"[project]/node_modules/uuid/dist/esm-node/stringify.js [app-route] (ecmascript)", ((__turbopack_context__) => {
"use strict";
__turbopack_context__.s([
"default",
()=>__TURBOPACK__default__export__
]);
var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$uuid$2f$dist$2f$esm$2d$node$2f$validate$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/uuid/dist/esm-node/validate.js [app-route] (ecmascript)");
;
/**
* Convert array of 16 byte values to UUID string format of the form:
* XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
*/ const byteToHex = [];
for(let i = 0; i < 256; ++i){
byteToHex.push((i + 0x100).toString(16).substr(1));
}
function stringify(arr, offset = 0) {
// Note: Be careful editing this code! It's been tuned for performance
// and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
const uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one
// of the following:
// - One or more input array values don't map to a hex octet (leading to
// "undefined" in the uuid)
// - Invalid input values for the RFC `version` or `variant` fields
if (!(0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$uuid$2f$dist$2f$esm$2d$node$2f$validate$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["default"])(uuid)) {
throw TypeError('Stringified UUID is invalid');
}
return uuid;
}
const __TURBOPACK__default__export__ = stringify;
}),
"[project]/node_modules/uuid/dist/esm-node/v1.js [app-route] (ecmascript)", ((__turbopack_context__) => {
"use strict";
__turbopack_context__.s([
"default",
()=>__TURBOPACK__default__export__
]);
var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$uuid$2f$dist$2f$esm$2d$node$2f$rng$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/uuid/dist/esm-node/rng.js [app-route] (ecmascript)");
var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$uuid$2f$dist$2f$esm$2d$node$2f$stringify$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/uuid/dist/esm-node/stringify.js [app-route] (ecmascript)"); // **`v1()` - Generate time-based UUID**
;
;
//
// Inspired by https://github.com/LiosK/UUID.js
// and http://docs.python.org/library/uuid.html
let _nodeId;
let _clockseq; // Previous uuid creation time
let _lastMSecs = 0;
let _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details
function v1(options, buf, offset) {
let i = buf && offset || 0;
const b = buf || new Array(16);
options = options || {};
let node = options.node || _nodeId;
let clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not
// specified. We do this lazily to minimize issues related to insufficient
// system entropy. See #189
if (node == null || clockseq == null) {
const seedBytes = options.random || (options.rng || __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$uuid$2f$dist$2f$esm$2d$node$2f$rng$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["default"])();
if (node == null) {
// Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)
node = _nodeId = [
seedBytes[0] | 0x01,
seedBytes[1],
seedBytes[2],
seedBytes[3],
seedBytes[4],
seedBytes[5]
];
}
if (clockseq == null) {
// Per 4.2.2, randomize (14 bit) clockseq
clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;
}
} // UUID timestamps are 100 nano-second units since the Gregorian epoch,
// (1582-10-15 00:00). JSNumbers aren't precise enough for this, so
// time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'
// (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.
let msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock
// cycle to simulate higher resolution clock
let nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs)
const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression
if (dt < 0 && options.clockseq === undefined) {
clockseq = clockseq + 1 & 0x3fff;
} // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new
// time interval
if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {
nsecs = 0;
} // Per 4.2.1.2 Throw error if too many uuids are requested
if (nsecs >= 10000) {
throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");
}
_lastMSecs = msecs;
_lastNSecs = nsecs;
_clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch
msecs += 12219292800000; // `time_low`
const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;
b[i++] = tl >>> 24 & 0xff;
b[i++] = tl >>> 16 & 0xff;
b[i++] = tl >>> 8 & 0xff;
b[i++] = tl & 0xff; // `time_mid`
const tmh = msecs / 0x100000000 * 10000 & 0xfffffff;
b[i++] = tmh >>> 8 & 0xff;
b[i++] = tmh & 0xff; // `time_high_and_version`
b[i++] = tmh >>> 24 & 0xf | 0x10; // include version
b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)
b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low`
b[i++] = clockseq & 0xff; // `node`
for(let n = 0; n < 6; ++n){
b[i + n] = node[n];
}
return buf || (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$uuid$2f$dist$2f$esm$2d$node$2f$stringify$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["default"])(b);
}
const __TURBOPACK__default__export__ = v1;
}),
"[project]/node_modules/uuid/dist/esm-node/parse.js [app-route] (ecmascript)", ((__turbopack_context__) => {
"use strict";
__turbopack_context__.s([
"default",
()=>__TURBOPACK__default__export__
]);
var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$uuid$2f$dist$2f$esm$2d$node$2f$validate$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/uuid/dist/esm-node/validate.js [app-route] (ecmascript)");
;
function parse(uuid) {
if (!(0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$uuid$2f$dist$2f$esm$2d$node$2f$validate$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["default"])(uuid)) {
throw TypeError('Invalid UUID');
}
let v;
const arr = new Uint8Array(16); // Parse ########-....-....-....-............
arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24;
arr[1] = v >>> 16 & 0xff;
arr[2] = v >>> 8 & 0xff;
arr[3] = v & 0xff; // Parse ........-####-....-....-............
arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8;
arr[5] = v & 0xff; // Parse ........-....-####-....-............
arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8;
arr[7] = v & 0xff; // Parse ........-....-....-####-............
arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8;
arr[9] = v & 0xff; // Parse ........-....-....-....-############
// (Use "/" to avoid 32-bit truncation when bit-shifting high-order bytes)
arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff;
arr[11] = v / 0x100000000 & 0xff;
arr[12] = v >>> 24 & 0xff;
arr[13] = v >>> 16 & 0xff;
arr[14] = v >>> 8 & 0xff;
arr[15] = v & 0xff;
return arr;
}
const __TURBOPACK__default__export__ = parse;
}),
"[project]/node_modules/uuid/dist/esm-node/v35.js [app-route] (ecmascript)", ((__turbopack_context__) => {
"use strict";
__turbopack_context__.s([
"DNS",
()=>DNS,
"URL",
()=>URL,
"default",
()=>__TURBOPACK__default__export__
]);
var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$uuid$2f$dist$2f$esm$2d$node$2f$stringify$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/uuid/dist/esm-node/stringify.js [app-route] (ecmascript)");
var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$uuid$2f$dist$2f$esm$2d$node$2f$parse$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/uuid/dist/esm-node/parse.js [app-route] (ecmascript)");
;
;
function stringToBytes(str) {
str = unescape(encodeURIComponent(str)); // UTF8 escape
const bytes = [];
for(let i = 0; i < str.length; ++i){
bytes.push(str.charCodeAt(i));
}
return bytes;
}
const DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';
const URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';
function __TURBOPACK__default__export__(name, version, hashfunc) {
function generateUUID(value, namespace, buf, offset) {
if (typeof value === 'string') {
value = stringToBytes(value);
}
if (typeof namespace === 'string') {
namespace = (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$uuid$2f$dist$2f$esm$2d$node$2f$parse$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["default"])(namespace);
}
if (namespace.length !== 16) {
throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)');
} // Compute hash of namespace and value, Per 4.3
// Future: Use spread syntax when supported on all platforms, e.g. `bytes =
// hashfunc([...namespace, ... value])`
let bytes = new Uint8Array(16 + value.length);
bytes.set(namespace);
bytes.set(value, namespace.length);
bytes = hashfunc(bytes);
bytes[6] = bytes[6] & 0x0f | version;
bytes[8] = bytes[8] & 0x3f | 0x80;
if (buf) {
offset = offset || 0;
for(let i = 0; i < 16; ++i){
buf[offset + i] = bytes[i];
}
return buf;
}
return (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$uuid$2f$dist$2f$esm$2d$node$2f$stringify$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["default"])(bytes);
} // Function#name is not settable on some platforms (#270)
try {
generateUUID.name = name; // eslint-disable-next-line no-empty
} catch (err) {} // For CommonJS default export support
generateUUID.DNS = DNS;
generateUUID.URL = URL;
return generateUUID;
}
}),
"[project]/node_modules/uuid/dist/esm-node/md5.js [app-route] (ecmascript)", ((__turbopack_context__) => {
"use strict";
__turbopack_context__.s([
"default",
()=>__TURBOPACK__default__export__
]);
var __TURBOPACK__imported__module__$5b$externals$5d2f$crypto__$5b$external$5d$__$28$crypto$2c$__cjs$29$__ = __turbopack_context__.i("[externals]/crypto [external] (crypto, cjs)");
;
function md5(bytes) {
if (Array.isArray(bytes)) {
bytes = Buffer.from(bytes);
} else if (typeof bytes === 'string') {
bytes = Buffer.from(bytes, 'utf8');
}
return __TURBOPACK__imported__module__$5b$externals$5d2f$crypto__$5b$external$5d$__$28$crypto$2c$__cjs$29$__["default"].createHash('md5').update(bytes).digest();
}
const __TURBOPACK__default__export__ = md5;
}),
"[project]/node_modules/uuid/dist/esm-node/v3.js [app-route] (ecmascript)", ((__turbopack_context__) => {
"use strict";
__turbopack_context__.s([
"default",
()=>__TURBOPACK__default__export__
]);
var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$uuid$2f$dist$2f$esm$2d$node$2f$v35$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/uuid/dist/esm-node/v35.js [app-route] (ecmascript)");
var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$uuid$2f$dist$2f$esm$2d$node$2f$md5$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/uuid/dist/esm-node/md5.js [app-route] (ecmascript)");
;
;
const v3 = (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$uuid$2f$dist$2f$esm$2d$node$2f$v35$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["default"])('v3', 0x30, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$uuid$2f$dist$2f$esm$2d$node$2f$md5$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["default"]);
const __TURBOPACK__default__export__ = v3;
}),
"[project]/node_modules/uuid/dist/esm-node/v4.js [app-route] (ecmascript)", ((__turbopack_context__) => {
"use strict";
__turbopack_context__.s([
"default",
()=>__TURBOPACK__default__export__
]);
var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$uuid$2f$dist$2f$esm$2d$node$2f$rng$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/uuid/dist/esm-node/rng.js [app-route] (ecmascript)");
var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$uuid$2f$dist$2f$esm$2d$node$2f$stringify$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/uuid/dist/esm-node/stringify.js [app-route] (ecmascript)");
;
;
function v4(options, buf, offset) {
options = options || {};
const rnds = options.random || (options.rng || __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$uuid$2f$dist$2f$esm$2d$node$2f$rng$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["default"])(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
rnds[6] = rnds[6] & 0x0f | 0x40;
rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
if (buf) {
offset = offset || 0;
for(let i = 0; i < 16; ++i){
buf[offset + i] = rnds[i];
}
return buf;
}
return (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$uuid$2f$dist$2f$esm$2d$node$2f$stringify$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["default"])(rnds);
}
const __TURBOPACK__default__export__ = v4;
}),
"[project]/node_modules/uuid/dist/esm-node/sha1.js [app-route] (ecmascript)", ((__turbopack_context__) => {
"use strict";
__turbopack_context__.s([
"default",
()=>__TURBOPACK__default__export__
]);
var __TURBOPACK__imported__module__$5b$externals$5d2f$crypto__$5b$external$5d$__$28$crypto$2c$__cjs$29$__ = __turbopack_context__.i("[externals]/crypto [external] (crypto, cjs)");
;
function sha1(bytes) {
if (Array.isArray(bytes)) {
bytes = Buffer.from(bytes);
} else if (typeof bytes === 'string') {
bytes = Buffer.from(bytes, 'utf8');
}
return __TURBOPACK__imported__module__$5b$externals$5d2f$crypto__$5b$external$5d$__$28$crypto$2c$__cjs$29$__["default"].createHash('sha1').update(bytes).digest();
}
const __TURBOPACK__default__export__ = sha1;
}),
"[project]/node_modules/uuid/dist/esm-node/v5.js [app-route] (ecmascript)", ((__turbopack_context__) => {
"use strict";
__turbopack_context__.s([
"default",
()=>__TURBOPACK__default__export__
]);
var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$uuid$2f$dist$2f$esm$2d$node$2f$v35$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/uuid/dist/esm-node/v35.js [app-route] (ecmascript)");
var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$uuid$2f$dist$2f$esm$2d$node$2f$sha1$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/uuid/dist/esm-node/sha1.js [app-route] (ecmascript)");
;
;
const v5 = (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$uuid$2f$dist$2f$esm$2d$node$2f$v35$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["default"])('v5', 0x50, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$uuid$2f$dist$2f$esm$2d$node$2f$sha1$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["default"]);
const __TURBOPACK__default__export__ = v5;
}),
"[project]/node_modules/uuid/dist/esm-node/nil.js [app-route] (ecmascript)", ((__turbopack_context__) => {
"use strict";
__turbopack_context__.s([
"default",
()=>__TURBOPACK__default__export__
]);
const __TURBOPACK__default__export__ = '00000000-0000-0000-0000-000000000000';
}),
"[project]/node_modules/uuid/dist/esm-node/version.js [app-route] (ecmascript)", ((__turbopack_context__) => {
"use strict";
__turbopack_context__.s([
"default",
()=>__TURBOPACK__default__export__
]);
var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$uuid$2f$dist$2f$esm$2d$node$2f$validate$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/uuid/dist/esm-node/validate.js [app-route] (ecmascript)");
;
function version(uuid) {
if (!(0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$uuid$2f$dist$2f$esm$2d$node$2f$validate$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["default"])(uuid)) {
throw TypeError('Invalid UUID');
}
return parseInt(uuid.substr(14, 1), 16);
}
const __TURBOPACK__default__export__ = version;
}),
"[project]/node_modules/uuid/dist/esm-node/index.js [app-route] (ecmascript)", ((__turbopack_context__) => {
"use strict";
__turbopack_context__.s([
"NIL",
()=>__TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$uuid$2f$dist$2f$esm$2d$node$2f$nil$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["default"],
"parse",
()=>__TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$uuid$2f$dist$2f$esm$2d$node$2f$parse$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["default"],
"stringify",
()=>__TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$uuid$2f$dist$2f$esm$2d$node$2f$stringify$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["default"],
"v1",
()=>__TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$uuid$2f$dist$2f$esm$2d$node$2f$v1$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["default"],
"v3",
()=>__TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$uuid$2f$dist$2f$esm$2d$node$2f$v3$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["default"],
"v4",
()=>__TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$uuid$2f$dist$2f$esm$2d$node$2f$v4$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["default"],
"v5",
()=>__TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$uuid$2f$dist$2f$esm$2d$node$2f$v5$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["default"],
"validate",
()=>__TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$uuid$2f$dist$2f$esm$2d$node$2f$validate$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["default"],
"version",
()=>__TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$uuid$2f$dist$2f$esm$2d$node$2f$version$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["default"]
]);
var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$uuid$2f$dist$2f$esm$2d$node$2f$index$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__$3c$locals$3e$__ = __turbopack_context__.i("[project]/node_modules/uuid/dist/esm-node/index.js [app-route] (ecmascript) <locals>");
var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$uuid$2f$dist$2f$esm$2d$node$2f$v1$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/uuid/dist/esm-node/v1.js [app-route] (ecmascript)");
var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$uuid$2f$dist$2f$esm$2d$node$2f$v3$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/uuid/dist/esm-node/v3.js [app-route] (ecmascript)");
var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$uuid$2f$dist$2f$esm$2d$node$2f$v4$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/uuid/dist/esm-node/v4.js [app-route] (ecmascript)");
var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$uuid$2f$dist$2f$esm$2d$node$2f$v5$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/uuid/dist/esm-node/v5.js [app-route] (ecmascript)");
var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$uuid$2f$dist$2f$esm$2d$node$2f$nil$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/uuid/dist/esm-node/nil.js [app-route] (ecmascript)");
var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$uuid$2f$dist$2f$esm$2d$node$2f$version$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/uuid/dist/esm-node/version.js [app-route] (ecmascript)");
var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$uuid$2f$dist$2f$esm$2d$node$2f$validate$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/uuid/dist/esm-node/validate.js [app-route] (ecmascript)");
var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$uuid$2f$dist$2f$esm$2d$node$2f$stringify$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/uuid/dist/esm-node/stringify.js [app-route] (ecmascript)");
var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$uuid$2f$dist$2f$esm$2d$node$2f$parse$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/uuid/dist/esm-node/parse.js [app-route] (ecmascript)");
}),
"[project]/node_modules/preact/dist/preact.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => {
var n, l, t, u, r, i, o, e, f, c, s, a, h, p, v, y, d = {}, w = [], _ = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, g = Array.isArray;
function x(n, l) {
for(var t in l)n[t] = l[t];
return n;
}
function m(n) {
n && n.parentNode && n.parentNode.removeChild(n);
}
function b(l, t, u) {
var r, i, o, e = {};
for(o in t)"key" == o ? r = t[o] : "ref" == o ? i = t[o] : e[o] = t[o];
if (arguments.length > 2 && (e.children = arguments.length > 3 ? n.call(arguments, 2) : u), "function" == typeof l && null != l.defaultProps) for(o in l.defaultProps)void 0 === e[o] && (e[o] = l.defaultProps[o]);
return k(l, e, r, i, null);
}
function k(n, u, r, i, o) {
var e = {
type: n,
props: u,
key: r,
ref: i,
__k: null,
__: null,
__b: 0,
__e: null,
__c: null,
constructor: void 0,
__v: null == o ? ++t : o,
__i: -1,
__u: 0
};
return null == o && null != l.vnode && l.vnode(e), e;
}
function M(n) {
return n.children;
}
function S(n, l) {
this.props = n, this.context = l;
}
function $(n, l) {
if (null == l) return n.__ ? $(n.__, n.__i + 1) : null;
for(var t; l < n.__k.length; l++)if (null != (t = n.__k[l]) && null != t.__e) return t.__e;
return "function" == typeof n.type ? $(n) : null;
}
function C(n) {
if (n.__P && n.__d) {
var t = n.__v, u = t.__e, r = [], i = [], o = x({}, t);
o.__v = t.__v + 1, l.vnode && l.vnode(o), N(n.__P, o, t, n.__n, n.__P.namespaceURI, 32 & t.__u ? [
u
] : null, r, null == u ? $(t) : u, !!(32 & t.__u), i), o.__v = t.__v, o.__.__k[o.__i] = o, q(r, o, i), t.__e = t.__ = null, o.__e != u && I(o);
}
}
function I(n) {
if (null != (n = n.__) && null != n.__c) return n.__e = n.__c.base = null, n.__k.some(function(l) {
if (null != l && null != l.__e) return n.__e = n.__c.base = l.__e;
}), I(n);
}
function P(n) {
(!n.__d && (n.__d = !0) && r.push(n) && !A.__r++ || i != l.debounceRendering) && ((i = l.debounceRendering) || o)(A);
}
function A() {
try {
for(var n, l = 1; r.length;)r.length > l && r.sort(e), n = r.shift(), l = r.length, C(n);
} finally{
r.length = A.__r = 0;
}
}
function H(n, l, t, u, r, i, o, e, f, c, s) {
var a, h, p, v, y, _, g, x = u && u.__k || w, m = l.length;
for(f = L(t, l, x, f, m), a = 0; a < m; a++)null != (p = t.__k[a]) && (h = -1 != p.__i && x[p.__i] || d, p.__i = a, _ = N(n, p, h, r, i, o, e, f, c, s), v = p.__e, p.ref && h.ref != p.ref && (h.ref && E(h.ref, null, p), s.push(p.ref, p.__c || v, p)), null == y && null != v && (y = v), (g = !!(4 & p.__u)) || h.__k === p.__k ? (f = T(p, f, n, g), g && h.__e && (h.__e = null)) : "function" == typeof p.type && void 0 !== _ ? f = _ : v && (f = v.nextSibling), p.__u &= -7);
return t.__e = y, f;
}
function L(n, l, t, u, r) {
var i, o, e, f, c, s = t.length, a = s, h = 0;
for(n.__k = new Array(r), i = 0; i < r; i++)null != (o = l[i]) && "boolean" != typeof o && "function" != typeof o ? ("string" == typeof o || "number" == typeof o || "bigint" == typeof o || o.constructor == String ? o = n.__k[i] = k(null, o, null, null, null) : g(o) ? o = n.__k[i] = k(M, {
children: o
}, null, null, null) : void 0 === o.constructor && o.__b > 0 ? o = n.__k[i] = k(o.type, o.props, o.key, o.ref ? o.ref : null, o.__v) : n.__k[i] = o, f = i + h, o.__ = n, o.__b = n.__b + 1, e = null, -1 != (c = o.__i = j(o, t, f, a)) && (a--, (e = t[c]) && (e.__u |= 2)), null == e || null == e.__v ? (-1 == c && (r > s ? h-- : r < s && h++), "function" != typeof o.type && (o.__u |= 4)) : c != f && (c == f - 1 ? h-- : c == f + 1 ? h++ : (c > f ? h-- : h++, o.__u |= 4))) : n.__k[i] = null;
if (a) for(i = 0; i < s; i++)null != (e = t[i]) && 0 == (2 & e.__u) && (e.__e == u && (u = $(e)), G(e, e));
return u;
}
function T(n, l, t, u) {
var r, i;
if ("function" == typeof n.type) {
for(r = n.__k, i = 0; r && i < r.length; i++)r[i] && (r[i].__ = n, l = T(r[i], l, t, u));
return l;
}
n.__e != l && (u && (l && n.type && !l.parentNode && (l = $(n)), t.insertBefore(n.__e, l || null)), l = n.__e);
do {
l = l && l.nextSibling;
}while (null != l && 8 == l.nodeType)
return l;
}
function j(n, l, t, u) {
var r, i, o, e = n.key, f = n.type, c = l[t], s = null != c && 0 == (2 & c.__u);
if (null === c && null == e || s && e == c.key && f == c.type) return t;
if (u > (s ? 1 : 0)) {
for(r = t - 1, i = t + 1; r >= 0 || i < l.length;)if (null != (c = l[o = r >= 0 ? r-- : i++]) && 0 == (2 & c.__u) && e == c.key && f == c.type) return o;
}
return -1;
}
function F(n, l, t) {
"-" == l[0] ? n.setProperty(l, null == t ? "" : t) : n[l] = null == t ? "" : "number" != typeof t || _.test(l) ? t : t + "px";
}
function O(n, l, t, u, r) {
var i, o;
n: if ("style" == l) if ("string" == typeof t) n.style.cssText = t;
else {
if ("string" == typeof u && (n.style.cssText = u = ""), u) for(l in u)t && l in t || F(n.style, l, "");
if (t) for(l in t)u && t[l] == u[l] || F(n.style, l, t[l]);
}
else if ("o" == l[0] && "n" == l[1]) i = l != (l = l.replace(a, "$1")), o = l.toLowerCase(), l = o in n || "onFocusOut" == l || "onFocusIn" == l ? o.slice(2) : l.slice(2), n.l || (n.l = {}), n.l[l + i] = t, t ? u ? t[s] = u[s] : (t[s] = h, n.addEventListener(l, i ? v : p, i)) : n.removeEventListener(l, i ? v : p, i);
else {
if ("http://www.w3.org/2000/svg" == r) l = l.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s");
else if ("width" != l && "height" != l && "href" != l && "list" != l && "form" != l && "tabIndex" != l && "download" != l && "rowSpan" != l && "colSpan" != l && "role" != l && "popover" != l && l in n) try {
n[l] = null == t ? "" : t;
break n;
} catch (n) {}
"function" == typeof t || (null == t || !1 === t && "-" != l[4] ? n.removeAttribute(l) : n.setAttribute(l, "popover" == l && 1 == t ? "" : t));
}
}
function z(n) {
return function(t) {
if (this.l) {
var u = this.l[t.type + n];
if (null == t[c]) t[c] = h++;
else if (t[c] < u[s]) return;
return u(l.event ? l.event(t) : t);
}
};
}
function N(n, t, u, r, i, o, e, f, c, s) {
var a, h, p, v, y, d, _, b, k, $, C, I, P, A, L, T = t.type;
if (void 0 !== t.constructor) return null;
128 & u.__u && (c = !!(32 & u.__u), o = [
f = t.__e = u.__e
]), (a = l.__b) && a(t);
n: if ("function" == typeof T) try {
if (b = t.props, k = T.prototype && T.prototype.render, $ = (a = T.contextType) && r[a.__c], C = a ? $ ? $.props.value : a.__ : r, u.__c ? _ = (h = t.__c = u.__c).__ = h.__E : (k ? t.__c = h = new T(b, C) : (t.__c = h = new S(b, C), h.constructor = T, h.render = J), $ && $.sub(h), h.state || (h.state = {}), h.__n = r, p = h.__d = !0, h.__h = [], h._sb = []), k && null == h.__s && (h.__s = h.state), k && null != T.getDerivedStateFromProps && (h.__s == h.state && (h.__s = x({}, h.__s)), x(h.__s, T.getDerivedStateFromProps(b, h.__s))), v = h.props, y = h.state, h.__v = t, p) k && null == T.getDerivedStateFromProps && null != h.componentWillMount && h.componentWillMount(), k && null != h.componentDidMount && h.__h.push(h.componentDidMount);
else {
if (k && null == T.getDerivedStateFromProps && b !== v && null != h.componentWillReceiveProps && h.componentWillReceiveProps(b, C), t.__v == u.__v || !h.__e && null != h.shouldComponentUpdate && !1 === h.shouldComponentUpdate(b, h.__s, C)) {
t.__v != u.__v && (h.props = b, h.state = h.__s, h.__d = !1), t.__e = u.__e, t.__k = u.__k, t.__k.some(function(n) {
n && (n.__ = t);
}), w.push.apply(h.__h, h._sb), h._sb = [], h.__h.length && e.push(h);
break n;
}
null != h.componentWillUpdate && h.componentWillUpdate(b, h.__s, C), k && null != h.componentDidUpdate && h.__h.push(function() {
h.componentDidUpdate(v, y, d);
});
}
if (h.context = C, h.props = b, h.__P = n, h.__e = !1, I = l.__r, P = 0, k) h.state = h.__s, h.__d = !1, I && I(t), a = h.render(h.props, h.state, h.context), w.push.apply(h.__h, h._sb), h._sb = [];
else do {
h.__d = !1, I && I(t), a = h.render(h.props, h.state, h.context), h.state = h.__s;
}while (h.__d && ++P < 25)
h.state = h.__s, null != h.getChildContext && (r = x(x({}, r), h.getChildContext())), k && !p && null != h.getSnapshotBeforeUpdate && (d = h.getSnapshotBeforeUpdate(v, y)), A = null != a && a.type === M && null == a.key ? B(a.props.children) : a, f = H(n, g(A) ? A : [
A
], t, u, r, i, o, e, f, c, s), h.base = t.__e, t.__u &= -161, h.__h.length && e.push(h), _ && (h.__E = h.__ = null);
} catch (n) {
if (t.__v = null, c || null != o) if (n.then) {
for(t.__u |= c ? 160 : 128; f && 8 == f.nodeType && f.nextSibling;)f = f.nextSibling;
o[o.indexOf(f)] = null, t.__e = f;
} else {
for(L = o.length; L--;)m(o[L]);
V(t);
}
else t.__e = u.__e, t.__k = u.__k, n.then || V(t);
l.__e(n, t, u);
}
else null == o && t.__v == u.__v ? (t.__k = u.__k, t.__e = u.__e) : f = t.__e = D(u.__e, t, u, r, i, o, e, c, s);
return (a = l.diffed) && a(t), 128 & t.__u ? void 0 : f;
}
function V(n) {
n && (n.__c && (n.__c.__e = !0), n.__k && n.__k.some(V));
}
function q(n, t, u) {
for(var r = 0; r < u.length; r++)E(u[r], u[++r], u[++r]);
l.__c && l.__c(t, n), n.some(function(t) {
try {
n = t.__h, t.__h = [], n.some(function(n) {
n.call(t);
});
} catch (n) {
l.__e(n, t.__v);
}
});
}
function B(n) {
return "object" != typeof n || null == n || n.__b > 0 ? n : g(n) ? n.map(B) : x({}, n);
}
function D(t, u, r, i, o, e, f, c, s) {
var a, h, p, v, y, w, _, x = r.props || d, b = u.props, k = u.type;
if ("svg" == k ? o = "http://www.w3.org/2000/svg" : "math" == k ? o = "http://www.w3.org/1998/Math/MathML" : o || (o = "http://www.w3.org/1999/xhtml"), null != e) {
for(a = 0; a < e.length; a++)if ((y = e[a]) && "setAttribute" in y == !!k && (k ? y.localName == k : 3 == y.nodeType)) {
t = y, e[a] = null;
break;
}
}
if (null == t) {
if (null == k) return document.createTextNode(b);
t = document.createElementNS(o, k, b.is && b), c && (l.__m && l.__m(u, e), c = !1), e = null;
}
if (null == k) x === b || c && t.data == b || (t.data = b);
else {
if (e = e && n.call(t.childNodes), !c && null != e) for(x = {}, a = 0; a < t.attributes.length; a++)x[(y = t.attributes[a]).name] = y.value;
for(a in x)y = x[a], "dangerouslySetInnerHTML" == a ? p = y : "children" == a || a in b || "value" == a && "defaultValue" in b || "checked" == a && "defaultChecked" in b || O(t, a, null, y, o);
for(a in b)y = b[a], "children" == a ? v = y : "dangerouslySetInnerHTML" == a ? h = y : "value" == a ? w = y : "checked" == a ? _ = y : c && "function" != typeof y || x[a] === y || O(t, a, y, x[a], o);
if (h) c || p && (h.__html == p.__html || h.__html == t.innerHTML) || (t.innerHTML = h.__html), u.__k = [];
else if (p && (t.innerHTML = ""), H("template" == u.type ? t.content : t, g(v) ? v : [
v
], u, r, i, "foreignObject" == k ? "http://www.w3.org/1999/xhtml" : o, e, f, e ? e[0] : r.__k && $(r, 0), c, s), null != e) for(a = e.length; a--;)m(e[a]);
c || (a = "value", "progress" == k && null == w ? t.removeAttribute("value") : null != w && (w !== t[a] || "progress" == k && !w || "option" == k && w != x[a]) && O(t, a, w, x[a], o), a = "checked", null != _ && _ != t[a] && O(t, a, _, x[a], o));
}
return t;
}
function E(n, t, u) {
try {
if ("function" == typeof n) {
var r = "function" == typeof n.__u;
r && n.__u(), r && null == t || (n.__u = n(t));
} else n.current = t;
} catch (n) {
l.__e(n, u);
}
}
function G(n, t, u) {
var r, i;
if (l.unmount && l.unmount(n), (r = n.ref) && (r.current && r.current != n.__e || E(r, null, t)), null != (r = n.__c)) {
if (r.componentWillUnmount) try {
r.componentWillUnmount();
} catch (n) {
l.__e(n, t);
}
r.base = r.__P = null;
}
if (r = n.__k) for(i = 0; i < r.length; i++)r[i] && G(r[i], t, u || "function" != typeof n.type);
u || m(n.__e), n.__c = n.__ = n.__e = void 0;
}
function J(n, l, t) {
return this.constructor(n, t);
}
function K(t, u, r) {
var i, o, e, f;
u == document && (u = document.documentElement), l.__ && l.__(t, u), o = (i = "function" == typeof r) ? null : r && r.__k || u.__k, e = [], f = [], N(u, t = (!i && r || u).__k = b(M, null, [
t
]), o || d, d, u.namespaceURI, !i && r ? [
r
] : o ? null : u.firstChild ? n.call(u.childNodes) : null, e, !i && r ? r : o ? o.__e : u.firstChild, i, f), q(e, t, f);
}
n = w.slice, l = {
__e: function(n, l, t, u) {
for(var r, i, o; l = l.__;)if ((r = l.__c) && !r.__) try {
if ((i = r.constructor) && null != i.getDerivedStateFromError && (r.setState(i.getDerivedStateFromError(n)), o = r.__d), null != r.componentDidCatch && (r.componentDidCatch(n, u || {}), o = r.__d), o) return r.__E = r;
} catch (l) {
n = l;
}
throw n;
}
}, t = 0, u = function(n) {
return null != n && void 0 === n.constructor;
}, S.prototype.setState = function(n, l) {
var t;
t = null != this.__s && this.__s != this.state ? this.__s : this.__s = x({}, this.state), "function" == typeof n && (n = n(x({}, t), this.props)), n && x(t, n), null != n && this.__v && (l && this._sb.push(l), P(this));
}, S.prototype.forceUpdate = function(n) {
this.__v && (this.__e = !0, n && this.__h.push(n), P(this));
}, S.prototype.render = M, r = [], o = "function" == typeof Promise ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, e = function(n, l) {
return n.__v.__b - l.__v.__b;
}, A.__r = 0, f = Math.random().toString(8), c = "__d" + f, s = "__a" + f, a = /(PointerCapture)$|Capture$/i, h = 0, p = z(!1), v = z(!0), y = 0, exports.Component = S, exports.Fragment = M, exports.cloneElement = function(l, t, u) {
var r, i, o, e, f = x({}, l.props);
for(o in l.type && l.type.defaultProps && (e = l.type.defaultProps), t)"key" == o ? r = t[o] : "ref" == o ? i = t[o] : f[o] = void 0 === t[o] && null != e ? e[o] : t[o];
return arguments.length > 2 && (f.children = arguments.length > 3 ? n.call(arguments, 2) : u), k(l.type, f, r || l.key, i || l.ref, null);
}, exports.createContext = function(n) {
function l(n) {
var t, u;
return this.getChildContext || (t = new Set, (u = {})[l.__c] = this, this.getChildContext = function() {
return u;
}, this.componentWillUnmount = function() {
t = null;
}, this.shouldComponentUpdate = function(n) {
this.props.value != n.value && t.forEach(function(n) {
n.__e = !0, P(n);
});
}, this.sub = function(n) {
t.add(n);
var l = n.componentWillUnmount;
n.componentWillUnmount = function() {
t && t.delete(n), l && l.call(n);
};
}), n.children;
}
return l.__c = "__cC" + y++, l.__ = n, l.Provider = l.__l = (l.Consumer = function(n, l) {
return n.children(l);
}).contextType = l, l;
}, exports.createElement = b, exports.createRef = function() {
return {
current: null
};
}, exports.h = b, exports.hydrate = function n(l, t) {
K(l, t, n);
}, exports.isValidElement = u, exports.options = l, exports.render = K, exports.toChildArray = function n(l, t) {
return t = t || [], null == l || "boolean" == typeof l || (g(l) ? l.some(function(l) {
n(l, t);
}) : t.push(l)), t;
};
}),
"[project]/node_modules/preact-render-to-string/dist/commonjs.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => {
!function(e, t) {
("TURBOPACK compile-time truthy", 1) ? t(exports, __turbopack_context__.r("[project]/node_modules/preact/dist/preact.js [app-route] (ecmascript)")) : "TURBOPACK unreachable";
}(/*TURBOPACK member replacement*/ __turbopack_context__.e, function(e, t) {
var n = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|^--/i, r = /^(area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr)$/, o = /[\s\n\\/='"\0<>]/, i = /^xlink:?./, s = /["&<]/;
function a(e) {
if (!1 === s.test(e += "")) return e;
for(var t = 0, n = 0, r = "", o = ""; n < e.length; n++){
switch(e.charCodeAt(n)){
case 34:
o = "&quot;";
break;
case 38:
o = "&amp;";
break;
case 60:
o = "&lt;";
break;
default:
continue;
}
n !== t && (r += e.slice(t, n)), r += o, t = n + 1;
}
return n !== t && (r += e.slice(t, n)), r;
}
var l = function(e, t) {
return String(e).replace(/(\n+)/g, "$1" + (t || "\t"));
}, f = function(e, t, n) {
return String(e).length > (t || 40) || !n && -1 !== String(e).indexOf("\n") || -1 !== String(e).indexOf("<");
}, u = {}, p = /([A-Z])/g;
function c(e) {
var t = "";
for(var r in e){
var o = e[r];
null != o && "" !== o && (t && (t += " "), t += "-" == r[0] ? r : u[r] || (u[r] = r.replace(p, "-$1").toLowerCase()), t = "number" == typeof o && !1 === n.test(r) ? t + ": " + o + "px;" : t + ": " + o + ";");
}
return t || void 0;
}
function _(e, t) {
return Array.isArray(t) ? t.reduce(_, e) : null != t && !1 !== t && e.push(t), e;
}
function d() {
this.__d = !0;
}
function v(e, t) {
return {
__v: e,
context: t,
props: e.props,
setState: d,
forceUpdate: d,
__d: !0,
__h: []
};
}
function g(e, t) {
var n = e.contextType, r = n && t[n.__c];
return null != n ? r ? r.props.value : n.__ : t;
}
var h = [];
function y(e, n, s, u, p, d) {
if (null == e || "boolean" == typeof e) return "";
if ("object" != typeof e) return "function" == typeof e ? "" : a(e);
var m = s.pretty, b = m && "string" == typeof m ? m : "\t";
if (Array.isArray(e)) {
for(var x = "", k = 0; k < e.length; k++)m && k > 0 && (x += "\n"), x += y(e[k], n, s, u, p, d);
return x;
}
if (void 0 !== e.constructor) return "";
var S, w = e.type, C = e.props, O = !1;
if ("function" == typeof w) {
if (O = !0, !s.shallow || !u && !1 !== s.renderRootComponent) {
if (w === t.Fragment) {
var j = [];
return _(j, e.props.children), y(j, n, s, !1 !== s.shallowHighOrder, p, d);
}
var F, A = e.__c = v(e, n);
t.options.__b && t.options.__b(e);
var T = t.options.__r;
if (w.prototype && "function" == typeof w.prototype.render) {
var H = g(w, n);
(A = e.__c = new w(C, H)).__v = e, A._dirty = A.__d = !0, A.props = C, null == A.state && (A.state = {}), null == A._nextState && null == A.__s && (A._nextState = A.__s = A.state), A.context = H, w.getDerivedStateFromProps ? A.state = Object.assign({}, A.state, w.getDerivedStateFromProps(A.props, A.state)) : A.componentWillMount && (A.componentWillMount(), A.state = A._nextState !== A.state ? A._nextState : A.__s !== A.state ? A.__s : A.state), T && T(e), F = A.render(A.props, A.state, A.context);
} else for(var M = g(w, n), L = 0; A.__d && L++ < 25;)A.__d = !1, T && T(e), F = w.call(e.__c, C, M);
return A.getChildContext && (n = Object.assign({}, n, A.getChildContext())), t.options.diffed && t.options.diffed(e), y(F, n, s, !1 !== s.shallowHighOrder, p, d);
}
w = (S = w).displayName || S !== Function && S.name || function(e) {
var t = (Function.prototype.toString.call(e).match(/^\s*function\s+([^( ]+)/) || "")[1];
if (!t) {
for(var n = -1, r = h.length; r--;)if (h[r] === e) {
n = r;
break;
}
n < 0 && (n = h.push(e) - 1), t = "UnnamedComponent" + n;
}
return t;
}(S);
}
var E, $, D = "<" + w;
if (C) {
var N = Object.keys(C);
s && !0 === s.sortAttributes && N.sort();
for(var P = 0; P < N.length; P++){
var R = N[P], W = C[R];
if ("children" !== R) {
if (!o.test(R) && (s && s.allAttributes || "key" !== R && "ref" !== R && "__self" !== R && "__source" !== R)) {
if ("defaultValue" === R) R = "value";
else if ("defaultChecked" === R) R = "checked";
else if ("defaultSelected" === R) R = "selected";
else if ("className" === R) {
if (void 0 !== C.class) continue;
R = "class";
} else p && i.test(R) && (R = R.toLowerCase().replace(/^xlink:?/, "xlink:"));
if ("htmlFor" === R) {
if (C.for) continue;
R = "for";
}
"style" === R && W && "object" == typeof W && (W = c(W)), "a" === R[0] && "r" === R[1] && "boolean" == typeof W && (W = String(W));
var q = s.attributeHook && s.attributeHook(R, W, n, s, O);
if (q || "" === q) D += q;
else if ("dangerouslySetInnerHTML" === R) $ = W && W.__html;
else if ("textarea" === w && "value" === R) E = W;
else if ((W || 0 === W || "" === W) && "function" != typeof W) {
if (!(!0 !== W && "" !== W || (W = R, s && s.xml))) {
D = D + " " + R;
continue;
}
if ("value" === R) {
if ("select" === w) {
d = W;
continue;
}
"option" === w && d == W && void 0 === C.selected && (D += " selected");
}
D = D + " " + R + '="' + a(W) + '"';
}
}
} else E = W;
}
}
if (m) {
var I = D.replace(/\n\s*/, " ");
I === D || ~I.indexOf("\n") ? m && ~D.indexOf("\n") && (D += "\n") : D = I;
}
if (D += ">", o.test(w)) throw new Error(w + " is not a valid HTML tag name in " + D);
var U, V = r.test(w) || s.voidElements && s.voidElements.test(w), z = [];
if ($) m && f($) && ($ = "\n" + b + l($, b)), D += $;
else if (null != E && _(U = [], E).length) {
for(var Z = m && ~D.indexOf("\n"), B = !1, G = 0; G < U.length; G++){
var J = U[G];
if (null != J && !1 !== J) {
var K = y(J, n, s, !0, "svg" === w || "foreignObject" !== w && p, d);
if (m && !Z && f(K) && (Z = !0), K) if (m) {
var Q = K.length > 0 && "<" != K[0];
B && Q ? z[z.length - 1] += K : z.push(K), B = Q;
} else z.push(K);
}
}
if (m && Z) for(var X = z.length; X--;)z[X] = "\n" + b + l(z[X], b);
}
if (z.length || $) D += z.join("");
else if (s && s.xml) return D.substring(0, D.length - 1) + " />";
return !V || U || $ ? (m && ~D.indexOf("\n") && (D += "\n"), D = D + "</" + w + ">") : D = D.replace(/>$/, " />"), D;
}
var m = {
shallow: !0
};
k.render = k;
var b = function(e, t) {
return k(e, t, m);
}, x = [];
function k(e, n, r) {
n = n || {};
var o = t.options.__s;
t.options.__s = !0;
var i, s = t.h(t.Fragment, null);
return s.__k = [
e
], i = r && (r.pretty || r.voidElements || r.sortAttributes || r.shallow || r.allAttributes || r.xml || r.attributeHook) ? y(e, n, r) : F(e, n, !1, void 0, s), t.options.__c && t.options.__c(e, x), t.options.__s = o, x.length = 0, i;
}
function S(e) {
return null == e || "boolean" == typeof e ? null : "string" == typeof e || "number" == typeof e || "bigint" == typeof e ? t.h(null, null, e) : e;
}
function w(e, t) {
return "className" === e ? "class" : "htmlFor" === e ? "for" : "defaultValue" === e ? "value" : "defaultChecked" === e ? "checked" : "defaultSelected" === e ? "selected" : t && i.test(e) ? e.toLowerCase().replace(/^xlink:?/, "xlink:") : e;
}
function C(e, t) {
return "style" === e && null != t && "object" == typeof t ? c(t) : "a" === e[0] && "r" === e[1] && "boolean" == typeof t ? String(t) : t;
}
var O = Array.isArray, j = Object.assign;
function F(e, n, i, s, l) {
if (null == e || !0 === e || !1 === e || "" === e) return "";
if ("object" != typeof e) return "function" == typeof e ? "" : a(e);
if (O(e)) {
var f = "";
l.__k = e;
for(var u = 0; u < e.length; u++)f += F(e[u], n, i, s, l), e[u] = S(e[u]);
return f;
}
if (void 0 !== e.constructor) return "";
e.__ = l, t.options.__b && t.options.__b(e);
var p = e.type, c = e.props;
if ("function" == typeof p) {
var _;
if (p === t.Fragment) _ = c.children;
else {
_ = p.prototype && "function" == typeof p.prototype.render ? function(e, n) {
var r = e.type, o = g(r, n), i = new r(e.props, o);
e.__c = i, i.__v = e, i.__d = !0, i.props = e.props, null == i.state && (i.state = {}), null == i.__s && (i.__s = i.state), i.context = o, r.getDerivedStateFromProps ? i.state = j({}, i.state, r.getDerivedStateFromProps(i.props, i.state)) : i.componentWillMount && (i.componentWillMount(), i.state = i.__s !== i.state ? i.__s : i.state);
var s = t.options.__r;
return s && s(e), i.render(i.props, i.state, i.context);
}(e, n) : function(e, n) {
var r, o = v(e, n), i = g(e.type, n);
e.__c = o;
for(var s = t.options.__r, a = 0; o.__d && a++ < 25;)o.__d = !1, s && s(e), r = e.type.call(o, e.props, i);
return r;
}(e, n);
var d = e.__c;
d.getChildContext && (n = j({}, n, d.getChildContext()));
}
var h = F(_ = null != _ && _.type === t.Fragment && null == _.key ? _.props.children : _, n, i, s, e);
return t.options.diffed && t.options.diffed(e), e.__ = void 0, t.options.unmount && t.options.unmount(e), h;
}
var y, m, b = "<";
if (b += p, c) for(var x in y = c.children, c){
var k = c[x];
if (!("key" === x || "ref" === x || "__self" === x || "__source" === x || "children" === x || "className" === x && "class" in c || "htmlFor" === x && "for" in c || o.test(x))) {
if (k = C(x = w(x, i), k), "dangerouslySetInnerHTML" === x) m = k && k.__html;
else if ("textarea" === p && "value" === x) y = k;
else if ((k || 0 === k || "" === k) && "function" != typeof k) {
if (!0 === k || "" === k) {
k = x, b = b + " " + x;
continue;
}
if ("value" === x) {
if ("select" === p) {
s = k;
continue;
}
"option" !== p || s != k || "selected" in c || (b += " selected");
}
b = b + " " + x + '="' + a(k) + '"';
}
}
}
var A = b;
if (b += ">", o.test(p)) throw new Error(p + " is not a valid HTML tag name in " + b);
var T = "", H = !1;
if (m) T += m, H = !0;
else if ("string" == typeof y) T += a(y), H = !0;
else if (O(y)) {
e.__k = y;
for(var M = 0; M < y.length; M++){
var L = y[M];
if (y[M] = S(L), null != L && !1 !== L) {
var E = F(L, n, "svg" === p || "foreignObject" !== p && i, s, e);
E && (T += E, H = !0);
}
}
} else if (null != y && !1 !== y && !0 !== y) {
e.__k = [
S(y)
];
var $ = F(y, n, "svg" === p || "foreignObject" !== p && i, s, e);
$ && (T += $, H = !0);
}
if (t.options.diffed && t.options.diffed(e), e.__ = void 0, t.options.unmount && t.options.unmount(e), H) b += T;
else if (r.test(p)) return A + " />";
return b + "</" + p + ">";
}
k.shallowRender = b, e.default = k, e.render = k, e.renderToStaticMarkup = k, e.renderToString = k, e.shallowRender = b;
});
}),
"[project]/node_modules/preact-render-to-string/dist/index.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => {
module.exports = __turbopack_context__.r("[project]/node_modules/preact-render-to-string/dist/commonjs.js [app-route] (ecmascript)").default;
}),
"[project]/node_modules/cookie/index.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => {
"use strict";
/*!
* cookie
* Copyright(c) 2012-2014 Roman Shtylman
* Copyright(c) 2015 Douglas Christopher Wilson
* MIT Licensed
*/ /**
* Module exports.
* @public
*/ exports.parse = parse;
exports.serialize = serialize;
/**
* Module variables.
* @private
*/ var __toString = Object.prototype.toString;
var __hasOwnProperty = Object.prototype.hasOwnProperty;
/**
* RegExp to match cookie-name in RFC 6265 sec 4.1.1
* This refers out to the obsoleted definition of token in RFC 2616 sec 2.2
* which has been replaced by the token definition in RFC 7230 appendix B.
*
* cookie-name = token
* token = 1*tchar
* tchar = "!" / "#" / "$" / "%" / "&" / "'" /
* "*" / "+" / "-" / "." / "^" / "_" /
* "`" / "|" / "~" / DIGIT / ALPHA
*/ var cookieNameRegExp = /^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;
/**
* RegExp to match cookie-value in RFC 6265 sec 4.1.1
*
* cookie-value = *cookie-octet / ( DQUOTE *cookie-octet DQUOTE )
* cookie-octet = %x21 / %x23-2B / %x2D-3A / %x3C-5B / %x5D-7E
* ; US-ASCII characters excluding CTLs,
* ; whitespace DQUOTE, comma, semicolon,
* ; and backslash
*/ var cookieValueRegExp = /^("?)[\u0021\u0023-\u002B\u002D-\u003A\u003C-\u005B\u005D-\u007E]*\1$/;
/**
* RegExp to match domain-value in RFC 6265 sec 4.1.1
*
* domain-value = <subdomain>
* ; defined in [RFC1034], Section 3.5, as
* ; enhanced by [RFC1123], Section 2.1
* <subdomain> = <label> | <subdomain> "." <label>
* <label> = <let-dig> [ [ <ldh-str> ] <let-dig> ]
* Labels must be 63 characters or less.
* 'let-dig' not 'letter' in the first char, per RFC1123
* <ldh-str> = <let-dig-hyp> | <let-dig-hyp> <ldh-str>
* <let-dig-hyp> = <let-dig> | "-"
* <let-dig> = <letter> | <digit>
* <letter> = any one of the 52 alphabetic characters A through Z in
* upper case and a through z in lower case
* <digit> = any one of the ten digits 0 through 9
*
* Keep support for leading dot: https://github.com/jshttp/cookie/issues/173
*
* > (Note that a leading %x2E ("."), if present, is ignored even though that
* character is not permitted, but a trailing %x2E ("."), if present, will
* cause the user agent to ignore the attribute.)
*/ var domainValueRegExp = /^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i;
/**
* RegExp to match path-value in RFC 6265 sec 4.1.1
*
* path-value = <any CHAR except CTLs or ";">
* CHAR = %x01-7F
* ; defined in RFC 5234 appendix B.1
*/ var pathValueRegExp = /^[\u0020-\u003A\u003D-\u007E]*$/;
/**
* Parse a cookie header.
*
* Parse the given cookie header string into an object
* The object has the various cookies as keys(names) => values
*
* @param {string} str
* @param {object} [opt]
* @return {object}
* @public
*/ function parse(str, opt) {
if (typeof str !== 'string') {
throw new TypeError('argument str must be a string');
}
var obj = {};
var len = str.length;
// RFC 6265 sec 4.1.1, RFC 2616 2.2 defines a cookie name consists of one char minimum, plus '='.
if (len < 2) return obj;
var dec = opt && opt.decode || decode;
var index = 0;
var eqIdx = 0;
var endIdx = 0;
do {
eqIdx = str.indexOf('=', index);
if (eqIdx === -1) break; // No more cookie pairs.
endIdx = str.indexOf(';', index);
if (endIdx === -1) {
endIdx = len;
} else if (eqIdx > endIdx) {
// backtrack on prior semicolon
index = str.lastIndexOf(';', eqIdx - 1) + 1;
continue;
}
var keyStartIdx = startIndex(str, index, eqIdx);
var keyEndIdx = endIndex(str, eqIdx, keyStartIdx);
var key = str.slice(keyStartIdx, keyEndIdx);
// only assign once
if (!__hasOwnProperty.call(obj, key)) {
var valStartIdx = startIndex(str, eqIdx + 1, endIdx);
var valEndIdx = endIndex(str, endIdx, valStartIdx);
if (str.charCodeAt(valStartIdx) === 0x22 /* " */ && str.charCodeAt(valEndIdx - 1) === 0x22 /* " */ ) {
valStartIdx++;
valEndIdx--;
}
var val = str.slice(valStartIdx, valEndIdx);
obj[key] = tryDecode(val, dec);
}
index = endIdx + 1;
}while (index < len)
return obj;
}
function startIndex(str, index, max) {
do {
var code = str.charCodeAt(index);
if (code !== 0x20 /* */ && code !== 0x09 /* \t */ ) return index;
}while (++index < max)
return max;
}
function endIndex(str, index, min) {
while(index > min){
var code = str.charCodeAt(--index);
if (code !== 0x20 /* */ && code !== 0x09 /* \t */ ) return index + 1;
}
return min;
}
/**
* Serialize data into a cookie header.
*
* Serialize a name value pair into a cookie string suitable for
* http headers. An optional options object specifies cookie parameters.
*
* serialize('foo', 'bar', { httpOnly: true })
* => "foo=bar; httpOnly"
*
* @param {string} name
* @param {string} val
* @param {object} [opt]
* @return {string}
* @public
*/ function serialize(name, val, opt) {
var enc = opt && opt.encode || encodeURIComponent;
if (typeof enc !== 'function') {
throw new TypeError('option encode is invalid');
}
if (!cookieNameRegExp.test(name)) {
throw new TypeError('argument name is invalid');
}
var value = enc(val);
if (!cookieValueRegExp.test(value)) {
throw new TypeError('argument val is invalid');
}
var str = name + '=' + value;
if (!opt) return str;
if (null != opt.maxAge) {
var maxAge = Math.floor(opt.maxAge);
if (!isFinite(maxAge)) {
throw new TypeError('option maxAge is invalid');
}
str += '; Max-Age=' + maxAge;
}
if (opt.domain) {
if (!domainValueRegExp.test(opt.domain)) {
throw new TypeError('option domain is invalid');
}
str += '; Domain=' + opt.domain;
}
if (opt.path) {
if (!pathValueRegExp.test(opt.path)) {
throw new TypeError('option path is invalid');
}
str += '; Path=' + opt.path;
}
if (opt.expires) {
var expires = opt.expires;
if (!isDate(expires) || isNaN(expires.valueOf())) {
throw new TypeError('option expires is invalid');
}
str += '; Expires=' + expires.toUTCString();
}
if (opt.httpOnly) {
str += '; HttpOnly';
}
if (opt.secure) {
str += '; Secure';
}
if (opt.partitioned) {
str += '; Partitioned';
}
if (opt.priority) {
var priority = typeof opt.priority === 'string' ? opt.priority.toLowerCase() : opt.priority;
switch(priority){
case 'low':
str += '; Priority=Low';
break;
case 'medium':
str += '; Priority=Medium';
break;
case 'high':
str += '; Priority=High';
break;
default:
throw new TypeError('option priority is invalid');
}
}
if (opt.sameSite) {
var sameSite = typeof opt.sameSite === 'string' ? opt.sameSite.toLowerCase() : opt.sameSite;
switch(sameSite){
case true:
str += '; SameSite=Strict';
break;
case 'lax':
str += '; SameSite=Lax';
break;
case 'strict':
str += '; SameSite=Strict';
break;
case 'none':
str += '; SameSite=None';
break;
default:
throw new TypeError('option sameSite is invalid');
}
}
return str;
}
/**
* URL-decode string value. Optimized to skip native call when no %.
*
* @param {string} str
* @returns {string}
*/ function decode(str) {
return str.indexOf('%') !== -1 ? decodeURIComponent(str) : str;
}
/**
* Determine if value is a Date.
*
* @param {*} val
* @private
*/ function isDate(val) {
return __toString.call(val) === '[object Date]';
}
/**
* Try decoding a string using a decoding function.
*
* @param {string} str
* @param {function} decode
* @private
*/ function tryDecode(str, decode) {
try {
return decode(str);
} catch (e) {
return str;
}
}
}),
];
//# sourceMappingURL=%5Broot-of-the-server%5D__0_zxh-o._.js.map