studiograph 1.3.42 → 1.3.43

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 (51) hide show
  1. package/dist/web/_app/immutable/assets/{2.DtDUN2Ae.css → 2.C8WqLKVH.css} +1 -1
  2. package/dist/web/_app/immutable/chunks/{qeyyXhHO.js → 3kn731Pp.js} +1 -1
  3. package/dist/web/_app/immutable/chunks/{FmR2V1-h.js → 9TVbAwoF.js} +1 -1
  4. package/dist/web/_app/immutable/chunks/{Dty7t9WP.js → B-46Slz_.js} +1 -1
  5. package/dist/web/_app/immutable/chunks/{DD0eH0_A.js → B3OdLZwd.js} +1 -1
  6. package/dist/web/_app/immutable/chunks/{D9BdHkd3.js → B3cgneCL.js} +1 -1
  7. package/dist/web/_app/immutable/chunks/{CgcfyvoD.js → BOcEeypC.js} +1 -1
  8. package/dist/web/_app/immutable/chunks/BRjGNUzV.js +5 -0
  9. package/dist/web/_app/immutable/chunks/{DSZYl5ah.js → BbsQ7LcO.js} +1 -1
  10. package/dist/web/_app/immutable/chunks/{DlkslpnI.js → BlYD-5Z_.js} +1 -1
  11. package/dist/web/_app/immutable/chunks/{yMbbhP0p.js → Bo0CMKlC.js} +1 -1
  12. package/dist/web/_app/immutable/chunks/{Dr5ZUnae.js → BpQkNqbd.js} +1 -1
  13. package/dist/web/_app/immutable/chunks/BwiF2fxX.js +1 -0
  14. package/dist/web/_app/immutable/chunks/{B2LOVFFz.js → ByGNDrbC.js} +1 -1
  15. package/dist/web/_app/immutable/chunks/{HzJbEnio.js → C39N6y-4.js} +1 -1
  16. package/dist/web/_app/immutable/chunks/{DmLcKvmV.js → CHyNkE69.js} +1 -1
  17. package/dist/web/_app/immutable/chunks/{rcG0Y_x7.js → CIgxv4dO.js} +1 -1
  18. package/dist/web/_app/immutable/chunks/{BnPh5q8z.js → CP30HKCf.js} +1 -1
  19. package/dist/web/_app/immutable/chunks/{1vztr6_A.js → Cbba0X2k.js} +1 -1
  20. package/dist/web/_app/immutable/chunks/{DVyuW48M.js → CdoeTcKU.js} +1 -1
  21. package/dist/web/_app/immutable/chunks/{KCOVknl_.js → CvT005bt.js} +1 -1
  22. package/dist/web/_app/immutable/chunks/{CYMV9O2_.js → D-Er8WL_.js} +1 -1
  23. package/dist/web/_app/immutable/chunks/{D91YXE6T.js → D5GOt_JW.js} +1 -1
  24. package/dist/web/_app/immutable/chunks/{l5w7mUkV.js → DNfruFPs.js} +1 -1
  25. package/dist/web/_app/immutable/chunks/{Brxs8A3C.js → DVpZtGWL.js} +1 -1
  26. package/dist/web/_app/immutable/chunks/{DfwW1gF2.js → DY21hM66.js} +1 -1
  27. package/dist/web/_app/immutable/chunks/{BUMhcVI4.js → Dw9UPwc-.js} +1 -1
  28. package/dist/web/_app/immutable/entry/{app.CUfCyEld.js → app.EJEuMPYz.js} +2 -2
  29. package/dist/web/_app/immutable/entry/start.BOMbKPKA.js +1 -0
  30. package/dist/web/_app/immutable/nodes/0.BZ4775L8.js +2 -0
  31. package/dist/web/_app/immutable/nodes/{1.CUZf-oFi.js → 1.Bsi4xvt_.js} +1 -1
  32. package/dist/web/_app/immutable/nodes/2.Dtg7XjMw.js +84 -0
  33. package/dist/web/_app/immutable/nodes/{3.CywCCe9F.js → 3.BnPkMEuM.js} +1 -1
  34. package/dist/web/_app/immutable/nodes/4.B8xw3uIV.js +11 -0
  35. package/dist/web/_app/immutable/nodes/{5.BG_fz1Pc.js → 5.jC5vBcjM.js} +1 -1
  36. package/dist/web/_app/immutable/nodes/{6.s5GRZINE.js → 6.BrJWdUaW.js} +1 -1
  37. package/dist/web/_app/immutable/nodes/7.DhmNA9F-.js +2 -0
  38. package/dist/web/_app/immutable/nodes/{8.B2uOoOa7.js → 8.D4qXhOtf.js} +1 -1
  39. package/dist/web/_app/immutable/nodes/{9.jU4WCAQj.js → 9.B9Hbxu54.js} +1 -1
  40. package/dist/web/_app/version.json +1 -1
  41. package/dist/web/index.html +12 -12
  42. package/package.json +1 -1
  43. package/dist/web/_app/immutable/chunks/BKAD6OjK.js +0 -1
  44. package/dist/web/_app/immutable/chunks/SAMwKg4j.js +0 -5
  45. package/dist/web/_app/immutable/chunks/Y2eppfkg.js +0 -1
  46. package/dist/web/_app/immutable/entry/start.aufF8xaf.js +0 -1
  47. package/dist/web/_app/immutable/nodes/0.C-CmG3eF.js +0 -2
  48. package/dist/web/_app/immutable/nodes/2.BuPKoNE3.js +0 -84
  49. package/dist/web/_app/immutable/nodes/4.BXLn5nFI.js +0 -11
  50. package/dist/web/_app/immutable/nodes/7.C24TRVUy.js +0 -2
  51. /package/dist/web/_app/immutable/assets/{dialog-close.FS8bdfxr.css → Copy.FS8bdfxr.css} +0 -0
