token-usage-dashboard 1.0.13 → 1.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (126) hide show
  1. package/build/adapter-node.js +11 -0
  2. package/build/client/_app/immutable/chunks/B0VWrXPj.js +1 -0
  3. package/build/client/_app/immutable/chunks/B0VWrXPj.js.br +0 -0
  4. package/build/client/_app/immutable/chunks/B0VWrXPj.js.gz +0 -0
  5. package/build/client/_app/immutable/chunks/BaNbYf_w.js +1 -0
  6. package/build/client/_app/immutable/chunks/BaNbYf_w.js.br +0 -0
  7. package/build/client/_app/immutable/chunks/BaNbYf_w.js.gz +0 -0
  8. package/build/client/_app/immutable/chunks/CbiRHTcG.js +1 -0
  9. package/build/client/_app/immutable/chunks/CbiRHTcG.js.br +0 -0
  10. package/build/client/_app/immutable/chunks/CbiRHTcG.js.gz +0 -0
  11. package/build/client/_app/immutable/chunks/DTingiCe.js +3 -0
  12. package/build/client/_app/immutable/chunks/DTingiCe.js.br +0 -0
  13. package/build/client/_app/immutable/chunks/DTingiCe.js.gz +0 -0
  14. package/build/client/_app/immutable/chunks/ssd4Rw-g.js +3 -0
  15. package/build/client/_app/immutable/chunks/ssd4Rw-g.js.br +0 -0
  16. package/build/client/_app/immutable/chunks/ssd4Rw-g.js.gz +0 -0
  17. package/build/client/_app/immutable/entry/app.CRLWmGVY.js +2 -0
  18. package/build/client/_app/immutable/entry/app.CRLWmGVY.js.br +0 -0
  19. package/build/client/_app/immutable/entry/app.CRLWmGVY.js.gz +0 -0
  20. package/build/client/_app/immutable/entry/payload.DSmR2FwN.js +1 -0
  21. package/build/client/_app/immutable/entry/payload.DSmR2FwN.js.br +0 -0
  22. package/build/client/_app/immutable/entry/payload.DSmR2FwN.js.gz +0 -0
  23. package/build/client/_app/immutable/entry/start.CzGx2BYz.js +2 -0
  24. package/build/client/_app/immutable/entry/start.CzGx2BYz.js.br +0 -0
  25. package/build/client/_app/immutable/entry/start.CzGx2BYz.js.gz +0 -0
  26. package/build/client/_app/immutable/nodes/0.BBGTwdwd.js +1 -0
  27. package/build/client/_app/immutable/nodes/0.BBGTwdwd.js.br +0 -0
  28. package/build/client/_app/immutable/nodes/0.BBGTwdwd.js.gz +0 -0
  29. package/build/client/_app/immutable/nodes/1.Cy2JV0fN.js +1 -0
  30. package/build/client/_app/immutable/nodes/1.Cy2JV0fN.js.br +2 -0
  31. package/build/client/_app/immutable/nodes/1.Cy2JV0fN.js.gz +0 -0
  32. package/build/client/_app/immutable/nodes/2.CRMPKkcX.js +2 -0
  33. package/build/client/_app/immutable/nodes/2.CRMPKkcX.js.br +0 -0
  34. package/build/client/_app/immutable/nodes/2.CRMPKkcX.js.gz +0 -0
  35. package/build/client/_app/version.json +1 -1
  36. package/build/client/_app/version.json.br +0 -0
  37. package/build/client/_app/version.json.gz +0 -0
  38. package/build/handler.js +1 -22
  39. package/build/index.js +1 -145
  40. package/build/server/.vite/manifest.json +271 -0
  41. package/build/server/_app/immutable/assets/_layout.CZ6VMqH1.css +1 -0
  42. package/build/server/_app/immutable/assets/_page.CZocdpCk.css +1 -0
  43. package/build/server/adapter-env.js +2 -0
  44. package/build/server/adapter-index.js +74 -0
  45. package/build/server/adapter-node-env.js +63 -0
  46. package/build/server/adapter-node-handler.js +584 -0
  47. package/build/server/chunks/config.js +10 -0
  48. package/build/server/chunks/functions.js +30 -0
  49. package/build/server/chunks/index-server.js +2 -0
  50. package/build/server/chunks/instance.js +3546 -0
  51. package/build/server/chunks/internal.js +3323 -0
  52. package/build/server/chunks/navigation.js +16 -0
  53. package/build/server/chunks/{chunks/queries.js-BEdRnpMa.js → queries.js} +9 -9
  54. package/build/server/chunks/{chunks/range.js-CiCoLGqh.js → range.js} +3 -2
  55. package/build/server/chunks/{chunks/refresh.js-0W7-GwaH.js → refresh.js} +7 -7
  56. package/build/server/chunks/{chunks/request.js-BF7n7fZo.js → request.js} +5 -5
  57. package/build/server/chunks/server-errors.js +489 -0
  58. package/build/server/chunks/server.js +9 -0
  59. package/build/server/chunks/server2.js +1504 -0
  60. package/build/server/chunks/shared.js +84 -0
  61. package/build/server/chunks/uneval.js +537 -0
  62. package/build/server/entries/endpoints/api/refresh/_server.ts.js +12 -0
  63. package/build/server/entries/endpoints/api/settings/_server.ts.js +15 -0
  64. package/build/server/entries/endpoints/api/usage/_server.ts.js +8 -0
  65. package/build/server/entries/fallbacks/error.svelte.js +47 -0
  66. package/build/server/entries/hooks.server.js +10 -0
  67. package/build/server/{chunks/entries/pages/_layout.svelte.js-C9kkUOBf.js → entries/pages/_layout.svelte.js} +4 -2
  68. package/build/server/entries/pages/_page.server.ts.js +12 -0
  69. package/build/server/{chunks/entries/pages/_page.svelte.js-HFiLlojS.js → entries/pages/_page.svelte.js} +64 -27
  70. package/build/server/env.js +2 -0
  71. package/build/server/handler.js +2 -0
  72. package/build/server/index.js +67 -0
  73. package/build/server/manifest-full.js +58 -0
  74. package/build/server/manifest.js +58 -0
  75. package/build/server/nodes/0.js +8 -0
  76. package/build/server/nodes/1.js +8 -0
  77. package/build/server/nodes/2.js +10 -0
  78. package/build/server/remote-entry.js +1564 -0
  79. package/build/server/server.js +60 -0
  80. package/package.json +8 -8
  81. package/build/client/_app/immutable/chunks/CukLSH0w.js +0 -2
  82. package/build/client/_app/immutable/chunks/CukLSH0w.js.br +0 -0
  83. package/build/client/_app/immutable/chunks/CukLSH0w.js.gz +0 -0
  84. package/build/client/_app/immutable/chunks/Dsm7b1TR.js +0 -3
  85. package/build/client/_app/immutable/chunks/Dsm7b1TR.js.br +0 -0
  86. package/build/client/_app/immutable/chunks/Dsm7b1TR.js.gz +0 -0
  87. package/build/client/_app/immutable/chunks/xihTtKlq.js +0 -1
  88. package/build/client/_app/immutable/chunks/xihTtKlq.js.br +0 -1
  89. package/build/client/_app/immutable/chunks/xihTtKlq.js.gz +0 -0
  90. package/build/client/_app/immutable/entry/app.Hr-44d0W.js +0 -2
  91. package/build/client/_app/immutable/entry/app.Hr-44d0W.js.br +0 -0
  92. package/build/client/_app/immutable/entry/app.Hr-44d0W.js.gz +0 -0
  93. package/build/client/_app/immutable/entry/start.DGEKXdCU.js +0 -1
  94. package/build/client/_app/immutable/entry/start.DGEKXdCU.js.br +0 -0
  95. package/build/client/_app/immutable/entry/start.DGEKXdCU.js.gz +0 -0
  96. package/build/client/_app/immutable/nodes/0.PGglbI9f.js +0 -1
  97. package/build/client/_app/immutable/nodes/0.PGglbI9f.js.br +0 -0
  98. package/build/client/_app/immutable/nodes/0.PGglbI9f.js.gz +0 -0
  99. package/build/client/_app/immutable/nodes/1.MxgNrYxb.js +0 -1
  100. package/build/client/_app/immutable/nodes/1.MxgNrYxb.js.br +0 -0
  101. package/build/client/_app/immutable/nodes/1.MxgNrYxb.js.gz +0 -0
  102. package/build/client/_app/immutable/nodes/2.DOLqBxXu.js +0 -2
  103. package/build/client/_app/immutable/nodes/2.DOLqBxXu.js.br +0 -0
  104. package/build/client/_app/immutable/nodes/2.DOLqBxXu.js.gz +0 -0
  105. package/build/env.js +0 -70
  106. package/build/server/chunks/chunks/client.js-9ZtqvVP6.js +0 -28
  107. package/build/server/chunks/chunks/env.js-l0sNRNKZ.js +0 -2
  108. package/build/server/chunks/chunks/exports.js-Bbyr-JtB.js +0 -349
  109. package/build/server/chunks/chunks/internal.js-WGl35QnN.js +0 -1202
  110. package/build/server/chunks/chunks/internal2.js-BlXt2rfE.js +0 -22
  111. package/build/server/chunks/chunks/server.js-UOanU7fq.js +0 -5527
  112. package/build/server/chunks/chunks/shared.js-Dg3Ewm8t.js +0 -255
  113. package/build/server/chunks/chunks/utils.js-DUDFXVFd.js +0 -1049
  114. package/build/server/chunks/entries/endpoints/api/refresh/_server.ts.js-CcG44vTx.js +0 -21
  115. package/build/server/chunks/entries/endpoints/api/settings/_server.ts.js-B0LWCQis.js +0 -24
  116. package/build/server/chunks/entries/endpoints/api/usage/_server.ts.js-CJGTdjik.js +0 -17
  117. package/build/server/chunks/entries/fallbacks/error.svelte.js-D7UgI0q0.js +0 -68
  118. package/build/server/chunks/entries/hooks.server.js-_Fcw_IVA.js +0 -16
  119. package/build/server/chunks/entries/pages/_page.server.ts.js-BBibcAZP.js +0 -17
  120. package/build/server/chunks/handler-TvIKu86j.js +0 -1475
  121. package/build/server/chunks/index.js-C3LwYUKO.js +0 -3972
  122. package/build/server/chunks/manifest.js-CZoz0xLc.js +0 -63
  123. package/build/server/chunks/nodes/0.js-7EReDAeT.js +0 -9
  124. package/build/server/chunks/nodes/1.js-BcW8BjKg.js +0 -9
  125. package/build/server/chunks/nodes/2.js-fS9KDy-5.js +0 -20
  126. package/build/shims.js +0 -33
