@juliantanx/aiusage 1.0.4 → 1.0.5

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.
package/README.md ADDED
@@ -0,0 +1,393 @@
1
+ # aiusage
2
+
3
+ Track AI coding assistant usage, token consumption, cost, and tool calls in one place across Claude Code, Codex, OpenClaw, and OpenCode.
4
+
5
+ English | [中文](./README_zh.md)
6
+
7
+ ## Why aiusage
8
+
9
+ - Aggregate local session logs from multiple AI coding assistants into one view.
10
+ - Analyze token usage, cost, model mix, and tool call activity.
11
+ - Explore the data through a local dashboard with overview ranges from Today to All Time.
12
+ - Sync usage data across multiple machines with GitHub, S3, or R2.
13
+ - Keep everything local-first, with optional cloud sync when you need shared visibility.
14
+
15
+ ## Quick Start
16
+
17
+ **Prerequisites:** Node.js >= 18
18
+
19
+ ```bash
20
+ # Install
21
+ npm install -g @juliantanx/aiusage
22
+
23
+ # Parse local session logs
24
+ aiusage parse
25
+
26
+ # Start the dashboard
27
+ aiusage serve
28
+ # Open http://localhost:3847
29
+ ```
30
+
31
+ Day-to-day usage is usually just:
32
+
33
+ ```bash
34
+ aiusage parse
35
+ aiusage serve
36
+ ```
37
+
38
+ `aiusage` does not run a built-in background parser. If you want automatic imports, schedule `aiusage parse` with cron or Task Scheduler.
39
+
40
+ <details>
41
+ <summary>Build from source</summary>
42
+
43
+ ```bash
44
+ git clone https://github.com/juliantanx/aiusage.git
45
+ cd aiusage
46
+ pnpm install
47
+ pnpm build
48
+ cd packages/cli
49
+ npm link
50
+ ```
51
+
52
+ After pulling updates, rebuild to pick up changes:
53
+
54
+ ```bash
55
+ pnpm build
56
+ ```
57
+
58
+ </details>
59
+
60
+ ## Screenshot
61
+
62
+ ![This Week homepage dashboard](https://cdn.jsdelivr.net/gh/juliantanx/aiusage@main/docs/assets/readme/weekly-overview.png)
63
+
64
+ Homepage dashboard filtered to This Week, showing real local usage data across assistants.
65
+
66
+ ## Common Commands
67
+
68
+ | Command | Purpose |
69
+ | --- | --- |
70
+ | `aiusage` | Print the same terminal summary as `aiusage summary` |
71
+ | `aiusage parse` | Import newly appended local session data from discovered source paths |
72
+ | `aiusage serve` | Start the local dashboard and runtime settings controller |
73
+ | `aiusage summary` | Print a usage summary in the terminal |
74
+ | `aiusage status` | Show database path, schema version, and record counts |
75
+ | `aiusage sync` | Push and pull data with a configured remote backend |
76
+ | `aiusage export` | Export records as CSV, JSON, or NDJSON |
77
+ | `aiusage clean` | Remove old data |
78
+ | `aiusage recalc` | Recalculate costs with updated pricing |
79
+ | `aiusage init` | Configure a sync backend |
80
+
81
+ ## Web Dashboard
82
+
83
+ ```bash
84
+ aiusage serve
85
+ # Open http://localhost:3847
86
+ ```
87
+
88
+ `aiusage serve` hosts two top-level dashboard entry points:
89
+
90
+ - **Home (`/`)** — live counter homepage. On first load it calls `/api/refresh`, runs one incremental local parse, then loads summary data. After that, it refreshes on the configured dashboard poll interval.
91
+ - **Overview (`/overview`)** — totals, cost, active days, and per-tool breakdowns for Today, This Week, This Month, Last 30d, or All Time.
92
+ - **Tokens** — token usage trends over time.
93
+ - **Cost** — cost trends with by-tool and by-model breakdowns.
94
+ - **Models** — model share and distribution.
95
+ - **Tool Calls** — tool call frequency and ranking.
96
+ - **Projects** — project-level usage rollups.
97
+ - **Sessions** — session browsing with filters and pagination.
98
+ - **Pricing** — active model pricing reference.
99
+ - **Settings** — configure device name, week start day, dashboard poll interval, auto-parse interval, source paths, sync backend, credentials, and local data retention without editing config files manually.
100
+
101
+ **Settings behavior**
102
+
103
+ - **Dashboard Poll Interval** is in milliseconds and only controls the homepage refresh cycle after the initial load.
104
+ - **Auto-Parse Interval** is in milliseconds and schedules background `aiusage parse` runs only while `aiusage serve` is running. Set `0` or leave it blank to disable it.
105
+ - **Local Data Retention** runs periodic cleanup only while `aiusage serve` is running. Set `0` or leave it blank to keep data forever.
106
+ - **Source path** changes take effect on the next parse.
107
+ - **Sync backend and credential** changes take effect on the next sync.
108
+
109
+ ---
110
+
111
+ ## Deployment
112
+
113
+ Need multi-machine aggregation or cloud access? Choose your scenario:
114
+
115
+ | Scenario | Method | Description |
116
+ |----------|--------|-------------|
117
+ | Multiple machines, aggregate data | [Multi-Machine Sync](#multi-machine-sync) | Sync via GitHub/S3/R2 |
118
+ | Multiple machines + unified dashboard | [Docker Deployment](#docker-deployment) | Run a 24/7 dashboard from synced data |
119
+
120
+ For single-machine usage, Quick Start is enough.
121
+
122
+ ### Multi-Machine Sync
123
+
124
+ Use this to aggregate token usage from multiple machines into one dashboard. Works with Claude Code, Codex, OpenClaw, and OpenCode.
125
+
126
+ **Architecture:**
127
+
128
+ ```
129
+ Machine A ──┐
130
+ Machine B ──┼──▶ GitHub / S3 / R2 (shared storage) ──▶ Any machine: aiusage summary / serve
131
+ Machine C ──┘
132
+ ```
133
+
134
+ **Step 1 — Choose a sync backend**
135
+
136
+ **Option A: GitHub (recommended)**
137
+
138
+ 1. Create a **private** repository on GitHub (for example `aiusage-data`)
139
+ 2. Generate a [Personal Access Token](https://github.com/settings/tokens) with `repo` scope
140
+
141
+ **Option B: AWS S3 / Cloudflare R2**
142
+
143
+ 1. Create an S3 or R2 bucket
144
+ 2. Create an IAM user or role with read/write permissions
145
+ 3. Note the access key ID, secret access key, and endpoint
146
+
147
+ **Step 2 — Install and configure on each machine**
148
+
149
+ On every machine that uses Claude Code, Codex, OpenClaw, or OpenCode:
150
+
151
+ ```bash
152
+ # Install aiusage CLI
153
+ npm install -g @juliantanx/aiusage
154
+
155
+ # Configure sync backend — GitHub
156
+ aiusage init --backend github \
157
+ --repo <user>/aiusage-data \
158
+ --token ghp_xxxxxxxxxxxxxxxxxxxx
159
+
160
+ # OR configure sync backend — S3 / R2
161
+ aiusage init --backend s3 \
162
+ --bucket my-aiusage-bucket \
163
+ --prefix aiusage/ \
164
+ --endpoint https://<account-id>.r2.cloudflarestorage.com \
165
+ --region auto \
166
+ --access-key-id AKIAxxxxxxxxxxxx \
167
+ --secret-access-key xxxxxxxxxxxxxxxxxxxxxxxxxx
168
+ ```
169
+
170
+ **Step 3 — Parse and sync on each machine**
171
+
172
+ ```bash
173
+ aiusage parse
174
+ aiusage sync
175
+ ```
176
+
177
+ **Step 4 — View aggregated data on any machine**
178
+
179
+ ```bash
180
+ aiusage sync
181
+ aiusage summary
182
+ aiusage serve
183
+ ```
184
+
185
+ **Automate (recommended)**
186
+
187
+ ```bash
188
+ # Linux/macOS
189
+ crontab -e
190
+ # Add:
191
+ */30 * * * * /usr/local/bin/aiusage parse && /usr/local/bin/aiusage sync >> ~/.aiusage/cron.log 2>&1
192
+
193
+ # Windows
194
+ schtasks /create /tn "AiusageSync" /tr "aiusage parse && aiusage sync" /sc minute /mo 30
195
+ ```
196
+
197
+ **How sync works**
198
+
199
+ - Each machine has a unique `deviceInstanceId` generated on first run.
200
+ - Each device writes to its own daily file (`{deviceInstanceId}/YYYY/MM/DD.ndjson`) in the remote backend.
201
+ - Pull reads other devices' files into the local `synced_records` table; upload writes only this device's files.
202
+ - Device-partitioned files avoid write conflicts, so no locking is needed.
203
+ - Sync frequency comes from your external scheduler or manual runs; aiusage does not include a built-in sync daemon.
204
+ - Session IDs are anonymized via `sha256(device + sessionId)`.
205
+
206
+ ---
207
+
208
+ ### Docker Deployment
209
+
210
+ Run the pre-built image on a server for a 24/7 dashboard. The container does **not** run any AI coding tools itself — it serves the web dashboard, can run the same runtime settings controller as `aiusage serve`, and can pull synced data from GitHub, S3, or R2.
211
+
212
+ **Architecture:**
213
+
214
+ ```
215
+ Machine A ──┐ ┌── Browser: https://aiusage.your-domain.com
216
+ Machine B ──┼──▶ GitHub / S3 / R2 ──▶ Cloud Server (Docker)
217
+ Machine C ──┘ └── port 3847
218
+ ```
219
+
220
+ **How data flows**
221
+
222
+ 1. Each dev machine runs `aiusage parse && aiusage sync` to upload local usage data.
223
+ 2. The Docker container runs `aiusage sync` to pull that data into its local SQLite database.
224
+ 3. The web dashboard reads from the local database and displays aggregated stats.
225
+
226
+ **Data storage in Docker**
227
+
228
+ | Item | Container path | Description |
229
+ |------|---------------|-------------|
230
+ | Database | `/root/.aiusage/cache.db` | SQLite database with aggregated usage data |
231
+ | Config | `/root/.aiusage/config.json` | Sync backend config, runtime settings, and credentials |
232
+ | State | `/root/.aiusage/state.json` | Consent and sync runtime state |
233
+ | Watermarks | `/root/.aiusage/watermark.json` | Incremental parse cursors |
234
+
235
+ All data lives under `/root/.aiusage`, which is declared as a `VOLUME`. You **must** mount this volume to persist data across container restarts.
236
+
237
+ **Step 1 — Pull image and run**
238
+
239
+ ```bash
240
+ # Pull image
241
+ docker pull juliantanx/aiusage
242
+
243
+ # Run container (mount volume for data persistence)
244
+ docker run -d \
245
+ --name aiusage \
246
+ -p 3847:3847 \
247
+ -v aiusage-data:/root/.aiusage \
248
+ juliantanx/aiusage
249
+
250
+ # Configure sync backend
251
+ docker exec -it aiusage aiusage init \
252
+ --backend github \
253
+ --repo <user>/aiusage-data \
254
+ --token ghp_xxxxxxxxxxxxxxxxxxxx
255
+
256
+ # Initial data pull
257
+ docker exec -it aiusage aiusage sync
258
+ ```
259
+
260
+ > Without the `-v` flag, data is lost when the container is removed.
261
+
262
+ **Step 2 — Scheduled sync**
263
+
264
+ ```bash
265
+ # Install cron in container and create scheduled task
266
+ docker exec -it aiusage bash -c "apt-get update && apt-get install -y cron"
267
+ docker exec -it aiusage bash -c \
268
+ 'echo "*/30 * * * * aiusage sync >> /root/.aiusage/cron.log 2>&1" | crontab -'
269
+ docker restart aiusage
270
+ ```
271
+
272
+ > Note: `parse` is not needed here unless you also mount local AI session logs into the container. In the standard deployment, only `sync` is needed to pull data from the remote backend.
273
+
274
+ **Step 3 — Access**
275
+
276
+ Open `http://<server-ip>:3847`.
277
+
278
+ For HTTPS with a custom domain:
279
+
280
+ ```bash
281
+ # Caddy (auto HTTPS, recommended)
282
+ caddy reverse-proxy --from aiusage.your-domain.com --to localhost:3847
283
+
284
+ # Or Nginx
285
+ server {
286
+ listen 80;
287
+ server_name aiusage.your-domain.com;
288
+ location / {
289
+ proxy_pass http://127.0.0.1:3847;
290
+ proxy_set_header Host $host;
291
+ proxy_set_header X-Real-IP $remote_addr;
292
+ }
293
+ }
294
+ ```
295
+
296
+ **Build image yourself (optional)**
297
+
298
+ A `Dockerfile` is included in the project root:
299
+
300
+ ```bash
301
+ docker build -t aiusage .
302
+ ```
303
+
304
+ ---
305
+
306
+ ## Data Storage
307
+
308
+ | Item | Path |
309
+ |------|------|
310
+ | Local database | `~/.aiusage/cache.db` |
311
+ | Config | `~/.aiusage/config.json` |
312
+ | State (watermarks, sync) | `~/.aiusage/state.json` |
313
+
314
+ ### Default Source Paths
315
+
316
+ `aiusage parse` auto-discovers session logs from the following default locations:
317
+
318
+ | Tool | macOS | Linux | Windows |
319
+ |------|-------|-------|---------|
320
+ | Claude Code | `~/.claude/projects/` | `~/.claude/projects/` | `%USERPROFILE%\.claude\projects\` |
321
+ | Codex | `~/.codex/sessions/` | `~/.codex/sessions/` | `%USERPROFILE%\.codex\sessions\` |
322
+ | OpenClaw | `~/.openclaw/agents/*/sessions/` | `~/.openclaw/agents/*/sessions/` | `%USERPROFILE%\.openclaw\agents\*\sessions\` |
323
+ | OpenCode | `~/Library/Application Support/opencode/opencode.db` | `~/.local/share/opencode/opencode.db` | `%APPDATA%\opencode\opencode.db` |
324
+
325
+ Discovery behavior:
326
+
327
+ - **Claude Code** — recursively scans `~/.claude/projects/**` for `.jsonl` files, including nested subagent logs.
328
+ - **Codex** — recursively scans `~/.codex/sessions/**` for `.jsonl` files.
329
+ - **OpenClaw** — scans each agent's `sessions/` directory under `~/.openclaw/agents/*/sessions/` and skips checkpoint files.
330
+ - **OpenCode** — reads the SQLite database file directly instead of `.jsonl` logs.
331
+
332
+ > On Linux, OpenCode respects `$XDG_DATA_HOME` if set.
333
+
334
+ ### Custom Source Paths
335
+
336
+ If you installed a tool to a non-default location, override the paths in the **Settings** page of the web dashboard (`http://localhost:3847/settings` → Sources section), or edit `~/.aiusage/config.json` directly:
337
+
338
+ ```json
339
+ {
340
+ "sources": {
341
+ "claude-code": "/custom/path/.claude/projects",
342
+ "codex": "/custom/path/.codex/sessions",
343
+ "openclaw": "/custom/sessions-dir",
344
+ "opencode": "/custom/path/opencode.db"
345
+ }
346
+ }
347
+ ```
348
+
349
+ Only the paths you specify are overridden; unspecified tools fall back to their defaults.
350
+
351
+ ## Database Visualization
352
+
353
+ The local database is a standard SQLite file, so you can open it directly in DBeaver, TablePlus, DataGrip, DB Browser for SQLite, or any similar tool.
354
+
355
+ ```bash
356
+ aiusage status
357
+ # Shows the exact DB Path, schema version, and object counts
358
+ ```
359
+
360
+ - Open `~/.aiusage/cache.db` as a SQLite database.
361
+ - Prefer read-only mode in your database tool. `aiusage` writes to the same file and uses WAL mode.
362
+ - If your tool asks about sidecar files, keep `cache.db-wal` and `cache.db-shm` alongside the main database file.
363
+ - Start with the read-only views:
364
+ - `v_usage_records`: one row per usage record with normalized timestamp and token totals
365
+ - `v_tool_calls`: tool call rows joined with their parent usage record
366
+ - `v_sessions`: session-level aggregates for pivoting and charting
367
+ - Raw internal tables remain available for advanced inspection:
368
+ - `records`
369
+ - `tool_calls`
370
+ - `synced_records`
371
+ - `sync_tombstones`
372
+
373
+ ## Tech Stack
374
+
375
+ - **Runtime:** Node.js, TypeScript
376
+ - **Database:** better-sqlite3 (local, WAL mode)
377
+ - **CLI:** Commander.js
378
+ - **Web:** SvelteKit + adapter-static
379
+ - **Build:** tsup (core/cli), Vite (web)
380
+ - **Sync:** GitHub API, AWS S3 / Cloudflare R2
381
+
382
+ ## Project Structure
383
+
384
+ ```text
385
+ packages/
386
+ core/ - Shared types, database schema, pricing data
387
+ cli/ - CLI tool for parsing logs, querying data, cloud sync
388
+ web/ - SvelteKit web dashboard (SPA)
389
+ ```
390
+
391
+ ## License
392
+
393
+ MIT
package/dist/index.js CHANGED
@@ -2869,7 +2869,7 @@ function createDatabase(path2) {
2869
2869
  import { join as join8 } from "path";
2870
2870
  var DB_PATH = join8(AIUSAGE_DIR, "cache.db");
2871
2871
  var program = new Command();
2872
- program.name("aiusage").version(true ? "1.0.4" : "dev").description("CLI tool for AI usage statistics");
2872
+ program.name("aiusage").version(true ? "1.0.5" : "dev").description("CLI tool for AI usage statistics");
2873
2873
  program.action(() => {
2874
2874
  const db = createDatabase(DB_PATH);
2875
2875
  const state = getState(AIUSAGE_DIR);
@@ -0,0 +1,3 @@
1
+ var mt=Object.defineProperty;var wt=(e,n,t)=>n in e?mt(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t;var P=(e,n,t)=>wt(e,typeof n!="symbol"?n+"":n,t);import{o as je,t as yt}from"./scheduler.DukoKnjQ.js";import{w as ye}from"./index.BjVwNvJa.js";new URL("sveltekit-internal://");function _t(e,n){return e==="/"||n==="ignore"?e:n==="never"?e.endsWith("/")?e.slice(0,-1):e:n==="always"&&!e.endsWith("/")?e+"/":e}function vt(e){return e.split("%25").map(decodeURI).join("%25")}function bt(e){for(const n in e)e[n]=decodeURIComponent(e[n]);return e}function ue({href:e}){return e.split("#")[0]}function At(e,n,t,r=!1){const a=new URL(e);Object.defineProperty(a,"searchParams",{value:new Proxy(a.searchParams,{get(o,c){if(c==="get"||c==="getAll"||c==="has")return f=>(t(f),o[c](f));n();const i=Reflect.get(o,c);return typeof i=="function"?i.bind(o):i}}),enumerable:!0,configurable:!0});const s=["href","pathname","search","toString","toJSON"];r&&s.push("hash");for(const o of s)Object.defineProperty(a,o,{get(){return n(),e[o]},enumerable:!0,configurable:!0});return a}const kt="/__data.json",Et=".html__data.json";function St(e){return e.endsWith(".html")?e.replace(/\.html$/,Et):e.replace(/\/$/,"")+kt}function Rt(...e){let n=5381;for(const t of e)if(typeof t=="string"){let r=t.length;for(;r;)n=n*33^t.charCodeAt(--r)}else if(ArrayBuffer.isView(t)){const r=new Uint8Array(t.buffer,t.byteOffset,t.byteLength);let a=r.length;for(;a;)n=n*33^r[--a]}else throw new TypeError("value must be a string or TypedArray");return(n>>>0).toString(36)}function It(e){const n=atob(e),t=new Uint8Array(n.length);for(let r=0;r<n.length;r++)t[r]=n.charCodeAt(r);return t.buffer}const He=window.fetch;window.fetch=(e,n)=>((e instanceof Request?e.method:(n==null?void 0:n.method)||"GET")!=="GET"&&M.delete(_e(e)),He(e,n));const M=new Map;function Ut(e,n){const t=_e(e,n),r=document.querySelector(t);if(r!=null&&r.textContent){let{body:a,...s}=JSON.parse(r.textContent);const o=r.getAttribute("data-ttl");return o&&M.set(t,{body:a,init:s,ttl:1e3*Number(o)}),r.getAttribute("data-b64")!==null&&(a=It(a)),Promise.resolve(new Response(a,s))}return window.fetch(e,n)}function Tt(e,n,t){if(M.size>0){const r=_e(e,t),a=M.get(r);if(a){if(performance.now()<a.ttl&&["default","force-cache","only-if-cached",void 0].includes(t==null?void 0:t.cache))return new Response(a.body,a.init);M.delete(r)}}return window.fetch(n,t)}function _e(e,n){let r=`script[data-sveltekit-fetched][data-url=${JSON.stringify(e instanceof Request?e.url:e)}]`;if(n!=null&&n.headers||n!=null&&n.body){const a=[];n.headers&&a.push([...new Headers(n.headers)].join(",")),n.body&&(typeof n.body=="string"||ArrayBuffer.isView(n.body))&&a.push(n.body),r+=`[data-hash="${Rt(...a)}"]`}return r}const Lt=/^(\[)?(\.\.\.)?(\w+)(?:=(\w+))?(\])?$/;function Pt(e){const n=[];return{pattern:e==="/"?/^\/$/:new RegExp(`^${jt(e).map(r=>{const a=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(r);if(a)return n.push({name:a[1],matcher:a[2],optional:!1,rest:!0,chained:!0}),"(?:/(.*))?";const s=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(r);if(s)return n.push({name:s[1],matcher:s[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!r)return;const o=r.split(/\[(.+?)\](?!\])/);return"/"+o.map((i,f)=>{if(f%2){if(i.startsWith("x+"))return de(String.fromCharCode(parseInt(i.slice(2),16)));if(i.startsWith("u+"))return de(String.fromCharCode(...i.slice(2).split("-").map(l=>parseInt(l,16))));const h=Lt.exec(i),[,u,g,p,d]=h;return n.push({name:p,matcher:d,optional:!!u,rest:!!g,chained:g?f===1&&o[0]==="":!1}),g?"(.*?)":u?"([^/]*)?":"([^/]+?)"}return de(i)}).join("")}).join("")}/?$`),params:n}}function Ot(e){return!/^\([^)]+\)$/.test(e)}function jt(e){return e.slice(1).split("/").filter(Ot)}function Nt(e,n,t){const r={},a=e.slice(1),s=a.filter(c=>c!==void 0);let o=0;for(let c=0;c<n.length;c+=1){const i=n[c];let f=a[c-o];if(i.chained&&i.rest&&o&&(f=a.slice(c-o,c+1).filter(h=>h).join("/"),o=0),f===void 0){i.rest&&(r[i.name]="");continue}if(!i.matcher||t[i.matcher](f)){r[i.name]=f;const h=n[c+1],u=a[c+1];h&&!h.rest&&h.optional&&u&&i.chained&&(o=0),!h&&!u&&Object.keys(r).length===s.length&&(o=0);continue}if(i.optional&&i.chained){o++;continue}return}if(!o)return r}function de(e){return e.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}function $t({nodes:e,server_loads:n,dictionary:t,matchers:r}){const a=new Set(n);return Object.entries(t).map(([c,[i,f,h]])=>{const{pattern:u,params:g}=Pt(c),p={id:c,exec:d=>{const l=u.exec(d);if(l)return Nt(l,g,r)},errors:[1,...h||[]].map(d=>e[d]),layouts:[0,...f||[]].map(o),leaf:s(i)};return p.errors.length=p.layouts.length=Math.max(p.errors.length,p.layouts.length),p});function s(c){const i=c<0;return i&&(c=~c),[i,e[c]]}function o(c){return c===void 0?c:[a.has(c),e[c]]}}function Ke(e,n=JSON.parse){try{return n(sessionStorage[e])}catch{}}function Ne(e,n,t=JSON.stringify){const r=t(n);try{sessionStorage[e]=r}catch{}}var Me;const L=((Me=globalThis.__sveltekit_1azk3th)==null?void 0:Me.base)??"";var qe;const xt=((qe=globalThis.__sveltekit_1azk3th)==null?void 0:qe.assets)??L,Ct="1779003570696",We="sveltekit:snapshot",Ye="sveltekit:scroll",ze="sveltekit:states",Dt="sveltekit:pageurl",C="sveltekit:history",H="sveltekit:navigation",J={tap:1,hover:2,viewport:3,eager:4,off:-1,false:-1},z=location.origin;function Je(e){if(e instanceof URL)return e;let n=document.baseURI;if(!n){const t=document.getElementsByTagName("base");n=t.length?t[0].href:document.URL}return new URL(e,n)}function ve(){return{x:pageXOffset,y:pageYOffset}}function x(e,n){return e.getAttribute(`data-sveltekit-${n}`)}const $e={...J,"":J.hover};function Xe(e){let n=e.assignedSlot??e.parentNode;return(n==null?void 0:n.nodeType)===11&&(n=n.host),n}function Ze(e,n){for(;e&&e!==n;){if(e.nodeName.toUpperCase()==="A"&&e.hasAttribute("href"))return e;e=Xe(e)}}function ge(e,n,t){let r;try{r=new URL(e instanceof SVGAElement?e.href.baseVal:e.href,document.baseURI)}catch{}const a=e instanceof SVGAElement?e.target.baseVal:e.target,s=!r||!!a||oe(r,n,t)||(e.getAttribute("rel")||"").split(/\s+/).includes("external"),o=(r==null?void 0:r.origin)===z&&e.hasAttribute("download");return{url:r,external:s,target:a,download:o}}function X(e){let n=null,t=null,r=null,a=null,s=null,o=null,c=e;for(;c&&c!==document.documentElement;)r===null&&(r=x(c,"preload-code")),a===null&&(a=x(c,"preload-data")),n===null&&(n=x(c,"keepfocus")),t===null&&(t=x(c,"noscroll")),s===null&&(s=x(c,"reload")),o===null&&(o=x(c,"replacestate")),c=Xe(c);function i(f){switch(f){case"":case"true":return!0;case"off":case"false":return!1;default:return}}return{preload_code:$e[r??"off"],preload_data:$e[a??"off"],keepfocus:i(n),noscroll:i(t),reload:i(s),replace_state:i(o)}}function xe(e){const n=ye(e);let t=!0;function r(){t=!0,n.update(o=>o)}function a(o){t=!1,n.set(o)}function s(o){let c;return n.subscribe(i=>{(c===void 0||t&&i!==c)&&o(c=i)})}return{notify:r,set:a,subscribe:s}}const Qe={v:()=>{}};function Bt(){const{set:e,subscribe:n}=ye(!1);let t;async function r(){clearTimeout(t);try{const a=await fetch(`${xt}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!a.ok)return!1;const o=(await a.json()).version!==Ct;return o&&(e(!0),Qe.v(),clearTimeout(t)),o}catch{return!1}}return{subscribe:n,check:r}}function oe(e,n,t){return e.origin!==z||!e.pathname.startsWith(n)?!0:t?!(e.pathname===n+"/"||e.protocol==="file:"&&e.pathname.replace(/\/[^/]+\.html?$/,"")===n):!1}function Ft(e){return Uint8Array.fromBase64(e).buffer}function Vt(e){return Uint8Array.from(Buffer.from(e,"base64")).buffer}function Mt(e){const n=atob(e),t=n.length,r=new Uint8Array(t);for(let a=0;a<t;a++)r[a]=n.charCodeAt(a);return r.buffer}const qt=typeof Uint8Array.fromBase64=="function";var Ge;const Gt=typeof process=="object"&&((Ge=process.versions)==null?void 0:Ge.node)!==void 0,Ht=qt?Ft:Gt?Vt:Mt,Kt=-1,Wt=-2,Yt=-3,zt=-4,Jt=-5,Xt=-6,Zt=-7;function Qt(e,n){if(typeof e=="number")return s(e,!0);if(!Array.isArray(e)||e.length===0)throw new Error("Invalid input");const t=e,r=Array(t.length);let a=null;function s(o,c=!1){if(o===Kt)return;if(o===Yt)return NaN;if(o===zt)return 1/0;if(o===Jt)return-1/0;if(o===Xt)return-0;if(c||typeof o!="number")throw new Error("Invalid input");if(o in r)return r[o];const i=t[o];if(!i||typeof i!="object")r[o]=i;else if(Array.isArray(i))if(typeof i[0]=="string"){const f=i[0],h=n&&Object.hasOwn(n,f)?n[f]:void 0;if(h){let u=i[1];if(typeof u!="number"&&(u=t.push(i[1])-1),a??(a=new Set),a.has(u))throw new Error("Invalid circular reference");return a.add(u),r[o]=h(s(u)),a.delete(u),r[o]}switch(f){case"Date":r[o]=new Date(i[1]);break;case"Set":const u=new Set;r[o]=u;for(let d=1;d<i.length;d+=1)u.add(s(i[d]));break;case"Map":const g=new Map;r[o]=g;for(let d=1;d<i.length;d+=2)g.set(s(i[d]),s(i[d+1]));break;case"RegExp":r[o]=new RegExp(i[1],i[2]);break;case"Object":{const d=i[1];if(typeof t[d]=="object"&&t[d][0]!=="BigInt")throw new Error("Invalid input");r[o]=Object(s(d));break}case"BigInt":r[o]=BigInt(i[1]);break;case"null":const p=Object.create(null);r[o]=p;for(let d=1;d<i.length;d+=2){if(i[d]==="__proto__")throw new Error("Cannot parse an object with a `__proto__` property");p[i[d]]=s(i[d+1])}break;case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Float16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"BigInt64Array":case"BigUint64Array":case"DataView":{if(t[i[1]][0]!=="ArrayBuffer")throw new Error("Invalid data");const d=globalThis[f],l=s(i[1]);r[o]=i[2]!==void 0?new d(l,i[2],i[3]):new d(l);break}case"ArrayBuffer":{const d=i[1];if(typeof d!="string")throw new Error("Invalid ArrayBuffer encoding");const l=Ht(d);r[o]=l;break}case"Temporal.Duration":case"Temporal.Instant":case"Temporal.PlainDate":case"Temporal.PlainTime":case"Temporal.PlainDateTime":case"Temporal.PlainMonthDay":case"Temporal.PlainYearMonth":case"Temporal.ZonedDateTime":{const d=f.slice(9);r[o]=Temporal[d].from(i[1]);break}case"URL":{const d=new URL(i[1]);r[o]=d;break}case"URLSearchParams":{const d=new URLSearchParams(i[1]);r[o]=d;break}default:throw new Error(`Unknown type ${f}`)}}else if(i[0]===Zt){const f=i[1];if(!Number.isInteger(f)||f<0)throw new Error("Invalid input");const h=new Array(f);r[o]=h;for(let u=2;u<i.length;u+=2){const g=i[u];if(!Number.isInteger(g)||g<0||g>=f)throw new Error("Invalid input");h[g]=s(i[u+1])}}else{const f=new Array(i.length);r[o]=f;for(let h=0;h<i.length;h+=1){const u=i[h];u!==Wt&&(f[h]=s(u))}}else{const f={};r[o]=f;for(const h of Object.keys(i)){if(h==="__proto__")throw new Error("Cannot parse an object with a `__proto__` property");const u=i[h];f[h]=s(u)}}return r[o]}return s(0)}const et=new Set(["load","prerender","csr","ssr","trailingSlash","config"]);[...et];const en=new Set([...et]);[...en];function tn(e){return e.filter(n=>n!=null)}class se{constructor(n,t){this.status=n,typeof t=="string"?this.body={message:t}:t?this.body=t:this.body={message:`Error: ${n}`}}toString(){return JSON.stringify(this.body)}}class be{constructor(n,t){this.status=n,this.location=t}}class Ae extends Error{constructor(n,t,r){super(r),this.status=n,this.text=t}}const nn="x-sveltekit-invalidated",rn="x-sveltekit-trailing-slash";function Z(e){return e instanceof se||e instanceof Ae?e.status:500}function an(e){return e instanceof Ae?e.text:"Internal Error"}let I,K,he;const on=je.toString().includes("$$")||/function \w+\(\) \{\}/.test(je.toString());on?(I={data:{},form:null,error:null,params:{},route:{id:null},state:{},status:-1,url:new URL("https://example.com")},K={current:null},he={current:!1}):(I=new class{constructor(){P(this,"data",$state.raw({}));P(this,"form",$state.raw(null));P(this,"error",$state.raw(null));P(this,"params",$state.raw({}));P(this,"route",$state.raw({id:null}));P(this,"state",$state.raw({}));P(this,"status",$state.raw(-1));P(this,"url",$state.raw(new URL("https://example.com")))}},K=new class{constructor(){P(this,"current",$state.raw(null))}},he=new class{constructor(){P(this,"current",$state.raw(!1))}},Qe.v=()=>he.current=!0);function sn(e){Object.assign(I,e)}const cn=new Set(["icon","shortcut icon","apple-touch-icon"]),$=Ke(Ye)??{},W=Ke(We)??{},j={url:xe({}),page:xe({}),navigating:ye(null),updated:Bt()};function ke(e){$[e]=ve()}function ln(e,n){let t=e+1;for(;$[t];)delete $[t],t+=1;for(t=n+1;W[t];)delete W[t],t+=1}function B(e){return location.href=e.href,new Promise(()=>{})}async function tt(){if("serviceWorker"in navigator){const e=await navigator.serviceWorker.getRegistration(L||"/");e&&await e.update()}}function Ce(){}let ie,me,Q,O,we,A;const nt=[],ee=[];let U=null;const rt=new Set,fn=new Set,q=new Set;let y={branch:[],error:null,url:null},Ee=!1,te=!1,De=!0,Y=!1,F=!1,at=!1,Se=!1,ot,R,T,ne;const G=new Set;async function Rn(e,n,t){var a,s,o,c;document.URL!==location.href&&(location.href=location.href),A=e,await((s=(a=e.hooks).init)==null?void 0:s.call(a)),ie=$t(e),O=document.documentElement,we=n,me=e.nodes[0],Q=e.nodes[1],me(),Q(),R=(o=history.state)==null?void 0:o[C],T=(c=history.state)==null?void 0:c[H],R||(R=T=Date.now(),history.replaceState({...history.state,[C]:R,[H]:T},""));const r=$[R];r&&(history.scrollRestoration="manual",scrollTo(r.x,r.y)),t?await yn(we,t):mn(location.href,{replaceState:!0}),wn()}function un(){nt.length=0,Se=!1}function st(e){ee.some(n=>n==null?void 0:n.snapshot)&&(W[e]=ee.map(n=>{var t;return(t=n==null?void 0:n.snapshot)==null?void 0:t.capture()}))}function it(e){var n;(n=W[e])==null||n.forEach((t,r)=>{var a,s;(s=(a=ee[r])==null?void 0:a.snapshot)==null||s.restore(t)})}function Be(){ke(R),Ne(Ye,$),st(T),Ne(We,W)}async function Re(e,n,t,r){return V({type:"goto",url:Je(e),keepfocus:n.keepFocus,noscroll:n.noScroll,replace_state:n.replaceState,state:n.state,redirect_count:t,nav_token:r,accept:()=>{n.invalidateAll&&(Se=!0)}})}async function dn(e){if(e.id!==(U==null?void 0:U.id)){const n={};G.add(n),U={id:e.id,token:n,promise:lt({...e,preload:n}).then(t=>(G.delete(n),t.type==="loaded"&&t.state.error&&(U=null),t))}}return U.promise}async function pe(e){const n=ie.find(t=>t.exec(ft(e)));n&&await Promise.all([...n.layouts,n.leaf].map(t=>t==null?void 0:t[1]()))}function ct(e,n,t){var s;y=e.state;const r=document.querySelector("style[data-sveltekit]");r&&r.remove(),Object.assign(I,e.props.page),ot=new A.root({target:n,props:{...e.props,stores:j,components:ee},hydrate:t,sync:!1}),it(T);const a={from:null,to:{params:y.params,route:{id:((s=y.route)==null?void 0:s.id)??null},url:new URL(location.href)},willUnload:!1,type:"enter",complete:Promise.resolve()};q.forEach(o=>o(a)),te=!0}function re({url:e,params:n,branch:t,status:r,error:a,route:s,form:o}){let c="never";if(L&&(e.pathname===L||e.pathname===L+"/"))c="always";else for(const p of t)(p==null?void 0:p.slash)!==void 0&&(c=p.slash);e.pathname=_t(e.pathname,c),e.search=e.search;const i={type:"loaded",state:{url:e,params:n,branch:t,error:a,route:s},props:{constructors:tn(t).map(p=>p.node.component),page:Le(I)}};o!==void 0&&(i.props.form=o);let f={},h=!I,u=0;for(let p=0;p<Math.max(t.length,y.branch.length);p+=1){const d=t[p],l=y.branch[p];(d==null?void 0:d.data)!==(l==null?void 0:l.data)&&(h=!0),d&&(f={...f,...d.data},h&&(i.props[`data_${u}`]=f),u+=1)}return(!y.url||e.href!==y.url.href||y.error!==a||o!==void 0&&o!==I.form||h)&&(i.props.page={error:a,params:n,route:{id:(s==null?void 0:s.id)??null},state:{},status:r,url:new URL(e),form:o??null,data:h?f:I.data}),i}async function Ie({loader:e,parent:n,url:t,params:r,route:a,server_data_node:s}){var h,u,g;let o=null,c=!0;const i={dependencies:new Set,params:new Set,parent:!1,route:!1,url:!1,search_params:new Set},f=await e();if((h=f.universal)!=null&&h.load){let p=function(...l){for(const m of l){const{href:b}=new URL(m,t);i.dependencies.add(b)}};const d={route:new Proxy(a,{get:(l,m)=>(c&&(i.route=!0),l[m])}),params:new Proxy(r,{get:(l,m)=>(c&&i.params.add(m),l[m])}),data:(s==null?void 0:s.data)??null,url:At(t,()=>{c&&(i.url=!0)},l=>{c&&i.search_params.add(l)},A.hash),async fetch(l,m){let b;l instanceof Request?(b=l.url,m={body:l.method==="GET"||l.method==="HEAD"?void 0:await l.blob(),cache:l.cache,credentials:l.credentials,headers:[...l.headers].length?l.headers:void 0,integrity:l.integrity,keepalive:l.keepalive,method:l.method,mode:l.mode,redirect:l.redirect,referrer:l.referrer,referrerPolicy:l.referrerPolicy,signal:l.signal,...m}):b=l;const E=new URL(b,t);return c&&p(E.href),E.origin===t.origin&&(b=E.href.slice(t.origin.length)),te?Tt(b,E.href,m):Ut(b,m)},setHeaders:()=>{},depends:p,parent(){return c&&(i.parent=!0),n()},untrack(l){c=!1;try{return l()}finally{c=!0}}};o=await f.universal.load.call(null,d)??null}return{node:f,loader:e,server:s,universal:(u=f.universal)!=null&&u.load?{type:"data",data:o,uses:i}:null,data:o??(s==null?void 0:s.data)??null,slash:((g=f.universal)==null?void 0:g.trailingSlash)??(s==null?void 0:s.slash)}}function Fe(e,n,t,r,a,s){if(Se)return!0;if(!a)return!1;if(a.parent&&e||a.route&&n||a.url&&t)return!0;for(const o of a.search_params)if(r.has(o))return!0;for(const o of a.params)if(s[o]!==y.params[o])return!0;for(const o of a.dependencies)if(nt.some(c=>c(new URL(o))))return!0;return!1}function Ue(e,n){return(e==null?void 0:e.type)==="data"?e:(e==null?void 0:e.type)==="skip"?n??null:null}function hn(e,n){if(!e)return new Set(n.searchParams.keys());const t=new Set([...e.searchParams.keys(),...n.searchParams.keys()]);for(const r of t){const a=e.searchParams.getAll(r),s=n.searchParams.getAll(r);a.every(o=>s.includes(o))&&s.every(o=>a.includes(o))&&t.delete(r)}return t}function Ve({error:e,url:n,route:t,params:r}){return{type:"loaded",state:{error:e,url:n,route:t,params:r,branch:[]},props:{page:Le(I),constructors:[]}}}async function lt({id:e,invalidating:n,url:t,params:r,route:a,preload:s}){if((U==null?void 0:U.id)===e)return G.delete(U.token),U.promise;const{errors:o,layouts:c,leaf:i}=a,f=[...c,i];o.forEach(w=>w==null?void 0:w().catch(()=>{})),f.forEach(w=>w==null?void 0:w[1]().catch(()=>{}));let h=null;const u=y.url?e!==ae(y.url):!1,g=y.route?a.id!==y.route.id:!1,p=hn(y.url,t);let d=!1;const l=f.map((w,_)=>{var N;const k=y.branch[_],S=!!(w!=null&&w[0])&&((k==null?void 0:k.loader)!==w[1]||Fe(d,g,u,p,(N=k.server)==null?void 0:N.uses,r));return S&&(d=!0),S});if(l.some(Boolean)){try{h=await ht(t,l)}catch(w){const _=await D(w,{url:t,params:r,route:{id:e}});return G.has(s)?Ve({error:_,url:t,params:r,route:a}):ce({status:Z(w),error:_,url:t,route:a})}if(h.type==="redirect")return h}const m=h==null?void 0:h.nodes;let b=!1;const E=f.map(async(w,_)=>{var le;if(!w)return;const k=y.branch[_],S=m==null?void 0:m[_];if((!S||S.type==="skip")&&w[1]===(k==null?void 0:k.loader)&&!Fe(b,g,u,p,(le=k.universal)==null?void 0:le.uses,r))return k;if(b=!0,(S==null?void 0:S.type)==="error")throw S;return Ie({loader:w[1],url:t,params:r,route:a,parent:async()=>{var Oe;const Pe={};for(let fe=0;fe<_;fe+=1)Object.assign(Pe,(Oe=await E[fe])==null?void 0:Oe.data);return Pe},server_data_node:Ue(S===void 0&&w[0]?{type:"skip"}:S??null,w[0]?k==null?void 0:k.server:void 0)})});for(const w of E)w.catch(()=>{});const v=[];for(let w=0;w<f.length;w+=1)if(f[w])try{v.push(await E[w])}catch(_){if(_ instanceof be)return{type:"redirect",location:_.location};if(G.has(s))return Ve({error:await D(_,{params:r,url:t,route:{id:a.id}}),url:t,params:r,route:a});let k=Z(_),S;if(m!=null&&m.includes(_))k=_.status??k,S=_.error;else if(_ instanceof se)S=_.body;else{if(await j.updated.check())return await tt(),await B(t);S=await D(_,{params:r,url:t,route:{id:a.id}})}const N=await pn(w,v,o);return N?re({url:t,params:r,branch:v.slice(0,N.idx).concat(N.node),status:k,error:S,route:a}):await dt(t,{id:a.id},S,k)}else v.push(void 0);return re({url:t,params:r,branch:v,status:200,error:null,route:a,form:n?void 0:null})}async function pn(e,n,t){for(;e--;)if(t[e]){let r=e;for(;!n[r];)r-=1;try{return{idx:r+1,node:{node:await t[e](),loader:t[e],data:{},server:null,universal:null}}}catch{continue}}}async function ce({status:e,error:n,url:t,route:r}){const a={};let s=null;if(A.server_loads[0]===0)try{const c=await ht(t,[!0]);if(c.type!=="data"||c.nodes[0]&&c.nodes[0].type!=="data")throw 0;s=c.nodes[0]??null}catch{(t.origin!==z||t.pathname!==location.pathname||Ee)&&await B(t)}try{const c=await Ie({loader:me,url:t,params:a,route:r,parent:()=>Promise.resolve({}),server_data_node:Ue(s)}),i={node:await Q(),loader:Q,universal:null,server:null,data:null};return re({url:t,params:a,branch:[c,i],status:e,error:n,route:null})}catch(c){if(c instanceof be)return Re(new URL(c.location,location.href),{},0);throw c}}function Te(e,n){if(!e||oe(e,L,A.hash))return;let t;try{if(t=A.hooks.reroute({url:new URL(e)})??e,typeof t=="string"){const a=new URL(e);A.hash?a.hash=t:a.pathname=t,t=a}}catch{return}const r=ft(t);for(const a of ie){const s=a.exec(r);if(s)return{id:ae(e),invalidating:n,route:a,params:bt(s),url:e}}}function ft(e){return vt(A.hash?e.hash.replace(/^#/,"").replace(/[?#].+/,""):e.pathname.slice(L.length))||"/"}function ae(e){return(A.hash?e.hash.replace(/^#/,""):e.pathname)+e.search}function ut({url:e,type:n,intent:t,delta:r}){let a=!1;const s=gt(y,t,e,n);r!==void 0&&(s.navigation.delta=r);const o={...s.navigation,cancel:()=>{a=!0,s.reject(new Error("navigation cancelled"))}};return Y||rt.forEach(c=>c(o)),a?null:s}async function V({type:e,url:n,popped:t,keepfocus:r,noscroll:a,replace_state:s,state:o={},redirect_count:c=0,nav_token:i={},accept:f=Ce,block:h=Ce}){const u=Te(n,!1),g=ut({url:n,type:e,delta:t==null?void 0:t.delta,intent:u});if(!g){h();return}const p=R,d=T;f(),Y=!0,te&&j.navigating.set(K.current=g.navigation),ne=i;let l=u&&await lt(u);if(!l){if(oe(n,L,A.hash))return await B(n);l=await dt(n,{id:null},await D(new Ae(404,"Not Found",`Not found: ${n.pathname}`),{url:n,params:{},route:{id:null}}),404)}if(n=(u==null?void 0:u.url)||n,ne!==i)return g.reject(new Error("navigation aborted")),!1;if(l.type==="redirect")if(c>=20)l=await ce({status:500,error:await D(new Error("Redirect loop"),{url:n,params:{},route:{id:null}}),url:n,route:{id:null}});else return Re(new URL(l.location,n).href,{},c+1,i),!1;else l.props.page.status>=400&&await j.updated.check()&&(await tt(),await B(n));if(un(),ke(p),st(d),l.props.page.url.pathname!==n.pathname&&(n.pathname=l.props.page.url.pathname),o=t?t.state:o,!t){const v=s?0:1,w={[C]:R+=v,[H]:T+=v,[ze]:o};(s?history.replaceState:history.pushState).call(history,w,"",n),s||ln(R,T)}if(U=null,l.props.page.state=o,te){y=l.state,l.props.page&&(l.props.page.url=n);const v=(await Promise.all(Array.from(fn,w=>w(g.navigation)))).filter(w=>typeof w=="function");if(v.length>0){let w=function(){v.forEach(_=>{q.delete(_)})};v.push(w),v.forEach(_=>{q.add(_)})}ot.$set(l.props),sn(l.props.page),at=!0}else ct(l,we,!1);const{activeElement:m}=document;await yt();const b=t?t.scroll:a?ve():null;if(De){const v=n.hash&&document.getElementById(decodeURIComponent(A.hash?n.hash.split("#")[2]??"":n.hash.slice(1)));b?scrollTo(b.x,b.y):v?v.scrollIntoView():scrollTo(0,0)}const E=document.activeElement!==m&&document.activeElement!==document.body;!r&&!E&&_n(),De=!0,l.props.page&&Object.assign(I,l.props.page),Y=!1,e==="popstate"&&it(T),g.fulfil(void 0),q.forEach(v=>v(g.navigation)),j.navigating.set(K.current=null)}async function dt(e,n,t,r){return e.origin===z&&e.pathname===location.pathname&&!Ee?await ce({status:r,error:t,url:e,route:n}):await B(e)}function gn(){let e;O.addEventListener("mousemove",s=>{const o=s.target;clearTimeout(e),e=setTimeout(()=>{r(o,2)},20)});function n(s){s.defaultPrevented||r(s.composedPath()[0],1)}O.addEventListener("mousedown",n),O.addEventListener("touchstart",n,{passive:!0});const t=new IntersectionObserver(s=>{for(const o of s)o.isIntersecting&&(pe(new URL(o.target.href)),t.unobserve(o.target))},{threshold:0});function r(s,o){const c=Ze(s,O);if(!c)return;const{url:i,external:f,download:h}=ge(c,L,A.hash);if(f||h)return;const u=X(c),g=i&&ae(y.url)===ae(i);if(!u.reload&&!g)if(o<=u.preload_data){const p=Te(i,!1);p&&dn(p)}else o<=u.preload_code&&pe(i)}function a(){t.disconnect();for(const s of O.querySelectorAll("a")){const{url:o,external:c,download:i}=ge(s,L,A.hash);if(c||i)continue;const f=X(s);f.reload||(f.preload_code===J.viewport&&t.observe(s),f.preload_code===J.eager&&pe(o))}}q.add(a),a()}function D(e,n){if(e instanceof se)return e.body;const t=Z(e),r=an(e);return A.hooks.handleError({error:e,event:n,status:t,message:r})??{message:r}}function mn(e,n={}){return e=new URL(Je(e)),e.origin!==z?Promise.reject(new Error("goto: invalid URL")):Re(e,n,0)}function wn(){var n;history.scrollRestoration="manual",addEventListener("beforeunload",t=>{let r=!1;if(Be(),!Y){const a=gt(y,void 0,null,"leave"),s={...a.navigation,cancel:()=>{r=!0,a.reject(new Error("navigation cancelled"))}};rt.forEach(o=>o(s))}r?(t.preventDefault(),t.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&Be()}),(n=navigator.connection)!=null&&n.saveData||gn(),O.addEventListener("click",async t=>{if(t.button||t.which!==1||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.defaultPrevented)return;const r=Ze(t.composedPath()[0],O);if(!r)return;const{url:a,external:s,target:o,download:c}=ge(r,L,A.hash);if(!a)return;if(o==="_parent"||o==="_top"){if(window.parent!==window)return}else if(o&&o!=="_self")return;const i=X(r);if(!(r instanceof SVGAElement)&&a.protocol!==location.protocol&&!(a.protocol==="https:"||a.protocol==="http:")||c)return;const[h,u]=(A.hash?a.hash.replace(/^#/,""):a.href).split("#"),g=h===ue(location);if(s||i.reload&&(!g||!u)){ut({url:a,type:"link"})?Y=!0:t.preventDefault();return}if(u!==void 0&&g){const[,p]=y.url.href.split("#");if(p===u){if(t.preventDefault(),u===""||u==="top"&&r.ownerDocument.getElementById("top")===null)window.scrollTo({top:0});else{const d=r.ownerDocument.getElementById(decodeURIComponent(u));d&&(d.scrollIntoView(),d.focus())}return}if(F=!0,ke(R),e(a),!i.replace_state)return;F=!1}t.preventDefault(),await new Promise(p=>{requestAnimationFrame(()=>{setTimeout(p,0)}),setTimeout(p,100)}),V({type:"link",url:a,keepfocus:i.keepfocus,noscroll:i.noscroll,replace_state:i.replace_state??a.href===location.href})}),O.addEventListener("submit",t=>{if(t.defaultPrevented)return;const r=HTMLFormElement.prototype.cloneNode.call(t.target),a=t.submitter;if(((a==null?void 0:a.formTarget)||r.target)==="_blank"||((a==null?void 0:a.formMethod)||r.method)!=="get")return;const c=new URL((a==null?void 0:a.hasAttribute("formaction"))&&(a==null?void 0:a.formAction)||r.action);if(oe(c,L,!1))return;const i=t.target,f=X(i);if(f.reload)return;t.preventDefault(),t.stopPropagation();const h=new FormData(i),u=a==null?void 0:a.getAttribute("name");u&&h.append(u,(a==null?void 0:a.getAttribute("value"))??""),c.search=new URLSearchParams(h).toString(),V({type:"form",url:c,keepfocus:f.keepfocus,noscroll:f.noscroll,replace_state:f.replace_state??c.href===location.href})}),addEventListener("popstate",async t=>{var r;if((r=t.state)!=null&&r[C]){const a=t.state[C];if(ne={},a===R)return;const s=$[a],o=t.state[ze]??{},c=new URL(t.state[Dt]??location.href),i=t.state[H],f=y.url?ue(location)===ue(y.url):!1;if(i===T&&(at||f)){o!==I.state&&(I.state=o),e(c),$[R]=ve(),s&&scrollTo(s.x,s.y),R=a;return}const u=a-R;await V({type:"popstate",url:c,popped:{state:o,scroll:s,delta:u},accept:()=>{R=a,T=i},block:()=>{history.go(-u)},nav_token:ne})}else if(!F){const a=new URL(location.href);e(a)}}),addEventListener("hashchange",()=>{F?(F=!1,history.replaceState({...history.state,[C]:++R,[H]:T},"",location.href)):A.hash&&y.url.hash===location.hash&&V({type:"goto",url:y.url})});for(const t of document.querySelectorAll("link"))cn.has(t.rel)&&(t.href=t.href);addEventListener("pageshow",t=>{t.persisted&&j.navigating.set(K.current=null)});function e(t){y.url=I.url=t,j.page.set(Le(I)),j.page.notify()}}async function yn(e,{status:n=200,error:t,node_ids:r,params:a,route:s,data:o,form:c}){Ee=!0;const i=new URL(location.href);({params:a={},route:s={id:null}}=Te(i,!1)||{});let f,h=!0;try{const u=r.map(async(d,l)=>{const m=o[l];return m!=null&&m.uses&&(m.uses=pt(m.uses)),Ie({loader:A.nodes[d],url:i,params:a,route:s,parent:async()=>{const b={};for(let E=0;E<l;E+=1)Object.assign(b,(await u[E]).data);return b},server_data_node:Ue(m)})}),g=await Promise.all(u),p=ie.find(({id:d})=>d===s.id);if(p){const d=p.layouts;for(let l=0;l<d.length;l++)d[l]||g.splice(l,0,void 0)}f=re({url:i,params:a,branch:g,status:n,error:t,form:c,route:p??null})}catch(u){if(u instanceof be){await B(new URL(u.location,location.href));return}f=await ce({status:Z(u),error:await D(u,{url:i,params:a,route:s}),url:i,route:s}),e.textContent="",h=!1}f.props.page&&(f.props.page.state={}),ct(f,e,h)}async function ht(e,n){var a;const t=new URL(e);t.pathname=St(e.pathname),e.pathname.endsWith("/")&&t.searchParams.append(rn,"1"),t.searchParams.append(nn,n.map(s=>s?"1":"0").join(""));const r=await He(t.href);if(!r.ok){let s;throw(a=r.headers.get("content-type"))!=null&&a.includes("application/json")?s=await r.json():r.status===404?s="Not Found":r.status===500&&(s="Internal Error"),new se(r.status,s)}return new Promise(async s=>{var u;const o=new Map,c=r.body.getReader(),i=new TextDecoder;function f(g){return Qt(g,{...A.decoders,Promise:p=>new Promise((d,l)=>{o.set(p,{fulfil:d,reject:l})})})}let h="";for(;;){const{done:g,value:p}=await c.read();if(g&&!h)break;for(h+=!p&&h?`
2
+ `:i.decode(p,{stream:!0});;){const d=h.indexOf(`
3
+ `);if(d===-1)break;const l=JSON.parse(h.slice(0,d));if(h=h.slice(d+1),l.type==="redirect")return s(l);if(l.type==="data")(u=l.nodes)==null||u.forEach(m=>{(m==null?void 0:m.type)==="data"&&(m.uses=pt(m.uses),m.data=f(m.data))}),s(l);else if(l.type==="chunk"){const{id:m,data:b,error:E}=l,v=o.get(m);o.delete(m),E?v.reject(f(E)):v.fulfil(f(b))}}}})}function pt(e){return{dependencies:new Set((e==null?void 0:e.dependencies)??[]),params:new Set((e==null?void 0:e.params)??[]),parent:!!(e!=null&&e.parent),route:!!(e!=null&&e.route),url:!!(e!=null&&e.url),search_params:new Set((e==null?void 0:e.search_params)??[])}}function _n(){const e=document.querySelector("[autofocus]");if(e)e.focus();else{const n=document.body,t=n.getAttribute("tabindex");n.tabIndex=-1,n.focus({preventScroll:!0,focusVisible:!1}),t!==null?n.setAttribute("tabindex",t):n.removeAttribute("tabindex");const r=getSelection();if(r&&r.type!=="None"){const a=[];for(let s=0;s<r.rangeCount;s+=1)a.push(r.getRangeAt(s));setTimeout(()=>{if(r.rangeCount===a.length){for(let s=0;s<r.rangeCount;s+=1){const o=a[s],c=r.getRangeAt(s);if(o.commonAncestorContainer!==c.commonAncestorContainer||o.startContainer!==c.startContainer||o.endContainer!==c.endContainer||o.startOffset!==c.startOffset||o.endOffset!==c.endOffset)return}r.removeAllRanges()}})}}}function gt(e,n,t,r){var i,f;let a,s;const o=new Promise((h,u)=>{a=h,s=u});return o.catch(()=>{}),{navigation:{from:{params:e.params,route:{id:((i=e.route)==null?void 0:i.id)??null},url:e.url},to:t&&{params:(n==null?void 0:n.params)??null,route:{id:((f=n==null?void 0:n.route)==null?void 0:f.id)??null},url:t},willUnload:!n,type:r,complete:o},fulfil:a,reject:s}}function Le(e){return{data:e.data,error:e.error,form:e.form,params:e.params,route:e.route,state:e.state,status:e.status,url:e.url}}export{Rn as a,j as s};
@@ -1 +1 @@
1
- import{s as e}from"./entry.-i5eOrF8.js";const r=()=>{const s=e;return{page:{subscribe:s.page.subscribe},navigating:{subscribe:s.navigating.subscribe},updated:s.updated}},b={subscribe(s){return r().page.subscribe(s)}};export{b as p};
1
+ import{s as e}from"./entry.DYaPgmil.js";const r=()=>{const s=e;return{page:{subscribe:s.page.subscribe},navigating:{subscribe:s.navigating.subscribe},updated:s.updated}},b={subscribe(s){return r().page.subscribe(s)}};export{b as p};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../nodes/0.BhkxfbMC.js","../chunks/scheduler.DukoKnjQ.js","../chunks/index.CUfK07C5.js","../chunks/api.D-M_rVlI.js","../chunks/index.BjVwNvJa.js","../chunks/stores.BJHWQcKv.js","../chunks/entry.-i5eOrF8.js","../assets/0.DDbFsqNI.css","../nodes/1.CNO4bJXv.js","../nodes/2.C_8jrQsV.js","../assets/2.fho1OPpm.css","../nodes/3.Lz_pbSpS.js","../chunks/ToolSelector.DIzQsA4_.js","../assets/ToolSelector.HSbC8-q9.css","../assets/3.BmO4KrOR.css","../nodes/4.BCB36ta_.js","../assets/4.TAVgUi8b.css","../nodes/5.CykeLKzi.js","../assets/5.I4bgY8QS.css","../nodes/6.De73932o.js","../assets/6.BeDwa7mS.css","../nodes/7.6OEKXCWR.js","../assets/7.BYQidWiw.css","../nodes/8.niqPZkB9.js","../assets/8.9sovMx-u.css","../nodes/9.DRZSbXAV.js","../assets/9.Doxq00gF.css","../nodes/10.1LgqVOtM.js","../assets/10.BcbNCOTS.css","../nodes/11.BOfGogcw.js","../assets/11.QhlpTtkf.css"])))=>i.map(i=>d[i]);
2
- import{s as C,h as N,o as B,t as U,j as I}from"../chunks/scheduler.DukoKnjQ.js";import{S as F,i as G,d as h,l as g,m as w,E as y,F as D,a as k,g as W,r as E,j as z,G as R,k as L,u as O,n as A,q as V,o as T,w as p,c as H,e as J,h as K,s as Q,f as X,t as Y}from"../chunks/index.CUfK07C5.js";const Z="modulepreload",M=function(s,e){return new URL(s,e).href},S={},m=function(e,n,r){let o=Promise.resolve();if(n&&n.length>0){const t=document.getElementsByTagName("link"),i=document.querySelector("meta[property=csp-nonce]"),l=(i==null?void 0:i.nonce)||(i==null?void 0:i.getAttribute("nonce"));o=Promise.allSettled(n.map(c=>{if(c=M(c,r),c in S)return;S[c]=!0;const a=c.endsWith(".css"),u=a?'[rel="stylesheet"]':"";if(!!r)for(let v=t.length-1;v>=0;v--){const P=t[v];if(P.href===c&&(!a||P.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${c}"]${u}`))return;const d=document.createElement("link");if(d.rel=a?"stylesheet":Z,a||(d.as="script"),d.crossOrigin="",d.href=c,l&&d.setAttribute("nonce",l),document.head.appendChild(d),a)return new Promise((v,P)=>{d.addEventListener("load",v),d.addEventListener("error",()=>P(new Error(`Unable to preload CSS for ${c}`)))})}))}function _(t){const i=new Event("vite:preloadError",{cancelable:!0});if(i.payload=t,window.dispatchEvent(i),!i.defaultPrevented)throw t}return o.then(t=>{for(const i of t||[])i.status==="rejected"&&_(i.reason);return e().catch(_)})},ae={};function $(s){let e,n,r;var o=s[1][0];function _(t,i){return{props:{data:t[3],form:t[2]}}}return o&&(e=R(o,_(s)),s[12](e)),{c(){e&&O(e.$$.fragment),n=E()},l(t){e&&V(e.$$.fragment,t),n=E()},m(t,i){e&&A(e,t,i),k(t,n,i),r=!0},p(t,i){if(i&2&&o!==(o=t[1][0])){if(e){y();const l=e;g(l.$$.fragment,1,0,()=>{L(l,1)}),D()}o?(e=R(o,_(t)),t[12](e),O(e.$$.fragment),w(e.$$.fragment,1),A(e,n.parentNode,n)):e=null}else if(o){const l={};i&8&&(l.data=t[3]),i&4&&(l.form=t[2]),e.$set(l)}},i(t){r||(e&&w(e.$$.fragment,t),r=!0)},o(t){e&&g(e.$$.fragment,t),r=!1},d(t){t&&h(n),s[12](null),e&&L(e,t)}}}function x(s){let e,n,r;var o=s[1][0];function _(t,i){return{props:{data:t[3],$$slots:{default:[ee]},$$scope:{ctx:t}}}}return o&&(e=R(o,_(s)),s[11](e)),{c(){e&&O(e.$$.fragment),n=E()},l(t){e&&V(e.$$.fragment,t),n=E()},m(t,i){e&&A(e,t,i),k(t,n,i),r=!0},p(t,i){if(i&2&&o!==(o=t[1][0])){if(e){y();const l=e;g(l.$$.fragment,1,0,()=>{L(l,1)}),D()}o?(e=R(o,_(t)),t[11](e),O(e.$$.fragment),w(e.$$.fragment,1),A(e,n.parentNode,n)):e=null}else if(o){const l={};i&8&&(l.data=t[3]),i&8215&&(l.$$scope={dirty:i,ctx:t}),e.$set(l)}},i(t){r||(e&&w(e.$$.fragment,t),r=!0)},o(t){e&&g(e.$$.fragment,t),r=!1},d(t){t&&h(n),s[11](null),e&&L(e,t)}}}function ee(s){let e,n,r;var o=s[1][1];function _(t,i){return{props:{data:t[4],form:t[2]}}}return o&&(e=R(o,_(s)),s[10](e)),{c(){e&&O(e.$$.fragment),n=E()},l(t){e&&V(e.$$.fragment,t),n=E()},m(t,i){e&&A(e,t,i),k(t,n,i),r=!0},p(t,i){if(i&2&&o!==(o=t[1][1])){if(e){y();const l=e;g(l.$$.fragment,1,0,()=>{L(l,1)}),D()}o?(e=R(o,_(t)),t[10](e),O(e.$$.fragment),w(e.$$.fragment,1),A(e,n.parentNode,n)):e=null}else if(o){const l={};i&16&&(l.data=t[4]),i&4&&(l.form=t[2]),e.$set(l)}},i(t){r||(e&&w(e.$$.fragment,t),r=!0)},o(t){e&&g(e.$$.fragment,t),r=!1},d(t){t&&h(n),s[10](null),e&&L(e,t)}}}function j(s){let e,n=s[6]&&q(s);return{c(){e=K("div"),n&&n.c(),this.h()},l(r){e=H(r,"DIV",{id:!0,"aria-live":!0,"aria-atomic":!0,style:!0});var o=J(e);n&&n.l(o),o.forEach(h),this.h()},h(){T(e,"id","svelte-announcer"),T(e,"aria-live","assertive"),T(e,"aria-atomic","true"),p(e,"position","absolute"),p(e,"left","0"),p(e,"top","0"),p(e,"clip","rect(0 0 0 0)"),p(e,"clip-path","inset(50%)"),p(e,"overflow","hidden"),p(e,"white-space","nowrap"),p(e,"width","1px"),p(e,"height","1px")},m(r,o){k(r,e,o),n&&n.m(e,null)},p(r,o){r[6]?n?n.p(r,o):(n=q(r),n.c(),n.m(e,null)):n&&(n.d(1),n=null)},d(r){r&&h(e),n&&n.d()}}}function q(s){let e;return{c(){e=Y(s[7])},l(n){e=X(n,s[7])},m(n,r){k(n,e,r)},p(n,r){r&128&&Q(e,n[7])},d(n){n&&h(e)}}}function te(s){let e,n,r,o,_;const t=[x,$],i=[];function l(a,u){return a[1][1]?0:1}e=l(s),n=i[e]=t[e](s);let c=s[5]&&j(s);return{c(){n.c(),r=z(),c&&c.c(),o=E()},l(a){n.l(a),r=W(a),c&&c.l(a),o=E()},m(a,u){i[e].m(a,u),k(a,r,u),c&&c.m(a,u),k(a,o,u),_=!0},p(a,[u]){let b=e;e=l(a),e===b?i[e].p(a,u):(y(),g(i[b],1,1,()=>{i[b]=null}),D(),n=i[e],n?n.p(a,u):(n=i[e]=t[e](a),n.c()),w(n,1),n.m(r.parentNode,r)),a[5]?c?c.p(a,u):(c=j(a),c.c(),c.m(o.parentNode,o)):c&&(c.d(1),c=null)},i(a){_||(w(n),_=!0)},o(a){g(n),_=!1},d(a){a&&(h(r),h(o)),i[e].d(a),c&&c.d(a)}}}function ne(s,e,n){let{stores:r}=e,{page:o}=e,{constructors:_}=e,{components:t=[]}=e,{form:i}=e,{data_0:l=null}=e,{data_1:c=null}=e;N(r.page.notify);let a=!1,u=!1,b=null;B(()=>{const f=r.page.subscribe(()=>{a&&(n(6,u=!0),U().then(()=>{n(7,b=document.title||"untitled page")}))});return n(5,a=!0),f});function d(f){I[f?"unshift":"push"](()=>{t[1]=f,n(0,t)})}function v(f){I[f?"unshift":"push"](()=>{t[0]=f,n(0,t)})}function P(f){I[f?"unshift":"push"](()=>{t[0]=f,n(0,t)})}return s.$$set=f=>{"stores"in f&&n(8,r=f.stores),"page"in f&&n(9,o=f.page),"constructors"in f&&n(1,_=f.constructors),"components"in f&&n(0,t=f.components),"form"in f&&n(2,i=f.form),"data_0"in f&&n(3,l=f.data_0),"data_1"in f&&n(4,c=f.data_1)},s.$$.update=()=>{s.$$.dirty&768&&r.page.set(o)},[t,_,i,l,c,a,u,b,r,o,d,v,P]}class le extends F{constructor(e){super(),G(this,e,ne,te,C,{stores:8,page:9,constructors:1,components:0,form:2,data_0:3,data_1:4})}}const ce=[()=>m(()=>import("../nodes/0.BhkxfbMC.js"),__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url),()=>m(()=>import("../nodes/1.CNO4bJXv.js"),__vite__mapDeps([8,1,2,5,6,4]),import.meta.url),()=>m(()=>import("../nodes/2.C_8jrQsV.js"),__vite__mapDeps([9,1,2,3,4,10]),import.meta.url),()=>m(()=>import("../nodes/3.Lz_pbSpS.js"),__vite__mapDeps([11,1,2,3,4,12,13,14]),import.meta.url),()=>m(()=>import("../nodes/4.BCB36ta_.js"),__vite__mapDeps([15,1,2,3,4,12,13,16]),import.meta.url),()=>m(()=>import("../nodes/5.CykeLKzi.js"),__vite__mapDeps([17,1,2,3,4,12,13,18]),import.meta.url),()=>m(()=>import("../nodes/6.De73932o.js"),__vite__mapDeps([19,1,2,3,4,20]),import.meta.url),()=>m(()=>import("../nodes/7.6OEKXCWR.js"),__vite__mapDeps([21,1,2,3,4,12,13,22]),import.meta.url),()=>m(()=>import("../nodes/8.niqPZkB9.js"),__vite__mapDeps([23,1,2,3,4,12,13,24]),import.meta.url),()=>m(()=>import("../nodes/9.DRZSbXAV.js"),__vite__mapDeps([25,1,2,3,4,26]),import.meta.url),()=>m(()=>import("../nodes/10.1LgqVOtM.js"),__vite__mapDeps([27,1,2,3,4,12,13,28]),import.meta.url),()=>m(()=>import("../nodes/11.BOfGogcw.js"),__vite__mapDeps([29,1,2,3,4,12,13,30]),import.meta.url)],fe=[],_e={"/":[2],"/cost":[3],"/models":[4],"/overview":[5],"/pricing":[6],"/projects":[7],"/sessions":[8],"/settings":[9],"/tokens":[10],"/tool-calls":[11]},ie={handleError:({error:s})=>{console.error(s)},reroute:()=>{},transport:{}},re=Object.fromEntries(Object.entries(ie.transport).map(([s,e])=>[s,e.decode])),ue=!1,me=(s,e)=>re[s](e);export{me as decode,re as decoders,_e as dictionary,ue as hash,ie as hooks,ae as matchers,ce as nodes,le as root,fe as server_loads};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../nodes/0.Dk6-dCHu.js","../chunks/scheduler.DukoKnjQ.js","../chunks/index.CUfK07C5.js","../chunks/api.D-M_rVlI.js","../chunks/index.BjVwNvJa.js","../chunks/stores.WJ5dxJwL.js","../chunks/entry.DYaPgmil.js","../assets/0.DDbFsqNI.css","../nodes/1.CjGQp8zu.js","../nodes/2.C_8jrQsV.js","../assets/2.fho1OPpm.css","../nodes/3.Lz_pbSpS.js","../chunks/ToolSelector.DIzQsA4_.js","../assets/ToolSelector.HSbC8-q9.css","../assets/3.BmO4KrOR.css","../nodes/4.BCB36ta_.js","../assets/4.TAVgUi8b.css","../nodes/5.CykeLKzi.js","../assets/5.I4bgY8QS.css","../nodes/6.De73932o.js","../assets/6.BeDwa7mS.css","../nodes/7.6OEKXCWR.js","../assets/7.BYQidWiw.css","../nodes/8.niqPZkB9.js","../assets/8.9sovMx-u.css","../nodes/9.DRZSbXAV.js","../assets/9.Doxq00gF.css","../nodes/10.1LgqVOtM.js","../assets/10.BcbNCOTS.css","../nodes/11.BOfGogcw.js","../assets/11.QhlpTtkf.css"])))=>i.map(i=>d[i]);
2
+ import{s as C,h as N,o as B,t as U,j as I}from"../chunks/scheduler.DukoKnjQ.js";import{S as F,i as G,d as h,l as g,m as w,E as y,F as D,a as k,g as W,r as E,j as z,G as R,k as L,u as O,n as A,q as V,o as T,w as p,c as H,e as J,h as K,s as Q,f as X,t as Y}from"../chunks/index.CUfK07C5.js";const Z="modulepreload",M=function(s,e){return new URL(s,e).href},S={},m=function(e,n,r){let o=Promise.resolve();if(n&&n.length>0){const t=document.getElementsByTagName("link"),i=document.querySelector("meta[property=csp-nonce]"),l=(i==null?void 0:i.nonce)||(i==null?void 0:i.getAttribute("nonce"));o=Promise.allSettled(n.map(c=>{if(c=M(c,r),c in S)return;S[c]=!0;const a=c.endsWith(".css"),u=a?'[rel="stylesheet"]':"";if(!!r)for(let v=t.length-1;v>=0;v--){const P=t[v];if(P.href===c&&(!a||P.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${c}"]${u}`))return;const d=document.createElement("link");if(d.rel=a?"stylesheet":Z,a||(d.as="script"),d.crossOrigin="",d.href=c,l&&d.setAttribute("nonce",l),document.head.appendChild(d),a)return new Promise((v,P)=>{d.addEventListener("load",v),d.addEventListener("error",()=>P(new Error(`Unable to preload CSS for ${c}`)))})}))}function _(t){const i=new Event("vite:preloadError",{cancelable:!0});if(i.payload=t,window.dispatchEvent(i),!i.defaultPrevented)throw t}return o.then(t=>{for(const i of t||[])i.status==="rejected"&&_(i.reason);return e().catch(_)})},ae={};function $(s){let e,n,r;var o=s[1][0];function _(t,i){return{props:{data:t[3],form:t[2]}}}return o&&(e=R(o,_(s)),s[12](e)),{c(){e&&O(e.$$.fragment),n=E()},l(t){e&&V(e.$$.fragment,t),n=E()},m(t,i){e&&A(e,t,i),k(t,n,i),r=!0},p(t,i){if(i&2&&o!==(o=t[1][0])){if(e){y();const l=e;g(l.$$.fragment,1,0,()=>{L(l,1)}),D()}o?(e=R(o,_(t)),t[12](e),O(e.$$.fragment),w(e.$$.fragment,1),A(e,n.parentNode,n)):e=null}else if(o){const l={};i&8&&(l.data=t[3]),i&4&&(l.form=t[2]),e.$set(l)}},i(t){r||(e&&w(e.$$.fragment,t),r=!0)},o(t){e&&g(e.$$.fragment,t),r=!1},d(t){t&&h(n),s[12](null),e&&L(e,t)}}}function x(s){let e,n,r;var o=s[1][0];function _(t,i){return{props:{data:t[3],$$slots:{default:[ee]},$$scope:{ctx:t}}}}return o&&(e=R(o,_(s)),s[11](e)),{c(){e&&O(e.$$.fragment),n=E()},l(t){e&&V(e.$$.fragment,t),n=E()},m(t,i){e&&A(e,t,i),k(t,n,i),r=!0},p(t,i){if(i&2&&o!==(o=t[1][0])){if(e){y();const l=e;g(l.$$.fragment,1,0,()=>{L(l,1)}),D()}o?(e=R(o,_(t)),t[11](e),O(e.$$.fragment),w(e.$$.fragment,1),A(e,n.parentNode,n)):e=null}else if(o){const l={};i&8&&(l.data=t[3]),i&8215&&(l.$$scope={dirty:i,ctx:t}),e.$set(l)}},i(t){r||(e&&w(e.$$.fragment,t),r=!0)},o(t){e&&g(e.$$.fragment,t),r=!1},d(t){t&&h(n),s[11](null),e&&L(e,t)}}}function ee(s){let e,n,r;var o=s[1][1];function _(t,i){return{props:{data:t[4],form:t[2]}}}return o&&(e=R(o,_(s)),s[10](e)),{c(){e&&O(e.$$.fragment),n=E()},l(t){e&&V(e.$$.fragment,t),n=E()},m(t,i){e&&A(e,t,i),k(t,n,i),r=!0},p(t,i){if(i&2&&o!==(o=t[1][1])){if(e){y();const l=e;g(l.$$.fragment,1,0,()=>{L(l,1)}),D()}o?(e=R(o,_(t)),t[10](e),O(e.$$.fragment),w(e.$$.fragment,1),A(e,n.parentNode,n)):e=null}else if(o){const l={};i&16&&(l.data=t[4]),i&4&&(l.form=t[2]),e.$set(l)}},i(t){r||(e&&w(e.$$.fragment,t),r=!0)},o(t){e&&g(e.$$.fragment,t),r=!1},d(t){t&&h(n),s[10](null),e&&L(e,t)}}}function j(s){let e,n=s[6]&&q(s);return{c(){e=K("div"),n&&n.c(),this.h()},l(r){e=H(r,"DIV",{id:!0,"aria-live":!0,"aria-atomic":!0,style:!0});var o=J(e);n&&n.l(o),o.forEach(h),this.h()},h(){T(e,"id","svelte-announcer"),T(e,"aria-live","assertive"),T(e,"aria-atomic","true"),p(e,"position","absolute"),p(e,"left","0"),p(e,"top","0"),p(e,"clip","rect(0 0 0 0)"),p(e,"clip-path","inset(50%)"),p(e,"overflow","hidden"),p(e,"white-space","nowrap"),p(e,"width","1px"),p(e,"height","1px")},m(r,o){k(r,e,o),n&&n.m(e,null)},p(r,o){r[6]?n?n.p(r,o):(n=q(r),n.c(),n.m(e,null)):n&&(n.d(1),n=null)},d(r){r&&h(e),n&&n.d()}}}function q(s){let e;return{c(){e=Y(s[7])},l(n){e=X(n,s[7])},m(n,r){k(n,e,r)},p(n,r){r&128&&Q(e,n[7])},d(n){n&&h(e)}}}function te(s){let e,n,r,o,_;const t=[x,$],i=[];function l(a,u){return a[1][1]?0:1}e=l(s),n=i[e]=t[e](s);let c=s[5]&&j(s);return{c(){n.c(),r=z(),c&&c.c(),o=E()},l(a){n.l(a),r=W(a),c&&c.l(a),o=E()},m(a,u){i[e].m(a,u),k(a,r,u),c&&c.m(a,u),k(a,o,u),_=!0},p(a,[u]){let b=e;e=l(a),e===b?i[e].p(a,u):(y(),g(i[b],1,1,()=>{i[b]=null}),D(),n=i[e],n?n.p(a,u):(n=i[e]=t[e](a),n.c()),w(n,1),n.m(r.parentNode,r)),a[5]?c?c.p(a,u):(c=j(a),c.c(),c.m(o.parentNode,o)):c&&(c.d(1),c=null)},i(a){_||(w(n),_=!0)},o(a){g(n),_=!1},d(a){a&&(h(r),h(o)),i[e].d(a),c&&c.d(a)}}}function ne(s,e,n){let{stores:r}=e,{page:o}=e,{constructors:_}=e,{components:t=[]}=e,{form:i}=e,{data_0:l=null}=e,{data_1:c=null}=e;N(r.page.notify);let a=!1,u=!1,b=null;B(()=>{const f=r.page.subscribe(()=>{a&&(n(6,u=!0),U().then(()=>{n(7,b=document.title||"untitled page")}))});return n(5,a=!0),f});function d(f){I[f?"unshift":"push"](()=>{t[1]=f,n(0,t)})}function v(f){I[f?"unshift":"push"](()=>{t[0]=f,n(0,t)})}function P(f){I[f?"unshift":"push"](()=>{t[0]=f,n(0,t)})}return s.$$set=f=>{"stores"in f&&n(8,r=f.stores),"page"in f&&n(9,o=f.page),"constructors"in f&&n(1,_=f.constructors),"components"in f&&n(0,t=f.components),"form"in f&&n(2,i=f.form),"data_0"in f&&n(3,l=f.data_0),"data_1"in f&&n(4,c=f.data_1)},s.$$.update=()=>{s.$$.dirty&768&&r.page.set(o)},[t,_,i,l,c,a,u,b,r,o,d,v,P]}class le extends F{constructor(e){super(),G(this,e,ne,te,C,{stores:8,page:9,constructors:1,components:0,form:2,data_0:3,data_1:4})}}const ce=[()=>m(()=>import("../nodes/0.Dk6-dCHu.js"),__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url),()=>m(()=>import("../nodes/1.CjGQp8zu.js"),__vite__mapDeps([8,1,2,5,6,4]),import.meta.url),()=>m(()=>import("../nodes/2.C_8jrQsV.js"),__vite__mapDeps([9,1,2,3,4,10]),import.meta.url),()=>m(()=>import("../nodes/3.Lz_pbSpS.js"),__vite__mapDeps([11,1,2,3,4,12,13,14]),import.meta.url),()=>m(()=>import("../nodes/4.BCB36ta_.js"),__vite__mapDeps([15,1,2,3,4,12,13,16]),import.meta.url),()=>m(()=>import("../nodes/5.CykeLKzi.js"),__vite__mapDeps([17,1,2,3,4,12,13,18]),import.meta.url),()=>m(()=>import("../nodes/6.De73932o.js"),__vite__mapDeps([19,1,2,3,4,20]),import.meta.url),()=>m(()=>import("../nodes/7.6OEKXCWR.js"),__vite__mapDeps([21,1,2,3,4,12,13,22]),import.meta.url),()=>m(()=>import("../nodes/8.niqPZkB9.js"),__vite__mapDeps([23,1,2,3,4,12,13,24]),import.meta.url),()=>m(()=>import("../nodes/9.DRZSbXAV.js"),__vite__mapDeps([25,1,2,3,4,26]),import.meta.url),()=>m(()=>import("../nodes/10.1LgqVOtM.js"),__vite__mapDeps([27,1,2,3,4,12,13,28]),import.meta.url),()=>m(()=>import("../nodes/11.BOfGogcw.js"),__vite__mapDeps([29,1,2,3,4,12,13,30]),import.meta.url)],fe=[],_e={"/":[2],"/cost":[3],"/models":[4],"/overview":[5],"/pricing":[6],"/projects":[7],"/sessions":[8],"/settings":[9],"/tokens":[10],"/tool-calls":[11]},ie={handleError:({error:s})=>{console.error(s)},reroute:()=>{},transport:{}},re=Object.fromEntries(Object.entries(ie.transport).map(([s,e])=>[s,e.decode])),ue=!1,me=(s,e)=>re[s](e);export{me as decode,re as decoders,_e as dictionary,ue as hash,ie as hooks,ae as matchers,ce as nodes,le as root,fe as server_loads};
@@ -0,0 +1 @@
1
+ import{a as t}from"../chunks/entry.DYaPgmil.js";export{t as start};
@@ -1 +1 @@
1
- import{s as Se,d as we,r as Te,u as Ae,g as Ne,e as Ie,c as se,o as Pe,f as Me}from"../chunks/scheduler.DukoKnjQ.js";import{S as Be,i as De,d as h,v as Le,l as Re,m as Ce,s as P,o as f,a as L,b as i,x as ce,c as _,e as v,g as N,B as He,f as M,h as d,j as I,t as B,z as O}from"../chunks/index.CUfK07C5.js";import{e as ye,o as Ue,p as Ve,q as je,t as Oe,v as Ke}from"../chunks/api.D-M_rVlI.js";import{p as Ye}from"../chunks/stores.BJHWQcKv.js";import{w as Ee}from"../chunks/index.BjVwNvJa.js";const qe="aiusage-theme";function ue(){return typeof window>"u"?"system":localStorage.getItem(qe)||"system"}function ze(){return typeof window>"u"||window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}const fe=Ee(ue()),Fe=Ee(ze());function Ge(){fe.update(s=>s==="system"?"dark":s==="dark"?"light":"system")}function Je(){if(typeof window>"u")return;const s=window.matchMedia("(prefers-color-scheme: dark)");function e(t){const l=t==="system"?ze():t;document.documentElement.setAttribute("data-theme",l),Fe.set(l)}e(ue()),fe.subscribe(t=>{localStorage.setItem(qe,t),e(t)}),s.addEventListener("change",()=>{ue()==="system"&&e("system")})}function ke(s,e,t){const l=s.slice();return l[16]=e[t],l}function be(s){let e,t=s[3](s[16].key)+"",l;return{c(){e=d("a"),l=B(t),this.h()},l(a){e=_(a,"A",{href:!0,class:!0});var r=v(e);l=M(r,t),r.forEach(h),this.h()},h(){f(e,"href",s[16].path),f(e,"class","svelte-zqr7pm"),O(e,"active",s[4].url.pathname===s[16].path)},m(a,r){L(a,e,r),i(e,l)},p(a,r){r&8&&t!==(t=a[3](a[16].key)+"")&&P(l,t),r&144&&O(e,"active",a[4].url.pathname===a[16].path)},d(a){a&&h(e)}}}function Qe(s){let e,t=s[3]("sync.trigger")+"",l;return{c(){e=d("span"),l=B(t),this.h()},l(a){e=_(a,"SPAN",{class:!0});var r=v(e);l=M(r,t),r.forEach(h),this.h()},h(){f(e,"class","sync-label svelte-zqr7pm")},m(a,r){L(a,e,r),i(e,l)},p(a,r){r&8&&t!==(t=a[3]("sync.trigger")+"")&&P(l,t)},d(a){a&&h(e)}}}function We(s){let e,t;return{c(){e=d("span"),t=B(s[2]),this.h()},l(l){e=_(l,"SPAN",{class:!0});var a=v(e);t=M(a,s[2]),a.forEach(h),this.h()},h(){f(e,"class","sync-label svelte-zqr7pm"),O(e,"ok",s[2]===s[3]("sync.complete")),O(e,"err",s[2]===s[3]("sync.failed"))},m(l,a){L(l,e,a),i(e,t)},p(l,a){a&4&&P(t,l[2]),a&12&&O(e,"ok",l[2]===l[3]("sync.complete")),a&12&&O(e,"err",l[2]===l[3]("sync.failed"))},d(l){l&&h(e)}}}function Xe(s){let e,t=s[3]("sync.syncing")+"",l;return{c(){e=d("span"),l=B(t),this.h()},l(a){e=_(a,"SPAN",{class:!0});var r=v(e);l=M(r,t),r.forEach(h),this.h()},h(){f(e,"class","sync-label svelte-zqr7pm")},m(a,r){L(a,e,r),i(e,l)},p(a,r){r&8&&t!==(t=a[3]("sync.syncing")+"")&&P(l,t)},d(a){a&&h(e)}}}function Ze(s){let e,t,l,a,r,K='<span class="logo svelte-zqr7pm">⌘</span> <span class="name svelte-zqr7pm">AIUsage</span>',Y,w,F,q,o,g,y=s[1]?"↻":"⇅",z,R,C,A,k,c,T=s[8][s[5]]+"",W,le,H,G=s[3](`theme.${s[5]}`)+"",X,Z,ne,D,J=s[6]==="en"?"中文":"EN",$,ae,U,b,re,he,V=ye(s[7]),p=[];for(let n=0;n<V.length;n+=1)p[n]=be(ke(s,V,n));function me(n,m){return n[1]?Xe:n[2]?We:Qe}let x=me(s),S=x(s);const oe=s[12].default,E=we(oe,s,s[11],null);return{c(){e=d("div"),t=I(),l=d("div"),a=d("header"),r=d("a"),r.innerHTML=K,Y=I(),w=d("nav");for(let n=0;n<p.length;n+=1)p[n].c();F=I(),q=d("div"),o=d("button"),g=d("span"),z=B(y),R=I(),S.c(),A=I(),k=d("button"),c=d("span"),W=B(T),le=I(),H=d("span"),X=B(G),ne=I(),D=d("button"),$=B(J),ae=I(),U=d("main"),E&&E.c(),this.h()},l(n){e=_(n,"DIV",{class:!0}),v(e).forEach(h),t=N(n),l=_(n,"DIV",{class:!0});var m=v(l);a=_(m,"HEADER",{class:!0});var u=v(a);r=_(u,"A",{href:!0,class:!0,"data-svelte-h":!0}),He(r)!=="svelte-tkxtzm"&&(r.innerHTML=K),Y=N(u),w=_(u,"NAV",{class:!0});var Q=v(w);for(let ie=0;ie<p.length;ie+=1)p[ie].l(Q);Q.forEach(h),F=N(u),q=_(u,"DIV",{class:!0});var j=v(q);o=_(j,"BUTTON",{class:!0,title:!0});var ee=v(o);g=_(ee,"SPAN",{class:!0});var pe=v(g);z=M(pe,y),pe.forEach(h),R=N(ee),S.l(ee),ee.forEach(h),A=N(j),k=_(j,"BUTTON",{class:!0,title:!0});var te=v(k);c=_(te,"SPAN",{class:!0});var _e=v(c);W=M(_e,T),_e.forEach(h),le=N(te),H=_(te,"SPAN",{class:!0});var de=v(H);X=M(de,G),de.forEach(h),te.forEach(h),ne=N(j),D=_(j,"BUTTON",{class:!0});var ve=v(D);$=M(ve,J),ve.forEach(h),j.forEach(h),u.forEach(h),ae=N(m),U=_(m,"MAIN",{class:!0});var ge=v(U);E&&E.l(ge),ge.forEach(h),m.forEach(h),this.h()},h(){f(e,"class","grain svelte-zqr7pm"),f(r,"href","/"),f(r,"class","brand svelte-zqr7pm"),f(w,"class","svelte-zqr7pm"),f(g,"class","sync-icon svelte-zqr7pm"),f(o,"class","sync-toggle svelte-zqr7pm"),o.disabled=s[1],f(o,"title",C=s[0]?`${s[3]("sync.lastSync")}: ${s[10](s[0].lastSyncAt)}`:s[3]("sync.notConfigured")),f(c,"class","theme-icon svelte-zqr7pm"),f(H,"class","theme-label svelte-zqr7pm"),f(k,"class","theme-toggle svelte-zqr7pm"),f(k,"title",Z=s[3](`theme.${s[5]}`)),f(D,"class","lang-toggle svelte-zqr7pm"),f(q,"class","controls svelte-zqr7pm"),f(a,"class","svelte-zqr7pm"),f(U,"class","svelte-zqr7pm"),f(l,"class","app svelte-zqr7pm")},m(n,m){L(n,e,m),L(n,t,m),L(n,l,m),i(l,a),i(a,r),i(a,Y),i(a,w);for(let u=0;u<p.length;u+=1)p[u]&&p[u].m(w,null);i(a,F),i(a,q),i(q,o),i(o,g),i(g,z),i(o,R),S.m(o,null),i(q,A),i(q,k),i(k,c),i(c,W),i(k,le),i(k,H),i(H,X),i(q,ne),i(q,D),i(D,$),i(l,ae),i(l,U),E&&E.m(U,null),b=!0,re||(he=[ce(o,"click",s[9]),ce(k,"click",Ge),ce(D,"click",je)],re=!0)},p(n,[m]){if(m&152){V=ye(n[7]);let u;for(u=0;u<V.length;u+=1){const Q=ke(n,V,u);p[u]?p[u].p(Q,m):(p[u]=be(Q),p[u].c(),p[u].m(w,null))}for(;u<p.length;u+=1)p[u].d(1);p.length=V.length}(!b||m&2)&&y!==(y=n[1]?"↻":"⇅")&&P(z,y),x===(x=me(n))&&S?S.p(n,m):(S.d(1),S=x(n),S&&(S.c(),S.m(o,null))),(!b||m&2)&&(o.disabled=n[1]),(!b||m&9&&C!==(C=n[0]?`${n[3]("sync.lastSync")}: ${n[10](n[0].lastSyncAt)}`:n[3]("sync.notConfigured")))&&f(o,"title",C),(!b||m&32)&&T!==(T=n[8][n[5]]+"")&&P(W,T),(!b||m&40)&&G!==(G=n[3](`theme.${n[5]}`)+"")&&P(X,G),(!b||m&40&&Z!==(Z=n[3](`theme.${n[5]}`)))&&f(k,"title",Z),(!b||m&64)&&J!==(J=n[6]==="en"?"中文":"EN")&&P($,J),E&&E.p&&(!b||m&2048)&&Ae(E,oe,n,n[11],b?Ie(oe,n[11],m,null):Ne(n[11]),null)},i(n){b||(Ce(E,n),b=!0)},o(n){Re(E,n),b=!1},d(n){n&&(h(e),h(t),h(l)),Le(p,n),S.d(),E&&E.d(n),re=!1,Te(he)}}}function $e(s,e,t){let l,a,r,K;se(s,Oe,c=>t(3,l=c)),se(s,Ye,c=>t(4,a=c)),se(s,fe,c=>t(5,r=c)),se(s,Ke,c=>t(6,K=c));let{$$slots:Y={},$$scope:w}=e;const F=[{path:"/overview",key:"nav.overview"},{path:"/tokens",key:"nav.tokens"},{path:"/cost",key:"nav.cost"},{path:"/models",key:"nav.models"},{path:"/tool-calls",key:"nav.toolCalls"},{path:"/projects",key:"nav.projects"},{path:"/sessions",key:"nav.sessions"},{path:"/pricing",key:"nav.pricing"},{path:"/settings",key:"nav.settings"}],q={system:"◐",dark:"●",light:"○"};let o=null,g=!1,y="",z=null;async function R(){try{const c=await Ue();t(0,o=c.status),t(1,g=!!(o!=null&&o.isRunning)),A()}catch{t(0,o=null),t(1,g=!1),A()}}async function C(){var c;t(2,y="");try{const T=await Ve();t(0,o=T.status),t(1,g=!!((c=T.status)!=null&&c.isRunning)),t(2,y=T.alreadyRunning?l("sync.inProgress"):l("sync.started")),A()}catch{t(2,y=l("sync.failed")),t(1,g=!1),A()}setTimeout(()=>{g||t(2,y="")},3e3)}function A(){z&&(clearInterval(z),z=null),g&&(z=setInterval(async()=>{await R(),o!=null&&o.isRunning||(t(2,y=(o==null?void 0:o.lastSyncStatus)==="ok"?l("sync.complete"):(o==null?void 0:o.lastSyncError)||l("sync.failed")),setTimeout(()=>{t(2,y="")},5e3))},2e3))}function k(c){return c?new Date(c).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):l("sync.never")}return Pe(()=>{Je(),R()}),Me(()=>{z&&clearInterval(z)}),s.$$set=c=>{"$$scope"in c&&t(11,w=c.$$scope)},[o,g,y,l,a,r,K,F,q,C,k,w,Y]}class nt extends Be{constructor(e){super(),De(this,e,$e,Ze,Se,{})}}export{nt as component};
1
+ import{s as Se,d as we,r as Te,u as Ae,g as Ne,e as Ie,c as se,o as Pe,f as Me}from"../chunks/scheduler.DukoKnjQ.js";import{S as Be,i as De,d as h,v as Le,l as Re,m as Ce,s as P,o as f,a as L,b as i,x as ce,c as _,e as v,g as N,B as He,f as M,h as d,j as I,t as B,z as O}from"../chunks/index.CUfK07C5.js";import{e as ye,o as Ue,p as Ve,q as je,t as Oe,v as Ke}from"../chunks/api.D-M_rVlI.js";import{p as Ye}from"../chunks/stores.WJ5dxJwL.js";import{w as Ee}from"../chunks/index.BjVwNvJa.js";const qe="aiusage-theme";function ue(){return typeof window>"u"?"system":localStorage.getItem(qe)||"system"}function ze(){return typeof window>"u"||window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}const fe=Ee(ue()),Fe=Ee(ze());function Ge(){fe.update(s=>s==="system"?"dark":s==="dark"?"light":"system")}function Je(){if(typeof window>"u")return;const s=window.matchMedia("(prefers-color-scheme: dark)");function e(t){const l=t==="system"?ze():t;document.documentElement.setAttribute("data-theme",l),Fe.set(l)}e(ue()),fe.subscribe(t=>{localStorage.setItem(qe,t),e(t)}),s.addEventListener("change",()=>{ue()==="system"&&e("system")})}function ke(s,e,t){const l=s.slice();return l[16]=e[t],l}function be(s){let e,t=s[3](s[16].key)+"",l;return{c(){e=d("a"),l=B(t),this.h()},l(a){e=_(a,"A",{href:!0,class:!0});var r=v(e);l=M(r,t),r.forEach(h),this.h()},h(){f(e,"href",s[16].path),f(e,"class","svelte-zqr7pm"),O(e,"active",s[4].url.pathname===s[16].path)},m(a,r){L(a,e,r),i(e,l)},p(a,r){r&8&&t!==(t=a[3](a[16].key)+"")&&P(l,t),r&144&&O(e,"active",a[4].url.pathname===a[16].path)},d(a){a&&h(e)}}}function Qe(s){let e,t=s[3]("sync.trigger")+"",l;return{c(){e=d("span"),l=B(t),this.h()},l(a){e=_(a,"SPAN",{class:!0});var r=v(e);l=M(r,t),r.forEach(h),this.h()},h(){f(e,"class","sync-label svelte-zqr7pm")},m(a,r){L(a,e,r),i(e,l)},p(a,r){r&8&&t!==(t=a[3]("sync.trigger")+"")&&P(l,t)},d(a){a&&h(e)}}}function We(s){let e,t;return{c(){e=d("span"),t=B(s[2]),this.h()},l(l){e=_(l,"SPAN",{class:!0});var a=v(e);t=M(a,s[2]),a.forEach(h),this.h()},h(){f(e,"class","sync-label svelte-zqr7pm"),O(e,"ok",s[2]===s[3]("sync.complete")),O(e,"err",s[2]===s[3]("sync.failed"))},m(l,a){L(l,e,a),i(e,t)},p(l,a){a&4&&P(t,l[2]),a&12&&O(e,"ok",l[2]===l[3]("sync.complete")),a&12&&O(e,"err",l[2]===l[3]("sync.failed"))},d(l){l&&h(e)}}}function Xe(s){let e,t=s[3]("sync.syncing")+"",l;return{c(){e=d("span"),l=B(t),this.h()},l(a){e=_(a,"SPAN",{class:!0});var r=v(e);l=M(r,t),r.forEach(h),this.h()},h(){f(e,"class","sync-label svelte-zqr7pm")},m(a,r){L(a,e,r),i(e,l)},p(a,r){r&8&&t!==(t=a[3]("sync.syncing")+"")&&P(l,t)},d(a){a&&h(e)}}}function Ze(s){let e,t,l,a,r,K='<span class="logo svelte-zqr7pm">⌘</span> <span class="name svelte-zqr7pm">AIUsage</span>',Y,w,F,q,o,g,y=s[1]?"↻":"⇅",z,R,C,A,k,c,T=s[8][s[5]]+"",W,le,H,G=s[3](`theme.${s[5]}`)+"",X,Z,ne,D,J=s[6]==="en"?"中文":"EN",$,ae,U,b,re,he,V=ye(s[7]),p=[];for(let n=0;n<V.length;n+=1)p[n]=be(ke(s,V,n));function me(n,m){return n[1]?Xe:n[2]?We:Qe}let x=me(s),S=x(s);const oe=s[12].default,E=we(oe,s,s[11],null);return{c(){e=d("div"),t=I(),l=d("div"),a=d("header"),r=d("a"),r.innerHTML=K,Y=I(),w=d("nav");for(let n=0;n<p.length;n+=1)p[n].c();F=I(),q=d("div"),o=d("button"),g=d("span"),z=B(y),R=I(),S.c(),A=I(),k=d("button"),c=d("span"),W=B(T),le=I(),H=d("span"),X=B(G),ne=I(),D=d("button"),$=B(J),ae=I(),U=d("main"),E&&E.c(),this.h()},l(n){e=_(n,"DIV",{class:!0}),v(e).forEach(h),t=N(n),l=_(n,"DIV",{class:!0});var m=v(l);a=_(m,"HEADER",{class:!0});var u=v(a);r=_(u,"A",{href:!0,class:!0,"data-svelte-h":!0}),He(r)!=="svelte-tkxtzm"&&(r.innerHTML=K),Y=N(u),w=_(u,"NAV",{class:!0});var Q=v(w);for(let ie=0;ie<p.length;ie+=1)p[ie].l(Q);Q.forEach(h),F=N(u),q=_(u,"DIV",{class:!0});var j=v(q);o=_(j,"BUTTON",{class:!0,title:!0});var ee=v(o);g=_(ee,"SPAN",{class:!0});var pe=v(g);z=M(pe,y),pe.forEach(h),R=N(ee),S.l(ee),ee.forEach(h),A=N(j),k=_(j,"BUTTON",{class:!0,title:!0});var te=v(k);c=_(te,"SPAN",{class:!0});var _e=v(c);W=M(_e,T),_e.forEach(h),le=N(te),H=_(te,"SPAN",{class:!0});var de=v(H);X=M(de,G),de.forEach(h),te.forEach(h),ne=N(j),D=_(j,"BUTTON",{class:!0});var ve=v(D);$=M(ve,J),ve.forEach(h),j.forEach(h),u.forEach(h),ae=N(m),U=_(m,"MAIN",{class:!0});var ge=v(U);E&&E.l(ge),ge.forEach(h),m.forEach(h),this.h()},h(){f(e,"class","grain svelte-zqr7pm"),f(r,"href","/"),f(r,"class","brand svelte-zqr7pm"),f(w,"class","svelte-zqr7pm"),f(g,"class","sync-icon svelte-zqr7pm"),f(o,"class","sync-toggle svelte-zqr7pm"),o.disabled=s[1],f(o,"title",C=s[0]?`${s[3]("sync.lastSync")}: ${s[10](s[0].lastSyncAt)}`:s[3]("sync.notConfigured")),f(c,"class","theme-icon svelte-zqr7pm"),f(H,"class","theme-label svelte-zqr7pm"),f(k,"class","theme-toggle svelte-zqr7pm"),f(k,"title",Z=s[3](`theme.${s[5]}`)),f(D,"class","lang-toggle svelte-zqr7pm"),f(q,"class","controls svelte-zqr7pm"),f(a,"class","svelte-zqr7pm"),f(U,"class","svelte-zqr7pm"),f(l,"class","app svelte-zqr7pm")},m(n,m){L(n,e,m),L(n,t,m),L(n,l,m),i(l,a),i(a,r),i(a,Y),i(a,w);for(let u=0;u<p.length;u+=1)p[u]&&p[u].m(w,null);i(a,F),i(a,q),i(q,o),i(o,g),i(g,z),i(o,R),S.m(o,null),i(q,A),i(q,k),i(k,c),i(c,W),i(k,le),i(k,H),i(H,X),i(q,ne),i(q,D),i(D,$),i(l,ae),i(l,U),E&&E.m(U,null),b=!0,re||(he=[ce(o,"click",s[9]),ce(k,"click",Ge),ce(D,"click",je)],re=!0)},p(n,[m]){if(m&152){V=ye(n[7]);let u;for(u=0;u<V.length;u+=1){const Q=ke(n,V,u);p[u]?p[u].p(Q,m):(p[u]=be(Q),p[u].c(),p[u].m(w,null))}for(;u<p.length;u+=1)p[u].d(1);p.length=V.length}(!b||m&2)&&y!==(y=n[1]?"↻":"⇅")&&P(z,y),x===(x=me(n))&&S?S.p(n,m):(S.d(1),S=x(n),S&&(S.c(),S.m(o,null))),(!b||m&2)&&(o.disabled=n[1]),(!b||m&9&&C!==(C=n[0]?`${n[3]("sync.lastSync")}: ${n[10](n[0].lastSyncAt)}`:n[3]("sync.notConfigured")))&&f(o,"title",C),(!b||m&32)&&T!==(T=n[8][n[5]]+"")&&P(W,T),(!b||m&40)&&G!==(G=n[3](`theme.${n[5]}`)+"")&&P(X,G),(!b||m&40&&Z!==(Z=n[3](`theme.${n[5]}`)))&&f(k,"title",Z),(!b||m&64)&&J!==(J=n[6]==="en"?"中文":"EN")&&P($,J),E&&E.p&&(!b||m&2048)&&Ae(E,oe,n,n[11],b?Ie(oe,n[11],m,null):Ne(n[11]),null)},i(n){b||(Ce(E,n),b=!0)},o(n){Re(E,n),b=!1},d(n){n&&(h(e),h(t),h(l)),Le(p,n),S.d(),E&&E.d(n),re=!1,Te(he)}}}function $e(s,e,t){let l,a,r,K;se(s,Oe,c=>t(3,l=c)),se(s,Ye,c=>t(4,a=c)),se(s,fe,c=>t(5,r=c)),se(s,Ke,c=>t(6,K=c));let{$$slots:Y={},$$scope:w}=e;const F=[{path:"/overview",key:"nav.overview"},{path:"/tokens",key:"nav.tokens"},{path:"/cost",key:"nav.cost"},{path:"/models",key:"nav.models"},{path:"/tool-calls",key:"nav.toolCalls"},{path:"/projects",key:"nav.projects"},{path:"/sessions",key:"nav.sessions"},{path:"/pricing",key:"nav.pricing"},{path:"/settings",key:"nav.settings"}],q={system:"◐",dark:"●",light:"○"};let o=null,g=!1,y="",z=null;async function R(){try{const c=await Ue();t(0,o=c.status),t(1,g=!!(o!=null&&o.isRunning)),A()}catch{t(0,o=null),t(1,g=!1),A()}}async function C(){var c;t(2,y="");try{const T=await Ve();t(0,o=T.status),t(1,g=!!((c=T.status)!=null&&c.isRunning)),t(2,y=T.alreadyRunning?l("sync.inProgress"):l("sync.started")),A()}catch{t(2,y=l("sync.failed")),t(1,g=!1),A()}setTimeout(()=>{g||t(2,y="")},3e3)}function A(){z&&(clearInterval(z),z=null),g&&(z=setInterval(async()=>{await R(),o!=null&&o.isRunning||(t(2,y=(o==null?void 0:o.lastSyncStatus)==="ok"?l("sync.complete"):(o==null?void 0:o.lastSyncError)||l("sync.failed")),setTimeout(()=>{t(2,y="")},5e3))},2e3))}function k(c){return c?new Date(c).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):l("sync.never")}return Pe(()=>{Je(),R()}),Me(()=>{z&&clearInterval(z)}),s.$$set=c=>{"$$scope"in c&&t(11,w=c.$$scope)},[o,g,y,l,a,r,K,F,q,C,k,w,Y]}class nt extends Be{constructor(e){super(),De(this,e,$e,Ze,Se,{})}}export{nt as component};
@@ -1 +1 @@
1
- import{s as x,n as u,c as S}from"../chunks/scheduler.DukoKnjQ.js";import{S as j,i as q,d as c,s as h,a as _,b as d,c as v,e as g,f as b,g as y,h as E,t as $,j as C}from"../chunks/index.CUfK07C5.js";import{p as H}from"../chunks/stores.BJHWQcKv.js";function P(p){var f;let a,s=p[0].status+"",r,o,n,i=((f=p[0].error)==null?void 0:f.message)+"",m;return{c(){a=E("h1"),r=$(s),o=C(),n=E("p"),m=$(i)},l(e){a=v(e,"H1",{});var t=g(a);r=b(t,s),t.forEach(c),o=y(e),n=v(e,"P",{});var l=g(n);m=b(l,i),l.forEach(c)},m(e,t){_(e,a,t),d(a,r),_(e,o,t),_(e,n,t),d(n,m)},p(e,[t]){var l;t&1&&s!==(s=e[0].status+"")&&h(r,s),t&1&&i!==(i=((l=e[0].error)==null?void 0:l.message)+"")&&h(m,i)},i:u,o:u,d(e){e&&(c(a),c(o),c(n))}}}function k(p,a,s){let r;return S(p,H,o=>s(0,r=o)),[r]}class B extends j{constructor(a){super(),q(this,a,k,P,x,{})}}export{B as component};
1
+ import{s as x,n as u,c as S}from"../chunks/scheduler.DukoKnjQ.js";import{S as j,i as q,d as c,s as h,a as _,b as d,c as v,e as g,f as b,g as y,h as E,t as $,j as C}from"../chunks/index.CUfK07C5.js";import{p as H}from"../chunks/stores.WJ5dxJwL.js";function P(p){var f;let a,s=p[0].status+"",r,o,n,i=((f=p[0].error)==null?void 0:f.message)+"",m;return{c(){a=E("h1"),r=$(s),o=C(),n=E("p"),m=$(i)},l(e){a=v(e,"H1",{});var t=g(a);r=b(t,s),t.forEach(c),o=y(e),n=v(e,"P",{});var l=g(n);m=b(l,i),l.forEach(c)},m(e,t){_(e,a,t),d(a,r),_(e,o,t),_(e,n,t),d(n,m)},p(e,[t]){var l;t&1&&s!==(s=e[0].status+"")&&h(r,s),t&1&&i!==(i=((l=e[0].error)==null?void 0:l.message)+"")&&h(m,i)},i:u,o:u,d(e){e&&(c(a),c(o),c(n))}}}function k(p,a,s){let r;return S(p,H,o=>s(0,r=o)),[r]}class B extends j{constructor(a){super(),q(this,a,k,P,x,{})}}export{B as component};
@@ -1 +1 @@
1
- {"version":"1779001042128"}
1
+ {"version":"1779003570696"}
@@ -17,26 +17,26 @@
17
17
  })();
18
18
  </script>
19
19
 
20
- <link rel="modulepreload" href="/_app/immutable/entry/start.DyuR4tFJ.js">
21
- <link rel="modulepreload" href="/_app/immutable/chunks/entry.-i5eOrF8.js">
20
+ <link rel="modulepreload" href="/_app/immutable/entry/start.DIxZ9qE_.js">
21
+ <link rel="modulepreload" href="/_app/immutable/chunks/entry.DYaPgmil.js">
22
22
  <link rel="modulepreload" href="/_app/immutable/chunks/scheduler.DukoKnjQ.js">
23
23
  <link rel="modulepreload" href="/_app/immutable/chunks/index.BjVwNvJa.js">
24
- <link rel="modulepreload" href="/_app/immutable/entry/app.Pb7AfjR8.js">
24
+ <link rel="modulepreload" href="/_app/immutable/entry/app.C6dQgA3c.js">
25
25
  <link rel="modulepreload" href="/_app/immutable/chunks/index.CUfK07C5.js">
26
26
  </head>
27
27
  <body data-sveltekit-preload-data="hover">
28
28
  <div style="display: contents">
29
29
  <script>
30
30
  {
31
- __sveltekit_g5ij2p = {
31
+ __sveltekit_1azk3th = {
32
32
  base: ""
33
33
  };
34
34
 
35
35
  const element = document.currentScript.parentElement;
36
36
 
37
37
  Promise.all([
38
- import("/_app/immutable/entry/start.DyuR4tFJ.js"),
39
- import("/_app/immutable/entry/app.Pb7AfjR8.js")
38
+ import("/_app/immutable/entry/start.DIxZ9qE_.js"),
39
+ import("/_app/immutable/entry/app.C6dQgA3c.js")
40
40
  ]).then(([kit, app]) => {
41
41
  kit.start(app, element);
42
42
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@juliantanx/aiusage",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "type": "module",
5
5
  "description": "Track and analyze AI coding assistant usage across Claude Code, Codex, and more",
6
6
  "main": "./dist/index.js",
@@ -9,7 +9,8 @@
9
9
  "aiusage": "./dist/index.js"
10
10
  },
11
11
  "files": [
12
- "dist"
12
+ "dist",
13
+ "README.md"
13
14
  ],
14
15
  "dependencies": {
15
16
  "@aws-sdk/client-s3": "^3.700.0",
@@ -23,7 +24,7 @@
23
24
  "tsx": "^4.0.0",
24
25
  "typescript": "^5.7.0",
25
26
  "vitest": "^3.0.0",
26
- "@aiusage/core": "1.0.4",
27
+ "@aiusage/core": "1.0.5",
27
28
  "@aiusage/web": "0.0.1"
28
29
  },
29
30
  "scripts": {
@@ -1,3 +0,0 @@
1
- var mt=Object.defineProperty;var wt=(e,n,t)=>n in e?mt(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t;var P=(e,n,t)=>wt(e,typeof n!="symbol"?n+"":n,t);import{o as Oe,t as yt}from"./scheduler.DukoKnjQ.js";import{w as ye}from"./index.BjVwNvJa.js";new URL("sveltekit-internal://");function _t(e,n){return e==="/"||n==="ignore"?e:n==="never"?e.endsWith("/")?e.slice(0,-1):e:n==="always"&&!e.endsWith("/")?e+"/":e}function vt(e){return e.split("%25").map(decodeURI).join("%25")}function bt(e){for(const n in e)e[n]=decodeURIComponent(e[n]);return e}function ue({href:e}){return e.split("#")[0]}function At(e,n,t,r=!1){const a=new URL(e);Object.defineProperty(a,"searchParams",{value:new Proxy(a.searchParams,{get(o,c){if(c==="get"||c==="getAll"||c==="has")return f=>(t(f),o[c](f));n();const i=Reflect.get(o,c);return typeof i=="function"?i.bind(o):i}}),enumerable:!0,configurable:!0});const s=["href","pathname","search","toString","toJSON"];r&&s.push("hash");for(const o of s)Object.defineProperty(a,o,{get(){return n(),e[o]},enumerable:!0,configurable:!0});return a}const Et="/__data.json",kt=".html__data.json";function St(e){return e.endsWith(".html")?e.replace(/\.html$/,kt):e.replace(/\/$/,"")+Et}function Rt(...e){let n=5381;for(const t of e)if(typeof t=="string"){let r=t.length;for(;r;)n=n*33^t.charCodeAt(--r)}else if(ArrayBuffer.isView(t)){const r=new Uint8Array(t.buffer,t.byteOffset,t.byteLength);let a=r.length;for(;a;)n=n*33^r[--a]}else throw new TypeError("value must be a string or TypedArray");return(n>>>0).toString(36)}function It(e){const n=atob(e),t=new Uint8Array(n.length);for(let r=0;r<n.length;r++)t[r]=n.charCodeAt(r);return t.buffer}const He=window.fetch;window.fetch=(e,n)=>((e instanceof Request?e.method:(n==null?void 0:n.method)||"GET")!=="GET"&&M.delete(_e(e)),He(e,n));const M=new Map;function Ut(e,n){const t=_e(e,n),r=document.querySelector(t);if(r!=null&&r.textContent){let{body:a,...s}=JSON.parse(r.textContent);const o=r.getAttribute("data-ttl");return o&&M.set(t,{body:a,init:s,ttl:1e3*Number(o)}),r.getAttribute("data-b64")!==null&&(a=It(a)),Promise.resolve(new Response(a,s))}return window.fetch(e,n)}function Tt(e,n,t){if(M.size>0){const r=_e(e,t),a=M.get(r);if(a){if(performance.now()<a.ttl&&["default","force-cache","only-if-cached",void 0].includes(t==null?void 0:t.cache))return new Response(a.body,a.init);M.delete(r)}}return window.fetch(n,t)}function _e(e,n){let r=`script[data-sveltekit-fetched][data-url=${JSON.stringify(e instanceof Request?e.url:e)}]`;if(n!=null&&n.headers||n!=null&&n.body){const a=[];n.headers&&a.push([...new Headers(n.headers)].join(",")),n.body&&(typeof n.body=="string"||ArrayBuffer.isView(n.body))&&a.push(n.body),r+=`[data-hash="${Rt(...a)}"]`}return r}const Lt=/^(\[)?(\.\.\.)?(\w+)(?:=(\w+))?(\])?$/;function Pt(e){const n=[];return{pattern:e==="/"?/^\/$/:new RegExp(`^${Ot(e).map(r=>{const a=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(r);if(a)return n.push({name:a[1],matcher:a[2],optional:!1,rest:!0,chained:!0}),"(?:/(.*))?";const s=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(r);if(s)return n.push({name:s[1],matcher:s[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!r)return;const o=r.split(/\[(.+?)\](?!\])/);return"/"+o.map((i,f)=>{if(f%2){if(i.startsWith("x+"))return de(String.fromCharCode(parseInt(i.slice(2),16)));if(i.startsWith("u+"))return de(String.fromCharCode(...i.slice(2).split("-").map(l=>parseInt(l,16))));const h=Lt.exec(i),[,u,g,p,d]=h;return n.push({name:p,matcher:d,optional:!!u,rest:!!g,chained:g?f===1&&o[0]==="":!1}),g?"(.*?)":u?"([^/]*)?":"([^/]+?)"}return de(i)}).join("")}).join("")}/?$`),params:n}}function jt(e){return!/^\([^)]+\)$/.test(e)}function Ot(e){return e.slice(1).split("/").filter(jt)}function Nt(e,n,t){const r={},a=e.slice(1),s=a.filter(c=>c!==void 0);let o=0;for(let c=0;c<n.length;c+=1){const i=n[c];let f=a[c-o];if(i.chained&&i.rest&&o&&(f=a.slice(c-o,c+1).filter(h=>h).join("/"),o=0),f===void 0){i.rest&&(r[i.name]="");continue}if(!i.matcher||t[i.matcher](f)){r[i.name]=f;const h=n[c+1],u=a[c+1];h&&!h.rest&&h.optional&&u&&i.chained&&(o=0),!h&&!u&&Object.keys(r).length===s.length&&(o=0);continue}if(i.optional&&i.chained){o++;continue}return}if(!o)return r}function de(e){return e.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}function $t({nodes:e,server_loads:n,dictionary:t,matchers:r}){const a=new Set(n);return Object.entries(t).map(([c,[i,f,h]])=>{const{pattern:u,params:g}=Pt(c),p={id:c,exec:d=>{const l=u.exec(d);if(l)return Nt(l,g,r)},errors:[1,...h||[]].map(d=>e[d]),layouts:[0,...f||[]].map(o),leaf:s(i)};return p.errors.length=p.layouts.length=Math.max(p.errors.length,p.layouts.length),p});function s(c){const i=c<0;return i&&(c=~c),[i,e[c]]}function o(c){return c===void 0?c:[a.has(c),e[c]]}}function Ke(e,n=JSON.parse){try{return n(sessionStorage[e])}catch{}}function Ne(e,n,t=JSON.stringify){const r=t(n);try{sessionStorage[e]=r}catch{}}var Me;const L=((Me=globalThis.__sveltekit_g5ij2p)==null?void 0:Me.base)??"";var qe;const xt=((qe=globalThis.__sveltekit_g5ij2p)==null?void 0:qe.assets)??L,Ct="1779001042128",We="sveltekit:snapshot",Ye="sveltekit:scroll",Je="sveltekit:states",Dt="sveltekit:pageurl",C="sveltekit:history",H="sveltekit:navigation",z={tap:1,hover:2,viewport:3,eager:4,off:-1,false:-1},J=location.origin;function ze(e){if(e instanceof URL)return e;let n=document.baseURI;if(!n){const t=document.getElementsByTagName("base");n=t.length?t[0].href:document.URL}return new URL(e,n)}function ve(){return{x:pageXOffset,y:pageYOffset}}function x(e,n){return e.getAttribute(`data-sveltekit-${n}`)}const $e={...z,"":z.hover};function Xe(e){let n=e.assignedSlot??e.parentNode;return(n==null?void 0:n.nodeType)===11&&(n=n.host),n}function Ze(e,n){for(;e&&e!==n;){if(e.nodeName.toUpperCase()==="A"&&e.hasAttribute("href"))return e;e=Xe(e)}}function ge(e,n,t){let r;try{r=new URL(e instanceof SVGAElement?e.href.baseVal:e.href,document.baseURI)}catch{}const a=e instanceof SVGAElement?e.target.baseVal:e.target,s=!r||!!a||oe(r,n,t)||(e.getAttribute("rel")||"").split(/\s+/).includes("external"),o=(r==null?void 0:r.origin)===J&&e.hasAttribute("download");return{url:r,external:s,target:a,download:o}}function X(e){let n=null,t=null,r=null,a=null,s=null,o=null,c=e;for(;c&&c!==document.documentElement;)r===null&&(r=x(c,"preload-code")),a===null&&(a=x(c,"preload-data")),n===null&&(n=x(c,"keepfocus")),t===null&&(t=x(c,"noscroll")),s===null&&(s=x(c,"reload")),o===null&&(o=x(c,"replacestate")),c=Xe(c);function i(f){switch(f){case"":case"true":return!0;case"off":case"false":return!1;default:return}}return{preload_code:$e[r??"off"],preload_data:$e[a??"off"],keepfocus:i(n),noscroll:i(t),reload:i(s),replace_state:i(o)}}function xe(e){const n=ye(e);let t=!0;function r(){t=!0,n.update(o=>o)}function a(o){t=!1,n.set(o)}function s(o){let c;return n.subscribe(i=>{(c===void 0||t&&i!==c)&&o(c=i)})}return{notify:r,set:a,subscribe:s}}const Qe={v:()=>{}};function Bt(){const{set:e,subscribe:n}=ye(!1);let t;async function r(){clearTimeout(t);try{const a=await fetch(`${xt}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!a.ok)return!1;const o=(await a.json()).version!==Ct;return o&&(e(!0),Qe.v(),clearTimeout(t)),o}catch{return!1}}return{subscribe:n,check:r}}function oe(e,n,t){return e.origin!==J||!e.pathname.startsWith(n)?!0:t?!(e.pathname===n+"/"||e.protocol==="file:"&&e.pathname.replace(/\/[^/]+\.html?$/,"")===n):!1}function Ft(e){return Uint8Array.fromBase64(e).buffer}function Vt(e){return Uint8Array.from(Buffer.from(e,"base64")).buffer}function Mt(e){const n=atob(e),t=n.length,r=new Uint8Array(t);for(let a=0;a<t;a++)r[a]=n.charCodeAt(a);return r.buffer}const qt=typeof Uint8Array.fromBase64=="function";var Ge;const Gt=typeof process=="object"&&((Ge=process.versions)==null?void 0:Ge.node)!==void 0,Ht=qt?Ft:Gt?Vt:Mt,Kt=-1,Wt=-2,Yt=-3,Jt=-4,zt=-5,Xt=-6,Zt=-7;function Qt(e,n){if(typeof e=="number")return s(e,!0);if(!Array.isArray(e)||e.length===0)throw new Error("Invalid input");const t=e,r=Array(t.length);let a=null;function s(o,c=!1){if(o===Kt)return;if(o===Yt)return NaN;if(o===Jt)return 1/0;if(o===zt)return-1/0;if(o===Xt)return-0;if(c||typeof o!="number")throw new Error("Invalid input");if(o in r)return r[o];const i=t[o];if(!i||typeof i!="object")r[o]=i;else if(Array.isArray(i))if(typeof i[0]=="string"){const f=i[0],h=n&&Object.hasOwn(n,f)?n[f]:void 0;if(h){let u=i[1];if(typeof u!="number"&&(u=t.push(i[1])-1),a??(a=new Set),a.has(u))throw new Error("Invalid circular reference");return a.add(u),r[o]=h(s(u)),a.delete(u),r[o]}switch(f){case"Date":r[o]=new Date(i[1]);break;case"Set":const u=new Set;r[o]=u;for(let d=1;d<i.length;d+=1)u.add(s(i[d]));break;case"Map":const g=new Map;r[o]=g;for(let d=1;d<i.length;d+=2)g.set(s(i[d]),s(i[d+1]));break;case"RegExp":r[o]=new RegExp(i[1],i[2]);break;case"Object":{const d=i[1];if(typeof t[d]=="object"&&t[d][0]!=="BigInt")throw new Error("Invalid input");r[o]=Object(s(d));break}case"BigInt":r[o]=BigInt(i[1]);break;case"null":const p=Object.create(null);r[o]=p;for(let d=1;d<i.length;d+=2){if(i[d]==="__proto__")throw new Error("Cannot parse an object with a `__proto__` property");p[i[d]]=s(i[d+1])}break;case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Float16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"BigInt64Array":case"BigUint64Array":case"DataView":{if(t[i[1]][0]!=="ArrayBuffer")throw new Error("Invalid data");const d=globalThis[f],l=s(i[1]);r[o]=i[2]!==void 0?new d(l,i[2],i[3]):new d(l);break}case"ArrayBuffer":{const d=i[1];if(typeof d!="string")throw new Error("Invalid ArrayBuffer encoding");const l=Ht(d);r[o]=l;break}case"Temporal.Duration":case"Temporal.Instant":case"Temporal.PlainDate":case"Temporal.PlainTime":case"Temporal.PlainDateTime":case"Temporal.PlainMonthDay":case"Temporal.PlainYearMonth":case"Temporal.ZonedDateTime":{const d=f.slice(9);r[o]=Temporal[d].from(i[1]);break}case"URL":{const d=new URL(i[1]);r[o]=d;break}case"URLSearchParams":{const d=new URLSearchParams(i[1]);r[o]=d;break}default:throw new Error(`Unknown type ${f}`)}}else if(i[0]===Zt){const f=i[1];if(!Number.isInteger(f)||f<0)throw new Error("Invalid input");const h=new Array(f);r[o]=h;for(let u=2;u<i.length;u+=2){const g=i[u];if(!Number.isInteger(g)||g<0||g>=f)throw new Error("Invalid input");h[g]=s(i[u+1])}}else{const f=new Array(i.length);r[o]=f;for(let h=0;h<i.length;h+=1){const u=i[h];u!==Wt&&(f[h]=s(u))}}else{const f={};r[o]=f;for(const h of Object.keys(i)){if(h==="__proto__")throw new Error("Cannot parse an object with a `__proto__` property");const u=i[h];f[h]=s(u)}}return r[o]}return s(0)}const et=new Set(["load","prerender","csr","ssr","trailingSlash","config"]);[...et];const en=new Set([...et]);[...en];function tn(e){return e.filter(n=>n!=null)}class se{constructor(n,t){this.status=n,typeof t=="string"?this.body={message:t}:t?this.body=t:this.body={message:`Error: ${n}`}}toString(){return JSON.stringify(this.body)}}class be{constructor(n,t){this.status=n,this.location=t}}class Ae extends Error{constructor(n,t,r){super(r),this.status=n,this.text=t}}const nn="x-sveltekit-invalidated",rn="x-sveltekit-trailing-slash";function Z(e){return e instanceof se||e instanceof Ae?e.status:500}function an(e){return e instanceof Ae?e.text:"Internal Error"}let I,K,he;const on=Oe.toString().includes("$$")||/function \w+\(\) \{\}/.test(Oe.toString());on?(I={data:{},form:null,error:null,params:{},route:{id:null},state:{},status:-1,url:new URL("https://example.com")},K={current:null},he={current:!1}):(I=new class{constructor(){P(this,"data",$state.raw({}));P(this,"form",$state.raw(null));P(this,"error",$state.raw(null));P(this,"params",$state.raw({}));P(this,"route",$state.raw({id:null}));P(this,"state",$state.raw({}));P(this,"status",$state.raw(-1));P(this,"url",$state.raw(new URL("https://example.com")))}},K=new class{constructor(){P(this,"current",$state.raw(null))}},he=new class{constructor(){P(this,"current",$state.raw(!1))}},Qe.v=()=>he.current=!0);function sn(e){Object.assign(I,e)}const cn=new Set(["icon","shortcut icon","apple-touch-icon"]),$=Ke(Ye)??{},W=Ke(We)??{},O={url:xe({}),page:xe({}),navigating:ye(null),updated:Bt()};function Ee(e){$[e]=ve()}function ln(e,n){let t=e+1;for(;$[t];)delete $[t],t+=1;for(t=n+1;W[t];)delete W[t],t+=1}function B(e){return location.href=e.href,new Promise(()=>{})}async function tt(){if("serviceWorker"in navigator){const e=await navigator.serviceWorker.getRegistration(L||"/");e&&await e.update()}}function Ce(){}let ie,me,Q,j,we,A;const nt=[],ee=[];let U=null;const rt=new Set,fn=new Set,q=new Set;let y={branch:[],error:null,url:null},ke=!1,te=!1,De=!0,Y=!1,F=!1,at=!1,Se=!1,ot,R,T,ne;const G=new Set;async function Rn(e,n,t){var a,s,o,c;document.URL!==location.href&&(location.href=location.href),A=e,await((s=(a=e.hooks).init)==null?void 0:s.call(a)),ie=$t(e),j=document.documentElement,we=n,me=e.nodes[0],Q=e.nodes[1],me(),Q(),R=(o=history.state)==null?void 0:o[C],T=(c=history.state)==null?void 0:c[H],R||(R=T=Date.now(),history.replaceState({...history.state,[C]:R,[H]:T},""));const r=$[R];r&&(history.scrollRestoration="manual",scrollTo(r.x,r.y)),t?await yn(we,t):mn(location.href,{replaceState:!0}),wn()}function un(){nt.length=0,Se=!1}function st(e){ee.some(n=>n==null?void 0:n.snapshot)&&(W[e]=ee.map(n=>{var t;return(t=n==null?void 0:n.snapshot)==null?void 0:t.capture()}))}function it(e){var n;(n=W[e])==null||n.forEach((t,r)=>{var a,s;(s=(a=ee[r])==null?void 0:a.snapshot)==null||s.restore(t)})}function Be(){Ee(R),Ne(Ye,$),st(T),Ne(We,W)}async function Re(e,n,t,r){return V({type:"goto",url:ze(e),keepfocus:n.keepFocus,noscroll:n.noScroll,replace_state:n.replaceState,state:n.state,redirect_count:t,nav_token:r,accept:()=>{n.invalidateAll&&(Se=!0)}})}async function dn(e){if(e.id!==(U==null?void 0:U.id)){const n={};G.add(n),U={id:e.id,token:n,promise:lt({...e,preload:n}).then(t=>(G.delete(n),t.type==="loaded"&&t.state.error&&(U=null),t))}}return U.promise}async function pe(e){const n=ie.find(t=>t.exec(ft(e)));n&&await Promise.all([...n.layouts,n.leaf].map(t=>t==null?void 0:t[1]()))}function ct(e,n,t){var s;y=e.state;const r=document.querySelector("style[data-sveltekit]");r&&r.remove(),Object.assign(I,e.props.page),ot=new A.root({target:n,props:{...e.props,stores:O,components:ee},hydrate:t,sync:!1}),it(T);const a={from:null,to:{params:y.params,route:{id:((s=y.route)==null?void 0:s.id)??null},url:new URL(location.href)},willUnload:!1,type:"enter",complete:Promise.resolve()};q.forEach(o=>o(a)),te=!0}function re({url:e,params:n,branch:t,status:r,error:a,route:s,form:o}){let c="never";if(L&&(e.pathname===L||e.pathname===L+"/"))c="always";else for(const p of t)(p==null?void 0:p.slash)!==void 0&&(c=p.slash);e.pathname=_t(e.pathname,c),e.search=e.search;const i={type:"loaded",state:{url:e,params:n,branch:t,error:a,route:s},props:{constructors:tn(t).map(p=>p.node.component),page:Le(I)}};o!==void 0&&(i.props.form=o);let f={},h=!I,u=0;for(let p=0;p<Math.max(t.length,y.branch.length);p+=1){const d=t[p],l=y.branch[p];(d==null?void 0:d.data)!==(l==null?void 0:l.data)&&(h=!0),d&&(f={...f,...d.data},h&&(i.props[`data_${u}`]=f),u+=1)}return(!y.url||e.href!==y.url.href||y.error!==a||o!==void 0&&o!==I.form||h)&&(i.props.page={error:a,params:n,route:{id:(s==null?void 0:s.id)??null},state:{},status:r,url:new URL(e),form:o??null,data:h?f:I.data}),i}async function Ie({loader:e,parent:n,url:t,params:r,route:a,server_data_node:s}){var h,u,g;let o=null,c=!0;const i={dependencies:new Set,params:new Set,parent:!1,route:!1,url:!1,search_params:new Set},f=await e();if((h=f.universal)!=null&&h.load){let p=function(...l){for(const m of l){const{href:b}=new URL(m,t);i.dependencies.add(b)}};const d={route:new Proxy(a,{get:(l,m)=>(c&&(i.route=!0),l[m])}),params:new Proxy(r,{get:(l,m)=>(c&&i.params.add(m),l[m])}),data:(s==null?void 0:s.data)??null,url:At(t,()=>{c&&(i.url=!0)},l=>{c&&i.search_params.add(l)},A.hash),async fetch(l,m){let b;l instanceof Request?(b=l.url,m={body:l.method==="GET"||l.method==="HEAD"?void 0:await l.blob(),cache:l.cache,credentials:l.credentials,headers:[...l.headers].length?l.headers:void 0,integrity:l.integrity,keepalive:l.keepalive,method:l.method,mode:l.mode,redirect:l.redirect,referrer:l.referrer,referrerPolicy:l.referrerPolicy,signal:l.signal,...m}):b=l;const k=new URL(b,t);return c&&p(k.href),k.origin===t.origin&&(b=k.href.slice(t.origin.length)),te?Tt(b,k.href,m):Ut(b,m)},setHeaders:()=>{},depends:p,parent(){return c&&(i.parent=!0),n()},untrack(l){c=!1;try{return l()}finally{c=!0}}};o=await f.universal.load.call(null,d)??null}return{node:f,loader:e,server:s,universal:(u=f.universal)!=null&&u.load?{type:"data",data:o,uses:i}:null,data:o??(s==null?void 0:s.data)??null,slash:((g=f.universal)==null?void 0:g.trailingSlash)??(s==null?void 0:s.slash)}}function Fe(e,n,t,r,a,s){if(Se)return!0;if(!a)return!1;if(a.parent&&e||a.route&&n||a.url&&t)return!0;for(const o of a.search_params)if(r.has(o))return!0;for(const o of a.params)if(s[o]!==y.params[o])return!0;for(const o of a.dependencies)if(nt.some(c=>c(new URL(o))))return!0;return!1}function Ue(e,n){return(e==null?void 0:e.type)==="data"?e:(e==null?void 0:e.type)==="skip"?n??null:null}function hn(e,n){if(!e)return new Set(n.searchParams.keys());const t=new Set([...e.searchParams.keys(),...n.searchParams.keys()]);for(const r of t){const a=e.searchParams.getAll(r),s=n.searchParams.getAll(r);a.every(o=>s.includes(o))&&s.every(o=>a.includes(o))&&t.delete(r)}return t}function Ve({error:e,url:n,route:t,params:r}){return{type:"loaded",state:{error:e,url:n,route:t,params:r,branch:[]},props:{page:Le(I),constructors:[]}}}async function lt({id:e,invalidating:n,url:t,params:r,route:a,preload:s}){if((U==null?void 0:U.id)===e)return G.delete(U.token),U.promise;const{errors:o,layouts:c,leaf:i}=a,f=[...c,i];o.forEach(w=>w==null?void 0:w().catch(()=>{})),f.forEach(w=>w==null?void 0:w[1]().catch(()=>{}));let h=null;const u=y.url?e!==ae(y.url):!1,g=y.route?a.id!==y.route.id:!1,p=hn(y.url,t);let d=!1;const l=f.map((w,_)=>{var N;const E=y.branch[_],S=!!(w!=null&&w[0])&&((E==null?void 0:E.loader)!==w[1]||Fe(d,g,u,p,(N=E.server)==null?void 0:N.uses,r));return S&&(d=!0),S});if(l.some(Boolean)){try{h=await ht(t,l)}catch(w){const _=await D(w,{url:t,params:r,route:{id:e}});return G.has(s)?Ve({error:_,url:t,params:r,route:a}):ce({status:Z(w),error:_,url:t,route:a})}if(h.type==="redirect")return h}const m=h==null?void 0:h.nodes;let b=!1;const k=f.map(async(w,_)=>{var le;if(!w)return;const E=y.branch[_],S=m==null?void 0:m[_];if((!S||S.type==="skip")&&w[1]===(E==null?void 0:E.loader)&&!Fe(b,g,u,p,(le=E.universal)==null?void 0:le.uses,r))return E;if(b=!0,(S==null?void 0:S.type)==="error")throw S;return Ie({loader:w[1],url:t,params:r,route:a,parent:async()=>{var je;const Pe={};for(let fe=0;fe<_;fe+=1)Object.assign(Pe,(je=await k[fe])==null?void 0:je.data);return Pe},server_data_node:Ue(S===void 0&&w[0]?{type:"skip"}:S??null,w[0]?E==null?void 0:E.server:void 0)})});for(const w of k)w.catch(()=>{});const v=[];for(let w=0;w<f.length;w+=1)if(f[w])try{v.push(await k[w])}catch(_){if(_ instanceof be)return{type:"redirect",location:_.location};if(G.has(s))return Ve({error:await D(_,{params:r,url:t,route:{id:a.id}}),url:t,params:r,route:a});let E=Z(_),S;if(m!=null&&m.includes(_))E=_.status??E,S=_.error;else if(_ instanceof se)S=_.body;else{if(await O.updated.check())return await tt(),await B(t);S=await D(_,{params:r,url:t,route:{id:a.id}})}const N=await pn(w,v,o);return N?re({url:t,params:r,branch:v.slice(0,N.idx).concat(N.node),status:E,error:S,route:a}):await dt(t,{id:a.id},S,E)}else v.push(void 0);return re({url:t,params:r,branch:v,status:200,error:null,route:a,form:n?void 0:null})}async function pn(e,n,t){for(;e--;)if(t[e]){let r=e;for(;!n[r];)r-=1;try{return{idx:r+1,node:{node:await t[e](),loader:t[e],data:{},server:null,universal:null}}}catch{continue}}}async function ce({status:e,error:n,url:t,route:r}){const a={};let s=null;if(A.server_loads[0]===0)try{const c=await ht(t,[!0]);if(c.type!=="data"||c.nodes[0]&&c.nodes[0].type!=="data")throw 0;s=c.nodes[0]??null}catch{(t.origin!==J||t.pathname!==location.pathname||ke)&&await B(t)}try{const c=await Ie({loader:me,url:t,params:a,route:r,parent:()=>Promise.resolve({}),server_data_node:Ue(s)}),i={node:await Q(),loader:Q,universal:null,server:null,data:null};return re({url:t,params:a,branch:[c,i],status:e,error:n,route:null})}catch(c){if(c instanceof be)return Re(new URL(c.location,location.href),{},0);throw c}}function Te(e,n){if(!e||oe(e,L,A.hash))return;let t;try{if(t=A.hooks.reroute({url:new URL(e)})??e,typeof t=="string"){const a=new URL(e);A.hash?a.hash=t:a.pathname=t,t=a}}catch{return}const r=ft(t);for(const a of ie){const s=a.exec(r);if(s)return{id:ae(e),invalidating:n,route:a,params:bt(s),url:e}}}function ft(e){return vt(A.hash?e.hash.replace(/^#/,"").replace(/[?#].+/,""):e.pathname.slice(L.length))||"/"}function ae(e){return(A.hash?e.hash.replace(/^#/,""):e.pathname)+e.search}function ut({url:e,type:n,intent:t,delta:r}){let a=!1;const s=gt(y,t,e,n);r!==void 0&&(s.navigation.delta=r);const o={...s.navigation,cancel:()=>{a=!0,s.reject(new Error("navigation cancelled"))}};return Y||rt.forEach(c=>c(o)),a?null:s}async function V({type:e,url:n,popped:t,keepfocus:r,noscroll:a,replace_state:s,state:o={},redirect_count:c=0,nav_token:i={},accept:f=Ce,block:h=Ce}){const u=Te(n,!1),g=ut({url:n,type:e,delta:t==null?void 0:t.delta,intent:u});if(!g){h();return}const p=R,d=T;f(),Y=!0,te&&O.navigating.set(K.current=g.navigation),ne=i;let l=u&&await lt(u);if(!l){if(oe(n,L,A.hash))return await B(n);l=await dt(n,{id:null},await D(new Ae(404,"Not Found",`Not found: ${n.pathname}`),{url:n,params:{},route:{id:null}}),404)}if(n=(u==null?void 0:u.url)||n,ne!==i)return g.reject(new Error("navigation aborted")),!1;if(l.type==="redirect")if(c>=20)l=await ce({status:500,error:await D(new Error("Redirect loop"),{url:n,params:{},route:{id:null}}),url:n,route:{id:null}});else return Re(new URL(l.location,n).href,{},c+1,i),!1;else l.props.page.status>=400&&await O.updated.check()&&(await tt(),await B(n));if(un(),Ee(p),st(d),l.props.page.url.pathname!==n.pathname&&(n.pathname=l.props.page.url.pathname),o=t?t.state:o,!t){const v=s?0:1,w={[C]:R+=v,[H]:T+=v,[Je]:o};(s?history.replaceState:history.pushState).call(history,w,"",n),s||ln(R,T)}if(U=null,l.props.page.state=o,te){y=l.state,l.props.page&&(l.props.page.url=n);const v=(await Promise.all(Array.from(fn,w=>w(g.navigation)))).filter(w=>typeof w=="function");if(v.length>0){let w=function(){v.forEach(_=>{q.delete(_)})};v.push(w),v.forEach(_=>{q.add(_)})}ot.$set(l.props),sn(l.props.page),at=!0}else ct(l,we,!1);const{activeElement:m}=document;await yt();const b=t?t.scroll:a?ve():null;if(De){const v=n.hash&&document.getElementById(decodeURIComponent(A.hash?n.hash.split("#")[2]??"":n.hash.slice(1)));b?scrollTo(b.x,b.y):v?v.scrollIntoView():scrollTo(0,0)}const k=document.activeElement!==m&&document.activeElement!==document.body;!r&&!k&&_n(),De=!0,l.props.page&&Object.assign(I,l.props.page),Y=!1,e==="popstate"&&it(T),g.fulfil(void 0),q.forEach(v=>v(g.navigation)),O.navigating.set(K.current=null)}async function dt(e,n,t,r){return e.origin===J&&e.pathname===location.pathname&&!ke?await ce({status:r,error:t,url:e,route:n}):await B(e)}function gn(){let e;j.addEventListener("mousemove",s=>{const o=s.target;clearTimeout(e),e=setTimeout(()=>{r(o,2)},20)});function n(s){s.defaultPrevented||r(s.composedPath()[0],1)}j.addEventListener("mousedown",n),j.addEventListener("touchstart",n,{passive:!0});const t=new IntersectionObserver(s=>{for(const o of s)o.isIntersecting&&(pe(new URL(o.target.href)),t.unobserve(o.target))},{threshold:0});function r(s,o){const c=Ze(s,j);if(!c)return;const{url:i,external:f,download:h}=ge(c,L,A.hash);if(f||h)return;const u=X(c),g=i&&ae(y.url)===ae(i);if(!u.reload&&!g)if(o<=u.preload_data){const p=Te(i,!1);p&&dn(p)}else o<=u.preload_code&&pe(i)}function a(){t.disconnect();for(const s of j.querySelectorAll("a")){const{url:o,external:c,download:i}=ge(s,L,A.hash);if(c||i)continue;const f=X(s);f.reload||(f.preload_code===z.viewport&&t.observe(s),f.preload_code===z.eager&&pe(o))}}q.add(a),a()}function D(e,n){if(e instanceof se)return e.body;const t=Z(e),r=an(e);return A.hooks.handleError({error:e,event:n,status:t,message:r})??{message:r}}function mn(e,n={}){return e=new URL(ze(e)),e.origin!==J?Promise.reject(new Error("goto: invalid URL")):Re(e,n,0)}function wn(){var n;history.scrollRestoration="manual",addEventListener("beforeunload",t=>{let r=!1;if(Be(),!Y){const a=gt(y,void 0,null,"leave"),s={...a.navigation,cancel:()=>{r=!0,a.reject(new Error("navigation cancelled"))}};rt.forEach(o=>o(s))}r?(t.preventDefault(),t.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&Be()}),(n=navigator.connection)!=null&&n.saveData||gn(),j.addEventListener("click",async t=>{if(t.button||t.which!==1||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.defaultPrevented)return;const r=Ze(t.composedPath()[0],j);if(!r)return;const{url:a,external:s,target:o,download:c}=ge(r,L,A.hash);if(!a)return;if(o==="_parent"||o==="_top"){if(window.parent!==window)return}else if(o&&o!=="_self")return;const i=X(r);if(!(r instanceof SVGAElement)&&a.protocol!==location.protocol&&!(a.protocol==="https:"||a.protocol==="http:")||c)return;const[h,u]=(A.hash?a.hash.replace(/^#/,""):a.href).split("#"),g=h===ue(location);if(s||i.reload&&(!g||!u)){ut({url:a,type:"link"})?Y=!0:t.preventDefault();return}if(u!==void 0&&g){const[,p]=y.url.href.split("#");if(p===u){if(t.preventDefault(),u===""||u==="top"&&r.ownerDocument.getElementById("top")===null)window.scrollTo({top:0});else{const d=r.ownerDocument.getElementById(decodeURIComponent(u));d&&(d.scrollIntoView(),d.focus())}return}if(F=!0,Ee(R),e(a),!i.replace_state)return;F=!1}t.preventDefault(),await new Promise(p=>{requestAnimationFrame(()=>{setTimeout(p,0)}),setTimeout(p,100)}),V({type:"link",url:a,keepfocus:i.keepfocus,noscroll:i.noscroll,replace_state:i.replace_state??a.href===location.href})}),j.addEventListener("submit",t=>{if(t.defaultPrevented)return;const r=HTMLFormElement.prototype.cloneNode.call(t.target),a=t.submitter;if(((a==null?void 0:a.formTarget)||r.target)==="_blank"||((a==null?void 0:a.formMethod)||r.method)!=="get")return;const c=new URL((a==null?void 0:a.hasAttribute("formaction"))&&(a==null?void 0:a.formAction)||r.action);if(oe(c,L,!1))return;const i=t.target,f=X(i);if(f.reload)return;t.preventDefault(),t.stopPropagation();const h=new FormData(i),u=a==null?void 0:a.getAttribute("name");u&&h.append(u,(a==null?void 0:a.getAttribute("value"))??""),c.search=new URLSearchParams(h).toString(),V({type:"form",url:c,keepfocus:f.keepfocus,noscroll:f.noscroll,replace_state:f.replace_state??c.href===location.href})}),addEventListener("popstate",async t=>{var r;if((r=t.state)!=null&&r[C]){const a=t.state[C];if(ne={},a===R)return;const s=$[a],o=t.state[Je]??{},c=new URL(t.state[Dt]??location.href),i=t.state[H],f=y.url?ue(location)===ue(y.url):!1;if(i===T&&(at||f)){o!==I.state&&(I.state=o),e(c),$[R]=ve(),s&&scrollTo(s.x,s.y),R=a;return}const u=a-R;await V({type:"popstate",url:c,popped:{state:o,scroll:s,delta:u},accept:()=>{R=a,T=i},block:()=>{history.go(-u)},nav_token:ne})}else if(!F){const a=new URL(location.href);e(a)}}),addEventListener("hashchange",()=>{F?(F=!1,history.replaceState({...history.state,[C]:++R,[H]:T},"",location.href)):A.hash&&y.url.hash===location.hash&&V({type:"goto",url:y.url})});for(const t of document.querySelectorAll("link"))cn.has(t.rel)&&(t.href=t.href);addEventListener("pageshow",t=>{t.persisted&&O.navigating.set(K.current=null)});function e(t){y.url=I.url=t,O.page.set(Le(I)),O.page.notify()}}async function yn(e,{status:n=200,error:t,node_ids:r,params:a,route:s,data:o,form:c}){ke=!0;const i=new URL(location.href);({params:a={},route:s={id:null}}=Te(i,!1)||{});let f,h=!0;try{const u=r.map(async(d,l)=>{const m=o[l];return m!=null&&m.uses&&(m.uses=pt(m.uses)),Ie({loader:A.nodes[d],url:i,params:a,route:s,parent:async()=>{const b={};for(let k=0;k<l;k+=1)Object.assign(b,(await u[k]).data);return b},server_data_node:Ue(m)})}),g=await Promise.all(u),p=ie.find(({id:d})=>d===s.id);if(p){const d=p.layouts;for(let l=0;l<d.length;l++)d[l]||g.splice(l,0,void 0)}f=re({url:i,params:a,branch:g,status:n,error:t,form:c,route:p??null})}catch(u){if(u instanceof be){await B(new URL(u.location,location.href));return}f=await ce({status:Z(u),error:await D(u,{url:i,params:a,route:s}),url:i,route:s}),e.textContent="",h=!1}f.props.page&&(f.props.page.state={}),ct(f,e,h)}async function ht(e,n){var a;const t=new URL(e);t.pathname=St(e.pathname),e.pathname.endsWith("/")&&t.searchParams.append(rn,"1"),t.searchParams.append(nn,n.map(s=>s?"1":"0").join(""));const r=await He(t.href);if(!r.ok){let s;throw(a=r.headers.get("content-type"))!=null&&a.includes("application/json")?s=await r.json():r.status===404?s="Not Found":r.status===500&&(s="Internal Error"),new se(r.status,s)}return new Promise(async s=>{var u;const o=new Map,c=r.body.getReader(),i=new TextDecoder;function f(g){return Qt(g,{...A.decoders,Promise:p=>new Promise((d,l)=>{o.set(p,{fulfil:d,reject:l})})})}let h="";for(;;){const{done:g,value:p}=await c.read();if(g&&!h)break;for(h+=!p&&h?`
2
- `:i.decode(p,{stream:!0});;){const d=h.indexOf(`
3
- `);if(d===-1)break;const l=JSON.parse(h.slice(0,d));if(h=h.slice(d+1),l.type==="redirect")return s(l);if(l.type==="data")(u=l.nodes)==null||u.forEach(m=>{(m==null?void 0:m.type)==="data"&&(m.uses=pt(m.uses),m.data=f(m.data))}),s(l);else if(l.type==="chunk"){const{id:m,data:b,error:k}=l,v=o.get(m);o.delete(m),k?v.reject(f(k)):v.fulfil(f(b))}}}})}function pt(e){return{dependencies:new Set((e==null?void 0:e.dependencies)??[]),params:new Set((e==null?void 0:e.params)??[]),parent:!!(e!=null&&e.parent),route:!!(e!=null&&e.route),url:!!(e!=null&&e.url),search_params:new Set((e==null?void 0:e.search_params)??[])}}function _n(){const e=document.querySelector("[autofocus]");if(e)e.focus();else{const n=document.body,t=n.getAttribute("tabindex");n.tabIndex=-1,n.focus({preventScroll:!0,focusVisible:!1}),t!==null?n.setAttribute("tabindex",t):n.removeAttribute("tabindex");const r=getSelection();if(r&&r.type!=="None"){const a=[];for(let s=0;s<r.rangeCount;s+=1)a.push(r.getRangeAt(s));setTimeout(()=>{if(r.rangeCount===a.length){for(let s=0;s<r.rangeCount;s+=1){const o=a[s],c=r.getRangeAt(s);if(o.commonAncestorContainer!==c.commonAncestorContainer||o.startContainer!==c.startContainer||o.endContainer!==c.endContainer||o.startOffset!==c.startOffset||o.endOffset!==c.endOffset)return}r.removeAllRanges()}})}}}function gt(e,n,t,r){var i,f;let a,s;const o=new Promise((h,u)=>{a=h,s=u});return o.catch(()=>{}),{navigation:{from:{params:e.params,route:{id:((i=e.route)==null?void 0:i.id)??null},url:e.url},to:t&&{params:(n==null?void 0:n.params)??null,route:{id:((f=n==null?void 0:n.route)==null?void 0:f.id)??null},url:t},willUnload:!n,type:r,complete:o},fulfil:a,reject:s}}function Le(e){return{data:e.data,error:e.error,form:e.form,params:e.params,route:e.route,state:e.state,status:e.status,url:e.url}}export{Rn as a,O as s};
@@ -1 +0,0 @@
1
- import{a as t}from"../chunks/entry.-i5eOrF8.js";export{t as start};