openportal 0.1.21 → 0.1.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/dist/index.js +159 -61
  2. package/package.json +1 -1
  3. package/web/nitro.json +1 -1
  4. package/web/public/assets/_app-DR3fN4ux.js +41 -0
  5. package/web/public/assets/_app-s55ZVvYX.js +1 -0
  6. package/web/public/assets/_id-tcVVgEAU.js +37 -0
  7. package/web/public/assets/{about-DrLMzK9p.js → about-CMq9lprB.js} +1 -1
  8. package/web/public/assets/breadcrumb-context-DVp6Utys.js +1 -0
  9. package/web/public/assets/diff-CeYk9FRZ.js +1 -0
  10. package/web/public/assets/es-2Z9yCxBa.js +12 -0
  11. package/web/public/assets/{field-DzEyUXLT.js → field-C_yIisEG.js} +1 -1
  12. package/web/public/assets/geist-mono-cyrillic-wght-normal-BZdD_g9V.woff2 +0 -0
  13. package/web/public/assets/geist-mono-latin-ext-wght-normal-b6lpi8_2.woff2 +0 -0
  14. package/web/public/assets/geist-mono-latin-wght-normal-Cjtb1TV-.woff2 +0 -0
  15. package/web/public/assets/geist-sans-latin-400-normal-BOaIZNA2.woff +0 -0
  16. package/web/public/assets/geist-sans-latin-400-normal-gapTbOY8.woff2 +0 -0
  17. package/web/public/assets/index-F7uBlb4O.js +23 -0
  18. package/web/public/assets/index-cSM4JIYc.css +2 -0
  19. package/web/public/assets/instances-sesWc2nc.js +1 -0
  20. package/web/public/assets/inter-cyrillic-ext-wght-normal-BOeWTOD4.woff2 +0 -0
  21. package/web/public/assets/inter-cyrillic-wght-normal-DqGufNeO.woff2 +0 -0
  22. package/web/public/assets/inter-greek-ext-wght-normal-DlzME5K_.woff2 +0 -0
  23. package/web/public/assets/inter-greek-wght-normal-CkhJZR-_.woff2 +0 -0
  24. package/web/public/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2 +0 -0
  25. package/web/public/assets/inter-latin-wght-normal-Dx4kXJAl.woff2 +0 -0
  26. package/web/public/assets/inter-vietnamese-wght-normal-CBcvBZtf.woff2 +0 -0
  27. package/web/public/assets/link-Cuyn8HOL.js +1 -0
  28. package/web/public/assets/model-store-Dj9Oh_H_.js +1 -0
  29. package/web/public/assets/select-BL8AW2NH.js +1 -0
  30. package/web/public/assets/settings-BV2WSAEW.js +1 -0
  31. package/web/public/assets/use-media-query-RLsQpAw3.js +1 -0
  32. package/web/public/assets/useHasTabbableChild-BfugZHgl.js +1 -0
  33. package/web/server/chunks/nitro/nitro.mjs +292 -76
  34. package/web/server/chunks/routes/api/instances.mjs +4 -3
  35. package/web/server/chunks/routes/api/opencode/_port/config.mjs +1 -1
  36. package/web/server/chunks/routes/api/opencode/_port/files/search.mjs +9 -0
  37. package/web/server/chunks/routes/api/opencode/_port/git/diff.mjs +26 -0
  38. package/web/server/chunks/routes/api/opencode/_port/health.mjs +1 -1
  39. package/web/server/chunks/routes/api/opencode/_port/project/current.mjs +1 -1
  40. package/web/server/chunks/routes/api/opencode/_port/providers.mjs +1 -1
  41. package/web/server/chunks/routes/api/opencode/_port/session/_id/messages.mjs +1 -1
  42. package/web/server/chunks/routes/api/opencode/_port/session/_id/prompt.mjs +1 -1
  43. package/web/server/chunks/routes/api/opencode/_port/session/create.mjs +1 -1
  44. package/web/server/chunks/routes/api/opencode/_port/session/index.delete.mjs +1 -1
  45. package/web/server/chunks/routes/api/opencode/_port/session/index.get.mjs +1 -1
  46. package/web/server/chunks/routes/api/opencode/_port/sessions.mjs +1 -1
  47. package/web/public/assets/_app-CC_Y-qWn.js +0 -1
  48. package/web/public/assets/_app-DczUzSHr.js +0 -1
  49. package/web/public/assets/_id-rJW_FSHn.js +0 -35
  50. package/web/public/assets/index-DlbRLAic.css +0 -2
  51. package/web/public/assets/index-Fp5xCkff.js +0 -20
  52. package/web/public/assets/instances-Qnhfp3do.js +0 -1
  53. package/web/public/assets/select-Bx8tbnxS.js +0 -1
  54. package/web/public/assets/settings-NbPWPs_I.js +0 -1
  55. package/web/public/assets/use-media-query-B3osDNFy.js +0 -1
package/dist/index.js CHANGED
@@ -282,6 +282,8 @@ function generateId() {
282
282
  return Math.random().toString(36).substring(2, 10);
283
283
  }