@@ -0,0 +1,16 @@
1
+ import { n as noop, t as disallow_on_server } from "./functions.js";
2
+ //#region node_modules/@sveltejs/kit/src/runtime/app/navigation/server.js
3
+ var afterNavigate = noop;
4
+ disallow_on_server("disableScrollHandling", "()");
5
+ disallow_on_server("goto");
6
+ disallow_on_server("invalidate");
7
+ disallow_on_server("invalidateAll", "()");
8
+ disallow_on_server("refreshAll", "()");
9
+ disallow_on_server("preloadCode");
10
+ disallow_on_server("preloadData");
11
+ disallow_on_server("pushState");
12
+ disallow_on_server("replaceState");
13
+ //#endregion
14
+ export { afterNavigate as t };
15
+
16
+ //# sourceMappingURL=navigation.js.map
@@ -1,10 +1,9 @@
1
- import { T as THEMES, t as totalOf, c as costOf } from './range.js-CiCoLGqh.js';
2
- import { readFile, readdir, stat } from 'node:fs/promises';
3
- import { dirname, join, basename } from 'node:path';
4
- import { DatabaseSync } from 'node:sqlite';
5
- import { mkdirSync } from 'node:fs';
6
- import { homedir } from 'node:os';
7
-
1
+ import { a as costOf, o as totalOf, s as THEMES } from "./range.js";
2
+ import { readFile, readdir, stat } from "node:fs/promises";
3
+ import { basename, dirname, join } from "node:path";
4
+ import { DatabaseSync } from "node:sqlite";
5
+ import { mkdirSync } from "node:fs";
6
+ import { homedir } from "node:os";
8
7
  //#region src/lib/server/config.ts
