@juspay/shooter 1.8.0 → 1.9.1
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/.claude/hooks/notifier.cjs +490 -136
- package/bin/shooter.cjs +50 -14
- package/build/client/_app/immutable/chunks/3EfvnCrr.js +1 -0
- package/build/client/_app/immutable/chunks/3EfvnCrr.js.br +0 -0
- package/build/client/_app/immutable/chunks/3EfvnCrr.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{B6b4w6vf.js → DaomQix1.js} +1 -1
- package/build/client/_app/immutable/chunks/DaomQix1.js.br +0 -0
- package/build/client/_app/immutable/chunks/{B6b4w6vf.js.gz → DaomQix1.js.gz} +0 -0
- package/build/client/_app/immutable/chunks/Dfn9ME_a.js +3 -0
- package/build/client/_app/immutable/chunks/Dfn9ME_a.js.br +0 -0
- package/build/client/_app/immutable/chunks/Dfn9ME_a.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{C7SeOWDG.js → DuaEmHXZ.js} +1 -1
- package/build/client/_app/immutable/chunks/DuaEmHXZ.js.br +0 -0
- package/build/client/_app/immutable/chunks/DuaEmHXZ.js.gz +0 -0
- package/build/client/_app/immutable/entry/{app.CP7226A7.js → app.C23A4_LP.js} +2 -2
- package/build/client/_app/immutable/entry/app.C23A4_LP.js.br +0 -0
- package/build/client/_app/immutable/entry/app.C23A4_LP.js.gz +0 -0
- package/build/client/_app/immutable/entry/start.Dzoby1AT.js +1 -0
- package/build/client/_app/immutable/entry/start.Dzoby1AT.js.br +2 -0
- package/build/client/_app/immutable/entry/start.Dzoby1AT.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{0.DwU44ZAj.js → 0.BgwfOZTV.js} +1 -1
- package/build/client/_app/immutable/nodes/0.BgwfOZTV.js.br +0 -0
- package/build/client/_app/immutable/nodes/0.BgwfOZTV.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{1.CChG-n6d.js → 1.DunuP0ec.js} +1 -1
- package/build/client/_app/immutable/nodes/1.DunuP0ec.js.br +0 -0
- package/build/client/_app/immutable/nodes/1.DunuP0ec.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{2.CzexDbwp.js → 2.dWYUfDXP.js} +2 -2
- package/build/client/_app/immutable/nodes/2.dWYUfDXP.js.br +0 -0
- package/build/client/_app/immutable/nodes/2.dWYUfDXP.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{3.DC3WghxB.js → 3.rBWJMWFr.js} +3 -3
- package/build/client/_app/immutable/nodes/3.rBWJMWFr.js.br +0 -0
- package/build/client/_app/immutable/nodes/3.rBWJMWFr.js.gz +0 -0
- package/build/client/_app/immutable/nodes/5.BN2SM61w.js +1 -0
- package/build/client/_app/immutable/nodes/5.BN2SM61w.js.br +0 -0
- package/build/client/_app/immutable/nodes/5.BN2SM61w.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{6.C4aXlZQd.js → 6.DDMVIiVk.js} +1 -1
- package/build/client/_app/immutable/nodes/6.DDMVIiVk.js.br +0 -0
- package/build/client/_app/immutable/nodes/6.DDMVIiVk.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{7.DfniCleW.js → 7.DijtBcpt.js} +1 -1
- package/build/client/_app/immutable/nodes/7.DijtBcpt.js.br +0 -0
- package/build/client/_app/immutable/nodes/7.DijtBcpt.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{8.D4AzZWcq.js → 8.Y_8EIs9h.js} +1 -1
- package/build/client/_app/immutable/nodes/8.Y_8EIs9h.js.br +0 -0
- package/build/client/_app/immutable/nodes/8.Y_8EIs9h.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{9.gV8oJWv_.js → 9.BoJIHqox.js} +1 -1
- package/build/client/_app/immutable/nodes/9.BoJIHqox.js.br +0 -0
- package/build/client/_app/immutable/nodes/9.BoJIHqox.js.gz +0 -0
- package/build/client/_app/version.json +1 -1
- package/build/client/_app/version.json.br +0 -0
- package/build/client/_app/version.json.gz +0 -0
- package/build/server/chunks/{0-XyVDlEyN.js → 0-0CZFKlE-.js} +2 -2
- package/build/server/chunks/{0-XyVDlEyN.js.map → 0-0CZFKlE-.js.map} +1 -1
- package/build/server/chunks/{1-C3vZx9QL.js → 1-DLzdA7q9.js} +2 -2
- package/build/server/chunks/{1-C3vZx9QL.js.map → 1-DLzdA7q9.js.map} +1 -1
- package/build/server/chunks/{2-LWO3Q9-s.js → 2-DssNCbHE.js} +2 -2
- package/build/server/chunks/{2-LWO3Q9-s.js.map → 2-DssNCbHE.js.map} +1 -1
- package/build/server/chunks/{3-3WzO52IA.js → 3-xYdrp1JC.js} +2 -2
- package/build/server/chunks/{3-3WzO52IA.js.map → 3-xYdrp1JC.js.map} +1 -1
- package/build/server/chunks/{5-Bj49x3to.js → 5-DRhcUdp_.js} +2 -2
- package/build/server/chunks/{5-Bj49x3to.js.map → 5-DRhcUdp_.js.map} +1 -1
- package/build/server/chunks/{6-DjPIWYcj.js → 6-DpmjM0Zz.js} +2 -2
- package/build/server/chunks/{6-DjPIWYcj.js.map → 6-DpmjM0Zz.js.map} +1 -1
- package/build/server/chunks/{7-DF5FUXhP.js → 7-fZr6V0jx.js} +2 -2
- package/build/server/chunks/{7-DF5FUXhP.js.map → 7-fZr6V0jx.js.map} +1 -1
- package/build/server/chunks/{8-CejJgM0l.js → 8-C92Y2pM_.js} +2 -2
- package/build/server/chunks/{8-CejJgM0l.js.map → 8-C92Y2pM_.js.map} +1 -1
- package/build/server/chunks/{9-D1YMozmH.js → 9-xiLWXynw.js} +2 -2
- package/build/server/chunks/{9-D1YMozmH.js.map → 9-xiLWXynw.js.map} +1 -1
- package/build/server/chunks/{_server.ts-G8OeADGj.js → _server.ts-BMcbwZ2r.js} +8 -3
- package/build/server/chunks/_server.ts-BMcbwZ2r.js.map +1 -0
- package/build/server/chunks/{_server.ts-A9_tRR-K.js → _server.ts-D-vgx5UZ.js} +5 -3
- package/build/server/chunks/{_server.ts-A9_tRR-K.js.map → _server.ts-D-vgx5UZ.js.map} +1 -1
- package/build/server/chunks/library-apns-Dl3iRE2h.js +157 -0
- package/build/server/chunks/library-apns-Dl3iRE2h.js.map +1 -0
- package/build/server/index.js +1 -1
- package/build/server/index.js.map +1 -1
- package/build/server/manifest.js +12 -12
- package/build/server/manifest.js.map +1 -1
- package/package.json +1 -2
- package/server.ts +55 -3
- package/src/lib/modules/client/activity/summarizer.ts +1 -1
- package/src/lib/modules/client/dashboard/summarizer.ts +1 -2
- package/src/lib/modules/client/neurolink/cdn.ts +6 -0
- package/src/lib/modules/client/terminal/LaunchSheet.svelte +5 -12
- package/src/lib/modules/server/apn/library-apns.ts +138 -77
- package/src/lib/modules/server/fcm/fcm-service.ts +1 -0
- package/src/lib/types/apn.ts +11 -0
- package/src/routes/api/notify/+server.ts +2 -0
- package/src/routes/neurolink/+page.svelte +4 -6
- package/build/client/_app/immutable/chunks/B6b4w6vf.js.br +0 -0
- package/build/client/_app/immutable/chunks/BEa4nlMF.js +0 -3
- package/build/client/_app/immutable/chunks/BEa4nlMF.js.br +0 -0
- package/build/client/_app/immutable/chunks/BEa4nlMF.js.gz +0 -0
- package/build/client/_app/immutable/chunks/C7SeOWDG.js.br +0 -0
- package/build/client/_app/immutable/chunks/C7SeOWDG.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DQM017d5.js +0 -1
- package/build/client/_app/immutable/chunks/DQM017d5.js.br +0 -0
- package/build/client/_app/immutable/chunks/DQM017d5.js.gz +0 -0
- package/build/client/_app/immutable/entry/app.CP7226A7.js.br +0 -0
- package/build/client/_app/immutable/entry/app.CP7226A7.js.gz +0 -0
- package/build/client/_app/immutable/entry/start.mGPvkOah.js +0 -1
- package/build/client/_app/immutable/entry/start.mGPvkOah.js.br +0 -2
- package/build/client/_app/immutable/entry/start.mGPvkOah.js.gz +0 -0
- package/build/client/_app/immutable/nodes/0.DwU44ZAj.js.br +0 -0
- package/build/client/_app/immutable/nodes/0.DwU44ZAj.js.gz +0 -0
- package/build/client/_app/immutable/nodes/1.CChG-n6d.js.br +0 -0
- package/build/client/_app/immutable/nodes/1.CChG-n6d.js.gz +0 -0
- package/build/client/_app/immutable/nodes/2.CzexDbwp.js.br +0 -0
- package/build/client/_app/immutable/nodes/2.CzexDbwp.js.gz +0 -0
- package/build/client/_app/immutable/nodes/3.DC3WghxB.js.br +0 -0
- package/build/client/_app/immutable/nodes/3.DC3WghxB.js.gz +0 -0
- package/build/client/_app/immutable/nodes/5.DRvLQ5NR.js +0 -1
- package/build/client/_app/immutable/nodes/5.DRvLQ5NR.js.br +0 -0
- package/build/client/_app/immutable/nodes/5.DRvLQ5NR.js.gz +0 -0
- package/build/client/_app/immutable/nodes/6.C4aXlZQd.js.br +0 -0
- package/build/client/_app/immutable/nodes/6.C4aXlZQd.js.gz +0 -0
- package/build/client/_app/immutable/nodes/7.DfniCleW.js.br +0 -0
- package/build/client/_app/immutable/nodes/7.DfniCleW.js.gz +0 -0
- package/build/client/_app/immutable/nodes/8.D4AzZWcq.js.br +0 -0
- package/build/client/_app/immutable/nodes/8.D4AzZWcq.js.gz +0 -0
- package/build/client/_app/immutable/nodes/9.gV8oJWv_.js.br +0 -0
- package/build/client/_app/immutable/nodes/9.gV8oJWv_.js.gz +0 -0
- package/build/server/chunks/_server.ts-G8OeADGj.js.map +0 -1
- package/build/server/chunks/library-apns-Cf-E-DhM.js +0 -107
- package/build/server/chunks/library-apns-Cf-E-DhM.js.map +0 -1
package/bin/shooter.cjs
CHANGED
|
@@ -145,6 +145,35 @@ function hasFlag(flag) {
|
|
|
145
145
|
return args.includes(flag);
|
|
146
146
|
}
|
|
147
147
|
|
|
148
|
+
// Keep in sync with `parsePortArg` in server.ts.
|
|
149
|
+
function parsePortFlag() {
|
|
150
|
+
const isValid = (n) => Number.isInteger(n) && n >= 0 && n < 65536;
|
|
151
|
+
const fail = (raw) => {
|
|
152
|
+
console.error(`Error: invalid --port value "${raw}" — expected an integer in 0-65535.`);
|
|
153
|
+
process.exit(2);
|
|
154
|
+
};
|
|
155
|
+
for (let i = 0; i < args.length; i++) {
|
|
156
|
+
const a = args[i];
|
|
157
|
+
if ((a === '--port' || a === '-p') && args[i + 1] !== undefined) {
|
|
158
|
+
const raw = args[i + 1];
|
|
159
|
+
const n = parseInt(raw, 10);
|
|
160
|
+
if (!isValid(n)) fail(raw);
|
|
161
|
+
return n;
|
|
162
|
+
} else if (a.startsWith('--port=')) {
|
|
163
|
+
const raw = a.slice('--port='.length);
|
|
164
|
+
const n = parseInt(raw, 10);
|
|
165
|
+
if (!isValid(n)) fail(raw);
|
|
166
|
+
return n;
|
|
167
|
+
} else if (a.startsWith('-p=')) {
|
|
168
|
+
const raw = a.slice('-p='.length);
|
|
169
|
+
const n = parseInt(raw, 10);
|
|
170
|
+
if (!isValid(n)) fail(raw);
|
|
171
|
+
return n;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
return undefined;
|
|
175
|
+
}
|
|
176
|
+
|
|
148
177
|
function isCloudflaredAvailable() {
|
|
149
178
|
try {
|
|
150
179
|
execSync('which cloudflared', { stdio: 'ignore' });
|
|
@@ -231,9 +260,12 @@ function startServer() {
|
|
|
231
260
|
|
|
232
261
|
const daemon = hasFlag('--daemon') || hasFlag('-d');
|
|
233
262
|
const noTunnel = hasFlag('--no-tunnel');
|
|
234
|
-
const
|
|
263
|
+
const cliPort = parsePortFlag();
|
|
264
|
+
const port = cliPort ?? resolvePort();
|
|
235
265
|
|
|
236
|
-
//
|
|
266
|
+
// Fail-fast pre-flight so a busy port is surfaced before we spawn the
|
|
267
|
+
// server and start the Cloudflare Tunnel — keeping tunnel and listen
|
|
268
|
+
// port in sync.
|
|
237
269
|
try {
|
|
238
270
|
execSync(
|
|
239
271
|
`"${process.execPath}" -e "const s=require('net').createServer();s.listen(${parseInt(port, 10)},()=>s.close());s.on('error',e=>{if(e.code==='EADDRINUSE')process.exit(1)})"`,
|
|
@@ -241,7 +273,7 @@ function startServer() {
|
|
|
241
273
|
);
|
|
242
274
|
} catch {
|
|
243
275
|
console.error(`Error: Port ${port} is already in use.`);
|
|
244
|
-
console.error('Stop the existing process or set
|
|
276
|
+
console.error('Stop the existing process, pass --port <num>, or set PORT in ~/.shooter/.env');
|
|
245
277
|
process.exit(1);
|
|
246
278
|
}
|
|
247
279
|
|
|
@@ -271,6 +303,7 @@ function startServer() {
|
|
|
271
303
|
stdio: ['ignore', logFd, logFd],
|
|
272
304
|
env: {
|
|
273
305
|
...process.env,
|
|
306
|
+
PORT: String(port),
|
|
274
307
|
SHOOTER_PKG_ROOT: PKG_ROOT,
|
|
275
308
|
SHOOTER_HOME,
|
|
276
309
|
},
|
|
@@ -311,6 +344,7 @@ function startServer() {
|
|
|
311
344
|
stdio: 'inherit',
|
|
312
345
|
env: {
|
|
313
346
|
...process.env,
|
|
347
|
+
PORT: String(port),
|
|
314
348
|
SHOOTER_PKG_ROOT: PKG_ROOT,
|
|
315
349
|
SHOOTER_HOME,
|
|
316
350
|
},
|
|
@@ -1218,8 +1252,9 @@ Commands:
|
|
|
1218
1252
|
help Show this help message
|
|
1219
1253
|
|
|
1220
1254
|
Start options:
|
|
1221
|
-
-d, --daemon
|
|
1222
|
-
--no-tunnel
|
|
1255
|
+
-d, --daemon Run in background (detach from terminal)
|
|
1256
|
+
--no-tunnel Don't start a Cloudflare Tunnel
|
|
1257
|
+
-p, --port <num> Port to listen on (overrides PORT env)
|
|
1223
1258
|
|
|
1224
1259
|
Auto-update:
|
|
1225
1260
|
When running as a LaunchAgent, Shooter automatically checks for updates
|
|
@@ -1227,16 +1262,17 @@ Auto-update:
|
|
|
1227
1262
|
server is restarted via launchctl. Terminal sessions survive restarts.
|
|
1228
1263
|
|
|
1229
1264
|
Examples:
|
|
1230
|
-
shooter
|
|
1231
|
-
shooter start -d
|
|
1265
|
+
shooter Start the server + tunnel (foreground)
|
|
1266
|
+
shooter start -d Start in background (daemon mode)
|
|
1232
1267
|
shooter start --no-tunnel Start without Cloudflare Tunnel
|
|
1233
|
-
shooter
|
|
1234
|
-
shooter
|
|
1235
|
-
shooter
|
|
1236
|
-
shooter
|
|
1237
|
-
shooter setup
|
|
1238
|
-
shooter
|
|
1239
|
-
shooter update
|
|
1268
|
+
shooter start --port 3000 Start on port 3000
|
|
1269
|
+
shooter status Check status and tunnel URL
|
|
1270
|
+
shooter autostart on Enable autostart on login
|
|
1271
|
+
shooter logs Follow server logs
|
|
1272
|
+
shooter setup Quick setup (~60s, push deferred)
|
|
1273
|
+
shooter setup --push Add iOS/Android push notifications
|
|
1274
|
+
shooter update Check and install updates
|
|
1275
|
+
shooter update check Check for updates only
|
|
1240
1276
|
`.trim()
|
|
1241
1277
|
);
|
|
1242
1278
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{g as y}from"./gQJcRhou.js";import"./BCwT4WOg.js";const k="https://unpkg.com/@juspay/neurolink@9.61.1/dist/browser/neurolink.min.js",b={"https://api.anthropic.com/":"anthropic","https://api.mistral.ai/":"mistral","https://api.openai.com/":"openai","https://generativelanguage.googleapis.com/":"google-ai"};let f=!1;function O(){if(f||typeof globalThis>"u")return;f=!0;const r=globalThis.fetch.bind(globalThis);globalThis.fetch=async(e,o)=>{const i=typeof e=="string"?e:e instanceof URL?e.href:e.url,n=Object.entries(b).find(([t])=>i.startsWith(t))?.[1];if(!n)return r(e,o);const c={},s=o?.headers??(e instanceof Request?e.headers:{}),d=s instanceof Headers?s:Object.entries(s);for(const[t,g]of d){const p=t.toLowerCase();p!=="x-api-key"&&p!=="authorization"&&(c[t]=g)}let a;try{a=JSON.parse(o?.body??(e instanceof Request?await e.text():"{}"))}catch{a={}}const l=y(),h={"Content-Type":"application/json"};return l&&(h.Authorization=`Bearer ${l}`),r("/api/neurolink-proxy",{body:JSON.stringify({body:a,headers:c,provider:n,url:i}),headers:h,method:"POST"})}}export{k as N,O as i};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as r,p as e}from"./
|
|
1
|
+
import{s as r,p as e}from"./Dfn9ME_a.js";const a={get params(){return e.params},get url(){return e.url}};r.updated.check;const s=a;export{s as p};
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{bq as Te,q as Ve,s as P,g as j,b as C,P as oe,br as vt}from"./Ce0VRwE1.js";class pe{constructor(t,n){this.status=t,typeof n=="string"?this.body={message:n}:n?this.body=n:this.body={message:`Error: ${t}`}}toString(){return JSON.stringify(this.body)}}class Ue{constructor(t,n){this.status=t,this.location=n}}class Le extends Error{constructor(t,n,r){super(r),this.status=t,this.text=n}}new URL("sveltekit-internal://");function bt(e,t){return e==="/"||t==="ignore"?e:t==="never"?e.endsWith("/")?e.slice(0,-1):e:t==="always"&&!e.endsWith("/")?e+"/":e}function kt(e){return e.split("%25").map(decodeURI).join("%25")}function Et(e){for(const t in e)e[t]=decodeURIComponent(e[t]);return e}function ye({href:e}){return e.split("#")[0]}function At(...e){let t=5381;for(const n of e)if(typeof n=="string"){let r=n.length;for(;r;)t=t*33^n.charCodeAt(--r)}else if(ArrayBuffer.isView(n)){const r=new Uint8Array(n.buffer,n.byteOffset,n.byteLength);let a=r.length;for(;a;)t=t*33^r[--a]}else throw new TypeError("value must be a string or TypedArray");return(t>>>0).toString(36)}new TextEncoder;const St=new TextDecoder;function Rt(e){const t=atob(e),n=new Uint8Array(t.length);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}const It=window.fetch;window.fetch=(e,t)=>((e instanceof Request?e.method:t?.method||"GET")!=="GET"&&J.delete(Pe(e)),It(e,t));const J=new Map;function Tt(e,t){const n=Pe(e,t),r=document.querySelector(n);if(r?.textContent){r.remove();let{body:a,...s}=JSON.parse(r.textContent);const o=r.getAttribute("data-ttl");return o&&J.set(n,{body:a,init:s,ttl:1e3*Number(o)}),r.getAttribute("data-b64")!==null&&(a=Rt(a)),Promise.resolve(new Response(a,s))}return window.fetch(e,t)}function Ut(e,t,n){if(J.size>0){const r=Pe(e,n),a=J.get(r);if(a){if(performance.now()<a.ttl&&["default","force-cache","only-if-cached",void 0].includes(n?.cache))return new Response(a.body,a.init);J.delete(r)}}return window.fetch(t,n)}function Pe(e,t){let r=`script[data-sveltekit-fetched][data-url=${JSON.stringify(e instanceof Request?e.url:e)}]`;if(t?.headers||t?.body){const a=[];t.headers&&a.push([...new Headers(t.headers)].join(",")),t.body&&(typeof t.body=="string"||ArrayBuffer.isView(t.body))&&a.push(t.body),r+=`[data-hash="${At(...a)}"]`}return r}const Lt=/^(\[)?(\.\.\.)?(\w+)(?:=(\w+))?(\])?$/;function Pt(e){const t=[];return{pattern:e==="/"?/^\/$/:new RegExp(`^${Ct(e).map(r=>{const a=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(r);if(a)return t.push({name:a[1],matcher:a[2],optional:!1,rest:!0,chained:!0}),"(?:/([^]*))?";const s=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(r);if(s)return t.push({name:s[1],matcher:s[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!r)return;const o=r.split(/\[(.+?)\](?!\])/);return"/"+o.map((i,l)=>{if(l%2){if(i.startsWith("x+"))return ve(String.fromCharCode(parseInt(i.slice(2),16)));if(i.startsWith("u+"))return ve(String.fromCharCode(...i.slice(2).split("-").map(h=>parseInt(h,16))));const f=Lt.exec(i),[,u,_,p,d]=f;return t.push({name:p,matcher:d,optional:!!u,rest:!!_,chained:_?l===1&&o[0]==="":!1}),_?"([^]*?)":u?"([^/]*)?":"([^/]+?)"}return ve(i)}).join("")}).join("")}/?$`),params:t}}function jt(e){return e!==""&&!/^\([^)]+\)$/.test(e)}function Ct(e){return e.slice(1).split("/").filter(jt)}function Ot(e,t,n){const r={},a=e.slice(1),s=a.filter(c=>c!==void 0);let o=0;for(let c=0;c<t.length;c+=1){const i=t[c];let l=a[c-o];if(i.chained&&i.rest&&o&&(l=a.slice(c-o,c+1).filter(f=>f).join("/"),o=0),l===void 0)if(i.rest)l="";else continue;if(!i.matcher||n[i.matcher](l)){r[i.name]=l;const f=t[c+1],u=a[c+1];f&&!f.rest&&f.optional&&u&&i.chained&&(o=0),!f&&!u&&Object.keys(r).length===s.length&&(o=0);continue}if(i.optional&&i.chained){o++;continue}return}if(!o)return r}function ve(e){return e.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}function Nt({nodes:e,server_loads:t,dictionary:n,matchers:r}){const a=new Set(t);return Object.entries(n).map(([c,[i,l,f]])=>{const{pattern:u,params:_}=Pt(c),p={id:c,exec:d=>{const h=u.exec(d);if(h)return Ot(h,_,r)},errors:[1,...f||[]].map(d=>e[d]),layouts:[0,...l||[]].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 Ze(e,t=JSON.parse){try{return t(sessionStorage[e])}catch{}}function Me(e,t,n=JSON.stringify){const r=n(t);try{sessionStorage[e]=r}catch{}}const T=globalThis.__sveltekit_1viglpw?.base??"",xt=globalThis.__sveltekit_1viglpw?.assets??T??"",$t="1778362693535",Qe="sveltekit:snapshot",et="sveltekit:scroll",tt="sveltekit:states",Dt="sveltekit:pageurl",q="sveltekit:history",Q="sveltekit:navigation",B={tap:1,hover:2,viewport:3,eager:4,off:-1,false:-1},re=location.origin;function je(e){if(e instanceof URL)return e;let t=document.baseURI;if(!t){const n=document.getElementsByTagName("base");t=n.length?n[0].href:document.URL}return new URL(e,t)}function V(){return{x:pageXOffset,y:pageYOffset}}function M(e,t){return e.getAttribute(`data-sveltekit-${t}`)}const qe={...B,"":B.hover};function nt(e){let t=e.assignedSlot??e.parentNode;return t?.nodeType===11&&(t=t.host),t}function rt(e,t){for(;e&&e!==t;){if(e.nodeName.toUpperCase()==="A"&&e.hasAttribute("href"))return e;e=nt(e)}}function Ee(e,t,n){let r;try{if(r=new URL(e instanceof SVGAElement?e.href.baseVal:e.href,document.baseURI),n&&r.hash.match(/^#[^/]/)){const c=location.hash.split("#")[1]||"/";r.hash=`#${c}${r.hash}`}}catch{}const a=e instanceof SVGAElement?e.target.baseVal:e.target,s=!r||!!a||_e(r,t,n)||(e.getAttribute("rel")||"").split(/\s+/).includes("external"),o=r?.origin===re&&e.hasAttribute("download");return{url:r,external:s,target:a,download:o}}function se(e){let t=null,n=null,r=null,a=null,s=null,o=null,c=e;for(;c&&c!==document.documentElement;)r===null&&(r=M(c,"preload-code")),a===null&&(a=M(c,"preload-data")),t===null&&(t=M(c,"keepfocus")),n===null&&(n=M(c,"noscroll")),s===null&&(s=M(c,"reload")),o===null&&(o=M(c,"replacestate")),c=nt(c);function i(l){switch(l){case"":case"true":return!0;case"off":case"false":return!1;default:return}}return{preload_code:qe[r??"off"],preload_data:qe[a??"off"],keepfocus:i(t),noscroll:i(n),reload:i(s),replace_state:i(o)}}function Ge(e){const t=Te(e);let n=!0;function r(){n=!0,t.update(o=>o)}function a(o){n=!1,t.set(o)}function s(o){let c;return t.subscribe(i=>{(c===void 0||n&&i!==c)&&o(c=i)})}return{notify:r,set:a,subscribe:s}}const at={v:()=>{}};function Bt(){const{set:e,subscribe:t}=Te(!1);let n;async function r(){clearTimeout(n);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!==$t;return o&&(e(!0),at.v(),clearTimeout(n)),o}catch{return!1}}return{subscribe:t,check:r}}function _e(e,t,n){return e.origin!==re||!e.pathname.startsWith(t)?!0:n?e.pathname!==location.pathname:!1}function Sn(e){}function Ft(e){const t=Mt(e),n=new ArrayBuffer(t.length),r=new DataView(n);for(let a=0;a<n.byteLength;a++)r.setUint8(a,t.charCodeAt(a));return n}const Vt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function Mt(e){e.length%4===0&&(e=e.replace(/==?$/,""));let t="",n=0,r=0;for(let a=0;a<e.length;a++)n<<=6,n|=Vt.indexOf(e[a]),r+=6,r===24&&(t+=String.fromCharCode((n&16711680)>>16),t+=String.fromCharCode((n&65280)>>8),t+=String.fromCharCode(n&255),n=r=0);return r===12?(n>>=4,t+=String.fromCharCode(n)):r===18&&(n>>=2,t+=String.fromCharCode((n&65280)>>8),t+=String.fromCharCode(n&255)),t}const qt=-1,Gt=-2,Kt=-3,Yt=-4,Wt=-5,Ht=-6,zt=-7;function Jt(e,t){if(typeof e=="number")return s(e,!0);if(!Array.isArray(e)||e.length===0)throw new Error("Invalid input");const n=e,r=Array(n.length);let a=null;function s(o,c=!1){if(o===qt)return;if(o===Kt)return NaN;if(o===Yt)return 1/0;if(o===Wt)return-1/0;if(o===Ht)return-0;if(c||typeof o!="number")throw new Error("Invalid input");if(o in r)return r[o];const i=n[o];if(!i||typeof i!="object")r[o]=i;else if(Array.isArray(i))if(typeof i[0]=="string"){const l=i[0],f=t&&Object.hasOwn(t,l)?t[l]:void 0;if(f){let u=i[1];if(typeof u!="number"&&(u=n.push(i[1])-1),a??=new Set,a.has(u))throw new Error("Invalid circular reference");return a.add(u),r[o]=f(s(u)),a.delete(u),r[o]}switch(l){case"Date":r[o]=new Date(i[1]);break;case"Set":const u=new Set;r[o]=u;for(let h=1;h<i.length;h+=1)u.add(s(i[h]));break;case"Map":const _=new Map;r[o]=_;for(let h=1;h<i.length;h+=2)_.set(s(i[h]),s(i[h+1]));break;case"RegExp":r[o]=new RegExp(i[1],i[2]);break;case"Object":const p=Object(i[1]);if(Object.hasOwn(p,"__proto__"))throw new Error("Cannot parse an object with a `__proto__` property");r[o]=p;break;case"BigInt":r[o]=BigInt(i[1]);break;case"null":const d=Object.create(null);r[o]=d;for(let h=1;h<i.length;h+=2){if(i[h]==="__proto__")throw new Error("Cannot parse an object with a `__proto__` property");d[i[h]]=s(i[h+1])}break;case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"BigInt64Array":case"BigUint64Array":{if(n[i[1]][0]!=="ArrayBuffer")throw new Error("Invalid data");const h=globalThis[l],w=s(i[1]),g=new h(w);r[o]=i[2]!==void 0?g.subarray(i[2],i[3]):g;break}case"ArrayBuffer":{const h=i[1];if(typeof h!="string")throw new Error("Invalid ArrayBuffer encoding");const w=Ft(h);r[o]=w;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 h=l.slice(9);r[o]=Temporal[h].from(i[1]);break}case"URL":{const h=new URL(i[1]);r[o]=h;break}case"URLSearchParams":{const h=new URLSearchParams(i[1]);r[o]=h;break}default:throw new Error(`Unknown type ${l}`)}}else if(i[0]===zt){const l=i[1];if(!Number.isInteger(l)||l<0)throw new Error("Invalid input");const f=new Array(l);r[o]=f;for(let u=2;u<i.length;u+=2){const _=i[u];if(!Number.isInteger(_)||_<0||_>=l)throw new Error("Invalid input");f[_]=s(i[u+1])}}else{const l=new Array(i.length);r[o]=l;for(let f=0;f<i.length;f+=1){const u=i[f];u!==Gt&&(l[f]=s(u))}}else{const l={};r[o]=l;for(const f of Object.keys(i)){if(f==="__proto__")throw new Error("Cannot parse an object with a `__proto__` property");const u=i[f];l[f]=s(u)}}return r[o]}return s(0)}const ot=new Set(["load","prerender","csr","ssr","trailingSlash","config"]);[...ot];const Xt=new Set([...ot]);[...Xt];function Zt(e){return e.filter(t=>t!=null)}const Qt="x-sveltekit-invalidated",en="x-sveltekit-trailing-slash";function ie(e){return e instanceof pe||e instanceof Le?e.status:500}function tn(e){return e instanceof Le?e.text:"Internal Error"}let R,ee,be;const nn=Ve.toString().includes("$$")||/function \w+\(\) \{\}/.test(Ve.toString()),Ke="a:";nn?(R={data:{},form:null,error:null,params:{},route:{id:null},state:{},status:-1,url:new URL(Ke)},ee={current:null},be={current:!1}):(R=new class{#e=P({});get data(){return j(this.#e)}set data(t){C(this.#e,t)}#t=P(null);get form(){return j(this.#t)}set form(t){C(this.#t,t)}#n=P(null);get error(){return j(this.#n)}set error(t){C(this.#n,t)}#r=P({});get params(){return j(this.#r)}set params(t){C(this.#r,t)}#a=P({id:null});get route(){return j(this.#a)}set route(t){C(this.#a,t)}#o=P({});get state(){return j(this.#o)}set state(t){C(this.#o,t)}#s=P(-1);get status(){return j(this.#s)}set status(t){C(this.#s,t)}#i=P(new URL(Ke));get url(){return j(this.#i)}set url(t){C(this.#i,t)}},ee=new class{#e=P(null);get current(){return j(this.#e)}set current(t){C(this.#e,t)}},be=new class{#e=P(!1);get current(){return j(this.#e)}set current(t){C(this.#e,t)}},at.v=()=>be.current=!0);function rn(e){Object.assign(R,e)}const an="/__data.json",on=".html__data.json";function sn(e){return e.endsWith(".html")?e.replace(/\.html$/,on):e.replace(/\/$/,"")+an}const cn=new Set(["icon","shortcut icon","apple-touch-icon"]);let H=null;const $=Ze(et)??{},te=Ze(Qe)??{},x={url:Ge({}),page:Ge({}),navigating:Te(null),updated:Bt()};function Ce(e){$[e]=V()}function ln(e,t){let n=e+1;for(;$[n];)delete $[n],n+=1;for(n=t+1;te[n];)delete te[n],n+=1}function Y(e,t=!1){return t?location.replace(e.href):location.href=e.href,new Promise(()=>{})}async function st(){if("serviceWorker"in navigator){const e=await navigator.serviceWorker.getRegistration(T||"/");e&&await e.update()}}function Ye(){}let Oe,Ae,ce,N,Se,k;const le=[],fe=[];let L=null;function Re(){L?.fork?.then(e=>e?.discard()),L=null}const ae=new Map,it=new Set,fn=new Set,X=new Set;let y={branch:[],error:null,url:null},Ne=!1,ue=!1,We=!0,ne=!1,z=!1,ct=!1,xe=!1,lt,S,I,F;const Z=new Set,He=new Map;async function Un(e,t,n){globalThis.__sveltekit_1viglpw?.data&&globalThis.__sveltekit_1viglpw.data,document.URL!==location.href&&(location.href=location.href),k=e,await e.hooks.init?.(),Oe=Nt(e),N=document.documentElement,Se=t,Ae=e.nodes[0],ce=e.nodes[1],Ae(),ce(),S=history.state?.[q],I=history.state?.[Q],S||(S=I=Date.now(),history.replaceState({...history.state,[q]:S,[Q]:I},""));const r=$[S];function a(){r&&(history.scrollRestoration="manual",scrollTo(r.x,r.y))}n?(a(),await bn(Se,n)):(await G({type:"enter",url:je(k.hash?En(new URL(location.href)):location.href),replace_state:!0}),a()),vn()}function un(){le.length=0,xe=!1}function ft(e){fe.some(t=>t?.snapshot)&&(te[e]=fe.map(t=>t?.snapshot?.capture()))}function ut(e){te[e]?.forEach((t,n)=>{fe[n]?.snapshot?.restore(t)})}function ze(){Ce(S),Me(et,$),ft(I),Me(Qe,te)}async function dt(e,t,n,r){let a;t.invalidateAll&&Re(),await G({type:"goto",url:je(e),keepfocus:t.keepFocus,noscroll:t.noScroll,replace_state:t.replaceState,state:t.state,redirect_count:n,nav_token:r,accept:()=>{t.invalidateAll&&(xe=!0,a=[...He.keys()]),t.invalidate&&t.invalidate.forEach(yn)}}),t.invalidateAll&&oe().then(oe).then(()=>{He.forEach(({resource:s},o)=>{a?.includes(o)&&s.refresh?.()})})}async function dn(e){if(e.id!==L?.id){Re();const t={};Z.add(t),L={id:e.id,token:t,promise:pt({...e,preload:t}).then(n=>(Z.delete(t),n.type==="loaded"&&n.state.error&&Re(),n)),fork:null}}return L.promise}async function ke(e){const t=(await me(e,!1))?.route;t&&await Promise.all([...t.layouts,t.leaf].filter(Boolean).map(n=>n[1]()))}async function ht(e,t,n){const r={params:y.params,route:{id:y.route?.id??null},url:new URL(location.href)};y={...e.state,nav:r};const a=document.querySelector("style[data-sveltekit]");if(a&&a.remove(),Object.assign(R,e.props.page),lt=new k.root({target:t,props:{...e.props,stores:x,components:fe},hydrate:n,sync:!1,transformError:void 0}),await Promise.resolve(),ut(I),n){const s={from:null,to:{...r,scroll:$[S]??V()},willUnload:!1,type:"enter",complete:Promise.resolve()};X.forEach(o=>o(s))}ue=!0}async function de({url:e,params:t,branch:n,errors:r,status:a,error:s,route:o,form:c}){let i="never";if(T&&(e.pathname===T||e.pathname===T+"/"))i="always";else for(const d of n)d?.slash!==void 0&&(i=d.slash);e.pathname=bt(e.pathname,i),e.search=e.search;const l={type:"loaded",state:{url:e,params:t,branch:n,error:s,route:o},props:{constructors:Zt(n).map(d=>d.node.component),page:Fe(R)}};c!==void 0&&(l.props.form=c);let f={},u=!R,_=0;for(let d=0;d<Math.max(n.length,y.branch.length);d+=1){const h=n[d],w=y.branch[d];h?.data!==w?.data&&(u=!0),h&&(f={...f,...h.data},u&&(l.props[`data_${_}`]=f),_+=1)}return(!y.url||e.href!==y.url.href||y.error!==s||c!==void 0&&c!==R.form||u)&&(l.props.page={error:s,params:t,route:{id:o?.id??null},state:{},status:a,url:new URL(e),form:c??null,data:u?f:R.data}),l}async function $e({loader:e,parent:t,url:n,params:r,route:a,server_data_node:s}){let o=null;const c={dependencies:new Set,params:new Set,parent:!1,route:!1,url:!1,search_params:new Set},i=await e();return{node:i,loader:e,server:s,universal:i.universal?.load?{type:"data",data:o,uses:c}:null,data:o??s?.data??null,slash:i.universal?.trailingSlash??s?.slash}}function hn(e,t,n){let r=e instanceof Request?e.url:e;const a=new URL(r,n);a.origin===n.origin&&(r=a.href.slice(n.origin.length));const s=ue?Ut(r,a.href,t):Tt(r,t);return{resolved:a,promise:s}}function Je(e,t,n,r,a,s){if(xe)return!0;if(!a)return!1;if(a.parent&&e||a.route&&t||a.url&&n)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(le.some(c=>c(new URL(o))))return!0;return!1}function De(e,t){return e?.type==="data"?e:e?.type==="skip"?t??null:null}function pn(e,t){if(!e)return new Set(t.searchParams.keys());const n=new Set([...e.searchParams.keys(),...t.searchParams.keys()]);for(const r of n){const a=e.searchParams.getAll(r),s=t.searchParams.getAll(r);a.every(o=>s.includes(o))&&s.every(o=>a.includes(o))&&n.delete(r)}return n}function Xe({error:e,url:t,route:n,params:r}){return{type:"loaded",state:{error:e,url:t,route:n,params:r,branch:[]},props:{page:Fe(R),constructors:[]}}}async function pt({id:e,invalidating:t,url:n,params:r,route:a,preload:s}){if(L?.id===e)return Z.delete(L.token),L.promise;const{errors:o,layouts:c,leaf:i}=a,l=[...c,i];o.forEach(m=>m?.().catch(()=>{})),l.forEach(m=>m?.[1]().catch(()=>{}));let f=null;const u=y.url?e!==he(y.url):!1,_=y.route?a.id!==y.route.id:!1,p=pn(y.url,n);let d=!1;{const m=l.map((v,E)=>{const A=y.branch[E],b=!!v?.[0]&&(A?.loader!==v[1]||Je(d,_,u,p,A.server?.uses,r));return b&&(d=!0),b});if(m.some(Boolean)){try{f=await mt(n,m)}catch(v){const E=await K(v,{url:n,params:r,route:{id:e}});return Z.has(s)?Xe({error:E,url:n,params:r,route:a}):ge({status:ie(v),error:E,url:n,route:a})}if(f.type==="redirect")return f}}const h=f?.nodes;let w=!1;const g=l.map(async(m,v)=>{if(!m)return;const E=y.branch[v],A=h?.[v];if((!A||A.type==="skip")&&m[1]===E?.loader&&!Je(w,_,u,p,E.universal?.uses,r))return E;if(w=!0,A?.type==="error")throw A;return $e({loader:m[1],url:n,params:r,route:a,parent:async()=>{const O={};for(let D=0;D<v;D+=1)Object.assign(O,(await g[D])?.data);return O},server_data_node:De(A===void 0&&m[0]?{type:"skip"}:A??null,m[0]?E?.server:void 0)})});for(const m of g)m.catch(()=>{});const U=[];for(let m=0;m<l.length;m+=1)if(l[m])try{U.push(await g[m])}catch(v){if(v instanceof Ue)return{type:"redirect",location:v.location};if(Z.has(s))return Xe({error:await K(v,{params:r,url:n,route:{id:a.id}}),url:n,params:r,route:a});let E=ie(v),A;if(h?.includes(v))E=v.status??E,A=v.error;else if(v instanceof pe)A=v.body;else{if(await x.updated.check())return await st(),await Y(n);A=await K(v,{params:r,url:n,route:{id:a.id}})}const b=await _n(m,U,o);return b?de({url:n,params:r,branch:U.slice(0,b.idx).concat(b.node),errors:o,status:E,error:A,route:a}):await gt(n,{id:a.id},A,E)}else U.push(void 0);return de({url:n,params:r,branch:U,errors:o,status:200,error:null,route:a,form:t?void 0:null})}async function _n(e,t,n){for(;e--;)if(n[e]){let r=e;for(;!t[r];)r-=1;try{return{idx:r+1,node:{node:await n[e](),loader:n[e],data:{},server:null,universal:null}}}catch{continue}}}async function ge({status:e,error:t,url:n,route:r}){const a={};let s=null;if(k.server_loads[0]===0)try{const c=await mt(n,[!0]);if(c.type!=="data"||c.nodes[0]&&c.nodes[0].type!=="data")throw 0;s=c.nodes[0]??null}catch{(n.origin!==re||n.pathname!==location.pathname||Ne)&&await Y(n)}try{const o=await $e({loader:Ae,url:n,params:a,route:r,parent:()=>Promise.resolve({}),server_data_node:De(s)}),c={node:await ce(),loader:ce,universal:null,server:null,data:null};return de({url:n,params:a,branch:[o,c],status:e,error:t,errors:[],route:null})}catch(o){if(o instanceof Ue)return dt(new URL(o.location,location.href),{},0);throw o}}async function gn(e){const t=e.href;if(ae.has(t))return ae.get(t);let n;try{const r=(async()=>{let a=await k.hooks.reroute({url:new URL(e),fetch:async(s,o)=>hn(s,o,e).promise})??e;if(typeof a=="string"){const s=new URL(e);k.hash?s.hash=a:s.pathname=a,a=s}return a})();ae.set(t,r),n=await r}catch{ae.delete(t);return}return n}async function me(e,t){if(e&&!_e(e,T,k.hash)){const n=await gn(e);if(!n)return;const r=mn(n);for(const a of Oe){const s=a.exec(r);if(s)return{id:he(e),invalidating:t,route:a,params:Et(s),url:e}}}}function mn(e){return kt(k.hash?e.hash.replace(/^#/,"").replace(/[?#].+/,""):e.pathname.slice(T.length))||"/"}function he(e){return(k.hash?e.hash.replace(/^#/,""):e.pathname)+e.search}function _t({url:e,type:t,intent:n,delta:r,event:a,scroll:s}){let o=!1;const c=Be(y,n,e,t,s??null);r!==void 0&&(c.navigation.delta=r),a!==void 0&&(c.navigation.event=a);const i={...c.navigation,cancel:()=>{o=!0,c.reject(new Error("navigation cancelled"))}};return ne||it.forEach(l=>l(i)),o?null:c}async function G({type:e,url:t,popped:n,keepfocus:r,noscroll:a,replace_state:s,state:o={},redirect_count:c=0,nav_token:i={},accept:l=Ye,block:f=Ye,event:u}){const _=F;F=i;const p=await me(t,!1),d=e==="enter"?Be(y,p,t,e):_t({url:t,type:e,delta:n?.delta,intent:p,scroll:n?.scroll,event:u});if(!d){f(),F===i&&(F=_);return}const h=S,w=I;l(),ne=!0,ue&&d.navigation.type!=="enter"&&x.navigating.set(ee.current=d.navigation);let g=p&&await pt(p);if(!g){if(_e(t,T,k.hash))return await Y(t,s);g=await gt(t,{id:null},await K(new Le(404,"Not Found",`Not found: ${t.pathname}`),{url:t,params:{},route:{id:null}}),404,s)}if(t=p?.url||t,F!==i)return d.reject(new Error("navigation aborted")),!1;if(g.type==="redirect"){if(c<20){await G({type:e,url:new URL(g.location,t),popped:n,keepfocus:r,noscroll:a,replace_state:s,state:o,redirect_count:c+1,nav_token:i}),d.fulfil(void 0);return}g=await ge({status:500,error:await K(new Error("Redirect loop"),{url:t,params:{},route:{id:null}}),url:t,route:{id:null}})}else g.props.page.status>=400&&await x.updated.check()&&(await st(),await Y(t,s));if(un(),Ce(h),ft(w),g.props.page.url.pathname!==t.pathname&&(t.pathname=g.props.page.url.pathname),o=n?n.state:o,!n){const b=s?0:1,O={[q]:S+=b,[Q]:I+=b,[tt]:o};(s?history.replaceState:history.pushState).call(history,O,"",t),s||ln(S,I)}const U=p&&L?.id===p.id?L.fork:null;L=null,g.props.page.state=o;let m;if(ue){const b=(await Promise.all(Array.from(fn,W=>W(d.navigation)))).filter(W=>typeof W=="function");if(b.length>0){let W=function(){b.forEach(we=>{X.delete(we)})};b.push(W),b.forEach(we=>{X.add(we)})}const O=d.navigation.to;y={...g.state,nav:{params:O.params,route:O.route,url:O.url}},g.props.page&&(g.props.page.url=t);const D=U&&await U;D?m=D.commit():(H=null,lt.$set(g.props),H&&Object.assign(g.props.page,H),rn(g.props.page),m=vt?.()),ct=!0}else await ht(g,Se,!1);const{activeElement:v}=document;await m,await oe(),await oe();let E=null;if(We){const b=n?n.scroll:a?V():null;b?scrollTo(b.x,b.y):(E=t.hash&&document.getElementById(yt(t)))?E.scrollIntoView():scrollTo(0,0)}const A=document.activeElement!==v&&document.activeElement!==document.body;!r&&!A&&kn(t,!E),We=!0,g.props.page&&(H&&Object.assign(g.props.page,H),Object.assign(R,g.props.page)),ne=!1,e==="popstate"&&ut(I),d.fulfil(void 0),d.navigation.to&&(d.navigation.to.scroll=V()),X.forEach(b=>b(d.navigation)),x.navigating.set(ee.current=null)}async function gt(e,t,n,r,a){return e.origin===re&&e.pathname===location.pathname&&!Ne?await ge({status:r,error:n,url:e,route:t}):await Y(e,a)}function wn(){let e,t={element:void 0,href:void 0},n;N.addEventListener("mousemove",c=>{const i=c.target;clearTimeout(e),e=setTimeout(()=>{s(i,B.hover)},20)});function r(c){c.defaultPrevented||s(c.composedPath()[0],B.tap)}N.addEventListener("mousedown",r),N.addEventListener("touchstart",r,{passive:!0});const a=new IntersectionObserver(c=>{for(const i of c)i.isIntersecting&&(ke(new URL(i.target.href)),a.unobserve(i.target))},{threshold:0});async function s(c,i){const l=rt(c,N),f=l===t.element&&l?.href===t.href&&i>=n;if(!l||f)return;const{url:u,external:_,download:p}=Ee(l,T,k.hash);if(_||p)return;const d=se(l),h=u&&he(y.url)===he(u);if(!(d.reload||h))if(i<=d.preload_data){t={element:l,href:l.href},n=B.tap;const w=await me(u,!1);if(!w)return;dn(w)}else i<=d.preload_code&&(t={element:l,href:l.href},n=i,ke(u))}function o(){a.disconnect();for(const c of N.querySelectorAll("a")){const{url:i,external:l,download:f}=Ee(c,T,k.hash);if(l||f)continue;const u=se(c);u.reload||(u.preload_code===B.viewport&&a.observe(c),u.preload_code===B.eager&&ke(i))}}X.add(o),o()}function K(e,t){if(e instanceof pe)return e.body;const n=ie(e),r=tn(e);return k.hooks.handleError({error:e,event:t,status:n,message:r})??{message:r}}function Ln(e,t={}){return e=new URL(je(e)),e.origin!==re?Promise.reject(new Error("goto: invalid URL")):dt(e,t,0)}function yn(e){if(typeof e=="function")le.push(e);else{const{href:t}=new URL(e,location.href);le.push(n=>n.href===t)}}function vn(){history.scrollRestoration="manual",addEventListener("beforeunload",t=>{let n=!1;if(ze(),!ne){const r=Be(y,void 0,null,"leave"),a={...r.navigation,cancel:()=>{n=!0,r.reject(new Error("navigation cancelled"))}};it.forEach(s=>s(a))}n?(t.preventDefault(),t.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&ze()}),navigator.connection?.saveData||wn(),N.addEventListener("click",async t=>{if(t.button||t.which!==1||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.defaultPrevented)return;const n=rt(t.composedPath()[0],N);if(!n)return;const{url:r,external:a,target:s,download:o}=Ee(n,T,k.hash);if(!r)return;if(s==="_parent"||s==="_top"){if(window.parent!==window)return}else if(s&&s!=="_self")return;const c=se(n);if(!(n instanceof SVGAElement)&&r.protocol!==location.protocol&&!(r.protocol==="https:"||r.protocol==="http:")||o)return;const[l,f]=(k.hash?r.hash.replace(/^#/,""):r.href).split("#"),u=l===ye(location);if(a||c.reload&&(!u||!f)){_t({url:r,type:"link",event:t})?ne=!0:t.preventDefault();return}if(f!==void 0&&u){const[,_]=y.url.href.split("#");if(_===f){if(t.preventDefault(),f===""||f==="top"&&n.ownerDocument.getElementById("top")===null)scrollTo({top:0});else{const p=n.ownerDocument.getElementById(decodeURIComponent(f));p&&(p.scrollIntoView(),p.focus())}return}if(z=!0,Ce(S),e(r),!c.replace_state)return;z=!1}t.preventDefault(),await new Promise(_=>{requestAnimationFrame(()=>{setTimeout(_,0)}),setTimeout(_,100)}),await G({type:"link",url:r,keepfocus:c.keepfocus,noscroll:c.noscroll,replace_state:c.replace_state??r.href===location.href,event:t})}),N.addEventListener("submit",t=>{if(t.defaultPrevented)return;const n=HTMLFormElement.prototype.cloneNode.call(t.target),r=t.submitter;if((r?.formTarget||n.target)==="_blank"||(r?.formMethod||n.method)!=="get")return;const o=new URL(r?.hasAttribute("formaction")&&r?.formAction||n.action);if(_e(o,T,!1))return;const c=t.target,i=se(c);if(i.reload)return;t.preventDefault(),t.stopPropagation();const l=new FormData(c,r);o.search=new URLSearchParams(l).toString(),G({type:"form",url:o,keepfocus:i.keepfocus,noscroll:i.noscroll,replace_state:i.replace_state??o.href===location.href,event:t})}),addEventListener("popstate",async t=>{if(!Ie){if(t.state?.[q]){const n=t.state[q];if(F={},n===S)return;const r=$[n],a=t.state[tt]??{},s=new URL(t.state[Dt]??location.href),o=t.state[Q],c=y.url?ye(location)===ye(y.url):!1;if(o===I&&(ct||c)){a!==R.state&&(R.state=a),e(s),$[S]=V(),r&&scrollTo(r.x,r.y),S=n;return}const l=n-S;await G({type:"popstate",url:s,popped:{state:a,scroll:r,delta:l},accept:()=>{S=n,I=o},block:()=>{history.go(-l)},nav_token:F,event:t})}else if(!z){const n=new URL(location.href);e(n),k.hash&&location.reload()}}}),addEventListener("hashchange",()=>{z&&(z=!1,history.replaceState({...history.state,[q]:++S,[Q]:I},"",location.href))});for(const t of document.querySelectorAll("link"))cn.has(t.rel)&&(t.href=t.href);addEventListener("pageshow",t=>{t.persisted&&x.navigating.set(ee.current=null)});function e(t){y.url=R.url=t,x.page.set(Fe(R)),x.page.notify()}}async function bn(e,{status:t=200,error:n,node_ids:r,params:a,route:s,server_route:o,data:c,form:i}){Ne=!0;const l=new URL(location.href);let f;({params:a={},route:s={id:null}}=await me(l,!1)||{}),f=Oe.find(({id:p})=>p===s.id);let u,_=!0;try{const p=r.map(async(h,w)=>{const g=c[w];return g?.uses&&(g.uses=wt(g.uses)),$e({loader:k.nodes[h],url:l,params:a,route:s,parent:async()=>{const U={};for(let m=0;m<w;m+=1)Object.assign(U,(await p[m]).data);return U},server_data_node:De(g)})}),d=await Promise.all(p);if(f){const h=f.layouts;for(let w=0;w<h.length;w++)h[w]||d.splice(w,0,void 0)}u=await de({url:l,params:a,branch:d,status:t,error:n,errors:f?.errors,form:i,route:f??null})}catch(p){if(p instanceof Ue){await Y(new URL(p.location,location.href));return}u=await ge({status:ie(p),error:await K(p,{url:l,params:a,route:s}),url:l,route:s}),e.textContent="",_=!1}u.props.page&&(u.props.page.state={}),await ht(u,e,_)}async function mt(e,t){const n=new URL(e);n.pathname=sn(e.pathname),e.pathname.endsWith("/")&&n.searchParams.append(en,"1"),n.searchParams.append(Qt,t.map(s=>s?"1":"0").join(""));const r=window.fetch,a=await r(n.href,{});if(!a.ok){let s;throw a.headers.get("content-type")?.includes("application/json")?s=await a.json():a.status===404?s="Not Found":a.status===500&&(s="Internal Error"),new pe(a.status,s)}return new Promise(async s=>{const o=new Map,c=a.body.getReader();function i(f){return Jt(f,{...k.decoders,Promise:u=>new Promise((_,p)=>{o.set(u,{fulfil:_,reject:p})})})}let l="";for(;;){const{done:f,value:u}=await c.read();if(f&&!l)break;for(l+=!u&&l?`
|
|
2
|
+
`:St.decode(u,{stream:!0});;){const _=l.indexOf(`
|
|
3
|
+
`);if(_===-1)break;const p=JSON.parse(l.slice(0,_));if(l=l.slice(_+1),p.type==="redirect")return s(p);if(p.type==="data")p.nodes?.forEach(d=>{d?.type==="data"&&(d.uses=wt(d.uses),d.data=i(d.data))}),s(p);else if(p.type==="chunk"){const{id:d,data:h,error:w}=p,g=o.get(d);o.delete(d),w?g.reject(i(w)):g.fulfil(i(h))}}}})}function wt(e){return{dependencies:new Set(e?.dependencies??[]),params:new Set(e?.params??[]),parent:!!e?.parent,route:!!e?.route,url:!!e?.url,search_params:new Set(e?.search_params??[])}}let Ie=!1;function kn(e,t=!0){const n=document.querySelector("[autofocus]");if(n)n.focus();else{const r=yt(e);if(r&&document.getElementById(r)){const{x:s,y:o}=V();setTimeout(()=>{const c=history.state;Ie=!0,location.replace(new URL(`#${r}`,location.href)),history.replaceState(c,"",e),t&&scrollTo(s,o),Ie=!1})}else{const s=document.body,o=s.getAttribute("tabindex");s.tabIndex=-1,s.focus({preventScroll:!0,focusVisible:!1}),o!==null?s.setAttribute("tabindex",o):s.removeAttribute("tabindex")}const a=getSelection();if(a&&a.type!=="None"){const s=[];for(let o=0;o<a.rangeCount;o+=1)s.push(a.getRangeAt(o));setTimeout(()=>{if(a.rangeCount===s.length){for(let o=0;o<a.rangeCount;o+=1){const c=s[o],i=a.getRangeAt(o);if(c.commonAncestorContainer!==i.commonAncestorContainer||c.startContainer!==i.startContainer||c.endContainer!==i.endContainer||c.startOffset!==i.startOffset||c.endOffset!==i.endOffset)return}a.removeAllRanges()}})}}}function Be(e,t,n,r,a=null){let s,o;const c=new Promise((l,f)=>{s=l,o=f});return c.catch(()=>{}),{navigation:{from:{params:e.params,route:{id:e.route?.id??null},url:e.url,scroll:V()},to:n&&{params:t?.params??null,route:{id:t?.route?.id??null},url:n,scroll:a},willUnload:!t,type:r,complete:c},fulfil:s,reject:o}}function Fe(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}}function En(e){const t=new URL(e);return t.hash=decodeURIComponent(e.hash),t}function yt(e){let t;if(k.hash){const[,,n]=e.hash.split("#",3);t=n??""}else t=e.hash.slice(1);return decodeURIComponent(t)}export{Un as a,Ln as g,Sn as l,R as p,x as s};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as e}from"./
|
|
1
|
+
import{s as e}from"./Dfn9ME_a.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};
|
|
Binary file
|
|
Binary file
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../nodes/0.
|
|
2
|
-
import{_}from"../chunks/PPVm8Dsz.js";import{h as V,Q as z,f as G,R as H,S as Q,T as U,l as W,k,U as X,m as J,b,V as K,g as u,W as Z,X as $,Y as tt,p as et,D as rt,F as at,q as st,P as ot,z as R,d as nt,v as it,s as O,c as ct,r as _t,t as ut,w as p}from"../chunks/Ce0VRwE1.js";import{B as mt,k as dt,m as lt,u as ft,p as T,i as A,a as v,j as D,f as j,g as x,t as ht,s as vt}from"../chunks/3MMtouT7.js";function I(s,t,a){var n;V&&(n=J,z());var o=new mt(s);G(()=>{var e=t()??null;if(V){var r=Q(n),c=r===X,P=e!==null;if(c!==P){var g=U();W(g),o.anchor=g,k(!1),o.ensure(e,e&&(f=>a(f,e))),k(!0);return}}o.ensure(e,e&&(f=>a(f,e)))},H)}function gt(s){return class extends Et{constructor(t){super({component:s,...t})}}}class Et{#e;#t;constructor(t){var a=new Map,n=(e,r)=>{var c=tt(r,!1,!1);return a.set(e,c),c};const o=new Proxy({...t.props||{},$$events:{}},{get(e,r){return u(a.get(r)??n(r,Reflect.get(e,r)))},has(e,r){return r===K?!0:(u(a.get(r)??n(r,Reflect.get(e,r))),Reflect.has(e,r))},set(e,r,c){return b(a.get(r)??n(r,c),c),Reflect.set(e,r,c)}});this.#t=(t.hydrate?dt:lt)(t.component,{target:t.target,anchor:t.anchor,props:o,context:t.context,intro:t.intro??!1,recover:t.recover,transformError:t.transformError}),(!t?.props?.$$host||t.sync===!1)&&Z(),this.#e=o.$$events;for(const e of Object.keys(this.#t))e==="$set"||e==="$destroy"||e==="$on"||$(this,e,{get(){return this.#t[e]},set(r){this.#t[e]=r},enumerable:!0});this.#t.$set=e=>{Object.assign(o,e)},this.#t.$destroy=()=>{ft(this.#t)}}$set(t){this.#t.$set(t)}$on(t,a){this.#e[t]=this.#e[t]||[];const n=(...o)=>a.call(this,...o);return this.#e[t].push(n),()=>{this.#e[t]=this.#e[t].filter(o=>o!==n)}}$destroy(){this.#t.$destroy()}}const Dt={};var yt=j('<div id="svelte-announcer" aria-live="assertive" aria-atomic="true" style="position: absolute; left: 0; top: 0; clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap; width: 1px; height: 1px"><!></div>'),Rt=j("<!> <!>",1);function bt(s,t){et(t,!0);let a=T(t,"components",23,()=>[]),n=T(t,"data_0",3,null),o=T(t,"data_1",3,null);rt(()=>t.stores.page.set(t.page)),at(()=>{t.stores,t.page,t.constructors,a(),t.form,n(),o(),t.stores.page.notify()});let e=O(!1),r=O(!1),c=O(null);st(()=>{const i=t.stores.page.subscribe(()=>{u(e)&&(b(r,!0),ot().then(()=>{b(c,document.title||"untitled page",!0)}))});return b(e,!0),i});const P=p(()=>t.constructors[1]);var g=Rt(),f=R(g);{var S=i=>{const m=p(()=>t.constructors[0]);var d=D(),E=R(d);I(E,()=>u(m),(l,h)=>{x(h(l,{get data(){return n()},get form(){return t.form},get params(){return t.page.params},children:(y,Ot)=>{var L=D(),N=R(L);I(N,()=>u(P),(Y,B)=>{x(B(Y,{get data(){return o()},get form(){return t.form},get params(){return t.page.params}}),q=>a()[1]=q,()=>a()?.[1])}),v(y,L)},$$slots:{default:!0}}),y=>a()[0]=y,()=>a()?.[0])}),v(i,d)},C=i=>{const m=p(()=>t.constructors[0]);var d=D(),E=R(d);I(E,()=>u(m),(l,h)=>{x(h(l,{get data(){return n()},get form(){return t.form},get params(){return t.page.params}}),y=>a()[0]=y,()=>a()?.[0])}),v(i,d)};A(f,i=>{t.constructors[1]?i(S):i(C,-1)})}var F=nt(f,2);{var M=i=>{var m=yt(),d=ct(m);{var E=l=>{var h=ht();ut(()=>vt(h,u(c))),v(l,h)};A(d,l=>{u(r)&&l(E)})}_t(m),v(i,m)};A(F,i=>{u(e)&&i(M)})}v(s,g),it()}const xt=gt(bt),It=[()=>_(()=>import("../nodes/0.
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../nodes/0.BgwfOZTV.js","../chunks/3MMtouT7.js","../chunks/Ce0VRwE1.js","../chunks/BTu-2gkj.js","../assets/ColorPicker.Hf6zQzuB.css","../chunks/Dfn9ME_a.js","../chunks/DuaEmHXZ.js","../chunks/Bn-6X1BO.js","../chunks/CG453M9q.js","../chunks/CSjf4fBs.js","../assets/0.BZLcOr5z.css","../nodes/1.DunuP0ec.js","../chunks/DFPEaIHz.js","../assets/1.B_AnTlN1.css","../nodes/2.dWYUfDXP.js","../chunks/DdpA9n1s.js","../chunks/xs1Xl3_e.js","../chunks/gQJcRhou.js","../chunks/BCwT4WOg.js","../chunks/BLszSzTT.js","../chunks/B-XSrufh.js","../chunks/3EfvnCrr.js","../chunks/pRcLbE0d.js","../chunks/CMQw-Fc-.js","../assets/2.DjiwkLqE.css","../nodes/3.rBWJMWFr.js","../assets/3.DHxQoulp.css","../nodes/4.BcK1571T.js","../chunks/DzuS5Nbr.js","../assets/4.D4EDSN4H.css","../nodes/5.BN2SM61w.js","../assets/5.C5qz-NeI.css","../nodes/6.DDMVIiVk.js","../chunks/DaomQix1.js","../assets/6.DzV0p3l-.css","../nodes/7.DijtBcpt.js","../chunks/BsNWiLas.js","../assets/ChatView.Bnlg-oAF.css","../assets/7.CEbRAOOf.css","../nodes/8.Y_8EIs9h.js","../assets/8.BhoBXADL.css","../nodes/9.BoJIHqox.js","../chunks/PPVm8Dsz.js","../assets/9.v5KA95xm.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_}from"../chunks/PPVm8Dsz.js";import{h as V,Q as z,f as G,R as H,S as Q,T as U,l as W,k,U as X,m as J,b,V as K,g as u,W as Z,X as $,Y as tt,p as et,D as rt,F as at,q as st,P as ot,z as R,d as nt,v as it,s as O,c as ct,r as _t,t as ut,w as p}from"../chunks/Ce0VRwE1.js";import{B as mt,k as dt,m as lt,u as ft,p as T,i as A,a as v,j as D,f as j,g as x,t as ht,s as vt}from"../chunks/3MMtouT7.js";function I(s,t,a){var n;V&&(n=J,z());var o=new mt(s);G(()=>{var e=t()??null;if(V){var r=Q(n),c=r===X,P=e!==null;if(c!==P){var g=U();W(g),o.anchor=g,k(!1),o.ensure(e,e&&(f=>a(f,e))),k(!0);return}}o.ensure(e,e&&(f=>a(f,e)))},H)}function gt(s){return class extends Et{constructor(t){super({component:s,...t})}}}class Et{#e;#t;constructor(t){var a=new Map,n=(e,r)=>{var c=tt(r,!1,!1);return a.set(e,c),c};const o=new Proxy({...t.props||{},$$events:{}},{get(e,r){return u(a.get(r)??n(r,Reflect.get(e,r)))},has(e,r){return r===K?!0:(u(a.get(r)??n(r,Reflect.get(e,r))),Reflect.has(e,r))},set(e,r,c){return b(a.get(r)??n(r,c),c),Reflect.set(e,r,c)}});this.#t=(t.hydrate?dt:lt)(t.component,{target:t.target,anchor:t.anchor,props:o,context:t.context,intro:t.intro??!1,recover:t.recover,transformError:t.transformError}),(!t?.props?.$$host||t.sync===!1)&&Z(),this.#e=o.$$events;for(const e of Object.keys(this.#t))e==="$set"||e==="$destroy"||e==="$on"||$(this,e,{get(){return this.#t[e]},set(r){this.#t[e]=r},enumerable:!0});this.#t.$set=e=>{Object.assign(o,e)},this.#t.$destroy=()=>{ft(this.#t)}}$set(t){this.#t.$set(t)}$on(t,a){this.#e[t]=this.#e[t]||[];const n=(...o)=>a.call(this,...o);return this.#e[t].push(n),()=>{this.#e[t]=this.#e[t].filter(o=>o!==n)}}$destroy(){this.#t.$destroy()}}const Dt={};var yt=j('<div id="svelte-announcer" aria-live="assertive" aria-atomic="true" style="position: absolute; left: 0; top: 0; clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap; width: 1px; height: 1px"><!></div>'),Rt=j("<!> <!>",1);function bt(s,t){et(t,!0);let a=T(t,"components",23,()=>[]),n=T(t,"data_0",3,null),o=T(t,"data_1",3,null);rt(()=>t.stores.page.set(t.page)),at(()=>{t.stores,t.page,t.constructors,a(),t.form,n(),o(),t.stores.page.notify()});let e=O(!1),r=O(!1),c=O(null);st(()=>{const i=t.stores.page.subscribe(()=>{u(e)&&(b(r,!0),ot().then(()=>{b(c,document.title||"untitled page",!0)}))});return b(e,!0),i});const P=p(()=>t.constructors[1]);var g=Rt(),f=R(g);{var S=i=>{const m=p(()=>t.constructors[0]);var d=D(),E=R(d);I(E,()=>u(m),(l,h)=>{x(h(l,{get data(){return n()},get form(){return t.form},get params(){return t.page.params},children:(y,Ot)=>{var L=D(),N=R(L);I(N,()=>u(P),(Y,B)=>{x(B(Y,{get data(){return o()},get form(){return t.form},get params(){return t.page.params}}),q=>a()[1]=q,()=>a()?.[1])}),v(y,L)},$$slots:{default:!0}}),y=>a()[0]=y,()=>a()?.[0])}),v(i,d)},C=i=>{const m=p(()=>t.constructors[0]);var d=D(),E=R(d);I(E,()=>u(m),(l,h)=>{x(h(l,{get data(){return n()},get form(){return t.form},get params(){return t.page.params}}),y=>a()[0]=y,()=>a()?.[0])}),v(i,d)};A(f,i=>{t.constructors[1]?i(S):i(C,-1)})}var F=nt(f,2);{var M=i=>{var m=yt(),d=ct(m);{var E=l=>{var h=ht();ut(()=>vt(h,u(c))),v(l,h)};A(d,l=>{u(r)&&l(E)})}_t(m),v(i,m)};A(F,i=>{u(e)&&i(M)})}v(s,g),it()}const xt=gt(bt),It=[()=>_(()=>import("../nodes/0.BgwfOZTV.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10]),import.meta.url),()=>_(()=>import("../nodes/1.DunuP0ec.js"),__vite__mapDeps([11,1,2,12,5,6,3,4,13]),import.meta.url),()=>_(()=>import("../nodes/2.dWYUfDXP.js"),__vite__mapDeps([14,1,2,3,4,12,5,7,15,8,16,17,18,19,20,21,22,23,24]),import.meta.url),()=>_(()=>import("../nodes/3.rBWJMWFr.js"),__vite__mapDeps([25,1,2,12,5,3,4,17,18,19,20,21,22,26]),import.meta.url),()=>_(()=>import("../nodes/4.BcK1571T.js"),__vite__mapDeps([27,1,2,3,4,12,28,17,18,22,29]),import.meta.url),()=>_(()=>import("../nodes/5.BN2SM61w.js"),__vite__mapDeps([30,1,2,3,4,21,17,18,22,31]),import.meta.url),()=>_(()=>import("../nodes/6.DDMVIiVk.js"),__vite__mapDeps([32,1,2,3,4,12,5,33,28,7,15,16,17,18,19,23,34]),import.meta.url),()=>_(()=>import("../nodes/7.DijtBcpt.js"),__vite__mapDeps([35,1,2,12,3,4,33,5,16,18,36,20,37,38]),import.meta.url),()=>_(()=>import("../nodes/8.Y_8EIs9h.js"),__vite__mapDeps([39,1,2,3,4,12,5,15,8,9,16,17,18,23,40]),import.meta.url),()=>_(()=>import("../nodes/9.BoJIHqox.js"),__vite__mapDeps([41,42,1,2,12,3,4,5,6,28,36,18,20,37,23,43]),import.meta.url)],Lt=[0],Vt={"/":[-3],"/activity":[-4],"/config":[-5],"/neurolink":[-6],"/project":[6],"/session/[id]":[7],"/terminals":[8],"/terminals/[id]":[9]},w={handleError:(({error:s})=>{console.error(s)}),reroute:(()=>{}),transport:{}},Pt=Object.fromEntries(Object.entries(w.transport).map(([s,t])=>[s,t.decode])),kt=Object.fromEntries(Object.entries(w.transport).map(([s,t])=>[s,t.encode])),jt=!1,wt=(s,t)=>Pt[s](t);export{wt as decode,Pt as decoders,Vt as dictionary,kt as encoders,jt as hash,w as hooks,Dt as matchers,It as nodes,xt as root,Lt as server_loads};
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{l as o,a as r}from"../chunks/Dfn9ME_a.js";export{o as load_css,r as start};
|
|
Binary file
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as $,c as F,f as K,e as M}from"../chunks/3MMtouT7.js";import{p as U,F as V,q as z,t as G,v as H,b as m,c as a,d as i,g as l,r as s,A as w,s as J,w as _}from"../chunks/Ce0VRwE1.js";import{P as Q,B as X,a as Y,c as h,s as y}from"../chunks/BTu-2gkj.js";import{g as Z}from"../chunks/
|
|
1
|
+
import{a as $,c as F,f as K,e as M}from"../chunks/3MMtouT7.js";import{p as U,F as V,q as z,t as G,v as H,b as m,c as a,d as i,g as l,r as s,A as w,s as J,w as _}from"../chunks/Ce0VRwE1.js";import{P as Q,B as X,a as Y,c as h,s as y}from"../chunks/BTu-2gkj.js";import{g as Z}from"../chunks/Dfn9ME_a.js";import{p as tt}from"../chunks/DuaEmHXZ.js";import{B as et}from"../chunks/Bn-6X1BO.js";import{S as at}from"../chunks/CG453M9q.js";import{T as st}from"../chunks/CSjf4fBs.js";const rt=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
|
|
2
2
|
<rect x="3" y="3" width="7" height="7"/>
|
|
3
3
|
<rect x="14" y="3" width="7" height="7"/>
|
|
4
4
|
<rect x="3" y="14" width="7" height="7"/>
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as b,a as c,c as J,f as K,s as k,e as L,t as d}from"../chunks/3MMtouT7.js";import{B as M,D as N,F as w,G as P,I as y,J as q,g as G,K as z,L as C,M as O,p as Q,t as j,v as R,c as f,d as g,N as U,$ as V,r as v}from"../chunks/Ce0VRwE1.js";import{h as W}from"../chunks/DFPEaIHz.js";import{g as X}from"../chunks/
|
|
1
|
+
import{i as b,a as c,c as J,f as K,s as k,e as L,t as d}from"../chunks/3MMtouT7.js";import{B as M,D as N,F as w,G as P,I as y,J as q,g as G,K as z,L as C,M as O,p as Q,t as j,v as R,c as f,d as g,N as U,$ as V,r as v}from"../chunks/Ce0VRwE1.js";import{h as W}from"../chunks/DFPEaIHz.js";import{g as X}from"../chunks/Dfn9ME_a.js";import{p as Y}from"../chunks/DuaEmHXZ.js";import{B as $}from"../chunks/BTu-2gkj.js";function Z(n=!1){const r=M,s=r.l.u;if(!s)return;let p=()=>z(r.s);if(n){let i=0,a={};const _=C(()=>{let l=!1;const m=r.s;for(const o in m)m[o]!==a[o]&&(a[o]=m[o],l=!0);return l&&i++,i});p=()=>G(_)}s.b.length&&N(()=>{B(r,p),y(s.b)}),w(()=>{const i=P(()=>s.m.map(q));return()=>{for(const a of i)typeof a=="function"&&a()}}),s.a.length&&w(()=>{B(r,p),y(s.a)})}function B(n,r){if(n.l.s)for(const s of n.l.s)G(s);r()}O();var ee=K('<main class="error-page svelte-1j96wlh"><div class="error-content svelte-1j96wlh"><div class="error-code svelte-1j96wlh"> </div> <h1 class="error-title svelte-1j96wlh"><!></h1> <p class="error-message svelte-1j96wlh"><!></p> <div class="error-actions svelte-1j96wlh"><!> <!></div></div></main>');function ie(n,r){Q(r,!1);const s=()=>L(Y,"$page",p),[p,i]=J();Z();var a=ee();W("1j96wlh",e=>{U(()=>{V.title="Error - Shooter"})});var _=f(a),l=f(_),m=f(l,!0);v(l);var o=g(l,2),S=f(o);{var T=e=>{var t=d("Page not found");c(e,t)},A=e=>{var t=d("Something went wrong");c(e,t)};b(S,e=>{s().status===404?e(T):e(A,-1)})}v(o);var u=g(o,2),D=f(u);{var E=e=>{var t=d();j(()=>k(t,s().error.message)),c(e,t)},F=e=>{var t=d("The page you're looking for doesn't exist or has been moved.");c(e,t)},H=e=>{var t=d("An unexpected error occurred. Try refreshing or going back.");c(e,t)};b(D,e=>{s().error?.message?e(E):s().status===404?e(F,1):e(H,-1)})}v(u);var h=g(u,2),x=f(h);$(x,{text:"Go Home",classes:"btn-primary",onclick:()=>{X("/")}});var I=g(x,2);$(I,{text:"Go Back",classes:"btn-secondary",onclick:()=>{history.back()}}),v(h),v(_),v(a),j(()=>k(m,s().status)),c(n,a),R(),i()}export{ie as component};
|
|
Binary file
|
|
Binary file
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{d as vt,i as D,s as C,b as Fe,a as h,f as p}from"../chunks/3MMtouT7.js";import{p as ze,c,r as l,d as v,g as r,t as B,v as je,w as M,z as me,s as q,o as et,b as _,q as ft,x as gt,N as mt,$ as ht,A as Ge}from"../chunks/Ce0VRwE1.js";import{P as tt,k as pt,d as Re,s as _t,g as St,e as de,j as Le,B as Te,c as De,b as yt,i as Ue}from"../chunks/BTu-2gkj.js";import{h as bt}from"../chunks/DFPEaIHz.js";import{g as Ve}from"../chunks/
|
|
1
|
+
import{d as vt,i as D,s as C,b as Fe,a as h,f as p}from"../chunks/3MMtouT7.js";import{p as ze,c,r as l,d as v,g as r,t as B,v as je,w as M,z as me,s as q,o as et,b as _,q as ft,x as gt,N as mt,$ as ht,A as Ge}from"../chunks/Ce0VRwE1.js";import{P as tt,k as pt,d as Re,s as _t,g as St,e as de,j as Le,B as Te,c as De,b as yt,i as Ue}from"../chunks/BTu-2gkj.js";import{h as bt}from"../chunks/DFPEaIHz.js";import{g as Ve}from"../chunks/Dfn9ME_a.js";import{B as wt}from"../chunks/Bn-6X1BO.js";import{R as Ct,S as We}from"../chunks/DdpA9n1s.js";import{S as xt}from"../chunks/CG453M9q.js";import{c as kt,s as At,g as Et}from"../chunks/xs1Xl3_e.js";import{i as Nt}from"../chunks/gQJcRhou.js";import"../chunks/BCwT4WOg.js";import{f as It}from"../chunks/BLszSzTT.js";import{S as Pt}from"../chunks/B-XSrufh.js";import{i as Tt,N as Dt}from"../chunks/3EfvnCrr.js";import{d as Ot}from"../chunks/pRcLbE0d.js";import{E as He}from"../chunks/CMQw-Fc-.js";var Rt=p('<p class="goal-text svelte-1qbe2oo"> </p>'),zt=p('<span class="summarizing svelte-1qbe2oo">Analyzing…</span>'),jt=p('<span class="summary-text svelte-1qbe2oo"> </span>'),Lt=p('<span class="summary-fallback svelte-1qbe2oo"> </span>'),Mt=p('<span class="stat stat-error svelte-1qbe2oo"> </span>'),qt=p('<div class="card svelte-1qbe2oo" role="button" tabindex="0"><div class="card-header svelte-1qbe2oo"><span class="project-name svelte-1qbe2oo"> </span> <!></div> <!> <div class="summary-row svelte-1qbe2oo"><!></div> <div class="stats-row svelte-1qbe2oo"><span class="stat svelte-1qbe2oo"><span></span> </span> <span class="stat svelte-1qbe2oo"> </span> <!> <span class="stat stat-path svelte-1qbe2oo"> </span></div></div>');function Je(t,e){ze(e,!0);function s(d){const u=Math.floor(d/1e3);if(u<60)return`${u}s`;const i=Math.floor(u/60);return i<60?`${i}m ${u%60}s`:`${Math.floor(i/60)}h ${i%60}m`}function n(d){const u=d.replace(/\/$/,"").split("/");return u.length<=2?d:u.slice(-2).join("/")}const a=M(()=>e.card.status==="running"&&e.card.isActive?"var(--ds-green-700)":e.card.status==="running"?"var(--ds-blue-700)":e.card.status==="idle"?"var(--ds-amber-700)":e.card.status==="error"?"var(--ds-red-700)":"var(--ds-gray-600)"),o=M(()=>e.card.status==="running"&&e.card.isActive||e.card.status==="running"?"● Running":e.card.status==="idle"?"◎ Idle":e.card.status==="exited"?"○ Done":e.card.status==="error"?"✕ Error":e.card.status),S=M(()=>e.card.status==="running"&&e.card.isActive?"status-pill status-pill--running-active":e.card.status==="running"?"status-pill status-pill--running":e.card.status==="idle"?"status-pill status-pill--idle":e.card.status==="exited"?"status-pill status-pill--exited":e.card.status==="error"?"status-pill status-pill--error":"status-pill"),y=M(()=>e.card.toolCallCount===0?"Waiting for activity…":e.card.toolCallCount===1?"1 tool call so far":`${e.card.toolCallCount} tool calls so far`);function E(d){(d.key==="Enter"||d.key===" ")&&(d.key===" "&&d.preventDefault(),e.onclick?.())}var b=qt(),g=c(b),f=c(g),x=c(f,!0);l(f);var k=v(f,2);tt(k,{get text(){return r(o)},get classes(){return r(S)}}),l(g);var T=v(g,2);{var Se=d=>{var u=Rt(),i=c(u,!0);l(u),B(()=>C(i,e.card.goal)),h(d,u)};D(T,d=>{e.card.goal&&d(Se)})}var $=v(T,2),ye=c($);{var be=d=>{var u=zt();h(d,u)},ee=d=>{var u=jt(),i=c(u,!0);l(u),B(()=>C(i,e.card.summary)),h(d,u)},te=d=>{var u=Lt(),i=c(u,!0);l(u),B(()=>C(i,r(y))),h(d,u)};D(ye,d=>{e.card.isSummarizing?d(be):e.card.summary?d(ee,1):e.card.status==="running"&&d(te,2)})}l($);var W=v($,2),F=c(W),ae=c(F),we=v(ae);l(F);var se=v(F,2),Ce=c(se);l(se);var re=v(se,2);{var xe=d=>{var u=Mt(),i=c(u);l(u),B(()=>C(i,`${e.card.errorCount??""} errors`)),h(d,u)};D(re,d=>{e.card.errorCount>0&&d(xe)})}var oe=v(re,2),ke=c(oe,!0);l(oe),l(W),l(b),B((d,u)=>{pt(b,`--status-color: ${r(a)??""}`),Re(b,"aria-label",`Open ${e.card.projectName??""} session`),C(x,e.card.projectName),_t(ae,1,St(e.card.status==="running"&&e.card.isActive?"status-dot-active":"status-dot-static"),"svelte-1qbe2oo"),C(we,` ${d??""}`),C(Ce,`${e.card.toolCallCount??""} tools`),Re(oe,"title",e.card.cwd),C(ke,u)},[()=>s(e.card.duration),()=>n(e.card.cwd)]),Fe("click",b,function(...d){e.onclick?.apply(this,d)}),Fe("keydown",b,E),h(t,b),je()}vt(["click","keydown"]);var Bt=p('<div class="section svelte-14sxgtb"><h3 class="section-label svelte-14sxgtb">Active</h3> <!></div>'),Kt=p('<div class="section svelte-14sxgtb"><h3 class="section-label svelte-14sxgtb">Recent</h3> <!></div>'),Yt=p("<!> <!>",1);function Ft(t,e){ze(e,!0);const s=M(()=>e.cards.filter(g=>g.status==="running")),n=M(()=>e.cards.filter(g=>g.status!=="running"));function a(g){e.onCardClick?.(g)}var o=Yt(),S=me(o);{var y=g=>{var f=Bt(),x=v(c(f),2);de(x,17,()=>r(s),k=>k.terminalId,(k,T)=>{Je(k,{get card(){return r(T)},onclick:()=>{a(r(T))}})}),l(f),h(g,f)};D(S,g=>{r(s).length>0&&g(y)})}var E=v(S,2);{var b=g=>{var f=Kt(),x=v(c(f),2);de(x,17,()=>r(n),k=>k.terminalId,(k,T)=>{Je(k,{get card(){return r(T)},onclick:()=>{a(r(T))}})}),l(f),h(g,f)};D(E,g=>{r(n).length>0&&g(b)})}h(t,o),je()}const Gt=new Set(["agent-question","terminal-exited","tool-failed"]);let fe=null,ge=null,he=null;class Ut{async summarize(e){const s=this.chooseTone(e),n=s==="conversational"?this.buildConversationalPrompt(e):this.buildStatusReportPrompt(e);try{const a=await Vt();if(!a)return console.log("[SessionSummarizer] NeuroLink not available, using fallback."),{generatedAt:new Date().toISOString(),text:this.fallbackText(e),tone:s};const o=await a.generate({input:{text:n},...he?{model:he.model,provider:he.provider}:{}}),S=Ht(o.content??"").trim()||this.fallbackText(e);return{generatedAt:new Date().toISOString(),text:S,tone:s}}catch(a){return console.warn("[SessionSummarizer] summarize failed:",a instanceof Error?a.message:String(a)),{generatedAt:new Date().toISOString(),text:this.fallbackText(e),tone:s}}}buildConversationalPrompt(e){const s=e.goal??"unknown",n=e.recentEvents.map(a=>{const o=[a.type];return a.tool&&o.push(`tool=${a.tool}`),a.error&&o.push(`error=${a.error}`),a.command&&o.push(`command=${a.command}`),o.join(" ")}).join(", ");return`You are monitoring a coding session. Based on the context below, write ONE sentence (max 100 chars) describing what's happening in plain English. Be specific about what Claude did or is doing.
|
|
2
2
|
|
|
3
3
|
Goal: ${s}
|
|
4
4
|
Recent events: ${n}
|
|
@@ -10,4 +10,4 @@ One sentence only, no quotes, no markdown.`}buildStatusReportPrompt(e){return`Yo
|
|
|
10
10
|
Recent tool calls: ${e.recentEvents.flatMap(n=>n.tool?[n.tool]:[]).join(", ")||"none"}
|
|
11
11
|
Status: ${e.status}
|
|
12
12
|
|
|
13
|
-
Short phrase only, no quotes.`}chooseTone(e){return e.status==="error"||e.errorCount>0||e.recentEvents.some(n=>Gt.has(n.type))?"conversational":"status-report"}fallbackText(e){const s=e.recentEvents.flatMap(a=>a.tool?[a.tool]:[]),n=[...new Set(s)];return n.length>0?`Running: ${n.join(", ")} (${e.toolCallCount} tools)`:`Status: ${e.status} — ${e.toolCallCount} tool calls`}}async function Vt(){if(ge)return ge;Tt();const e=(await Wt()).NeuroLink;if(!e)return null;const s=window.__aiProviders,n=window.process?.env?.NEUROLINK_PROVIDER,a=Dt(s,n);if(!a)return console.warn("[SessionSummarizer] No AI provider configured"),null;const o=window.process;return o?.env&&s&&(s["google-ai"]&&!o.env.GOOGLE_AI_API_KEY&&(o.env.GOOGLE_AI_API_KEY="proxy-via-server"),s.anthropic&&!o.env.ANTHROPIC_API_KEY&&(o.env.ANTHROPIC_API_KEY="proxy-via-server"),s.openai&&!o.env.OPENAI_API_KEY&&(o.env.OPENAI_API_KEY="proxy-via-server"),s.mistral&&!o.env.MISTRAL_API_KEY&&(o.env.MISTRAL_API_KEY="proxy-via-server")),ge=new e({provider:a.provider}),he=a,console.log(`[SessionSummarizer] Using provider: ${a.provider}/${a.model}`),ge}function Wt(){return fe||(fe=import(Ft).catch(t=>{throw console.warn("[SessionSummarizer] Failed to load NeuroLink SDK:",t),fe=null,t})),fe}function Ht(t){return typeof t=="string"?t:typeof t=="number"||typeof t=="boolean"?String(t):""}function Me(){return new Date(Date.now()).toISOString()}const Jt=100,Xt=15e3,Zt=3e4,at=2e3,Qt=3e4;let j=q(et([])),ce=q(!1),R=null,Z=null,Q=null,pe=at,$t=0,K="";const ve=new Le,Y=new Le,_e=new Pt;async function ea(t){K=t||ra(),K&&(await Qe(K),await rt(K),Z&&clearInterval(Z),Z=setInterval(()=>{Qe(K)},Xt))}function ta(){R&&(R.onclose=null,R.close(),R=null),Z&&(clearInterval(Z),Z=null),Q&&(clearTimeout(Q),Q=null);for(const[,t]of Y)t.onclose=null,t.close();Y.clear(),_e.clear(),ve.clear(),_(ce,!1),K=""}function aa(){const t=Date.now();return qe(r(j)).map(e=>{const s=Date.parse(e.createdAt),n=e.events.length>0?Date.parse(e.events[e.events.length-1].timestamp):0;return{...e,duration:t-s,goal:e.goal,isActive:n>0&&t-n<Zt,isSummarizing:e.isSummarizing,summary:e.summary}})}function Xe(t,e){const s=r(j).find(n=>n.terminalId===t);s&&(s.goal=e)}function sa(t,e){const s=r(j).find(n=>n.terminalId===t);s&&(s.summary=e,s.summaryUpdatedAt=Me(),s.isSummarizing=!1)}function X(t,e,s){const n={data:s,id:`evt-${++$t}`,summarized:!1,terminalId:t.terminalId,timestamp:s.timestamp??Me(),type:e},a=t.events.length>=Jt?[...t.events.slice(1),n]:[...t.events,n];t.events=a,t.eventCount+=1}function st(t){return t.split("/").filter(Boolean).pop()??t}function ue(t){const e=Y.get(t);e&&(e.onclose=null,e.close(),Y.delete(t))}async function rt(t){if(!(R&&R.readyState<=1))try{const e=await fetch("/api/ws-ticket",{headers:{Authorization:`Bearer ${t}`},method:"POST"});if(!e.ok){Oe(t);return}const{ticket:s}=await e.json(),n=window.location.origin.replace(/^http/,"ws");R=new WebSocket(`${n}/ws/events?ticket=${s}`),R.onopen=()=>{_(ce,!0),pe=at},R.onmessage=a=>{try{const o=JSON.parse(a.data);o&&typeof o=="object"&&oa(o)}catch{}},R.onclose=()=>{_(ce,!1),R=null,Oe(t)},R.onerror=()=>{_(ce,!1)}}catch{_(ce,!1),Oe(t)}}function Ze(t){let e="";return typeof t=="string"?e=t:Array.isArray(t)&&(e=t.find(n=>n.type==="text")?.content??""),e.slice(0,200).trim()}async function Qe(t){if(t)try{const e=await fetch("/api/terminals",{headers:{Authorization:`Bearer ${t}`}});if(!e.ok)return;const n=(await e.json()).terminals??[];_(j,qe(ia(r(j),n)),!0)}catch{}}function ra(){try{const t=localStorage.getItem("shooter_config");if(!t)return"";const e=JSON.parse(t);if(e&&typeof e=="object"){const s=e;if(typeof s.apiKey=="string")return s.apiKey}}catch{}return""}function oa(t){const e=t.type;if(!e||e==="welcome")return;const s=t.terminalId??null;if(!s)return;const n=r(j).findIndex(S=>S.terminalId===s);if(n===-1)return;const a=r(j)[n];switch(e){case"agent-idle":case"agent-question":{a.status="idle",X(a,e,t);break}case"terminal-exited":{a.status="exited",a.exitedAt=t.exitedAt??Me(),X(a,e,t),ue(s),ve.delete(s);break}case"tool-completed":{X(a,e,t);break}case"tool-failed":{a.errorCount+=1,X(a,e,t);break}case"tool-started":{a.toolCallCount+=1,a.status="running",X(a,e,t);break}default:{X(a,e,t);break}}(e==="tool-failed"||e==="agent-question"||a.errorCount>=3||a.eventCount>0&&a.eventCount%20===0)&&!a.isSummarizing&&la(a),_(j,qe(r(j)),!0)}function na(t){return{command:t.command,createdAt:t.createdAt,cwd:t.cwd,errorCount:0,eventCount:0,events:[],exitedAt:t.exitedAt,goal:"",isSummarizing:!1,projectName:st(t.cwd),projectPath:t.cwd,status:ot(t.status),summary:"",summaryUpdatedAt:"",terminalId:t.id,toolCallCount:0}}function ot(t){return t==="running"?"running":t==="idle"?"idle":t==="exited"?"exited":"error"}function ia(t,e){const s=new Set(e.map(a=>a.id));for(const a of t)s.has(a.terminalId)||(ue(a.terminalId),ve.delete(a.terminalId));const n=new Le;for(const a of t)s.has(a.terminalId)&&n.set(a.terminalId,a);for(const a of e){const o=n.get(a.id);o?(o.command=a.command,o.cwd=a.cwd,o.projectName=st(a.cwd),o.projectPath=a.cwd,o.exitedAt=a.exitedAt,o.status!=="error"&&(o.status=ot(a.status)),o.goal||$e(a.id)):(n.set(a.id,na(a)),$e(a.id))}return Array.from(n.values())}async function $e(t){if(K&&!(Y.has(t)||_e.has(t))){_e.add(t),console.log(`[DashboardStore] Opening session socket for ${t}`);try{const e=await fetch("/api/ws-ticket",{headers:{Authorization:`Bearer ${K}`},method:"POST"});if(!e.ok){console.warn(`[DashboardStore] Failed to get WS ticket for ${t}:`,e.status);return}const{ticket:s}=await e.json(),a=`${window.location.origin.replace(/^http/,"ws")}/ws/session/${t}?ticket=${s}`;console.log(`[DashboardStore] Connecting session socket for ${t}`);const o=new WebSocket(a);Y.set(t,o),o.onopen=()=>{console.log(`[DashboardStore] Session socket opened for ${t}`)},o.onmessage=S=>{try{const y=JSON.parse(S.data);if(!y||typeof y!="object")return;const E=y,b=r(j).find(f=>f.terminalId===t),g=b?.goal&&b.goal.length>0;if(E.type==="history"){console.log(`[DashboardStore] Received history for ${t}, extracting goal...`);const f=E.messages;if(!Array.isArray(f)){console.warn(`[DashboardStore] No messages array in history for ${t}`);return}console.log(`[DashboardStore] Found ${f.length} messages, looking for first user message...`);for(const k of f)if(k.role==="user"){const x=Ze(k.content);console.log(`[DashboardStore] Extracted goal for ${t}: "${x.substring(0,50)}..."`),x&&Xe(t,x),ue(t);return}console.log(`[DashboardStore] No user message found in history for ${t}`);return}if(E.type==="message"&&E.role==="user"&&!g){const f=Ze(E.content);f&&(console.log(`[DashboardStore] Extracted goal from message for ${t}: "${f.substring(0,50)}..."`),Xe(t,f),ue(t));return}if(!g)return;ue(t)}catch(y){console.warn("[DashboardStore] Error processing session message:",y)}},o.onclose=()=>{console.log(`[DashboardStore] Session socket closed for ${t}`),Y.delete(t)},o.onerror=S=>{console.warn(`[DashboardStore] Session socket error for ${t}:`,S),Y.delete(t)}}catch(e){console.warn("[DashboardStore] Failed to open session socket:",e)}finally{_e.delete(t)}}}function Oe(t){Q||(Q=setTimeout(()=>{Q=null,rt(t)},pe),pe=Math.min(pe*2,Qt))}function qe(t){return[...t].sort((e,s)=>{const n={error:2,exited:3,idle:1,running:0},a=n[e.status],o=n[s.status];if(a!==o)return a-o;if(e.status!=="exited"&&s.status!=="exited")return s.createdAt.localeCompare(e.createdAt);const S=e.exitedAt??e.createdAt;return(s.exitedAt??s.createdAt).localeCompare(S)})}function la(t){t.isSummarizing=!0;let e=ve.get(t.terminalId);e||(e=new Ut,ve.set(t.terminalId,e));const s=t.events.slice(-10).map(a=>({command:typeof a.data.command=="string"?a.data.command:null,error:typeof a.data.error=="string"?a.data.error:null,tool:typeof a.data.tool=="string"?a.data.tool:null,type:a.type})),n={conversationExcerpt:t.goal??"",errorCount:t.errorCount,goal:t.goal,recentEvents:s,status:t.status,toolCallCount:t.toolCallCount};(async()=>{try{const a=await e.summarize(n);sa(t.terminalId,a.text)}catch(a){console.error(`[dashboard] Summarization failed for ${t.terminalId}:`,a)}finally{t.isSummarizing=!1}})()}var ca=p('<meta name="description" content="Active terminals and Claude Code sessions"/>'),da=p("<!> Refresh",1),ua=p('<div class="stat-chip stat-chip-active svelte-1uha8ag"><span class="stat-value svelte-1uha8ag"> </span> <span class="stat-label svelte-1uha8ag">active</span></div>'),va=p('<div class="stats-bar svelte-1uha8ag"><div class="stat-chip svelte-1uha8ag"><span class="stat-value svelte-1uha8ag"> </span> <span class="stat-label svelte-1uha8ag"> </span></div> <div class="stat-chip svelte-1uha8ag"><span class="stat-value svelte-1uha8ag"> </span> <span class="stat-label svelte-1uha8ag"> </span></div> <!></div>'),fa=p('<div class="loading-container"></div>'),ga=p('<div class="dashboard-section svelte-1uha8ag"><!></div>'),ma=p('<div class="loading-container"></div>'),ha=p('<h3 class="section-label svelte-1uha8ag">Sessions</h3>'),pa=p('<a class="session-card"><div class="session-card-header"><div><h3 class="session-card-title"> </h3> <div class="session-card-subtitle"> </div></div> <!></div> <div class="session-stats"><span><strong> </strong> </span></div></a>'),_a=p('<div style="text-align: center; padding: 1rem;"><!></div>'),Sa=p('<!> <div class="projects-container svelte-1uha8ag"></div> <!>',1),ya=p("<!> <!>",1),ba=p('<main class="main"><div class="page-header"><div class="page-header-content"><div><h1 class="page-title">Dashboard</h1> <p class="page-description">Active terminals and Claude Code sessions</p></div> <div class="page-actions"><!></div></div> <!></div> <!> <!></main>');function Ma(t,e){ze(e,!0);const s=1e4,n=20;let a=q(et([])),o=q(!1),S=!1,y=q(null),E=null,b=q(null),g=q(!1),f=q(0);const k=M(aa);ft(()=>{x();const i=Et("shooter_projects");i&&(_(a,i,!0),_(o,!1)),T(),E=setInterval(()=>{r(y)?.apiKey&&r(f)<=n&&T()},s)}),gt(()=>{E&&(clearInterval(E),E=null),ta()});function x(){try{const i=localStorage.getItem("shooter_config");if(i){const m=JSON.parse(i);Nt(m)?(_(y,m,!0),ea(r(y).apiKey)):(localStorage.removeItem("shooter_config"),_(y,null))}}catch{}}async function T(i=!1,m=!1){if(!r(y)?.apiKey||S)return;S=!0,r(a).length===0&&_(o,!0);const w=i?r(f):0;try{const G=await fetch(`${m?"/api/sessions?refresh=true&":"/api/sessions?"}limit=${n}&offset=${w}`,{headers:{Authorization:`Bearer ${r(y).apiKey}`}});if(!G.ok){_(b,`Failed to load projects (HTTP ${G.status})`);return}_(b,null);const L=await G.json();i?_(a,[...r(a),...L.projects],!0):_(a,L.projects,!0),_(f,r(a).length,!0),_(g,L.total!==void 0?r(a).length<L.total:!1,!0),At("shooter_projects",r(a))}catch(O){_(b,"Failed to load projects"),console.error("Failed to fetch sessions:",O)}finally{_(o,!1),S=!1}}async function Se(){await T(!0)}async function $(){_(o,!0),xt("shooter_projects"),await T(!1,!0)}function ye(){Ve("/config")}function be(i){Ve(`/terminals/${i}`)}function ee(){return r(a).reduce((i,m)=>i+m.sessionCount,0)}var te=ba();bt("1uha8ag",i=>{var m=ca();mt(()=>{ht.title="Dashboard - Shooter"}),h(i,m)});var W=c(te),F=c(W),ae=v(c(F),2),we=c(ae);Te(we,{classes:"btn-secondary",onclick:$,get disabled(){return r(o)},children:(i,m)=>{var w=da(),O=me(w);De(O,{get svg(){return Ct},classes:"icon-14"}),Ge(),h(i,w)},$$slots:{default:!0}}),l(ae),l(F);var se=v(F,2);{var Ce=i=>{var m=va(),w=c(m),O=c(w),G=c(O,!0);l(O);var L=v(O,2),Ae=c(L,!0);l(L),l(w);var ne=v(w,2),ie=c(ne),A=c(ie,!0);l(ie);var N=v(ie,2),z=c(N,!0);l(N),l(ne);var H=v(ne,2);{var le=U=>{var V=ua(),I=c(V),P=c(I,!0);l(I),Ge(2),l(V),B(()=>C(P,r(k).length)),h(U,V)};D(H,U=>{r(k).length>0&&U(le)})}l(m),B((U,V)=>{C(G,r(a).length),C(Ae,r(a).length===1?"project":"projects"),C(A,U),C(z,V)},[()=>ee(),()=>ee()===1?"session":"sessions"]),h(i,m)};D(se,i=>{r(a).length>0&&i(Ce)})}l(W);var re=v(W,2);{var ke=i=>{yt(i,{get text(){return r(b)},classes:"banner-error"})};D(re,i=>{r(b)&&i(ke)})}var oe=v(re,2);{var xe=i=>{var m=fa();de(m,20,()=>Array(3),Ue,(w,O)=>{We(w,{classes:"shimmer-card"})}),l(m),h(i,m)},d=i=>{He(i,{title:"Configuration Required",description:"Set up your API credentials to start tracking sessions",icon:w=>{De(w,{get svg(){return kt},classes:"icon-24"})},children:(w,O)=>{Te(w,{classes:"btn-primary",onclick:ye,text:"Configure Settings"})}})},u=i=>{var m=ya(),w=me(m);{var O=A=>{var N=ga(),z=c(N);Yt(z,{get cards(){return r(k)},onCardClick:H=>{be(H.terminalId)}}),l(N),h(A,N)};D(w,A=>{r(k).length>0&&A(O)})}var G=v(w,2);{var L=A=>{var N=ma();de(N,20,()=>Array(3),Ue,(z,H)=>{We(z,{classes:"shimmer-card"})}),l(N),h(A,N)},Ae=A=>{He(A,{title:"No sessions yet",description:"Claude Code sessions will appear here once JSONL files are found",icon:z=>{De(z,{get svg(){return wt},classes:"icon-24"})}})},ne=M(()=>ee()===0&&r(k).length===0),ie=A=>{var N=Sa(),z=me(N);{var H=I=>{var P=ha();h(I,P)};D(z,I=>{r(k).length>0&&I(H)})}var le=v(z,2);de(le,21,()=>r(a),I=>I.id,(I,P)=>{var J=pa(),Ee=c(J),Ne=c(Ee),Ie=c(Ne),nt=c(Ie,!0);l(Ie);var Be=v(Ie,2),it=c(Be,!0);l(Be),l(Ne);var lt=v(Ne,2);{let ut=M(()=>It(r(P).lastModified));tt(lt,{get text(){return`Last updated ${r(ut)??""}`},classes:"pill-session-time"})}l(Ee);var Ke=v(Ee,2),Ye=c(Ke),Pe=c(Ye),ct=c(Pe,!0);l(Pe);var dt=v(Pe);l(Ye),l(Ke),l(J),B(()=>{Re(J,"href",`/project?id=${r(P).id??""}`),C(nt,r(P).name),C(it,r(P).fullPath),C(ct,r(P).sessionCount),C(dt,` ${r(P).sessionCount===1?"session":"sessions"}`)}),h(I,J)}),l(le);var U=v(le,2);{var V=I=>{var P=_a(),J=c(P);Te(J,{classes:"btn-secondary",onclick:Se,text:"Load More"}),l(P),h(I,P)};D(U,I=>{r(g)&&I(V)})}h(A,N)};D(G,A=>{r(o)&&r(a).length===0?A(L):r(ne)?A(Ae,1):r(a).length>0&&A(ie,2)})}h(i,m)};D(oe,i=>{r(o)&&r(a).length===0&&r(k).length===0?i(xe):r(y)?.apiKey?i(u,-1):i(d,1)})}l(te),h(t,te),je()}export{Ma as component};
|
|
13
|
+
Short phrase only, no quotes.`}chooseTone(e){return e.status==="error"||e.errorCount>0||e.recentEvents.some(n=>Gt.has(n.type))?"conversational":"status-report"}fallbackText(e){const s=e.recentEvents.flatMap(a=>a.tool?[a.tool]:[]),n=[...new Set(s)];return n.length>0?`Running: ${n.join(", ")} (${e.toolCallCount} tools)`:`Status: ${e.status} — ${e.toolCallCount} tool calls`}}async function Vt(){if(ge)return ge;Tt();const e=(await Wt()).NeuroLink;if(!e)return null;const s=window.__aiProviders,n=window.process?.env?.NEUROLINK_PROVIDER,a=Ot(s,n);if(!a)return console.warn("[SessionSummarizer] No AI provider configured"),null;const o=window.process;return o?.env&&s&&(s["google-ai"]&&!o.env.GOOGLE_AI_API_KEY&&(o.env.GOOGLE_AI_API_KEY="proxy-via-server"),s.anthropic&&!o.env.ANTHROPIC_API_KEY&&(o.env.ANTHROPIC_API_KEY="proxy-via-server"),s.openai&&!o.env.OPENAI_API_KEY&&(o.env.OPENAI_API_KEY="proxy-via-server"),s.mistral&&!o.env.MISTRAL_API_KEY&&(o.env.MISTRAL_API_KEY="proxy-via-server")),ge=new e({provider:a.provider}),he=a,console.log(`[SessionSummarizer] Using provider: ${a.provider}/${a.model}`),ge}function Wt(){return fe||(fe=import(Dt).catch(t=>{throw console.warn("[SessionSummarizer] Failed to load NeuroLink SDK:",t),fe=null,t})),fe}function Ht(t){return typeof t=="string"?t:typeof t=="number"||typeof t=="boolean"?String(t):""}function Me(){return new Date(Date.now()).toISOString()}const Jt=100,Xt=15e3,Zt=3e4,at=2e3,Qt=3e4;let j=q(et([])),ce=q(!1),R=null,Z=null,Q=null,pe=at,$t=0,K="";const ve=new Le,Y=new Le,_e=new Pt;async function ea(t){K=t||ra(),K&&(await Qe(K),await rt(K),Z&&clearInterval(Z),Z=setInterval(()=>{Qe(K)},Xt))}function ta(){R&&(R.onclose=null,R.close(),R=null),Z&&(clearInterval(Z),Z=null),Q&&(clearTimeout(Q),Q=null);for(const[,t]of Y)t.onclose=null,t.close();Y.clear(),_e.clear(),ve.clear(),_(ce,!1),K=""}function aa(){const t=Date.now();return qe(r(j)).map(e=>{const s=Date.parse(e.createdAt),n=e.events.length>0?Date.parse(e.events[e.events.length-1].timestamp):0;return{...e,duration:t-s,goal:e.goal,isActive:n>0&&t-n<Zt,isSummarizing:e.isSummarizing,summary:e.summary}})}function Xe(t,e){const s=r(j).find(n=>n.terminalId===t);s&&(s.goal=e)}function sa(t,e){const s=r(j).find(n=>n.terminalId===t);s&&(s.summary=e,s.summaryUpdatedAt=Me(),s.isSummarizing=!1)}function X(t,e,s){const n={data:s,id:`evt-${++$t}`,summarized:!1,terminalId:t.terminalId,timestamp:s.timestamp??Me(),type:e},a=t.events.length>=Jt?[...t.events.slice(1),n]:[...t.events,n];t.events=a,t.eventCount+=1}function st(t){return t.split("/").filter(Boolean).pop()??t}function ue(t){const e=Y.get(t);e&&(e.onclose=null,e.close(),Y.delete(t))}async function rt(t){if(!(R&&R.readyState<=1))try{const e=await fetch("/api/ws-ticket",{headers:{Authorization:`Bearer ${t}`},method:"POST"});if(!e.ok){Oe(t);return}const{ticket:s}=await e.json(),n=window.location.origin.replace(/^http/,"ws");R=new WebSocket(`${n}/ws/events?ticket=${s}`),R.onopen=()=>{_(ce,!0),pe=at},R.onmessage=a=>{try{const o=JSON.parse(a.data);o&&typeof o=="object"&&oa(o)}catch{}},R.onclose=()=>{_(ce,!1),R=null,Oe(t)},R.onerror=()=>{_(ce,!1)}}catch{_(ce,!1),Oe(t)}}function Ze(t){let e="";return typeof t=="string"?e=t:Array.isArray(t)&&(e=t.find(n=>n.type==="text")?.content??""),e.slice(0,200).trim()}async function Qe(t){if(t)try{const e=await fetch("/api/terminals",{headers:{Authorization:`Bearer ${t}`}});if(!e.ok)return;const n=(await e.json()).terminals??[];_(j,qe(ia(r(j),n)),!0)}catch{}}function ra(){try{const t=localStorage.getItem("shooter_config");if(!t)return"";const e=JSON.parse(t);if(e&&typeof e=="object"){const s=e;if(typeof s.apiKey=="string")return s.apiKey}}catch{}return""}function oa(t){const e=t.type;if(!e||e==="welcome")return;const s=t.terminalId??null;if(!s)return;const n=r(j).findIndex(S=>S.terminalId===s);if(n===-1)return;const a=r(j)[n];switch(e){case"agent-idle":case"agent-question":{a.status="idle",X(a,e,t);break}case"terminal-exited":{a.status="exited",a.exitedAt=t.exitedAt??Me(),X(a,e,t),ue(s),ve.delete(s);break}case"tool-completed":{X(a,e,t);break}case"tool-failed":{a.errorCount+=1,X(a,e,t);break}case"tool-started":{a.toolCallCount+=1,a.status="running",X(a,e,t);break}default:{X(a,e,t);break}}(e==="tool-failed"||e==="agent-question"||a.errorCount>=3||a.eventCount>0&&a.eventCount%20===0)&&!a.isSummarizing&&la(a),_(j,qe(r(j)),!0)}function na(t){return{command:t.command,createdAt:t.createdAt,cwd:t.cwd,errorCount:0,eventCount:0,events:[],exitedAt:t.exitedAt,goal:"",isSummarizing:!1,projectName:st(t.cwd),projectPath:t.cwd,status:ot(t.status),summary:"",summaryUpdatedAt:"",terminalId:t.id,toolCallCount:0}}function ot(t){return t==="running"?"running":t==="idle"?"idle":t==="exited"?"exited":"error"}function ia(t,e){const s=new Set(e.map(a=>a.id));for(const a of t)s.has(a.terminalId)||(ue(a.terminalId),ve.delete(a.terminalId));const n=new Le;for(const a of t)s.has(a.terminalId)&&n.set(a.terminalId,a);for(const a of e){const o=n.get(a.id);o?(o.command=a.command,o.cwd=a.cwd,o.projectName=st(a.cwd),o.projectPath=a.cwd,o.exitedAt=a.exitedAt,o.status!=="error"&&(o.status=ot(a.status)),o.goal||$e(a.id)):(n.set(a.id,na(a)),$e(a.id))}return Array.from(n.values())}async function $e(t){if(K&&!(Y.has(t)||_e.has(t))){_e.add(t),console.log(`[DashboardStore] Opening session socket for ${t}`);try{const e=await fetch("/api/ws-ticket",{headers:{Authorization:`Bearer ${K}`},method:"POST"});if(!e.ok){console.warn(`[DashboardStore] Failed to get WS ticket for ${t}:`,e.status);return}const{ticket:s}=await e.json(),a=`${window.location.origin.replace(/^http/,"ws")}/ws/session/${t}?ticket=${s}`;console.log(`[DashboardStore] Connecting session socket for ${t}`);const o=new WebSocket(a);Y.set(t,o),o.onopen=()=>{console.log(`[DashboardStore] Session socket opened for ${t}`)},o.onmessage=S=>{try{const y=JSON.parse(S.data);if(!y||typeof y!="object")return;const E=y,b=r(j).find(f=>f.terminalId===t),g=b?.goal&&b.goal.length>0;if(E.type==="history"){console.log(`[DashboardStore] Received history for ${t}, extracting goal...`);const f=E.messages;if(!Array.isArray(f)){console.warn(`[DashboardStore] No messages array in history for ${t}`);return}console.log(`[DashboardStore] Found ${f.length} messages, looking for first user message...`);for(const x of f)if(x.role==="user"){const k=Ze(x.content);console.log(`[DashboardStore] Extracted goal for ${t}: "${k.substring(0,50)}..."`),k&&Xe(t,k),ue(t);return}console.log(`[DashboardStore] No user message found in history for ${t}`);return}if(E.type==="message"&&E.role==="user"&&!g){const f=Ze(E.content);f&&(console.log(`[DashboardStore] Extracted goal from message for ${t}: "${f.substring(0,50)}..."`),Xe(t,f),ue(t));return}if(!g)return;ue(t)}catch(y){console.warn("[DashboardStore] Error processing session message:",y)}},o.onclose=()=>{console.log(`[DashboardStore] Session socket closed for ${t}`),Y.delete(t)},o.onerror=S=>{console.warn(`[DashboardStore] Session socket error for ${t}:`,S),Y.delete(t)}}catch(e){console.warn("[DashboardStore] Failed to open session socket:",e)}finally{_e.delete(t)}}}function Oe(t){Q||(Q=setTimeout(()=>{Q=null,rt(t)},pe),pe=Math.min(pe*2,Qt))}function qe(t){return[...t].sort((e,s)=>{const n={error:2,exited:3,idle:1,running:0},a=n[e.status],o=n[s.status];if(a!==o)return a-o;if(e.status!=="exited"&&s.status!=="exited")return s.createdAt.localeCompare(e.createdAt);const S=e.exitedAt??e.createdAt;return(s.exitedAt??s.createdAt).localeCompare(S)})}function la(t){t.isSummarizing=!0;let e=ve.get(t.terminalId);e||(e=new Ut,ve.set(t.terminalId,e));const s=t.events.slice(-10).map(a=>({command:typeof a.data.command=="string"?a.data.command:null,error:typeof a.data.error=="string"?a.data.error:null,tool:typeof a.data.tool=="string"?a.data.tool:null,type:a.type})),n={conversationExcerpt:t.goal??"",errorCount:t.errorCount,goal:t.goal,recentEvents:s,status:t.status,toolCallCount:t.toolCallCount};(async()=>{try{const a=await e.summarize(n);sa(t.terminalId,a.text)}catch(a){console.error(`[dashboard] Summarization failed for ${t.terminalId}:`,a)}finally{t.isSummarizing=!1}})()}var ca=p('<meta name="description" content="Active terminals and Claude Code sessions"/>'),da=p("<!> Refresh",1),ua=p('<div class="stat-chip stat-chip-active svelte-1uha8ag"><span class="stat-value svelte-1uha8ag"> </span> <span class="stat-label svelte-1uha8ag">active</span></div>'),va=p('<div class="stats-bar svelte-1uha8ag"><div class="stat-chip svelte-1uha8ag"><span class="stat-value svelte-1uha8ag"> </span> <span class="stat-label svelte-1uha8ag"> </span></div> <div class="stat-chip svelte-1uha8ag"><span class="stat-value svelte-1uha8ag"> </span> <span class="stat-label svelte-1uha8ag"> </span></div> <!></div>'),fa=p('<div class="loading-container"></div>'),ga=p('<div class="dashboard-section svelte-1uha8ag"><!></div>'),ma=p('<div class="loading-container"></div>'),ha=p('<h3 class="section-label svelte-1uha8ag">Sessions</h3>'),pa=p('<a class="session-card"><div class="session-card-header"><div><h3 class="session-card-title"> </h3> <div class="session-card-subtitle"> </div></div> <!></div> <div class="session-stats"><span><strong> </strong> </span></div></a>'),_a=p('<div style="text-align: center; padding: 1rem;"><!></div>'),Sa=p('<!> <div class="projects-container svelte-1uha8ag"></div> <!>',1),ya=p("<!> <!>",1),ba=p('<main class="main"><div class="page-header"><div class="page-header-content"><div><h1 class="page-title">Dashboard</h1> <p class="page-description">Active terminals and Claude Code sessions</p></div> <div class="page-actions"><!></div></div> <!></div> <!> <!></main>');function Ma(t,e){ze(e,!0);const s=1e4,n=20;let a=q(et([])),o=q(!1),S=!1,y=q(null),E=null,b=q(null),g=q(!1),f=q(0);const x=M(aa);ft(()=>{k();const i=Et("shooter_projects");i&&(_(a,i,!0),_(o,!1)),T(),E=setInterval(()=>{r(y)?.apiKey&&r(f)<=n&&T()},s)}),gt(()=>{E&&(clearInterval(E),E=null),ta()});function k(){try{const i=localStorage.getItem("shooter_config");if(i){const m=JSON.parse(i);Nt(m)?(_(y,m,!0),ea(r(y).apiKey)):(localStorage.removeItem("shooter_config"),_(y,null))}}catch{}}async function T(i=!1,m=!1){if(!r(y)?.apiKey||S)return;S=!0,r(a).length===0&&_(o,!0);const w=i?r(f):0;try{const G=await fetch(`${m?"/api/sessions?refresh=true&":"/api/sessions?"}limit=${n}&offset=${w}`,{headers:{Authorization:`Bearer ${r(y).apiKey}`}});if(!G.ok){_(b,`Failed to load projects (HTTP ${G.status})`);return}_(b,null);const L=await G.json();i?_(a,[...r(a),...L.projects],!0):_(a,L.projects,!0),_(f,r(a).length,!0),_(g,L.total!==void 0?r(a).length<L.total:!1,!0),At("shooter_projects",r(a))}catch(O){_(b,"Failed to load projects"),console.error("Failed to fetch sessions:",O)}finally{_(o,!1),S=!1}}async function Se(){await T(!0)}async function $(){_(o,!0),kt("shooter_projects"),await T(!1,!0)}function ye(){Ve("/config")}function be(i){Ve(`/terminals/${i}`)}function ee(){return r(a).reduce((i,m)=>i+m.sessionCount,0)}var te=ba();bt("1uha8ag",i=>{var m=ca();mt(()=>{ht.title="Dashboard - Shooter"}),h(i,m)});var W=c(te),F=c(W),ae=v(c(F),2),we=c(ae);Te(we,{classes:"btn-secondary",onclick:$,get disabled(){return r(o)},children:(i,m)=>{var w=da(),O=me(w);De(O,{get svg(){return Ct},classes:"icon-14"}),Ge(),h(i,w)},$$slots:{default:!0}}),l(ae),l(F);var se=v(F,2);{var Ce=i=>{var m=va(),w=c(m),O=c(w),G=c(O,!0);l(O);var L=v(O,2),Ae=c(L,!0);l(L),l(w);var ne=v(w,2),ie=c(ne),A=c(ie,!0);l(ie);var N=v(ie,2),z=c(N,!0);l(N),l(ne);var H=v(ne,2);{var le=U=>{var V=ua(),I=c(V),P=c(I,!0);l(I),Ge(2),l(V),B(()=>C(P,r(x).length)),h(U,V)};D(H,U=>{r(x).length>0&&U(le)})}l(m),B((U,V)=>{C(G,r(a).length),C(Ae,r(a).length===1?"project":"projects"),C(A,U),C(z,V)},[()=>ee(),()=>ee()===1?"session":"sessions"]),h(i,m)};D(se,i=>{r(a).length>0&&i(Ce)})}l(W);var re=v(W,2);{var xe=i=>{yt(i,{get text(){return r(b)},classes:"banner-error"})};D(re,i=>{r(b)&&i(xe)})}var oe=v(re,2);{var ke=i=>{var m=fa();de(m,20,()=>Array(3),Ue,(w,O)=>{We(w,{classes:"shimmer-card"})}),l(m),h(i,m)},d=i=>{He(i,{title:"Configuration Required",description:"Set up your API credentials to start tracking sessions",icon:w=>{De(w,{get svg(){return xt},classes:"icon-24"})},children:(w,O)=>{Te(w,{classes:"btn-primary",onclick:ye,text:"Configure Settings"})}})},u=i=>{var m=ya(),w=me(m);{var O=A=>{var N=ga(),z=c(N);Ft(z,{get cards(){return r(x)},onCardClick:H=>{be(H.terminalId)}}),l(N),h(A,N)};D(w,A=>{r(x).length>0&&A(O)})}var G=v(w,2);{var L=A=>{var N=ma();de(N,20,()=>Array(3),Ue,(z,H)=>{We(z,{classes:"shimmer-card"})}),l(N),h(A,N)},Ae=A=>{He(A,{title:"No sessions yet",description:"Claude Code sessions will appear here once JSONL files are found",icon:z=>{De(z,{get svg(){return wt},classes:"icon-24"})}})},ne=M(()=>ee()===0&&r(x).length===0),ie=A=>{var N=Sa(),z=me(N);{var H=I=>{var P=ha();h(I,P)};D(z,I=>{r(x).length>0&&I(H)})}var le=v(z,2);de(le,21,()=>r(a),I=>I.id,(I,P)=>{var J=pa(),Ee=c(J),Ne=c(Ee),Ie=c(Ne),nt=c(Ie,!0);l(Ie);var Be=v(Ie,2),it=c(Be,!0);l(Be),l(Ne);var lt=v(Ne,2);{let ut=M(()=>It(r(P).lastModified));tt(lt,{get text(){return`Last updated ${r(ut)??""}`},classes:"pill-session-time"})}l(Ee);var Ke=v(Ee,2),Ye=c(Ke),Pe=c(Ye),ct=c(Pe,!0);l(Pe);var dt=v(Pe);l(Ye),l(Ke),l(J),B(()=>{Re(J,"href",`/project?id=${r(P).id??""}`),C(nt,r(P).name),C(it,r(P).fullPath),C(ct,r(P).sessionCount),C(dt,` ${r(P).sessionCount===1?"session":"sessions"}`)}),h(I,J)}),l(le);var U=v(le,2);{var V=I=>{var P=_a(),J=c(P);Te(J,{classes:"btn-secondary",onclick:Se,text:"Load More"}),l(P),h(I,P)};D(U,I=>{r(g)&&I(V)})}h(A,N)};D(G,A=>{r(o)&&r(a).length===0?A(L):r(ne)?A(Ae,1):r(a).length>0&&A(ie,2)})}h(i,m)};D(oe,i=>{r(o)&&r(a).length===0&&r(x).length===0?i(ke):r(y)?.apiKey?i(u,-1):i(d,1)})}l(te),h(t,te),je()}export{Ma as component};
|
|
Binary file
|
|
Binary file
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{i as P,s as h,a as g,t as Be,f as A}from"../chunks/3MMtouT7.js";import{s as
|
|
1
|
+
import{i as P,s as h,a as g,t as Be,f as A}from"../chunks/3MMtouT7.js";import{s as b,o as ke,b as _,g as n,p as Ee,q as Pe,x as Ge,c as u,d as p,r as d,t as E,A as He,v as Ne,w as N,N as Ve,$ as We}from"../chunks/Ce0VRwE1.js";import{h as Je}from"../chunks/DFPEaIHz.js";import{g as ce}from"../chunks/Dfn9ME_a.js";import{j as ue,e as le,B as qe,s as Ae,b as Xe}from"../chunks/BTu-2gkj.js";import{g as je,i as Ze}from"../chunks/gQJcRhou.js";import"../chunks/BCwT4WOg.js";import{f as we}from"../chunks/BLszSzTT.js";import{S as Qe}from"../chunks/B-XSrufh.js";import{i as et,N as tt}from"../chunks/3EfvnCrr.js";import{d as ot}from"../chunks/pRcLbE0d.js";const rt=6e4,Se=3;let Q=null,Y=null,L=0,$e=0;async function st(e,t){if(e.length===0)return{error:null,text:""};let i;try{i=await it()}catch{const o=e.map(x=>w(x.data.tool)||x.type),l=Array.from(new Set(o));return{error:"AI SDK failed to load",text:`${e.length} events: ${l.join(", ")}`}}if(!i){const o=e.map(x=>w(x.data.tool)||x.type),l=Array.from(new Set(o));return{error:"No AI provider configured",text:`${e.length} events: ${l.join(", ")}`}}const s=at(e),a=`You are a coding activity summarizer. Given these events from active Claude Code sessions, write a 1-2 sentence summary (max 150 chars) of what's happening. Be specific — mention tool names, file names, and what's being accomplished.
|
|
2
2
|
|
|
3
3
|
${t?`Project: ${t}
|
|
4
4
|
`:""}Events:
|
|
5
5
|
${s}
|
|
6
6
|
|
|
7
7
|
Summary:`;try{const o=await i.generate({input:{text:a},maxTokens:300,...me?{model:me}:{},...de?{provider:de}:{}});return{error:null,text:w(o.content??o.text).trim()||`${e.length} events processed`}}catch(o){return{error:o instanceof Error?o.message:String(o),text:`${e.length} events (summary unavailable)`}}}function nt(e){const t=e.data,i=e.projectName?`[${e.projectName}] `:"",s=w(t.tool)||w(t.name)||"",r=w(t.filePath),a=w(t.command),o=w(t.pattern);switch(e.type){case"agent-idle":case"agent-question":return`${i}${e.type}: ${w(t.message).slice(0,80)}`;case"error":return`${i}Error: ${w(t.error||t.message).slice(0,100)}`;case"session_end":return`${i}Session ended`;case"tool-completed":return`${i}[${s}] completed`;case"tool-failed":return`${i}[${s}] FAILED: ${w(t.error).slice(0,80)}`;case"tool-started":return`${i}[${s}] started${r?`: ${r}`:""}`;case"tool_result":{const l=t.is_error?"FAILED":"done";return`${i}${s?`[${s}] → `:""}${l}`}case"tool_use":{const l=r||a||o||"";return s?`${i}[${s}] ${l}`.trim():`${i}[tool] ${l}`.trim()}case"user_message":return`${i}User: ${w(t.text).slice(0,80)}`;default:return`${i}${e.type}`}}function at(e){return e.map(nt).join(`
|
|
8
|
-
`)}let me="",de="";async function it(){if(Q)return Q;if(Y)return Y;if(L>=Se){if(Date.now()<$e)return null;L=0}return L++,Y=(async()=>{try{et();const e=await import(
|
|
9
|
-
machine.</p>`),$t=A('<div class="summary-card svelte-tc58m"><time class="svelte-tc58m"> </time> <p class="svelte-tc58m"> </p> <span class="event-count svelte-tc58m"> </span></div>'),It=A('<div class="project-group svelte-tc58m"><h3 class="project-name svelte-tc58m"> </h3> <!></div>'),xt=A('<div class="pending svelte-tc58m"><span> </span></div>'),kt=A('<span class="tool svelte-tc58m"> </span>'),Et=A('<code class="file-path svelte-tc58m"> </code>'),Pt=A('<code class="svelte-tc58m"> </code>'),Nt=A('<div><time class="svelte-tc58m"> </time> <span class="project svelte-tc58m"> </span> <span class="type svelte-tc58m"> </span> <!> <!> <!></div>'),jt=A('<div class="raw-events svelte-tc58m"></div>'),
|
|
8
|
+
`)}let me="",de="";async function it(){if(Q)return Q;if(Y)return Y;if(L>=Se){if(Date.now()<$e)return null;L=0}return L++,Y=(async()=>{try{et();const e=await import(tt),t=window.__aiProviders,i=window.process?.env?.NEUROLINK_PROVIDER,s=ot(t,i);if(!s)return console.warn("[ActivityFeed] No AI provider configured"),null;const r=window.process;return r?.env&&t&&(t["google-ai"]&&!r.env.GOOGLE_AI_API_KEY&&(r.env.GOOGLE_AI_API_KEY="proxy-via-server"),t.anthropic&&!r.env.ANTHROPIC_API_KEY&&(r.env.ANTHROPIC_API_KEY="proxy-via-server"),t.openai&&!r.env.OPENAI_API_KEY&&(r.env.OPENAI_API_KEY="proxy-via-server"),t.mistral&&!r.env.MISTRAL_API_KEY&&(r.env.MISTRAL_API_KEY="proxy-via-server")),Q=new e.NeuroLink({provider:s.provider}),me=s.model,de=s.provider,L=0,console.log(`[ActivityFeed] NeuroLink SDK loaded: ${s.provider}/${s.model}`),Q}catch(e){return console.warn("[ActivityFeed] NeuroLink SDK load failed (attempt",L,"):",e instanceof Error?e.message:String(e)),L>=Se&&($e=Date.now()+rt),null}finally{Y=null}})(),Y}function w(e){return e==null?"":typeof e=="string"?e:typeof e=="number"||typeof e=="boolean"?String(e):JSON.stringify(e)}const ct=50,Oe=5,lt=15e3,mt=15e3,dt=5;let S=b(ke([])),te=b(ke([])),ve=b(!0),M=b(!1),B=b(!1),G=null,ee=null,fe=0;const I=new ue;let H="",oe=null;async function ut(e){if(!G){if(H=je(),!H){console.warn("[ActivityStore] No API key available");return}oe=e,await Ie(),G=setInterval(()=>{Ie()},mt),ee=setInterval(()=>{T()},lt)}}function vt(){G&&(clearInterval(G),G=null),ee&&(clearInterval(ee),ee=null);for(const[e,t]of I)t.onclose=null,t.close(),console.log(`[ActivityStore] Closed session socket for ${e}`);I.clear(),_(S,[],!0),_(te,[],!0),fe=0,_(ve,!0),_(B,!1),_(M,!1),H="",oe=null}function ft(){return n(S)}function pt(){return n(te)}function _t(){return n(ve)}function gt(){return n(M)}function yt(){return n(B)}function R(e,t,i,s){const r={data:i,id:`evt-${++fe}`,projectName:e.projectName,sessionId:e.id,summarized:!1,timestamp:s||new Date().toISOString(),type:t};_(S,[...n(S),r].slice(-200),!0),n(S).filter(o=>!o.summarized).length>=Oe&&T()}async function ht(e){if(oe)try{const t=await oe(),s=`${window.location.origin.replace(/^http/,"ws")}/ws/session/${e.id}?ticket=${t}`;console.log(`[ActivityStore] Connecting to session ${e.id}`);const r=new WebSocket(s);I.set(e.id,r),r.onopen=()=>{console.log(`[ActivityStore] Session socket opened: ${e.id}`),_(M,!0)},r.onmessage=a=>{try{const o=JSON.parse(a.data);if(!o||typeof o!="object")return;const l=o;At(e,l),l.type==="history"&&T()}catch{}},r.onclose=()=>{console.log(`[ActivityStore] Session socket closed: ${e.id}`),I.delete(e.id),_(M,I.size>0)},r.onerror=a=>{console.warn(`[ActivityStore] Session socket error for ${e.id}:`,a),I.delete(e.id),_(M,I.size>0)}}catch(t){console.warn(`[ActivityStore] Failed to connect session ${e.id}:`,t)}}async function Ie(){if(H)try{const e=await fetch("/api/sessions?limit=50",{headers:{Authorization:`Bearer ${H}`}});if(!e.ok){console.warn("[ActivityStore] Failed to fetch sessions:",e.status);return}const i=(await e.json()).projects??[],s=Date.now()-dt*60*1e3,r=[];for(const o of i)for(const l of o.sessions)Date.parse(l.modified)>s&&r.push({createdAt:l.created,id:l.id,modifiedAt:l.modified,projectName:o.name,projectPath:o.fullPath});const a=new Set(r.map(o=>o.id));for(const[o,l]of I)a.has(o)||(l.onclose=null,l.close(),I.delete(o),console.log(`[ActivityStore] Session ${o} went stale, closed socket`));for(const o of r)I.has(o.id)||ht(o);_(M,I.size>0)}catch(e){console.warn("[ActivityStore] Error discovering sessions:",e)}}function At(e,t){const i=t.type;if(i==="history"&&Array.isArray(t.messages)){const r=t.messages.slice(-20);for(const a of r)xe(e,a)}else if(i==="message")xe(e,{content:t.content||"",role:t.role||"assistant",timestamp:t.timestamp});else if(i==="tool-use"){const s=t.name||"unknown",r=typeof t.input=="object"&&t.input!==null?t.input:{},a=r.file_path||r.path||"",o=r.command||"",l=r.pattern||"";R(e,"tool_use",{command:o.slice(0,120),filePath:a.slice(0,200),name:s,pattern:l.slice(0,100),tool:s})}else if(i==="tool-result"){const s=t.isError===!0,r=(t.output||"").slice(0,200);let a=t.name||"";if(!a){for(let o=n(S).length-1;o>=0;o--)if(n(S)[o].type==="tool_use"&&n(S)[o].data.name){a=n(S)[o].data.name;break}}R(e,"tool_result",{is_error:s,output:r,status:s?"error":"done",tool:a}),s&&T()}else i==="thinking"||(i==="error"?(R(e,"error",{message:t.message||"Unknown error"}),T()):i==="session-end"&&(R(e,"session_end",{}),T()))}function xe(e,t){const i=t.timestamp||new Date().toISOString();let s="";if(typeof t.content=="string"?s=t.content:Array.isArray(t.content)&&(s=t.content.filter(a=>a.type==="text").map(a=>a.text||a.content||"").join("")),t.role==="user")R(e,"user_message",{text:s.slice(0,150)},i);else if(t.role==="assistant"&&Array.isArray(t.content)){const r=t.content.filter(a=>a.type==="tool_use");for(const a of r){const o=a,l=typeof o.input=="object"&&o.input!==null?o.input:{};R(e,"tool_use",{command:(l.command||"").slice(0,120),filePath:(l.file_path||l.path||"").slice(0,200),name:a.name||"unknown",tool:a.name||"unknown"},i)}}}async function T(){if(n(B))return;const e=n(S).filter(s=>!s.summarized);if(e.length===0)return;const t=new ue;for(const s of e){const r=s.projectName||"Unknown";t.has(r)||t.set(r,[]);const a=t.get(r);a&&a.push(s)}const i=Array.from(t.entries()).filter(([,s])=>s.length>=Oe);if(i.length!==0){_(B,!0);try{const s=await Promise.allSettled(i.slice(0,3).map(async([r,a])=>{const o=await st(a,r);return{projectEvents:a,projectName:r,result:o}}));for(const r of s){if(r.status!=="fulfilled"||!r.value.result.text)continue;const{projectEvents:a,projectName:o,result:l}=r.value;l.error?.includes("No AI provider")&&_(ve,!1);const x={eventIds:a.map(k=>k.id),id:`sum-${++fe}`,projectName:o,text:l.text,timestamp:new Date().toISOString()};_(te,[...n(te),x].slice(-ct),!0);const V=new Set(a.map(k=>k.id));_(S,n(S).map(k=>V.has(k.id)?{...k,summarized:!0}:k),!0)}}catch(s){console.warn("[ActivityStore] Summarization failed:",s)}finally{_(B,!1)}}}var wt=A('<span class="summarizing svelte-tc58m">Summarizing...</span>'),St=A(`<p class="empty svelte-tc58m">No recent activity. Summaries will appear here when Claude Code sessions are active on this
|
|
9
|
+
machine.</p>`),$t=A('<div class="summary-card svelte-tc58m"><time class="svelte-tc58m"> </time> <p class="svelte-tc58m"> </p> <span class="event-count svelte-tc58m"> </span></div>'),It=A('<div class="project-group svelte-tc58m"><h3 class="project-name svelte-tc58m"> </h3> <!></div>'),xt=A('<div class="pending svelte-tc58m"><span> </span></div>'),kt=A('<span class="tool svelte-tc58m"> </span>'),Et=A('<code class="file-path svelte-tc58m"> </code>'),Pt=A('<code class="svelte-tc58m"> </code>'),Nt=A('<div><time class="svelte-tc58m"> </time> <span class="project svelte-tc58m"> </span> <span class="type svelte-tc58m"> </span> <!> <!> <!></div>'),jt=A('<div class="raw-events svelte-tc58m"></div>'),Ot=A('<div class="feed svelte-tc58m"><header class="svelte-tc58m"><h2 class="svelte-tc58m">Activity</h2> <span> </span> <!></header> <!> <div class="entries svelte-tc58m"><!> <!> <!></div> <!> <!></div>');function bt(e,t){Ee(t,!0);let i=b(!1);async function s(){const c=je();if(!c)throw new Error("No API key configured");const m=await fetch("/api/ws-ticket",{headers:{Authorization:`Bearer ${c}`},method:"POST"});if(!m.ok)throw new Error("Failed to get WS ticket");return(await m.json()).ticket}Pe(()=>{ut(s)}),Ge(()=>{vt()});const r=N(pt),a=N(ft),o=N(gt),l=N(_t),x=N(yt),V=N(()=>n(a).filter(c=>!c.summarized).length),k=N(()=>{const c=new Qe;for(const m of n(a))m.sessionId&&c.add(m.sessionId);return c.size}),be=N(()=>{const c=new ue;for(const m of[...n(r)].reverse()){const v=m.projectName||"Unknown";c.has(v)||c.set(v,{name:v,summaries:[]});const f=c.get(v);f&&f.summaries.push(m)}return Array.from(c.values())});var re=Ot(),se=u(re),W=p(u(se),2);let pe;var ze=u(W,!0);d(W);var Le=p(W,2);{var Re=c=>{var m=wt();g(c,m)};P(Le,c=>{n(x)&&c(Re)})}d(se);var _e=p(se,2);{var Me=c=>{Xe(c,{text:"AI summaries unavailable — configure a provider to enable",classes:"banner-warning"})};P(_e,c=>{n(l)||c(Me)})}var ne=p(_e,2),ge=u(ne);{var Te=c=>{var m=St();g(c,m)};P(ge,c=>{n(r).length===0&&n(a).length===0&&c(Te)})}var ye=p(ge,2);le(ye,17,()=>n(be),c=>c.name,(c,m)=>{var v=It(),f=u(v),z=u(f,!0);d(f);var J=p(f,2);le(J,17,()=>n(m).summaries,j=>j.id,(j,D)=>{var O=$t(),C=u(O),K=u(C,!0);d(C);var F=p(C,2),q=u(F,!0);d(F);var X=p(F,2),Z=u(X);d(X),d(O),E(ae=>{h(K,ae),h(q,n(D).text),h(Z,`${n(D).eventIds.length??""} events`)},[()=>we(n(D).timestamp)]),g(j,O)}),d(v),E(()=>h(z,n(m).name)),g(c,v)});var De=p(ye,2);{var Ce=c=>{var m=xt(),v=u(m),f=u(v);d(v),d(m),E(()=>h(f,`${n(V)??""} events pending summary...`)),g(c,m)};P(De,c=>{n(V)>0&&c(Ce)})}d(ne);var he=p(ne,2);qe(he,{classes:"btn-ghost raw-toggle",onclick:()=>{_(i,!n(i))},children:(c,m)=>{He();var v=Be();E(()=>h(v,`${n(i)?"▾":"▸"} Raw events (${n(a).length??""})`)),g(c,v)},$$slots:{default:!0}});var Ke=p(he,2);{var Fe=c=>{var m=jt();le(m,21,()=>[...n(a)].reverse().slice(0,50),v=>v.id,(v,f)=>{var z=Nt();let J;var j=u(z),D=u(j,!0);d(j);var O=p(j,2),C=u(O,!0);d(O);var K=p(O,2),F=u(K,!0);d(K);var q=p(K,2);{var X=y=>{var $=kt(),U=u($,!0);d($),E(()=>h(U,n(f).data.tool)),g(y,$)};P(q,y=>{n(f).data.tool&&y(X)})}var Z=p(q,2);{var ae=y=>{var $=Et(),U=u($,!0);d($),E(ie=>h(U,ie),[()=>n(f).data.filePath.slice(0,80)]),g(y,$)};P(Z,y=>{n(f).data.filePath&&y(ae)})}var Ue=p(Z,2);{var Ye=y=>{var $=Pt(),U=u($,!0);d($),E(ie=>h(U,ie),[()=>n(f).data.command.slice(0,60)]),g(y,$)};P(Ue,y=>{n(f).data.command&&y(Ye)})}d(z),E(y=>{J=Ae(z,1,"raw-event svelte-tc58m",null,J,{summarized:n(f).summarized}),h(D,y),h(C,n(f).projectName||"Unknown"),h(F,n(f).type)},[()=>we(n(f).timestamp)]),g(v,z)}),d(m),g(c,m)};P(Ke,c=>{n(i)&&c(Fe)})}d(re),E(()=>{pe=Ae(W,1,"status svelte-tc58m",null,pe,{live:n(o)}),h(ze,n(o)?`● Watching ${n(k)} sessions`:"○ No active sessions")}),g(e,re),Ne()}var zt=A('<meta name="description" content="Real-time activity feed"/>'),Lt=A('<main class="main"><h1 class="page-title svelte-13r34ge">Activity Feed</h1> <!></main>');function Ht(e,t){Ee(t,!0);let i=b(!1);Pe(()=>{try{const o=localStorage.getItem("shooter_config");if(!o){ce("/config");return}const l=JSON.parse(o);if(!Ze(l)){localStorage.removeItem("shooter_config"),ce("/config");return}_(i,!0)}catch{localStorage.removeItem("shooter_config"),ce("/config")}});var s=Lt();Je("13r34ge",o=>{var l=zt();Ve(()=>{We.title="Activity Feed - Shooter"}),g(o,l)});var r=p(u(s),2);{var a=o=>{bt(o,{})};P(r,o=>{n(i)&&o(a)})}d(s),g(e,s),Ne()}export{Ht as component};
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as q,i as T,b as H,a as k,f as N,s as V}from"../chunks/3MMtouT7.js";import{p as z,s as n,o as J,q as Q,v as W,g as t,b as r,w as _,d as g,c as b,r as c,t as X}from"../chunks/Ce0VRwE1.js";import{e as K,I as Z,B as ee,s as te,i as ae,P as I}from"../chunks/BTu-2gkj.js";import{i as se,N as S}from"../chunks/3EfvnCrr.js";import{P as O}from"../chunks/pRcLbE0d.js";var re=N('<div class="provider-bar svelte-sjabew"></div>'),ie=N("<div> </div>"),oe=N('<div class="page svelte-sjabew"><header class="svelte-sjabew"><h1 class="svelte-sjabew">NeuroLink</h1> <span class="version svelte-sjabew">new NeuroLink()</span> <!></header> <!> <div class="log svelte-sjabew" id="log"></div> <div class="input-bar svelte-sjabew"><!> <!></div></div>');function pe(M,p){z(p,!0);let u=n(null),m=n(null),h=n(J([])),d=n(""),v=n(!1),f=n(!1),o=n("litellm");function i(e,a="info"){r(h,[...t(h),{text:e,type:a}],!0)}function R(){const e=globalThis.process;if(!e?.env)return;const a=e.env;p.data.litellmBaseUrl&&(a.LITELLM_BASE_URL=p.data.litellmBaseUrl),p.data.litellmModel&&(a.LITELLM_MODEL=p.data.litellmModel);const s=window.__aiProviders;s?.["google-ai"]&&(a.GOOGLE_AI_API_KEY="proxy-via-server"),s?.anthropic&&(a.ANTHROPIC_API_KEY="proxy-via-server"),s?.openai&&(a.OPENAI_API_KEY="proxy-via-server"),s?.mistral&&(a.MISTRAL_API_KEY="proxy-via-server")}Q(async()=>{$(),se(),R(),i("Loading NeuroLink from CDN..."),i(S,"dim");try{r(u,await import(S),!0),i(`Loaded! ${Object.keys(t(u)??{}).length} exports`,"pass"),r(m,new(t(u)).NeuroLink({provider:t(o)}),!0),i(`NeuroLink ready · provider: ${t(o)}`,"pass"),r(f,!0)}catch(e){i(`Failed to load: ${e instanceof Error?e.message:String(e)}`,"fail")}});function D(e){!t(u)||e===t(o)||(r(o,e,!0),r(m,new(t(u)).NeuroLink({provider:e}),!0),i(`Switched to provider: ${e}`,"dim"))}function $(){typeof globalThis.process>"u"&&(globalThis.process={cwd:()=>"/",env:{},platform:"browser",version:"v24.0.0"}),typeof globalThis.global>"u"&&(globalThis.global=globalThis)}async function P(){if(!t(d).trim()||!t(m)||t(v))return;const e=t(d).trim();r(d,""),r(v,!0),i(`> ${e}`,"user");const a=O.find(s=>s.id===t(o));if(!a){r(v,!1);return}try{const s=await t(m).generate({input:{text:e},model:a.model,provider:a.id}),l=typeof s.content=="string"?s.content:"(empty response)",E=s.usage;i(l,"ai"),i(`${a.id}/${a.model} | ${E?.total??"?"} tokens`,"dim")}catch(s){i(`Error: ${s instanceof Error?s.message:String(s)}`,"fail")}r(v,!1)}function B(e){e.key==="Enter"&&!e.shiftKey&&(e.preventDefault(),P())}var y=oe(),w=b(y),U=g(b(w),4);{var C=e=>{I(e,{text:"Connected",classes:"pill-connected"})},Y=e=>{I(e,{text:"Loading...",classes:"pill-loading"})};T(U,e=>{t(f)?e(C):e(Y,-1)})}c(w);var j=g(w,2);{var F=e=>{var a=re();K(a,21,()=>O,s=>s.id,(s,l)=>{{let E=_(()=>t(o)===t(l).id?"prov-pill--active":"");I(s,{get text(){return t(l).label},get classes(){return`prov-pill ${t(E)??""}`},onclick:()=>{D(t(l).id)}})}}),c(a),k(e,a)};T(j,e=>{t(f)&&e(F)})}var L=g(j,2);K(L,21,()=>t(h),ae,(e,a)=>{var s=ie(),l=b(s,!0);c(s),X(()=>{te(s,1,`log-entry ${t(a).type??""}`,"svelte-sjabew"),V(l,t(a).text)}),k(e,s)}),c(L);var x=g(L,2),A=b(x);{let e=_(()=>t(f)?`Ask anything... [${t(o)}]`:"Loading SDK...");Z(A,{name:"prompt",get placeholder(){return t(e)},classes:"input-prompt",get value(){return t(d)},set value(a){r(d,a,!0)}})}var G=g(A,2);{let e=_(()=>!t(f)||t(v)||!t(d).trim()),a=_(()=>t(v)?"...":"Send");ee(G,{classes:"btn-primary",onclick:P,get disabled(){return t(e)},get text(){return t(a)}})}c(x),c(y),H("keydown",x,B),k(M,y),W()}q(["keydown"]);export{pe as component};
|
|
Binary file
|
|
Binary file
|