284
284
  function isProcessRunning(pid) {
285
+ if (pid === null)
286
+ return false;
285
287
  try {
286
288
  process.kill(pid, 0);
287
289
  return true;
@@ -293,21 +295,29 @@ function printHelp() {
293
295
  console.log(`
294
296
  OpenPortal CLI - Run OpenCode with a web UI
295
297
 
296
- Usage: openportal [options] [command]
297
-
298
- Options:
299
- -h, --help Show this help message
298
+ Usage: openportal [command] [options]
300
299
 
301
300
  Commands:
302
- run [options] Start OpenCode and the web UI
301
+ (default) Start OpenCode server and Web UI
302
+ run [options] Start only OpenCode server (no Web UI)
303
303
  stop Stop running instances
304
304
  list, ls List running instances
305
305
  clean Clean up stale entries
306
306
 
307
+ Options:
308
+ -h, --help Show this help message
309
+ -d, --directory <path> Working directory (default: current directory)
310
+ -p, --port <port> Web UI port (default: 3000)
311
+ --opencode-port <port> OpenCode server port (default: 4000)
312
+ --hostname <host> Hostname to bind (default: 0.0.0.0)
313
+ --name <name> Instance name
314
+
307
315
  Examples:
308
- openportal run Start with default settings
309
- openportal run --port 8080 Use custom port
310
- openportal run --directory ./my-project Serve specific directory
316
+ openportal Start OpenCode + Web UI
317
+ openportal . Start OpenCode + Web UI in current dir
318
+ openportal run Start only OpenCode server
319
+ openportal run -d ./my-project Start OpenCode in specific directory
320
+ openportal --port 8080 Use custom web UI port
311
321
  openportal stop Stop running instances
312
322
  openportal list List running instances
313
323
  `);
@@ -319,7 +329,17 @@ function parseArgs() {
319
329
  const arg = process.argv[i];
320
330
  if (arg.startsWith("--")) {
321
331
  const [key, value] = arg.substring(2).split("=");
322
- flags[key.toLowerCase()] = value ?? true;
332
+ if (value !== undefined) {
333
+ flags[key.toLowerCase()] = value;
334
+ } else {
335
+ const next = process.argv[i + 1];
336
+ if (next && !next.startsWith("-")) {
337
+ flags[key.toLowerCase()] = next;
338
+ i++;
339
+ } else {
340
+ flags[key.toLowerCase()] = true;
341
+ }
342
+ }
323
343
  } else if (arg.startsWith("-")) {
324
344
  const short = arg.substring(1);
325
345
  const next = process.argv[i + 1];
@@ -335,11 +355,42 @@ function parseArgs() {
335
355
  }
336
356
  return { args, flags };
337
357
  }
338
- async function cmdRun(options) {
358
+ async function startOpenCodeServer(directory, opencodePort, hostname) {
359
+ console.log(`Starting OpenCode server...`);
360
+ const proc = Bun.spawn([
361
+ "opencode",
362
+ "serve",
363
+ "--port",
364
+ String(opencodePort),
365
+ "--hostname",
366
+ hostname
367
+ ], {
368
+ cwd: directory,
369
+ stdio: ["ignore", "pipe", "pipe"],
370
+ env: { ...process.env }
371
+ });
372
+ return proc.pid;
373
+ }
374
+ async function startWebServer(port, hostname) {
375
+ console.log(`Starting Web UI server...`);
376
+ const proc = Bun.spawn(["bun", "run", WEB_SERVER_PATH], {
377
+ cwd: dirname(WEB_SERVER_PATH),
378
+ stdio: ["ignore", "pipe", "pipe"],
379
+ env: {
380
+ ...process.env,
381
+ PORT: String(port),
382
+ HOST: hostname,
383
+ NITRO_PORT: String(port),
384
+ NITRO_HOST: hostname
385
+ }
386
+ });
387
+ return proc.pid;
388
+ }
389
+ async function cmdDefault(options) {
339
390
  const hostname = options.hostname || DEFAULT_HOSTNAME;
340
- const directory = options.directory || process.cwd();
391
+ const directory = resolve(options.directory || options.d || process.cwd());
341
392
  const name = options.name || directory.split("/").pop() || "opencode";
342
- const port = options.port ? parseInt(options.port, 10) : await getPort({ host: hostname, port: DEFAULT_PORT });
393
+ const port = options.port || options.p ? parseInt(options.port || options.p, 10) : await getPort({ host: hostname, port: DEFAULT_PORT });
343
394
  const opencodePort = options["opencode-port"] ? parseInt(options["opencode-port"], 10) : await getPort({ host: hostname, port: DEFAULT_OPENCODE_PORT });
344
395
  const config = readConfig();
345
396
  const existingIndex = config.instances.findIndex((i) => i.directory === directory);
@@ -348,12 +399,13 @@ async function cmdRun(options) {
348
399
  if (isProcessRunning(existing.opencodePid) || isProcessRunning(existing.webPid)) {
349
400
  console.log(`OpenPortal is already running for this directory.`);
350
401
  console.log(` Name: ${existing.name}`);
351
- console.log(` Port: ${existing.port}`);
402
+ console.log(` Web UI Port: ${existing.port ?? "N/A"}`);
352
403
  console.log(` OpenCode Port: ${existing.opencodePort}`);
353
- console.log(` OpenCode PID: ${existing.opencodePid}`);
354
- console.log(` Web PID: ${existing.webPid}`);
355
- console.log(`
356
- Access OpenPortal at http://localhost:${existing.port}`);
404
+ if (existing.port) {
405
+ console.log(`
406
+ \uD83D\uDCF1 Access OpenPortal at http://localhost:${existing.port}`);
407
+ }
408
+ console.log(`\uD83D\uDD27 OpenCode API at http://localhost:${existing.opencodePort}`);
357
409
  return;
358
410
  }
359
411
  config.instances.splice(existingIndex, 1);
@@ -370,50 +422,25 @@ Access OpenPortal at http://localhost:${existing.port}`);
370
422
  console.log(` OpenCode Port: ${opencodePort}`);
371
423
  console.log(` Hostname: ${hostname}`);
372
424
  try {
373
- const resolvedDir = resolve(directory);
374
- console.log(`
375
- Starting OpenCode server...`);
376
- const opencodeProc = Bun.spawn([
377
- "opencode",
378
- "serve",
379
- "--port",
380
- String(opencodePort),
381
- "--hostname",
382
- hostname
383
- ], {
384
- cwd: resolvedDir,
385
- stdio: ["ignore", "pipe", "pipe"],
386
- env: { ...process.env }
387
- });
388
- console.log(`Starting Web UI server...`);
389
- const webProc = Bun.spawn(["bun", "run", WEB_SERVER_PATH], {
390
- cwd: dirname(WEB_SERVER_PATH),
391
- stdio: ["ignore", "pipe", "pipe"],
392
- env: {
393
- ...process.env,
394
- PORT: String(port),
395
- HOST: hostname,
396
- NITRO_PORT: String(port),
397
- NITRO_HOST: hostname
398
- }
399
- });
425
+ const opencodePid = await startOpenCodeServer(directory, opencodePort, hostname);
426
+ const webPid = await startWebServer(port, hostname);
400
427
  const instance = {
401
428
  id: generateId(),
402
429
  name,
403
- directory: resolvedDir,
430
+ directory,
404
431
  port,
405
432
  opencodePort,
406
433
  hostname,
407
- opencodePid: opencodeProc.pid,
408
- webPid: webProc.pid,
434
+ opencodePid,
435
+ webPid,
409
436
  startedAt: new Date().toISOString()
410
437
  };
411
438
  config.instances.push(instance);
412
439
  writeConfig(config);
413
440
  console.log(`
414
441
  \u2705 OpenPortal started!`);
415
- console.log(` OpenCode PID: ${opencodeProc.pid}`);
416
- console.log(` Web UI PID: ${webProc.pid}`);
442
+ console.log(` OpenCode PID: ${opencodePid}`);
443
+ console.log(` Web UI PID: ${webPid}`);
417
444
  console.log(`
418
445
  \uD83D\uDCF1 Access OpenPortal at http://localhost:${port}`);
419
446
  console.log(`\uD83D\uDD27 OpenCode API at http://localhost:${opencodePort}`);
@@ -425,9 +452,59 @@ Starting OpenCode server...`);
425
452
  process.exit(1);
426
453
  }
427
454
  }
455
+ async function cmdRun(options) {
456
+ const hostname = options.hostname || DEFAULT_HOSTNAME;
457
+ const directory = resolve(options.directory || options.d || process.cwd());
458
+ const name = options.name || directory.split("/").pop() || "opencode";
459
+ const opencodePort = options["opencode-port"] ? parseInt(options["opencode-port"], 10) : await getPort({ host: hostname, port: DEFAULT_OPENCODE_PORT });
460
+ const config = readConfig();
461
+ const existingIndex = config.instances.findIndex((i) => i.directory === directory);
462
+ if (existingIndex !== -1) {
463
+ const existing = config.instances[existingIndex];
464
+ if (isProcessRunning(existing.opencodePid)) {
465
+ console.log(`OpenCode is already running for this directory.`);
466
+ console.log(` Name: ${existing.name}`);
467
+ console.log(` OpenCode Port: ${existing.opencodePort}`);
468
+ console.log(`\uD83D\uDD27 OpenCode API at http://localhost:${existing.opencodePort}`);
469
+ return;
470
+ }
471
+ config.instances.splice(existingIndex, 1);
472
+ }
473
+ console.log(`Starting OpenCode server...`);
474
+ console.log(` Name: ${name}`);
475
+ console.log(` Directory: ${directory}`);
476
+ console.log(` OpenCode Port: ${opencodePort}`);
477
+ console.log(` Hostname: ${hostname}`);
478
+ try {
479
+ const opencodePid = await startOpenCodeServer(directory, opencodePort, hostname);
480
+ const instance = {
481
+ id: generateId(),
482
+ name,
483
+ directory,
484
+ port: null,
485
+ opencodePort,
486
+ hostname,
487
+ opencodePid,
488
+ webPid: null,
489
+ startedAt: new Date().toISOString()
490
+ };
491
+ config.instances.push(instance);
492
+ writeConfig(config);
493
+ console.log(`
494
+ \u2705 OpenCode server started!`);
495
+ console.log(` OpenCode PID: ${opencodePid}`);
496
+ console.log(`\uD83D\uDD27 OpenCode API at http://localhost:${opencodePort}`);
497
+ } catch (error) {
498
+ if (error instanceof Error) {
499
+ console.error(`
500
+ \u274C Failed to start OpenCode: ${error.message}`);
501
+ }
502
+ process.exit(1);
503
+ }
504
+ }
428
505
  function cmdStop(options) {
429
506
  const config = readConfig();
430
- const directory = options.directory ? resolve(options.directory) : process.cwd();
507
+ const directory = options.directory || options.d ? resolve(options.directory || options.d) : process.cwd();
431
508
  const instance = options.name ? config.instances.find((i) => i.name === options.name) : config.instances.find((i) => i.directory === directory);
432
509
  if (!instance) {
433
510
  console.error("No instance found.");
@@ -439,11 +516,13 @@ function cmdStop(options) {
439
516
  } catch {
440
517
  console.log("OpenCode was already stopped.");
441
518
  }
442
- try {
443
- process.kill(instance.webPid, "SIGTERM");
444
- console.log(`Stopped Web UI (PID: ${instance.webPid})`);
445
- } catch {
446
- console.log("Web UI was already stopped.");
519
+ if (instance.webPid !== null) {
520
+ try {
521
+ process.kill(instance.webPid, "SIGTERM");
522
+ console.log(`Stopped Web UI (PID: ${instance.webPid})`);
523
+ } catch {
524
+ console.log("Web UI was already stopped.");
525
+ }
447
526
  }
448
527
  config.instances = config.instances.filter((i) => i.id !== instance.id);
449
528
  writeConfig(config);
@@ -465,11 +544,18 @@ OpenPortal Instances:
465
544
  for (const instance of config.instances) {
466
545
  const opencodeRunning = isProcessRunning(instance.opencodePid);
467
546
  const webRunning = isProcessRunning(instance.webPid);
468
- const status = opencodeRunning && webRunning ? "running" : "stopped";
547
+ let status = "stopped";
548
+ if (opencodeRunning && webRunning)
549
+ status = "running";
550
+ else if (opencodeRunning)
551
+ status = "opencode";
552
+ else if (webRunning)
553
+ status = "web only";
469
554
  if (opencodeRunning || webRunning) {
470
555
  validInstances.push(instance);
471
556
  }
472
- console.log(`${instance.id} ${instance.name.padEnd(16)} ${instance.port} ${instance.opencodePort} ${status.padEnd(12)} ${instance.directory}`);
557
+ const portDisplay = instance.port ?? "-";
558
+ console.log(`${instance.id} ${instance.name.padEnd(16)} ${String(portDisplay).padEnd(4)} ${instance.opencodePort} ${status.padEnd(12)} ${instance.directory}`);
473
559
  }
474
560
  if (validInstances.length !== config.instances.length) {
475
561
  config.instances = validInstances;
@@ -493,11 +579,18 @@ Config cleaned. ${validInstances.length} active instance(s).`);
493
579
  }
494
580
  async function main() {
495
581
  const { args, flags } = parseArgs();
496
- const command = args[0]?.toLowerCase() || "run";
497
582
  if (flags.help || flags.h) {
498
583
  printHelp();
499
584
  return;
500
585
  }
586
+ const command = args[0]?.toLowerCase();
587
+ if (!command || command === "." || command.startsWith("/") || command.startsWith("./")) {
588
+ if (command && command !== ".") {
589
+ flags.directory = command;
590
+ }
591
+ await cmdDefault(flags);
592
+ return;
593
+ }
501
594
  switch (command) {
502
595
  case "run":
503
596
  await cmdRun(flags);
@@ -513,9 +606,14 @@ async function main() {
513
606
  cmdClean();
514
607
  break;
515
608
  default:
516
- console.log(`Unknown command: ${command}`);
517
- console.log("Use --help to see available commands.");
518
- process.exit(1);
609
+ if (existsSync(command)) {
610
+ flags.directory = command;
611
+ await cmdDefault(flags);
612
+ } else {
613
+ console.log(`Unknown command: ${command}`);
614
+ console.log("Use --help to see available commands.");
615
+ process.exit(1);
616
+ }
519
617
  }
520
618
  }
521
619
  main();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openportal",
3
- "version": "0.1.21",
3
+ "version": "0.1.23",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",
package/web/nitro.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "date": "2026-01-05T10:10:41.786Z",
2
+ "date": "2026-01-05T12:29:13.359Z",
3
3
  "preset": "bun",
4
4
  "framework": {
5
5
  "name": "nitro",
@@ -0,0 +1,41 @@
1
+ import{n as e,r as t,t as n}from"./link-Cuyn8HOL.js";import{$ as r,$n as i,$t as a,At as o,B as s,C as c,Cn as l,D as u,E as d,Gn as f,H as p,I as m,J as h,L as g,Nt as _,O as v,Ot as y,Qn as ee,S as te,St as b,Tt as ne,U as x,V as S,Vn as C,Wn as re,Xn as ie,Y as ae,Yt as oe,Zn as se,_ as w,ar as T,b as ce,cn as le,d as ue,dn as de,en as fe,er as pe,et as me,f as he,g as ge,gn as _e,gt as ve,hn as E,k as ye,kt as be,l as xe,mn as Se,nr as Ce,on as we,p as Te,r as Ee,rn as De,s as Oe,st as ke,tn as Ae,tr as je,u as Me,v as D,vn as O,w as Ne,wn as Pe,x as k,xn as Fe,y as A,yt as Ie,zn as j}from"./index-F7uBlb4O.js";import{r as Le}from"./es-2Z9yCxBa.js";import{t as Re}from"./use-media-query-RLsQpAw3.js";import{t as ze}from"./model-store-Dj9Oh_H_.js";import{n as Be,t as Ve}from"./breadcrumb-context-DVp6Utys.js";var M=T(Ce(),1),He=T(je(),1),N=M.createContext(null);function Ue(e){let{children:t}=e,n=(0,M.useContext)(N),[r,i]=(0,M.useState)(0),a=(0,M.useMemo)(()=>({parent:n,modalCount:r,addModal(){i(e=>e+1),n&&n.addModal()},removeModal(){i(e=>e-1),n&&n.removeModal()}}),[n,r]);return M.createElement(N.Provider,{value:a},t)}function We(){let e=(0,M.useContext)(N);return{modalProviderProps:{"aria-hidden":e&&e.modalCount>0?!0:void 0}}}function Ge(e){let{modalProviderProps:t}=We();return M.createElement(`div`,{"data-overlay-container":!0,...e,...t})}function Ke(e){return M.createElement(Ue,null,M.createElement(Ge,e))}function qe(e){let t=f(),{portalContainer:n=t?null:document.body,...r}=e,{getContainer:i}=oe();if(!e.portalContainer&&i&&(n=i()),M.useEffect(()=>{if(n?.closest(`[data-overlay-container]`))throw Error(`An OverlayContainer must not be inside another container. Please change the portalContainer prop.`)},[n]),!n)return null;let a=M.createElement(Ke,r);return He.createPortal(a,n)}var P={};P={breadcrumbs:`عناصر الواجهة`};var F={};F={breadcrumbs:`Трохи хляб`};var I={};I={breadcrumbs:`Popis cesty`};var L={};L={breadcrumbs:`Brødkrummer`};var R={};R={breadcrumbs:`Breadcrumbs`};var z={};z={breadcrumbs:`Πλοηγήσεις breadcrumb`};var B={};B={breadcrumbs:`Breadcrumbs`};var V={};V={breadcrumbs:`Migas de pan`};var Je={};Je={breadcrumbs:`Lingiread`};var Ye={};Ye={breadcrumbs:`Navigointilinkit`};var Xe={};Xe={breadcrumbs:`Chemin de navigation`};var Ze={};Ze={breadcrumbs:`שבילי ניווט`};var Qe={};Qe={breadcrumbs:`Navigacijski putovi`};var $e={};$e={breadcrumbs:`Morzsamenü`};var et={};et={breadcrumbs:`Breadcrumb`};var tt={};tt={breadcrumbs:`パンくずリスト`};var nt={};nt={breadcrumbs:`탐색 표시`};var rt={};rt={breadcrumbs:`Naršymo kelias`};var it={};it={breadcrumbs:`Atpakaļceļi`};var at={};at={breadcrumbs:`Navigasjonsstier`};var ot={};ot={breadcrumbs:`Broodkruimels`};var st={};st={breadcrumbs:`Struktura nawigacyjna`};var ct={};ct={breadcrumbs:`Caminho detalhado`};var lt={};lt={breadcrumbs:`Categorias`};var ut={};ut={breadcrumbs:`Miez de pâine`};var dt={};dt={breadcrumbs:`Навигация`};var ft={};ft={breadcrumbs:`Navigačné prvky Breadcrumbs`};var pt={};pt={breadcrumbs:`Drobtine`};var mt={};mt={breadcrumbs:`Putanje navigacije`};var ht={};ht={breadcrumbs:`Sökvägar`};var H={};H={breadcrumbs:`İçerik haritaları`};var gt={};gt={breadcrumbs:`Навігаційна стежка`};var _t={};_t={breadcrumbs:`导航栏`};var vt={};vt={breadcrumbs:`導覽列`};var yt={};yt={"ar-AE":P,"bg-BG":F,"cs-CZ":I,"da-DK":L,"de-DE":R,"el-GR":z,"en-US":B,"es-ES":V,"et-EE":Je,"fi-FI":Ye,"fr-FR":Xe,"he-IL":Ze,"hr-HR":Qe,"hu-HU":$e,"it-IT":et,"ja-JP":tt,"ko-KR":nt,"lt-LT":rt,"lv-LV":it,"nb-NO":at,"nl-NL":ot,"pl-PL":st,"pt-BR":ct,"pt-PT":lt,"ro-RO":ut,"ru-RU":dt,"sk-SK":ft,"sl-SI":pt,"sr-SP":mt,"sv-SE":ht,"tr-TR":H,"uk-UA":gt,"zh-CN":_t,"zh-TW":vt};function bt(e){return e&&e.__esModule?e.default:e}function xt(e){let{"aria-label":t,...n}=e,r=de(bt(yt),`@react-aria/breadcrumbs`);return{navProps:{...j(n,{labelable:!0}),"aria-label":t||r.format(`breadcrumbs`)}}}function St(e,t){let n=j(e,{labelable:!0}),{hoverProps:r}=a({onHoverStart:()=>t?.open(!0),onHoverEnd:()=>t?.close()});return{tooltipProps:C(n,r,{role:`tooltip`})}}function Ct(e,t,n){let{isDisabled:r,trigger:i,shouldCloseOnPress:o=!0}=e,s=re(),c=(0,M.useRef)(!1),l=(0,M.useRef)(!1),u=()=>{(c.current||l.current)&&t.open(l.current)},d=e=>{!c.current&&!l.current&&t.close(e)};(0,M.useEffect)(()=>{let e=e=>{n&&n.current&&e.key===`Escape`&&(e.stopPropagation(),t.close(!0))};if(t.isOpen)return document.addEventListener(`keydown`,e,!0),()=>{document.removeEventListener(`keydown`,e,!0)}},[n,t]);let f=()=>{i!==`focus`&&(De()===`pointer`?c.current=!0:c.current=!1,u())},p=()=>{i!==`focus`&&(l.current=!1,c.current=!1,d())},m=()=>{o&&(l.current=!1,c.current=!1,d(!0))},h=()=>{we()&&(l.current=!0,u())},g=()=>{l.current=!1,c.current=!1,d(!0)},{hoverProps:_}=a({isDisabled:r,onHoverStart:f,onHoverEnd:p}),{focusableProps:v}=Ae({isDisabled:r,onFocus:h,onBlur:g},n);return{triggerProps:{"aria-describedby":t.isOpen?s:void 0,...C(v,_,{onPointerDown:m,onKeyDown:m}),tabIndex:void 0},tooltipProps:{id:s}}}var U=(0,M.createContext)(null),wt=(0,M.forwardRef)(function(e,t){[e,t]=E(e,t,U);let{CollectionRoot:n}=(0,M.useContext)(ne),{navProps:r}=xt(e),i=j(e,{global:!0,labelable:!0});return M.createElement(be,{content:M.createElement(o,e)},a=>M.createElement(`ol`,{ref:t,...C(i,r),slot:e.slot||void 0,style:e.style,className:e.className??`react-aria-Breadcrumbs`},M.createElement(U.Provider,{value:e},M.createElement(n,{collection:a}))))}),Tt=class extends _{};Tt.type=`item`;var Et=y(Tt,function(e,n,r){let i=r.nextKey==null,{isDisabled:a,onAction:o}=Fe(U),s={"aria-current":i?`page`:null,isDisabled:a||i,onPress:()=>o?.(r.key)},c=_e({...r.props,children:r.rendered,values:{isDisabled:a||i,isCurrent:i},defaultClassName:`react-aria-Breadcrumb`}),l=j(e,{global:!0,labelable:!0});return delete l.id,M.createElement(`li`,{...l,...c,ref:n,"data-disabled":a||i||void 0,"data-current":i||void 0},M.createElement(t.Provider,{value:s},c.children))}),Dt=1500,Ot=500,W={},kt=0,G=!1,K=null,q=null;function At(e={}){let{delay:t=Dt,closeDelay:n=Ot}=e,{isOpen:r,open:i,close:a}=ve(e),o=(0,M.useMemo)(()=>`${++kt}`,[]),s=(0,M.useRef)(null),c=(0,M.useRef)(a),l=()=>{W[o]=f},u=()=>{for(let e in W)e!==o&&(W[e](!0),delete W[e])},d=()=>{s.current&&clearTimeout(s.current),s.current=null,u(),l(),G=!0,i(),K&&=(clearTimeout(K),null),q&&=(clearTimeout(q),null)},f=e=>{e||n<=0?(s.current&&clearTimeout(s.current),s.current=null,c.current()):s.current||=setTimeout(()=>{s.current=null,c.current()},n),K&&=(clearTimeout(K),null),G&&(q&&clearTimeout(q),q=setTimeout(()=>{delete W[o],q=null,G=!1},Math.max(Ot,n)))},p=()=>{u(),l(),!r&&!K&&!G?K=setTimeout(()=>{K=null,G=!0,d()},t):r||d()};return(0,M.useEffect)(()=>{c.current=a},[a]),(0,M.useEffect)(()=>()=>{s.current&&clearTimeout(s.current),W[o]&&delete W[o]},[o]),{isOpen:r,open:e=>{!e&&t>0&&!s.current?p():d()},close:f}}var J=(0,M.createContext)(null),jt=(0,M.createContext)(null);function Mt(e){let t=At(e),n=(0,M.useRef)(null),{triggerProps:r,tooltipProps:i}=Ct(e,t,n);return M.createElement(Se,{values:[[J,t],[jt,{...i,triggerRef:n}]]},M.createElement(fe,{...r,ref:n},e.children))}var Nt=(0,M.forwardRef)(function({UNSTABLE_portalContainer:e,...t},n){[t,n]=E(t,n,jt);let r=(0,M.useContext)(J),i=At(t),a=t.isOpen!=null||t.defaultOpen!=null||!r?i:r,o=l(n,a.isOpen)||t.isExiting||!1;return!a.isOpen&&!o?null:M.createElement(qe,{portalContainer:e},M.createElement(Pt,{...t,tooltipRef:n,isExiting:o}))});function Pt(e){let t=(0,M.useContext)(J),n=(0,M.useRef)(null),{overlayProps:i,arrowProps:a,placement:o,triggerAnchorPoint:s}=le({placement:e.placement||`top`,targetRef:e.triggerRef,overlayRef:e.tooltipRef,arrowRef:n,offset:e.offset,crossOffset:e.crossOffset,isOpen:t.isOpen,arrowBoundaryOffset:e.arrowBoundaryOffset,shouldFlip:e.shouldFlip,containerPadding:e.containerPadding,onClose:()=>t.close(!0)}),c=Pe(e.tooltipRef,!!o)||e.isEntering||!1,l=_e({...e,defaultClassName:`react-aria-Tooltip`,values:{placement:o,isEntering:c,isExiting:e.isExiting,state:t}});e=C(e,i);let{tooltipProps:u}=St(e,t),d=j(e,{global:!0});return M.createElement(`div`,{...C(d,l,u),ref:e.tooltipRef,style:{...i.style,"--trigger-anchor-point":s?`${s.x}px ${s.y}px`:void 0,...l.style},"data-placement":o??void 0,"data-entering":c||void 0,"data-exiting":e.isExiting||void 0},M.createElement(r.Provider,{value:{...a,placement:o,ref:n}},l.children))}function Ft({title:e,titleId:t,...n},r){return M.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`,"data-slot":`icon`,ref:r,"aria-labelledby":t},n),e?M.createElement(`title`,{id:t},e):null,M.createElement(`path`,{fillRule:`evenodd`,d:`M7.5 3.75A1.5 1.5 0 0 0 6 5.25v13.5a1.5 1.5 0 0 0 1.5 1.5h6a1.5 1.5 0 0 0 1.5-1.5V15a.75.75 0 0 1 1.5 0v3.75a3 3 0 0 1-3 3h-6a3 3 0 0 1-3-3V5.25a3 3 0 0 1 3-3h6a3 3 0 0 1 3 3V9A.75.75 0 0 1 15 9V5.25a1.5 1.5 0 0 0-1.5-1.5h-6Zm10.72 4.72a.75.75 0 0 1 1.06 0l3 3a.75.75 0 0 1 0 1.06l-3 3a.75.75 0 1 1-1.06-1.06l1.72-1.72H9a.75.75 0 0 1 0-1.5h10.94l-1.72-1.72a.75.75 0 0 1 0-1.06Z`,clipRule:`evenodd`}))}var It=M.forwardRef(Ft);function Lt({title:e,titleId:t,...n},r){return M.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`,"data-slot":`icon`,ref:r,"aria-labelledby":t},n),e?M.createElement(`title`,{id:t},e):null,M.createElement(`path`,{fillRule:`evenodd`,d:`M16.28 11.47a.75.75 0 0 1 0 1.06l-7.5 7.5a.75.75 0 0 1-1.06-1.06L14.69 12 7.72 5.03a.75.75 0 0 1 1.06-1.06l7.5 7.5Z`,clipRule:`evenodd`}))}var Rt=M.forwardRef(Lt);function zt({title:e,titleId:t,...n},r){return M.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`,"data-slot":`icon`,ref:r,"aria-labelledby":t},n),e?M.createElement(`title`,{id:t},e):null,M.createElement(`path`,{fillRule:`evenodd`,d:`M11.078 2.25c-.917 0-1.699.663-1.85 1.567L9.05 4.889c-.02.12-.115.26-.297.348a7.493 7.493 0 0 0-.986.57c-.166.115-.334.126-.45.083L6.3 5.508a1.875 1.875 0 0 0-2.282.819l-.922 1.597a1.875 1.875 0 0 0 .432 2.385l.84.692c.095.078.17.229.154.43a7.598 7.598 0 0 0 0 1.139c.015.2-.059.352-.153.43l-.841.692a1.875 1.875 0 0 0-.432 2.385l.922 1.597a1.875 1.875 0 0 0 2.282.818l1.019-.382c.115-.043.283-.031.45.082.312.214.641.405.985.57.182.088.277.228.297.35l.178 1.071c.151.904.933 1.567 1.85 1.567h1.844c.916 0 1.699-.663 1.85-1.567l.178-1.072c.02-.12.114-.26.297-.349.344-.165.673-.356.985-.57.167-.114.335-.125.45-.082l1.02.382a1.875 1.875 0 0 0 2.28-.819l.923-1.597a1.875 1.875 0 0 0-.432-2.385l-.84-.692c-.095-.078-.17-.229-.154-.43a7.614 7.614 0 0 0 0-1.139c-.016-.2.059-.352.153-.43l.84-.692c.708-.582.891-1.59.433-2.385l-.922-1.597a1.875 1.875 0 0 0-2.282-.818l-1.02.382c-.114.043-.282.031-.449-.083a7.49 7.49 0 0 0-.985-.57c-.183-.087-.277-.227-.297-.348l-.179-1.072a1.875 1.875 0 0 0-1.85-1.567h-1.843ZM12 15.75a3.75 3.75 0 1 0 0-7.5 3.75 3.75 0 0 0 0 7.5Z`,clipRule:`evenodd`}))}var Bt=M.forwardRef(zt);function Vt({title:e,titleId:t,...n},r){return M.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`,"data-slot":`icon`,ref:r,"aria-labelledby":t},n),e?M.createElement(`title`,{id:t},e):null,M.createElement(`path`,{d:`M11.47 3.841a.75.75 0 0 1 1.06 0l8.69 8.69a.75.75 0 1 0 1.06-1.061l-8.689-8.69a2.25 2.25 0 0 0-3.182 0l-8.69 8.69a.75.75 0 1 0 1.061 1.06l8.69-8.689Z`}),M.createElement(`path`,{d:`m12 5.432 8.159 8.159c.03.03.06.058.091.086v6.198c0 1.035-.84 1.875-1.875 1.875H15a.75.75 0 0 1-.75-.75v-4.5a.75.75 0 0 0-.75-.75h-3a.75.75 0 0 0-.75.75V21a.75.75 0 0 1-.75.75H5.625a1.875 1.875 0 0 1-1.875-1.875v-6.198a2.29 2.29 0 0 0 .091-.086L12 5.432Z`}))}var Ht=M.forwardRef(Vt);function Ut({title:e,titleId:t,...n},r){return M.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`,"data-slot":`icon`,ref:r,"aria-labelledby":t},n),e?M.createElement(`title`,{id:t},e):null,M.createElement(`path`,{fillRule:`evenodd`,d:`M19.449 8.448 16.388 11a4.52 4.52 0 0 1 0 2.002l3.061 2.55a8.275 8.275 0 0 0 0-7.103ZM15.552 19.45 13 16.388a4.52 4.52 0 0 1-2.002 0l-2.55 3.061a8.275 8.275 0 0 0 7.103 0ZM4.55 15.552 7.612 13a4.52 4.52 0 0 1 0-2.002L4.551 8.45a8.275 8.275 0 0 0 0 7.103ZM8.448 4.55 11 7.612a4.52 4.52 0 0 1 2.002 0l2.55-3.061a8.275 8.275 0 0 0-7.103 0Zm8.657-.86a9.776 9.776 0 0 1 1.79 1.415 9.776 9.776 0 0 1 1.414 1.788 9.764 9.764 0 0 1 0 10.211 9.777 9.777 0 0 1-1.415 1.79 9.777 9.777 0 0 1-1.788 1.414 9.764 9.764 0 0 1-10.212 0 9.776 9.776 0 0 1-1.788-1.415 9.776 9.776 0 0 1-1.415-1.788 9.764 9.764 0 0 1 0-10.212 9.774 9.774 0 0 1 1.415-1.788A9.774 9.774 0 0 1 6.894 3.69a9.764 9.764 0 0 1 10.211 0ZM14.121 9.88a2.985 2.985 0 0 0-1.11-.704 3.015 3.015 0 0 0-2.022 0 2.985 2.985 0 0 0-1.11.704c-.326.325-.56.705-.704 1.11a3.015 3.015 0 0 0 0 2.022c.144.405.378.785.704 1.11.325.326.705.56 1.11.704.652.233 1.37.233 2.022 0a2.985 2.985 0 0 0 1.11-.704c.326-.325.56-.705.704-1.11a3.016 3.016 0 0 0 0-2.022 2.985 2.985 0 0 0-.704-1.11Z`,clipRule:`evenodd`}))}var Wt=M.forwardRef(Ut);function Gt({title:e,titleId:t,...n},r){return M.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`,"data-slot":`icon`,ref:r,"aria-labelledby":t},n),e?M.createElement(`title`,{id:t},e):null,M.createElement(`path`,{fillRule:`evenodd`,d:`M12 3.75a.75.75 0 0 1 .75.75v6.75h6.75a.75.75 0 0 1 0 1.5h-6.75v6.75a.75.75 0 0 1-1.5 0v-6.75H4.5a.75.75 0 0 1 0-1.5h6.75V4.5a.75.75 0 0 1 .75-.75Z`,clipRule:`evenodd`}))}var Kt=M.forwardRef(Gt);function qt({title:e,titleId:t,...n},r){return M.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`,"data-slot":`icon`,ref:r,"aria-labelledby":t},n),e?M.createElement(`title`,{id:t},e):null,M.createElement(`path`,{fillRule:`evenodd`,d:`M12.516 2.17a.75.75 0 0 0-1.032 0 11.209 11.209 0 0 1-7.877 3.08.75.75 0 0 0-.722.515A12.74 12.74 0 0 0 2.25 9.75c0 5.942 4.064 10.933 9.563 12.348a.749.749 0 0 0 .374 0c5.499-1.415 9.563-6.406 9.563-12.348 0-1.39-.223-2.73-.635-3.985a.75.75 0 0 0-.722-.516l-.143.001c-2.996 0-5.717-1.17-7.734-3.08Zm3.094 8.016a.75.75 0 1 0-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 0 0-1.06 1.06l2.25 2.25a.75.75 0 0 0 1.14-.094l3.75-5.25Z`,clipRule:`evenodd`}))}var Jt=M.forwardRef(qt);function Yt({title:e,titleId:t,...n},r){return M.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,"data-slot":`icon`,ref:r,"aria-labelledby":t},n),e?M.createElement(`title`,{id:t},e):null,M.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M8.25 15 12 18.75 15.75 15m-7.5-6L12 5.25 15.75 9`}))}var Xt=M.forwardRef(Yt),Y=T(pe(),1);function Zt({size:e=`18px`,...t}){return(0,Y.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:e,height:e,viewBox:`0 0 24 24`,fill:`currentColor`,...t,children:[(0,Y.jsx)(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),(0,Y.jsx)(`path`,{d:`M12 2l.117 .007a1 1 0 0 1 .876 .876l.007 .117v4l.005 .15a2 2 0 0 0 1.838 1.844l.157 .006h4l.117 .007a1 1 0 0 1 .876 .876l.007 .117v9a3 3 0 0 1 -2.824 2.995l-.176 .005h-10a3 3 0 0 1 -2.995 -2.824l-.005 -.176v-14a3 3 0 0 1 2.824 -2.995l.176 -.005zm2 15h-4a1 1 0 0 0 0 2h4a1 1 0 0 0 0 -2m-2 -7a1 1 0 0 0 -1 1v1h-1a1 1 0 0 0 0 2h1v1a1 1 0 0 0 2 0v-1h1a1 1 0 0 0 0 -2h-1v-1a1 1 0 0 0 -1 -1`}),(0,Y.jsx)(`path`,{d:`M19 7h-4l-.001 -4.001z`})]})}var Qt=Zt,$t=({src:e=null,isSquare:t=!1,size:n=`md`,initials:r,alt:i=``,className:a,...o})=>(0,Y.jsxs)(`span`,{"data-slot":`avatar`,...o,className:S(`inline-grid size-(--avatar-size) shrink-0 align-middle outline-1 outline-fg/(--ring-opacity) -outline-offset-1 [--avatar-radius:20%] [--ring-opacity:20%] *:col-start-1 *:row-start-1 *:size-(--avatar-size)`,n===`xs`&&`[--avatar-size:--spacing(5)]`,n===`sm`&&`[--avatar-size:--spacing(6)]`,n===`md`&&`[--avatar-size:--spacing(8)]`,n===`lg`&&`[--avatar-size:--spacing(10)]`,n===`xl`&&`[--avatar-size:--spacing(12)]`,n===`2xl`&&`[--avatar-size:--spacing(14)]`,n===`3xl`&&`[--avatar-size:--spacing(16)]`,n===`4xl`&&`[--avatar-size:--spacing(20)]`,n===`5xl`&&`[--avatar-size:--spacing(24)]`,n===`6xl`&&`[--avatar-size:--spacing(28)]`,n===`7xl`&&`[--avatar-size:--spacing(32)]`,n===`8xl`&&`[--avatar-size:--spacing(36)]`,n===`9xl`&&`[--avatar-size:--spacing(32)]`,t?`rounded-(--avatar-radius) *:rounded-(--avatar-radius)`:`rounded-full *:rounded-full`,a),children:[r&&(0,Y.jsxs)(`svg`,{className:`size-full select-none fill-current p-[5%] font-md text-[48px] uppercase`,viewBox:`0 0 100 100`,"aria-hidden":i?void 0:`true`,children:[i&&(0,Y.jsx)(`title`,{children:i}),(0,Y.jsx)(`text`,{x:`50%`,y:`50%`,alignmentBaseline:`middle`,dominantBaseline:`middle`,textAnchor:`middle`,dy:`.125em`,children:r})]}),e&&(0,Y.jsx)(`img`,{className:`size-full object-cover object-center`,src:e,alt:i})]}),en=m({base:[`fixed z-50 grid gap-4 border-muted-fg/20 bg-overlay text-overlay-fg shadow-lg dark:border-border`,`transform-gpu transition ease-in-out will-change-transform`],variants:{isEntering:{true:`fade-in animate-in duration-500`},isExiting:{true:`fade-in animate-out duration-300`},side:{top:`entering:slide-in-from-top exiting:slide-out-to-top inset-x-0 top-0 rounded-b-2xl border-b`,bottom:`entering:slide-in-from-bottom exiting:slide-out-to-bottom inset-x-0 bottom-0 rounded-t-2xl border-t`,left:`entering:slide-in-from-left exiting:slide-out-to-left-80 inset-y-0 left-0 h-auto w-3/4 overflow-y-auto border-r sm:max-w-80`,right:`entering:slide-in-from-right exiting:slide-out-to-right-80 inset-y-0 right-0 h-auto w-3/4 overflow-y-auto border-l sm:max-w-80`},isFloat:{false:`border-fg/20 dark:border-border`,true:`ring-fg/5 dark:ring-border`}},compoundVariants:(e=>e.map(e=>({side:e,isFloat:!0,className:e===`top`?`top-2 inset-x-2 rounded-lg ring-1 border-b-0`:e===`bottom`?`bottom-2 inset-x-2 rounded-lg ring-1 border-t-0`:e===`left`?`left-2 inset-y-2 rounded-lg ring-1 border-r-0`:`right-2 inset-y-2 rounded-lg ring-1 border-l-0`})))([`top`,`bottom`,`left`,`right`])}),tn=({className:e,isBlurred:t=!1,isDismissable:n,side:r=`right`,role:i=`dialog`,closeButton:a=!0,isFloat:o=!0,overlay:c,children:l,...f})=>{let p=n??i!==`alertdialog`;return(0,Y.jsx)(ae,{isDismissable:p,className:({isExiting:e,isEntering:n})=>s(`fixed inset-0 z-50 h-(--page-height) w-screen overflow-hidden bg-black/15`,n&&`fade-in animate-in duration-500`,e&&`fade-out animate-out duration-300`,t&&`backdrop-blur-sm backdrop-filter`),...f,children:(0,Y.jsx)(h,{className:O(e,(e,t)=>en({...t,side:r,isFloat:o,className:e})),children:(0,Y.jsx)(d,{"aria-label":f[`aria-label`],role:i,children:e=>(0,Y.jsxs)(Y.Fragment,{children:[typeof l==`function`?l(e):l,a&&(0,Y.jsx)(u,{className:`top-2.5 right-2.5`,isDismissable:p})]})})})})},nn=m({base:[`group origin-(--trigger-anchor-point) rounded-lg border border-(--tooltip-border) px-2.5 py-1.5 text-sm/6 will-change-transform [--tooltip-border:var(--color-muted-fg)]/30 dark:shadow-none *:[strong]:font-medium`],variants:{inverse:{true:`border-transparent bg-fg text-bg **:[.text-muted-fg]:text-bg/80`,false:`bg-overlay text-overlay-fg`},isEntering:{true:[`fade-in animate-in`,`placement-left:slide-in-from-right-1 placement-right:slide-in-from-left-1 placement-top:slide-in-from-bottom-1 placement-bottom:slide-in-from-top-1`]},isExiting:{true:[`fade-in direction-reverse animate-in`,`placement-left:slide-out-to-right-1 placement-right:slide-out-to-left-1 placement-top:slide-out-to-bottom-1 placement-bottom:slide-out-to-top-1`]}},defaultVariants:{inverse:!1}}),rn=e=>(0,Y.jsx)(Mt,{...e}),an=({offset:e=10,arrow:t=!0,inverse:n,children:r,...i})=>(0,Y.jsxs)(Nt,{...i,offset:e,className:O(i.className,(e,t)=>nn({...t,inverse:n,className:e})),children:[t&&(0,Y.jsx)(me,{className:`group`,children:(0,Y.jsx)(`svg`,{width:12,height:12,viewBox:`0 0 12 12`,className:s(`block group-placement-bottom:rotate-180 group-placement-left:-rotate-90 group-placement-right:rotate-90 forced-colors:fill-[Canvas] forced-colors:stroke-[ButtonBorder]`,n?`fill-fg stroke-transparent`:`fill-overlay stroke-(--tooltip-border)`),children:(0,Y.jsx)(`path`,{d:`M0 0 L6 6 L12 0`})})}),r]}),on=`22rem`,sn=`3.25rem`,cn=`sidebar_state`,ln=3600*24*7,un=(0,M.createContext)(null),X=()=>{let e=(0,M.use)(un);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e},dn=({defaultOpen:e=!0,isOpen:t,onOpenChange:n,className:r,style:i,children:a,shortcut:o=`b`,ref:s,...c})=>{let[l,u]=(0,M.useState)(!1),[d,f]=(0,M.useState)(e),p=t??d,m=(0,M.useCallback)(e=>{let t=typeof e==`function`?e(p):e;n?n(t):f(t),document.cookie=`${cn}=${t}; path=/; max-age=${ln}`},[n,p]),{isMobile:h,device:g}=Re(),_=(0,M.useCallback)(()=>h?u(e=>!e):m(e=>!e),[h,m]);(0,M.useEffect)(()=>{let e=e=>{e.key===o&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),_())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[_,o]);let v=p?`expanded`:`collapsed`,y=(0,M.useMemo)(()=>({state:v,open:p,setOpen:m,isMobile:h??!1,isOpenOnMobile:l,setIsOpenOnMobile:u,toggleSidebar:_}),[v,p,m,h,l,_]);return g===null?null:(0,Y.jsx)(un,{value:y,children:(0,Y.jsx)(`div`,{style:{"--sidebar-width":on,"--sidebar-width-dock":sn,...i},className:S(`@container **:data-[slot=icon]:shrink-0`,`flex w-full text-sidebar-fg`,`group/sidebar-root peer/sidebar-root has-data-[intent=inset]:bg-sidebar dark:has-data-[intent=inset]:bg-bg`,r),ref:s,...c,children:a})})},fn=({children:e,closeButton:t=!0,collapsible:n=`hidden`,side:r=`left`,intent:i=`default`,className:a,...o})=>{let{isMobile:c,state:l,isOpenOnMobile:u,setIsOpenOnMobile:d}=X();return n===`none`?(0,Y.jsx)(`div`,{"data-intent":i,"data-collapsible":`none`,"data-slot":`sidebar`,className:S(`flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-fg`,a),...o,children:e}):c?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`span`,{className:`sr-only`,"aria-hidden":!0,"data-intent":i}),(0,Y.jsx)(tn,{isOpen:u,onOpenChange:d,closeButton:t,"aria-label":`Sidebar`,"data-slot":`sidebar`,"data-intent":`default`,className:`w-(--sidebar-width) entering:blur-in exiting:blur-out [--sidebar-width:18rem] has-data-[slot=calendar]:[--sidebar-width:23rem]`,side:r,children:e})]}):(0,Y.jsxs)(`div`,{"data-state":l,"data-collapsible":l===`collapsed`?n:``,"data-intent":i,"data-side":r,"data-slot":`sidebar`,className:`group peer hidden text-sidebar-fg md:block`,...o,children:[(0,Y.jsx)(`div`,{"data-slot":`sidebar-gap`,"aria-hidden":`true`,className:S([`w-(--sidebar-width) group-data-[collapsible=hidden]:w-0`,`group-data-[side=right]:rotate-180`,`relative h-svh bg-transparent transition-[width] duration-200 ease-linear`,i===`default`&&`group-data-[collapsible=dock]:w-(--sidebar-width-dock)`,i===`float`&&`group-data-[collapsible=dock]:w-[calc(var(--sidebar-width-dock)+--spacing(4))]`,i===`inset`&&`group-data-[collapsible=dock]:w-[calc(var(--sidebar-width-dock)+--spacing(2))]`])}),(0,Y.jsx)(`div`,{"data-slot":`sidebar-container`,className:S(`fixed inset-y-0 z-10 hidden w-(--sidebar-width) bg-sidebar`,`not-has-data-[slot=sidebar-footer]:pb-2`,`transition-[left,right,width] duration-200 ease-linear`,`md:flex`,r===`left`&&`left-0 group-data-[collapsible=hidden]:left-[calc(var(--sidebar-width)*-1)]`,r===`right`&&`right-0 group-data-[collapsible=hidden]:right-[calc(var(--sidebar-width)*-1)]`,i===`float`&&`bg-bg p-2 group-data-[collapsible=dock]:w-[calc(--spacing(4)+2px)]`,i===`inset`&&`bg-sidebar group-data-[collapsible=dock]:w-[calc(var(--sidebar-width-dock)+--spacing(2)+2px)] dark:bg-bg`,i===`default`&&[`group-data-[collapsible=dock]:w-(--sidebar-width-dock)`,`border-sidebar-border group-data-[side=left]:border-r group-data-[side=right]:border-l`],a),...o,children:(0,Y.jsx)(`div`,{"data-sidebar":`default`,"data-slot":`sidebar-inner`,className:s(`flex h-full w-full flex-col text-sidebar-fg`,`group-data-[intent=inset]:bg-sidebar dark:group-data-[intent=inset]:bg-bg`,`group-data-[intent=float]:rounded-lg group-data-[intent=float]:border group-data-[intent=float]:border-sidebar-border group-data-[intent=float]:bg-sidebar group-data-[intent=float]:shadow-xs`),children:e})})]})},pn=({className:e,ref:t,...n})=>{let{state:r}=X();return(0,Y.jsx)(`div`,{ref:t,"data-slot":`sidebar-header`,className:S(`flex flex-col gap-2 p-2.5 [.border-b]:border-sidebar-border`,`in-data-[intent=inset]:p-4`,r===`collapsed`?`items-center p-2.5`:`p-4`,e),...n})},mn=({className:e,...t})=>(0,Y.jsx)(`div`,{"data-slot":`sidebar-footer`,className:S([`mt-auto flex shrink-0 items-center justify-center p-4 **:data-[slot=chevron]:text-muted-fg`,`in-data-[intent=inset]:px-6 in-data-[intent=inset]:py-4`,e]),...t}),hn=({className:e,...t})=>{let{state:n}=X();return(0,Y.jsx)(`div`,{"data-slot":`sidebar-content`,className:S(`flex min-h-0 flex-1 scroll-mb-96 flex-col overflow-auto *:data-[slot=sidebar-section]:border-l-0`,n===`collapsed`?`items-center`:`mask-b-from-95%`,e),...t,children:t.children})},gn=({className:e,...t})=>{let{state:n,isMobile:r}=X(),i=n===`collapsed`&&!r;return(0,Y.jsx)(`section`,{"data-slot":`sidebar-section-group`,className:S(`flex w-full min-w-0 flex-col gap-y-0.5`,i&&`items-center justify-center`,e),...t})},Z=({className:e,...t})=>{let{state:n}=X();return(0,Y.jsxs)(`div`,{"data-slot":`sidebar-section`,className:S(`col-span-full flex min-w-0 flex-col gap-y-0.5 **:data-[slot=sidebar-section]:**:gap-y-0`,`in-data-[state=collapsed]:p-2 p-4`,e),...t,children:[n!==`collapsed`&&`label`in t&&(0,Y.jsx)(ke,{className:`group-data-[collapsible=dock]:-mt-8 mb-1 flex shrink-0 items-center rounded-md px-2 font-medium text-sidebar-fg/70 text-xs/6 outline-none ring-sidebar-ring transition-[margin,opa] duration-200 ease-linear *:data-[slot=icon]:size-4 *:data-[slot=icon]:shrink-0 group-data-[collapsible=dock]:opacity-0`,children:t.label}),(0,Y.jsx)(`div`,{"data-slot":`sidebar-section-inner`,className:`grid grid-cols-[auto_1fr] gap-y-0.5 in-data-[state=collapsed]:gap-y-1.5`,children:t.children})]})},Q=({isCurrent:e,tooltip:t,children:r,badge:i,className:a,ref:o,...s})=>{let{state:c,isMobile:l}=X(),u=c===`collapsed`&&!l,d=(0,Y.jsx)(n,{ref:o,"data-slot":`sidebar-item`,"aria-current":e?`page`:void 0,className:O(a,(t,{isPressed:n,isFocusVisible:r,isHovered:i,isDisabled:a})=>S([`href`in s?`cursor-pointer`:`cursor-default`,`w-full min-w-0 items-center rounded-lg text-left font-medium text-base/6 text-sidebar-fg`,`group/sidebar-item relative col-span-full overflow-hidden focus-visible:outline-hidden`,`**:data-[slot=icon]:shrink-0 [&_[data-slot='icon']:not([class*='size-'])]:size-5 sm:[&_[data-slot='icon']:not([class*='size-'])]:size-4 [&_[data-slot='icon']:not([class*='text-'])]:text-muted-fg`,`**:last:data-[slot=icon]:size-5 sm:**:last:data-[slot=icon]:size-4`,`[&_[data-slot='icon']:not([class*='size-'])]:size-4 [&_[data-slot='icon']:not([class*='size-'])]:*:size-5`,`*:data-[slot=avatar]:*:size-5 *:data-[slot=avatar]:size-5`,`has-[[data-slot=avatar]]:has-[[data-slot=sidebar-label]]:gap-x-2 has-[[data-slot=icon]]:has-[[data-slot=sidebar-label]]:gap-x-2`,`grid grid-cols-[auto_1fr_1.5rem_0.5rem_auto] **:last:data-[slot=icon]:ml-auto supports-[grid-template-columns:subgrid]:grid-cols-subgrid sm:text-sm/5`,`p-2 has-[a]:p-0`,`[--sidebar-current-bg:var(--color-sidebar-primary)] [--sidebar-current-fg:var(--color-sidebar-primary-fg)]`,e&&`font-medium text-(--sidebar-current-fg) hover:bg-(--sidebar-current-bg) hover:text-(--sidebar-current-fg) [&_.text-muted-fg]:text-fg/80 [&_[data-slot='icon']:not([class*='text-'])]:text-(--sidebar-current-fg) hover:[&_[data-slot='icon']:not([class*='text-'])]:text-(--sidebar-current-fg)`,r&&`inset-ring inset-ring-sidebar-ring outline-hidden`,(n||i)&&`bg-sidebar-accent text-sidebar-accent-fg [&_[data-slot='icon']:not([class*='text-'])]:text-sidebar-accent-fg`,a&&`opacity-50`,t])),...s,children:e=>(0,Y.jsxs)(Y.Fragment,{children:[typeof r==`function`?r({...e,isCollapsed:u}):r,i&&(c===`collapsed`?(0,Y.jsx)(`div`,{"aria-hidden":!0,className:`absolute top-1 right-1 size-1.5 rounded-full bg-primary`}):(0,Y.jsx)(`span`,{"data-slot":`sidebar-badge`,className:`-translate-y-1/2 absolute inset-ring-1 inset-ring-sidebar-border inset-y-1/2 right-1.5 h-5.5 w-auto rounded-full bg-fg/5 px-2 text-[10px]/5.5 group-hover/sidebar-item:inset-ring-muted-fg/30 group-data-current:inset-ring-transparent`,children:i}))]})});return typeof t==`string`&&(t={children:t}),(0,Y.jsxs)(rn,{delay:0,children:[d,(0,Y.jsx)(an,{className:`**:data-[slot=icon]:hidden **:data-[slot=sidebar-label-mask]:hidden`,inverse:!0,placement:`right`,arrow:!0,hidden:!u||l||!t,...t})]})},_n=({className:e,ref:t,...r})=>(0,Y.jsx)(n,{ref:t,className:g(`col-span-full min-w-0 shrink-0 items-center p-2 focus:outline-hidden`,`grid grid-cols-[auto_1fr_1.5rem_0.5rem_auto] supports-[grid-template-columns:subgrid]:grid-cols-subgrid`,e),...r}),vn=({className:e,ref:t,...n})=>(0,Y.jsx)(`main`,{"data-slot":`sidebar-inset`,ref:t,className:S(`relative flex w-full flex-1 flex-col bg-bg lg:min-w-0`,`group-has-data-[intent=inset]/sidebar-root:border group-has-data-[intent=inset]/sidebar-root:border-sidebar-border group-has-data-[intent=inset]/sidebar-root:bg-overlay`,`md:group-has-data-[intent=inset]/sidebar-root:m-2`,`md:group-has-data-[side=left]:group-has-data-[intent=inset]/sidebar-root:ml-0`,`md:group-has-data-[side=right]:group-has-data-[intent=inset]/sidebar-root:mr-0`,`md:group-has-data-[intent=inset]/sidebar-root:rounded-2xl`,`md:group-has-data-[intent=inset]/sidebar-root:peer-data-[state=collapsed]:ml-2`,e),...n}),yn=({onPress:e,className:t,children:n,...r})=>{let{toggleSidebar:i}=X();return(0,Y.jsx)(v,{"aria-label":r[`aria-label`]||`Toggle Sidebar`,"data-slot":`sidebar-trigger`,intent:r.intent||`plain`,size:r.size||`sq-sm`,className:g(`shrink-0`,t),onPress:t=>{e?.(t),i()},...r,children:n||(0,Y.jsx)(Y.Fragment,{children:(0,Y.jsxs)(`svg`,{"data-slot":`icon`,xmlns:`http://www.w3.org/2000/svg`,fill:`currentColor`,viewBox:`0 0 16 16`,children:[(0,Y.jsx)(`path`,{d:`M14 2a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1zM2 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V3a2 2 0 0 0-2-2z`}),(0,Y.jsx)(`path`,{d:`M3 4a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1z`})]})})})},bn=({className:e,ref:t,...n})=>{let{toggleSidebar:r}=X();return n.children?n.children:(0,Y.jsx)(`button`,{ref:t,"data-slot":`sidebar-rail`,"aria-label":`Toggle Sidebar`,title:`Toggle Sidebar`,tabIndex:-1,onClick:r,className:S(`-translate-x-1/2 group-data-[side=left]:-right-4 absolute inset-y-0 z-20 hidden w-4 outline-hidden transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-transparent group-data-[side=right]:left-0 sm:flex`,`in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize`,`[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize`,`group-data-[collapsible=hidden]:translate-x-0 group-data-[collapsible=hidden]:hover:bg-sidebar-accent group-data-[collapsible=hidden]:after:left-full`,`[[data-side=left][data-collapsible=hidden]_&]:-right-2 [[data-side=right][data-collapsible=hidden]_&]:-left-2`,e),...n})},$=({className:e,ref:t,...n})=>{let{state:r,isMobile:i}=X();return r===`collapsed`&&!i?null:(0,Y.jsx)(Ie,{"data-slot":`sidebar-label`,tabIndex:-1,ref:t,slot:`label`,className:S(`col-start-2 overflow-hidden outline-hidden`,e),...n,children:n.children})},xn=({isSticky:e=!1,className:t,...n})=>(0,Y.jsx)(`nav`,{"data-slot":`sidebar-nav`,className:S(`isolate flex items-center justify-between gap-x-2 px-(--container-padding,--spacing(4)) py-2.5 text-navbar-fg sm:justify-start sm:px-(--gutter,--spacing(4)) md:w-full`,e&&`static top-0 z-40 group-has-data-[intent=default]/sidebar-root:sticky`,t),...n}),Sn=({alwaysVisible:e=!1,className:t,...n})=>(0,Y.jsx)(b,{className:g(!e&&`opacity-0 pressed:opacity-100 group-hover/sidebar-item:opacity-100 group-focus-visible/sidebar-item:opacity-100 group/sidebar-item:pressed:opacity-100`,`absolute right-0 flex h-full w-[calc(var(--sidebar-width)-90%)] items-center justify-end pr-2.5 outline-hidden`,`**:data-[slot=icon]:shrink-0 [&_[data-slot='icon']:not([class*='size-'])]:size-5 sm:[&_[data-slot='icon']:not([class*='size-'])]:size-4`,`pressed:text-fg text-muted-fg hover:text-fg`,t),...n});function Cn(e){let t=e.split(`/`);return t[t.length-1]||e}function wn(){let{data:e}=Me(),t=e?Cn(e.worktree):`Loading...`;return(0,Y.jsxs)(`div`,{className:`flex items-center gap-2 px-2 py-1.5`,children:[(0,Y.jsx)(Oe,{className:`shrink-0`}),(0,Y.jsx)(`div`,{className:`text-sm font-medium`,children:t})]})}function Tn(e,t=40){if(e.length<=t)return e;let n=Math.floor((t-3)/2);return`${e.slice(0,n)}...${e.slice(-n)}`}function En(t){let[r,a]=(0,M.useState)(!1),o=ee(),s=w(e=>e.instance),{data:l}=Te(),u=l?.hostname??`Loading...`,{data:d,mutate:f}=ge(),m=xe(),h=ue(),g=d??[],{data:_}=he(),v=(0,M.useMemo)(()=>{if(!_?.diff)return 0;try{return Le(_.diff).length}catch{return 0}},[_?.diff]);async function y(){if(!r){a(!0);try{let e=await m();await f(),x.capture(`session_created`),p.success(`Session created`),o({to:`/session/$id`,params:{id:e.id}})}catch(e){console.error(`Failed to create session:`,e),p.error(`Failed to create session`)}finally{a(!1)}}}let b=i({from:`/_app/session/$id`,shouldThrow:!1})?.params?.id;async function ne(e){try{await h(e),await f(),p.success(`Session deleted`),b===e&&o({to:`/`})}catch(e){console.error(`Failed to delete session:`,e),p.error(`Failed to delete session`)}}return(0,Y.jsxs)(fn,{...t,children:[(0,Y.jsx)(pn,{children:(0,Y.jsxs)(n,{href:`/`,className:`flex items-center gap-x-2`,children:[(0,Y.jsx)(`img`,{src:`/logo.svg`,alt:`OpenCode Portal`,className:`size-6`}),(0,Y.jsxs)($,{className:`font-medium`,children:[`OpenCode `,(0,Y.jsx)(`span`,{className:`text-muted-fg`,children:`Portal`})]})]})}),(0,Y.jsx)(hn,{children:(0,Y.jsxs)(gn,{children:[(0,Y.jsx)(Z,{children:(0,Y.jsx)(wn,{})}),(0,Y.jsxs)(Z,{children:[(0,Y.jsxs)(Q,{tooltip:`New Session`,onPress:y,className:`cursor-pointer gap-x-2`,children:[(0,Y.jsx)(Kt,{className:`size-4 shrink-0`,"data-slot":`icon`}),(0,Y.jsx)($,{children:r?`Creating...`:`New Session`})]}),(0,Y.jsxs)(Q,{tooltip:`View Git Diff`,href:`/diff`,onPress:()=>x.capture(`diff_viewed`),className:`cursor-pointer gap-x-2`,badge:v>0?v:void 0,children:[(0,Y.jsx)(Qt,{className:`size-4 shrink-0`,"data-slot":`icon`}),(0,Y.jsx)($,{children:`Diff`})]})]}),(0,Y.jsx)(Z,{label:`Sessions`,children:g.map(t=>(0,Y.jsx)(Q,{tooltip:t.title,children:({isCollapsed:n,isFocused:r})=>(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(_n,{href:`/session/${t.id}`,children:(0,Y.jsx)($,{children:Tn(t.title)})}),(!n||r)&&(0,Y.jsxs)(D,{children:[(0,Y.jsx)(Sn,{"aria-label":`Session options`,children:(0,Y.jsx)(e,{})}),(0,Y.jsx)(A,{popover:{offset:0,placement:`right top`},children:(0,Y.jsxs)(k,{intent:`danger`,onAction:()=>ne(t.id),children:[(0,Y.jsx)(ye,{}),`Delete Session`]})})]})]})},t.id))})]})}),(0,Y.jsx)(mn,{className:`flex flex-row justify-between gap-4 group-data-[state=collapsed]:flex-col`,children:(0,Y.jsxs)(D,{children:[(0,Y.jsxs)(Ne,{className:`flex w-full items-center justify-between`,"aria-label":`Profile`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-x-2`,children:[(0,Y.jsx)($t,{className:`size-8 *:size-8 group-data-[state=collapsed]:size-6 group-data-[state=collapsed]:*:size-6`,isSquare:!0,initials:u.slice(0,2).toUpperCase()}),(0,Y.jsx)(`div`,{className:`in-data-[collapsible=dock]:hidden text-sm`,children:(0,Y.jsx)($,{children:u})})]}),(0,Y.jsx)(Xt,{"data-slot":`chevron`})]}),(0,Y.jsxs)(A,{className:`in-data-[sidebar-collapsible=collapsed]:min-w-56 min-w-(--trigger-width)`,placement:`bottom right`,children:[(0,Y.jsx)(te,{children:(0,Y.jsxs)(ce,{separator:!0,children:[(0,Y.jsx)(`span`,{className:`block`,children:u}),s&&(0,Y.jsx)(`span`,{className:`block text-muted-fg text-xs`,children:s.name})]})}),(0,Y.jsxs)(k,{href:`#dashboard`,children:[(0,Y.jsx)(Ht,{}),`Dashboard`]}),(0,Y.jsxs)(k,{href:`/settings`,children:[(0,Y.jsx)(Bt,{}),`Settings`]}),(0,Y.jsxs)(k,{href:`#security`,children:[(0,Y.jsx)(Jt,{}),`Security`]}),(0,Y.jsx)(c,{}),(0,Y.jsxs)(k,{href:`#contact`,children:[(0,Y.jsx)(Wt,{}),`Customer Support`]}),(0,Y.jsx)(c,{}),(0,Y.jsxs)(k,{href:`#logout`,children:[(0,Y.jsx)(It,{}),`Log out`]})]})]})}),(0,Y.jsx)(bn,{})]})}var Dn=(0,M.createContext)({separator:`chevron`}),On=({className:e,...t})=>(0,Y.jsx)(Dn,{value:{separator:t.separator},children:(0,Y.jsx)(wt,{...t,className:S(`flex items-center gap-2`,e)})}),kn=({href:e,separator:t=!0,className:r,...i})=>{let{separator:a}=(0,M.use)(Dn);t=a??t;let o=t===!0?`chevron`:t;return(0,Y.jsx)(Et,{className:g(`flex items-center gap-2 text-sm`,r),"data-slot":`breadcrumb-item`,...i,children:({isCurrent:r})=>(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(n,{href:e,...i}),!r&&t!==!1&&(0,Y.jsx)(An,{separator:o})]})})},An=({separator:e=`chevron`})=>(0,Y.jsxs)(`span`,{className:`*:shrink-0 *:text-muted-fg *:data-[slot=icon]:size-3.5`,children:[e===`chevron`&&(0,Y.jsx)(Rt,{}),e===`slash`&&(0,Y.jsx)(`span`,{className:`text-muted-fg`,children:`/`})]});function jn({size:e=`24px`,...t}){return(0,Y.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:e,height:e,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,...t,children:[(0,Y.jsx)(`title`,{children:`Arrow Down`}),(0,Y.jsx)(`path`,{d:`M12 7v14`}),(0,Y.jsx)(`path`,{d:`M9 18l3 3l3 -3`}),(0,Y.jsx)(`path`,{d:`M12 7a2 2 0 1 0 0 -4a2 2 0 0 0 0 4`})]})}function Mn({size:e=`24px`,...t}){return(0,Y.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:e,height:e,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,...t,children:[(0,Y.jsx)(`title`,{children:`Arrow Up`}),(0,Y.jsx)(`path`,{d:`M12 17v-14`}),(0,Y.jsx)(`path`,{d:`M15 6l-3 -3l-3 3`}),(0,Y.jsx)(`path`,{d:`M12 17a2 2 0 1 0 0 4a2 2 0 0 0 0 -4`})]})}function Nn({size:e=`24px`,...t}){return(0,Y.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:e,height:e,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,...t,children:[(0,Y.jsx)(`title`,{children:`Pull Request`}),(0,Y.jsx)(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),(0,Y.jsx)(`path`,{d:`M6 18m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0`}),(0,Y.jsx)(`path`,{d:`M6 6m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0`}),(0,Y.jsx)(`path`,{d:`M18 18m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0`}),(0,Y.jsx)(`path`,{d:`M6 8l0 8`}),(0,Y.jsx)(`path`,{d:`M11 6h5a2 2 0 0 1 2 2v8`}),(0,Y.jsx)(`path`,{d:`M14 9l-3 -3l3 -3`})]})}var Pn=Nn,Fn=`Use gh CLI to create a pull request. Follow these steps:
2
+
3
+ 1. First, check git status to see all changes
4
+ 2. Stage all relevant changes with git add
5
+ 3. Get the diff of staged changes
6
+ 4. Generate a clear, descriptive commit message based on the changes
7
+ 5. Commit the changes
8
+ 6. Push to the remote branch (create branch if needed)
9
+ 7. Create a PR using gh pr create with a descriptive title and body
10
+ 8. After the PR is created, checkout to main branch
11
+
12
+ Make sure to:
13
+ - Write a meaningful commit message that explains WHY, not just WHAT
14
+ - The PR title should be concise but descriptive
15
+ - The PR body should summarize the changes and their purpose
16
+ - Always checkout to main after successfully creating the PR`,In=`Pull the latest changes from the remote repository. Follow these steps:
17
+
18
+ 1. First, check git status to see if there are any uncommitted changes
19
+ 2. If there are uncommitted changes, stash them with a descriptive message
20
+ 3. Run git pull to fetch and merge the latest changes from the remote
21
+ 4. If there were stashed changes, pop the stash and resolve any conflicts if needed
22
+ 5. Show a summary of what was pulled (new commits, files changed)
23
+
24
+ Make sure to:
25
+ - Handle any merge conflicts gracefully
26
+ - Report what changes were pulled
27
+ - Restore any stashed changes after pulling`,Ln=`Push the current changes to the remote repository. Follow these steps:
28
+
29
+ 1. First, check git status to see all uncommitted changes
30
+ 2. If there are uncommitted changes:
31
+ - Stage all relevant changes with git add
32
+ - Generate a clear, descriptive commit message based on the changes
33
+ - Commit the changes
34
+ 3. Check if the current branch has an upstream branch set
35
+ 4. Push to the remote (set upstream if needed)
36
+ 5. Show a summary of what was pushed
37
+
38
+ Make sure to:
39
+ - Write a meaningful commit message that explains WHY, not just WHAT
40
+ - Handle any push rejections (e.g., if remote has new commits, pull first)
41
+ - Report the result of the push operation`;function Rn(){let e=w(e=>e.instance),t=e?.port??0,{pageTitle:n}=Be(),r=ze(e=>e.selectedModel),{mutate:a}=ge(),[o,s]=(0,M.useState)(!1),[c,l]=(0,M.useState)(!1),[u,d]=(0,M.useState)(!1),f=i({from:`/_app/session/$id`,shouldThrow:!1})?.params?.id,m=async e=>{if(!f||!t){p.error(`Please open a session first`);return}if(!(await fetch(`/api/opencode/${t}/session/${f}/prompt`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({text:e,model:r})})).ok)throw Error(`Failed to send request`);Ee(t,f),a()},h=async()=>{s(!0);try{await m(Fn),x.capture(`git_create_pr`),p.success(`PR creation request sent`)}catch(e){console.error(`Failed to create PR:`,e),p.error(`Failed to send PR creation request`)}finally{s(!1)}},g=async()=>{l(!0);try{await m(In),x.capture(`git_pull`),p.success(`Pull request sent`)}catch(e){console.error(`Failed to pull:`,e),p.error(`Failed to send pull request`)}finally{l(!1)}},_=async()=>{d(!0);try{await m(Ln),x.capture(`git_push`),p.success(`Push request sent`)}catch(e){console.error(`Failed to push:`,e),p.error(`Failed to send push request`)}finally{d(!1)}},y=o||c||u;return(0,Y.jsxs)(xn,{isSticky:!0,children:[(0,Y.jsxs)(`span`,{className:`flex items-center gap-x-4`,children:[(0,Y.jsx)(yn,{className:`-ml-2`}),(0,Y.jsxs)(On,{className:`hidden md:flex`,children:[(0,Y.jsx)(kn,{href:`/`,children:e?.name??`Instance`}),n&&(0,Y.jsx)(kn,{children:n})]})]}),(0,Y.jsxs)(`span`,{className:`flex items-center gap-x-2 ml-auto`,children:[(0,Y.jsxs)(v,{size:`xs`,intent:`outline`,className:`uppercase font-mono`,onPress:g,isDisabled:y||!f,children:[(0,Y.jsx)(jn,{size:`14px`}),c?`Pulling...`:`Pull`]}),(0,Y.jsxs)(v,{size:`xs`,intent:`outline`,className:`uppercase font-mono`,onPress:_,isDisabled:y||!f,children:[(0,Y.jsx)(Mn,{size:`14px`}),u?`Pushing...`:`Push`]}),(0,Y.jsxs)(v,{size:`xs`,intent:`outline`,className:`uppercase font-mono`,onPress:h,isDisabled:y||!f,children:[(0,Y.jsx)(Pn,{size:`14px`}),o?`Creating...`:`Create PR`]})]})]})}function zn(){return w(e=>e.instance)?(0,Y.jsx)(Ve,{children:(0,Y.jsxs)(dn,{className:`h-dvh overflow-hidden`,children:[(0,Y.jsx)(En,{intent:`inset`,collapsible:`dock`}),(0,Y.jsxs)(vn,{className:`overflow-hidden`,children:[(0,Y.jsx)(Rn,{}),(0,Y.jsx)(`div`,{className:`flex-1 overflow-auto p-4`,children:(0,Y.jsx)(ie,{})})]})]})}):(0,Y.jsx)(se,{to:`/instances`})}export{zn as component};
@@ -0,0 +1 @@
1
+ import{n as e,t}from"./link-Cuyn8HOL.js";import{F as n,O as r,Qn as i,ar as a,c as o,d as s,er as c,g as l,k as u,l as d,nr as f,v as p,w as m,x as h,y as g}from"./index-F7uBlb4O.js";import{t as _}from"./use-media-query-RLsQpAw3.js";import{n as v}from"./breadcrumb-context-DVp6Utys.js";var y=a(f(),1),b=a(c(),1);function x(e,t=40){if(e.length<=t)return e;let n=Math.floor((t-3)/2);return`${e.slice(0,n)}...${e.slice(-n)}`}function S(){let a=i(),[c,f]=(0,y.useState)(!1),{isMobile:v}=_(),{data:S,error:C,isLoading:w,mutate:T}=l(),E=d(),D=s(),O=S??[],k=(0,y.useCallback)(async()=>{if(!c){f(!0);try{let e=await E();await T(),a({to:`/session/$id`,params:{id:e.id}})}catch(e){console.error(`Failed to create session:`,e)}finally{f(!1)}}},[c,E,T,a]);async function A(e){try{await D(e),await T()}catch(e){console.error(`Failed to delete session:`,e)}}return(0,y.useEffect)(()=>{function e(e){e.key===`Enter`&&e.shiftKey&&!c&&(e.preventDefault(),k())}return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[c,k]),v?(0,b.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,b.jsx)(`div`,{className:`flex flex-col items-center pt-8 pb-6`,children:(0,b.jsxs)(`div`,{className:`flex items-center gap-x-2 mb-2`,children:[(0,b.jsx)(`img`,{src:`/logo.svg`,alt:`OpenCode Portal`,className:`size-8`}),(0,b.jsxs)(`h2`,{className:`text-2xl font-medium text-fg`,children:[`OpenCode `,(0,b.jsx)(`span`,{className:`text-muted-fg`,children:`Portal`})]})]})}),(0,b.jsx)(`div`,{className:`px-4 pb-4`,children:(0,b.jsxs)(r,{intent:`outline`,onPress:k,isDisabled:c,className:`w-full`,children:[(0,b.jsx)(o,{className:`shrink-0`}),c?`Creating...`:`New Session`]})}),(0,b.jsxs)(`div`,{className:`flex-1 overflow-y-auto px-4`,children:[(0,b.jsx)(`h3`,{className:`text-sm font-medium text-muted-fg mb-2`,children:`Sessions`}),w&&(0,b.jsx)(`p`,{className:`text-sm text-muted-fg py-2`,children:`Loading sessions...`}),C&&(0,b.jsxs)(`p`,{className:`text-sm text-danger py-2`,children:[`Error: `,C.message]}),!w&&!C&&O.length===0&&(0,b.jsx)(`p`,{className:`text-sm text-muted-fg py-2`,children:`No sessions found`}),!w&&!C&&O.length>0&&(0,b.jsx)(`ul`,{className:`space-y-1`,children:O.map(n=>(0,b.jsxs)(`li`,{className:`group flex items-center justify-between rounded-lg hover:bg-secondary/50 transition-colors`,children:[(0,b.jsx)(t,{href:`/session/${n.id}`,className:`flex-1 py-2 px-3 text-sm truncate`,children:x(n.title||`Session ${n.id.slice(0,8)}`)}),(0,b.jsxs)(p,{children:[(0,b.jsx)(m,{className:`p-2 opacity-0 group-hover:opacity-100 focus:opacity-100 transition-opacity`,children:(0,b.jsx)(e,{className:`size-4`})}),(0,b.jsx)(g,{popover:{offset:0,placement:`bottom end`},children:(0,b.jsxs)(h,{intent:`danger`,onAction:()=>A(n.id),children:[(0,b.jsx)(u,{}),`Delete Session`]})})]})]},n.id))})]})]}):(0,b.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,b.jsxs)(`div`,{className:`text-center max-w-md`,children:[(0,b.jsxs)(`div`,{className:`flex items-center justify-center gap-x-2 mb-4`,children:[(0,b.jsx)(`img`,{src:`/logo.svg`,alt:`OpenCode Portal`,className:`size-8`}),(0,b.jsx)(`h2`,{className:`text-2xl font-medium text-fg`,children:`OpenCode Portal`})]}),(0,b.jsx)(`p`,{className:`text-muted-fg mb-6`,children:`Select an existing session from the left panel or create a new one to get started`}),(0,b.jsxs)(`div`,{className:`text-sm text-muted-fg`,children:[`Press`,` `,(0,b.jsx)(n,{className:`inline-flex px-1.5 py-0.5 rounded bg-secondary text-secondary-fg text-xs font-mono`,children:`Shift + Enter`}),` `,`to start a new session`]})]})})}function C(){let{setPageTitle:e}=v();return(0,y.useEffect)(()=>(e(null),()=>e(null)),[e]),(0,b.jsx)(S,{})}export{C as component};