9
8
  var home = homedir();
10
9
  var env = (name, fallback) => (process.env[name] || "").trim() || fallback;
@@ -724,6 +723,7 @@ function rollup(filters) {
724
723
  problems: problems()
725
724
  };
726
725
  }
726
+ //#endregion
727
+ export { scan as a, resolve as c, settings as i, db as l, usage as n, describe as o, saveSettings as r, report as s, clearUsageMemo as t, config as u };
727
728
 
728
- export { scan as a, db as b, resolve as c, describe as d, config as e, saveSettings as f, clearUsageMemo as g, report as r, settings as s, usage as u };
729
- //# sourceMappingURL=queries.js-BEdRnpMa.js.map
729
+ //# sourceMappingURL=queries.js.map
@@ -152,6 +152,7 @@ function resolveRange(id, now = Date.now()) {
152
152
  range: range.id
153
153
  };
154
154
  }
155
+ //#endregion
156
+ export { costOf as a, RATES as i, rangeLabel as n, totalOf as o, resolveRange as r, THEMES as s, RANGES as t };
155
157
 
156
- export { RANGES as R, THEMES as T, rangeLabel as a, RATES as b, costOf as c, resolveRange as r, totalOf as t };
157
- //# sourceMappingURL=range.js-CiCoLGqh.js.map
158
+ //# sourceMappingURL=range.js.map
@@ -1,8 +1,7 @@
1
- import { s as settings, a as scan, r as report, d as describe, b as db, c as resolve, u as usage, e as config } from './queries.js-BEdRnpMa.js';
2
- import { r as resolveRange } from './range.js-CiCoLGqh.js';
3
- import { readFile } from 'node:fs/promises';
4
- import { join } from 'node:path';
5
-
1
+ import { a as scan, c as resolve, i as settings, l as db, n as usage, o as describe, s as report, u as config } from "./queries.js";
2
+ import { r as resolveRange } from "./range.js";
3
+ import { readFile } from "node:fs/promises";
4
+ import { join } from "node:path";
6
5
  //#region src/lib/server/windows.ts
7
6
  var ENDPOINT = "https://api.anthropic.com/api/oauth/usage";
