{"version":3,"file":"control.c2cf8273.js","sources":["../../../../../../node_modules/@sveltejs/kit/src/runtime/control.js"],"sourcesContent":["export class HttpError {\n\t/**\n\t * @param {number} status\n\t * @param {{message: string} extends App.Error ? (App.Error | string | undefined) : App.Error} body\n\t */\n\tconstructor(status, body) {\n\t\tthis.status = status;\n\t\tif (typeof body === 'string') {\n\t\t\tthis.body = { message: body };\n\t\t} else if (body) {\n\t\t\tthis.body = body;\n\t\t} else {\n\t\t\tthis.body = { message: `Error: ${status}` };\n\t\t}\n\t}\n\n\ttoString() {\n\t\treturn JSON.stringify(this.body);\n\t}\n}\n\nexport class Redirect {\n\t/**\n\t * @param {300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308} status\n\t * @param {string} location\n\t */\n\tconstructor(status, location) {\n\t\tthis.status = status;\n\t\tthis.location = location;\n\t}\n}\n\nexport class NotFound extends Error {\n\t/**\n\t * @param {string} pathname\n\t */\n\tconstructor(pathname) {\n\t\tsuper();\n\n\t\tthis.status = 404;\n\t\tthis.message = `Not found: ${pathname}`;\n\t}\n}\n\n/**\n * @template {Record | undefined} [T=undefined]\n */\nexport class ActionFailure {\n\t/**\n\t * @param {number} status\n\t * @param {T} [data]\n\t */\n\tconstructor(status, data) {\n\t\tthis.status = status;\n\t\tthis.data = data;\n\t}\n}\n\n/**\n * This is a grotesque hack that, in dev, allows us to replace the implementations\n * of these classes that you'd get by importing them from `@sveltejs/kit` with the\n * ones that are imported via Vite and loaded internally, so that instanceof\n * checks work even though SvelteKit imports this module via Vite and consumers\n * import it via Node\n * @param {{\n * ActionFailure: typeof ActionFailure;\n * HttpError: typeof HttpError;\n * Redirect: typeof Redirect;\n * }} implementations\n */\nexport function replace_implementations(implementations) {\n\t// @ts-expect-error\n\tActionFailure = implementations.ActionFailure; // eslint-disable-line no-class-assign\n\t// @ts-expect-error\n\tHttpError = implementations.HttpError; // eslint-disable-line no-class-assign\n\t// @ts-expect-error\n\tRedirect = implementations.Redirect; // eslint-disable-line no-class-assign\n}\n"],"names":["HttpError","status","body","Redirect","location","NotFound","pathname"],"mappings":"AAAO,MAAMA,CAAU,CAKtB,YAAYC,EAAQC,EAAM,CACzB,KAAK,OAASD,EACV,OAAOC,GAAS,SACnB,KAAK,KAAO,CAAE,QAASA,CAAI,EACjBA,EACV,KAAK,KAAOA,EAEZ,KAAK,KAAO,CAAE,QAAS,UAAUD,CAAM,GAExC,CAED,UAAW,CACV,OAAO,KAAK,UAAU,KAAK,IAAI,CAC/B,CACF,CAEO,MAAME,CAAS,CAKrB,YAAYF,EAAQG,EAAU,CAC7B,KAAK,OAASH,EACd,KAAK,SAAWG,CAChB,CACF,CAEO,MAAMC,UAAiB,KAAM,CAInC,YAAYC,EAAU,CACrB,QAEA,KAAK,OAAS,IACd,KAAK,QAAU,cAAcA,CAAQ,EACrC,CACF","x_google_ignoreList":[0]}