@@ -1 +1 @@
1
- .entity-body{padding:16px 24px 24px;display:flex;flex-direction:column;gap:20px}.type-section.svelte-ak7t5k{display:flex;flex-direction:column;gap:8px}.type-section-label.svelte-ak7t5k{font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.05em;color:var(--color-text-tertiary)}.type-grid.svelte-ak7t5k{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}.type-grid.svelte-ak7t5k .type-card{display:flex;flex-direction:column;align-items:flex-start;gap:10px;padding:12px;height:auto;border-radius:8px;text-align:left;color:var(--color-text-secondary);justify-content:flex-start}.type-grid.svelte-ak7t5k .type-card:hover{background:var(--color-bg-hover);border-color:var(--color-border-strong)}.type-grid.svelte-ak7t5k .type-card:hover .type-name{color:var(--color-text-primary)}.type-dot.svelte-ak7t5k{width:8px;height:8px;border-radius:50%}.type-info.svelte-ak7t5k{display:flex;flex-direction:column;gap:2px}.type-name.svelte-ak7t5k{font-size:14px;font-weight:500;color:var(--color-text-secondary)}.type-desc.svelte-ak7t5k{font-size:12px;color:var(--color-text-tertiary);line-height:1.3}.sidebar.svelte-6dohdz{width:340px;min-width:340px;display:flex;flex-direction:column;overflow:hidden;background:var(--color-bg);border-right:1px solid var(--color-border)}.sidebar-header.svelte-6dohdz{height:40px;display:flex;align-items:center;gap:11px;padding:0 12px 0 19px;border-bottom:1px solid var(--color-border);flex-shrink:0}.header-actions.svelte-6dohdz{margin-left:auto;display:flex;align-items:center}.sidebar-header.svelte-6dohdz .home-btn{display:inline-flex;align-items:center;gap:11px;padding:0;min-width:0;text-align:left;border-radius:0;height:auto;background:transparent!important}.sidebar-header.svelte-6dohdz .home-btn:hover .workspace-icon{opacity:.8}.sidebar-header.svelte-6dohdz .home-btn:hover .workspace-name{color:var(--color-text-secondary)}.workspace-icon.svelte-6dohdz{width:22px;height:22px;border-radius:50%;background:var(--color-accent, #e05050);color:#fff;display:flex;align-items:center;justify-content:center;font-weight:600;font-size:11px;flex-shrink:0}.workspace-name.svelte-6dohdz{flex:1;font-size:14px;font-weight:600;color:var(--color-text-primary)}.settings-nav.svelte-6dohdz{display:flex;flex-direction:column;flex:1;padding-top:0}.settings-nav.svelte-6dohdz button[data-slot=tabs-trigger]{display:flex;align-items:center;width:100%;height:40px;padding:0 12px 0 19px;gap:11px;border:none;background:transparent;cursor:pointer;font-family:inherit;font-size:14px;color:var(--color-text-secondary);transition:color .15s,background .15s}.settings-nav.svelte-6dohdz button[data-slot=tabs-trigger]:hover{background:var(--color-bg-hover);color:var(--color-text-primary)}.settings-nav.svelte-6dohdz button[data-slot=tabs-trigger][data-state=active]{background:var(--color-bg-hover);color:var(--color-text-primary);font-weight:500}.settings-nav.svelte-6dohdz button[data-slot=tabs-trigger] svg{width:14px;height:14px;flex-shrink:0;box-sizing:content-box;padding:0 4px}.filter-bar.svelte-6dohdz{position:relative;display:flex;align-items:center;height:40px;padding:0 12px 0 52px;border-bottom:1px solid var(--color-border);flex-shrink:0}.filter-icon.svelte-6dohdz{position:absolute;left:22px;top:50%;transform:translateY(-50%);display:flex;align-items:center;justify-content:center;width:16px;color:var(--color-text-tertiary)}.filter-bar.svelte-6dohdz .filter-input{flex:1;background:transparent;border:none;outline:none;padding:0;margin:0;font-size:14px;line-height:1.4;height:auto;border-radius:0}.filter-bar.svelte-6dohdz .filter-clear{width:20px;height:20px;flex-shrink:0}.filter-bar.svelte-6dohdz .sort-toggle{width:28px;height:28px;flex-shrink:0;margin-left:4px}.filter-bar.svelte-6dohdz .sort-toggle.active{color:var(--color-accent, #e05050)}.repo-type-icon.svelte-6dohdz{display:inline-flex;align-items:center;color:var(--color-text-tertiary);margin-right:6px;flex-shrink:0;align-self:center}.tree.svelte-6dohdz{flex:1;overflow-y:auto;padding-top:0}.tree-group.svelte-6dohdz{display:flex;flex-direction:column}.tree-group.svelte-6dohdz+.tree-group:where(.svelte-6dohdz){margin-top:0}.repo-row{display:flex;align-items:baseline;height:40px;line-height:40px;width:100%;padding:0 12px 0 20px;border:none;background:transparent;font-family:inherit;text-align:left;border-left:2px solid transparent;border-radius:0;gap:0;justify-content:flex-start}.repo-row:hover,.repo-row.focused{background:var(--color-bg-hover)}.repo-row.repo-active{border-left-color:var(--active-color)}.repo-name.svelte-6dohdz{font-size:14px;color:var(--color-text-secondary)}.repo-row.repo-active .repo-name.svelte-6dohdz,.repo-row.repo-active .repo-type-icon.svelte-6dohdz{font-weight:600;color:var(--color-text-primary)}.tree-row{position:relative;display:flex;align-items:baseline;height:40px;line-height:40px;padding-right:40px;color:var(--color-text-secondary);font-size:14px;border:none;background:transparent;font-family:inherit;text-align:left;width:100%;border-left:2px solid transparent;border-radius:0;gap:0;justify-content:flex-start}.tree-row:hover,.tree-row.focused{background:var(--color-bg-hover)}.tree-row.selected{background:var(--color-bg-selected);border-left-color:var(--active-color);color:var(--color-text-primary);font-weight:600}.row-chevron.svelte-6dohdz{display:inline-flex;align-items:center;justify-content:center;width:16px;height:40px;flex-shrink:0;margin-right:14px;color:var(--color-text-tertiary);align-self:center}.row-label.svelte-6dohdz{flex:1;overflow:hidden;white-space:nowrap;mask-image:linear-gradient(to right,black calc(100% - 16px),transparent 100%);-webkit-mask-image:linear-gradient(to right,black calc(100% - 16px),transparent 100%)}.item-count.svelte-6dohdz{font-size:12px;color:var(--color-text-tertiary);margin-left:8px;flex-shrink:0}.indent-group.svelte-6dohdz{position:relative}.indent-group.svelte-6dohdz:before{content:"";position:absolute;left:var(--guide-left);top:0;bottom:0;width:1px;background:var(--color-border);pointer-events:none}.loading-row.svelte-6dohdz{height:40px;display:flex;align-items:center;font-size:14px;color:var(--color-text-tertiary)}.type-header-row{color:var(--color-text-secondary);border-left:2px solid transparent}.type-header-row.type-active{color:var(--color-text-primary);font-weight:600}.type-header-row .row-label.svelte-6dohdz{flex:none;mask-image:none;-webkit-mask-image:none}.new-entity-row{color:var(--color-text-tertiary);align-items:center}.new-entity-row:hover{color:var(--color-text-secondary)}.entity-row-wrapper.svelte-6dohdz{position:relative;display:flex;align-items:center}.entity-row-wrapper.svelte-6dohdz .tree-row{flex:1;min-width:0}.entity-row-wrapper.svelte-6dohdz .entity-actions-btn{display:none;width:28px;height:28px;position:absolute;right:12px;flex-shrink:0;padding:0;border:none;background:none;cursor:pointer;color:var(--color-text-tertiary);border-radius:4px;align-items:center;justify-content:center}.entity-row-wrapper.svelte-6dohdz .entity-actions-btn:hover{background:var(--color-bg-hover);color:var(--color-text-primary)}.entity-row-wrapper.svelte-6dohdz:hover .tree-row,.entity-row-wrapper.svelte-6dohdz:has(.entity-actions-btn.menu-open) .tree-row{background:var(--color-bg-hover)}.entity-row-wrapper.svelte-6dohdz:hover .entity-actions-btn,.entity-row-wrapper.svelte-6dohdz .entity-actions-btn.menu-open{display:inline-flex}.entity-type-dot.svelte-6dohdz{width:6px;height:6px;border-radius:50%;flex-shrink:0;margin-right:19px;align-self:center}.recent-time.svelte-6dohdz{font-size:12px;color:var(--color-text-tertiary);position:absolute;right:26px;top:50%;transform:translate(50%,-50%);white-space:nowrap}.entity-row-wrapper.svelte-6dohdz:hover .recent-time:where(.svelte-6dohdz){display:none}.presence-stack.svelte-6dohdz{display:flex;align-items:center;gap:-4px;margin-left:auto;flex-shrink:0;align-self:center}.presence-avatar.svelte-6dohdz{width:18px;height:18px;border-radius:50%;font-size:10px;font-weight:600;color:#fff;background:var(--color-accent);display:flex;align-items:center;justify-content:center;margin-left:-3px;border:1px solid var(--color-bg);box-sizing:border-box;flex-shrink:0;align-self:center}.presence-stack.svelte-6dohdz .presence-avatar:where(.svelte-6dohdz):first-child{margin-left:4px}.repo-row .presence-stack.svelte-6dohdz{margin-right:28px}.presence-avatar.svelte-6dohdz:nth-child(1){z-index:3}.presence-avatar.svelte-6dohdz:nth-child(2){z-index:2}.presence-avatar.svelte-6dohdz:nth-child(3){z-index:1}.filter-match.svelte-6dohdz{background:var(--color-accent, #e05050);color:#fff;border-radius:2px;padding:0}.no-results.svelte-6dohdz{padding:24px 16px;font-size:14px;color:var(--color-text-tertiary);text-align:center}.repo-row .repo-rename-input{flex:1;min-width:0;height:100%;padding:0 6px;margin:0;border:1px solid var(--color-accent, #e05050);border-radius:3px;font-size:14px;font-weight:600}.repo-row-wrapper.svelte-6dohdz{position:relative;display:flex;align-items:center}.repo-row-wrapper.drop-target.svelte-6dohdz{outline:2px solid var(--color-accent, #e05050);outline-offset:-2px;border-radius:6px;background:#e0505014}.import-modal{max-width:480px}.import-modal .dialog-header{flex-direction:column;align-items:flex-start;gap:4px}.import-modal-body.svelte-6dohdz{padding:16px 24px 8px}.import-modal .dialog-footer{border-top:none}.import-file-list.svelte-6dohdz{display:flex;flex-direction:column;max-height:240px;overflow-y:auto}.import-file-row.svelte-6dohdz{display:flex;align-items:center;gap:10px;padding:10px 12px;border-bottom:1px solid var(--color-border)}.import-file-icon.svelte-6dohdz{flex-shrink:0;color:var(--color-text-tertiary)}.import-file-info.svelte-6dohdz{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.import-file-name.svelte-6dohdz{font-size:14px;color:var(--color-text-primary);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.import-file-size.svelte-6dohdz{font-size:12px;color:var(--color-text-tertiary)}.import-file-remove.svelte-6dohdz{flex-shrink:0;background:none;border:none;color:var(--color-text-tertiary);cursor:pointer;padding:4px;border-radius:4px;display:flex;align-items:center;justify-content:center}.import-file-remove.svelte-6dohdz:hover{color:var(--color-text-primary);background:var(--color-bg-hover)}.import-drop-zone.svelte-6dohdz{border:1px solid var(--color-border, #333);border-radius:0;padding:40px 16px;text-align:center;color:var(--color-text-tertiary);font-size:15px;min-height:180px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;transition:background .15s}.import-drop-zone-compact.svelte-6dohdz{min-height:0;padding:14px 16px;border-top:none}.import-hint.svelte-6dohdz{font-size:13px;color:var(--color-text-tertiary);margin:0}.file-picker-link.svelte-6dohdz{background:none;border:none;color:var(--color-accent, #e05050);cursor:pointer;text-decoration:underline;font-size:15px;padding:0}.file-picker-link-sm.svelte-6dohdz{font-size:13px}.repo-row-wrapper.svelte-6dohdz .repo-row{flex:1;min-width:0}.repo-row-wrapper.svelte-6dohdz .repo-actions-btn{display:none;width:28px;height:28px;position:absolute;right:12px;flex-shrink:0;padding:0;border:none;background:none;cursor:pointer;color:var(--color-text-tertiary);border-radius:4px;align-items:center;justify-content:center}.repo-row-wrapper.svelte-6dohdz .repo-actions-btn:hover{background:var(--color-bg-hover);color:var(--color-text-primary)}.repo-row-wrapper.svelte-6dohdz:hover .repo-row,.repo-row-wrapper.svelte-6dohdz:has(.repo-actions-btn.menu-open) .repo-row{background:var(--color-bg-hover)}.repo-row-wrapper.svelte-6dohdz:hover .repo-actions-btn,.repo-row-wrapper.svelte-6dohdz .repo-actions-btn.menu-open{display:inline-flex}.type-header-wrapper.svelte-6dohdz{position:relative;display:flex;align-items:center}.type-header-wrapper.svelte-6dohdz .type-header-row{flex:1;min-width:0}.type-header-wrapper.svelte-6dohdz .type-actions-btn{display:none;width:24px;height:24px;position:absolute;right:12px;flex-shrink:0;padding:0;border:none;background:none;cursor:pointer;color:var(--color-text-tertiary);border-radius:4px;align-items:center;justify-content:center}.type-header-wrapper.svelte-6dohdz .type-actions-btn:hover{background:var(--color-bg-hover);color:var(--color-text-primary)}.type-header-wrapper.svelte-6dohdz:hover .type-header-row,.type-header-wrapper.svelte-6dohdz:has(.type-actions-btn.menu-open) .type-header-row{background:var(--color-bg-hover)}.type-header-wrapper.svelte-6dohdz:hover .type-actions-btn,.type-header-wrapper.svelte-6dohdz .type-actions-btn.menu-open{display:inline-flex}.repo-actions-menu{min-width:120px;padding:4px;border-radius:6px;background:var(--color-bg-elevated);border:1px solid var(--color-border);box-shadow:0 4px 12px #00000026;z-index:1000}.repo-menu-item{display:flex;align-items:center;gap:8px;padding:6px 8px;border-radius:4px;cursor:pointer;font-size:13px;color:var(--color-text-primary)}.repo-menu-item:hover{background:var(--color-bg-hover)}.repo-menu-item-danger{color:var(--color-error, #e55)}.new-collection-btn,.new-collection-btn .repo-name.svelte-6dohdz,.new-collection-btn .row-chevron.svelte-6dohdz{color:var(--color-text-tertiary)}.new-collection-btn:hover,.new-collection-btn:hover .repo-name.svelte-6dohdz{color:var(--color-text-secondary)}.new-collection-row.svelte-6dohdz{display:flex;align-items:center;height:40px;padding:0 12px 0 20px;border-left:2px solid transparent}.new-collection-row.svelte-6dohdz .new-collection-input{flex:1;height:100%;padding:0 0 0 30px;border:none;background:transparent;font-size:14px;border-radius:0}.new-collection-row.svelte-6dohdz .new-collection-clear{width:20px;height:20px;flex-shrink:0;margin-right:4px}.new-collection-row.svelte-6dohdz .private-toggle{width:20px;height:20px;flex-shrink:0;margin-left:auto;margin-right:4px;color:var(--color-text-secondary)}.new-collection-row.svelte-6dohdz .private-toggle.active{color:var(--color-accent, #e05050)}@keyframes svelte-6dohdz-shake{0%,to{transform:translate(0)}20%{transform:translate(-4px)}40%{transform:translate(4px)}60%{transform:translate(-3px)}80%{transform:translate(2px)}}.new-collection-row.svelte-6dohdz .new-collection-input.shake{animation:svelte-6dohdz-shake .3s ease-in-out}.sidebar-footer.svelte-6dohdz{display:flex;align-items:center;height:40px;padding:0 12px 0 19px;border-top:1px solid var(--color-border);flex-shrink:0;gap:8px}.user-email.svelte-6dohdz{flex:1;font-size:13px;color:var(--color-text-tertiary);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sidebar-footer.svelte-6dohdz .footer-icon-btn{width:28px;height:28px}.chat-panel.svelte-1xwj6s7{width:340px;min-width:340px;flex-shrink:0;display:flex;flex-direction:column;background:var(--color-bg);border-left:1px solid var(--color-border)}.chat-panel.chat-full.svelte-1xwj6s7{width:100%;min-width:0;flex:1;border-left:none}.chat-full.svelte-1xwj6s7 .chat-messages:where(.svelte-1xwj6s7){padding-left:calc((100% - 720px)/2);padding-right:calc((100% - 720px)/2)}.chat-full.svelte-1xwj6s7 .chat-input-area:where(.svelte-1xwj6s7){padding-left:calc((100% - 720px)/2);padding-right:calc((100% - 720px)/2)}.chat-header.svelte-1xwj6s7{height:40px;display:flex;align-items:center;justify-content:space-between;padding:0 16px;border-bottom:1px solid var(--color-border);position:relative;flex-shrink:0}.chat-header-left.svelte-1xwj6s7,.chat-header-right.svelte-1xwj6s7{display:flex;align-items:center;gap:2px}.history-active{color:var(--color-accent, #e05050)!important}.history-active:not(:hover){background:transparent!important}.session-dropdown.svelte-1xwj6s7{position:absolute;top:100%;left:0;right:0;z-index:10;box-shadow:0 4px 12px #0000001f}.session-list.svelte-1xwj6s7{max-height:240px;overflow-y:auto;background:var(--color-bg);border-bottom:1px solid var(--color-border)}.session-row.svelte-1xwj6s7{position:relative;display:flex;align-items:center}.session-row.svelte-1xwj6s7 .session-item{display:flex;align-items:center;justify-content:flex-start;flex:1;min-width:0;padding:0 32px 0 16px;height:40px;line-height:40px;font-size:14px;color:var(--color-text-secondary);text-align:left;border-radius:0}.session-row.svelte-1xwj6s7:hover .session-item{background:var(--color-bg-hover)}.session-row.svelte-1xwj6s7 .session-item.active{background:var(--color-bg-hover);color:var(--color-text-primary);font-weight:500}.session-row.svelte-1xwj6s7 .session-delete-btn{display:none;width:20px;height:20px;position:absolute;right:6px;flex-shrink:0;padding:0}.session-row.svelte-1xwj6s7 .session-delete-btn:hover{color:var(--color-error, #e55)}.session-row.svelte-1xwj6s7:hover .session-delete-btn{display:flex}.session-title.svelte-1xwj6s7{flex:1;overflow:hidden;white-space:nowrap;min-width:0;mask-image:linear-gradient(to right,black calc(100% - 24px),transparent 100%);-webkit-mask-image:linear-gradient(to right,black calc(100% - 24px),transparent 100%)}.chat-messages.svelte-1xwj6s7{flex:1;overflow-y:auto;padding:24px 16px;display:flex;flex-direction:column;gap:32px}.empty-state.svelte-1xwj6s7{flex:1;display:flex;align-items:center;justify-content:center;color:var(--color-text-tertiary);font-size:14px}.seed-prompts.svelte-1xwj6s7{display:flex;flex-direction:column;gap:8px;width:100%}.seed-prompts.svelte-1xwj6s7 .seed-prompt{font-size:14px;line-height:20px;padding:9px 13px;min-height:40px;height:auto;border-radius:8px;color:var(--color-text-secondary);text-align:left;white-space:normal;justify-content:flex-start}.seed-prompts.svelte-1xwj6s7 .seed-prompt:hover{background:var(--color-bg-hover);color:var(--color-text-primary)}.message-group.svelte-1xwj6s7{display:flex;flex-direction:column;gap:16px}.user-bubble.svelte-1xwj6s7{background:var(--color-bg-surface);border-radius:8px;padding:12px 14px;font-size:14px;line-height:22px;color:var(--color-text-primary)}.agent-content.svelte-1xwj6s7{display:flex;flex-direction:column;gap:14px}.tool-calls.svelte-1xwj6s7{display:flex;flex-direction:column;gap:4px}.tool-call.svelte-1xwj6s7{font-family:var(--font-mono);font-size:12px;color:var(--color-accent)}.agent-text.svelte-1xwj6s7{font-size:14px;line-height:22px;color:var(--color-text-primary)}.prose.svelte-1xwj6s7 h1{font-size:18px;font-weight:600;color:var(--color-text-primary);margin:24px 0 12px}.prose.svelte-1xwj6s7 h2{font-size:16px;font-weight:600;color:var(--color-text-primary);margin:22px 0 10px}.prose.svelte-1xwj6s7 h3{font-size:15px;font-weight:600;color:var(--color-text-primary);margin:20px 0 8px}.prose.svelte-1xwj6s7 p{margin:0 0 14px}.prose.svelte-1xwj6s7 p:last-child{margin-bottom:0}.prose.svelte-1xwj6s7 strong{font-weight:600}.prose.svelte-1xwj6s7 ul,.prose.svelte-1xwj6s7 ol{padding-left:20px;margin:0 0 14px;color:var(--color-text-primary)}.prose.svelte-1xwj6s7 ul{list-style-type:disc}.prose.svelte-1xwj6s7 ol{list-style-type:decimal}.prose.svelte-1xwj6s7 li{margin-bottom:6px}.prose.svelte-1xwj6s7 table{width:100%;border-collapse:collapse;font-size:13px;margin:16px 0}.prose.svelte-1xwj6s7 th,.prose.svelte-1xwj6s7 td{border:1px solid var(--color-border);padding:4px 8px;text-align:left;vertical-align:top}.prose.svelte-1xwj6s7 th{font-weight:600}.prose.svelte-1xwj6s7 pre{background:var(--color-bg-surface);border-radius:6px;padding:10px 12px;overflow-x:auto;margin:16px 0;font-family:var(--font-mono);font-size:13px;line-height:18px}.prose.svelte-1xwj6s7 code{font-family:var(--font-mono);font-size:13px;background:var(--color-bg-surface);padding:1px 4px;border-radius:3px}.prose.svelte-1xwj6s7 pre code{background:none;padding:0}.prose.svelte-1xwj6s7 a{color:var(--color-link)}.prose.svelte-1xwj6s7 blockquote{border-left:3px solid var(--color-accent);padding-left:12px;margin:16px 0;color:var(--color-text-secondary)}.prose.svelte-1xwj6s7 hr{border:none;border-top:1px solid var(--color-border);margin:24px 0}.streaming-dot.svelte-1xwj6s7{display:inline-block;width:8px;height:8px;background:var(--color-accent);border-radius:4px;animation:svelte-1xwj6s7-pulse 1s ease-in-out infinite}@keyframes svelte-1xwj6s7-pulse{0%,to{opacity:.3}50%{opacity:1}}.context-chip.svelte-1xwj6s7{font-size:12px;color:var(--color-text-tertiary);padding:0 2px 4px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chat-input-area.svelte-1xwj6s7{padding:12px 16px 16px}.text-input.svelte-1xwj6s7{display:flex;align-items:flex-end;min-height:40px;max-height:140px;padding:0 0 0 13px;background:transparent;border:1px solid var(--color-border);border-radius:8px;transition:border-color .15s}.text-input.svelte-1xwj6s7:focus-within{border-color:var(--color-accent)}.send-btn{color:var(--color-text-tertiary);margin:6px;flex-shrink:0;pointer-events:none}.send-btn.send-active{pointer-events:auto;color:#fff;background:var(--color-accent);border-radius:6px}.stop-btn{color:#fff;background:var(--color-accent);border-radius:6px}.input-field.svelte-1xwj6s7{flex:1;background:transparent;border:none;outline:none;font-family:inherit;font-size:14px;line-height:20px;color:var(--color-text-primary);resize:none;overflow-y:auto;padding:9px 0;max-height:120px;field-sizing:content}.input-field.svelte-1xwj6s7::placeholder{color:var(--color-text-tertiary)}.input-field.svelte-1xwj6s7:disabled{opacity:.5}.search-header.svelte-1xems06{display:flex;align-items:center;height:52px;padding:0 16px;gap:10px;border-bottom:1px solid var(--color-border)}.search-header.svelte-1xems06 svg{color:var(--color-text-tertiary);flex-shrink:0}.search-header.svelte-1xems06 .search-input{flex:1;font-size:16px;line-height:20px;border:none;background:transparent;box-shadow:none;padding:0;height:auto}.search-header.svelte-1xems06 .search-input:focus{box-shadow:none;border:none}.esc-badge.svelte-1xems06{font-family:var(--font-sans);font-size:12px;line-height:1;padding:3px 6px;border-radius:4px;background:var(--color-bg-surface);border:1px solid var(--color-border);color:var(--color-text-tertiary)}.results-list.svelte-1xems06{flex:1;overflow-y:auto;min-height:0}.empty-results.svelte-1xems06{padding:24px 16px;text-align:center;font-size:14px;color:var(--color-text-tertiary)}.results-list.svelte-1xems06 .result-row{display:flex;align-items:flex-start;padding:10px 16px;width:100%;text-align:left;border-radius:0;height:auto;justify-content:flex-start}.results-list.svelte-1xems06 .result-row:hover,.results-list.svelte-1xems06 .result-row.selected{background:var(--color-bg-hover)}.result-body.svelte-1xems06{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.result-title-row.svelte-1xems06{display:flex;align-items:center;gap:8px}.result-title.svelte-1xems06{font-size:14px;font-weight:500;color:var(--color-text-primary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.entity-tag.svelte-1xems06{flex-shrink:0;font-size:11px;font-weight:500;letter-spacing:.04em;text-transform:uppercase;padding:1px 6px;border-radius:3px;background:var(--color-badge-bg);color:var(--color-badge-text)}.result-meta.svelte-1xems06{font-size:13px;color:var(--color-text-tertiary)}.search-footer.svelte-1xems06{display:flex;align-items:center;height:39px;padding:0 16px;gap:16px;border-top:1px solid var(--color-border)}.shortcut-group.svelte-1xems06{display:flex;align-items:center;gap:4px}.shortcut-key.svelte-1xems06{display:inline-flex;align-items:center;justify-content:center;min-width:20px;height:20px;padding:0 4px;border-radius:4px;background:var(--color-bg-surface);border:1px solid var(--color-border);color:var(--color-text-tertiary)}.shortcut-label.svelte-1xems06{font-size:12px;color:var(--color-text-tertiary);margin-left:2px}.app-frame.svelte-vr1z90{width:100vw;height:100vh;display:flex;flex-direction:column;overflow:hidden;background:var(--color-bg)}.app-body.svelte-vr1z90{flex:1;display:flex;min-height:0;overflow:hidden}.main-content.svelte-vr1z90{flex:1;display:flex;flex-direction:column;min-width:0;min-height:0;overflow:hidden}#sg-chrome-footer{flex-shrink:0}
1
+ .entity-body{padding:16px 24px 24px;display:flex;flex-direction:column;gap:20px}.type-section.svelte-ak7t5k{display:flex;flex-direction:column;gap:8px}.type-section-label.svelte-ak7t5k{font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.05em;color:var(--color-text-tertiary)}.type-grid.svelte-ak7t5k{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}.type-grid.svelte-ak7t5k .type-card{display:flex;flex-direction:column;align-items:flex-start;gap:10px;padding:12px;height:auto;border-radius:8px;text-align:left;color:var(--color-text-secondary);justify-content:flex-start}.type-grid.svelte-ak7t5k .type-card:hover{background:var(--color-bg-hover);border-color:var(--color-border-strong)}.type-grid.svelte-ak7t5k .type-card:hover .type-name{color:var(--color-text-primary)}.type-dot.svelte-ak7t5k{width:8px;height:8px;border-radius:50%}.type-info.svelte-ak7t5k{display:flex;flex-direction:column;gap:2px}.type-name.svelte-ak7t5k{font-size:14px;font-weight:500;color:var(--color-text-secondary)}.type-desc.svelte-ak7t5k{font-size:12px;color:var(--color-text-tertiary);line-height:1.3}.sidebar.svelte-6dohdz{width:340px;min-width:340px;display:flex;flex-direction:column;overflow:hidden;background:var(--color-bg);border-right:1px solid var(--color-border)}.sidebar-header.svelte-6dohdz{height:40px;display:flex;align-items:center;gap:11px;padding:0 12px 0 19px;border-bottom:1px solid var(--color-border);flex-shrink:0}.header-actions.svelte-6dohdz{margin-left:auto;display:flex;align-items:center}.sidebar-header.svelte-6dohdz .home-btn{display:inline-flex;align-items:center;gap:11px;padding:0;min-width:0;text-align:left;border-radius:0;height:auto;background:transparent!important}.sidebar-header.svelte-6dohdz .home-btn:hover .workspace-icon{opacity:.8}.sidebar-header.svelte-6dohdz .home-btn:hover .workspace-name{color:var(--color-text-secondary)}.workspace-icon.svelte-6dohdz{width:22px;height:22px;border-radius:50%;background:var(--color-accent, #e05050);color:#fff;display:flex;align-items:center;justify-content:center;font-weight:600;font-size:11px;flex-shrink:0}.workspace-name.svelte-6dohdz{flex:1;font-size:14px;font-weight:600;color:var(--color-text-primary)}.settings-nav.svelte-6dohdz{display:flex;flex-direction:column;flex:1;padding-top:0}.settings-nav.svelte-6dohdz button[data-slot=tabs-trigger]{display:flex;align-items:center;width:100%;height:40px;padding:0 12px 0 19px;gap:11px;border:none;background:transparent;cursor:pointer;font-family:inherit;font-size:14px;color:var(--color-text-secondary);transition:color .15s,background .15s}.settings-nav.svelte-6dohdz button[data-slot=tabs-trigger]:hover{background:var(--color-bg-hover);color:var(--color-text-primary)}.settings-nav.svelte-6dohdz button[data-slot=tabs-trigger][data-state=active]{background:var(--color-bg-hover);color:var(--color-text-primary);font-weight:500}.settings-nav.svelte-6dohdz button[data-slot=tabs-trigger] svg{width:14px;height:14px;flex-shrink:0;box-sizing:content-box;padding:0 4px}.filter-bar.svelte-6dohdz{position:relative;display:flex;align-items:center;height:40px;padding:0 12px 0 52px;border-bottom:1px solid var(--color-border);flex-shrink:0}.filter-icon.svelte-6dohdz{position:absolute;left:22px;top:50%;transform:translateY(-50%);display:flex;align-items:center;justify-content:center;width:16px;color:var(--color-text-tertiary)}.filter-bar.svelte-6dohdz .filter-input{flex:1;background:transparent;border:none;outline:none;padding:0;margin:0;font-size:14px;line-height:1.4;height:auto;border-radius:0}.filter-bar.svelte-6dohdz .filter-clear{width:20px;height:20px;flex-shrink:0}.filter-bar.svelte-6dohdz .sort-toggle{width:28px;height:28px;flex-shrink:0;margin-left:4px}.filter-bar.svelte-6dohdz .sort-toggle.active{color:var(--color-accent, #e05050)}.repo-type-icon.svelte-6dohdz{display:inline-flex;align-items:center;color:var(--color-text-tertiary);margin-right:6px;flex-shrink:0;align-self:center}.tree.svelte-6dohdz{flex:1;overflow-y:auto;padding-top:0}.tree-group.svelte-6dohdz{display:flex;flex-direction:column}.tree-group.svelte-6dohdz+.tree-group:where(.svelte-6dohdz){margin-top:0}.repo-row{display:flex;align-items:baseline;height:40px;line-height:40px;width:100%;padding:0 12px 0 20px;border:none;background:transparent;font-family:inherit;text-align:left;border-left:2px solid transparent;border-radius:0;gap:0;justify-content:flex-start}.repo-row:hover,.repo-row.focused{background:var(--color-bg-hover)}.repo-row.repo-active{border-left-color:var(--active-color)}.repo-name.svelte-6dohdz{font-size:14px;color:var(--color-text-secondary)}.repo-row.repo-active .repo-name.svelte-6dohdz,.repo-row.repo-active .repo-type-icon.svelte-6dohdz{font-weight:600;color:var(--color-text-primary)}.tree-row{position:relative;display:flex;align-items:baseline;height:40px;line-height:40px;padding-right:40px;color:var(--color-text-secondary);font-size:14px;border:none;background:transparent;font-family:inherit;text-align:left;width:100%;border-left:2px solid transparent;border-radius:0;gap:0;justify-content:flex-start}.tree-row:hover,.tree-row.focused{background:var(--color-bg-hover)}.tree-row.selected{background:var(--color-bg-selected);border-left-color:var(--active-color);color:var(--color-text-primary);font-weight:600}.row-chevron.svelte-6dohdz{display:inline-flex;align-items:center;justify-content:center;width:16px;height:40px;flex-shrink:0;margin-right:14px;color:var(--color-text-tertiary);align-self:center}.row-label.svelte-6dohdz{flex:1;overflow:hidden;white-space:nowrap;mask-image:linear-gradient(to right,black calc(100% - 16px),transparent 100%);-webkit-mask-image:linear-gradient(to right,black calc(100% - 16px),transparent 100%)}.item-count.svelte-6dohdz{font-size:12px;color:var(--color-text-tertiary);margin-left:8px;flex-shrink:0}.indent-group.svelte-6dohdz{position:relative}.indent-group.svelte-6dohdz:before{content:"";position:absolute;left:var(--guide-left);top:0;bottom:0;width:1px;background:var(--color-border);pointer-events:none}.loading-row.svelte-6dohdz{height:40px;display:flex;align-items:center;font-size:14px;color:var(--color-text-tertiary)}.type-header-row{color:var(--color-text-secondary);border-left:2px solid transparent}.type-header-row.type-active{color:var(--color-text-primary);font-weight:600}.type-header-row .row-label.svelte-6dohdz{flex:none;mask-image:none;-webkit-mask-image:none}.new-entity-row{color:var(--color-text-tertiary);align-items:center}.new-entity-row:hover{color:var(--color-text-secondary)}.entity-row-wrapper.svelte-6dohdz{position:relative;display:flex;align-items:center}.entity-row-wrapper.svelte-6dohdz .tree-row{flex:1;min-width:0}.entity-row-wrapper.svelte-6dohdz .entity-actions-btn{display:none;width:28px;height:28px;position:absolute;right:12px;flex-shrink:0;padding:0;border:none;background:none;cursor:pointer;color:var(--color-text-tertiary);border-radius:4px;align-items:center;justify-content:center}.entity-row-wrapper.svelte-6dohdz .entity-actions-btn:hover{background:var(--color-bg-hover);color:var(--color-text-primary)}.entity-row-wrapper.svelte-6dohdz:hover .tree-row,.entity-row-wrapper.svelte-6dohdz:has(.entity-actions-btn.menu-open) .tree-row{background:var(--color-bg-hover)}.entity-row-wrapper.svelte-6dohdz:hover .entity-actions-btn,.entity-row-wrapper.svelte-6dohdz .entity-actions-btn.menu-open{display:inline-flex}.entity-type-dot.svelte-6dohdz{width:6px;height:6px;border-radius:50%;flex-shrink:0;margin-right:19px;align-self:center}.recent-time.svelte-6dohdz{font-size:12px;color:var(--color-text-tertiary);position:absolute;right:26px;top:50%;transform:translate(50%,-50%);white-space:nowrap}.entity-row-wrapper.svelte-6dohdz:hover .recent-time:where(.svelte-6dohdz){display:none}.presence-stack.svelte-6dohdz{display:flex;align-items:center;gap:-4px;margin-left:auto;flex-shrink:0;align-self:center}.presence-avatar.svelte-6dohdz{width:18px;height:18px;border-radius:50%;font-size:10px;font-weight:600;color:#fff;background:var(--color-accent);display:flex;align-items:center;justify-content:center;margin-left:-3px;border:1px solid var(--color-bg);box-sizing:border-box;flex-shrink:0;align-self:center}.presence-stack.svelte-6dohdz .presence-avatar:where(.svelte-6dohdz):first-child{margin-left:4px}.repo-row .presence-stack.svelte-6dohdz{margin-right:28px}.presence-avatar.svelte-6dohdz:nth-child(1){z-index:3}.presence-avatar.svelte-6dohdz:nth-child(2){z-index:2}.presence-avatar.svelte-6dohdz:nth-child(3){z-index:1}.filter-match.svelte-6dohdz{background:var(--color-accent, #e05050);color:#fff;border-radius:2px;padding:0}.no-results.svelte-6dohdz{padding:24px 16px;font-size:14px;color:var(--color-text-tertiary);text-align:center}.repo-row .repo-rename-input{flex:1;min-width:0;height:100%;padding:0 6px;margin:0;border:1px solid var(--color-accent, #e05050);border-radius:3px;font-size:14px;font-weight:600}.repo-row-wrapper.svelte-6dohdz{position:relative;display:flex;align-items:center}.repo-row-wrapper.drop-target.svelte-6dohdz{outline:2px solid var(--color-accent, #e05050);outline-offset:-2px;border-radius:6px;background:#e0505014}.import-modal{max-width:480px}.import-modal .dialog-header{flex-direction:column;align-items:flex-start;gap:4px}.import-modal-body.svelte-6dohdz{padding:16px 24px 8px}.import-modal .dialog-footer{border-top:none}.import-file-list.svelte-6dohdz{display:flex;flex-direction:column;max-height:240px;overflow-y:auto}.import-file-row.svelte-6dohdz{display:flex;align-items:center;gap:10px;padding:10px 12px;border-bottom:1px solid var(--color-border)}.import-file-icon.svelte-6dohdz{flex-shrink:0;color:var(--color-text-tertiary)}.import-file-info.svelte-6dohdz{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.import-file-name.svelte-6dohdz{font-size:14px;color:var(--color-text-primary);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.import-file-size.svelte-6dohdz{font-size:12px;color:var(--color-text-tertiary)}.import-file-remove.svelte-6dohdz{flex-shrink:0;background:none;border:none;color:var(--color-text-tertiary);cursor:pointer;padding:4px;border-radius:4px;display:flex;align-items:center;justify-content:center}.import-file-remove.svelte-6dohdz:hover{color:var(--color-text-primary);background:var(--color-bg-hover)}.import-drop-zone.svelte-6dohdz{border:1px solid var(--color-border, #333);border-radius:0;padding:40px 16px;text-align:center;color:var(--color-text-tertiary);font-size:15px;min-height:180px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;transition:background .15s}.import-drop-zone-compact.svelte-6dohdz{min-height:0;padding:14px 16px;border-top:none}.import-hint.svelte-6dohdz{font-size:13px;color:var(--color-text-tertiary);margin:0}.file-picker-link.svelte-6dohdz{background:none;border:none;color:var(--color-accent, #e05050);cursor:pointer;text-decoration:underline;font-size:15px;padding:0}.file-picker-link-sm.svelte-6dohdz{font-size:13px}.repo-row-wrapper.svelte-6dohdz .repo-row{flex:1;min-width:0}.repo-row-wrapper.svelte-6dohdz .repo-actions-btn{display:none;width:28px;height:28px;position:absolute;right:12px;flex-shrink:0;padding:0;border:none;background:none;cursor:pointer;color:var(--color-text-tertiary);border-radius:4px;align-items:center;justify-content:center}.repo-row-wrapper.svelte-6dohdz .repo-actions-btn:hover{background:var(--color-bg-hover);color:var(--color-text-primary)}.repo-row-wrapper.svelte-6dohdz:hover .repo-row,.repo-row-wrapper.svelte-6dohdz:has(.repo-actions-btn.menu-open) .repo-row{background:var(--color-bg-hover)}.repo-row-wrapper.svelte-6dohdz:hover .repo-actions-btn,.repo-row-wrapper.svelte-6dohdz .repo-actions-btn.menu-open{display:inline-flex}.type-header-wrapper.svelte-6dohdz{position:relative;display:flex;align-items:center}.type-header-wrapper.svelte-6dohdz .type-header-row{flex:1;min-width:0}.type-header-wrapper.svelte-6dohdz .type-actions-btn{display:none;width:24px;height:24px;position:absolute;right:12px;flex-shrink:0;padding:0;border:none;background:none;cursor:pointer;color:var(--color-text-tertiary);border-radius:4px;align-items:center;justify-content:center}.type-header-wrapper.svelte-6dohdz .type-actions-btn:hover{background:var(--color-bg-hover);color:var(--color-text-primary)}.type-header-wrapper.svelte-6dohdz:hover .type-header-row,.type-header-wrapper.svelte-6dohdz:has(.type-actions-btn.menu-open) .type-header-row{background:var(--color-bg-hover)}.type-header-wrapper.svelte-6dohdz:hover .type-actions-btn,.type-header-wrapper.svelte-6dohdz .type-actions-btn.menu-open{display:inline-flex}.repo-actions-menu{min-width:120px;padding:4px;border-radius:6px;background:var(--color-bg-elevated);border:1px solid var(--color-border);box-shadow:0 4px 12px #00000026;z-index:1000}.repo-menu-item{display:flex;align-items:center;gap:8px;padding:6px 8px;border-radius:4px;cursor:pointer;font-size:13px;color:var(--color-text-primary)}.repo-menu-item:hover{background:var(--color-bg-hover)}.repo-menu-item-danger{color:var(--color-error, #e55)}.new-collection-btn,.new-collection-btn .repo-name.svelte-6dohdz,.new-collection-btn .row-chevron.svelte-6dohdz{color:var(--color-text-tertiary)}.new-collection-btn:hover,.new-collection-btn:hover .repo-name.svelte-6dohdz{color:var(--color-text-secondary)}.new-collection-row.svelte-6dohdz{display:flex;align-items:center;height:40px;padding:0 12px 0 20px;border-left:2px solid transparent}.new-collection-row.svelte-6dohdz .new-collection-input{flex:1;height:100%;padding:0 0 0 30px;border:none;background:transparent;font-size:14px;border-radius:0}.new-collection-row.svelte-6dohdz .new-collection-clear{width:20px;height:20px;flex-shrink:0;margin-right:4px}.new-collection-row.svelte-6dohdz .private-toggle{width:20px;height:20px;flex-shrink:0;margin-left:auto;margin-right:4px;color:var(--color-text-secondary)}.new-collection-row.svelte-6dohdz .private-toggle.active{color:var(--color-accent, #e05050)}@keyframes svelte-6dohdz-shake{0%,to{transform:translate(0)}20%{transform:translate(-4px)}40%{transform:translate(4px)}60%{transform:translate(-3px)}80%{transform:translate(2px)}}.new-collection-row.svelte-6dohdz .new-collection-input.shake{animation:svelte-6dohdz-shake .3s ease-in-out}.sidebar-footer.svelte-6dohdz{display:flex;align-items:center;height:40px;padding:0 12px 0 19px;border-top:1px solid var(--color-border);flex-shrink:0;gap:8px}.user-email.svelte-6dohdz{flex:1;font-size:13px;color:var(--color-text-tertiary);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sidebar-footer.svelte-6dohdz .footer-icon-btn{width:28px;height:28px}.chat-panel.svelte-1xwj6s7{width:340px;min-width:340px;flex-shrink:0;display:flex;flex-direction:column;background:var(--color-bg);border-left:1px solid var(--color-border)}.chat-panel.chat-full.svelte-1xwj6s7{width:100%;min-width:0;flex:1;border-left:none}.chat-full.svelte-1xwj6s7 .chat-messages:where(.svelte-1xwj6s7){padding-left:calc((100% - 720px)/2);padding-right:calc((100% - 720px)/2)}.chat-full.svelte-1xwj6s7 .chat-input-area:where(.svelte-1xwj6s7){padding-left:calc((100% - 720px)/2);padding-right:calc((100% - 720px)/2)}.chat-header.svelte-1xwj6s7{height:40px;display:flex;align-items:center;justify-content:space-between;padding:0 16px;border-bottom:1px solid var(--color-border);position:relative;flex-shrink:0}.chat-header-left.svelte-1xwj6s7,.chat-header-right.svelte-1xwj6s7{display:flex;align-items:center;gap:2px}.history-active{color:var(--color-accent, #e05050)!important}.history-active:not(:hover){background:transparent!important}.session-dropdown.svelte-1xwj6s7{position:absolute;top:100%;left:0;right:0;z-index:10;box-shadow:0 4px 12px #0000001f}.session-list.svelte-1xwj6s7{max-height:240px;overflow-y:auto;background:var(--color-bg);border-bottom:1px solid var(--color-border)}.session-row.svelte-1xwj6s7{position:relative;display:flex;align-items:center}.session-row.svelte-1xwj6s7 .session-item{display:flex;align-items:center;justify-content:flex-start;flex:1;min-width:0;padding:0 32px 0 16px;height:40px;line-height:40px;font-size:14px;color:var(--color-text-secondary);text-align:left;border-radius:0}.session-row.svelte-1xwj6s7:hover .session-item{background:var(--color-bg-hover)}.session-row.svelte-1xwj6s7 .session-item.active{background:var(--color-bg-hover);color:var(--color-text-primary);font-weight:500}.session-row.svelte-1xwj6s7 .session-delete-btn{display:none;width:20px;height:20px;position:absolute;right:6px;flex-shrink:0;padding:0}.session-row.svelte-1xwj6s7 .session-delete-btn:hover{color:var(--color-error, #e55)}.session-row.svelte-1xwj6s7:hover .session-delete-btn{display:flex}.session-title.svelte-1xwj6s7{flex:1;overflow:hidden;white-space:nowrap;min-width:0;mask-image:linear-gradient(to right,black calc(100% - 24px),transparent 100%);-webkit-mask-image:linear-gradient(to right,black calc(100% - 24px),transparent 100%)}.chat-messages.svelte-1xwj6s7{flex:1;overflow-y:auto;padding:24px 16px;display:flex;flex-direction:column;gap:32px}.empty-state.svelte-1xwj6s7{flex:1;display:flex;align-items:center;justify-content:center;color:var(--color-text-tertiary);font-size:14px}.seed-prompts.svelte-1xwj6s7{display:flex;flex-direction:column;gap:8px;width:100%}.seed-prompts.svelte-1xwj6s7 .seed-prompt{font-size:14px;line-height:20px;padding:9px 13px;min-height:40px;height:auto;border-radius:8px;color:var(--color-text-secondary);text-align:left;white-space:normal;justify-content:flex-start}.seed-prompts.svelte-1xwj6s7 .seed-prompt:hover{background:var(--color-bg-hover);color:var(--color-text-primary)}.message-group.svelte-1xwj6s7{display:flex;flex-direction:column;gap:16px}.user-bubble.svelte-1xwj6s7{background:var(--color-bg-surface);border-radius:8px;padding:12px 14px;font-size:14px;line-height:22px;color:var(--color-text-primary)}.agent-content.svelte-1xwj6s7{display:flex;flex-direction:column;gap:14px;position:relative}.msg-actions.svelte-1xwj6s7{display:flex;gap:2px;align-self:flex-start}.copy-btn.svelte-1xwj6s7{display:flex;align-items:center;justify-content:center;background:none;border:none;color:var(--color-text-tertiary);cursor:pointer;padding:4px;border-radius:4px;align-self:flex-start}.copy-btn.svelte-1xwj6s7:hover{color:var(--color-text-primary);background:var(--color-bg-hover)}.tool-calls.svelte-1xwj6s7{display:flex;flex-direction:column;gap:4px}.tool-call.svelte-1xwj6s7{font-family:var(--font-mono);font-size:12px;color:var(--color-accent)}.agent-text.svelte-1xwj6s7{font-size:14px;line-height:22px;color:var(--color-text-primary)}.prose.svelte-1xwj6s7 h1{font-size:18px;font-weight:600;color:var(--color-text-primary);margin:24px 0 12px}.prose.svelte-1xwj6s7 h2{font-size:16px;font-weight:600;color:var(--color-text-primary);margin:22px 0 10px}.prose.svelte-1xwj6s7 h3{font-size:15px;font-weight:600;color:var(--color-text-primary);margin:20px 0 8px}.prose.svelte-1xwj6s7 p{margin:0 0 14px}.prose.svelte-1xwj6s7 p:last-child{margin-bottom:0}.prose.svelte-1xwj6s7 strong{font-weight:600}.prose.svelte-1xwj6s7 ul,.prose.svelte-1xwj6s7 ol{padding-left:20px;margin:0 0 14px;color:var(--color-text-primary)}.prose.svelte-1xwj6s7 ul{list-style-type:disc}.prose.svelte-1xwj6s7 ol{list-style-type:decimal}.prose.svelte-1xwj6s7 li{margin-bottom:6px}.prose.svelte-1xwj6s7 table{width:100%;border-collapse:collapse;font-size:13px;margin:16px 0}.prose.svelte-1xwj6s7 th,.prose.svelte-1xwj6s7 td{border:1px solid var(--color-border);padding:4px 8px;text-align:left;vertical-align:top}.prose.svelte-1xwj6s7 th{font-weight:600}.prose.svelte-1xwj6s7 pre{background:var(--color-bg-surface);border-radius:6px;padding:10px 12px;overflow-x:auto;margin:16px 0;font-family:var(--font-mono);font-size:13px;line-height:18px}.prose.svelte-1xwj6s7 code{font-family:var(--font-mono);font-size:13px;background:var(--color-bg-surface);padding:1px 4px;border-radius:3px}.prose.svelte-1xwj6s7 pre code{background:none;padding:0}.prose.svelte-1xwj6s7 a{color:var(--color-link)}.prose.svelte-1xwj6s7 blockquote{border-left:3px solid var(--color-accent);padding-left:12px;margin:16px 0;color:var(--color-text-secondary)}.prose.svelte-1xwj6s7 hr{border:none;border-top:1px solid var(--color-border);margin:24px 0}.streaming-dot.svelte-1xwj6s7{display:inline-block;width:8px;height:8px;background:var(--color-accent);border-radius:4px;animation:svelte-1xwj6s7-pulse 1s ease-in-out infinite}@keyframes svelte-1xwj6s7-pulse{0%,to{opacity:.3}50%{opacity:1}}.context-chip.svelte-1xwj6s7{font-size:12px;color:var(--color-text-tertiary);padding:0 2px 4px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chat-input-area.svelte-1xwj6s7{padding:12px 16px 16px}.text-input.svelte-1xwj6s7{display:flex;align-items:flex-end;min-height:40px;max-height:140px;padding:0 0 0 13px;background:transparent;border:1px solid var(--color-border);border-radius:8px;transition:border-color .15s}.text-input.svelte-1xwj6s7:focus-within{border-color:var(--color-accent)}.send-btn{color:var(--color-text-tertiary);margin:6px;flex-shrink:0;pointer-events:none}.send-btn.send-active{pointer-events:auto;color:#fff;background:var(--color-accent);border-radius:6px}.stop-btn{color:#fff;background:var(--color-accent);border-radius:6px}.input-field.svelte-1xwj6s7{flex:1;background:transparent;border:none;outline:none;font-family:inherit;font-size:14px;line-height:20px;color:var(--color-text-primary);resize:none;overflow-y:auto;padding:9px 0;max-height:120px;field-sizing:content}.input-field.svelte-1xwj6s7::placeholder{color:var(--color-text-tertiary)}.input-field.svelte-1xwj6s7:disabled{opacity:.5}.search-header.svelte-1xems06{display:flex;align-items:center;height:52px;padding:0 16px;gap:10px;border-bottom:1px solid var(--color-border)}.search-header.svelte-1xems06 svg{color:var(--color-text-tertiary);flex-shrink:0}.search-header.svelte-1xems06 .search-input{flex:1;font-size:16px;line-height:20px;border:none;background:transparent;box-shadow:none;padding:0;height:auto}.search-header.svelte-1xems06 .search-input:focus{box-shadow:none;border:none}.esc-badge.svelte-1xems06{font-family:var(--font-sans);font-size:12px;line-height:1;padding:3px 6px;border-radius:4px;background:var(--color-bg-surface);border:1px solid var(--color-border);color:var(--color-text-tertiary)}.results-list.svelte-1xems06{flex:1;overflow-y:auto;min-height:0}.empty-results.svelte-1xems06{padding:24px 16px;text-align:center;font-size:14px;color:var(--color-text-tertiary)}.results-list.svelte-1xems06 .result-row{display:flex;align-items:flex-start;padding:10px 16px;width:100%;text-align:left;border-radius:0;height:auto;justify-content:flex-start}.results-list.svelte-1xems06 .result-row:hover,.results-list.svelte-1xems06 .result-row.selected{background:var(--color-bg-hover)}.result-body.svelte-1xems06{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.result-title-row.svelte-1xems06{display:flex;align-items:center;gap:8px}.result-title.svelte-1xems06{font-size:14px;font-weight:500;color:var(--color-text-primary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.entity-tag.svelte-1xems06{flex-shrink:0;font-size:11px;font-weight:500;letter-spacing:.04em;text-transform:uppercase;padding:1px 6px;border-radius:3px;background:var(--color-badge-bg);color:var(--color-badge-text)}.result-meta.svelte-1xems06{font-size:13px;color:var(--color-text-tertiary)}.search-footer.svelte-1xems06{display:flex;align-items:center;height:39px;padding:0 16px;gap:16px;border-top:1px solid var(--color-border)}.shortcut-group.svelte-1xems06{display:flex;align-items:center;gap:4px}.shortcut-key.svelte-1xems06{display:inline-flex;align-items:center;justify-content:center;min-width:20px;height:20px;padding:0 4px;border-radius:4px;background:var(--color-bg-surface);border:1px solid var(--color-border);color:var(--color-text-tertiary)}.shortcut-label.svelte-1xems06{font-size:12px;color:var(--color-text-tertiary);margin-left:2px}.app-frame.svelte-vr1z90{width:100vw;height:100vh;display:flex;flex-direction:column;overflow:hidden;background:var(--color-bg)}.app-body.svelte-vr1z90{flex:1;display:flex;min-height:0;overflow:hidden}.main-content.svelte-vr1z90{flex:1;display:flex;flex-direction:column;min-width:0;min-height:0;overflow:hidden}#sg-chrome-footer{flex-shrink:0}
@@ -1 +1 @@
1
- import{a as p,s as fe,f as Q,p as X,g as x,b as W}from"./DfwW1gF2.js";import{i as ve}from"./Dr5ZUnae.js";import{p as H,l as q,s as N,d as U,g as i,a as pe,c as I,n as ge,r as R,b as T,m as G,t as he,a4 as O,aS as D,ag as E,Y as _e,a6 as me}from"./yMbbhP0p.js";import{i as k}from"./DSZYl5ah.js";import{a as z,s as A}from"./l5w7mUkV.js";import{l as J,p as l,r as $,s as ce}from"./DVyuW48M.js";import{c as ee,n as j,M as ye,b,m as B,a as be,d as Pe,e as we,F as Me,f as Se,P as Ce,g as xe,h as ue,D as Oe,i as Fe,j as Ie}from"./SAMwKg4j.js";import{r as le}from"./FmR2V1-h.js";var Re=Q("<title> </title>"),Ae=Q('<svg><!><path d="M17.4141 16 24 9.4141 22.5859 8 16 14.5859 9.4143 8 8 9.4141 14.5859 16 8 22.5859 9.4143 24 16 17.4141 22.5859 24 24 22.5859 17.4141 16z"></path></svg>');function $e(c,e){const o=J(e,["children","$$slots","$$events","$$legacy"]),g=J(o,["size","title"]);H(e,!1);const u=G(),f=G();let P=l(e,"size",8,16),v=l(e,"title",8,void 0);q(()=>(U(o),U(v())),()=>{N(u,o["aria-label"]||o["aria-labelledby"]||v())}),q(()=>(i(u),U(o)),()=>{N(f,{"aria-hidden":i(u)?void 0:!0,role:i(u)?"img":void 0,focusable:Number(o.tabindex)===0?!0:void 0})}),pe(),ve();var d=Ae();z(d,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:P(),height:P(),...i(f),...g}));var w=I(d);{var h=_=>{var n=Re(),t=I(n,!0);R(n),he(()=>fe(t,v())),p(_,n)};k(w,_=>{v()&&_(h)})}ge(),R(d),p(c,d),T()}var Ee=W("<div><!></div>");function ze(c,e){const o=X();H(e,!0);let g=l(e,"ref",15,null),u=l(e,"id",19,()=>ee(o)),f=l(e,"disabled",3,!1),P=l(e,"onSelect",3,j),v=l(e,"closeOnSelect",3,!0),d=$(e,["$$slots","$$events","$$legacy","child","children","ref","id","disabled","onSelect","closeOnSelect"]);const w=ye.create({id:b(()=>u()),disabled:b(()=>f()),onSelect:b(()=>P()),ref:b(()=>g(),r=>g(r)),closeOnSelect:b(()=>v())}),h=E(()=>B(d,w.props));var _=x(),n=O(_);{var t=r=>{var s=x(),m=O(s);A(m,()=>e.child,()=>({props:i(h)})),p(r,s)},a=r=>{var s=Ee();z(s,()=>({...i(h)}));var m=I(s);A(m,()=>e.children??D),R(s),p(r,s)};k(n,r=>{e.child?r(t):r(a,!1)})}p(c,_),T()}var ke=W("<div><!></div>");function Ke(c,e){const o=X();H(e,!0);let g=l(e,"ref",15,null),u=l(e,"id",19,()=>ee(o)),f=$(e,["$$slots","$$events","$$legacy","ref","id","child","children"]);const P=be.create({id:b(()=>u()),ref:b(()=>g(),n=>g(n))}),v=E(()=>B(f,P.props));var d=x(),w=O(d);{var h=n=>{var t=x(),a=O(t);A(a,()=>e.child,()=>({props:i(v)})),p(n,t)},_=n=>{var t=ke();z(t,()=>({...i(v)}));var a=I(t);A(a,()=>e.children??D),R(t),p(n,t)};k(w,n=>{e.child?n(h):n(_,!1)})}p(c,d),T()}function He(c,e){H(e,!0);let o=l(e,"open",15,!1),g=l(e,"dir",3,"ltr"),u=l(e,"onOpenChange",3,j),f=l(e,"onOpenChangeComplete",3,j),P=l(e,"_internal_variant",3,"dropdown-menu");const v=Pe.create({variant:b(()=>P()),dir:b(()=>g()),onClose:()=>{o(!1),u()(!1)}});we.create({open:b(()=>o(),d=>{o(d),u()(d)}),onOpenChangeComplete:b(()=>f())},v),Me(c,{children:(d,w)=>{var h=x(),_=O(h);A(_,()=>e.children??D),p(d,h)},$$slots:{default:!0}}),T()}var Te=W("<div><div><!></div></div>"),Ue=W("<div><div><!></div></div>");function je(c,e){const o=X();H(e,!0);let g=l(e,"id",19,()=>ee(o)),u=l(e,"ref",15,null),f=l(e,"loop",3,!0),P=l(e,"onInteractOutside",3,j),v=l(e,"onEscapeKeydown",3,j),d=l(e,"onCloseAutoFocus",3,j),w=l(e,"forceMount",3,!1),h=l(e,"trapFocus",3,!1),_=$(e,["$$slots","$$events","$$legacy","id","child","children","ref","loop","onInteractOutside","onEscapeKeydown","onCloseAutoFocus","forceMount","trapFocus","style"]);const n=Se.create({id:b(()=>g()),loop:b(()=>f()),ref:b(()=>u(),y=>u(y)),onCloseAutoFocus:b(()=>d())}),t=E(()=>B(_,n.props));function a(y){if(n.handleInteractOutside(y),!y.defaultPrevented&&(P()(y),!y.defaultPrevented)){if(y.target&&y.target instanceof Element){const re=`[${n.parentMenu.root.getBitsAttr("sub-content")}]`;if(y.target.closest(re))return}n.parentMenu.onClose()}}function r(y){v()(y),!y.defaultPrevented&&n.parentMenu.onClose()}var s=x(),m=O(s);{var C=y=>{Ce(y,ce(()=>i(t),()=>n.popperProps,{get ref(){return n.opts.ref},get enabled(){return n.parentMenu.opts.open.current},onInteractOutside:a,onEscapeKeydown:r,get trapFocus(){return h()},get loop(){return f()},forceMount:!0,get id(){return g()},get shouldRender(){return n.shouldRender},popper:(ne,L)=>{let ae=()=>L?.().props,Z=()=>L?.().wrapperProps;const V=E(()=>B(ae(),{style:ue("dropdown-menu")},{style:e.style}));var Y=x(),oe=O(Y);{var se=S=>{var M=x(),F=O(M);{let K=E(()=>({props:i(V),wrapperProps:Z(),...n.snippetProps}));A(F,()=>e.child,()=>i(K))}p(S,M)},ie=S=>{var M=Te();z(M,()=>({...Z()}));var F=I(M);z(F,()=>({...i(V)}));var K=I(F);A(K,()=>e.children??D),R(F),R(M),p(S,M)};k(oe,S=>{e.child?S(se):S(ie,!1)})}p(ne,Y)},$$slots:{popper:!0}}))},te=y=>{xe(y,ce(()=>i(t),()=>n.popperProps,{get ref(){return n.opts.ref},get open(){return n.parentMenu.opts.open.current},onInteractOutside:a,onEscapeKeydown:r,get trapFocus(){return h()},get loop(){return f()},forceMount:!1,get id(){return g()},get shouldRender(){return n.shouldRender},popper:(ne,L)=>{let ae=()=>L?.().props,Z=()=>L?.().wrapperProps;const V=E(()=>B(ae(),{style:ue("dropdown-menu")},{style:e.style}));var Y=x(),oe=O(Y);{var se=S=>{var M=x(),F=O(M);{let K=E(()=>({props:i(V),wrapperProps:Z(),...n.snippetProps}));A(F,()=>e.child,()=>i(K))}p(S,M)},ie=S=>{var M=Ue();z(M,()=>({...Z()}));var F=I(M);z(F,()=>({...i(V)}));var K=I(F);A(K,()=>e.children??D),R(F),R(M),p(S,M)};k(oe,S=>{e.child?S(se):S(ie,!1)})}p(ne,Y)},$$slots:{popper:!0}}))};k(m,y=>{w()?y(C):w()||y(te,1)})}p(c,s),T()}var Be=W("<button><!></button>");function De(c,e){const o=X();H(e,!0);let g=l(e,"id",19,()=>ee(o)),u=l(e,"ref",15,null),f=l(e,"disabled",3,!1),P=l(e,"type",3,"button"),v=$(e,["$$slots","$$events","$$legacy","id","ref","child","children","disabled","type"]);const d=Oe.create({id:b(()=>g()),disabled:b(()=>f()??!1),ref:b(()=>u(),h=>u(h))}),w=E(()=>B(v,d.props,{type:P()}));Fe(c,{get id(){return g()},get ref(){return d.opts.ref},children:(h,_)=>{var n=x(),t=O(n);{var a=s=>{var m=x(),C=O(m);A(C,()=>e.child,()=>({props:i(w)})),p(s,m)},r=s=>{var m=Be();z(m,()=>({...i(w)}));var C=I(m);A(C,()=>e.children??D),R(m),p(s,m)};k(t,s=>{e.child?s(a):s(r,!1)})}p(h,n)},$$slots:{default:!0}}),T()}const et=He,tt=De,rt=Ie,nt=je,at=ze,ot=Ke;function Le(){let c=_e(me({})),e=null,o=null;function g(t,a,r){o&&(clearInterval(o),o=null),e=`${t}/${a}/${r}`,f("enter",t,a,r),o=setInterval(()=>{e&&f("heartbeat",t,a,r)},3e4)}function u(){if(o&&(clearInterval(o),o=null),e){const[t,a,r]=e.split("/");t&&a&&r&&f("leave",t,a,r),e=null}}function f(t,a,r,s){le.send({type:"presence",action:t,repo:a,entityType:r,entityId:s})}function P(t){const a=`${t.repo}/${t.entityType}/${t.entityId}`,r=i(c)[a]??[];if(t.action==="leave")i(c)[a]=r.filter(s=>s.id!==t.user.id);else{const s=r.findIndex(m=>m.id===t.user.id);s>=0?(r[s]=t.user,i(c)[a]=[...r]):i(c)[a]=[...r,t.user]}}function v(){if(N(c,{},!0),!e)return;const[t,a,r]=e.split("/");t&&a&&r&&f("enter",t,a,r)}function d(t,a,r,s){const m=`${t}/${a}/${r}`,C=i(c)[m]??[];return s?C.filter(te=>te.id!==s):C}function w(t,a){const r=new Map;for(const[s,m]of Object.entries(i(c)))if(s.startsWith(t))for(const C of m)(!a||C.id!==a)&&r.set(C.id,C);return[...r.values()]}function h(t,a){return w(`${t}/`,a)}function _(t){const a=new Map;for(const r of Object.values(i(c)))for(const s of r)(!t||s.id!==t)&&a.set(s.id,s);return[...a.values()]}const n=E(()=>{const t=new Map;for(const a of Object.values(i(c)))for(const r of a)t.set(r.id,r);return[...t.values()]});return{enter:g,leave:u,handlePresenceEvent:P,resetAndResend:v,getPresence:d,getPresenceByPrefix:w,getRepoPresence:h,getAllUsers:_,get allUsers(){return i(n)}}}const de=Le();le.setPresenceHandler(c=>de.handlePresenceEvent(c));le.addConnectHandler(()=>de.resetAndResend());typeof window<"u"&&window.addEventListener("beforeunload",()=>de.leave());var Ze=Q("<title> </title>"),Ve=Q('<svg><!><path d="M25,12H20v2h5a1.0008,1.0008,0,0,1,1,1v2H22a3.0033,3.0033,0,0,0-3,3v1a3.0033,3.0033,0,0,0,3,3h6V15A3.0033,3.0033,0,0,0,25,12ZM22,22a1.0008,1.0008,0,0,1-1-1V20a1.0008,1.0008,0,0,1,1-1h4v3Z"></path><path d="M16,24h2L12,7H10L4,24H6l1.6936-5h6.6135ZM8.3711,17l2.4966-7.3711.2668.0005L13.63,17Z"></path></svg>');function st(c,e){const o=J(e,["children","$$slots","$$events","$$legacy"]),g=J(o,["size","title"]);H(e,!1);const u=G(),f=G();let P=l(e,"size",8,16),v=l(e,"title",8,void 0);q(()=>(U(o),U(v())),()=>{N(u,o["aria-label"]||o["aria-labelledby"]||v())}),q(()=>(i(u),U(o)),()=>{N(f,{"aria-hidden":i(u)?void 0:!0,role:i(u)?"img":void 0,focusable:Number(o.tabindex)===0?!0:void 0})}),pe(),ve();var d=Ve();z(d,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:P(),height:P(),...i(f),...g}));var w=I(d);{var h=_=>{var n=Ze(),t=I(n,!0);R(n),he(()=>fe(t,v())),p(_,n)};k(w,_=>{v()&&_(h)})}ge(2),R(d),p(c,d),T()}export{nt as C,at as I,rt as P,et as R,ot as S,tt as T,st as a,$e as b,de as p};
1
+ import{a as p,s as fe,f as Q,p as X,g as x,b as W}from"./DY21hM66.js";import{i as ve}from"./BpQkNqbd.js";import{p as H,l as q,s as N,d as U,g as i,a as pe,c as I,n as ge,r as R,b as T,m as G,t as he,a4 as O,aS as D,ag as E,Y as _e,a6 as me}from"./Bo0CMKlC.js";import{i as k}from"./BbsQ7LcO.js";import{a as z,s as A}from"./DNfruFPs.js";import{l as J,p as l,r as $,s as ce}from"./CdoeTcKU.js";import{c as ee,n as j,M as ye,b,m as B,a as be,d as Pe,e as we,F as Me,f as Se,P as Ce,g as xe,h as ue,D as Oe,i as Fe,j as Ie}from"./BRjGNUzV.js";import{r as le}from"./9TVbAwoF.js";var Re=Q("<title> </title>"),Ae=Q('<svg><!><path d="M17.4141 16 24 9.4141 22.5859 8 16 14.5859 9.4143 8 8 9.4141 14.5859 16 8 22.5859 9.4143 24 16 17.4141 22.5859 24 24 22.5859 17.4141 16z"></path></svg>');function $e(c,e){const o=J(e,["children","$$slots","$$events","$$legacy"]),g=J(o,["size","title"]);H(e,!1);const u=G(),f=G();let P=l(e,"size",8,16),v=l(e,"title",8,void 0);q(()=>(U(o),U(v())),()=>{N(u,o["aria-label"]||o["aria-labelledby"]||v())}),q(()=>(i(u),U(o)),()=>{N(f,{"aria-hidden":i(u)?void 0:!0,role:i(u)?"img":void 0,focusable:Number(o.tabindex)===0?!0:void 0})}),pe(),ve();var d=Ae();z(d,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:P(),height:P(),...i(f),...g}));var w=I(d);{var h=_=>{var n=Re(),t=I(n,!0);R(n),he(()=>fe(t,v())),p(_,n)};k(w,_=>{v()&&_(h)})}ge(),R(d),p(c,d),T()}var Ee=W("<div><!></div>");function ze(c,e){const o=X();H(e,!0);let g=l(e,"ref",15,null),u=l(e,"id",19,()=>ee(o)),f=l(e,"disabled",3,!1),P=l(e,"onSelect",3,j),v=l(e,"closeOnSelect",3,!0),d=$(e,["$$slots","$$events","$$legacy","child","children","ref","id","disabled","onSelect","closeOnSelect"]);const w=ye.create({id:b(()=>u()),disabled:b(()=>f()),onSelect:b(()=>P()),ref:b(()=>g(),r=>g(r)),closeOnSelect:b(()=>v())}),h=E(()=>B(d,w.props));var _=x(),n=O(_);{var t=r=>{var s=x(),m=O(s);A(m,()=>e.child,()=>({props:i(h)})),p(r,s)},a=r=>{var s=Ee();z(s,()=>({...i(h)}));var m=I(s);A(m,()=>e.children??D),R(s),p(r,s)};k(n,r=>{e.child?r(t):r(a,!1)})}p(c,_),T()}var ke=W("<div><!></div>");function Ke(c,e){const o=X();H(e,!0);let g=l(e,"ref",15,null),u=l(e,"id",19,()=>ee(o)),f=$(e,["$$slots","$$events","$$legacy","ref","id","child","children"]);const P=be.create({id:b(()=>u()),ref:b(()=>g(),n=>g(n))}),v=E(()=>B(f,P.props));var d=x(),w=O(d);{var h=n=>{var t=x(),a=O(t);A(a,()=>e.child,()=>({props:i(v)})),p(n,t)},_=n=>{var t=ke();z(t,()=>({...i(v)}));var a=I(t);A(a,()=>e.children??D),R(t),p(n,t)};k(w,n=>{e.child?n(h):n(_,!1)})}p(c,d),T()}function He(c,e){H(e,!0);let o=l(e,"open",15,!1),g=l(e,"dir",3,"ltr"),u=l(e,"onOpenChange",3,j),f=l(e,"onOpenChangeComplete",3,j),P=l(e,"_internal_variant",3,"dropdown-menu");const v=Pe.create({variant:b(()=>P()),dir:b(()=>g()),onClose:()=>{o(!1),u()(!1)}});we.create({open:b(()=>o(),d=>{o(d),u()(d)}),onOpenChangeComplete:b(()=>f())},v),Me(c,{children:(d,w)=>{var h=x(),_=O(h);A(_,()=>e.children??D),p(d,h)},$$slots:{default:!0}}),T()}var Te=W("<div><div><!></div></div>"),Ue=W("<div><div><!></div></div>");function je(c,e){const o=X();H(e,!0);let g=l(e,"id",19,()=>ee(o)),u=l(e,"ref",15,null),f=l(e,"loop",3,!0),P=l(e,"onInteractOutside",3,j),v=l(e,"onEscapeKeydown",3,j),d=l(e,"onCloseAutoFocus",3,j),w=l(e,"forceMount",3,!1),h=l(e,"trapFocus",3,!1),_=$(e,["$$slots","$$events","$$legacy","id","child","children","ref","loop","onInteractOutside","onEscapeKeydown","onCloseAutoFocus","forceMount","trapFocus","style"]);const n=Se.create({id:b(()=>g()),loop:b(()=>f()),ref:b(()=>u(),y=>u(y)),onCloseAutoFocus:b(()=>d())}),t=E(()=>B(_,n.props));function a(y){if(n.handleInteractOutside(y),!y.defaultPrevented&&(P()(y),!y.defaultPrevented)){if(y.target&&y.target instanceof Element){const re=`[${n.parentMenu.root.getBitsAttr("sub-content")}]`;if(y.target.closest(re))return}n.parentMenu.onClose()}}function r(y){v()(y),!y.defaultPrevented&&n.parentMenu.onClose()}var s=x(),m=O(s);{var C=y=>{Ce(y,ce(()=>i(t),()=>n.popperProps,{get ref(){return n.opts.ref},get enabled(){return n.parentMenu.opts.open.current},onInteractOutside:a,onEscapeKeydown:r,get trapFocus(){return h()},get loop(){return f()},forceMount:!0,get id(){return g()},get shouldRender(){return n.shouldRender},popper:(ne,L)=>{let ae=()=>L?.().props,Z=()=>L?.().wrapperProps;const V=E(()=>B(ae(),{style:ue("dropdown-menu")},{style:e.style}));var Y=x(),oe=O(Y);{var se=S=>{var M=x(),F=O(M);{let K=E(()=>({props:i(V),wrapperProps:Z(),...n.snippetProps}));A(F,()=>e.child,()=>i(K))}p(S,M)},ie=S=>{var M=Te();z(M,()=>({...Z()}));var F=I(M);z(F,()=>({...i(V)}));var K=I(F);A(K,()=>e.children??D),R(F),R(M),p(S,M)};k(oe,S=>{e.child?S(se):S(ie,!1)})}p(ne,Y)},$$slots:{popper:!0}}))},te=y=>{xe(y,ce(()=>i(t),()=>n.popperProps,{get ref(){return n.opts.ref},get open(){return n.parentMenu.opts.open.current},onInteractOutside:a,onEscapeKeydown:r,get trapFocus(){return h()},get loop(){return f()},forceMount:!1,get id(){return g()},get shouldRender(){return n.shouldRender},popper:(ne,L)=>{let ae=()=>L?.().props,Z=()=>L?.().wrapperProps;const V=E(()=>B(ae(),{style:ue("dropdown-menu")},{style:e.style}));var Y=x(),oe=O(Y);{var se=S=>{var M=x(),F=O(M);{let K=E(()=>({props:i(V),wrapperProps:Z(),...n.snippetProps}));A(F,()=>e.child,()=>i(K))}p(S,M)},ie=S=>{var M=Ue();z(M,()=>({...Z()}));var F=I(M);z(F,()=>({...i(V)}));var K=I(F);A(K,()=>e.children??D),R(F),R(M),p(S,M)};k(oe,S=>{e.child?S(se):S(ie,!1)})}p(ne,Y)},$$slots:{popper:!0}}))};k(m,y=>{w()?y(C):w()||y(te,1)})}p(c,s),T()}var Be=W("<button><!></button>");function De(c,e){const o=X();H(e,!0);let g=l(e,"id",19,()=>ee(o)),u=l(e,"ref",15,null),f=l(e,"disabled",3,!1),P=l(e,"type",3,"button"),v=$(e,["$$slots","$$events","$$legacy","id","ref","child","children","disabled","type"]);const d=Oe.create({id:b(()=>g()),disabled:b(()=>f()??!1),ref:b(()=>u(),h=>u(h))}),w=E(()=>B(v,d.props,{type:P()}));Fe(c,{get id(){return g()},get ref(){return d.opts.ref},children:(h,_)=>{var n=x(),t=O(n);{var a=s=>{var m=x(),C=O(m);A(C,()=>e.child,()=>({props:i(w)})),p(s,m)},r=s=>{var m=Be();z(m,()=>({...i(w)}));var C=I(m);A(C,()=>e.children??D),R(m),p(s,m)};k(t,s=>{e.child?s(a):s(r,!1)})}p(h,n)},$$slots:{default:!0}}),T()}const et=He,tt=De,rt=Ie,nt=je,at=ze,ot=Ke;function Le(){let c=_e(me({})),e=null,o=null;function g(t,a,r){o&&(clearInterval(o),o=null),e=`${t}/${a}/${r}`,f("enter",t,a,r),o=setInterval(()=>{e&&f("heartbeat",t,a,r)},3e4)}function u(){if(o&&(clearInterval(o),o=null),e){const[t,a,r]=e.split("/");t&&a&&r&&f("leave",t,a,r),e=null}}function f(t,a,r,s){le.send({type:"presence",action:t,repo:a,entityType:r,entityId:s})}function P(t){const a=`${t.repo}/${t.entityType}/${t.entityId}`,r=i(c)[a]??[];if(t.action==="leave")i(c)[a]=r.filter(s=>s.id!==t.user.id);else{const s=r.findIndex(m=>m.id===t.user.id);s>=0?(r[s]=t.user,i(c)[a]=[...r]):i(c)[a]=[...r,t.user]}}function v(){if(N(c,{},!0),!e)return;const[t,a,r]=e.split("/");t&&a&&r&&f("enter",t,a,r)}function d(t,a,r,s){const m=`${t}/${a}/${r}`,C=i(c)[m]??[];return s?C.filter(te=>te.id!==s):C}function w(t,a){const r=new Map;for(const[s,m]of Object.entries(i(c)))if(s.startsWith(t))for(const C of m)(!a||C.id!==a)&&r.set(C.id,C);return[...r.values()]}function h(t,a){return w(`${t}/`,a)}function _(t){const a=new Map;for(const r of Object.values(i(c)))for(const s of r)(!t||s.id!==t)&&a.set(s.id,s);return[...a.values()]}const n=E(()=>{const t=new Map;for(const a of Object.values(i(c)))for(const r of a)t.set(r.id,r);return[...t.values()]});return{enter:g,leave:u,handlePresenceEvent:P,resetAndResend:v,getPresence:d,getPresenceByPrefix:w,getRepoPresence:h,getAllUsers:_,get allUsers(){return i(n)}}}const de=Le();le.setPresenceHandler(c=>de.handlePresenceEvent(c));le.addConnectHandler(()=>de.resetAndResend());typeof window<"u"&&window.addEventListener("beforeunload",()=>de.leave());var Ze=Q("<title> </title>"),Ve=Q('<svg><!><path d="M25,12H20v2h5a1.0008,1.0008,0,0,1,1,1v2H22a3.0033,3.0033,0,0,0-3,3v1a3.0033,3.0033,0,0,0,3,3h6V15A3.0033,3.0033,0,0,0,25,12ZM22,22a1.0008,1.0008,0,0,1-1-1V20a1.0008,1.0008,0,0,1,1-1h4v3Z"></path><path d="M16,24h2L12,7H10L4,24H6l1.6936-5h6.6135ZM8.3711,17l2.4966-7.3711.2668.0005L13.63,17Z"></path></svg>');function st(c,e){const o=J(e,["children","$$slots","$$events","$$legacy"]),g=J(o,["size","title"]);H(e,!1);const u=G(),f=G();let P=l(e,"size",8,16),v=l(e,"title",8,void 0);q(()=>(U(o),U(v())),()=>{N(u,o["aria-label"]||o["aria-labelledby"]||v())}),q(()=>(i(u),U(o)),()=>{N(f,{"aria-hidden":i(u)?void 0:!0,role:i(u)?"img":void 0,focusable:Number(o.tabindex)===0?!0:void 0})}),pe(),ve();var d=Ve();z(d,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:P(),height:P(),...i(f),...g}));var w=I(d);{var h=_=>{var n=Ze(),t=I(n,!0);R(n),he(()=>fe(t,v())),p(_,n)};k(w,_=>{v()&&_(h)})}ge(2),R(d),p(c,d),T()}export{nt as C,at as I,rt as P,et as R,ot as S,tt as T,st as a,$e as b,de as p};
@@ -1 +1 @@
1
- import{Y as T,a6 as H,g as m,s as n,a1 as N,ag as Y}from"./yMbbhP0p.js";import{i as G}from"./D91YXE6T.js";import{u as P,w as h}from"./CgcfyvoD.js";import{a as L}from"./DlkslpnI.js";import{n as b}from"./BUMhcVI4.js";function mt(...t){return t.filter(Boolean).join(" ")}const V=typeof document<"u";let D=0;class q{#t=T(H([]));get toasts(){return m(this.#t)}set toasts(e){n(this.#t,e,!0)}#e=T(H([]));get heights(){return m(this.#e)}set heights(e){n(this.#e,e,!0)}#s=e=>{const s=this.toasts.findIndex(i=>i.id===e);return s===-1?null:s};addToast=e=>{V&&this.toasts.unshift(e)};updateToast=({id:e,data:s,type:i,message:r})=>{const o=this.toasts.findIndex(d=>d.id===e),u=this.toasts[o];this.toasts[o]={...u,...s,id:e,title:r,type:i,updated:!0}};create=e=>{const{message:s,...i}=e,r=typeof e?.id=="number"||e.id&&e.id?.length>0?e.id:D++,o=e.dismissible!==void 0?e.dismissible:e.dismissable!==void 0?e.dismissable:!0,u=e.type===void 0?"default":e.type;return N(()=>{this.toasts.find($=>$.id===r)?this.updateToast({id:r,data:e,type:u,message:s,dismissible:o}):this.addToast({...i,id:r,title:s,dismissible:o,type:u})}),r};dismiss=e=>(N(()=>{if(e===void 0){this.toasts=this.toasts.map(i=>({...i,dismiss:!0}));return}const s=this.toasts.findIndex(i=>i.id===e);this.toasts[s]&&(this.toasts[s]={...this.toasts[s],dismiss:!0})}),e);remove=e=>{if(e===void 0){this.toasts=[];return}const s=this.#s(e);if(s!==null)return this.toasts.splice(s,1),e};message=(e,s)=>this.create({...s,type:"default",message:e});error=(e,s)=>this.create({...s,type:"error",message:e});success=(e,s)=>this.create({...s,type:"success",message:e});info=(e,s)=>this.create({...s,type:"info",message:e});warning=(e,s)=>this.create({...s,type:"warning",message:e});loading=(e,s)=>this.create({...s,type:"loading",message:e});promise=(e,s)=>{if(!s)return;let i;s.loading!==void 0&&(i=this.create({...s,promise:e,type:"loading",message:typeof s.loading=="string"?s.loading:s.loading()}));const r=e instanceof Promise?e:e();let o=i!==void 0;return r.then(u=>{if(typeof u=="object"&&u&&"ok"in u&&typeof u.ok=="boolean"&&!u.ok){o=!1;const d=z(u);this.create({id:i,type:"error",message:d})}else if(s.success!==void 0){o=!1;const d=typeof s.success=="function"?s.success(u):s.success;this.create({id:i,type:"success",message:d})}}).catch(u=>{if(s.error!==void 0){o=!1;const d=typeof s.error=="function"?s.error(u):s.error;this.create({id:i,type:"error",message:d})}}).finally(()=>{o&&(this.dismiss(i),i=void 0),s.finally?.()}),i};custom=(e,s)=>{const i=s?.id||D++;return this.create({component:e,id:i,...s}),i};removeHeight=e=>{this.heights=this.heights.filter(s=>s.toastId!==e)};setHeight=e=>{const s=this.#s(e.toastId);if(s===null){this.heights.push(e);return}this.heights[s]=e};reset=()=>{this.toasts=[],this.heights=[]}}function z(t){return t&&typeof t=="object"&&"status"in t?`HTTP error! Status: ${t.status}`:`Error! ${t}`}const f=new q;function K(t,e){return f.create({message:t,...e})}class St{#t=Y(()=>f.toasts.filter(e=>!e.dismiss));get toasts(){return m(this.#t)}}const Q=K,a=Object.assign(Q,{success:f.success,info:f.info,warning:f.warning,error:f.error,custom:f.custom,message:f.message,promise:f.promise,dismiss:f.dismiss,loading:f.loading,getActiveToasts:()=>f.toasts.filter(t=>!t.dismiss)}),X=800;function Z(){let t=T(!1),e=T(null),s=T(null),i=null,r=null,o=!1;function u(p,S,y,l){i&&i.repo===p&&i.type===S&&i.id===y?(l.data!==void 0&&(i.payload.data=l.data),l.content!==void 0&&(i.payload.content=l.content)):i={repo:p,type:S,id:y,payload:{...l}},d()}function d(){r&&clearTimeout(r),r=setTimeout($,X)}async function $(){if(r=null,!o&&i){const{repo:p,type:S,id:y,payload:l}=i;i=null,o=!0,n(t,!0),n(s,null);try{if(await P(p,S,y,l),n(e,new Date,!0),l.data?.name){const E=h.repos.find(O=>O.name===p)?.entities.find(O=>O.id===y);E&&(E.title=l.data.name)}}catch(g){n(s,g.message??"Save failed",!0);const E=g.status??g.statusCode;(!E||E>=500)&&(i={repo:p,type:S,id:y,payload:l})}finally{n(t,!1),o=!1,i&&$()}}}function F(){r&&(clearTimeout(r),r=null),i&&$()}async function J(p,S,y,l){n(t,!0),n(s,null);try{const g=await P(p,S,y,l);return n(e,new Date,!0),g}catch(g){return n(s,g.message??"Save failed",!0),null}finally{n(t,!1)}}function R(){n(s,null),n(e,null),i=null,r&&(clearTimeout(r),r=null)}return{get saving(){return m(t)},get lastSaved(){return m(e)},get error(){return m(s)},get hasPending(){return!!(i||o)},scheduleAutoSave:u,flush:F,saveEntity:J,reset:R}}const v=Z();let c=null,U=null,j=null,B=[],_=null,x=1e3,k=T(!1),M=T(null);const w=new Map,I={},A={};function C(t,e){w.delete(t);const s=e.entities.length,i=s===1?`${t} updated ${e.entities[0]}`:`${t} updated ${s} entities`;a(i)}function tt(t){for(const[e,s]of w)s.repo===t&&(clearTimeout(s.timer),w.delete(e))}function et(t){const e=L.user?.displayName;if(t.type==="sync_progress"){const s=I[t.repo];if(s){const i=t.message.trim(),r=i.match(/^Syncing from source:\s*(.+)$/i);r&&(A[t.repo]=`Syncing ${r[1].trim()}…`);const o=A[t.repo]??`Syncing ${t.repo}…`;a.loading(o,{id:s,description:i,duration:36e5})}return}if(t.type==="entity_change"){if(e&&t.actor===e&&t.source==="api"){h.refreshEntities(t.repo);return}if(h.refreshEntities(t.repo),b.selectedRepo===t.repo&&b.selectedType===t.entityType&&b.selectedId===t.entityId){v.hasPending?a(`${t.actor} also saved changes to this entity`):G();return}const i=w.get(t.actor);if(i)clearTimeout(i.timer),i.entities.includes(t.entityId)||i.entities.push(t.entityId),i.timer=setTimeout(()=>C(t.actor,i),1e4);else{const r={entities:[t.entityId],repo:t.repo,timer:setTimeout(()=>C(t.actor,r),1e4)};w.set(t.actor,r)}return}if(t.type==="session_commit"){if(e&&t.actor===e){n(M,t.timestamp,!0);return}const s=t.entities.length,i=s===1?`${t.actor} saved changes to ${t.entities[0]}`:`${t.actor} saved ${s} changes in ${t.repo}`;a(i),h.refreshEntities(t.repo);return}if(t.type==="sync_complete"){if(tt(t.repo),!I[t.repo]){const s=t.created+t.updated+t.deleted,i=s===0?`Sync complete · no changes in ${t.repo}`:`Sync complete · ${s} ${s===1?"entity":"entities"} from ${t.source}`;a.success(i)}h.refreshEntities(t.repo);return}if(t.type==="collection_created"){a(`${t.actor} created collection ${t.repo}`),h.refreshEntities(t.repo);return}if(t.type==="collection_deleted"){a(`${t.actor} deleted collection ${t.repo}`);return}if(t.type==="repo_sync"){a(`${t.actor} pushed to ${t.repo}`),h.refreshEntities(t.repo);return}if(t.type==="presence"){U?.(t);return}if(t.type==="online"){j?.(t);return}if(t.type==="access_granted"||t.type==="access_revoked"){t.type==="access_revoked"&&b.selectedRepo===t.repo&&b.deselect(),h.load();return}}function W(){if(typeof window>"u"||c&&(c.readyState===WebSocket.OPEN||c.readyState===WebSocket.CONNECTING))return;const e=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`;c=new WebSocket(e),c.binaryType="arraybuffer",c.onopen=()=>{n(k,!0),x=1e3,h.refreshAll();for(const s of B)s()},c.onmessage=s=>{if(!(s.data instanceof ArrayBuffer))try{const i=JSON.parse(s.data);if(i?.type==="ping"){c?.send(JSON.stringify({type:"pong"}));return}const r=i;r.type&&r.type!=="toast"&&et(r)}catch{}},c.onclose=()=>{n(k,!1),c=null,_=setTimeout(()=>{x=Math.min(x*2,1e4),W()},x)},c.onerror=()=>{}}function st(){_&&(clearTimeout(_),_=null),c&&(c.close(),c=null),n(k,!1);for(const[,t]of w)clearTimeout(t.timer);w.clear()}function it(t,e=4e3){a(t,{duration:e})}function rt(t,e){const s=crypto.randomUUID();return e?.loading?a.loading(t,{id:s,duration:36e5}):a(t,{id:s}),s}function nt(t,e,s){if(s?.loading){a.loading(e,{id:t});return}/failed|error/i.test(e)?a.error(e,{id:t,duration:s?.duration??6e3}):a.success(e,{id:t,duration:s?.duration??4e3})}function ot(t){const e=crypto.randomUUID();I[t]=e,a.loading(`Syncing ${t}…`,{id:e,duration:36e5})}function ct(t,e,s){const i=I[t];i&&(delete I[t],delete A[t],s?a.error(e,{id:i,duration:6e3}):a.success(e,{id:i,duration:4e3}))}function at(t){U=t}function ut(t){j=t}function lt(t){B.push(t)}function ft(t){c?.readyState===WebSocket.OPEN&&c.send(JSON.stringify(t))}const Tt={get connected(){return m(k)},get lastAutoSaved(){return m(M)},get ws(){return c},connect:W,disconnect:st,showToast:it,showPersistentToast:rt,updateToast:nt,startSyncToast:ot,finishSyncToast:ct,send:ft,setPresenceHandler:at,setOnlineHandler:ut,addConnectHandler:lt};export{St as S,mt as c,v as e,Tt as r,f as t};
1
+ import{Y as T,a6 as H,g as m,s as n,a1 as N,ag as Y}from"./Bo0CMKlC.js";import{i as G}from"./D5GOt_JW.js";import{u as P,w as h}from"./BOcEeypC.js";import{a as L}from"./BlYD-5Z_.js";import{n as b}from"./Dw9UPwc-.js";function mt(...t){return t.filter(Boolean).join(" ")}const V=typeof document<"u";let D=0;class q{#t=T(H([]));get toasts(){return m(this.#t)}set toasts(e){n(this.#t,e,!0)}#e=T(H([]));get heights(){return m(this.#e)}set heights(e){n(this.#e,e,!0)}#s=e=>{const s=this.toasts.findIndex(i=>i.id===e);return s===-1?null:s};addToast=e=>{V&&this.toasts.unshift(e)};updateToast=({id:e,data:s,type:i,message:r})=>{const o=this.toasts.findIndex(d=>d.id===e),u=this.toasts[o];this.toasts[o]={...u,...s,id:e,title:r,type:i,updated:!0}};create=e=>{const{message:s,...i}=e,r=typeof e?.id=="number"||e.id&&e.id?.length>0?e.id:D++,o=e.dismissible!==void 0?e.dismissible:e.dismissable!==void 0?e.dismissable:!0,u=e.type===void 0?"default":e.type;return N(()=>{this.toasts.find($=>$.id===r)?this.updateToast({id:r,data:e,type:u,message:s,dismissible:o}):this.addToast({...i,id:r,title:s,dismissible:o,type:u})}),r};dismiss=e=>(N(()=>{if(e===void 0){this.toasts=this.toasts.map(i=>({...i,dismiss:!0}));return}const s=this.toasts.findIndex(i=>i.id===e);this.toasts[s]&&(this.toasts[s]={...this.toasts[s],dismiss:!0})}),e);remove=e=>{if(e===void 0){this.toasts=[];return}const s=this.#s(e);if(s!==null)return this.toasts.splice(s,1),e};message=(e,s)=>this.create({...s,type:"default",message:e});error=(e,s)=>this.create({...s,type:"error",message:e});success=(e,s)=>this.create({...s,type:"success",message:e});info=(e,s)=>this.create({...s,type:"info",message:e});warning=(e,s)=>this.create({...s,type:"warning",message:e});loading=(e,s)=>this.create({...s,type:"loading",message:e});promise=(e,s)=>{if(!s)return;let i;s.loading!==void 0&&(i=this.create({...s,promise:e,type:"loading",message:typeof s.loading=="string"?s.loading:s.loading()}));const r=e instanceof Promise?e:e();let o=i!==void 0;return r.then(u=>{if(typeof u=="object"&&u&&"ok"in u&&typeof u.ok=="boolean"&&!u.ok){o=!1;const d=z(u);this.create({id:i,type:"error",message:d})}else if(s.success!==void 0){o=!1;const d=typeof s.success=="function"?s.success(u):s.success;this.create({id:i,type:"success",message:d})}}).catch(u=>{if(s.error!==void 0){o=!1;const d=typeof s.error=="function"?s.error(u):s.error;this.create({id:i,type:"error",message:d})}}).finally(()=>{o&&(this.dismiss(i),i=void 0),s.finally?.()}),i};custom=(e,s)=>{const i=s?.id||D++;return this.create({component:e,id:i,...s}),i};removeHeight=e=>{this.heights=this.heights.filter(s=>s.toastId!==e)};setHeight=e=>{const s=this.#s(e.toastId);if(s===null){this.heights.push(e);return}this.heights[s]=e};reset=()=>{this.toasts=[],this.heights=[]}}function z(t){return t&&typeof t=="object"&&"status"in t?`HTTP error! Status: ${t.status}`:`Error! ${t}`}const f=new q;function K(t,e){return f.create({message:t,...e})}class St{#t=Y(()=>f.toasts.filter(e=>!e.dismiss));get toasts(){return m(this.#t)}}const Q=K,a=Object.assign(Q,{success:f.success,info:f.info,warning:f.warning,error:f.error,custom:f.custom,message:f.message,promise:f.promise,dismiss:f.dismiss,loading:f.loading,getActiveToasts:()=>f.toasts.filter(t=>!t.dismiss)}),X=800;function Z(){let t=T(!1),e=T(null),s=T(null),i=null,r=null,o=!1;function u(p,S,y,l){i&&i.repo===p&&i.type===S&&i.id===y?(l.data!==void 0&&(i.payload.data=l.data),l.content!==void 0&&(i.payload.content=l.content)):i={repo:p,type:S,id:y,payload:{...l}},d()}function d(){r&&clearTimeout(r),r=setTimeout($,X)}async function $(){if(r=null,!o&&i){const{repo:p,type:S,id:y,payload:l}=i;i=null,o=!0,n(t,!0),n(s,null);try{if(await P(p,S,y,l),n(e,new Date,!0),l.data?.name){const E=h.repos.find(O=>O.name===p)?.entities.find(O=>O.id===y);E&&(E.title=l.data.name)}}catch(g){n(s,g.message??"Save failed",!0);const E=g.status??g.statusCode;(!E||E>=500)&&(i={repo:p,type:S,id:y,payload:l})}finally{n(t,!1),o=!1,i&&$()}}}function F(){r&&(clearTimeout(r),r=null),i&&$()}async function J(p,S,y,l){n(t,!0),n(s,null);try{const g=await P(p,S,y,l);return n(e,new Date,!0),g}catch(g){return n(s,g.message??"Save failed",!0),null}finally{n(t,!1)}}function R(){n(s,null),n(e,null),i=null,r&&(clearTimeout(r),r=null)}return{get saving(){return m(t)},get lastSaved(){return m(e)},get error(){return m(s)},get hasPending(){return!!(i||o)},scheduleAutoSave:u,flush:F,saveEntity:J,reset:R}}const v=Z();let c=null,U=null,j=null,B=[],_=null,x=1e3,k=T(!1),M=T(null);const w=new Map,I={},A={};function C(t,e){w.delete(t);const s=e.entities.length,i=s===1?`${t} updated ${e.entities[0]}`:`${t} updated ${s} entities`;a(i)}function tt(t){for(const[e,s]of w)s.repo===t&&(clearTimeout(s.timer),w.delete(e))}function et(t){const e=L.user?.displayName;if(t.type==="sync_progress"){const s=I[t.repo];if(s){const i=t.message.trim(),r=i.match(/^Syncing from source:\s*(.+)$/i);r&&(A[t.repo]=`Syncing ${r[1].trim()}…`);const o=A[t.repo]??`Syncing ${t.repo}…`;a.loading(o,{id:s,description:i,duration:36e5})}return}if(t.type==="entity_change"){if(e&&t.actor===e&&t.source==="api"){h.refreshEntities(t.repo);return}if(h.refreshEntities(t.repo),b.selectedRepo===t.repo&&b.selectedType===t.entityType&&b.selectedId===t.entityId){v.hasPending?a(`${t.actor} also saved changes to this entity`):G();return}const i=w.get(t.actor);if(i)clearTimeout(i.timer),i.entities.includes(t.entityId)||i.entities.push(t.entityId),i.timer=setTimeout(()=>C(t.actor,i),1e4);else{const r={entities:[t.entityId],repo:t.repo,timer:setTimeout(()=>C(t.actor,r),1e4)};w.set(t.actor,r)}return}if(t.type==="session_commit"){if(e&&t.actor===e){n(M,t.timestamp,!0);return}const s=t.entities.length,i=s===1?`${t.actor} saved changes to ${t.entities[0]}`:`${t.actor} saved ${s} changes in ${t.repo}`;a(i),h.refreshEntities(t.repo);return}if(t.type==="sync_complete"){if(tt(t.repo),!I[t.repo]){const s=t.created+t.updated+t.deleted,i=s===0?`Sync complete · no changes in ${t.repo}`:`Sync complete · ${s} ${s===1?"entity":"entities"} from ${t.source}`;a.success(i)}h.refreshEntities(t.repo);return}if(t.type==="collection_created"){a(`${t.actor} created collection ${t.repo}`),h.refreshEntities(t.repo);return}if(t.type==="collection_deleted"){a(`${t.actor} deleted collection ${t.repo}`);return}if(t.type==="repo_sync"){a(`${t.actor} pushed to ${t.repo}`),h.refreshEntities(t.repo);return}if(t.type==="presence"){U?.(t);return}if(t.type==="online"){j?.(t);return}if(t.type==="access_granted"||t.type==="access_revoked"){t.type==="access_revoked"&&b.selectedRepo===t.repo&&b.deselect(),h.load();return}}function W(){if(typeof window>"u"||c&&(c.readyState===WebSocket.OPEN||c.readyState===WebSocket.CONNECTING))return;const e=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`;c=new WebSocket(e),c.binaryType="arraybuffer",c.onopen=()=>{n(k,!0),x=1e3,h.refreshAll();for(const s of B)s()},c.onmessage=s=>{if(!(s.data instanceof ArrayBuffer))try{const i=JSON.parse(s.data);if(i?.type==="ping"){c?.send(JSON.stringify({type:"pong"}));return}const r=i;r.type&&r.type!=="toast"&&et(r)}catch{}},c.onclose=()=>{n(k,!1),c=null,_=setTimeout(()=>{x=Math.min(x*2,1e4),W()},x)},c.onerror=()=>{}}function st(){_&&(clearTimeout(_),_=null),c&&(c.close(),c=null),n(k,!1);for(const[,t]of w)clearTimeout(t.timer);w.clear()}function it(t,e=4e3){a(t,{duration:e})}function rt(t,e){const s=crypto.randomUUID();return e?.loading?a.loading(t,{id:s,duration:36e5}):a(t,{id:s}),s}function nt(t,e,s){if(s?.loading){a.loading(e,{id:t});return}/failed|error/i.test(e)?a.error(e,{id:t,duration:s?.duration??6e3}):a.success(e,{id:t,duration:s?.duration??4e3})}function ot(t){const e=crypto.randomUUID();I[t]=e,a.loading(`Syncing ${t}…`,{id:e,duration:36e5})}function ct(t,e,s){const i=I[t];i&&(delete I[t],delete A[t],s?a.error(e,{id:i,duration:6e3}):a.success(e,{id:i,duration:4e3}))}function at(t){U=t}function ut(t){j=t}function lt(t){B.push(t)}function ft(t){c?.readyState===WebSocket.OPEN&&c.send(JSON.stringify(t))}const Tt={get connected(){return m(k)},get lastAutoSaved(){return m(M)},get ws(){return c},connect:W,disconnect:st,showToast:it,showPersistentToast:rt,updateToast:nt,startSyncToast:ot,finishSyncToast:ct,send:ft,setPresenceHandler:at,setOnlineHandler:ut,addConnectHandler:lt};export{St as S,mt as c,v as e,Tt as r,f as t};
@@ -1,4 +1,4 @@
1
- import{Y as I,a6 as _,s as a,g as s,a7 as U}from"./yMbbhP0p.js";import{i as H,g as L}from"./D91YXE6T.js";import{n as h}from"./BUMhcVI4.js";import{w as V}from"./CgcfyvoD.js";function W(g,c,n){fetch("/api/chat/stream",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(g),signal:n}).then(async o=>{if(!o.ok){c({type:"error",message:`HTTP ${o.status}`});return}const r=o.body?.getReader();if(!r){c({type:"error",message:"No response body"});return}const m=new TextDecoder;let f="";for(;;){const{done:b,value:O}=await r.read();if(b)break;f+=m.decode(O,{stream:!0});const C=f.split(`
1
+ import{Y as I,a6 as _,s as a,g as s,a7 as U}from"./Bo0CMKlC.js";import{i as H,g as L}from"./D5GOt_JW.js";import{n as h}from"./Dw9UPwc-.js";import{w as V}from"./BOcEeypC.js";function W(g,c,n){fetch("/api/chat/stream",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(g),signal:n}).then(async o=>{if(!o.ok){c({type:"error",message:`HTTP ${o.status}`});return}const r=o.body?.getReader();if(!r){c({type:"error",message:"No response body"});return}const m=new TextDecoder;let f="";for(;;){const{done:b,value:O}=await r.read();if(b)break;f+=m.decode(O,{stream:!0});const C=f.split(`
2
2
  `);f=C.pop()??"";for(const p of C)if(p.startsWith("data: "))try{const x=JSON.parse(p.slice(6));c(x)}catch{}}}).catch(o=>{o.name!=="AbortError"&&c({type:"error",message:o.message})})}const D="sg-chat-sessions",J="sg-chat-version",X=14;function w(){try{const g=localStorage.getItem(D);if(!g)return[];if(localStorage.getItem(J)==="2")return JSON.parse(g);const o=JSON.parse(g).map(r=>({id:crypto.randomUUID(),createdAt:r.date+"T00:00:00.000Z",updatedAt:r.date+"T00:00:00.000Z",title:r.messages.find(m=>m.role==="user")?.content.slice(0,50)||"New chat",messages:r.messages}));return localStorage.setItem(D,JSON.stringify(o)),localStorage.setItem(J,"2"),o}catch{return[]}}function $(g){const n=[...g].sort((o,r)=>r.updatedAt.localeCompare(o.updatedAt)).slice(0,X);try{localStorage.setItem(D,JSON.stringify(n)),localStorage.setItem(J,"2")}catch{}}function k(g,c){const n=w(),o=c.map(({streaming:m,...f})=>f),r=n.findIndex(m=>m.id===g);r>=0&&(n[r].messages=o,n[r].updatedAt=new Date().toISOString()),$(n)}function z(){const c=w().sort((e,i)=>i.updatedAt.localeCompare(e.updatedAt))[0];let n=I(_(c?c.messages.map(e=>({...e,streaming:!1})):[])),o=I(_(c?.id??null)),r=I(!1),m=I(0),f=I(0),b=I(null),O=null,C=I(""),p=I(_(!!c));const x=new Set(["create_entity","update_entity","delete_entity","move_entity"]);function R(){N();const e=crypto.randomUUID();a(o,e,!0),a(n,[],!0),a(p,!1)}function M(){if(s(o)&&s(p))return s(o);const e=s(o)||crypto.randomUUID();a(o,e,!0);const i=new Date().toISOString(),d=w();return d.push({id:e,createdAt:i,updatedAt:i,title:"New chat",messages:[]}),$(d),a(p,!0),e}function E(e){if(!e.trim()||s(r))return;a(b,null);const i=M();s(n).push({role:"user",content:e}),s(n).push({role:"agent",content:"",segments:[],streaming:!0}),a(r,!0);const d=w(),l=d.find(t=>t.id===i);l&&l.title==="New chat"&&(l.title=e.slice(0,50),$(d)),k(i,s(n));let A=!1,T=null;O=new AbortController;const q=h.selectedSubPath?`${h.selectedRepo}/${h.selectedType}/${h.selectedId}/${h.selectedSubPath}`:h.selectedId?`${h.selectedRepo}/${h.selectedType}/${h.selectedId}`:null,P=s(n).slice(0,-2).map(t=>({role:t.role==="agent"?"assistant":t.role,content:t.content})),G={message:e,context:q??void 0,sessionId:i,history:P.length>0?P:void 0};W(G,t=>{const u=s(n)[s(n).length-1];if(!u||u.role!=="agent")return;const y=u.segments;switch(t.type){case"token":{u.content+=t.text??"";const S=y[y.length-1];S&&S.type==="text"?S.content+=t.text??"":y.push({type:"text",content:t.text??""}),u.segments=y,U(f);break}case"tool_start":if(t.name){x.has(t.name)&&(A=!0);const S=y[y.length-1];S&&S.type==="tools"?S.names=[...S.names,t.name]:y.push({type:"tools",names:[t.name]}),u.segments=y,U(f)}break;case"mutation":A=!0,t.action==="created"&&t.repo&&t.entityType&&t.entityId&&(T={repo:t.repo,entityType:t.entityType,entityId:t.entityId}),window.StudioChrome?.emitMutation?.({action:t.action,repo:t.repo,entityType:t.entityType,entityId:t.entityId});break;case"highlight":a(b,t.entityIds&&t.entityIds.length>0?new Set(t.entityIds):null,!0);break;case"done":t.message&&!u.content&&(u.content=t.message,u.segments=[{type:"text",content:t.message}]),u.streaming=!1,a(r,!1),k(i,s(n)),A&&(H().then(()=>{U(m)}),V.refreshAll().then(()=>{T&&L(`/${T.repo}/${T.entityType}/${T.entityId}`)}));break;case"error":u.content+=`
3
3
 
4
4
  Error: ${t.message}`,u.streaming=!1,a(r,!1),k(i,s(n));break}},O.signal)}function N(){O?.abort(),a(r,!1);const e=s(n)[s(n).length-1];e?.streaming&&(e.streaming=!1),fetch("/api/chat/abort",{method:"POST",credentials:"include"}).catch(()=>{})}function Y(){N(),a(n,[],!0),s(o)&&s(p)&&k(s(o),s(n))}function K(e){const d=w().filter(l=>l.id!==e);if($(d),s(o)===e){const l=d.sort((A,T)=>T.updatedAt.localeCompare(A.updatedAt));l.length>0?(a(o,l[0].id,!0),a(n,l[0].messages.map(A=>({...A,streaming:!1})),!0),a(p,!0)):(a(o,null),a(n,[],!0),a(p,!1))}}function Z(e){const d=w().find(l=>l.id===e);d&&(N(),a(o,d.id,!0),a(n,d.messages.map(l=>({...l,streaming:!1})),!0),a(p,!0))}function j(){return w().sort((e,i)=>i.updatedAt.localeCompare(e.updatedAt)).map(e=>({id:e.id,title:e.title,createdAt:e.createdAt,updatedAt:e.updatedAt,preview:e.messages.find(i=>i.role==="user")?.content.slice(0,80)||"",count:e.messages.length,active:e.id===s(o)}))}return{get messages(){return s(n)},get streaming(){return s(r)},get mutationCount(){return s(m)},get scrollTick(){return s(f)},get highlightedIds(){return s(b)},get activeSessionId(){return s(o)},get draftInput(){return s(C)},set draftInput(e){a(C,e,!0)},send:E,stop:N,clear:Y,newSession:R,deleteSession:K,getSessions:j,loadSession:Z}}const ee=z();export{ee as c};
@@ -1 +1 @@
1
- import{a as b,s as R,f as P,d as S,c as H,b as T,g as Y}from"./DfwW1gF2.js";import{p as $,l as k,s as M,d as w,g as u,a as Z,c as d,n as j,r as v,b as D,m as A,t as G,ax as q,a5 as h,a4 as E}from"./yMbbhP0p.js";import{a as F,s as I}from"./l5w7mUkV.js";import{i as x}from"./DSZYl5ah.js";import{s as C}from"./1vztr6_A.js";import{l as B,p as V}from"./DVyuW48M.js";import{g as J}from"./D91YXE6T.js";import{i as K}from"./Dr5ZUnae.js";import{n as L}from"./BUMhcVI4.js";import{B as Q}from"./Brxs8A3C.js";var U=P("<title> </title>"),W=P('<svg><!><path d="M17.74,30,16,29l4-7h6a2,2,0,0,0,2-2V8a2,2,0,0,0-2-2H6A2,2,0,0,0,4,8V20a2,2,0,0,0,2,2h9v2H6a4,4,0,0,1-4-4V8A4,4,0,0,1,6,4H26a4,4,0,0,1,4,4V20a4,4,0,0,1-4,4H21.16Z"></path><path d="M8 10H24V12H8z"></path><path d="M8 16H18V18H8z"></path></svg>');function X(_,e){const t=B(e,["children","$$slots","$$events","$$legacy"]),g=B(t,["size","title"]);$(e,!1);const i=A(),l=A();let o=V(e,"size",8,16),s=V(e,"title",8,void 0);k(()=>(w(t),w(s())),()=>{M(i,t["aria-label"]||t["aria-labelledby"]||s())}),k(()=>(u(i),w(t)),()=>{M(l,{"aria-hidden":u(i)?void 0:!0,role:u(i)?"img":void 0,focusable:Number(t.tabindex)===0?!0:void 0})}),Z(),K();var r=W();F(r,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:o(),height:o(),...u(l),...g}));var f=d(r);{var p=n=>{var c=U(),y=d(c,!0);v(c),G(()=>R(y,s())),b(n,c)};x(f,n=>{s()&&n(p)})}j(3),v(r),b(_,r),D()}var tt=T('<div class="view-toolbar svelte-r6dy5f"><div></div> <div class="view-toggles svelte-r6dy5f"><button><span class="toggle-label">Details</span></button> <button><span class="toggle-label">Graph</span></button></div> <div class="toolbar-right svelte-r6dy5f"><!> <!></div></div>');function vt(_,e){$(e,!0);let t=V(e,"activeView",3,"entity");const g=q("chat");function i(a){J(a,{noScroll:!0})}var l=tt(),o=h(d(l),2),s=d(o);let r;var f=h(s,2);let p;v(o);var n=h(o,2),c=d(n);{var y=a=>{var m=Y(),z=E(m);I(z,()=>e.right),b(a,m)};x(c,a=>{e.right&&a(y)})}var N=h(c,2);{var O=a=>{Q(a,{variant:"accent",size:"icon",class:"chat-toggle",title:"Open Agent",get onclick(){return g.toggle},children:(m,z)=>{X(m,{size:14})},$$slots:{default:!0}})};x(N,a=>{g.open||a(O)})}v(n),v(l),G(()=>{r=C(s,1,"toggle-btn svelte-r6dy5f",null,r,{active:t()==="entity"}),p=C(f,1,"toggle-btn svelte-r6dy5f",null,p,{active:t()==="graph"})}),H("click",s,()=>t()!=="entity"&&i(L.entityPath??"/")),H("click",f,()=>t()!=="graph"&&i("/graph")),b(_,l),D()}S(["click"]);export{vt as V};
1
+ import{a as b,s as R,f as P,d as S,c as H,b as T,g as Y}from"./DY21hM66.js";import{p as $,l as k,s as M,d as w,g as u,a as Z,c as d,n as j,r as v,b as D,m as A,t as G,ax as q,a5 as h,a4 as E}from"./Bo0CMKlC.js";import{a as F,s as I}from"./DNfruFPs.js";import{i as x}from"./BbsQ7LcO.js";import{s as C}from"./Cbba0X2k.js";import{l as B,p as V}from"./CdoeTcKU.js";import{g as J}from"./D5GOt_JW.js";import{i as K}from"./BpQkNqbd.js";import{n as L}from"./Dw9UPwc-.js";import{B as Q}from"./DVpZtGWL.js";var U=P("<title> </title>"),W=P('<svg><!><path d="M17.74,30,16,29l4-7h6a2,2,0,0,0,2-2V8a2,2,0,0,0-2-2H6A2,2,0,0,0,4,8V20a2,2,0,0,0,2,2h9v2H6a4,4,0,0,1-4-4V8A4,4,0,0,1,6,4H26a4,4,0,0,1,4,4V20a4,4,0,0,1-4,4H21.16Z"></path><path d="M8 10H24V12H8z"></path><path d="M8 16H18V18H8z"></path></svg>');function X(_,e){const t=B(e,["children","$$slots","$$events","$$legacy"]),g=B(t,["size","title"]);$(e,!1);const i=A(),l=A();let o=V(e,"size",8,16),s=V(e,"title",8,void 0);k(()=>(w(t),w(s())),()=>{M(i,t["aria-label"]||t["aria-labelledby"]||s())}),k(()=>(u(i),w(t)),()=>{M(l,{"aria-hidden":u(i)?void 0:!0,role:u(i)?"img":void 0,focusable:Number(t.tabindex)===0?!0:void 0})}),Z(),K();var r=W();F(r,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:o(),height:o(),...u(l),...g}));var f=d(r);{var p=n=>{var c=U(),y=d(c,!0);v(c),G(()=>R(y,s())),b(n,c)};x(f,n=>{s()&&n(p)})}j(3),v(r),b(_,r),D()}var tt=T('<div class="view-toolbar svelte-r6dy5f"><div></div> <div class="view-toggles svelte-r6dy5f"><button><span class="toggle-label">Details</span></button> <button><span class="toggle-label">Graph</span></button></div> <div class="toolbar-right svelte-r6dy5f"><!> <!></div></div>');function vt(_,e){$(e,!0);let t=V(e,"activeView",3,"entity");const g=q("chat");function i(a){J(a,{noScroll:!0})}var l=tt(),o=h(d(l),2),s=d(o);let r;var f=h(s,2);let p;v(o);var n=h(o,2),c=d(n);{var y=a=>{var m=Y(),z=E(m);I(z,()=>e.right),b(a,m)};x(c,a=>{e.right&&a(y)})}var N=h(c,2);{var O=a=>{Q(a,{variant:"accent",size:"icon",class:"chat-toggle",title:"Open Agent",get onclick(){return g.toggle},children:(m,z)=>{X(m,{size:14})},$$slots:{default:!0}})};x(N,a=>{g.open||a(O)})}v(n),v(l),G(()=>{r=C(s,1,"toggle-btn svelte-r6dy5f",null,r,{active:t()==="entity"}),p=C(f,1,"toggle-btn svelte-r6dy5f",null,p,{active:t()==="graph"})}),H("click",s,()=>t()!=="entity"&&i(L.entityPath??"/")),H("click",f,()=>t()!=="graph"&&i("/graph")),b(_,l),D()}S(["click"]);export{vt as V};
@@ -1 +1 @@
1
- import{u as O,e as y,h as M,k as b,v as Z,f as $,g as V,i as j,w as ee,j as U,o as F,q as H,C as re,x as ne,y as X,z as fe,A as m,B as L,D as ae,F as ie,G as le,I as ue,J as B,K as se,L as oe,m as te,M as Y,N as ve,O as J,P as K,Q as z,R as de,S as ce,T as pe,U as _e,V as he,W as P,X as ge}from"./yMbbhP0p.js";function Ce(e,i){return i}function Ee(e,i,l){for(var d=[],g=i.length,s,u=i.length,p=0;p<g;p++){let E=i[p];K(E,()=>{if(s){if(s.pending.delete(E),s.done.add(E),s.pending.size===0){var o=e.outrogroups;q(B(s.done)),o.delete(s),o.size===0&&(e.outrogroups=null)}}else u-=1},!1)}if(u===0){var a=d.length===0&&l!==null;if(a){var t=l,n=t.parentNode;ce(n),n.append(t),e.items.clear()}q(i,!a)}else s={pending:new Set(i),done:new Set},(e.outrogroups??=new Set).add(s)}function q(e,i=!0){for(var l=0;l<e.length;l++)pe(e[l],i)}var G;function we(e,i,l,d,g,s=null){var u=e,p=new Map,a=(i&P)!==0;if(a){var t=e;u=M?b(Z(t)):t.appendChild(O())}M&&$();var n=null,E=le(()=>{var f=l();return ue(f)?f:f==null?[]:B(f)}),o,c=!0;function A(){r.fallback=n,me(r,o,u,i,d),n!==null&&(o.length===0?(n.f&m)===0?J(n):(n.f^=m,D(n,null,u)):K(n,()=>{n=null}))}var I=y(()=>{o=V(E);var f=o.length;let N=!1;if(M){var S=j(u)===ee;S!==(f===0)&&(u=U(),b(u),F(!1),N=!0)}for(var h=new Set,C=fe,x=ie(),_=0;_<f;_+=1){M&&H.nodeType===re&&H.data===ne&&(u=H,N=!0,F(!1));var w=o[_],R=d(w,_),v=c?null:p.get(R);v?(v.v&&X(v.v,w),v.i&&X(v.i,_),x&&C.unskip_effect(v.e)):(v=Te(p,c?u:G??=O(),w,R,_,g,i,l),c||(v.e.f|=m),p.set(R,v)),h.add(R)}if(f===0&&s&&!n&&(c?n=L(()=>s(u)):(n=L(()=>s(G??=O())),n.f|=m)),f>h.size&&ae(),M&&f>0&&b(U()),!c)if(x){for(const[Q,W]of p)h.has(Q)||C.skip_effect(W.e);C.oncommit(A),C.ondiscard(()=>{})}else A();N&&F(!0),V(E)}),r={effect:I,items:p,outrogroups:null,fallback:n};c=!1,M&&(u=H)}function k(e){for(;e!==null&&(e.f&de)===0;)e=e.next;return e}function me(e,i,l,d,g){var s=(d&ge)!==0,u=i.length,p=e.items,a=k(e.effect.first),t,n=null,E,o=[],c=[],A,I,r,f;if(s)for(f=0;f<u;f+=1)A=i[f],I=g(A,f),r=p.get(I).e,(r.f&m)===0&&(r.nodes?.a?.measure(),(E??=new Set).add(r));for(f=0;f<u;f+=1){if(A=i[f],I=g(A,f),r=p.get(I).e,e.outrogroups!==null)for(const v of e.outrogroups)v.pending.delete(r),v.done.delete(r);if((r.f&m)!==0)if(r.f^=m,r===a)D(r,null,l);else{var N=n?n.next:a;r===e.effect.last&&(e.effect.last=r.prev),r.prev&&(r.prev.next=r.next),r.next&&(r.next.prev=r.prev),T(e,n,r),T(e,r,N),D(r,N,l),n=r,o=[],c=[],a=k(n.next);continue}if((r.f&z)!==0&&(J(r),s&&(r.nodes?.a?.unfix(),(E??=new Set).delete(r))),r!==a){if(t!==void 0&&t.has(r)){if(o.length<c.length){var S=c[0],h;n=S.prev;var C=o[0],x=o[o.length-1];for(h=0;h<o.length;h+=1)D(o[h],S,l);for(h=0;h<c.length;h+=1)t.delete(c[h]);T(e,C.prev,x.next),T(e,n,C),T(e,x,S),a=S,n=x,f-=1,o=[],c=[]}else t.delete(r),D(r,a,l),T(e,r.prev,r.next),T(e,r,n===null?e.effect.first:n.next),T(e,n,r),n=r;continue}for(o=[],c=[];a!==null&&a!==r;)(t??=new Set).add(a),c.push(a),a=k(a.next);if(a===null)continue}(r.f&m)===0&&o.push(r),n=r,a=k(r.next)}if(e.outrogroups!==null){for(const v of e.outrogroups)v.pending.size===0&&(q(B(v.done)),e.outrogroups?.delete(v));e.outrogroups.size===0&&(e.outrogroups=null)}if(a!==null||t!==void 0){var _=[];if(t!==void 0)for(r of t)(r.f&z)===0&&_.push(r);for(;a!==null;)(a.f&z)===0&&a!==e.fallback&&_.push(a),a=k(a.next);var w=_.length;if(w>0){var R=(d&P)!==0&&u===0?l:null;if(s){for(f=0;f<w;f+=1)_[f].nodes?.a?.measure();for(f=0;f<w;f+=1)_[f].nodes?.a?.fix()}Ee(e,_,R)}}s&&_e(()=>{if(E!==void 0)for(r of E)r.nodes?.a?.apply()})}function Te(e,i,l,d,g,s,u,p){var a=(u&se)!==0?(u&oe)===0?te(l,!1,!1):Y(l):null,t=(u&ve)!==0?Y(g):null;return{v:a,i:t,e:L(()=>(s(i,a??l,t??g,p),()=>{e.delete(d)}))}}function D(e,i,l){if(e.nodes)for(var d=e.nodes.start,g=e.nodes.end,s=i&&(i.f&m)===0?i.nodes.start:l;d!==null;){var u=he(d);if(s.before(d),d===g)return;d=u}}function T(e,i,l){i===null?e.effect.first=l:i.next=l,l===null?e.effect.last=i:l.prev=i}export{we as e,Ce as i};
1
+ import{u as O,e as y,h as M,k as b,v as Z,f as $,g as V,i as j,w as ee,j as U,o as F,q as H,C as re,x as ne,y as X,z as fe,A as m,B as L,D as ae,F as ie,G as le,I as ue,J as B,K as se,L as oe,m as te,M as Y,N as ve,O as J,P as K,Q as z,R as de,S as ce,T as pe,U as _e,V as he,W as P,X as ge}from"./Bo0CMKlC.js";function Ce(e,i){return i}function Ee(e,i,l){for(var d=[],g=i.length,s,u=i.length,p=0;p<g;p++){let E=i[p];K(E,()=>{if(s){if(s.pending.delete(E),s.done.add(E),s.pending.size===0){var o=e.outrogroups;q(B(s.done)),o.delete(s),o.size===0&&(e.outrogroups=null)}}else u-=1},!1)}if(u===0){var a=d.length===0&&l!==null;if(a){var t=l,n=t.parentNode;ce(n),n.append(t),e.items.clear()}q(i,!a)}else s={pending:new Set(i),done:new Set},(e.outrogroups??=new Set).add(s)}function q(e,i=!0){for(var l=0;l<e.length;l++)pe(e[l],i)}var G;function we(e,i,l,d,g,s=null){var u=e,p=new Map,a=(i&P)!==0;if(a){var t=e;u=M?b(Z(t)):t.appendChild(O())}M&&$();var n=null,E=le(()=>{var f=l();return ue(f)?f:f==null?[]:B(f)}),o,c=!0;function A(){r.fallback=n,me(r,o,u,i,d),n!==null&&(o.length===0?(n.f&m)===0?J(n):(n.f^=m,D(n,null,u)):K(n,()=>{n=null}))}var I=y(()=>{o=V(E);var f=o.length;let N=!1;if(M){var S=j(u)===ee;S!==(f===0)&&(u=U(),b(u),F(!1),N=!0)}for(var h=new Set,C=fe,x=ie(),_=0;_<f;_+=1){M&&H.nodeType===re&&H.data===ne&&(u=H,N=!0,F(!1));var w=o[_],R=d(w,_),v=c?null:p.get(R);v?(v.v&&X(v.v,w),v.i&&X(v.i,_),x&&C.unskip_effect(v.e)):(v=Te(p,c?u:G??=O(),w,R,_,g,i,l),c||(v.e.f|=m),p.set(R,v)),h.add(R)}if(f===0&&s&&!n&&(c?n=L(()=>s(u)):(n=L(()=>s(G??=O())),n.f|=m)),f>h.size&&ae(),M&&f>0&&b(U()),!c)if(x){for(const[Q,W]of p)h.has(Q)||C.skip_effect(W.e);C.oncommit(A),C.ondiscard(()=>{})}else A();N&&F(!0),V(E)}),r={effect:I,items:p,outrogroups:null,fallback:n};c=!1,M&&(u=H)}function k(e){for(;e!==null&&(e.f&de)===0;)e=e.next;return e}function me(e,i,l,d,g){var s=(d&ge)!==0,u=i.length,p=e.items,a=k(e.effect.first),t,n=null,E,o=[],c=[],A,I,r,f;if(s)for(f=0;f<u;f+=1)A=i[f],I=g(A,f),r=p.get(I).e,(r.f&m)===0&&(r.nodes?.a?.measure(),(E??=new Set).add(r));for(f=0;f<u;f+=1){if(A=i[f],I=g(A,f),r=p.get(I).e,e.outrogroups!==null)for(const v of e.outrogroups)v.pending.delete(r),v.done.delete(r);if((r.f&m)!==0)if(r.f^=m,r===a)D(r,null,l);else{var N=n?n.next:a;r===e.effect.last&&(e.effect.last=r.prev),r.prev&&(r.prev.next=r.next),r.next&&(r.next.prev=r.prev),T(e,n,r),T(e,r,N),D(r,N,l),n=r,o=[],c=[],a=k(n.next);continue}if((r.f&z)!==0&&(J(r),s&&(r.nodes?.a?.unfix(),(E??=new Set).delete(r))),r!==a){if(t!==void 0&&t.has(r)){if(o.length<c.length){var S=c[0],h;n=S.prev;var C=o[0],x=o[o.length-1];for(h=0;h<o.length;h+=1)D(o[h],S,l);for(h=0;h<c.length;h+=1)t.delete(c[h]);T(e,C.prev,x.next),T(e,n,C),T(e,x,S),a=S,n=x,f-=1,o=[],c=[]}else t.delete(r),D(r,a,l),T(e,r.prev,r.next),T(e,r,n===null?e.effect.first:n.next),T(e,n,r),n=r;continue}for(o=[],c=[];a!==null&&a!==r;)(t??=new Set).add(a),c.push(a),a=k(a.next);if(a===null)continue}(r.f&m)===0&&o.push(r),n=r,a=k(r.next)}if(e.outrogroups!==null){for(const v of e.outrogroups)v.pending.size===0&&(q(B(v.done)),e.outrogroups?.delete(v));e.outrogroups.size===0&&(e.outrogroups=null)}if(a!==null||t!==void 0){var _=[];if(t!==void 0)for(r of t)(r.f&z)===0&&_.push(r);for(;a!==null;)(a.f&z)===0&&a!==e.fallback&&_.push(a),a=k(a.next);var w=_.length;if(w>0){var R=(d&P)!==0&&u===0?l:null;if(s){for(f=0;f<w;f+=1)_[f].nodes?.a?.measure();for(f=0;f<w;f+=1)_[f].nodes?.a?.fix()}Ee(e,_,R)}}s&&_e(()=>{if(E!==void 0)for(r of E)r.nodes?.a?.apply()})}function Te(e,i,l,d,g,s,u,p){var a=(u&se)!==0?(u&oe)===0?te(l,!1,!1):Y(l):null,t=(u&ve)!==0?Y(g):null;return{v:a,i:t,e:L(()=>(s(i,a??l,t??g,p),()=>{e.delete(d)}))}}function D(e,i,l){if(e.nodes)for(var d=e.nodes.start,g=e.nodes.end,s=i&&(i.f&m)===0?i.nodes.start:l;d!==null;){var u=he(d);if(s.before(d),d===g)return;d=u}}function T(e,i,l){i===null?e.effect.first=l:i.next=l,l===null?e.effect.last=i:l.prev=i}export{we as e,Ce as i};
@@ -1 +1 @@
1
- import{Y as f,a6 as w,s as u,g as o,ag as ot}from"./yMbbhP0p.js";import{a as m}from"./1vztr6_A.js";function rt(){return m("/api/workspace")}function at(a){return m("/api/workspace",{method:"PUT",body:JSON.stringify(a)})}function Ct(){return m("/api/workspace/mcp-config")}function _(){return m("/api/repos")}function it(a,i,l,p){return m("/api/repos",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:a,display_name:i||void 0,description:l,...p?{private:!0}:{}})})}function st(a,i,l){return m(`/api/repos/${encodeURIComponent(a)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:i,display_name:l||void 0})})}function lt(a){return m(`/api/repos/${encodeURIComponent(a)}`,{method:"DELETE"})}function ct(){return m("/api/apps")}function ut(a){return m(`/api/repos/${encodeURIComponent(a)}/entities?summary=true`)}function ht(a,i,l){return m(`/api/repos/${encodeURIComponent(a)}/entities/${encodeURIComponent(i)}/${encodeURIComponent(l)}`)}function wt(a,i,l,p,c){return m(`/api/repos/${encodeURIComponent(a)}/entities`,{method:"POST",body:JSON.stringify({entityType:i,entityId:l,data:p,content:c})})}function Et(a,i,l){return m(`/api/repos/${encodeURIComponent(a)}/entities/${encodeURIComponent(i)}/${encodeURIComponent(l)}`,{method:"DELETE"})}function $t(a,i,l,p){return m(`/api/repos/${encodeURIComponent(a)}/entities/${encodeURIComponent(i)}/${encodeURIComponent(l)}`,{method:"PUT",body:JSON.stringify(p)})}function It(a){return m(`/api/repos/${encodeURIComponent(a)}/commit`,{method:"POST"})}function dt(a){return a.replace(/-/g," ").replace(/\b\w/g,i=>i.toUpperCase())}function F(a,i){return i||a.split("-").map(l=>l.charAt(0).toUpperCase()+l.slice(1)).join(" ")}const pt="#e05050";function O(a){if(typeof document>"u")return;const i=a||pt,l=parseInt(i.slice(1,3),16),p=parseInt(i.slice(3,5),16),c=parseInt(i.slice(5,7),16),E=[document.documentElement,document.querySelector("[data-theme]")].filter(Boolean);for(const C of E)C.style.setProperty("--color-accent",i),C.style.setProperty("--color-accent-hover",ft(i,15)),C.style.setProperty("--color-accent-muted",`rgba(${l}, ${p}, ${c}, 0.08)`),C.style.setProperty("--color-link",W(i,15)),C.style.setProperty("--color-badge-bg",`rgba(${l}, ${p}, ${c}, 0.1)`),C.style.setProperty("--color-badge-text",W(i,20))}function ft(a,i){const l=Math.max(0,Math.round(parseInt(a.slice(1,3),16)*(1-i/100))),p=Math.max(0,Math.round(parseInt(a.slice(3,5),16)*(1-i/100))),c=Math.max(0,Math.round(parseInt(a.slice(5,7),16)*(1-i/100)));return`#${l.toString(16).padStart(2,"0")}${p.toString(16).padStart(2,"0")}${c.toString(16).padStart(2,"0")}`}function W(a,i){const l=Math.min(255,Math.round(parseInt(a.slice(1,3),16)+(255-parseInt(a.slice(1,3),16))*i/100)),p=Math.min(255,Math.round(parseInt(a.slice(3,5),16)+(255-parseInt(a.slice(3,5),16))*i/100)),c=Math.min(255,Math.round(parseInt(a.slice(5,7),16)+(255-parseInt(a.slice(5,7),16))*i/100));return`#${l.toString(16).padStart(2,"0")}${p.toString(16).padStart(2,"0")}${c.toString(16).padStart(2,"0")}`}function mt(){let a=f(""),i=f(null),l=f(null),p=f(!1),c=f(w([]));const E={};let C=f(w([])),L=f(!1),R=f(null),g=f(w({})),U=w({}),M=w({}),S=w({}),P=f(0),v=f(null),h=f(""),k=null,$=f(0),I=f(0),x=f("alpha");async function J(){u(L,!0),u(R,null),u($,0),u(I,0);try{const[t,e,n]=await Promise.all([_(),ct().catch(()=>[]),rt().catch(()=>({name:""}))]);u(C,e,!0),u(a,n.name,!0),u(i,n.about??null,!0),u(l,n.accent_color??null,!0),u(p,!0),O(o(l)),u(c,t.map(r=>({name:r.name,displayName:F(r.name,r.display_name),type:r.type,private:r.private,sync:r.sync,count:null,entities:[],loading:!1,loaded:!1})),!0),await Promise.all(o(c).map(r=>b(r.name)))}catch(t){u(R,t.message,!0)}finally{u(L,!1)}}function D(t,e,n){const r=o(c).find(s=>s.name===t);r&&(r.entities=r.entities.filter(s=>!(s.id===n&&s.entityType===e)),r.count=r.entities.length)}async function j(t){o(c).find(n=>n.name===t)&&await b(t,!0)}async function Q(){u($,0),u(I,0),await Promise.all(o(c).map(t=>b(t.name,!0)))}async function b(t,e=!1){const n=o(c).find(s=>s.name===t);if(!n||n.loading||!e&&n.loaded)return;const r=(E[t]??0)+1;E[t]=r,e||(n.loading=!0);try{const s=await ut(t);if(E[t]!==r)return;let y=0,A=0;for(const d of s)y+=d.document?.wikilinks?.length??0,A+=d.subContentCount??0;u($,o($)+y),u(I,o(I)+A),n.entities=s.filter(d=>!d.id.toLowerCase().startsWith("readme")).map(d=>({id:d.id,title:d.data?.name??dt(d.id),entityType:d.entityType,repo:t,hasSubContent:!!d.hasSubContent,wikilinks:d.document?.wikilinks??[],createdAt:d.data?.created_at??null,updatedAt:d.data?.updated_at??null})).sort((d,nt)=>d.title.localeCompare(nt.title)),n.count=n.entities.length,n.loaded=!0}catch(s){console.error(`Failed to load entities for ${t}:`,s)}finally{n.loading=!1}}function q(t){o(g)[t]=!o(g)[t]}function B(t){return o(g)[t]??!1}function T(t,e,n){return`${t}/${e}/${n}`}function H(t,e,n){const r=T(t,e,n),s=U[r]??!1;U[r]=!s,!s&&!M[r]?.loaded&&Y(t,e,n)}function K(t,e,n){return U[T(t,e,n)]??!1}function V(t,e,n){return M[T(t,e,n)]??{entries:[],loading:!1,loaded:!1}}async function Y(t,e,n){const r=T(t,e,n);M[r]={entries:[],loading:!1,loaded:!0}}function z(t){const e=o(h).trim().toLowerCase();if(!e)return t;const n=[];for(const r of t){const s=r.entities.filter(y=>y.title.toLowerCase().includes(e)||y.id.toLowerCase().includes(e));s.length>0&&n.push({...r,entities:s,count:s.length})}return n}function G(t){if(t&&!o(h)?k={...o(g)}:!t&&o(h)&&k&&(u(g,k,!0),k=null),u(h,t,!0),t){const e=t.trim().toLowerCase();for(const n of o(c)){const r=n.entities.some(s=>s.title.toLowerCase().includes(e)||s.id.toLowerCase().includes(e));o(g)[n.name]=r}}}function X(t){const e=t.startsWith("type:");S[t]=!(S[t]??e)}function Z(t){return S[t]??!1}function N(t){return S[t]===!1}const tt=ot(()=>o(c).reduce((t,e)=>t+(e.count??0),0));function et(t){return o(C).find(e=>e.entityTypes.includes(t))}return{get name(){return o(a)},get about(){return o(i)},get accentColor(){return o(l)},get nameLoaded(){return o(p)},async updateWorkspace(t){t.accent_color!==void 0&&(u(l,t.accent_color,!0),O(t.accent_color)),await at(t),t.name?.trim()&&u(a,t.name.trim(),!0),typeof t.about=="string"&&u(i,t.about,!0)},get repos(){return o(c)},get apps(){return o(C)},get loading(){return o(L)},get error(){return o(R)},get totalEntities(){return o(tt)},get totalLinks(){return o($)},get totalFiles(){return o(I)},get sortedRepos(){const t=[...o(c)].sort((e,n)=>e.name.localeCompare(n.name));return z(t)},get filteredIds(){const t=o(h).trim().toLowerCase();if(!t)return null;const e=new Set;for(const n of o(c))for(const r of n.entities)(r.title.toLowerCase().includes(t)||r.id.toLowerCase().includes(t))&&e.add(r.id);return e},get filterQuery(){return o(h)},setFilterQuery:G,get sortMode(){return o(x)},set sortMode(t){u(x,t,!0)},get recentEntities(){const t=o(h).trim().toLowerCase();let e=[];for(const n of o(c))for(const r of n.entities)t&&!r.title.toLowerCase().includes(t)&&!r.id.toLowerCase().includes(t)||e.push(r);return e.sort((n,r)=>{const s=n.updatedAt??"";return(r.updatedAt??"").localeCompare(s)})},get sidebarScrollTop(){return o(P)},set sidebarScrollTop(t){u(P,t,!0)},get lastAutoExpandedFor(){return o(v)},set lastAutoExpandedFor(t){u(v,t,!0)},load:J,loadEntities:b,removeEntity:D,refreshEntities:j,refreshAll:Q,toggleRepo:q,isExpanded:B,toggleEntity:H,isEntityExpanded:K,getEntityContents:V,toggleFolder:X,isFolderExpanded:Z,isFolderCollapsed:N,getAppForEntityType:et,async renameCollectionTo(t,e,n){await st(t,e,n);const r=o(c).find(s=>s.name===t);r&&(r.name=e,r.displayName=n||F(e),o(g)[t]&&(o(g)[e]=!0,delete o(g)[t]))},async removeCollection(t){await lt(t),u(c,o(c).filter(e=>e.name!==t),!0),delete o(g)[t]},async addCollection(t,e,n,r){await it(t,e,n,r);const s=await _();u(c,s.map(y=>o(c).find(d=>d.name===y.name)??{name:y.name,displayName:F(y.name,y.display_name),type:y.type,private:y.private,count:null,entities:[],loading:!1,loaded:!1}),!0),o(g)[t]=!0,await b(t)}}}const bt=mt();export{ht as a,Ct as b,wt as c,Et as d,It as f,$t as u,bt as w};
1
+ import{Y as f,a6 as w,s as u,g as o,ag as ot}from"./Bo0CMKlC.js";import{a as m}from"./Cbba0X2k.js";function rt(){return m("/api/workspace")}function at(a){return m("/api/workspace",{method:"PUT",body:JSON.stringify(a)})}function Ct(){return m("/api/workspace/mcp-config")}function _(){return m("/api/repos")}function it(a,i,l,p){return m("/api/repos",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:a,display_name:i||void 0,description:l,...p?{private:!0}:{}})})}function st(a,i,l){return m(`/api/repos/${encodeURIComponent(a)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:i,display_name:l||void 0})})}function lt(a){return m(`/api/repos/${encodeURIComponent(a)}`,{method:"DELETE"})}function ct(){return m("/api/apps")}function ut(a){return m(`/api/repos/${encodeURIComponent(a)}/entities?summary=true`)}function ht(a,i,l){return m(`/api/repos/${encodeURIComponent(a)}/entities/${encodeURIComponent(i)}/${encodeURIComponent(l)}`)}function wt(a,i,l,p,c){return m(`/api/repos/${encodeURIComponent(a)}/entities`,{method:"POST",body:JSON.stringify({entityType:i,entityId:l,data:p,content:c})})}function Et(a,i,l){return m(`/api/repos/${encodeURIComponent(a)}/entities/${encodeURIComponent(i)}/${encodeURIComponent(l)}`,{method:"DELETE"})}function $t(a,i,l,p){return m(`/api/repos/${encodeURIComponent(a)}/entities/${encodeURIComponent(i)}/${encodeURIComponent(l)}`,{method:"PUT",body:JSON.stringify(p)})}function It(a){return m(`/api/repos/${encodeURIComponent(a)}/commit`,{method:"POST"})}function dt(a){return a.replace(/-/g," ").replace(/\b\w/g,i=>i.toUpperCase())}function F(a,i){return i||a.split("-").map(l=>l.charAt(0).toUpperCase()+l.slice(1)).join(" ")}const pt="#e05050";function O(a){if(typeof document>"u")return;const i=a||pt,l=parseInt(i.slice(1,3),16),p=parseInt(i.slice(3,5),16),c=parseInt(i.slice(5,7),16),E=[document.documentElement,document.querySelector("[data-theme]")].filter(Boolean);for(const C of E)C.style.setProperty("--color-accent",i),C.style.setProperty("--color-accent-hover",ft(i,15)),C.style.setProperty("--color-accent-muted",`rgba(${l}, ${p}, ${c}, 0.08)`),C.style.setProperty("--color-link",W(i,15)),C.style.setProperty("--color-badge-bg",`rgba(${l}, ${p}, ${c}, 0.1)`),C.style.setProperty("--color-badge-text",W(i,20))}function ft(a,i){const l=Math.max(0,Math.round(parseInt(a.slice(1,3),16)*(1-i/100))),p=Math.max(0,Math.round(parseInt(a.slice(3,5),16)*(1-i/100))),c=Math.max(0,Math.round(parseInt(a.slice(5,7),16)*(1-i/100)));return`#${l.toString(16).padStart(2,"0")}${p.toString(16).padStart(2,"0")}${c.toString(16).padStart(2,"0")}`}function W(a,i){const l=Math.min(255,Math.round(parseInt(a.slice(1,3),16)+(255-parseInt(a.slice(1,3),16))*i/100)),p=Math.min(255,Math.round(parseInt(a.slice(3,5),16)+(255-parseInt(a.slice(3,5),16))*i/100)),c=Math.min(255,Math.round(parseInt(a.slice(5,7),16)+(255-parseInt(a.slice(5,7),16))*i/100));return`#${l.toString(16).padStart(2,"0")}${p.toString(16).padStart(2,"0")}${c.toString(16).padStart(2,"0")}`}function mt(){let a=f(""),i=f(null),l=f(null),p=f(!1),c=f(w([]));const E={};let C=f(w([])),L=f(!1),R=f(null),g=f(w({})),U=w({}),M=w({}),S=w({}),P=f(0),v=f(null),h=f(""),k=null,$=f(0),I=f(0),x=f("alpha");async function J(){u(L,!0),u(R,null),u($,0),u(I,0);try{const[t,e,n]=await Promise.all([_(),ct().catch(()=>[]),rt().catch(()=>({name:""}))]);u(C,e,!0),u(a,n.name,!0),u(i,n.about??null,!0),u(l,n.accent_color??null,!0),u(p,!0),O(o(l)),u(c,t.map(r=>({name:r.name,displayName:F(r.name,r.display_name),type:r.type,private:r.private,sync:r.sync,count:null,entities:[],loading:!1,loaded:!1})),!0),await Promise.all(o(c).map(r=>b(r.name)))}catch(t){u(R,t.message,!0)}finally{u(L,!1)}}function D(t,e,n){const r=o(c).find(s=>s.name===t);r&&(r.entities=r.entities.filter(s=>!(s.id===n&&s.entityType===e)),r.count=r.entities.length)}async function j(t){o(c).find(n=>n.name===t)&&await b(t,!0)}async function Q(){u($,0),u(I,0),await Promise.all(o(c).map(t=>b(t.name,!0)))}async function b(t,e=!1){const n=o(c).find(s=>s.name===t);if(!n||n.loading||!e&&n.loaded)return;const r=(E[t]??0)+1;E[t]=r,e||(n.loading=!0);try{const s=await ut(t);if(E[t]!==r)return;let y=0,A=0;for(const d of s)y+=d.document?.wikilinks?.length??0,A+=d.subContentCount??0;u($,o($)+y),u(I,o(I)+A),n.entities=s.filter(d=>!d.id.toLowerCase().startsWith("readme")).map(d=>({id:d.id,title:d.data?.name??dt(d.id),entityType:d.entityType,repo:t,hasSubContent:!!d.hasSubContent,wikilinks:d.document?.wikilinks??[],createdAt:d.data?.created_at??null,updatedAt:d.data?.updated_at??null})).sort((d,nt)=>d.title.localeCompare(nt.title)),n.count=n.entities.length,n.loaded=!0}catch(s){console.error(`Failed to load entities for ${t}:`,s)}finally{n.loading=!1}}function q(t){o(g)[t]=!o(g)[t]}function B(t){return o(g)[t]??!1}function T(t,e,n){return`${t}/${e}/${n}`}function H(t,e,n){const r=T(t,e,n),s=U[r]??!1;U[r]=!s,!s&&!M[r]?.loaded&&Y(t,e,n)}function K(t,e,n){return U[T(t,e,n)]??!1}function V(t,e,n){return M[T(t,e,n)]??{entries:[],loading:!1,loaded:!1}}async function Y(t,e,n){const r=T(t,e,n);M[r]={entries:[],loading:!1,loaded:!0}}function z(t){const e=o(h).trim().toLowerCase();if(!e)return t;const n=[];for(const r of t){const s=r.entities.filter(y=>y.title.toLowerCase().includes(e)||y.id.toLowerCase().includes(e));s.length>0&&n.push({...r,entities:s,count:s.length})}return n}function G(t){if(t&&!o(h)?k={...o(g)}:!t&&o(h)&&k&&(u(g,k,!0),k=null),u(h,t,!0),t){const e=t.trim().toLowerCase();for(const n of o(c)){const r=n.entities.some(s=>s.title.toLowerCase().includes(e)||s.id.toLowerCase().includes(e));o(g)[n.name]=r}}}function X(t){const e=t.startsWith("type:");S[t]=!(S[t]??e)}function Z(t){return S[t]??!1}function N(t){return S[t]===!1}const tt=ot(()=>o(c).reduce((t,e)=>t+(e.count??0),0));function et(t){return o(C).find(e=>e.entityTypes.includes(t))}return{get name(){return o(a)},get about(){return o(i)},get accentColor(){return o(l)},get nameLoaded(){return o(p)},async updateWorkspace(t){t.accent_color!==void 0&&(u(l,t.accent_color,!0),O(t.accent_color)),await at(t),t.name?.trim()&&u(a,t.name.trim(),!0),typeof t.about=="string"&&u(i,t.about,!0)},get repos(){return o(c)},get apps(){return o(C)},get loading(){return o(L)},get error(){return o(R)},get totalEntities(){return o(tt)},get totalLinks(){return o($)},get totalFiles(){return o(I)},get sortedRepos(){const t=[...o(c)].sort((e,n)=>e.name.localeCompare(n.name));return z(t)},get filteredIds(){const t=o(h).trim().toLowerCase();if(!t)return null;const e=new Set;for(const n of o(c))for(const r of n.entities)(r.title.toLowerCase().includes(t)||r.id.toLowerCase().includes(t))&&e.add(r.id);return e},get filterQuery(){return o(h)},setFilterQuery:G,get sortMode(){return o(x)},set sortMode(t){u(x,t,!0)},get recentEntities(){const t=o(h).trim().toLowerCase();let e=[];for(const n of o(c))for(const r of n.entities)t&&!r.title.toLowerCase().includes(t)&&!r.id.toLowerCase().includes(t)||e.push(r);return e.sort((n,r)=>{const s=n.updatedAt??"";return(r.updatedAt??"").localeCompare(s)})},get sidebarScrollTop(){return o(P)},set sidebarScrollTop(t){u(P,t,!0)},get lastAutoExpandedFor(){return o(v)},set lastAutoExpandedFor(t){u(v,t,!0)},load:J,loadEntities:b,removeEntity:D,refreshEntities:j,refreshAll:Q,toggleRepo:q,isExpanded:B,toggleEntity:H,isEntityExpanded:K,getEntityContents:V,toggleFolder:X,isFolderExpanded:Z,isFolderCollapsed:N,getAppForEntityType:et,async renameCollectionTo(t,e,n){await st(t,e,n);const r=o(c).find(s=>s.name===t);r&&(r.name=e,r.displayName=n||F(e),o(g)[t]&&(o(g)[e]=!0,delete o(g)[t]))},async removeCollection(t){await lt(t),u(c,o(c).filter(e=>e.name!==t),!0),delete o(g)[t]},async addCollection(t,e,n,r){await it(t,e,n,r);const s=await _();u(c,s.map(y=>o(c).find(d=>d.name===y.name)??{name:y.name,displayName:F(y.name,y.display_name),type:y.type,private:y.private,count:null,entities:[],loading:!1,loaded:!1}),!0),o(g)[t]=!0,await b(t)}}}const bt=mt();export{ht as a,Ct as b,wt as c,Et as d,It as f,$t as u,bt as w};