8
7
  var LABELS = {
@@ -102,6 +101,7 @@ function boot() {
102
101
  timer.unref?.();
103
102
  refresh();
104
103
  }
104
+ //#endregion
105
+ export { refresh as n, boot as t };
105
106
 
106
- export { boot as b, refresh as r };
107
- //# sourceMappingURL=refresh.js-0W7-GwaH.js.map
107
+ //# sourceMappingURL=refresh.js.map
@@ -1,6 +1,5 @@
1
- import { s as settings } from './queries.js-BEdRnpMa.js';
2
- import { r as resolveRange } from './range.js-CiCoLGqh.js';
3
-
1
+ import { i as settings } from "./queries.js";
2
+ import { r as resolveRange } from "./range.js";
4
3
  //#region src/lib/server/request.ts
5
4
  function filtersFrom(url) {
6
5
  const id = url.searchParams.get("range") || settings().range;
@@ -15,6 +14,7 @@ function filtersFrom(url) {
15
14
  projects: list("projects")
16
15
  };
17
16
  }
17
+ //#endregion
18
+ export { filtersFrom as t };
18
19
 
19
- export { filtersFrom as f };
20
- //# sourceMappingURL=request.js-BF7n7fZo.js.map
20
+ //# sourceMappingURL=request.js.map
@@ -0,0 +1,489 @@
1
+ //#region node_modules/@sveltejs/kit/src/messages/internal/server.js
2
+ /**
3
+ * @typedef {{ cause?: unknown; stackless?: boolean }} ServerThrowOptions
4
+ */
5
+ /**
6
+ * Throws the full diagnostic. Unlike shared errors, server-only errors keep their full text in production
7
+ * @param {string} code
8
+ * @param {string} message
9
+ * @param {ServerThrowOptions | undefined} options
10
+ * @param {Function} caller The generated helper, which is omitted from the stack along with this function
11
+ * @returns {never}
12
+ */
13
+ function throw_error(code, message, options, caller) {
14
+ const error = new Error(`${code}\n${message}\nhttps://svelte.dev/e/kit/${code}`, options?.cause === void 0 ? void 0 : { cause: options.cause });
15
+ error.name = "SvelteKit error";
16
+ if (options?.stackless) error.stack = "";
17
+ else Error.captureStackTrace?.(error, caller);
18
+ throw error;
19
+ }
20
+ /**
21
+ * Returns the error thrown by `fn`, for the few places that pass an error on (for example to
22
+ * `handleError` or a later `console.error`) rather than throwing it. Its stack starts inside `fn`
23
+ * @param {() => never} fn A function that calls a generated `server-errors` helper
24
+ * @returns {Error}
25
+ */
26
+ function capture_error(fn) {
27
+ try {
28
+ fn();
29
+ } catch (error) {
30
+ return error;
31
+ }
32
+ }
33
+ //#endregion
34
+ //#region node_modules/@sveltejs/kit/src/messages/server-errors.js
35
+ /** @import { ServerThrowOptions } from './internal/server.js' */
36
+ /**
37
+ * Data returned from action inside `%id%` is not serializable: %message%
38
+ * @param {{ "id": string; "message": string; "path"?: string }} _values
39
+ * @param {ServerThrowOptions} [options]
40
+ * @returns {never}
41
+ */
42
+ function action_data_not_serializable(_values, options) {
43
+ throw_error("action_data_not_serializable", _values?.path !== void 0 ? `Data returned from action inside \`${_values.id}\` is not serializable: ${_values.message} (\`${_values.path}\`)` : `Data returned from action inside \`${_values.id}\` is not serializable: ${_values.message}`, options, action_data_not_serializable);
44
+ }
45
+ /**
46
+ * When using named actions, the default action cannot be used. See the docs for more info: https://svelte.dev/docs/kit/form-actions#Named-actions
47
+ * @param {void} _values
48
+ * @param {ServerThrowOptions} [options]
49
+ * @returns {never}
50
+ */
51
+ function action_default_with_named(_values, options) {
52
+ throw_error("action_default_with_named", `When using named actions, the default action cannot be used. See the docs for more info: https://svelte.dev/docs/kit/form-actions#Named-actions`, options, action_default_with_named);
53
+ }
54
+ /**
55
+ * Cannot use reserved action name `default`
56
+ * @param {void} _values
57
+ * @param {ServerThrowOptions} [options]
58
+ * @returns {never}
59
+ */
60
+ function action_name_reserved(_values, options) {
61
+ throw_error("action_name_reserved", `Cannot use reserved action name \`default\``, options, action_name_reserved);
62
+ }
63
+ /**
64
+ * Data returned from action inside `%id%` is not serializable. Form actions need to return plain objects or `fail()`. E.g. `return { success: true }` or `return fail(400, { message: "invalid" });`
65
+ * @param {{ "id": string }} _values
66
+ * @param {ServerThrowOptions} [options]
67
+ * @returns {never}
68
+ */
69
+ function action_response_not_serializable(_values, options) {
70
+ throw_error("action_response_not_serializable", `Data returned from action inside \`${_values.id}\` is not serializable. Form actions need to return plain objects or \`fail()\`. E.g. \`return { success: true }\` or \`return fail(400, { message: "invalid" });\``, options, action_response_not_serializable);
71
+ }
72
+ /**
73
+ * Cannot `return error(...)` — use `error(...)` or `return fail(...)` instead
74
+ * @param {void} _values
75
+ * @param {ServerThrowOptions} [options]
76
+ * @returns {never}
77
+ */
78
+ function action_return_error(_values, options) {
79
+ throw_error("action_return_error", `Cannot \`return error(...)\` — use \`error(...)\` or \`return fail(...)\` instead`, options, action_return_error);
80
+ }
81
+ /**
82
+ * Cannot `return redirect(...)` — use `redirect(...)` instead
83
+ * @param {void} _values
84
+ * @param {ServerThrowOptions} [options]
85
+ * @returns {never}
86
+ */
87
+ function action_return_redirect(_values, options) {
88
+ throw_error("action_return_redirect", `Cannot \`return redirect(...)\` — use \`redirect(...)\` instead`, options, action_return_redirect);
89
+ }
90
+ /**
91
+ * Cannot `throw fail()`. Use `return fail()`
92
+ * @param {void} _values
93
+ * @param {ServerThrowOptions} [options]
94
+ * @returns {never}
95
+ */
96
+ function action_throw_fail(_values, options) {
97
+ throw_error("action_throw_fail", `Cannot \`throw fail()\`. Use \`return fail()\``, options, action_throw_fail);
98
+ }
99
+ /**
100
+ * `%adapter%` does not specify `getClientAddress`. Please raise an issue
101
+ * @param {{ "adapter": string }} _values
102
+ * @param {ServerThrowOptions} [options]
103
+ * @returns {never}
104
+ */
105
+ function client_address_unsupported(_values, options) {
106
+ throw_error("client_address_unsupported", `\`${_values.adapter}\` does not specify \`getClientAddress\`. Please raise an issue`, options, client_address_unsupported);
107
+ }
108
+ /**
109
+ * Cookie `%name%` is too large, and will be discarded by the browser
110
+ * @param {{ "name": string }} _values
111
+ * @param {ServerThrowOptions} [options]
112
+ * @returns {never}
113
+ */
114
+ function cookie_too_large(_values, options) {
115
+ throw_error("cookie_too_large", `Cookie \`${_values.name}\` is too large, and will be discarded by the browser`, options, cookie_too_large);
116
+ }
117
+ /**
118
+ * Cannot serialize cookies until after the route is determined
119
+ * @param {void} _values
120
+ * @param {ServerThrowOptions} [options]
121
+ * @returns {never}
122
+ */
123
+ function cookies_serialize_before_route(_values, options) {
124
+ throw_error("cookies_serialize_before_route", `Cannot serialize cookies until after the route is determined`, options, cookies_serialize_before_route);
125
+ }
126
+ /**
127
+ * Cannot use `cookies.set(...)` after the response has been generated
128
+ * @param {void} _values
129
+ * @param {ServerThrowOptions} [options]
130
+ * @returns {never}
131
+ */
132
+ function cookies_set_after_response(_values, options) {
133
+ throw_error("cookies_set_after_response", `Cannot use \`cookies.set(...)\` after the response has been generated`, options, cookies_set_after_response);
134
+ }
135
+ /**
136
+ * `content-security-policy-report-only` must be specified with either the `report-to` or `report-uri` directives, or both
137
+ * @param {void} _values
138
+ * @param {ServerThrowOptions} [options]
139
+ * @returns {never}
140
+ */
141
+ function csp_report_only_missing_report(_values, options) {
142
+ throw_error("csp_report_only_missing_report", `\`content-security-policy-report-only\` must be specified with either the \`report-to\` or \`report-uri\` directives, or both`, options, csp_report_only_missing_report);
143
+ }
144
+ /**
145
+ * Invalid response from route `%path%`: handler should return a `Response` object
146
+ * @param {{ "path": string }} _values
147
+ * @param {ServerThrowOptions} [options]
148
+ * @returns {never}
149
+ */
150
+ function endpoint_invalid_response(_values, options) {
151
+ throw_error("endpoint_invalid_response", `Invalid response from route \`${_values.path}\`: handler should return a \`Response\` object`, options, endpoint_invalid_response);
152
+ }
153
+ /**
154
+ * Cannot return `fetch(...)` directly from a handler if the response has a `Content-Encoding: %encoding%` header. The body has already been decoded
155
+ * @param {{ "encoding": string }} _values
156
+ * @param {ServerThrowOptions} [options]
157
+ * @returns {never}
158
+ */
159
+ function fetch_response_decoded(_values, options) {
160
+ throw_error("fetch_response_decoded", `Cannot return \`fetch(...)\` directly from a handler if the response has a \`Content-Encoding: ${_values.encoding}\` header. The body has already been decoded`, options, fetch_response_decoded);
161
+ }
162
+ /**
163
+ * The `handleError` hook failed
164
+ * @param {void} _values
165
+ * @param {ServerThrowOptions} [options]
166
+ * @returns {never}
167
+ */
168
+ function handle_error_hook_failed(_values, options) {
169
+ throw_error("handle_error_hook_failed", `The \`handleError\` hook failed`, options, handle_error_hook_failed);
170
+ }
171
+ /**
172
+ * `%name%` header is already set
173
+ * @param {{ "name": string }} _values
174
+ * @param {ServerThrowOptions} [options]
175
+ * @returns {never}
176
+ */
177
+ function header_already_set(_values, options) {
178
+ throw_error("header_already_set", `\`${_values.name}\` header is already set`, options, header_already_set);
179
+ }
180
+ /**
181
+ * CORS error: %reason% `Access-Control-Allow-Origin` header is present on the requested resource
182
+ * @param {{ "reason": string }} _values
183
+ * @param {ServerThrowOptions} [options]
184
+ * @returns {never}
185
+ */
186
+ function load_fetch_cors(_values, options) {
187
+ throw_error("load_fetch_cors", `CORS error: ${_values.reason} \`Access-Control-Allow-Origin\` header is present on the requested resource`, options, load_fetch_cors);
188
+ }
189
+ /**
190
+ * Data returned from `load` while rendering `%id%` is not a plain object
191
+ * @param {{ "id": string }} _values
192
+ * @param {ServerThrowOptions} [options]
193
+ * @returns {never}
194
+ */
195
+ function load_not_plain_object(_values, options) {
196
+ throw_error("load_not_plain_object", `Data returned from \`load\` while rendering \`${_values.id}\` is not a plain object`, options, load_not_plain_object);
197
+ }
198
+ /**
199
+ * Data returned from `load` while rendering `%id%` is not serializable: %message% (`%path%`). If you need to serialize/deserialize custom types, use transport hooks: https://svelte.dev/docs/kit/hooks#transport.
200
+ * @param {{ "id": string; "message": string; "path": string }} _values
201
+ * @param {ServerThrowOptions} [options]
202
+ * @returns {never}
203
+ */
204
+ function load_not_serializable(_values, options) {
205
+ throw_error("load_not_serializable", `Data returned from \`load\` while rendering \`${_values.id}\` is not serializable: ${_values.message} (\`${_values.path}\`). If you need to serialize/deserialize custom types, use transport hooks: https://svelte.dev/docs/kit/hooks#transport.`, options, load_not_serializable);
206
+ }
207
+ /**
208
+ * Failed to serialize promise while rendering `%id%`
209
+ * @param {{ "id": string }} _values
210
+ * @param {ServerThrowOptions} [options]
211
+ * @returns {never}
212
+ */
213
+ function load_promise_not_serializable(_values, options) {
214
+ throw_error("load_promise_not_serializable", `Failed to serialize promise while rendering \`${_values.id}\``, options, load_promise_not_serializable);
215
+ }
216
+ /**
217
+ * Failed to get response header `%name%` — it must be included by the `filterSerializedResponseHeaders` option: https://svelte.dev/docs/kit/hooks#handle (at `%id%`)
218
+ * @param {{ "name": string; "id": string }} _values
219
+ * @param {ServerThrowOptions} [options]
220
+ * @returns {never}
221
+ */
222
+ function load_response_header_not_serialized(_values, options) {
223
+ throw_error("load_response_header_not_serialized", `Failed to get response header \`${_values.name}\` — it must be included by the \`filterSerializedResponseHeaders\` option: https://svelte.dev/docs/kit/hooks#handle (at \`${_values.id}\`)`, options, load_response_header_not_serialized);
224
+ }
225
+ /**
226
+ * Cannot prerender pages with actions
227
+ * @param {void} _values
228
+ * @param {ServerThrowOptions} [options]
229
+ * @returns {never}
230
+ */
231
+ function prerender_actions(_values, options) {
232
+ throw_error("prerender_actions", `Cannot prerender pages with actions`, options, prerender_actions);
233
+ }
234
+ /**
235
+ * Cannot prerender a `+server` file with %methods% or fallback handlers (`%id%`)
236
+ * @param {{ "methods": string; "id": string }} _values
237
+ * @param {ServerThrowOptions} [options]
238
+ * @returns {never}
239
+ */
240
+ function prerender_endpoint_methods(_values, options) {
241
+ throw_error("prerender_endpoint_methods", `Cannot prerender a \`+server\` file with ${_values.methods} or fallback handlers (\`${_values.id}\`)`, options, prerender_endpoint_methods);
242
+ }
243
+ /**
244
+ * `%id%` is not prerenderable
245
+ * @param {{ "id": string }} _values
246
+ * @param {ServerThrowOptions} [options]
247
+ * @returns {never}
248
+ */
249
+ function prerender_endpoint_not_prerenderable(_values, options) {
250
+ throw_error("prerender_endpoint_not_prerenderable", `\`${_values.id}\` is not prerenderable`, options, prerender_endpoint_not_prerenderable);
251
+ }
252
+ /**
253
+ * Cannot use prerendering if `config.csp.mode === 'nonce'`
254
+ * @param {void} _values
255
+ * @param {ServerThrowOptions} [options]
256
+ * @returns {never}
257
+ */
258
+ function prerender_nonce(_values, options) {
259
+ throw_error("prerender_nonce", `Cannot use prerendering if \`config.csp.mode === 'nonce'\``, options, prerender_nonce);
260
+ }
261
+ /**
262
+ * Cannot use prerendering if page template contains `%tag%`
263
+ * @param {{ "tag": string }} _values
264
+ * @param {ServerThrowOptions} [options]
265
+ * @returns {never}
266
+ */
267
+ function prerender_template_nonce(_values, options) {
268
+ throw_error("prerender_template_nonce", `Cannot use prerendering if page template contains \`${_values.tag}\``, options, prerender_template_nonce);
269
+ }
270
+ /**
271
+ * Cannot call a command (`%name%`) from a `%method%` handler
272
+ * @param {{ "name": string; "method": string }} _values
273
+ * @param {ServerThrowOptions} [options]
274
+ * @returns {never}
275
+ */
276
+ function remote_command_method(_values, options) {
277
+ throw_error("remote_command_method", `Cannot call a command (\`${_values.name}\`) from a \`${_values.method}\` handler`, options, remote_command_method);
278
+ }
279
+ /**
280
+ * Cannot call a command (`%name%`) inside a query or prerender function
281
+ * @param {{ "name": string }} _values
282
+ * @param {ServerThrowOptions} [options]
283
+ * @returns {never}
284
+ */
285
+ function remote_command_readonly(_values, options) {
286
+ throw_error("remote_command_readonly", `Cannot call a command (\`${_values.name}\`) inside a query or prerender function`, options, remote_command_readonly);
287
+ }
288
+ /**
289
+ * Cannot call a command (`%name%`) during server-side rendering
290
+ * @param {{ "name": string }} _values
291
+ * @param {ServerThrowOptions} [options]
292
+ * @returns {never}
293
+ */
294
+ function remote_command_render(_values, options) {
295
+ throw_error("remote_command_render", `Cannot call a command (\`${_values.name}\`) during server-side rendering`, options, remote_command_render);
296
+ }
297
+ /**
298
+ * Cannot %operation% cookies in `query` or `prerender` functions
299
+ * @param {{ "operation": string }} _values
300
+ * @param {ServerThrowOptions} [options]
301
+ * @returns {never}
302
+ */
303
+ function remote_cookie_forbidden(_values, options) {
304
+ throw_error("remote_cookie_forbidden", `Cannot ${_values.operation} cookies in \`query\` or \`prerender\` functions`, options, remote_cookie_forbidden);
305
+ }
306
+ /**
307
+ * Cookies %operation% in remote functions must have an absolute path
308
+ * @param {{ "operation": string }} _values
309
+ * @param {ServerThrowOptions} [options]
310
+ * @returns {never}
311
+ */
312
+ function remote_cookie_path_relative(_values, options) {
313
+ throw_error("remote_cookie_path_relative", `Cookies ${_values.operation} in remote functions must have an absolute path`, options, remote_cookie_path_relative);
314
+ }
315
+ /**
316
+ * `fail(...)` is for form actions. A remote `form` handler should call `invalid(...)` instead. See https://svelte.dev/docs/kit/remote-functions#form-Programmatic-validation
317
+ * @param {void} _values
318
+ * @param {ServerThrowOptions} [options]
319
+ * @returns {never}
320
+ */
321
+ function remote_form_fail(_values, options) {
322
+ throw_error("remote_form_fail", `\`fail(...)\` is for form actions. A remote \`form\` handler should call \`invalid(...)\` instead. See https://svelte.dev/docs/kit/remote-functions#form-Programmatic-validation`, options, remote_form_fail);
323
+ }
324
+ /**
325
+ * `setHeaders` is not allowed in remote functions
326
+ * @param {void} _values
327
+ * @param {ServerThrowOptions} [options]
328
+ * @returns {never}
329
+ */
330
+ function remote_headers_forbidden(_values, options) {
331
+ throw_error("remote_headers_forbidden", `\`setHeaders\` is not allowed in remote functions`, options, remote_headers_forbidden);
332
+ }
333
+ /**
334
+ * Invalid validator passed to remote function. Expected `'unchecked'` or a Standard Schema (https://standardschema.dev)
335
+ * @param {void} _values
336
+ * @param {ServerThrowOptions} [options]
337
+ * @returns {never}
338
+ */
339
+ function remote_invalid_validator(_values, options) {
340
+ throw_error("remote_invalid_validator", `Invalid validator passed to remote function. Expected \`'unchecked'\` or a Standard Schema (https://standardschema.dev)`, options, remote_invalid_validator);
341
+ }
342
+ /**
343
+ * `query.live` `%name%` did not yield a value
344
+ * @param {{ "name": string }} _values
345
+ * @param {ServerThrowOptions} [options]
346
+ * @returns {never}
347
+ */
348
+ function remote_query_live_no_value(_values, options) {
349
+ throw_error("remote_query_live_no_value", `\`query.live\` \`${_values.name}\` did not yield a value`, options, remote_query_live_no_value);
350
+ }
351
+ /**
352
+ * `query.live` `%name%` must return an `Iterator`, `Iterable`, `AsyncIterator` or `AsyncIterable`
353
+ * @param {{ "name": string }} _values
354
+ * @param {ServerThrowOptions} [options]
355
+ * @returns {never}
356
+ */
357
+ function remote_query_live_not_iterable(_values, options) {
358
+ throw_error("remote_query_live_not_iterable", `\`query.live\` \`${_values.name}\` must return an \`Iterator\`, \`Iterable\`, \`AsyncIterator\` or \`AsyncIterable\``, options, remote_query_live_not_iterable);
359
+ }
360
+ /**
361
+ * Cannot call `%type%` `%name%` while prerendering, as prerendered pages need static data. Use `prerender` from `$app/server` instead
362
+ * @param {{ "type": string; "name": string }} _values
363
+ * @param {ServerThrowOptions} [options]
364
+ * @returns {never}
365
+ */
366
+ function remote_query_prerender(_values, options) {
367
+ throw_error("remote_query_prerender", `Cannot call \`${_values.type}\` \`${_values.name}\` while prerendering, as prerendered pages need static data. Use \`prerender\` from \`$app/server\` instead`, options, remote_query_prerender);
368
+ }
369
+ /**
370
+ * Cannot access `event.%property%` in a query. Pass the value as an argument to the query instead
371
+ * @param {{ "property": string }} _values
372
+ * @param {ServerThrowOptions} [options]
373
+ * @returns {never}
374
+ */
375
+ function remote_request_property(_values, options) {
376
+ throw_error("remote_request_property", `Cannot access \`event.${_values.property}\` in a query. Pass the value as an argument to the query instead`, options, remote_request_property);
377
+ }
378
+ /**
379
+ * `requested(%name%, %limit%)` cannot be used with synchronous iteration because the query validator is async. Use `for await ... of` instead
380
+ * @param {{ "name": string; "limit": string }} _values
381
+ * @param {ServerThrowOptions} [options]
382
+ * @returns {never}
383
+ */
384
+ function remote_requested_async_validator(_values, options) {
385
+ throw_error("remote_requested_async_validator", `\`requested(${_values.name}, ${_values.limit})\` cannot be used with synchronous iteration because the query validator is async. Use \`for await ... of\` instead`, options, remote_requested_async_validator);
386
+ }
387
+ /**
388
+ * `requested(...)` can only be called in the context of a command/form remote function
389
+ * @param {void} _values
390
+ * @param {ServerThrowOptions} [options]
391
+ * @returns {never}
392
+ */
393
+ function remote_requested_context(_values, options) {
394
+ throw_error("remote_requested_context", `\`requested(...)\` can only be called in the context of a command/form remote function`, options, remote_requested_context);
395
+ }
396
+ /**
397
+ * Limit must be a non-negative integer or `Infinity`
398
+ * @param {void} _values
399
+ * @param {ServerThrowOptions} [options]
400
+ * @returns {never}
401
+ */
402
+ function remote_requested_invalid_limit(_values, options) {
403
+ throw_error("remote_requested_invalid_limit", `Limit must be a non-negative integer or \`Infinity\``, options, remote_requested_invalid_limit);
404
+ }
405
+ /**
406
+ * `requested(...)` expects a query function created with `query(...)`, `query.batch(...)`, or `query.live(...)`
407
+ * @param {void} _values
408
+ * @param {ServerThrowOptions} [options]
409
+ * @returns {never}
410
+ */
411
+ function remote_requested_invalid_query(_values, options) {
412
+ throw_error("remote_requested_invalid_query", `\`requested(...)\` expects a query function created with \`query(...)\`, \`query.batch(...)\`, or \`query.live(...)\``, options, remote_requested_invalid_query);
413
+ }
414
+ /**
415
+ * `%method%()` is invalid for %type% queries. Use `%replacement%()` instead.
416
+ * @param {{ "method": string; "type": string; "replacement": string }} _values
417
+ * @param {ServerThrowOptions} [options]
418
+ * @returns {never}
419
+ */
420
+ function remote_requested_wrong_method(_values, options) {
421
+ throw_error("remote_requested_wrong_method", `\`${_values.method}()\` is invalid for ${_values.type} queries. Use \`${_values.replacement}()\` instead.`, options, remote_requested_wrong_method);
422
+ }
423
+ /**
424
+ * Could not get the request store. In environments without `AsyncLocalStorage`, the request store (used by e.g. remote functions) must be accessed synchronously, not after an `await`. If it was accessed synchronously then this is an internal error.
425
+ * @param {void} _values
426
+ * @param {ServerThrowOptions} [options]
427
+ * @returns {never}
428
+ */
429
+ function request_store_after_await(_values, options) {
430
+ throw_error("request_store_after_await", `Could not get the request store. In environments without \`AsyncLocalStorage\`, the request store (used by e.g. remote functions) must be accessed synchronously, not after an \`await\`. If it was accessed synchronously then this is an internal error.`, options, request_store_after_await);
431
+ }
432
+ /**
433
+ * Cannot call `%name%` on the server
434
+ * @param {{ "name": string }} _values
435
+ * @param {ServerThrowOptions} [options]
436
+ * @returns {never}
437
+ */
438
+ function server_api_unavailable(_values, options) {
439
+ throw_error("server_api_unavailable", `Cannot call \`${_values.name}\` on the server`, options, server_api_unavailable);
440
+ }
441
+ /**
442
+ * Cannot use `setHeaders(...)` after the response has been generated
443
+ * @param {void} _values
444
+ * @param {ServerThrowOptions} [options]
445
+ * @returns {never}
446
+ */
447
+ function set_headers_after_response(_values, options) {
448
+ throw_error("set_headers_after_response", `Cannot use \`setHeaders(...)\` after the response has been generated`, options, set_headers_after_response);
449
+ }
450
+ /**
451
+ * Use `event.cookies.set(name, value, options)` instead of `event.setHeaders` to set cookies
452
+ * @param {void} _values
453
+ * @param {ServerThrowOptions} [options]
454
+ * @returns {never}
455
+ */
456
+ function set_headers_cookie(_values, options) {
457
+ throw_error("set_headers_cookie", `Use \`event.cookies.set(name, value, options)\` instead of \`event.setHeaders\` to set cookies`, options, set_headers_cookie);
458
+ }
459
+ /**
460
+ * Cannot call `fetch` eagerly during server-side rendering with relative URL (`%url%`) — put your `fetch` calls inside `onMount` or a `load` function instead
461
+ * @param {{ "url": string }} _values
462
+ * @param {ServerThrowOptions} [options]
463
+ * @returns {never}
464
+ */
465
+ function ssr_fetch_relative_url(_values, options) {
466
+ throw_error("ssr_fetch_relative_url", `Cannot call \`fetch\` eagerly during server-side rendering with relative URL (\`${_values.url}\`) — put your \`fetch\` calls inside \`onMount\` or a \`load\` function instead`, options, ssr_fetch_relative_url);
467
+ }
468
+ /**
469
+ * Can only read `%name%` on the server during rendering (not in e.g. `load` functions), as it is bound to the current request via component context. This prevents state from leaking between users.
470
+ * @param {{ "name": string }} _values
471
+ * @param {ServerThrowOptions} [options]
472
+ * @returns {never}
473
+ */
474
+ function state_read_outside_render(_values, options) {
475
+ throw_error("state_read_outside_render", `Can only read \`${_values.name}\` on the server during rendering (not in e.g. \`load\` functions), as it is bound to the current request via component context. This prevents state from leaking between users.`, options, state_read_outside_render);
476
+ }
477
+ /**
478
+ * Cannot access `url.%property%` on a page with prerendering enabled
479
+ * @param {{ "property": string }} _values
480
+ * @param {ServerThrowOptions} [options]
481
+ * @returns {never}
482
+ */
483
+ function url_search_unavailable_prerender(_values, options) {
484
+ throw_error("url_search_unavailable_prerender", `Cannot access \`url.${_values.property}\` on a page with prerendering enabled`, options, url_search_unavailable_prerender);
485
+ }
486
+ //#endregion
487
+ export { remote_cookie_forbidden as A, remote_requested_context as B, prerender_endpoint_methods as C, remote_command_method as D, prerender_template_nonce as E, remote_query_live_no_value as F, server_api_unavailable as G, remote_requested_invalid_query as H, remote_query_live_not_iterable as I, ssr_fetch_relative_url as J, set_headers_after_response as K, remote_query_prerender as L, remote_form_fail as M, remote_headers_forbidden as N, remote_command_readonly as O, remote_invalid_validator as P, remote_request_property as R, prerender_actions as S, prerender_nonce as T, remote_requested_wrong_method as U, remote_requested_invalid_limit as V, request_store_after_await as W, url_search_unavailable_prerender as X, state_read_outside_render as Y, capture_error as Z, load_fetch_cors as _, action_return_error as a, load_promise_not_serializable as b, client_address_unsupported as c, cookies_set_after_response as d, csp_report_only_missing_report as f, header_already_set as g, handle_error_hook_failed as h, action_response_not_serializable as i, remote_cookie_path_relative as j, remote_command_render as k, cookie_too_large as l, fetch_response_decoded as m, action_default_with_named as n, action_return_redirect as o, endpoint_invalid_response as p, set_headers_cookie as q, action_name_reserved as r, action_throw_fail as s, action_data_not_serializable as t, cookies_serialize_before_route as u, load_not_plain_object as v, prerender_endpoint_not_prerenderable as w, load_response_header_not_serialized as x, load_not_serializable as y, remote_requested_async_validator as z };
488
+
489
+ //# sourceMappingURL=server-errors.js.map
@@ -0,0 +1,9 @@
1
+ var prerendering = false;
2
+ function set_building() {}
3
+ function set_prerendering() {
4
+ prerendering = true;
5
+ }
6
+ //#endregion
7
+ export { set_building as n, set_prerendering as r, prerendering as t };
8
+
9
+ //# sourceMappingURL=server.js.map