studiograph 1.3.44-next.16 → 1.3.44-next.17

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 (65) hide show
  1. package/dist/web/_app/immutable/assets/4.jjULm1Dn.css +1 -0
  2. package/dist/web/_app/immutable/chunks/0l-halRY.js +1 -0
  3. package/dist/web/_app/immutable/chunks/{CQi1Ny0F.js → 9NN6rQgR.js} +1 -1
  4. package/dist/web/_app/immutable/chunks/{BtBweNkk.js → B0qTqRR8.js} +1 -1
  5. package/dist/web/_app/immutable/chunks/{2U5cDetP.js → BC12QVnT.js} +1 -1
  6. package/dist/web/_app/immutable/chunks/BOJ0UPVX.js +1 -0
  7. package/dist/web/_app/immutable/chunks/{faGDeGnG.js → BSBiehHY.js} +1 -1
  8. package/dist/web/_app/immutable/chunks/{Dp_zRVHI.js → BasUgd5N.js} +1 -1
  9. package/dist/web/_app/immutable/chunks/{sZJoCX5N.js → BenpwI6m.js} +1 -1
  10. package/dist/web/_app/immutable/chunks/{DvmL5xMZ.js → BjAmYrTY.js} +1 -1
  11. package/dist/web/_app/immutable/chunks/{CkIXD8Ce.js → CDFdgZ9U.js} +1 -1
  12. package/dist/web/_app/immutable/chunks/{CN-T2z5Y.js → CIaYnEDh.js} +1 -1
  13. package/dist/web/_app/immutable/chunks/{B4jNhkRC.js → CLw5zKi0.js} +1 -1
  14. package/dist/web/_app/immutable/chunks/{BdF6nRVd.js → COik51fd.js} +1 -1
  15. package/dist/web/_app/immutable/chunks/{SnShNp4Z.js → CRqQfwSP.js} +2 -2
  16. package/dist/web/_app/immutable/chunks/{BKUmpdNY.js → CStpN6HQ.js} +1 -1
  17. package/dist/web/_app/immutable/chunks/{D7roBQpq.js → CaswfP26.js} +1 -1
  18. package/dist/web/_app/immutable/chunks/{4uEV2Hr-.js → CbwDFpOn.js} +1 -1
  19. package/dist/web/_app/immutable/chunks/{OZfYVFGq.js → CieeblIr.js} +1 -1
  20. package/dist/web/_app/immutable/chunks/{b6zmgGXh.js → CpzNBDBb.js} +1 -1
  21. package/dist/web/_app/immutable/chunks/{DhsBMOEB.js → CyzLSh3b.js} +1 -1
  22. package/dist/web/_app/immutable/chunks/{Cz_Ld_mD.js → D0t3xCgu.js} +1 -1
  23. package/dist/web/_app/immutable/chunks/{B73qQAse.js → D2lhP22s.js} +1 -1
  24. package/dist/web/_app/immutable/chunks/{DHapptfx.js → D4dM_YPo.js} +1 -1
  25. package/dist/web/_app/immutable/chunks/{9rXsO0Bz.js → DAD7hf2c.js} +1 -1
  26. package/dist/web/_app/immutable/chunks/{CO5wfegi.js → DC1nGnOD.js} +1 -1
  27. package/dist/web/_app/immutable/chunks/{D94pMxcD.js → DN_2uSjw.js} +1 -1
  28. package/dist/web/_app/immutable/chunks/DQBH1xkO.js +1 -0
  29. package/dist/web/_app/immutable/chunks/{BdOJnB5W.js → DkilSMcP.js} +2 -2
  30. package/dist/web/_app/immutable/chunks/{DycWivyI.js → DtsqpIgr.js} +1 -1
  31. package/dist/web/_app/immutable/chunks/{BSSN_IAc.js → Dvv4bkXH.js} +1 -1
  32. package/dist/web/_app/immutable/chunks/{ghYWEYsA.js → DwG0Us6L.js} +1 -1
  33. package/dist/web/_app/immutable/chunks/OFOivmhv.js +1 -0
  34. package/dist/web/_app/immutable/chunks/{gawey_BW.js → h2NtTN7K.js} +1 -1
  35. package/dist/web/_app/immutable/chunks/{BnpnuDO4.js → owhS8Kw_.js} +1 -1
  36. package/dist/web/_app/immutable/chunks/sIAbdVrz.js +1 -0
  37. package/dist/web/_app/immutable/chunks/{DNrFMx27.js → wWaI7EIw.js} +1 -1
  38. package/dist/web/_app/immutable/entry/app.rLjdzA0r.js +2 -0
  39. package/dist/web/_app/immutable/entry/start.C9kTtODD.js +1 -0
  40. package/dist/web/_app/immutable/nodes/{0.lf3lBX5x.js → 0.C93-H6ox.js} +2 -2
  41. package/dist/web/_app/immutable/nodes/{1.Balz9xkk.js → 1.AQ3vkNSu.js} +1 -1
  42. package/dist/web/_app/immutable/nodes/{10.BY1McRFh.js → 10.DTaXt5yD.js} +1 -1
  43. package/dist/web/_app/immutable/nodes/{2.DQ9jxT6w.js → 2.bebiJHcc.js} +2 -2
  44. package/dist/web/_app/immutable/nodes/{3.Cch_DZ8s.js → 3.Cndxs4Li.js} +1 -1
  45. package/dist/web/_app/immutable/nodes/4.DVcx0swD.js +11 -0
  46. package/dist/web/_app/immutable/nodes/{5.DzFKcvFJ.js → 5.Crn1UO1M.js} +1 -1
  47. package/dist/web/_app/immutable/nodes/{6.BN5cgrr3.js → 6._vW6iBPu.js} +1 -1
  48. package/dist/web/_app/immutable/nodes/7.ZfmKjMRi.js +2 -0
  49. package/dist/web/_app/immutable/nodes/8.c1LZrXY5.js +1 -0
  50. package/dist/web/_app/immutable/nodes/{9.BKlUMRGR.js → 9.w1J9XasZ.js} +1 -1
  51. package/dist/web/_app/version.json +1 -1
  52. package/dist/web/index.html +11 -11
  53. package/package.json +1 -1
  54. package/dist/web/_app/immutable/assets/4.7qTa8kx3.css +0 -1
  55. package/dist/web/_app/immutable/chunks/B95ZQgm6.js +0 -1
  56. package/dist/web/_app/immutable/chunks/BDpvJ55Z.js +0 -1
  57. package/dist/web/_app/immutable/chunks/CiAwDBAJ.js +0 -1
  58. package/dist/web/_app/immutable/chunks/CoRi7XbI.js +0 -1
  59. package/dist/web/_app/immutable/chunks/DJQi596I.js +0 -1
  60. package/dist/web/_app/immutable/entry/app.BM8walGc.js +0 -2
  61. package/dist/web/_app/immutable/entry/start.CgjuomQF.js +0 -1
  62. package/dist/web/_app/immutable/nodes/4.Bg6bUbVA.js +0 -11
  63. package/dist/web/_app/immutable/nodes/7.DRZM4YuE.js +0 -2
  64. package/dist/web/_app/immutable/nodes/8.2JnI55tt.js +0 -1
  65. /package/dist/web/_app/immutable/assets/{checkbox.D6tMDJWk.css → index.D6tMDJWk.css} +0 -0
@@ -0,0 +1 @@
1
+ .autocomplete.svelte-84vb17{position:relative;width:100%}.input-row.svelte-84vb17{display:flex;flex-wrap:wrap;align-items:center;gap:4px;min-height:22px;padding:0;background:transparent;border:none;border-radius:4px}.chip.svelte-84vb17{display:inline-flex;align-items:center;gap:4px;height:20px;padding:0 8px;border-radius:9999px;font-size:13px;background:var(--color-accent-muted);color:var(--color-link, #e07070);flex-shrink:0}.chip.svelte-84vb17 .chip-remove{width:14px;height:14px;padding:0;color:var(--color-text-tertiary);font-size:13px;line-height:1}.chip.svelte-84vb17 .chip-remove:hover{color:var(--color-text-primary)}.ac-input.svelte-84vb17{flex:1;min-width:80px;height:22px;padding:0;font-size:14px;font-family:inherit;color:var(--color-text-primary);background:transparent;border:none;outline:none}.dropdown.svelte-84vb17{position:absolute;top:100%;left:0;right:0;margin-top:4px;max-height:240px;overflow-y:auto;background:var(--color-bg-elevated);border:1px solid var(--color-border);border-radius:6px;box-shadow:0 4px 16px #00000040;z-index:50}.dropdown-item.svelte-84vb17{display:flex;align-items:center;justify-content:space-between;padding:6px 10px;cursor:pointer;gap:8px}.dropdown-item.highlighted.svelte-84vb17{background:var(--color-bg-hover)}.entity-title.svelte-84vb17{font-size:14px;color:var(--color-text-primary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}.entity-meta.svelte-84vb17{display:flex;align-items:center;gap:6px;flex-shrink:0}.entity-type-badge.svelte-84vb17{font-size:12px;padding:1px 6px;border-radius:9999px;background:var(--color-badge-bg);color:var(--color-badge-text)}.entity-repo.svelte-84vb17{font-size:12px;color:var(--color-text-tertiary)}.property-row.svelte-eh8ho9{display:grid;grid-template-columns:20px 130px 1fr;align-items:center;gap:10px;padding:5px 8px;margin:0 -8px;border-radius:4px;min-height:30px;outline:2px solid transparent;transition:outline-color .1s}.property-row.svelte-eh8ho9:hover,.property-row.svelte-eh8ho9:focus-within{outline-color:var(--color-border)}.prop-icon.svelte-eh8ho9{display:flex;align-items:center;justify-content:center;color:var(--color-text-tertiary)}.icon-trigger{all:unset;display:flex;align-items:center;justify-content:center;cursor:pointer;color:var(--color-text-tertiary);border-radius:3px}.icon-trigger:hover{color:var(--color-text-secondary);background:var(--color-bg-hover)}.prop-key.svelte-eh8ho9{font-size:14px;color:var(--color-text-tertiary);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.prop-value.svelte-eh8ho9{font-size:14px;color:var(--color-text-primary);min-width:0;display:flex;align-items:center;gap:6px;cursor:pointer}.dot.svelte-eh8ho9{width:8px;height:8px;border-radius:50%;flex-shrink:0}.edit-input.svelte-eh8ho9{width:100%;font-size:14px;font-family:inherit;color:var(--color-text-primary);background:transparent;border:none;outline:none;padding:0}.text-value.svelte-eh8ho9,.date-value.svelte-eh8ho9{cursor:pointer;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.url-value.svelte-eh8ho9{color:var(--color-link, #e07070);cursor:text;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.badge-value.svelte-eh8ho9{display:inline-flex;padding:2px 8px;border-radius:4px;font-size:12px;font-weight:500;background:var(--color-badge-bg, rgba(224, 80, 80, .1));color:var(--color-badge-text, #e07070)}.wikilink-chips.svelte-eh8ho9{display:flex;flex-wrap:wrap;gap:4px}.wikilink-chip{padding:2px 8px!important;font-size:13px!important;border-radius:4px!important;background:var(--color-badge-bg, rgba(224, 80, 80, .1))!important;color:var(--color-badge-text, #e07070)!important}.wikilink-add{padding:2px 6px!important;font-size:13px!important;color:var(--color-text-tertiary)!important}.etype-trigger{all:unset;display:inline-flex;align-items:center;gap:6px;font-size:14px;color:var(--color-text-primary);cursor:pointer}.etype-trigger:hover{color:var(--etype-color)}.etype-content{max-height:300px;overflow-y:auto}.etype-item{display:flex;align-items:center;gap:6px}.status-trigger{border:none!important;box-shadow:none!important;padding:0!important;height:auto!important;background:transparent!important;gap:6px!important}.type-menu-content{min-width:120px}.type-menu-item{display:flex;align-items:center;justify-content:space-between;gap:8px}.type-menu-danger{color:var(--color-error, #e55)!important}.entity-properties.svelte-1a2lez6{padding:16px 40px 8px;border-bottom:1px solid var(--color-border)}.name-headline.svelte-1a2lez6{margin:8px 0;cursor:text}.name-text.svelte-1a2lez6{font-size:22px;font-weight:600;color:var(--color-text-primary);line-height:1.3}.name-input.svelte-1a2lez6{font-size:22px;font-weight:600;font-family:inherit;color:var(--color-text-primary);background:transparent;border:none;outline:none;width:100%;line-height:1.3;padding:0}.fields-toggle.svelte-1a2lez6{display:flex;align-items:baseline;gap:10px;background:none;border:none;font-family:inherit;font-size:14px;color:var(--color-text-secondary);cursor:pointer;padding:4px 8px;margin:0 -8px}.fields-toggle.svelte-1a2lez6:hover{color:var(--color-text-primary)}.fields-chevron.svelte-1a2lez6{display:inline-flex;align-items:center;justify-content:center;align-self:center;width:20px;color:var(--color-text-tertiary);transition:transform .15s}.fields-chevron.expanded.svelte-1a2lez6{transform:rotate(90deg)}.fields-label.svelte-1a2lez6{font-weight:400}.fields-count.svelte-1a2lez6{font-size:12px;color:var(--color-text-tertiary)}.fields-list.svelte-1a2lez6{margin-top:4px}.add-field-row.svelte-1a2lez6{padding:5px 8px;margin:0 -8px}.add-field-input.svelte-1a2lez6{font-size:14px;font-family:inherit;color:var(--color-text-primary);background:transparent;border:none;outline:none;padding:0;width:100%}.entity-properties.svelte-1a2lez6 .add-field-btn{margin:8px -8px;font-size:14px}.connections-panel.svelte-16xienp{margin:80px 0 48px;padding:16px 40px 0;border-top:1px solid var(--color-border)}.connections-header.svelte-16xienp{display:flex;align-items:baseline;gap:10px;background:none;border:none;font-family:inherit;font-size:14px;color:var(--color-text-secondary);cursor:pointer;padding:4px 8px;margin:0 -8px}.connections-header.svelte-16xienp:hover{color:var(--color-text-primary)}.header-chevron.svelte-16xienp{display:inline-flex;align-items:center;justify-content:center;width:20px;color:var(--color-text-tertiary);transition:transform .15s;transform:rotate(90deg)}.header-chevron.collapsed.svelte-16xienp{transform:rotate(0)}.header-label.svelte-16xienp{font-weight:400}.header-count.svelte-16xienp{font-size:12px;color:var(--color-text-tertiary)}.connections-body.svelte-16xienp{display:flex;flex-direction:column;gap:0;margin-top:8px}.connection-chip.svelte-16xienp{display:flex;align-items:center;gap:8px;padding:6px 8px;background:none;border:none;border-radius:4px;font-family:inherit;font-size:13px;color:var(--color-text-primary);cursor:pointer;text-align:left}.connection-chip.svelte-16xienp:hover{background:var(--color-bg-hover)}.chip-dot.svelte-16xienp{width:6px;height:6px;border-radius:50%;flex-shrink:0}.chip-name.svelte-16xienp{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chip-type.svelte-16xienp{font-size:12px;color:var(--color-text-tertiary);flex-shrink:0}.editor-wrap.svelte-ok7wy5{display:flex;min-height:0;position:relative}.cm-container.svelte-ok7wy5{flex:1;min-height:100px}.cm-container.svelte-ok7wy5 .cm-editor{min-height:100px;outline:none}.cm-container.svelte-ok7wy5 .cm-scroller{overflow:visible!important}.cursor-overlay.svelte-ok7wy5{position:absolute;inset:0;pointer-events:none;overflow:hidden}.remote-cursor.svelte-ok7wy5{position:absolute;width:2px;background-color:var(--cursor-color);z-index:10}.remote-cursor-label.svelte-ok7wy5{position:absolute;top:-1.4em;left:-1px;font-size:12px;font-family:var(--font-sans);font-weight:500;padding:0 4px;border-radius:3px 3px 3px 0;white-space:nowrap;line-height:1.5;color:#fff}.csv-editor.svelte-63hltt{padding:32px 40px 0}.table-scroll.svelte-63hltt{overflow-x:auto}table.svelte-63hltt{border-collapse:collapse;width:max-content;min-width:100%;font-size:14px;font-family:var(--font-sans)}th.svelte-63hltt,td.svelte-63hltt{border:1px solid var(--color-border);padding:0;height:32px;min-width:120px;max-width:300px}th.svelte-63hltt{background:transparent;font-weight:500;color:var(--color-text-secondary);position:sticky;top:0;z-index:1}th.svelte-63hltt:not(.row-num):not(.col-add){position:sticky;top:0;z-index:1}.row-num.svelte-63hltt{width:40px;min-width:40px;max-width:40px;text-align:center;color:var(--color-text-tertiary);font-size:12px;background:transparent}.cell-input.svelte-63hltt{width:100%;height:100%;border:none;background:transparent;color:var(--color-text-primary);font-family:var(--font-sans);font-size:14px;padding:4px 8px;outline:none}.cell-input.svelte-63hltt:focus{outline:2px solid var(--color-accent);outline-offset:-2px}.header-input.svelte-63hltt{font-weight:500;color:var(--color-text-secondary)}th.svelte-63hltt:not(.row-num):not(.col-add){position:relative}th.svelte-63hltt .col-delete-btn{position:absolute;top:2px;right:2px;width:18px;height:18px;display:none;background:var(--color-bg-hover);border-radius:3px;padding:0}th.svelte-63hltt:hover .col-delete-btn{display:flex}th.svelte-63hltt .col-delete-btn:hover{color:var(--color-destructive);background:var(--color-bg-selected)}.col-add.svelte-63hltt{width:32px;border:none;background:transparent}.col-add.svelte-63hltt .col-add-btn{width:100%;height:100%;border-radius:0;padding:0}.col-add.svelte-63hltt .col-add-btn:hover{color:var(--color-accent)}.actions.svelte-63hltt{width:32px;text-align:center;border:none}.actions.svelte-63hltt .delete-btn{display:none;width:20px;height:20px;padding:0;margin:0 auto}tr.svelte-63hltt:hover .delete-btn{display:flex}tr.svelte-63hltt .delete-btn:hover{color:var(--color-destructive)}.csv-footer.svelte-63hltt{display:flex;align-items:center;gap:16px;padding:8px 0}.csv-footer.svelte-63hltt .add-row-btn{font-size:14px}.remote-active.svelte-63hltt{outline:2px solid var(--rc-color, #e05050);outline-offset:-2px;position:relative}.remote-cell-label.svelte-63hltt{position:absolute;top:-18px;left:-1px;font-size:11px;font-family:var(--font-sans);font-weight:500;padding:0 4px;border-radius:3px 3px 3px 0;white-space:nowrap;line-height:1.6;color:#fff;z-index:2;pointer-events:none}.diff-view.svelte-1g4tvol{flex:1;overflow-y:auto;min-height:0}.diff-properties.svelte-1g4tvol{padding:16px 40px 8px;border-bottom:1px solid var(--color-border)}.dp-row.svelte-1g4tvol{display:grid;grid-template-columns:20px 120px 1fr;align-items:start;gap:8px;padding:5px 8px;margin:0 -8px;border-radius:4px;min-height:30px}.dp-icon.svelte-1g4tvol{display:flex;align-items:center;justify-content:center;color:var(--color-text-tertiary);height:22px}.dp-key.svelte-1g4tvol{font-size:14px;color:var(--color-text-tertiary);line-height:22px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.dp-value.svelte-1g4tvol{display:flex;flex-direction:column;gap:2px;min-height:22px;line-height:22px;font-size:14px;color:var(--color-text-primary)}.dp-diff-old.svelte-1g4tvol{display:inline-flex;align-items:center;padding:0 8px;border-radius:4px;background:#dc505026;color:var(--color-destructive, #e54d4d);min-height:22px;line-height:22px;width:fit-content}.dp-diff-new.svelte-1g4tvol{display:inline-flex;align-items:center;padding:0 8px;border-radius:4px;background:#50c86426;color:var(--color-success, #3ecf8e);min-height:22px;line-height:22px;width:fit-content}.diff-body.svelte-1g4tvol{padding:32px 40px;font-family:var(--font-sans);font-size:16px;line-height:1.6;color:var(--color-text-primary);white-space:pre-wrap;word-break:break-word}.diff-body.svelte-1g4tvol .db-removed{background:#dc505026;color:var(--color-destructive, #e54d4d);border-radius:2px}.diff-body.svelte-1g4tvol .db-added{background:#50c86426;color:var(--color-success, #3ecf8e);border-radius:2px}.document-scroll.svelte-udj3er{flex:1;overflow-y:auto;min-height:0}.document-well.svelte-udj3er{max-width:720px;margin:0 auto;width:100%}.editor-bar.svelte-udj3er{height:40px;flex-shrink:0;display:flex;align-items:center;justify-content:space-between;padding:0 16px 0 40px;border-bottom:1px solid var(--color-border)}.breadcrumb-path.svelte-udj3er{font-size:14px;color:var(--color-text-secondary);line-height:1.4;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}.bc-sep.svelte-udj3er{color:var(--color-text-tertiary);margin:0 6px}.bc-segment.svelte-udj3er{color:var(--color-text-secondary)}.bc-current.svelte-udj3er{color:var(--color-text-primary)}.editor-actions.svelte-udj3er{display:flex;align-items:center;gap:8px;flex-shrink:0;white-space:nowrap}.status-text.svelte-udj3er{font-size:13px}.status-text.saving.svelte-udj3er{color:var(--color-text-tertiary)}.status-text.error.svelte-udj3er{color:var(--color-destructive)}.editor-actions.svelte-udj3er .open-app{text-transform:capitalize}.refresh-panel.svelte-udj3er{border-bottom:1px solid var(--color-border);padding:12px 40px;background:var(--color-bg-secondary, var(--color-bg-hover));font-size:14px;flex-shrink:0}.refresh-uptodate.svelte-udj3er{color:var(--color-text-secondary)}.editor-bar-diff.svelte-udj3er{background:var(--color-bg)}.diff-action-title.svelte-udj3er{font-size:14px;color:var(--color-text-primary);font-weight:600}.diff-action-buttons.svelte-udj3er{display:flex;align-items:center;gap:6px}@media(max-width:960px){.breadcrumb-path.svelte-udj3er{display:none}}
@@ -0,0 +1 @@
1
+ import{c as H,a as y,p as ce,b as B,s as de,f as F}from"./COik51fd.js";import{J as he,aL as le,aT as fe,a4 as l,g as o,s as f,e as pe,p as z,a0 as S,b as E,a3 as me,c as P,ae as ge,r as N,l as J,d as M,a as be,n as ke,m as G,t as ve}from"./BenpwI6m.js";import{i as I}from"./Dvv4bkXH.js";import{c as ye}from"./CbwDFpOn.js";import{s as K,p as d,r as Q,l as L}from"./wWaI7EIw.js";import{c as _e}from"./DAD7hf2c.js";import{C as Ce}from"./DtsqpIgr.js";import{i as X}from"./BSBiehHY.js";import{s as U,a as Z}from"./CStpN6HQ.js";import{C as $,a as ee,w as T,E as xe,S as we,b as O,c as W,g as Re,i as qe,d as De,e as Y,f as Se,h as b,m as Pe}from"./DkilSMcP.js";import{H as Ne}from"./sIAbdVrz.js";const ze=[];function te(t,e=!1,r=!1){return D(t,new Map,"",ze,null,r)}function D(t,e,r,s,i=null,p=!1){if(typeof t=="object"&&t!==null){var u=e.get(t);if(u!==void 0)return u;if(t instanceof Map)return new Map(t);if(t instanceof Set)return new Set(t);if(he(t)){var a=Array(t.length);e.set(t,a),i!==null&&e.set(i,a);for(var n=0;n<t.length;n+=1){var _=t[n];n in t&&(a[n]=D(_,e,r,s,null,p))}return a}if(le(t)===fe){a={},e.set(t,a),i!==null&&e.set(i,a);for(var m of Object.keys(t))a[m]=D(t[m],e,r,s,null,p);return a}if(t instanceof Date)return structuredClone(t);if(typeof t.toJSON=="function"&&!p)return D(t.toJSON(),e,r,s,t)}if(t instanceof EventTarget)return t;try{return structuredClone(t)}catch{return t}}const re=De({component:"checkbox",parts:["root","group","group-label","input"]}),se=new $("Checkbox.Group");class ie{static create(e){return se.set(new ie(e))}opts;attachment;#e=pe(void 0);get labelId(){return o(this.#e)}set labelId(e){f(this.#e,e,!0)}constructor(e){this.opts=e,this.attachment=ee(this.opts.ref)}addValue(e){if(e&&!this.opts.value.current.includes(e)){const r=[...te(this.opts.value.current),e];if(this.opts.value.current=r,Y(this.opts.value.current,r))return;this.opts.onValueChange.current(r)}}removeValue(e){if(!e||this.opts.value.current.indexOf(e)===-1)return;const s=this.opts.value.current.filter(i=>i!==e);this.opts.value.current=s,!Y(this.opts.value.current,s)&&this.opts.onValueChange.current(s)}#t=l(()=>({id:this.opts.id.current,role:"group","aria-labelledby":this.labelId,"data-disabled":O(this.opts.disabled.current),[re.group]:"",...this.attachment}));get props(){return o(this.#t)}set props(e){f(this.#t,e)}}const ne=new $("Checkbox.Root");class V{static create(e,r=null){return ne.set(new V(e,r))}opts;group;#e=l(()=>this.group&&this.group.opts.name.current?this.group.opts.name.current:this.opts.name.current);get trueName(){return o(this.#e)}set trueName(e){f(this.#e,e)}#t=l(()=>this.group&&this.group.opts.required.current?!0:this.opts.required.current);get trueRequired(){return o(this.#t)}set trueRequired(e){f(this.#t,e)}#r=l(()=>this.group&&this.group.opts.disabled.current?!0:this.opts.disabled.current);get trueDisabled(){return o(this.#r)}set trueDisabled(e){f(this.#r,e)}#i=l(()=>this.group&&this.group.opts.readonly.current?!0:this.opts.readonly.current);get trueReadonly(){return o(this.#i)}set trueReadonly(e){f(this.#i,e)}attachment;constructor(e,r){this.opts=e,this.group=r,this.attachment=ee(this.opts.ref),this.onkeydown=this.onkeydown.bind(this),this.onclick=this.onclick.bind(this),T.pre([()=>te(this.group?.opts.value.current),()=>this.opts.value.current],([s,i])=>{!s||!i||(this.opts.checked.current=s.includes(i))}),T.pre(()=>this.opts.checked.current,s=>{this.group&&(s?this.group?.addValue(this.opts.value.current):this.group?.removeValue(this.opts.value.current))})}onkeydown(e){if(!(this.trueDisabled||this.trueReadonly)){if(e.key===xe){e.preventDefault(),this.opts.type.current==="submit"&&e.currentTarget.closest("form")?.requestSubmit();return}e.key===we&&(e.preventDefault(),this.#s())}}#s(){this.opts.indeterminate.current?(this.opts.indeterminate.current=!1,this.opts.checked.current=!0):this.opts.checked.current=!this.opts.checked.current}onclick(e){if(!(this.trueDisabled||this.trueReadonly)){if(this.opts.type.current==="submit"){this.#s();return}e.preventDefault(),this.#s()}}#n=l(()=>({checked:this.opts.checked.current,indeterminate:this.opts.indeterminate.current}));get snippetProps(){return o(this.#n)}set snippetProps(e){f(this.#n,e)}#o=l(()=>({id:this.opts.id.current,role:"checkbox",type:this.opts.type.current,disabled:this.trueDisabled,"aria-checked":Re(this.opts.checked.current,this.opts.indeterminate.current),"aria-required":W(this.trueRequired),"aria-readonly":W(this.trueReadonly),"data-disabled":O(this.trueDisabled),"data-readonly":O(this.trueReadonly),"data-state":Ee(this.opts.checked.current,this.opts.indeterminate.current),[re.root]:"",onclick:this.onclick,onkeydown:this.onkeydown,...this.attachment}));get props(){return o(this.#o)}set props(e){f(this.#o,e)}}class j{static create(){return new j(ne.get())}root;#e=l(()=>this.root.group?!!(this.root.opts.value.current!==void 0&&this.root.group.opts.value.current.includes(this.root.opts.value.current)):this.root.opts.checked.current);get trueChecked(){return o(this.#e)}set trueChecked(e){f(this.#e,e)}#t=l(()=>!!this.root.trueName);get shouldRender(){return o(this.#t)}set shouldRender(e){f(this.#t,e)}constructor(e){this.root=e,this.onfocus=this.onfocus.bind(this)}onfocus(e){qe(this.root.opts.ref.current)&&this.root.opts.ref.current.focus()}#r=l(()=>({type:"checkbox",checked:this.root.opts.checked.current===!0,disabled:this.root.trueDisabled,required:this.root.trueRequired,name:this.root.trueName,value:this.root.opts.value.current,readonly:this.root.trueReadonly,onfocus:this.onfocus}));get props(){return o(this.#r)}set props(e){f(this.#r,e)}}function Ee(t,e){return e?"indeterminate":t?"checked":"unchecked"}function Ie(t,e){z(e,!1);const r=j.create();X();var s=H(),i=S(s);{var p=u=>{Ne(u,K(()=>r.props))};I(i,u=>{r.shouldRender&&u(p)})}y(t,s),E()}var Ae=B("<button><!></button>"),Me=B("<!> <!>",1);function Te(t,e){const r=ce();z(e,!0);let s=d(e,"checked",15,!1),i=d(e,"ref",15,null),p=d(e,"disabled",3,!1),u=d(e,"required",3,!1),a=d(e,"name",3,void 0),n=d(e,"value",3,"on"),_=d(e,"id",19,()=>Se(r)),m=d(e,"indeterminate",15,!1),g=d(e,"type",3,"button"),h=Q(e,["$$slots","$$events","$$legacy","checked","ref","onCheckedChange","children","disabled","required","name","value","id","indeterminate","onIndeterminateChange","child","type","readonly"]);const k=se.getOr(null);k&&n()&&(k.opts.value.current.includes(n())?s(!0):s(!1)),T.pre(()=>n(),()=>{k&&n()&&(k.opts.value.current.includes(n())?s(!0):s(!1))});const C=V.create({checked:b(()=>s(),c=>{s(c),e.onCheckedChange?.(c)}),disabled:b(()=>p()??!1),required:b(()=>u()),name:b(()=>a()),value:b(()=>n()),id:b(()=>_()),ref:b(()=>i(),c=>i(c)),indeterminate:b(()=>m(),c=>{m(c),e.onIndeterminateChange?.(c)}),type:b(()=>g()),readonly:b(()=>!!e.readonly)},k),w=l(()=>Pe({...h},C.props));var R=Me(),q=S(R);{var v=c=>{var x=H(),A=S(x);{let ue=l(()=>({props:o(w),...C.snippetProps}));U(A,()=>e.child,()=>o(ue))}y(c,x)},oe=c=>{var x=Ae();Z(x,()=>({...o(w)}));var A=P(x);U(A,()=>e.children??ge,()=>C.snippetProps),N(x),y(c,x)};I(q,c=>{e.child?c(v):c(oe,!1)})}var ae=me(q,2);Ie(ae,{}),y(t,R),E()}var Oe=F("<title> </title>"),He=F('<svg><!><path d="M8 15H24V17H8z"></path></svg>');function Be(t,e){const r=L(e,["children","$$slots","$$events","$$legacy"]),s=L(r,["size","title"]);z(e,!1);const i=G(),p=G();let u=d(e,"size",8,16),a=d(e,"title",8,void 0);J(()=>(M(r),M(a())),()=>{f(i,r["aria-label"]||r["aria-labelledby"]||a())}),J(()=>(o(i),M(r)),()=>{f(p,{"aria-hidden":o(i)?void 0:!0,role:o(i)?"img":void 0,focusable:Number(r.tabindex)===0?!0:void 0})}),be(),X();var n=He();Z(n,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:u(),height:u(),...o(p),...s}));var _=P(n);{var m=g=>{var h=Oe(),k=P(h,!0);N(h),ve(()=>de(k,a())),y(g,h)};I(_,g=>{a()&&g(m)})}ke(),N(n),y(t,n),E()}var Ve=B('<span class="flex items-center justify-center text-current"><!></span>');function Ze(t,e){z(e,!0);let r=d(e,"checked",15,!1),s=d(e,"indeterminate",15,!1),i=d(e,"ref",15,null),p=Q(e,["$$slots","$$events","$$legacy","class","checked","indeterminate","ref"]);var u=H(),a=S(u);{const n=(m,g)=>{let h=()=>g?.().checked,k=()=>g?.().indeterminate;var C=Ve(),w=P(C);{var R=v=>{Be(v,{class:"size-3"})},q=v=>{Ce(v,{class:"size-3"})};I(w,v=>{k()?v(R):h()&&v(q,1)})}N(C),y(m,C)};let _=l(()=>_e("peer inline-flex size-4 shrink-0 items-center justify-center rounded-sm border border-[var(--color-border)] bg-transparent transition-colors","hover:border-[var(--color-accent)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent)] focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--color-bg-primary)]","disabled:cursor-not-allowed disabled:opacity-50","data-[state=checked]:border-[var(--color-accent)] data-[state=checked]:bg-[var(--color-accent)] data-[state=checked]:text-white",e.class));ye(a,()=>Te,(m,g)=>{g(m,K({get class(){return o(_)}},()=>p,{get checked(){return r()},set checked(h){r(h)},get indeterminate(){return s()},set indeterminate(h){s(h)},get ref(){return i()},set ref(h){i(h)},children:n,$$slots:{default:!0}}))})}y(t,u),E()}export{Ze as C,ie as a,te as s};
@@ -1 +1 @@
1
- import{O as B,f as F,g as A,e as V,w as S,a as J,t as v,c as D,r as L,b as _,d as N,h as E,i as P,j as G,k as O,l as q,D as R,m as z}from"./CLFba8FK.js";import{r as M}from"./SnShNp4Z.js";const b=3e4;class K extends B{constructor(n){super(),this.doc=n,this.clientID=n.clientID,this.states=new Map,this.meta=new Map,this._checkInterval=setInterval(()=>{const e=A();this.getLocalState()!==null&&b/2<=e-this.meta.get(this.clientID).lastUpdated&&this.setLocalState(this.getLocalState());const s=[];this.meta.forEach((a,c)=>{c!==this.clientID&&b<=e-a.lastUpdated&&this.states.has(c)&&s.push(c)}),s.length>0&&x(this,s,"timeout")},F(b/10)),n.on("destroy",()=>{this.destroy()}),this.setLocalState({})}destroy(){this.emit("destroy",[this]),this.setLocalState(null),super.destroy(),clearInterval(this._checkInterval)}getLocalState(){return this.states.get(this.clientID)||null}setLocalState(n){const e=this.clientID,s=this.meta.get(e),a=s===void 0?0:s.clock+1,c=this.states.get(e);n===null?this.states.delete(e):this.states.set(e,n),this.meta.set(e,{clock:a,lastUpdated:A()});const l=[],u=[],r=[],p=[];n===null?p.push(e):c==null?n!=null&&l.push(e):(u.push(e),V(c,n)||r.push(e)),(l.length>0||r.length>0||p.length>0)&&this.emit("change",[{added:l,updated:r,removed:p},"local"]),this.emit("update",[{added:l,updated:u,removed:p},"local"])}setLocalStateField(n,e){const s=this.getLocalState();s!==null&&this.setLocalState({...s,[n]:e})}getStates(){return this.states}}const x=(t,n,e)=>{const s=[];for(let a=0;a<n.length;a++){const c=n[a];if(t.states.has(c)){if(t.states.delete(c),c===t.clientID){const l=t.meta.get(c);t.meta.set(c,{clock:l.clock+1,lastUpdated:A()})}s.push(c)}}s.length>0&&(t.emit("change",[{added:[],updated:[],removed:s},e]),t.emit("update",[{added:[],updated:[],removed:s},e]))},Q=(t,n,e=t.states)=>{const s=n.length,a=D();S(a,s);for(let c=0;c<s;c++){const l=n[c],u=e.get(l)||null,r=t.meta.get(l).clock;S(a,l),S(a,r),J(a,JSON.stringify(u))}return v(a)},X=(t,n,e)=>{const s=N(n),a=A(),c=[],l=[],u=[],r=[],p=L(s);for(let m=0;m<p;m++){const d=L(s);let g=L(s);const h=JSON.parse(_(s)),y=t.meta.get(d),k=t.states.get(d),o=y===void 0?0:y.clock;(o<g||o===g&&h===null&&t.states.has(d))&&(h===null?d===t.clientID&&t.getLocalState()!=null?g++:t.states.delete(d):t.states.set(d,h),t.meta.set(d,{clock:g,lastUpdated:a}),y===void 0&&h!==null?c.push(d):y!==void 0&&h===null?r.push(d):h!==null&&(V(h,k)||u.push(d),l.push(d)))}(c.length>0||u.length>0||r.length>0)&&t.emit("change",[{added:c,updated:u,removed:r},e]),(c.length>0||l.length>0||r.length>0)&&t.emit("update",[{added:c,updated:l,removed:r},e])},W=0,j=1,C=2,Z=(t,n)=>{S(t,W);const e=P(n);E(t,e)},$=(t,n,e)=>{S(t,j),E(t,q(n,e))},H=(t,n,e)=>$(n,e,O(t)),Y=(t,n,e,s)=>{try{G(n,O(t),e)}catch(a){s?.(a),console.error("Caught error while handling a Yjs update",a)}},tt=(t,n)=>{S(t,C),E(t,n)},et=Y,nt=(t,n,e,s,a)=>{const c=L(t);switch(c){case W:H(t,n,e);break;case j:Y(t,e,s,a);break;case C:et(t,e,s,a);break;default:throw new Error("Unknown message type")}return c},U=0,T=1;function st(t,n,e){const s=new TextEncoder().encode(t),a=new ArrayBuffer(2+s.length+1+e.length);return new DataView(a).setUint16(0,s.length),new Uint8Array(a,2,s.length).set(s),new Uint8Array(a)[2+s.length]=n,new Uint8Array(a,2+s.length+1).set(e),a}function at(t){if(t.byteLength<3)return null;const e=new DataView(t).getUint16(0);if(t.byteLength<2+e+1)return null;const s=new TextDecoder().decode(new Uint8Array(t,2,e)),a=new Uint8Array(t)[2+e],c=new Uint8Array(t,2+e+1);return{docName:s,msgType:a,payload:c}}function lt(t,n){const e=new R,s=e.getText("content"),a=new K(e);a.setLocalStateField("user",{name:n.name,color:n.color,colorLight:n.colorLight??n.color+"33"});let c=null,l=!1;function u(){return M.ws??null}function r(o,f){const i=u();!i||i.readyState!==WebSocket.OPEN||i.send(st(t,o,f))}function p(){const o=D();Z(o,e),r(U,v(o))}function m(o){const f=o??[e.clientID],i=Q(a,f);r(T,i)}function d(o){if(l||typeof o.data=="string")return;const f=o.data instanceof ArrayBuffer?o.data:null;if(!f)return;const i=at(f);if(!(!i||i.docName!==t))if(i.msgType===U){const I=N(i.payload),w=D();nt(I,w,e,"ws-server"),z(w)>0&&r(U,v(w))}else i.msgType===T&&X(a,i.payload,"ws-server")}function g(o,f){if(l||f==="ws-server")return;const i=D();tt(i,o),r(U,v(i))}function h({added:o,updated:f,removed:i},I){if(l||I==="ws-server")return;const w=o.concat(f,i);m(w)}function y(){if(l)return;const o=u();!o||o.readyState!==WebSocket.OPEN||(o.send(JSON.stringify({type:"collab:join",docName:t})),c&&o.removeEventListener("message",c),c=d,o.addEventListener("message",c),p(),m())}e.on("update",g),a.on("update",h),y(),M.addConnectHandler(y);function k(){if(l)return;l=!0,x(a,[e.clientID],"local"),m([e.clientID]);const o=u();o&&o.readyState===WebSocket.OPEN&&o.send(JSON.stringify({type:"collab:leave",docName:t})),c&&o&&(o.removeEventListener("message",c),c=null),e.off("update",g),a.off("update",h),a.destroy(),e.destroy()}return{ydoc:e,ytext:s,awareness:a,destroy:k}}export{lt as createCollabSession};
1
+ import{O as B,f as F,g as A,e as V,w as S,a as J,t as v,c as D,r as L,b as _,d as N,h as E,i as P,j as G,k as O,l as q,D as R,m as z}from"./CLFba8FK.js";import{r as M}from"./CRqQfwSP.js";const b=3e4;class K extends B{constructor(n){super(),this.doc=n,this.clientID=n.clientID,this.states=new Map,this.meta=new Map,this._checkInterval=setInterval(()=>{const e=A();this.getLocalState()!==null&&b/2<=e-this.meta.get(this.clientID).lastUpdated&&this.setLocalState(this.getLocalState());const s=[];this.meta.forEach((a,c)=>{c!==this.clientID&&b<=e-a.lastUpdated&&this.states.has(c)&&s.push(c)}),s.length>0&&x(this,s,"timeout")},F(b/10)),n.on("destroy",()=>{this.destroy()}),this.setLocalState({})}destroy(){this.emit("destroy",[this]),this.setLocalState(null),super.destroy(),clearInterval(this._checkInterval)}getLocalState(){return this.states.get(this.clientID)||null}setLocalState(n){const e=this.clientID,s=this.meta.get(e),a=s===void 0?0:s.clock+1,c=this.states.get(e);n===null?this.states.delete(e):this.states.set(e,n),this.meta.set(e,{clock:a,lastUpdated:A()});const l=[],u=[],r=[],p=[];n===null?p.push(e):c==null?n!=null&&l.push(e):(u.push(e),V(c,n)||r.push(e)),(l.length>0||r.length>0||p.length>0)&&this.emit("change",[{added:l,updated:r,removed:p},"local"]),this.emit("update",[{added:l,updated:u,removed:p},"local"])}setLocalStateField(n,e){const s=this.getLocalState();s!==null&&this.setLocalState({...s,[n]:e})}getStates(){return this.states}}const x=(t,n,e)=>{const s=[];for(let a=0;a<n.length;a++){const c=n[a];if(t.states.has(c)){if(t.states.delete(c),c===t.clientID){const l=t.meta.get(c);t.meta.set(c,{clock:l.clock+1,lastUpdated:A()})}s.push(c)}}s.length>0&&(t.emit("change",[{added:[],updated:[],removed:s},e]),t.emit("update",[{added:[],updated:[],removed:s},e]))},Q=(t,n,e=t.states)=>{const s=n.length,a=D();S(a,s);for(let c=0;c<s;c++){const l=n[c],u=e.get(l)||null,r=t.meta.get(l).clock;S(a,l),S(a,r),J(a,JSON.stringify(u))}return v(a)},X=(t,n,e)=>{const s=N(n),a=A(),c=[],l=[],u=[],r=[],p=L(s);for(let m=0;m<p;m++){const d=L(s);let g=L(s);const h=JSON.parse(_(s)),y=t.meta.get(d),k=t.states.get(d),o=y===void 0?0:y.clock;(o<g||o===g&&h===null&&t.states.has(d))&&(h===null?d===t.clientID&&t.getLocalState()!=null?g++:t.states.delete(d):t.states.set(d,h),t.meta.set(d,{clock:g,lastUpdated:a}),y===void 0&&h!==null?c.push(d):y!==void 0&&h===null?r.push(d):h!==null&&(V(h,k)||u.push(d),l.push(d)))}(c.length>0||u.length>0||r.length>0)&&t.emit("change",[{added:c,updated:u,removed:r},e]),(c.length>0||l.length>0||r.length>0)&&t.emit("update",[{added:c,updated:l,removed:r},e])},W=0,j=1,C=2,Z=(t,n)=>{S(t,W);const e=P(n);E(t,e)},$=(t,n,e)=>{S(t,j),E(t,q(n,e))},H=(t,n,e)=>$(n,e,O(t)),Y=(t,n,e,s)=>{try{G(n,O(t),e)}catch(a){s?.(a),console.error("Caught error while handling a Yjs update",a)}},tt=(t,n)=>{S(t,C),E(t,n)},et=Y,nt=(t,n,e,s,a)=>{const c=L(t);switch(c){case W:H(t,n,e);break;case j:Y(t,e,s,a);break;case C:et(t,e,s,a);break;default:throw new Error("Unknown message type")}return c},U=0,T=1;function st(t,n,e){const s=new TextEncoder().encode(t),a=new ArrayBuffer(2+s.length+1+e.length);return new DataView(a).setUint16(0,s.length),new Uint8Array(a,2,s.length).set(s),new Uint8Array(a)[2+s.length]=n,new Uint8Array(a,2+s.length+1).set(e),a}function at(t){if(t.byteLength<3)return null;const e=new DataView(t).getUint16(0);if(t.byteLength<2+e+1)return null;const s=new TextDecoder().decode(new Uint8Array(t,2,e)),a=new Uint8Array(t)[2+e],c=new Uint8Array(t,2+e+1);return{docName:s,msgType:a,payload:c}}function lt(t,n){const e=new R,s=e.getText("content"),a=new K(e);a.setLocalStateField("user",{name:n.name,color:n.color,colorLight:n.colorLight??n.color+"33"});let c=null,l=!1;function u(){return M.ws??null}function r(o,f){const i=u();!i||i.readyState!==WebSocket.OPEN||i.send(st(t,o,f))}function p(){const o=D();Z(o,e),r(U,v(o))}function m(o){const f=o??[e.clientID],i=Q(a,f);r(T,i)}function d(o){if(l||typeof o.data=="string")return;const f=o.data instanceof ArrayBuffer?o.data:null;if(!f)return;const i=at(f);if(!(!i||i.docName!==t))if(i.msgType===U){const I=N(i.payload),w=D();nt(I,w,e,"ws-server"),z(w)>0&&r(U,v(w))}else i.msgType===T&&X(a,i.payload,"ws-server")}function g(o,f){if(l||f==="ws-server")return;const i=D();tt(i,o),r(U,v(i))}function h({added:o,updated:f,removed:i},I){if(l||I==="ws-server")return;const w=o.concat(f,i);m(w)}function y(){if(l)return;const o=u();!o||o.readyState!==WebSocket.OPEN||(o.send(JSON.stringify({type:"collab:join",docName:t})),c&&o.removeEventListener("message",c),c=d,o.addEventListener("message",c),p(),m())}e.on("update",g),a.on("update",h),y(),M.addConnectHandler(y);function k(){if(l)return;l=!0,x(a,[e.clientID],"local"),m([e.clientID]);const o=u();o&&o.readyState===WebSocket.OPEN&&o.send(JSON.stringify({type:"collab:leave",docName:t})),c&&o&&(o.removeEventListener("message",c),c=null),e.off("update",g),a.off("update",h),a.destroy(),e.destroy()}return{ydoc:e,ytext:s,awareness:a,destroy:k}}export{lt as createCollabSession};
@@ -1 +1 @@
1
- import{g as n,e as o,s as t}from"./sZJoCX5N.js";import{a as u}from"./OZfYVFGq.js";function f(){return u("/api/auth/status")}function p(){return u("/api/auth/me")}function g(e,a){return u("/api/auth/login",{method:"POST",body:JSON.stringify({email:e,password:a})})}function S(){return u("/api/auth/logout",{method:"POST"})}function b(e,a,r){return u("/api/auth/setup",{method:"POST",body:JSON.stringify({email:e,password:a,displayName:r})})}function w(){return u("/api/auth/users")}function O(e,a,r,i){return u("/api/auth/users",{method:"POST",body:JSON.stringify({email:e,password:a,displayName:r,role:i})})}function N(e){return u(`/api/auth/users/${e}`,{method:"DELETE"})}function P(e,a){return u(`/api/auth/users/${e}/password`,{method:"PATCH",body:JSON.stringify({password:a})})}let l=o(null),d=o(!1),c=o(!1),s=o(!0),h=o("");const m={get user(){return n(l)},get authEnabled(){return n(d)},get needsSetup(){return n(c)},get loading(){return n(s)},get workspaceName(){return n(h)},async checkAuth(){t(s,!0);try{const e=await f();if(t(d,e.authEnabled,!0),t(c,e.userCount===0),e.workspaceName&&t(h,e.workspaceName,!0),n(c))return t(s,!1),{authenticated:!1,authEnabled:!1,needsSetup:!0};if(!e.authEnabled)return t(s,!1),{authenticated:!0,authEnabled:!1,needsSetup:!1};try{const{user:a}=await p();return t(l,a,!0),t(s,!1),{authenticated:!0,authEnabled:!0,needsSetup:!1}}catch{return t(l,null),t(s,!1),{authenticated:!1,authEnabled:!0,needsSetup:!1}}}catch{return t(s,!1),{authenticated:!0,authEnabled:!1,needsSetup:!1}}},async login(e,a){const{user:r}=await g(e,a);return t(l,r,!0),t(d,!0),r},async setup(e,a,r){const{user:i}=await b(e,a,r);return t(l,i,!0),t(d,!0),t(c,!1),i},async logout(){await S(),t(l,null)}},T=Object.freeze(Object.defineProperty({__proto__:null,auth:m},Symbol.toStringTag,{value:"Module"}));export{m as a,T as b,O as c,N as d,w as l,P as r};
1
+ import{g as n,e as o,s as t}from"./BenpwI6m.js";import{a as u}from"./CieeblIr.js";function f(){return u("/api/auth/status")}function p(){return u("/api/auth/me")}function g(e,a){return u("/api/auth/login",{method:"POST",body:JSON.stringify({email:e,password:a})})}function S(){return u("/api/auth/logout",{method:"POST"})}function b(e,a,r){return u("/api/auth/setup",{method:"POST",body:JSON.stringify({email:e,password:a,displayName:r})})}function w(){return u("/api/auth/users")}function O(e,a,r,i){return u("/api/auth/users",{method:"POST",body:JSON.stringify({email:e,password:a,displayName:r,role:i})})}function N(e){return u(`/api/auth/users/${e}`,{method:"DELETE"})}function P(e,a){return u(`/api/auth/users/${e}/password`,{method:"PATCH",body:JSON.stringify({password:a})})}let l=o(null),d=o(!1),c=o(!1),s=o(!0),h=o("");const m={get user(){return n(l)},get authEnabled(){return n(d)},get needsSetup(){return n(c)},get loading(){return n(s)},get workspaceName(){return n(h)},async checkAuth(){t(s,!0);try{const e=await f();if(t(d,e.authEnabled,!0),t(c,e.userCount===0),e.workspaceName&&t(h,e.workspaceName,!0),n(c))return t(s,!1),{authenticated:!1,authEnabled:!1,needsSetup:!0};if(!e.authEnabled)return t(s,!1),{authenticated:!0,authEnabled:!1,needsSetup:!1};try{const{user:a}=await p();return t(l,a,!0),t(s,!1),{authenticated:!0,authEnabled:!0,needsSetup:!1}}catch{return t(l,null),t(s,!1),{authenticated:!1,authEnabled:!0,needsSetup:!1}}}catch{return t(s,!1),{authenticated:!0,authEnabled:!1,needsSetup:!1}}},async login(e,a){const{user:r}=await g(e,a);return t(l,r,!0),t(d,!0),r},async setup(e,a,r){const{user:i}=await b(e,a,r);return t(l,i,!0),t(d,!0),t(c,!1),i},async logout(){await S(),t(l,null)}},T=Object.freeze(Object.defineProperty({__proto__:null,auth:m},Symbol.toStringTag,{value:"Module"}));export{m as a,T as b,O as c,N as d,w as l,P as r};
@@ -1 +1 @@
1
- import{a as m,s as U,f as _}from"./BdF6nRVd.js";import{i as O}from"./faGDeGnG.js";import{p as T,l as h,s as l,d as u,g as i,a as H,c as C,n as P,r as g,b as V,m as y,t as x}from"./sZJoCX5N.js";import{i as z}from"./BSSN_IAc.js";import{a as M}from"./BKUmpdNY.js";import{l as $,p as R}from"./DNrFMx27.js";import{a as t}from"./OZfYVFGq.js";var w=_("<title> </title>"),A=_('<svg><!><path d="M12 12H14V24H12z"></path><path d="M18 12H20V24H18z"></path><path d="M4,6V8H6V28a2,2,0,0,0,2,2H24a2,2,0,0,0,2-2V8h2V6ZM8,28V8H24V28Z"></path><path d="M12 2H20V4H12z"></path></svg>');function D(e,n){const o=$(n,["children","$$slots","$$events","$$legacy"]),v=$(o,["size","title"]);T(n,!1);const r=y(),d=y();let f=R(n,"size",8,16),a=R(n,"title",8,void 0);h(()=>(u(o),u(a())),()=>{l(r,o["aria-label"]||o["aria-labelledby"]||a())}),h(()=>(i(r),u(o)),()=>{l(d,{"aria-hidden":i(r)?void 0:!0,role:i(r)?"img":void 0,focusable:Number(o.tabindex)===0?!0:void 0})}),H(),O();var s=A();M(s,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:f(),height:f(),...i(d),...v}));var b=C(s);{var I=c=>{var p=w(),S=C(p,!0);g(p),x(()=>U(S,a())),m(c,p)};z(b,c=>{a()&&c(I)})}P(4),g(s),m(e,s),V()}function F(e){return t(`/api/repos/${encodeURIComponent(e)}/sync`,{method:"POST"})}function L(){return t("/api/sync",{method:"POST"})}function W(e,n,o){return t(`/api/repos/${encodeURIComponent(e)}/entities/${encodeURIComponent(n)}/${encodeURIComponent(o)}/refresh`,{method:"POST"})}function Y(e,n,o){return t(`/api/repos/${encodeURIComponent(e)}/entities/${encodeURIComponent(n)}/${encodeURIComponent(o)}/refresh/apply`,{method:"POST"})}function q(){return t("/api/sources")}function G(){return t("/api/connectors")}function K(e){return t(`/api/connectors/${encodeURIComponent(e)}/config`)}function Q(e,n){return t(`/api/connectors/${encodeURIComponent(e)}/config`,{method:"POST",body:JSON.stringify({...n,name:e})})}function X(e){return t(`/api/connectors/${encodeURIComponent(e)}/config`,{method:"DELETE"})}function ee(e){return t(`/api/sources/${encodeURIComponent(e)}`)}function te(e,n){return t(`/api/sources/${encodeURIComponent(e)}`,{method:"POST",body:JSON.stringify(n)})}function ne(e,n){return t(`/api/repos/${encodeURIComponent(e)}`,{method:"PATCH",body:JSON.stringify({sync:n})})}function oe(e){return t(`/api/connectors/${encodeURIComponent(e)}/oauth/authorize`,{method:"POST"})}function re(e){return t(`/api/connectors/${encodeURIComponent(e)}/oauth/status`)}function ae(e){return t(`/api/connectors/${encodeURIComponent(e)}/oauth/disconnect`,{method:"POST"})}export{D as T,G as a,ee as b,K as c,Q as d,ae as e,q as f,X as g,re as h,oe as i,Y as j,L as k,F as l,W as r,te as s,ne as u};
1
+ import{a as m,s as U,f as _}from"./COik51fd.js";import{i as O}from"./BSBiehHY.js";import{p as T,l as h,s as l,d as u,g as i,a as H,c as C,n as P,r as g,b as V,m as y,t as x}from"./BenpwI6m.js";import{i as z}from"./Dvv4bkXH.js";import{a as M}from"./CStpN6HQ.js";import{l as $,p as R}from"./wWaI7EIw.js";import{a as t}from"./CieeblIr.js";var w=_("<title> </title>"),A=_('<svg><!><path d="M12 12H14V24H12z"></path><path d="M18 12H20V24H18z"></path><path d="M4,6V8H6V28a2,2,0,0,0,2,2H24a2,2,0,0,0,2-2V8h2V6ZM8,28V8H24V28Z"></path><path d="M12 2H20V4H12z"></path></svg>');function D(e,n){const o=$(n,["children","$$slots","$$events","$$legacy"]),v=$(o,["size","title"]);T(n,!1);const r=y(),d=y();let f=R(n,"size",8,16),a=R(n,"title",8,void 0);h(()=>(u(o),u(a())),()=>{l(r,o["aria-label"]||o["aria-labelledby"]||a())}),h(()=>(i(r),u(o)),()=>{l(d,{"aria-hidden":i(r)?void 0:!0,role:i(r)?"img":void 0,focusable:Number(o.tabindex)===0?!0:void 0})}),H(),O();var s=A();M(s,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:f(),height:f(),...i(d),...v}));var b=C(s);{var I=c=>{var p=w(),S=C(p,!0);g(p),x(()=>U(S,a())),m(c,p)};z(b,c=>{a()&&c(I)})}P(4),g(s),m(e,s),V()}function F(e){return t(`/api/repos/${encodeURIComponent(e)}/sync`,{method:"POST"})}function L(){return t("/api/sync",{method:"POST"})}function W(e,n,o){return t(`/api/repos/${encodeURIComponent(e)}/entities/${encodeURIComponent(n)}/${encodeURIComponent(o)}/refresh`,{method:"POST"})}function Y(e,n,o){return t(`/api/repos/${encodeURIComponent(e)}/entities/${encodeURIComponent(n)}/${encodeURIComponent(o)}/refresh/apply`,{method:"POST"})}function q(){return t("/api/sources")}function G(){return t("/api/connectors")}function K(e){return t(`/api/connectors/${encodeURIComponent(e)}/config`)}function Q(e,n){return t(`/api/connectors/${encodeURIComponent(e)}/config`,{method:"POST",body:JSON.stringify({...n,name:e})})}function X(e){return t(`/api/connectors/${encodeURIComponent(e)}/config`,{method:"DELETE"})}function ee(e){return t(`/api/sources/${encodeURIComponent(e)}`)}function te(e,n){return t(`/api/sources/${encodeURIComponent(e)}`,{method:"POST",body:JSON.stringify(n)})}function ne(e,n){return t(`/api/repos/${encodeURIComponent(e)}`,{method:"PATCH",body:JSON.stringify({sync:n})})}function oe(e){return t(`/api/connectors/${encodeURIComponent(e)}/oauth/authorize`,{method:"POST"})}function re(e){return t(`/api/connectors/${encodeURIComponent(e)}/oauth/status`)}function ae(e){return t(`/api/connectors/${encodeURIComponent(e)}/oauth/disconnect`,{method:"POST"})}export{D as T,G as a,ee as b,K as c,Q as d,ae as e,q as f,X as g,re as h,oe as i,Y as j,L as k,F as l,W as r,te as s,ne as u};
@@ -0,0 +1 @@
1
+ import{c as K,a as u,p as oe,b as q,s as ue,f as Ae,t as ve}from"./COik51fd.js";import{p as $,a0 as O,ae as X,b as ee,g as l,c as T,r as k,a4 as I,e as Re,f as De,s as be,l as we,d as ye,a as Te,n as ce,m as Ce,t as fe,a3 as Pe}from"./BenpwI6m.js";import{s as x,a as U}from"./CStpN6HQ.js";import{i as Y}from"./Dvv4bkXH.js";import{p as r,r as ae,s as pe,l as Se}from"./wWaI7EIw.js";import{p as D,M as ke,h,t as Ke,f as se,H as Le,m as Q,I as He,J as Ie,q as xe,r as Ee,i as Ne,K as Ue,L as ze,s as ge,N as Ve,F as Be,O as Ze,Q as je,R as We,T as Ye,A as qe,u as Ge,v as Je,x as Qe,y as Xe,z as $e,B as et,G as tt}from"./DkilSMcP.js";import{r as Me}from"./CRqQfwSP.js";import{i as rt}from"./BSBiehHY.js";import{c as re}from"./CbwDFpOn.js";import{a as Fe}from"./DAD7hf2c.js";function nt(v,e){$(e,!0);let c=r(e,"open",15,!1),y=r(e,"onOpenChange",3,D),m=r(e,"onOpenChangeComplete",3,D);ke.create({open:h(()=>c(),f=>{c(f),y()?.(f)}),onOpenChangeComplete:h(()=>m())}),Ke(v,{children:(f,F)=>{var P=K(),g=O(P);x(g,()=>e.children??X),u(f,P)},$$slots:{default:!0}}),ee()}var ot=q("<div><!></div>");function at(v,e){const c=oe();$(e,!0);let y=r(e,"ref",15,null),m=r(e,"id",19,()=>se(c)),f=r(e,"disabled",3,!1),F=r(e,"onSelect",3,D),P=r(e,"closeOnSelect",3,!0),g=ae(e,["$$slots","$$events","$$legacy","child","children","ref","id","disabled","onSelect","closeOnSelect"]);const C=Le.create({id:h(()=>m()),disabled:h(()=>f()),onSelect:h(()=>F()),ref:h(()=>y(),n=>y(n)),closeOnSelect:h(()=>P())}),p=I(()=>Q(g,C.props));var A=K(),i=O(A);{var t=n=>{var d=K(),o=O(d);x(o,()=>e.child,()=>({props:l(p)})),u(n,d)},a=n=>{var d=ot();U(d,()=>({...l(p)}));var o=T(d);x(o,()=>e.children??X),k(d),u(n,d)};Y(i,n=>{e.child?n(t):n(a,!1)})}u(v,A),ee()}var st=q("<div><!></div>");function lt(v,e){const c=oe();$(e,!0);let y=r(e,"ref",15,null),m=r(e,"id",19,()=>se(c)),f=ae(e,["$$slots","$$events","$$legacy","ref","id","child","children"]);const F=He.create({id:h(()=>m()),ref:h(()=>y(),i=>y(i))}),P=I(()=>Q(f,F.props));var g=K(),C=O(g);{var p=i=>{var t=K(),a=O(t);x(a,()=>e.child,()=>({props:l(P)})),u(i,t)},A=i=>{var t=st();U(t,()=>({...l(P)}));var a=T(t);x(a,()=>e.children??X),k(t),u(i,t)};Y(C,i=>{e.child?i(p):i(A,!1)})}u(v,g),ee()}var it=q("<div><div><!></div></div>"),dt=q("<div><div><!></div></div>");function ut(v,e){const c=oe();$(e,!0);let y=r(e,"id",19,()=>se(c)),m=r(e,"ref",15,null),f=r(e,"loop",3,!0),F=r(e,"onInteractOutside",3,D),P=r(e,"forceMount",3,!1),g=r(e,"onEscapeKeydown",3,D),C=r(e,"interactOutsideBehavior",3,"defer-otherwise-close"),p=r(e,"escapeKeydownBehavior",3,"defer-otherwise-close"),A=r(e,"onOpenAutoFocus",3,D),i=r(e,"onCloseAutoFocus",3,D),t=r(e,"onFocusOutside",3,D),a=r(e,"side",3,"right"),n=r(e,"trapFocus",3,!1),d=ae(e,["$$slots","$$events","$$legacy","id","ref","children","child","loop","onInteractOutside","forceMount","onEscapeKeydown","interactOutsideBehavior","escapeKeydownBehavior","onOpenAutoFocus","onCloseAutoFocus","onFocusOutside","side","trapFocus","style"]);const o=Ie.create({id:h(()=>y()),loop:h(()=>f()),ref:h(()=>m(),s=>m(s)),isSub:!0,onCloseAutoFocus:h(()=>J)});function M(s){const S=s.currentTarget.contains(s.target),_=ze[o.parentMenu.root.opts.dir.current].includes(s.key);S&&_&&(o.parentMenu.onClose(),o.parentMenu.triggerNode?.focus(),s.preventDefault())}const z=I(()=>o.parentMenu.root.getBitsAttr("sub-content")),b=I(()=>Q(d,o.props,{side:a(),onkeydown:M,[l(z)]:""}));function G(s){A()(s),!s.defaultPrevented&&(s.preventDefault(),o.parentMenu.root.isUsingKeyboard&&o.parentMenu.contentNode&&Ue.dispatch(o.parentMenu.contentNode))}function J(s){i()(s),!s.defaultPrevented&&s.preventDefault()}function V(s){F()(s),!s.defaultPrevented&&o.parentMenu.onClose()}function te(s){g()(s),!s.defaultPrevented&&o.parentMenu.onClose()}function B(s){t()(s),!s.defaultPrevented&&Ne(s.target)&&s.target.id!==o.parentMenu.triggerNode?.id&&o.parentMenu.onClose()}var R=K(),Z=O(R);{var L=s=>{xe(s,pe(()=>l(b),{get ref(){return o.opts.ref},get interactOutsideBehavior(){return C()},get escapeKeydownBehavior(){return p()},onOpenAutoFocus:G,get enabled(){return o.parentMenu.opts.open.current},onInteractOutside:V,onEscapeKeydown:te,onFocusOutside:B,preventScroll:!1,get loop(){return f()},get trapFocus(){return n()},get shouldRender(){return o.shouldRender},popper:(_,w)=>{let j=()=>w?.().props,le=()=>w?.().wrapperProps;const ie=I(()=>Q(j(),l(b),{style:ge("menu")},{style:e.style}));var de=K(),_e=O(de);{var he=N=>{var E=K(),W=O(E);{let ne=I(()=>({props:l(ie),wrapperProps:le(),...o.snippetProps}));x(W,()=>e.child,()=>l(ne))}u(N,E)},me=N=>{var E=it();U(E,()=>({...le()}));var W=T(E);U(W,()=>({...l(ie)}));var ne=T(W);x(ne,()=>e.children??X),k(W),k(E),u(N,E)};Y(_e,N=>{e.child?N(he):N(me,!1)})}u(_,de)},$$slots:{popper:!0}}))},H=s=>{Ee(s,pe(()=>l(b),{get ref(){return o.opts.ref},get interactOutsideBehavior(){return C()},get escapeKeydownBehavior(){return p()},onCloseAutoFocus:J,onOpenAutoFocus:G,get open(){return o.parentMenu.opts.open.current},onInteractOutside:V,onEscapeKeydown:te,onFocusOutside:B,preventScroll:!1,get loop(){return f()},get trapFocus(){return n()},get shouldRender(){return o.shouldRender},popper:(_,w)=>{let j=()=>w?.().props,le=()=>w?.().wrapperProps;const ie=I(()=>Q(j(),l(b),{style:ge("menu")},{style:e.style}));var de=K(),_e=O(de);{var he=N=>{var E=K(),W=O(E);{let ne=I(()=>({props:l(ie),wrapperProps:le(),...o.snippetProps}));x(W,()=>e.child,()=>l(ne))}u(N,E)},me=N=>{var E=dt();U(E,()=>({...le()}));var W=T(E);U(W,()=>({...l(ie)}));var ne=T(W);x(ne,()=>e.children??X),k(W),k(E),u(N,E)};Y(_e,N=>{e.child?N(he):N(me,!1)})}u(_,de)},$$slots:{popper:!0}}))};Y(Z,s=>{P()?s(L):P()||s(H,1)})}u(v,R),ee()}var ct=q("<div><!></div>");function ft(v,e){const c=oe();$(e,!0);let y=r(e,"id",19,()=>se(c)),m=r(e,"disabled",3,!1),f=r(e,"ref",15,null),F=r(e,"onSelect",3,D),P=r(e,"openDelay",3,100),g=ae(e,["$$slots","$$events","$$legacy","id","disabled","ref","children","child","onSelect","openDelay"]);const C=Ve.create({disabled:h(()=>m()),onSelect:h(()=>F()),id:h(()=>y()),ref:h(()=>f(),A=>f(A)),openDelay:h(()=>P())}),p=I(()=>Q(g,C.props));Be(v,{get id(){return y()},get ref(){return C.opts.ref},children:(A,i)=>{var t=K(),a=O(t);{var n=o=>{var M=K(),z=O(M);x(z,()=>e.child,()=>({props:l(p)})),u(o,M)},d=o=>{var M=ct();U(M,()=>({...l(p)}));var z=T(M);x(z,()=>e.children??X),k(M),u(o,M)};Y(a,o=>{e.child?o(n):o(d,!1)})}u(A,t)},$$slots:{default:!0}}),ee()}function vt(v,e){$(e,!0);let c=r(e,"open",15,!1),y=r(e,"dir",3,"ltr"),m=r(e,"onOpenChange",3,D),f=r(e,"onOpenChangeComplete",3,D),F=r(e,"_internal_variant",3,"dropdown-menu");const P=Ze.create({variant:h(()=>F()),dir:h(()=>y()),onClose:()=>{c(!1),m()(!1)}});je.create({open:h(()=>c(),g=>{c(g),m()(g)}),onOpenChangeComplete:h(()=>f())},P),Ke(v,{children:(g,C)=>{var p=K(),A=O(p);x(A,()=>e.children??X),u(g,p)},$$slots:{default:!0}}),ee()}var pt=q("<div><div><!></div></div>"),gt=q("<div><div><!></div></div>");function _t(v,e){const c=oe();$(e,!0);let y=r(e,"id",19,()=>se(c)),m=r(e,"ref",15,null),f=r(e,"loop",3,!0),F=r(e,"onInteractOutside",3,D),P=r(e,"onEscapeKeydown",3,D),g=r(e,"onCloseAutoFocus",3,D),C=r(e,"forceMount",3,!1),p=r(e,"trapFocus",3,!1),A=ae(e,["$$slots","$$events","$$legacy","id","child","children","ref","loop","onInteractOutside","onEscapeKeydown","onCloseAutoFocus","forceMount","trapFocus","style"]);const i=Ie.create({id:h(()=>y()),loop:h(()=>f()),ref:h(()=>m(),b=>m(b)),onCloseAutoFocus:h(()=>g())}),t=I(()=>Q(A,i.props));function a(b){if(i.handleInteractOutside(b),!b.defaultPrevented&&(F()(b),!b.defaultPrevented)){if(b.target&&b.target instanceof Element){const G=`[${i.parentMenu.root.getBitsAttr("sub-content")}]`;if(b.target.closest(G))return}i.parentMenu.onClose()}}function n(b){P()(b),!b.defaultPrevented&&i.parentMenu.onClose()}var d=K(),o=O(d);{var M=b=>{xe(b,pe(()=>l(t),()=>i.popperProps,{get ref(){return i.opts.ref},get enabled(){return i.parentMenu.opts.open.current},onInteractOutside:a,onEscapeKeydown:n,get trapFocus(){return p()},get loop(){return f()},forceMount:!0,get id(){return y()},get shouldRender(){return i.shouldRender},popper:(J,V)=>{let te=()=>V?.().props,B=()=>V?.().wrapperProps;const R=I(()=>Q(te(),{style:ge("dropdown-menu")},{style:e.style}));var Z=K(),L=O(Z);{var H=S=>{var _=K(),w=O(_);{let j=I(()=>({props:l(R),wrapperProps:B(),...i.snippetProps}));x(w,()=>e.child,()=>l(j))}u(S,_)},s=S=>{var _=pt();U(_,()=>({...B()}));var w=T(_);U(w,()=>({...l(R)}));var j=T(w);x(j,()=>e.children??X),k(w),k(_),u(S,_)};Y(L,S=>{e.child?S(H):S(s,!1)})}u(J,Z)},$$slots:{popper:!0}}))},z=b=>{Ee(b,pe(()=>l(t),()=>i.popperProps,{get ref(){return i.opts.ref},get open(){return i.parentMenu.opts.open.current},onInteractOutside:a,onEscapeKeydown:n,get trapFocus(){return p()},get loop(){return f()},forceMount:!1,get id(){return y()},get shouldRender(){return i.shouldRender},popper:(J,V)=>{let te=()=>V?.().props,B=()=>V?.().wrapperProps;const R=I(()=>Q(te(),{style:ge("dropdown-menu")},{style:e.style}));var Z=K(),L=O(Z);{var H=S=>{var _=K(),w=O(_);{let j=I(()=>({props:l(R),wrapperProps:B(),...i.snippetProps}));x(w,()=>e.child,()=>l(j))}u(S,_)},s=S=>{var _=gt();U(_,()=>({...B()}));var w=T(_);U(w,()=>({...l(R)}));var j=T(w);x(j,()=>e.children??X),k(w),k(_),u(S,_)};Y(L,S=>{e.child?S(H):S(s,!1)})}u(J,Z)},$$slots:{popper:!0}}))};Y(o,b=>{C()?b(M):C()||b(z,1)})}u(v,d),ee()}var ht=q("<button><!></button>");function mt(v,e){const c=oe();$(e,!0);let y=r(e,"id",19,()=>se(c)),m=r(e,"ref",15,null),f=r(e,"disabled",3,!1),F=r(e,"type",3,"button"),P=ae(e,["$$slots","$$events","$$legacy","id","ref","child","children","disabled","type"]);const g=We.create({id:h(()=>y()),disabled:h(()=>f()??!1),ref:h(()=>m(),p=>m(p))}),C=I(()=>Q(P,g.props,{type:F()}));Be(v,{get id(){return y()},get ref(){return g.opts.ref},children:(p,A)=>{var i=K(),t=O(i);{var a=d=>{var o=K(),M=O(o);x(M,()=>e.child,()=>({props:l(C)})),u(d,o)},n=d=>{var o=ht();U(o,()=>({...l(C)}));var M=T(o);x(M,()=>e.children??X),k(o),u(d,o)};Y(t,d=>{e.child?d(a):d(n,!1)})}u(p,i)},$$slots:{default:!0}}),ee()}const Dt=vt,Tt=mt,kt=Ye,Lt=_t,Ht=at,Nt=lt,Ut=nt,zt=ft,Vt=ut;function yt(){let v=Re(De({})),e=null,c=null;function y(t,a,n){c&&(clearInterval(c),c=null),e=`${t}/${a}/${n}`,f("enter",t,a,n),c=setInterval(()=>{e&&f("heartbeat",t,a,n)},3e4)}function m(){if(c&&(clearInterval(c),c=null),e){const[t,a,n]=e.split("/");t&&a&&n&&f("leave",t,a,n),e=null}}function f(t,a,n,d){Me.send({type:"presence",action:t,repo:a,entityType:n,entityId:d})}function F(t){const a=`${t.repo}/${t.entityType}/${t.entityId}`,n=l(v)[a]??[];if(t.action==="leave")l(v)[a]=n.filter(d=>d.id!==t.user.id);else{const d=n.findIndex(o=>o.id===t.user.id);d>=0?(n[d]=t.user,l(v)[a]=[...n]):l(v)[a]=[...n,t.user]}}function P(){if(be(v,{},!0),!e)return;const[t,a,n]=e.split("/");t&&a&&n&&f("enter",t,a,n)}function g(t,a,n,d){const o=`${t}/${a}/${n}`,M=l(v)[o]??[];return d?M.filter(z=>z.id!==d):M}function C(t,a){const n=new Map;for(const[d,o]of Object.entries(l(v)))if(d.startsWith(t))for(const M of o)(!a||M.id!==a)&&n.set(M.id,M);return[...n.values()]}function p(t,a){return C(`${t}/`,a)}function A(t){const a=new Map;for(const n of Object.values(l(v)))for(const d of n)(!t||d.id!==t)&&a.set(d.id,d);return[...a.values()]}const i=I(()=>{const t=new Map;for(const a of Object.values(l(v)))for(const n of a)t.set(n.id,n);return[...t.values()]});return{enter:y,leave:m,handlePresenceEvent:F,resetAndResend:P,getPresence:g,getPresenceByPrefix:C,getRepoPresence:p,getAllUsers:A,get allUsers(){return l(i)}}}const Oe=yt();Me.setPresenceHandler(v=>Oe.handlePresenceEvent(v));Me.addConnectHandler(()=>Oe.resetAndResend());typeof window<"u"&&window.addEventListener("beforeunload",()=>Oe.leave());var Pt=Ae("<title> </title>"),bt=Ae('<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 Zt(v,e){const c=Se(e,["children","$$slots","$$events","$$legacy"]),y=Se(c,["size","title"]);$(e,!1);const m=Ce(),f=Ce();let F=r(e,"size",8,16),P=r(e,"title",8,void 0);we(()=>(ye(c),ye(P())),()=>{be(m,c["aria-label"]||c["aria-labelledby"]||P())}),we(()=>(l(m),ye(c)),()=>{be(f,{"aria-hidden":l(m)?void 0:!0,role:l(m)?"img":void 0,focusable:Number(c.tabindex)===0?!0:void 0})}),Te(),rt();var g=bt();U(g,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:F(),height:F(),...l(f),...y}));var C=T(g);{var p=A=>{var i=Pt(),t=T(i,!0);k(i),fe(()=>ue(t,P())),u(A,i)};Y(C,A=>{P()&&A(p)})}ce(2),k(g),u(v,g),ee()}var Mt=q("<!> <!>",1),Ot=q("<!> <!>",1),wt=q("<!> <!>",1);function jt(v,e){$(e,!0);let c=r(e,"open",15),y=r(e,"confirmLabel",3,"Confirm"),m=r(e,"cancelLabel",3,"Cancel"),f=r(e,"destructive",3,!1);var F=K(),P=O(F);re(P,()=>tt,(g,C)=>{C(g,{onOpenChange:p=>{p||e.oncancel()},get open(){return c()},set open(p){c(p)},children:(p,A)=>{var i=K(),t=O(i);re(t,()=>qe,(a,n)=>{n(a,{children:(d,o)=>{var M=wt(),z=O(M);re(z,()=>Ge,(G,J)=>{J(G,{children:(V,te)=>{var B=Mt(),R=O(B);re(R,()=>Je,(L,H)=>{H(L,{children:(s,S)=>{ce();var _=ve();fe(()=>ue(_,e.title)),u(s,_)},$$slots:{default:!0}})});var Z=Pe(R,2);re(Z,()=>Qe,(L,H)=>{H(L,{children:(s,S)=>{ce();var _=ve();fe(()=>ue(_,e.message)),u(s,_)},$$slots:{default:!0}})}),u(V,B)},$$slots:{default:!0}})});var b=Pe(z,2);re(b,()=>Xe,(G,J)=>{J(G,{children:(V,te)=>{var B=Ot(),R=O(B);{let L=I(()=>Fe({variant:"ghost"}));re(R,()=>$e,(H,s)=>{s(H,{get class(){return l(L)},get onclick(){return e.oncancel},children:(S,_)=>{ce();var w=ve();fe(()=>ue(w,m())),u(S,w)},$$slots:{default:!0}})})}var Z=Pe(R,2);{let L=I(()=>Fe({variant:f()?"destructive":"accent"}));re(Z,()=>et,(H,s)=>{s(H,{get class(){return l(L)},get onclick(){return e.onconfirm},children:(S,_)=>{ce();var w=ve();fe(()=>ue(w,y())),u(S,w)},$$slots:{default:!0}})})}u(V,B)},$$slots:{default:!0}})}),u(d,M)},$$slots:{default:!0}})}),u(p,i)},$$slots:{default:!0}})}),u(v,F),ee()}export{Lt as C,Ht as I,kt as P,Dt as R,Nt as S,Tt as T,Zt as a,jt as b,Ut as c,zt as d,Vt as e,Oe as p};
@@ -1 +1 @@
1
- import{a5 as d,a6 as g,a2 as c,a7 as b,a8 as m,a9 as i,g as p,d as v,aa as h,ab as k}from"./sZJoCX5N.js";function x(t=!1){const a=d,e=a.l.u;if(!e)return;let f=()=>v(a.s);if(t){let n=0,s={};const _=h(()=>{let l=!1;const r=a.s;for(const o in r)r[o]!==s[o]&&(s[o]=r[o],l=!0);return l&&n++,n});f=()=>p(_)}e.b.length&&g(()=>{u(a,f),i(e.b)}),c(()=>{const n=b(()=>e.m.map(m));return()=>{for(const s of n)typeof s=="function"&&s()}}),e.a.length&&c(()=>{u(a,f),i(e.a)})}function u(t,a){if(t.l.s)for(const e of t.l.s)p(e);a()}k();export{x as i};
1
+ import{a5 as d,a6 as g,a2 as c,a7 as b,a8 as m,a9 as i,g as p,d as v,aa as h,ab as k}from"./BenpwI6m.js";function x(t=!1){const a=d,e=a.l.u;if(!e)return;let f=()=>v(a.s);if(t){let n=0,s={};const _=h(()=>{let l=!1;const r=a.s;for(const o in r)r[o]!==s[o]&&(s[o]=r[o],l=!0);return l&&n++,n});f=()=>p(_)}e.b.length&&g(()=>{u(a,f),i(e.b)}),c(()=>{const n=b(()=>e.m.map(m));return()=>{for(const s of n)typeof s=="function"&&s()}}),e.a.length&&c(()=>{u(a,f),i(e.a)})}function u(t,a){if(t.l.s)for(const e of t.l.s)p(e);a()}k();export{x as i};
@@ -1 +1 @@
1
- import{a as n,b as c}from"./BdF6nRVd.js";import{b as d,c as p}from"./9rXsO0Bz.js";import{p as u,b as f}from"./sZJoCX5N.js";import{a as m}from"./BKUmpdNY.js";import{b}from"./BSSN_IAc.js";import{p as a,r as v}from"./DNrFMx27.js";var x=c("<input/>");function P(l,r){u(r,!0);let e=a(r,"ref",15,null),s=a(r,"value",15),i=v(r,["$$slots","$$events","$$legacy","class","ref","value"]);var o=x();m(o,t=>({class:t,...i}),[()=>p("h-8 w-full rounded-md border border-[var(--color-border)] bg-[var(--color-bg)] px-2.5 text-[14px] text-[var(--color-text-primary)] font-[inherit] outline-none transition-colors placeholder:text-[var(--color-text-tertiary)] focus:border-[var(--color-accent,#e05050)] disabled:cursor-not-allowed disabled:opacity-50",r.class)],void 0,void 0,void 0,!0),b(o,t=>e(t),()=>e()),d(o,s),n(l,o),f()}export{P as I};
1
+ import{a as n,b as c}from"./COik51fd.js";import{b as d,c as p}from"./DAD7hf2c.js";import{p as u,b as f}from"./BenpwI6m.js";import{a as m}from"./CStpN6HQ.js";import{b}from"./Dvv4bkXH.js";import{p as a,r as v}from"./wWaI7EIw.js";var x=c("<input/>");function P(l,r){u(r,!0);let e=a(r,"ref",15,null),s=a(r,"value",15),i=v(r,["$$slots","$$events","$$legacy","class","ref","value"]);var o=x();m(o,t=>({class:t,...i}),[()=>p("h-8 w-full rounded-md border border-[var(--color-border)] bg-[var(--color-bg)] px-2.5 text-[14px] text-[var(--color-text-primary)] font-[inherit] outline-none transition-colors placeholder:text-[var(--color-text-tertiary)] focus:border-[var(--color-accent,#e05050)] disabled:cursor-not-allowed disabled:opacity-50",r.class)],void 0,void 0,void 0,!0),b(o,t=>e(t),()=>e()),d(o,s),n(l,o),f()}export{P as I};
@@ -1 +1 @@
1
- var Kt=Array.isArray,Xt=Array.prototype.indexOf,oe=Array.prototype.includes,zn=Array.from,Gn=Object.defineProperty,we=Object.getOwnPropertyDescriptor,Zt=Object.getOwnPropertyDescriptors,Wt=Object.prototype,Jt=Array.prototype,_t=Object.getPrototypeOf,rt=Object.isExtensible;function $n(e){return typeof e=="function"}const ye=()=>{};function Kn(e){return e()}function Qt(e){for(var t=0;t<e.length;t++)e[t]()}function vt(){var e,t,n=new Promise((r,s)=>{e=r,t=s});return{promise:n,resolve:e,reject:t}}function Xn(e,t){if(Array.isArray(e))return e;if(!(Symbol.iterator in e))return Array.from(e);const n=[];for(const r of e)if(n.push(r),n.length===t)break;return n}const g=2,ie=4,ue=8,Be=1<<24,K=16,L=32,X=64,en=128,k=512,y=1024,T=2048,P=4096,F=8192,V=16384,de=32768,Se=65536,st=1<<17,tn=1<<18,he=1<<19,dt=1<<20,Zn=1<<25,re=65536,Le=1<<21,Ue=1<<22,B=1<<23,te=Symbol("$state"),Wn=Symbol("legacy props"),Jn=Symbol(""),W=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"},er=!!globalThis.document?.contentType&&globalThis.document.contentType.includes("xml"),tr=1,Ce=3,ht=8;function ze(e){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function nn(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function nr(e,t,n){throw new Error("https://svelte.dev/e/each_key_duplicate")}function rn(e){throw new Error("https://svelte.dev/e/effect_in_teardown")}function sn(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function fn(e){throw new Error("https://svelte.dev/e/effect_orphan")}function an(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function rr(){throw new Error("https://svelte.dev/e/hydration_failed")}function sr(e){throw new Error("https://svelte.dev/e/props_invalid_value")}function ln(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function on(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function un(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function fr(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}const ir=1,ar=2,lr=4,or=8,ur=16,cr=1,_r=2,vr=4,dr=8,hr=16,pr=1,br=2,cn="[",_n="[!",wr="[?",vn="]",Ge={},E=Symbol(),dn="http://www.w3.org/1999/xhtml",yr="http://www.w3.org/2000/svg",Er="http://www.w3.org/1998/Math/MathML",gr="@attach";function $e(e){console.warn("https://svelte.dev/e/hydration_mismatch")}function mr(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function Tr(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}let z=!1;function Ar(e){z=e}let S;function ce(e){if(e===null)throw $e(),Ge;return S=e}function xr(){return ce(Z(S))}function Sr(e){if(z){if(Z(S)!==null)throw $e(),Ge;S=e}}function Rr(e=1){if(z){for(var t=e,n=S;t--;)n=Z(n);S=n}}function Nr(e=!0){for(var t=0,n=S;;){if(n.nodeType===ht){var r=n.data;if(r===vn){if(t===0)return n;t-=1}else(r===cn||r===_n||r[0]==="["&&!isNaN(Number(r.slice(1))))&&(t+=1)}var s=Z(n);e&&n.remove(),n=s}}function Or(e){if(!e||e.nodeType!==ht)throw $e(),Ge;return e.data}function pt(e){return e===this.v}function bt(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function wt(e){return!bt(e,this.v)}let me=!1;function kr(){me=!0}let h=null;function Re(e){h=e}function Cr(e){return De().get(e)}function Dr(e,t){return De().set(e,t),t}function Ir(e){return De().has(e)}function Mr(){return De()}function Pr(e,t=!1,n){h={p:h,i:!1,c:null,e:null,s:e,x:null,l:me&&!t?{s:null,u:null,$:[]}:null}}function Fr(e){var t=h,n=t.e;if(n!==null){t.e=null;for(var r of n)Pt(r)}return e!==void 0&&(t.x=e),t.i=!0,h=t.p,e??{}}function Te(){return!me||h!==null&&h.l===null}function De(e){return h===null&&ze(),h.c??=new Map(hn(h)||void 0)}function hn(e){let t=e.p;for(;t!==null;){const n=t.c;if(n!==null)return n;t=t.p}return null}let J=[];function yt(){var e=J;J=[],Qt(e)}function je(e){if(J.length===0&&!Ee){var t=J;queueMicrotask(()=>{t===J&&yt()})}J.push(e)}function pn(){for(;J.length>0;)yt()}function bn(e){var t=d;if(t===null)return v.f|=B,e;if((t.f&de)===0&&(t.f&ie)===0)throw e;Ne(e,t)}function Ne(e,t){for(;t!==null;){if((t.f&en)!==0){if((t.f&de)===0)throw e;try{t.b.error(e);return}catch(n){e=n}}t=t.parent}throw e}const wn=-7169;function w(e,t){e.f=e.f&wn|t}function Ke(e){(e.f&k)!==0||e.deps===null?w(e,y):w(e,P)}function Et(e){if(e!==null)for(const t of e)(t.f&g)===0||(t.f&re)===0||(t.f^=re,Et(t.deps))}function yn(e,t,n){(e.f&T)!==0?t.add(e):(e.f&P)!==0&&n.add(e),Et(e.deps),w(e,y)}const Ae=new Set;let b=null,ft=null,I=null,A=[],Ie=null,Ee=!1,_e=null;class ae{current=new Map;previous=new Map;#t=new Set;#s=new Set;#r=0;#f=0;#i=null;#a=new Set;#n=new Set;#e=new Map;is_fork=!1;#l=!1;#o(){return this.is_fork||this.#f>0}skip_effect(t){this.#e.has(t)||this.#e.set(t,{d:[],m:[]})}unskip_effect(t){var n=this.#e.get(t);if(n){this.#e.delete(t);for(var r of n.d)w(r,T),Y(r);for(r of n.m)w(r,P),Y(r)}}process(t){A=[],this.apply();var n=_e=[],r=[];for(const s of t)this.#u(s,n,r);if(_e=null,this.#o()){this.#c(r),this.#c(n);for(const[s,f]of this.#e)At(s,f)}else{ft=this,b=null;for(const s of this.#t)s(this);this.#t.clear(),this.#r===0&&this.#_(),it(r),it(n),this.#a.clear(),this.#n.clear(),ft=null,this.#i?.resolve()}I=null}#u(t,n,r){t.f^=y;for(var s=t.first;s!==null;){var f=s.f,o=(f&(L|X))!==0,l=o&&(f&y)!==0,i=l||(f&F)!==0||this.#e.has(s);if(!i&&s.fn!==null){o?s.f^=y:(f&ie)!==0?n.push(s):pe(s)&&((f&K)!==0&&this.#n.add(s),fe(s));var a=s.first;if(a!==null){s=a;continue}}for(;s!==null;){var u=s.next;if(u!==null){s=u;break}s=s.parent}}}#c(t){for(var n=0;n<t.length;n+=1)yn(t[n],this.#a,this.#n)}capture(t,n){n!==E&&!this.previous.has(t)&&this.previous.set(t,n),(t.f&B)===0&&(this.current.set(t,t.v),I?.set(t,t.v))}activate(){b=this,this.apply()}deactivate(){b===this&&(b=null,I=null)}flush(){if(A.length>0)b=this,gt();else if(this.#r===0&&!this.is_fork){for(const t of this.#t)t(this);this.#t.clear(),this.#_(),this.#i?.resolve()}this.deactivate()}discard(){for(const t of this.#s)t(this);this.#s.clear()}#_(){if(Ae.size>1){this.previous.clear();var t=b,n=I,r=!0;for(const f of Ae){if(f===this){r=!1;continue}const o=[];for(const[i,a]of this.current){if(f.current.has(i))if(r&&a!==f.current.get(i))f.current.set(i,a);else continue;o.push(i)}if(o.length===0)continue;const l=[...f.current.keys()].filter(i=>!this.current.has(i));if(l.length>0){var s=A;A=[];const i=new Set,a=new Map;for(const u of o)mt(u,l,i,a);if(A.length>0){b=f,f.apply();for(const u of A)f.#u(u,[],[]);f.deactivate()}A=s}}b=t,I=n}this.#e.clear(),Ae.delete(this)}increment(t){this.#r+=1,t&&(this.#f+=1)}decrement(t){this.#r-=1,t&&(this.#f-=1),!this.#l&&(this.#l=!0,je(()=>{this.#l=!1,this.#o()?A.length>0&&this.flush():this.revive()}))}revive(){for(const t of this.#a)this.#n.delete(t),w(t,T),Y(t);for(const t of this.#n)w(t,P),Y(t);this.flush()}oncommit(t){this.#t.add(t)}ondiscard(t){this.#s.add(t)}settled(){return(this.#i??=vt()).promise}static ensure(){if(b===null){const t=b=new ae;Ae.add(b),Ee||je(()=>{b===t&&t.flush()})}return b}apply(){}}function En(e){var t=Ee;Ee=!0;try{for(var n;;){if(pn(),A.length===0&&(b?.flush(),A.length===0))return Ie=null,n;gt()}}finally{Ee=t}}function gt(){var e=null;try{for(var t=0;A.length>0;){var n=ae.ensure();if(t++>1e3){var r,s;gn()}n.process(A),U.clear()}}finally{A=[],Ie=null,_e=null}}function gn(){try{an()}catch(e){Ne(e,Ie)}}let j=null;function it(e){var t=e.length;if(t!==0){for(var n=0;n<t;){var r=e[n++];if((r.f&(V|F))===0&&pe(r)&&(j=new Set,fe(r),r.deps===null&&r.first===null&&r.nodes===null&&r.teardown===null&&r.ac===null&&jt(r),j?.size>0)){U.clear();for(const s of j){if((s.f&(V|F))!==0)continue;const f=[s];let o=s.parent;for(;o!==null;)j.has(o)&&(j.delete(o),f.push(o)),o=o.parent;for(let l=f.length-1;l>=0;l--){const i=f[l];(i.f&(V|F))===0&&fe(i)}}j.clear()}}j=null}}function mt(e,t,n,r){if(!n.has(e)&&(n.add(e),e.reactions!==null))for(const s of e.reactions){const f=s.f;(f&g)!==0?mt(s,t,n,r):(f&(Ue|K))!==0&&(f&T)===0&&Tt(s,t,r)&&(w(s,T),Y(s))}}function Tt(e,t,n){const r=n.get(e);if(r!==void 0)return r;if(e.deps!==null)for(const s of e.deps){if(oe.call(t,s))return!0;if((s.f&g)!==0&&Tt(s,t,n))return n.set(s,!0),!0}return n.set(e,!1),!1}function Y(e){var t=Ie=e,n=t.b;if(n?.is_pending&&(e.f&(ie|ue|Be))!==0&&(e.f&de)===0){n.defer_effect(e);return}for(;t.parent!==null;){t=t.parent;var r=t.f;if(_e!==null&&t===d&&(e.f&ue)===0)return;if((r&(X|L))!==0){if((r&y)===0)return;t.f^=y}}A.push(t)}function At(e,t){if(!((e.f&L)!==0&&(e.f&y)!==0)){(e.f&T)!==0?t.d.push(e):(e.f&P)!==0&&t.m.push(e),w(e,y);for(var n=e.first;n!==null;)At(n,t),n=n.next}}function xt(e,t,n,r){const s=Te()?Xe:An;var f=e.filter(c=>!c.settled);if(n.length===0&&f.length===0){r(t.map(s));return}var o=d,l=mn(),i=f.length===1?f[0].promise:f.length>1?Promise.all(f.map(c=>c.promise)):null;function a(c){l();try{r(c)}catch(_){(o.f&V)===0&&Ne(_,o)}Ye()}if(n.length===0){i.then(()=>a(t.map(s)));return}function u(){l(),Promise.all(n.map(c=>Tn(c))).then(c=>a([...t.map(s),...c])).catch(c=>Ne(c,o))}i?i.then(u):u()}function mn(){var e=d,t=v,n=h,r=b;return function(f=!0){ve(e),$(t),Re(n),f&&r?.activate()}}function Ye(e=!0){ve(null),$(null),Re(null),e&&b?.deactivate()}function St(){var e=d.b,t=b,n=e.is_rendered();return e.update_pending_count(1),t.increment(n),()=>{e.update_pending_count(-1),t.decrement(n)}}function Xe(e){var t=g|T,n=v!==null&&(v.f&g)!==0?v:null;return d!==null&&(d.f|=he),{ctx:h,deps:null,effects:null,equals:pt,f:t,fn:e,reactions:null,rv:0,v:E,wv:0,parent:n??d,ac:null}}function Tn(e,t,n){d===null&&nn();var s=void 0,f=We(E),o=!v,l=new Map;return Fn(()=>{var i=vt();s=i.promise;try{Promise.resolve(e()).then(i.resolve,i.reject).finally(Ye)}catch(_){i.reject(_),Ye()}var a=b;if(o){var u=St();l.get(a)?.reject(W),l.delete(a),l.set(a,i)}const c=(_,m=void 0)=>{if(a.activate(),m)m!==W&&(f.f|=B,He(f,m));else{(f.f&B)!==0&&(f.f^=B),He(f,_);for(const[p,D]of l){if(l.delete(p),p===a)break;D.reject(W)}}u&&u()};i.promise.then(c,_=>c(null,_||"unknown"))}),Mn(()=>{for(const i of l.values())i.reject(W)}),new Promise(i=>{function a(u){function c(){u===s?i(f):a(s)}u.then(c,c)}a(s)})}function Lr(e){const t=Xe(e);return Ht(t),t}function An(e){const t=Xe(e);return t.equals=wt,t}function xn(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n<t.length;n+=1)G(t[n])}}function Sn(e){for(var t=e.parent;t!==null;){if((t.f&g)===0)return(t.f&V)===0?t:null;t=t.parent}return null}function Ze(e){var t,n=d;ve(Sn(e));try{e.f&=~re,xn(e),t=zt(e)}finally{ve(n)}return t}function Rt(e){var t=Ze(e);if(!e.equals(t)&&(e.wv=Bt(),(!b?.is_fork||e.deps===null)&&(e.v=t,e.deps===null))){w(e,y);return}se||(I!==null?(Mt()||b?.is_fork)&&I.set(e,t):Ke(e))}function Rn(e){if(e.effects!==null)for(const t of e.effects)(t.teardown||t.ac)&&(t.teardown?.(),t.ac?.abort(W),t.teardown=ye,t.ac=null,ge(t,0),et(t))}function Nt(e){if(e.effects!==null)for(const t of e.effects)t.teardown&&fe(t)}let qe=new Set;const U=new Map;let Ot=!1;function We(e,t){var n={f:0,v:e,reactions:null,equals:pt,rv:0,wv:0};return n}function q(e,t){const n=We(e);return Ht(n),n}function jr(e,t=!1,n=!0){const r=We(e);return t||(r.equals=wt),me&&n&&h!==null&&h.l!==null&&(h.l.s??=[]).push(r),r}function H(e,t,n=!1){v!==null&&(!M||(v.f&st)!==0)&&Te()&&(v.f&(g|K|Ue|st))!==0&&(C===null||!oe.call(C,e))&&un();let r=n?be(t):t;return He(e,r)}function He(e,t){if(!e.equals(t)){var n=e.v;se?U.set(e,t):U.set(e,n),e.v=t;var r=ae.ensure();if(r.capture(e,n),(e.f&g)!==0){const s=e;(e.f&T)!==0&&Ze(s),Ke(s)}e.wv=Bt(),kt(e,T),Te()&&d!==null&&(d.f&y)!==0&&(d.f&(L|X))===0&&(O===null?qn([e]):O.push(e)),!r.is_fork&&qe.size>0&&!Ot&&Nn()}return t}function Nn(){Ot=!1;for(const e of qe)(e.f&y)!==0&&w(e,P),pe(e)&&fe(e);qe.clear()}function Yr(e,t=1){var n=ee(e),r=t===1?n++:n--;return H(e,n),r}function Fe(e){H(e,e.v+1)}function kt(e,t){var n=e.reactions;if(n!==null)for(var r=Te(),s=n.length,f=0;f<s;f++){var o=n[f],l=o.f;if(!(!r&&o===d)){var i=(l&T)===0;if(i&&w(o,t),(l&g)!==0){var a=o;I?.delete(a),(l&re)===0&&(l&k&&(o.f|=re),kt(a,P))}else i&&((l&K)!==0&&j!==null&&j.add(o),Y(o))}}}function be(e){if(typeof e!="object"||e===null||te in e)return e;const t=_t(e);if(t!==Wt&&t!==Jt)return e;var n=new Map,r=Kt(e),s=q(0),f=ne,o=l=>{if(ne===f)return l();var i=v,a=ne;$(null),ct(f);var u=l();return $(i),ct(a),u};return r&&n.set("length",q(e.length)),new Proxy(e,{defineProperty(l,i,a){(!("value"in a)||a.configurable===!1||a.enumerable===!1||a.writable===!1)&&ln();var u=n.get(i);return u===void 0?o(()=>{var c=q(a.value);return n.set(i,c),c}):H(u,a.value,!0),!0},deleteProperty(l,i){var a=n.get(i);if(a===void 0){if(i in l){const u=o(()=>q(E));n.set(i,u),Fe(s)}}else H(a,E),Fe(s);return!0},get(l,i,a){if(i===te)return e;var u=n.get(i),c=i in l;if(u===void 0&&(!c||we(l,i)?.writable)&&(u=o(()=>{var m=be(c?l[i]:E),p=q(m);return p}),n.set(i,u)),u!==void 0){var _=ee(u);return _===E?void 0:_}return Reflect.get(l,i,a)},getOwnPropertyDescriptor(l,i){var a=Reflect.getOwnPropertyDescriptor(l,i);if(a&&"value"in a){var u=n.get(i);u&&(a.value=ee(u))}else if(a===void 0){var c=n.get(i),_=c?.v;if(c!==void 0&&_!==E)return{enumerable:!0,configurable:!0,value:_,writable:!0}}return a},has(l,i){if(i===te)return!0;var a=n.get(i),u=a!==void 0&&a.v!==E||Reflect.has(l,i);if(a!==void 0||d!==null&&(!u||we(l,i)?.writable)){a===void 0&&(a=o(()=>{var _=u?be(l[i]):E,m=q(_);return m}),n.set(i,a));var c=ee(a);if(c===E)return!1}return u},set(l,i,a,u){var c=n.get(i),_=i in l;if(r&&i==="length")for(var m=a;m<c.v;m+=1){var p=n.get(m+"");p!==void 0?H(p,E):m in l&&(p=o(()=>q(E)),n.set(m+"",p))}if(c===void 0)(!_||we(l,i)?.writable)&&(c=o(()=>q(void 0)),H(c,be(a)),n.set(i,c));else{_=c.v!==E;var D=o(()=>be(a));H(c,D)}var tt=Reflect.getOwnPropertyDescriptor(l,i);if(tt?.set&&tt.set.call(u,a),!_){if(r&&typeof i=="string"){var nt=n.get("length"),Pe=Number(i);Number.isInteger(Pe)&&Pe>=nt.v&&H(nt,Pe+1)}Fe(s)}return!0},ownKeys(l){ee(s);var i=Reflect.ownKeys(l).filter(c=>{var _=n.get(c);return _===void 0||_.v!==E});for(var[a,u]of n)u.v!==E&&!(a in l)&&i.push(a);return i},setPrototypeOf(){on()}})}function at(e){try{if(e!==null&&typeof e=="object"&&te in e)return e[te]}catch{}return e}function qr(e,t){return Object.is(at(e),at(t))}var lt,On,kn,Ct,Dt;function Hr(){if(lt===void 0){lt=window,On=document,kn=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;Ct=we(t,"firstChild").get,Dt=we(t,"nextSibling").get,rt(e)&&(e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0),rt(n)&&(n.__t=void 0)}}function Oe(e=""){return document.createTextNode(e)}function ke(e){return Ct.call(e)}function Z(e){return Dt.call(e)}function Vr(e,t){if(!z)return ke(e);var n=ke(S);if(n===null)n=S.appendChild(Oe());else if(t&&n.nodeType!==Ce){var r=Oe();return n?.before(r),ce(r),r}return t&&Je(n),ce(n),n}function Br(e,t=!1){if(!z){var n=ke(e);return n instanceof Comment&&n.data===""?Z(n):n}if(t){if(S?.nodeType!==Ce){var r=Oe();return S?.before(r),ce(r),r}Je(S)}return S}function Ur(e,t=1,n=!1){let r=z?S:e;for(var s;t--;)s=r,r=Z(r);if(!z)return r;if(n){if(r?.nodeType!==Ce){var f=Oe();return r===null?s?.after(f):r.before(f),ce(f),f}Je(r)}return ce(r),r}function Cn(e){e.textContent=""}function zr(){return!1}function Gr(e,t,n){return document.createElementNS(t??dn,e,void 0)}function Je(e){if(e.nodeValue.length<65536)return;let t=e.nextSibling;for(;t!==null&&t.nodeType===Ce;)t.remove(),e.nodeValue+=t.nodeValue,t=e.nextSibling}function $r(e,t){if(t){const n=document.body;e.autofocus=!0,je(()=>{document.activeElement===n&&e.focus()})}}function Kr(e){z&&ke(e)!==null&&Cn(e)}let ot=!1;function Dn(){ot||(ot=!0,document.addEventListener("reset",e=>{Promise.resolve().then(()=>{if(!e.defaultPrevented)for(const t of e.target.elements)t.__on_r?.()})},{capture:!0}))}function Qe(e){var t=v,n=d;$(null),ve(null);try{return e()}finally{$(t),ve(n)}}function Xr(e,t,n,r=n){e.addEventListener(t,()=>Qe(n));const s=e.__on_r;s?e.__on_r=()=>{s(),r(!0)}:e.__on_r=()=>r(!0),Dn()}function It(e){d===null&&(v===null&&fn(),sn()),se&&rn()}function In(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function N(e,t){var n=d;n!==null&&(n.f&F)!==0&&(e|=F);var r={ctx:h,deps:null,nodes:null,f:e|T|k,first:null,fn:t,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null},s=r;if((e&ie)!==0)_e!==null?_e.push(r):Y(r);else if(t!==null){try{fe(r)}catch(o){throw G(r),o}s.deps===null&&s.teardown===null&&s.nodes===null&&s.first===s.last&&(s.f&he)===0&&(s=s.first,(e&K)!==0&&(e&Se)!==0&&s!==null&&(s.f|=Se))}if(s!==null&&(s.parent=n,n!==null&&In(s,n),v!==null&&(v.f&g)!==0&&(e&X)===0)){var f=v;(f.effects??=[]).push(s)}return r}function Mt(){return v!==null&&!M}function Mn(e){const t=N(ue,null);return w(t,y),t.teardown=e,t}function Pn(e){It();var t=d.f,n=!v&&(t&L)!==0&&(t&de)===0;if(n){var r=h;(r.e??=[]).push(e)}else return Pt(e)}function Pt(e){return N(ie|dt,e)}function Zr(e){return It(),N(ue|dt,e)}function Wr(e){ae.ensure();const t=N(X|he,e);return()=>{G(t)}}function Jr(e){ae.ensure();const t=N(X|he,e);return(n={})=>new Promise(r=>{n.outro?Yn(t,()=>{G(t),r(void 0)}):(G(t),r(void 0))})}function Qr(e){return N(ie,e)}function es(e,t){var n=h,r={effect:null,ran:!1,deps:e};n.l.$.push(r),r.effect=Ft(()=>{e(),!r.ran&&(r.ran=!0,Me(t))})}function ts(){var e=h;Ft(()=>{for(var t of e.l.$){t.deps();var n=t.effect;(n.f&y)!==0&&n.deps!==null&&w(n,P),pe(n)&&fe(n),t.ran=!1}})}function Fn(e){return N(Ue|he,e)}function Ft(e,t=0){return N(ue|t,e)}function ns(e,t=[],n=[],r=[]){xt(r,t,n,s=>{N(ue,()=>e(...s.map(ee)))})}function rs(e,t=[],n=[],r=[]){if(n.length>0||r.length>0)var s=St();xt(r,t,n,f=>{N(ie,()=>e(...f.map(ee))),s&&s()})}function ss(e,t=0){var n=N(K|t,e);return n}function fs(e,t=0){var n=N(Be|t,e);return n}function is(e){return N(L|he,e)}function Lt(e){var t=e.teardown;if(t!==null){const n=se,r=v;ut(!0),$(null);try{t.call(null)}finally{ut(n),$(r)}}}function et(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){const s=n.ac;s!==null&&Qe(()=>{s.abort(W)});var r=n.next;(n.f&X)!==0?n.parent=null:G(n,t),n=r}}function Ln(e){for(var t=e.first;t!==null;){var n=t.next;(t.f&L)===0&&G(t),t=n}}function G(e,t=!0){var n=!1;(t||(e.f&tn)!==0)&&e.nodes!==null&&e.nodes.end!==null&&(jn(e.nodes.start,e.nodes.end),n=!0),et(e,t&&!n),ge(e,0),w(e,V);var r=e.nodes&&e.nodes.t;if(r!==null)for(const f of r)f.stop();Lt(e);var s=e.parent;s!==null&&s.first!==null&&jt(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=null}function jn(e,t){for(;e!==null;){var n=e===t?null:Z(e);e.remove(),e=n}}function jt(e){var t=e.parent,n=e.prev,r=e.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),t!==null&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function Yn(e,t,n=!0){var r=[];Yt(e,r,!0);var s=()=>{n&&G(e),t&&t()},f=r.length;if(f>0){var o=()=>--f||s();for(var l of r)l.out(o)}else s()}function Yt(e,t,n){if((e.f&F)===0){e.f^=F;var r=e.nodes&&e.nodes.t;if(r!==null)for(const l of r)(l.is_global||n)&&t.push(l);for(var s=e.first;s!==null;){var f=s.next,o=(s.f&Se)!==0||(s.f&L)!==0&&(e.f&K)!==0;Yt(s,t,o?n:!1),s=f}}}function as(e){qt(e,!0)}function qt(e,t){if((e.f&F)!==0){e.f^=F,(e.f&y)===0&&(w(e,T),Y(e));for(var n=e.first;n!==null;){var r=n.next,s=(n.f&Se)!==0||(n.f&L)!==0;qt(n,s?t:!1),n=r}var f=e.nodes&&e.nodes.t;if(f!==null)for(const o of f)(o.is_global||t)&&o.in()}}function ls(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var s=n===r?null:Z(n);t.append(n),n=s}}let xe=!1,se=!1;function ut(e){se=e}let v=null,M=!1;function $(e){v=e}let d=null;function ve(e){d=e}let C=null;function Ht(e){v!==null&&(C===null?C=[e]:C.push(e))}let x=null,R=0,O=null;function qn(e){O=e}let Vt=1,Q=0,ne=Q;function ct(e){ne=e}function Bt(){return++Vt}function pe(e){var t=e.f;if((t&T)!==0)return!0;if(t&g&&(e.f&=~re),(t&P)!==0){for(var n=e.deps,r=n.length,s=0;s<r;s++){var f=n[s];if(pe(f)&&Rt(f),f.wv>e.wv)return!0}(t&k)!==0&&I===null&&w(e,y)}return!1}function Ut(e,t,n=!0){var r=e.reactions;if(r!==null&&!(C!==null&&oe.call(C,e)))for(var s=0;s<r.length;s++){var f=r[s];(f.f&g)!==0?Ut(f,t,!1):t===f&&(n?w(f,T):(f.f&y)!==0&&w(f,P),Y(f))}}function zt(e){var t=x,n=R,r=O,s=v,f=C,o=h,l=M,i=ne,a=e.f;x=null,R=0,O=null,v=(a&(L|X))===0?e:null,C=null,Re(e.ctx),M=!1,ne=++Q,e.ac!==null&&(Qe(()=>{e.ac.abort(W)}),e.ac=null);try{e.f|=Le;var u=e.fn,c=u();e.f|=de;var _=e.deps,m=b?.is_fork;if(x!==null){var p;if(m||ge(e,R),_!==null&&R>0)for(_.length=R+x.length,p=0;p<x.length;p++)_[R+p]=x[p];else e.deps=_=x;if(Mt()&&(e.f&k)!==0)for(p=R;p<_.length;p++)(_[p].reactions??=[]).push(e)}else!m&&_!==null&&R<_.length&&(ge(e,R),_.length=R);if(Te()&&O!==null&&!M&&_!==null&&(e.f&(g|P|T))===0)for(p=0;p<O.length;p++)Ut(O[p],e);if(s!==null&&s!==e){if(Q++,s.deps!==null)for(let D=0;D<n;D+=1)s.deps[D].rv=Q;if(t!==null)for(const D of t)D.rv=Q;O!==null&&(r===null?r=O:r.push(...O))}return(e.f&B)!==0&&(e.f^=B),c}catch(D){return bn(D)}finally{e.f^=Le,x=t,R=n,O=r,v=s,C=f,Re(o),M=l,ne=i}}function Hn(e,t){let n=t.reactions;if(n!==null){var r=Xt.call(n,e);if(r!==-1){var s=n.length-1;s===0?n=t.reactions=null:(n[r]=n[s],n.pop())}}if(n===null&&(t.f&g)!==0&&(x===null||!oe.call(x,t))){var f=t;(f.f&k)!==0&&(f.f^=k,f.f&=~re),Ke(f),Rn(f),ge(f,0)}}function ge(e,t){var n=e.deps;if(n!==null)for(var r=t;r<n.length;r++)Hn(e,n[r])}function fe(e){var t=e.f;if((t&V)===0){w(e,y);var n=d,r=xe;d=e,xe=!0;try{(t&(K|Be))!==0?Ln(e):et(e),Lt(e);var s=zt(e);e.teardown=typeof s=="function"?s:null,e.wv=Vt;var f}finally{xe=r,d=n}}}async function os(){await Promise.resolve(),En()}function us(){return ae.ensure().settled()}function ee(e){var t=e.f,n=(t&g)!==0;if(v!==null&&!M){var r=d!==null&&(d.f&V)!==0;if(!r&&(C===null||!oe.call(C,e))){var s=v.deps;if((v.f&Le)!==0)e.rv<Q&&(e.rv=Q,x===null&&s!==null&&s[R]===e?R++:x===null?x=[e]:x.push(e));else{(v.deps??=[]).push(e);var f=e.reactions;f===null?e.reactions=[v]:oe.call(f,v)||f.push(v)}}}if(se&&U.has(e))return U.get(e);if(n){var o=e;if(se){var l=o.v;return((o.f&y)===0&&o.reactions!==null||$t(o))&&(l=Ze(o)),U.set(o,l),l}var i=(o.f&k)===0&&!M&&v!==null&&(xe||(v.f&k)!==0),a=(o.f&de)===0;pe(o)&&(i&&(o.f|=k),Rt(o)),i&&!a&&(Nt(o),Gt(o))}if(I?.has(e))return I.get(e);if((e.f&B)!==0)throw e.v;return e.v}function Gt(e){if(e.f|=k,e.deps!==null)for(const t of e.deps)(t.reactions??=[]).push(e),(t.f&g)!==0&&(t.f&k)===0&&(Nt(t),Gt(t))}function $t(e){if(e.v===E)return!0;if(e.deps===null)return!1;for(const t of e.deps)if(U.has(t)||(t.f&g)!==0&&$t(t))return!0;return!1}function Me(e){var t=M;try{return M=!0,e()}finally{M=t}}function cs(e){if(!(typeof e!="object"||!e||e instanceof EventTarget)){if(te in e)Ve(e);else if(!Array.isArray(e))for(let t in e){const n=e[t];typeof n=="object"&&n&&te in n&&Ve(n)}}}function Ve(e,t=new Set){if(typeof e=="object"&&e!==null&&!(e instanceof EventTarget)&&!t.has(e)){t.add(e),e instanceof Date&&e.getTime();for(let r in e)try{Ve(e[r],t)}catch{}const n=_t(e);if(n!==Object.prototype&&n!==Array.prototype&&n!==Map.prototype&&n!==Set.prototype&&n!==Date.prototype){const r=Zt(n);for(let s in r){const f=r[s].get;if(f)try{f.call(e)}catch{}}}}}function Vn(e,t,n){if(e==null)return t(void 0),ye;const r=Me(()=>e.subscribe(t,n));return r.unsubscribe?()=>r.unsubscribe():r}const le=[];function _s(e,t=ye){let n=null;const r=new Set;function s(l){if(bt(e,l)&&(e=l,n)){const i=!le.length;for(const a of r)a[1](),le.push(a,e);if(i){for(let a=0;a<le.length;a+=2)le[a][0](le[a+1]);le.length=0}}}function f(l){s(l(e))}function o(l,i=ye){const a=[l,i];return r.add(a),r.size===1&&(n=t(s,f)||ye),l(e),()=>{r.delete(a),r.size===0&&n&&(n(),n=null)}}return{set:s,update:f,subscribe:o}}function vs(e){let t;return Vn(e,n=>t=n)(),t}function Bn(e){h===null&&ze(),me&&h.l!==null?Un(h).m.push(e):Pn(()=>{const t=Me(e);if(typeof t=="function")return t})}function ds(e){h===null&&ze(),Bn(()=>()=>Me(e))}function Un(e){var t=e.l;return t.u??={a:[],b:[],m:[]}}export{he as $,b as A,Zn as B,ht as C,is as D,lr as E,nr as F,zr as G,_n as H,An as I,Kt as J,zn as K,ir as L,ur as M,We as N,ar as O,as as P,Yn as Q,F as R,je as S,L as T,or as U,Cn as V,G as W,Z as X,Se as Y,cn as Z,tn as _,ts as a,ae as a$,Br as a0,Cr as a1,Pn as a2,Ur as a3,Lr as a4,h as a5,Zr as a6,Me as a7,Kn as a8,Qt as a9,Qr as aA,Ft as aB,En as aC,Bn as aD,os as aE,ds as aF,fs as aG,mr as aH,qr as aI,xt as aJ,dn as aK,_t as aL,gr as aM,Zt as aN,er as aO,$r as aP,E as aQ,Dn as aR,Jn as aS,Xr as aT,ft as aU,Dr as aV,Ir as aW,Mt as aX,Fe as aY,en as aZ,wr as a_,Xe as aa,kr as ab,rs as ac,On as ad,ye as ae,Vn as af,vs as ag,Mn as ah,Gn as ai,we as aj,sr as ak,vr as al,se as am,d as an,V as ao,dr as ap,me as aq,_r as ar,cr as as,$n as at,te as au,Wn as av,hr as aw,Yr as ax,ve as ay,ls as az,Fr as b,w as b0,T as b1,Y as b2,P as b3,yn as b4,$ as b5,Re as b6,bn as b7,v as b8,Ne as b9,Wr as bA,_s as bB,us as bC,fr as ba,Tr as bb,Qe as bc,Gr as bd,kn as be,pr as bf,br as bg,Ce as bh,Je as bi,de as bj,Hr as bk,Ge as bl,rr as bm,Jr as bn,$e as bo,tr as bp,yr as bq,Kr as br,lt as bs,Wt as bt,Xn as bu,jn as bv,Er as bw,Te as bx,ne as by,Mr as bz,Vr as c,cs as d,q as e,be as f,ee as g,Oe as h,ss as i,z as j,ce as k,es as l,jr as m,Rr as n,ke as o,Pr as p,xr as q,Sr as r,H as s,ns as t,Or as u,Nr as v,Ar as w,S as x,vn as y,He as z};
1
+ var Kt=Array.isArray,Xt=Array.prototype.indexOf,oe=Array.prototype.includes,zn=Array.from,Gn=Object.defineProperty,we=Object.getOwnPropertyDescriptor,Zt=Object.getOwnPropertyDescriptors,Wt=Object.prototype,Jt=Array.prototype,_t=Object.getPrototypeOf,rt=Object.isExtensible;function $n(e){return typeof e=="function"}const ye=()=>{};function Kn(e){return e()}function Qt(e){for(var t=0;t<e.length;t++)e[t]()}function vt(){var e,t,n=new Promise((r,s)=>{e=r,t=s});return{promise:n,resolve:e,reject:t}}function Xn(e,t){if(Array.isArray(e))return e;if(!(Symbol.iterator in e))return Array.from(e);const n=[];for(const r of e)if(n.push(r),n.length===t)break;return n}const g=2,ie=4,ue=8,Be=1<<24,K=16,L=32,X=64,en=128,k=512,y=1024,T=2048,P=4096,F=8192,V=16384,de=32768,Se=65536,st=1<<17,tn=1<<18,he=1<<19,dt=1<<20,Zn=1<<25,re=65536,Le=1<<21,Ue=1<<22,B=1<<23,te=Symbol("$state"),Wn=Symbol("legacy props"),Jn=Symbol(""),W=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"},er=!!globalThis.document?.contentType&&globalThis.document.contentType.includes("xml"),tr=1,Ce=3,ht=8;function ze(e){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function nn(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function nr(e,t,n){throw new Error("https://svelte.dev/e/each_key_duplicate")}function rn(e){throw new Error("https://svelte.dev/e/effect_in_teardown")}function sn(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function fn(e){throw new Error("https://svelte.dev/e/effect_orphan")}function an(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function rr(){throw new Error("https://svelte.dev/e/hydration_failed")}function sr(e){throw new Error("https://svelte.dev/e/props_invalid_value")}function ln(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function on(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function un(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function fr(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}const ir=1,ar=2,lr=4,or=8,ur=16,cr=1,_r=2,vr=4,dr=8,hr=16,pr=1,br=2,cn="[",_n="[!",wr="[?",vn="]",Ge={},E=Symbol(),dn="http://www.w3.org/1999/xhtml",yr="http://www.w3.org/2000/svg",Er="http://www.w3.org/1998/Math/MathML",gr="@attach";function $e(e){console.warn("https://svelte.dev/e/hydration_mismatch")}function mr(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function Tr(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}let z=!1;function Ar(e){z=e}let S;function ce(e){if(e===null)throw $e(),Ge;return S=e}function xr(){return ce(Z(S))}function Sr(e){if(z){if(Z(S)!==null)throw $e(),Ge;S=e}}function Rr(e=1){if(z){for(var t=e,n=S;t--;)n=Z(n);S=n}}function Nr(e=!0){for(var t=0,n=S;;){if(n.nodeType===ht){var r=n.data;if(r===vn){if(t===0)return n;t-=1}else(r===cn||r===_n||r[0]==="["&&!isNaN(Number(r.slice(1))))&&(t+=1)}var s=Z(n);e&&n.remove(),n=s}}function Or(e){if(!e||e.nodeType!==ht)throw $e(),Ge;return e.data}function pt(e){return e===this.v}function bt(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function wt(e){return!bt(e,this.v)}let me=!1;function kr(){me=!0}let h=null;function Re(e){h=e}function Cr(e){return De().get(e)}function Dr(e,t){return De().set(e,t),t}function Ir(e){return De().has(e)}function Mr(){return De()}function Pr(e,t=!1,n){h={p:h,i:!1,c:null,e:null,s:e,x:null,l:me&&!t?{s:null,u:null,$:[]}:null}}function Fr(e){var t=h,n=t.e;if(n!==null){t.e=null;for(var r of n)Pt(r)}return e!==void 0&&(t.x=e),t.i=!0,h=t.p,e??{}}function Te(){return!me||h!==null&&h.l===null}function De(e){return h===null&&ze(),h.c??=new Map(hn(h)||void 0)}function hn(e){let t=e.p;for(;t!==null;){const n=t.c;if(n!==null)return n;t=t.p}return null}let J=[];function yt(){var e=J;J=[],Qt(e)}function je(e){if(J.length===0&&!Ee){var t=J;queueMicrotask(()=>{t===J&&yt()})}J.push(e)}function pn(){for(;J.length>0;)yt()}function bn(e){var t=d;if(t===null)return v.f|=B,e;if((t.f&de)===0&&(t.f&ie)===0)throw e;Ne(e,t)}function Ne(e,t){for(;t!==null;){if((t.f&en)!==0){if((t.f&de)===0)throw e;try{t.b.error(e);return}catch(n){e=n}}t=t.parent}throw e}const wn=-7169;function w(e,t){e.f=e.f&wn|t}function Ke(e){(e.f&k)!==0||e.deps===null?w(e,y):w(e,P)}function Et(e){if(e!==null)for(const t of e)(t.f&g)===0||(t.f&re)===0||(t.f^=re,Et(t.deps))}function yn(e,t,n){(e.f&T)!==0?t.add(e):(e.f&P)!==0&&n.add(e),Et(e.deps),w(e,y)}const Ae=new Set;let b=null,ft=null,I=null,A=[],Ie=null,Ee=!1,_e=null;class ae{current=new Map;previous=new Map;#t=new Set;#s=new Set;#r=0;#f=0;#i=null;#a=new Set;#n=new Set;#e=new Map;is_fork=!1;#l=!1;#o(){return this.is_fork||this.#f>0}skip_effect(t){this.#e.has(t)||this.#e.set(t,{d:[],m:[]})}unskip_effect(t){var n=this.#e.get(t);if(n){this.#e.delete(t);for(var r of n.d)w(r,T),Y(r);for(r of n.m)w(r,P),Y(r)}}process(t){A=[],this.apply();var n=_e=[],r=[];for(const s of t)this.#u(s,n,r);if(_e=null,this.#o()){this.#c(r),this.#c(n);for(const[s,f]of this.#e)At(s,f)}else{ft=this,b=null;for(const s of this.#t)s(this);this.#t.clear(),this.#r===0&&this.#_(),it(r),it(n),this.#a.clear(),this.#n.clear(),ft=null,this.#i?.resolve()}I=null}#u(t,n,r){t.f^=y;for(var s=t.first;s!==null;){var f=s.f,o=(f&(L|X))!==0,l=o&&(f&y)!==0,i=l||(f&F)!==0||this.#e.has(s);if(!i&&s.fn!==null){o?s.f^=y:(f&ie)!==0?n.push(s):pe(s)&&((f&K)!==0&&this.#n.add(s),fe(s));var a=s.first;if(a!==null){s=a;continue}}for(;s!==null;){var u=s.next;if(u!==null){s=u;break}s=s.parent}}}#c(t){for(var n=0;n<t.length;n+=1)yn(t[n],this.#a,this.#n)}capture(t,n){n!==E&&!this.previous.has(t)&&this.previous.set(t,n),(t.f&B)===0&&(this.current.set(t,t.v),I?.set(t,t.v))}activate(){b=this,this.apply()}deactivate(){b===this&&(b=null,I=null)}flush(){if(A.length>0)b=this,gt();else if(this.#r===0&&!this.is_fork){for(const t of this.#t)t(this);this.#t.clear(),this.#_(),this.#i?.resolve()}this.deactivate()}discard(){for(const t of this.#s)t(this);this.#s.clear()}#_(){if(Ae.size>1){this.previous.clear();var t=b,n=I,r=!0;for(const f of Ae){if(f===this){r=!1;continue}const o=[];for(const[i,a]of this.current){if(f.current.has(i))if(r&&a!==f.current.get(i))f.current.set(i,a);else continue;o.push(i)}if(o.length===0)continue;const l=[...f.current.keys()].filter(i=>!this.current.has(i));if(l.length>0){var s=A;A=[];const i=new Set,a=new Map;for(const u of o)mt(u,l,i,a);if(A.length>0){b=f,f.apply();for(const u of A)f.#u(u,[],[]);f.deactivate()}A=s}}b=t,I=n}this.#e.clear(),Ae.delete(this)}increment(t){this.#r+=1,t&&(this.#f+=1)}decrement(t){this.#r-=1,t&&(this.#f-=1),!this.#l&&(this.#l=!0,je(()=>{this.#l=!1,this.#o()?A.length>0&&this.flush():this.revive()}))}revive(){for(const t of this.#a)this.#n.delete(t),w(t,T),Y(t);for(const t of this.#n)w(t,P),Y(t);this.flush()}oncommit(t){this.#t.add(t)}ondiscard(t){this.#s.add(t)}settled(){return(this.#i??=vt()).promise}static ensure(){if(b===null){const t=b=new ae;Ae.add(b),Ee||je(()=>{b===t&&t.flush()})}return b}apply(){}}function En(e){var t=Ee;Ee=!0;try{for(var n;;){if(pn(),A.length===0&&(b?.flush(),A.length===0))return Ie=null,n;gt()}}finally{Ee=t}}function gt(){var e=null;try{for(var t=0;A.length>0;){var n=ae.ensure();if(t++>1e3){var r,s;gn()}n.process(A),U.clear()}}finally{A=[],Ie=null,_e=null}}function gn(){try{an()}catch(e){Ne(e,Ie)}}let j=null;function it(e){var t=e.length;if(t!==0){for(var n=0;n<t;){var r=e[n++];if((r.f&(V|F))===0&&pe(r)&&(j=new Set,fe(r),r.deps===null&&r.first===null&&r.nodes===null&&r.teardown===null&&r.ac===null&&jt(r),j?.size>0)){U.clear();for(const s of j){if((s.f&(V|F))!==0)continue;const f=[s];let o=s.parent;for(;o!==null;)j.has(o)&&(j.delete(o),f.push(o)),o=o.parent;for(let l=f.length-1;l>=0;l--){const i=f[l];(i.f&(V|F))===0&&fe(i)}}j.clear()}}j=null}}function mt(e,t,n,r){if(!n.has(e)&&(n.add(e),e.reactions!==null))for(const s of e.reactions){const f=s.f;(f&g)!==0?mt(s,t,n,r):(f&(Ue|K))!==0&&(f&T)===0&&Tt(s,t,r)&&(w(s,T),Y(s))}}function Tt(e,t,n){const r=n.get(e);if(r!==void 0)return r;if(e.deps!==null)for(const s of e.deps){if(oe.call(t,s))return!0;if((s.f&g)!==0&&Tt(s,t,n))return n.set(s,!0),!0}return n.set(e,!1),!1}function Y(e){var t=Ie=e,n=t.b;if(n?.is_pending&&(e.f&(ie|ue|Be))!==0&&(e.f&de)===0){n.defer_effect(e);return}for(;t.parent!==null;){t=t.parent;var r=t.f;if(_e!==null&&t===d&&(e.f&ue)===0)return;if((r&(X|L))!==0){if((r&y)===0)return;t.f^=y}}A.push(t)}function At(e,t){if(!((e.f&L)!==0&&(e.f&y)!==0)){(e.f&T)!==0?t.d.push(e):(e.f&P)!==0&&t.m.push(e),w(e,y);for(var n=e.first;n!==null;)At(n,t),n=n.next}}function xt(e,t,n,r){const s=Te()?Xe:An;var f=e.filter(c=>!c.settled);if(n.length===0&&f.length===0){r(t.map(s));return}var o=d,l=mn(),i=f.length===1?f[0].promise:f.length>1?Promise.all(f.map(c=>c.promise)):null;function a(c){l();try{r(c)}catch(_){(o.f&V)===0&&Ne(_,o)}Ye()}if(n.length===0){i.then(()=>a(t.map(s)));return}function u(){l(),Promise.all(n.map(c=>Tn(c))).then(c=>a([...t.map(s),...c])).catch(c=>Ne(c,o))}i?i.then(u):u()}function mn(){var e=d,t=v,n=h,r=b;return function(f=!0){ve(e),$(t),Re(n),f&&r?.activate()}}function Ye(e=!0){ve(null),$(null),Re(null),e&&b?.deactivate()}function St(){var e=d.b,t=b,n=e.is_rendered();return e.update_pending_count(1),t.increment(n),()=>{e.update_pending_count(-1),t.decrement(n)}}function Xe(e){var t=g|T,n=v!==null&&(v.f&g)!==0?v:null;return d!==null&&(d.f|=he),{ctx:h,deps:null,effects:null,equals:pt,f:t,fn:e,reactions:null,rv:0,v:E,wv:0,parent:n??d,ac:null}}function Tn(e,t,n){d===null&&nn();var s=void 0,f=We(E),o=!v,l=new Map;return Fn(()=>{var i=vt();s=i.promise;try{Promise.resolve(e()).then(i.resolve,i.reject).finally(Ye)}catch(_){i.reject(_),Ye()}var a=b;if(o){var u=St();l.get(a)?.reject(W),l.delete(a),l.set(a,i)}const c=(_,m=void 0)=>{if(a.activate(),m)m!==W&&(f.f|=B,He(f,m));else{(f.f&B)!==0&&(f.f^=B),He(f,_);for(const[p,D]of l){if(l.delete(p),p===a)break;D.reject(W)}}u&&u()};i.promise.then(c,_=>c(null,_||"unknown"))}),Mn(()=>{for(const i of l.values())i.reject(W)}),new Promise(i=>{function a(u){function c(){u===s?i(f):a(s)}u.then(c,c)}a(s)})}function Lr(e){const t=Xe(e);return Ht(t),t}function An(e){const t=Xe(e);return t.equals=wt,t}function xn(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n<t.length;n+=1)G(t[n])}}function Sn(e){for(var t=e.parent;t!==null;){if((t.f&g)===0)return(t.f&V)===0?t:null;t=t.parent}return null}function Ze(e){var t,n=d;ve(Sn(e));try{e.f&=~re,xn(e),t=zt(e)}finally{ve(n)}return t}function Rt(e){var t=Ze(e);if(!e.equals(t)&&(e.wv=Bt(),(!b?.is_fork||e.deps===null)&&(e.v=t,e.deps===null))){w(e,y);return}se||(I!==null?(Mt()||b?.is_fork)&&I.set(e,t):Ke(e))}function Rn(e){if(e.effects!==null)for(const t of e.effects)(t.teardown||t.ac)&&(t.teardown?.(),t.ac?.abort(W),t.teardown=ye,t.ac=null,ge(t,0),et(t))}function Nt(e){if(e.effects!==null)for(const t of e.effects)t.teardown&&fe(t)}let qe=new Set;const U=new Map;let Ot=!1;function We(e,t){var n={f:0,v:e,reactions:null,equals:pt,rv:0,wv:0};return n}function q(e,t){const n=We(e);return Ht(n),n}function jr(e,t=!1,n=!0){const r=We(e);return t||(r.equals=wt),me&&n&&h!==null&&h.l!==null&&(h.l.s??=[]).push(r),r}function H(e,t,n=!1){v!==null&&(!M||(v.f&st)!==0)&&Te()&&(v.f&(g|K|Ue|st))!==0&&(C===null||!oe.call(C,e))&&un();let r=n?be(t):t;return He(e,r)}function He(e,t){if(!e.equals(t)){var n=e.v;se?U.set(e,t):U.set(e,n),e.v=t;var r=ae.ensure();if(r.capture(e,n),(e.f&g)!==0){const s=e;(e.f&T)!==0&&Ze(s),Ke(s)}e.wv=Bt(),kt(e,T),Te()&&d!==null&&(d.f&y)!==0&&(d.f&(L|X))===0&&(O===null?qn([e]):O.push(e)),!r.is_fork&&qe.size>0&&!Ot&&Nn()}return t}function Nn(){Ot=!1;for(const e of qe)(e.f&y)!==0&&w(e,P),pe(e)&&fe(e);qe.clear()}function Yr(e,t=1){var n=ee(e),r=t===1?n++:n--;return H(e,n),r}function Fe(e){H(e,e.v+1)}function kt(e,t){var n=e.reactions;if(n!==null)for(var r=Te(),s=n.length,f=0;f<s;f++){var o=n[f],l=o.f;if(!(!r&&o===d)){var i=(l&T)===0;if(i&&w(o,t),(l&g)!==0){var a=o;I?.delete(a),(l&re)===0&&(l&k&&(o.f|=re),kt(a,P))}else i&&((l&K)!==0&&j!==null&&j.add(o),Y(o))}}}function be(e){if(typeof e!="object"||e===null||te in e)return e;const t=_t(e);if(t!==Wt&&t!==Jt)return e;var n=new Map,r=Kt(e),s=q(0),f=ne,o=l=>{if(ne===f)return l();var i=v,a=ne;$(null),ct(f);var u=l();return $(i),ct(a),u};return r&&n.set("length",q(e.length)),new Proxy(e,{defineProperty(l,i,a){(!("value"in a)||a.configurable===!1||a.enumerable===!1||a.writable===!1)&&ln();var u=n.get(i);return u===void 0?o(()=>{var c=q(a.value);return n.set(i,c),c}):H(u,a.value,!0),!0},deleteProperty(l,i){var a=n.get(i);if(a===void 0){if(i in l){const u=o(()=>q(E));n.set(i,u),Fe(s)}}else H(a,E),Fe(s);return!0},get(l,i,a){if(i===te)return e;var u=n.get(i),c=i in l;if(u===void 0&&(!c||we(l,i)?.writable)&&(u=o(()=>{var m=be(c?l[i]:E),p=q(m);return p}),n.set(i,u)),u!==void 0){var _=ee(u);return _===E?void 0:_}return Reflect.get(l,i,a)},getOwnPropertyDescriptor(l,i){var a=Reflect.getOwnPropertyDescriptor(l,i);if(a&&"value"in a){var u=n.get(i);u&&(a.value=ee(u))}else if(a===void 0){var c=n.get(i),_=c?.v;if(c!==void 0&&_!==E)return{enumerable:!0,configurable:!0,value:_,writable:!0}}return a},has(l,i){if(i===te)return!0;var a=n.get(i),u=a!==void 0&&a.v!==E||Reflect.has(l,i);if(a!==void 0||d!==null&&(!u||we(l,i)?.writable)){a===void 0&&(a=o(()=>{var _=u?be(l[i]):E,m=q(_);return m}),n.set(i,a));var c=ee(a);if(c===E)return!1}return u},set(l,i,a,u){var c=n.get(i),_=i in l;if(r&&i==="length")for(var m=a;m<c.v;m+=1){var p=n.get(m+"");p!==void 0?H(p,E):m in l&&(p=o(()=>q(E)),n.set(m+"",p))}if(c===void 0)(!_||we(l,i)?.writable)&&(c=o(()=>q(void 0)),H(c,be(a)),n.set(i,c));else{_=c.v!==E;var D=o(()=>be(a));H(c,D)}var tt=Reflect.getOwnPropertyDescriptor(l,i);if(tt?.set&&tt.set.call(u,a),!_){if(r&&typeof i=="string"){var nt=n.get("length"),Pe=Number(i);Number.isInteger(Pe)&&Pe>=nt.v&&H(nt,Pe+1)}Fe(s)}return!0},ownKeys(l){ee(s);var i=Reflect.ownKeys(l).filter(c=>{var _=n.get(c);return _===void 0||_.v!==E});for(var[a,u]of n)u.v!==E&&!(a in l)&&i.push(a);return i},setPrototypeOf(){on()}})}function at(e){try{if(e!==null&&typeof e=="object"&&te in e)return e[te]}catch{}return e}function qr(e,t){return Object.is(at(e),at(t))}var lt,On,kn,Ct,Dt;function Hr(){if(lt===void 0){lt=window,On=document,kn=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;Ct=we(t,"firstChild").get,Dt=we(t,"nextSibling").get,rt(e)&&(e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0),rt(n)&&(n.__t=void 0)}}function Oe(e=""){return document.createTextNode(e)}function ke(e){return Ct.call(e)}function Z(e){return Dt.call(e)}function Vr(e,t){if(!z)return ke(e);var n=ke(S);if(n===null)n=S.appendChild(Oe());else if(t&&n.nodeType!==Ce){var r=Oe();return n?.before(r),ce(r),r}return t&&Je(n),ce(n),n}function Br(e,t=!1){if(!z){var n=ke(e);return n instanceof Comment&&n.data===""?Z(n):n}if(t){if(S?.nodeType!==Ce){var r=Oe();return S?.before(r),ce(r),r}Je(S)}return S}function Ur(e,t=1,n=!1){let r=z?S:e;for(var s;t--;)s=r,r=Z(r);if(!z)return r;if(n){if(r?.nodeType!==Ce){var f=Oe();return r===null?s?.after(f):r.before(f),ce(f),f}Je(r)}return ce(r),r}function Cn(e){e.textContent=""}function zr(){return!1}function Gr(e,t,n){return document.createElementNS(t??dn,e,void 0)}function Je(e){if(e.nodeValue.length<65536)return;let t=e.nextSibling;for(;t!==null&&t.nodeType===Ce;)t.remove(),e.nodeValue+=t.nodeValue,t=e.nextSibling}function $r(e,t){if(t){const n=document.body;e.autofocus=!0,je(()=>{document.activeElement===n&&e.focus()})}}function Kr(e){z&&ke(e)!==null&&Cn(e)}let ot=!1;function Dn(){ot||(ot=!0,document.addEventListener("reset",e=>{Promise.resolve().then(()=>{if(!e.defaultPrevented)for(const t of e.target.elements)t.__on_r?.()})},{capture:!0}))}function Qe(e){var t=v,n=d;$(null),ve(null);try{return e()}finally{$(t),ve(n)}}function Xr(e,t,n,r=n){e.addEventListener(t,()=>Qe(n));const s=e.__on_r;s?e.__on_r=()=>{s(),r(!0)}:e.__on_r=()=>r(!0),Dn()}function It(e){d===null&&(v===null&&fn(),sn()),se&&rn()}function In(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function N(e,t){var n=d;n!==null&&(n.f&F)!==0&&(e|=F);var r={ctx:h,deps:null,nodes:null,f:e|T|k,first:null,fn:t,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null},s=r;if((e&ie)!==0)_e!==null?_e.push(r):Y(r);else if(t!==null){try{fe(r)}catch(o){throw G(r),o}s.deps===null&&s.teardown===null&&s.nodes===null&&s.first===s.last&&(s.f&he)===0&&(s=s.first,(e&K)!==0&&(e&Se)!==0&&s!==null&&(s.f|=Se))}if(s!==null&&(s.parent=n,n!==null&&In(s,n),v!==null&&(v.f&g)!==0&&(e&X)===0)){var f=v;(f.effects??=[]).push(s)}return r}function Mt(){return v!==null&&!M}function Mn(e){const t=N(ue,null);return w(t,y),t.teardown=e,t}function Pn(e){It();var t=d.f,n=!v&&(t&L)!==0&&(t&de)===0;if(n){var r=h;(r.e??=[]).push(e)}else return Pt(e)}function Pt(e){return N(ie|dt,e)}function Zr(e){return It(),N(ue|dt,e)}function Wr(e){ae.ensure();const t=N(X|he,e);return()=>{G(t)}}function Jr(e){ae.ensure();const t=N(X|he,e);return(n={})=>new Promise(r=>{n.outro?Yn(t,()=>{G(t),r(void 0)}):(G(t),r(void 0))})}function Qr(e){return N(ie,e)}function es(e,t){var n=h,r={effect:null,ran:!1,deps:e};n.l.$.push(r),r.effect=Ft(()=>{e(),!r.ran&&(r.ran=!0,Me(t))})}function ts(){var e=h;Ft(()=>{for(var t of e.l.$){t.deps();var n=t.effect;(n.f&y)!==0&&n.deps!==null&&w(n,P),pe(n)&&fe(n),t.ran=!1}})}function Fn(e){return N(Ue|he,e)}function Ft(e,t=0){return N(ue|t,e)}function ns(e,t=[],n=[],r=[]){xt(r,t,n,s=>{N(ue,()=>e(...s.map(ee)))})}function rs(e,t=[],n=[],r=[]){if(n.length>0||r.length>0)var s=St();xt(r,t,n,f=>{N(ie,()=>e(...f.map(ee))),s&&s()})}function ss(e,t=0){var n=N(K|t,e);return n}function fs(e,t=0){var n=N(Be|t,e);return n}function is(e){return N(L|he,e)}function Lt(e){var t=e.teardown;if(t!==null){const n=se,r=v;ut(!0),$(null);try{t.call(null)}finally{ut(n),$(r)}}}function et(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){const s=n.ac;s!==null&&Qe(()=>{s.abort(W)});var r=n.next;(n.f&X)!==0?n.parent=null:G(n,t),n=r}}function Ln(e){for(var t=e.first;t!==null;){var n=t.next;(t.f&L)===0&&G(t),t=n}}function G(e,t=!0){var n=!1;(t||(e.f&tn)!==0)&&e.nodes!==null&&e.nodes.end!==null&&(jn(e.nodes.start,e.nodes.end),n=!0),et(e,t&&!n),ge(e,0),w(e,V);var r=e.nodes&&e.nodes.t;if(r!==null)for(const f of r)f.stop();Lt(e);var s=e.parent;s!==null&&s.first!==null&&jt(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=null}function jn(e,t){for(;e!==null;){var n=e===t?null:Z(e);e.remove(),e=n}}function jt(e){var t=e.parent,n=e.prev,r=e.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),t!==null&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function Yn(e,t,n=!0){var r=[];Yt(e,r,!0);var s=()=>{n&&G(e),t&&t()},f=r.length;if(f>0){var o=()=>--f||s();for(var l of r)l.out(o)}else s()}function Yt(e,t,n){if((e.f&F)===0){e.f^=F;var r=e.nodes&&e.nodes.t;if(r!==null)for(const l of r)(l.is_global||n)&&t.push(l);for(var s=e.first;s!==null;){var f=s.next,o=(s.f&Se)!==0||(s.f&L)!==0&&(e.f&K)!==0;Yt(s,t,o?n:!1),s=f}}}function as(e){qt(e,!0)}function qt(e,t){if((e.f&F)!==0){e.f^=F,(e.f&y)===0&&(w(e,T),Y(e));for(var n=e.first;n!==null;){var r=n.next,s=(n.f&Se)!==0||(n.f&L)!==0;qt(n,s?t:!1),n=r}var f=e.nodes&&e.nodes.t;if(f!==null)for(const o of f)(o.is_global||t)&&o.in()}}function ls(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var s=n===r?null:Z(n);t.append(n),n=s}}let xe=!1,se=!1;function ut(e){se=e}let v=null,M=!1;function $(e){v=e}let d=null;function ve(e){d=e}let C=null;function Ht(e){v!==null&&(C===null?C=[e]:C.push(e))}let x=null,R=0,O=null;function qn(e){O=e}let Vt=1,Q=0,ne=Q;function ct(e){ne=e}function Bt(){return++Vt}function pe(e){var t=e.f;if((t&T)!==0)return!0;if(t&g&&(e.f&=~re),(t&P)!==0){for(var n=e.deps,r=n.length,s=0;s<r;s++){var f=n[s];if(pe(f)&&Rt(f),f.wv>e.wv)return!0}(t&k)!==0&&I===null&&w(e,y)}return!1}function Ut(e,t,n=!0){var r=e.reactions;if(r!==null&&!(C!==null&&oe.call(C,e)))for(var s=0;s<r.length;s++){var f=r[s];(f.f&g)!==0?Ut(f,t,!1):t===f&&(n?w(f,T):(f.f&y)!==0&&w(f,P),Y(f))}}function zt(e){var t=x,n=R,r=O,s=v,f=C,o=h,l=M,i=ne,a=e.f;x=null,R=0,O=null,v=(a&(L|X))===0?e:null,C=null,Re(e.ctx),M=!1,ne=++Q,e.ac!==null&&(Qe(()=>{e.ac.abort(W)}),e.ac=null);try{e.f|=Le;var u=e.fn,c=u();e.f|=de;var _=e.deps,m=b?.is_fork;if(x!==null){var p;if(m||ge(e,R),_!==null&&R>0)for(_.length=R+x.length,p=0;p<x.length;p++)_[R+p]=x[p];else e.deps=_=x;if(Mt()&&(e.f&k)!==0)for(p=R;p<_.length;p++)(_[p].reactions??=[]).push(e)}else!m&&_!==null&&R<_.length&&(ge(e,R),_.length=R);if(Te()&&O!==null&&!M&&_!==null&&(e.f&(g|P|T))===0)for(p=0;p<O.length;p++)Ut(O[p],e);if(s!==null&&s!==e){if(Q++,s.deps!==null)for(let D=0;D<n;D+=1)s.deps[D].rv=Q;if(t!==null)for(const D of t)D.rv=Q;O!==null&&(r===null?r=O:r.push(...O))}return(e.f&B)!==0&&(e.f^=B),c}catch(D){return bn(D)}finally{e.f^=Le,x=t,R=n,O=r,v=s,C=f,Re(o),M=l,ne=i}}function Hn(e,t){let n=t.reactions;if(n!==null){var r=Xt.call(n,e);if(r!==-1){var s=n.length-1;s===0?n=t.reactions=null:(n[r]=n[s],n.pop())}}if(n===null&&(t.f&g)!==0&&(x===null||!oe.call(x,t))){var f=t;(f.f&k)!==0&&(f.f^=k,f.f&=~re),Ke(f),Rn(f),ge(f,0)}}function ge(e,t){var n=e.deps;if(n!==null)for(var r=t;r<n.length;r++)Hn(e,n[r])}function fe(e){var t=e.f;if((t&V)===0){w(e,y);var n=d,r=xe;d=e,xe=!0;try{(t&(K|Be))!==0?Ln(e):et(e),Lt(e);var s=zt(e);e.teardown=typeof s=="function"?s:null,e.wv=Vt;var f}finally{xe=r,d=n}}}async function os(){await Promise.resolve(),En()}function us(){return ae.ensure().settled()}function ee(e){var t=e.f,n=(t&g)!==0;if(v!==null&&!M){var r=d!==null&&(d.f&V)!==0;if(!r&&(C===null||!oe.call(C,e))){var s=v.deps;if((v.f&Le)!==0)e.rv<Q&&(e.rv=Q,x===null&&s!==null&&s[R]===e?R++:x===null?x=[e]:x.push(e));else{(v.deps??=[]).push(e);var f=e.reactions;f===null?e.reactions=[v]:oe.call(f,v)||f.push(v)}}}if(se&&U.has(e))return U.get(e);if(n){var o=e;if(se){var l=o.v;return((o.f&y)===0&&o.reactions!==null||$t(o))&&(l=Ze(o)),U.set(o,l),l}var i=(o.f&k)===0&&!M&&v!==null&&(xe||(v.f&k)!==0),a=(o.f&de)===0;pe(o)&&(i&&(o.f|=k),Rt(o)),i&&!a&&(Nt(o),Gt(o))}if(I?.has(e))return I.get(e);if((e.f&B)!==0)throw e.v;return e.v}function Gt(e){if(e.f|=k,e.deps!==null)for(const t of e.deps)(t.reactions??=[]).push(e),(t.f&g)!==0&&(t.f&k)===0&&(Nt(t),Gt(t))}function $t(e){if(e.v===E)return!0;if(e.deps===null)return!1;for(const t of e.deps)if(U.has(t)||(t.f&g)!==0&&$t(t))return!0;return!1}function Me(e){var t=M;try{return M=!0,e()}finally{M=t}}function cs(e){if(!(typeof e!="object"||!e||e instanceof EventTarget)){if(te in e)Ve(e);else if(!Array.isArray(e))for(let t in e){const n=e[t];typeof n=="object"&&n&&te in n&&Ve(n)}}}function Ve(e,t=new Set){if(typeof e=="object"&&e!==null&&!(e instanceof EventTarget)&&!t.has(e)){t.add(e),e instanceof Date&&e.getTime();for(let r in e)try{Ve(e[r],t)}catch{}const n=_t(e);if(n!==Object.prototype&&n!==Array.prototype&&n!==Map.prototype&&n!==Set.prototype&&n!==Date.prototype){const r=Zt(n);for(let s in r){const f=r[s].get;if(f)try{f.call(e)}catch{}}}}}function Vn(e,t,n){if(e==null)return t(void 0),ye;const r=Me(()=>e.subscribe(t,n));return r.unsubscribe?()=>r.unsubscribe():r}const le=[];function _s(e,t=ye){let n=null;const r=new Set;function s(l){if(bt(e,l)&&(e=l,n)){const i=!le.length;for(const a of r)a[1](),le.push(a,e);if(i){for(let a=0;a<le.length;a+=2)le[a][0](le[a+1]);le.length=0}}}function f(l){s(l(e))}function o(l,i=ye){const a=[l,i];return r.add(a),r.size===1&&(n=t(s,f)||ye),l(e),()=>{r.delete(a),r.size===0&&n&&(n(),n=null)}}return{set:s,update:f,subscribe:o}}function vs(e){let t;return Vn(e,n=>t=n)(),t}function Bn(e){h===null&&ze(),me&&h.l!==null?Un(h).m.push(e):Pn(()=>{const t=Me(e);if(typeof t=="function")return t})}function ds(e){h===null&&ze(),Bn(()=>()=>Me(e))}function Un(e){var t=e.l;return t.u??={a:[],b:[],m:[]}}export{he as $,b as A,Zn as B,ht as C,is as D,lr as E,nr as F,zr as G,_n as H,An as I,Kt as J,zn as K,ir as L,ur as M,We as N,ar as O,as as P,Yn as Q,F as R,je as S,L as T,or as U,Cn as V,G as W,Z as X,Se as Y,cn as Z,tn as _,ts as a,wr as a$,Br as a0,Cr as a1,Pn as a2,Ur as a3,Lr as a4,h as a5,Zr as a6,Me as a7,Kn as a8,Qt as a9,Qr as aA,Ft as aB,En as aC,Bn as aD,os as aE,ds as aF,fs as aG,mr as aH,qr as aI,xt as aJ,dn as aK,_t as aL,gr as aM,Zt as aN,er as aO,$r as aP,E as aQ,Dn as aR,Jn as aS,Wt as aT,Xr as aU,ft as aV,Dr as aW,Ir as aX,Mt as aY,Fe as aZ,en as a_,Xe as aa,kr as ab,rs as ac,On as ad,ye as ae,Vn as af,vs as ag,Mn as ah,Gn as ai,we as aj,sr as ak,vr as al,se as am,d as an,V as ao,dr as ap,me as aq,_r as ar,cr as as,$n as at,te as au,Wn as av,hr as aw,Yr as ax,ve as ay,ls as az,Fr as b,ae as b0,w as b1,T as b2,Y as b3,P as b4,yn as b5,$ as b6,Re as b7,bn as b8,v as b9,Wr as bA,_s as bB,us as bC,Ne as ba,fr as bb,Tr as bc,Qe as bd,Gr as be,kn as bf,pr as bg,br as bh,Ce as bi,Je as bj,de as bk,Hr as bl,Ge as bm,rr as bn,Jr as bo,$e as bp,tr as bq,yr as br,Kr as bs,lt as bt,Xn as bu,jn as bv,Er as bw,Te as bx,ne as by,Mr as bz,Vr as c,cs as d,q as e,be as f,ee as g,Oe as h,ss as i,z as j,ce as k,es as l,jr as m,Rr as n,ke as o,Pr as p,xr as q,Sr as r,H as s,ns as t,Or as u,Nr as v,Ar as w,S as x,vn as y,He as z};
@@ -1 +1 @@
1
- import{e as m,f as w,s as u,g as o,a4 as it}from"./sZJoCX5N.js";import{a as d}from"./OZfYVFGq.js";function at(){return d("/api/workspace")}function st(e){return d("/api/workspace",{method:"PUT",body:JSON.stringify(e)})}function wt(){return d("/api/workspace/mcp-config")}function D(){return d("/api/repos")}function ct(e,i,s,f){return d("/api/repos",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e,display_name:i||void 0,description:s,...f?{private:!0}:{}})})}function lt(e,i,s){return d(`/api/repos/${encodeURIComponent(e)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:i,display_name:s||void 0})})}function ut(e){return d(`/api/repos/${encodeURIComponent(e)}`,{method:"DELETE"})}function dt(){return d("/api/apps")}function pt(e){return d(`/api/repos/${encodeURIComponent(e)}/entities?summary=true`)}function Et(e,i,s){return d(`/api/repos/${encodeURIComponent(e)}/entities/${encodeURIComponent(i)}/${encodeURIComponent(s)}`)}function St(e,i,s,f,c){return d(`/api/repos/${encodeURIComponent(e)}/entities`,{method:"POST",body:JSON.stringify({entityType:i,entityId:s,data:f,content:c})})}function bt(e,i,s){return d(`/api/repos/${encodeURIComponent(e)}/entities/${encodeURIComponent(i)}/${encodeURIComponent(s)}`,{method:"DELETE"})}function It(e,i,s,f){return d(`/api/repos/${encodeURIComponent(e)}/entities/${encodeURIComponent(i)}/${encodeURIComponent(s)}`,{method:"PUT",body:JSON.stringify(f)})}function Tt(e,i,s,f){return d(`/api/repos/${encodeURIComponent(e)}/change-type`,{method:"POST",body:JSON.stringify({entityType:i,entityId:s,newType:f})})}function $t(e,i,s,f,c){return d(`/api/repos/${encodeURIComponent(e)}/transfer`,{method:"POST",body:JSON.stringify({entityType:i,entityId:s,targetRepo:f,mode:c})})}function kt(){return d("/api/insights")}function vt(){return d("/api/insights/generate",{method:"POST"})}function Ut(){return d("/api/preferences")}function Pt(e){return d("/api/preferences",{method:"PUT",body:JSON.stringify(e)})}function Rt(){return d("/api/views")}function At(e,i,s){return d("/api/views",{method:"POST",body:JSON.stringify({name:e,viewType:s??"list",config:i})})}function Lt(e,i){return d(`/api/views/${e}`,{method:"PUT",body:JSON.stringify(i)})}function Ot(e){return d(`/api/views/${e}`,{method:"DELETE"})}function Mt(e){return d(`/api/repos/${encodeURIComponent(e)}/commit`,{method:"POST"})}function ft(e){return e.replace(/-/g," ").replace(/\b\w/g,i=>i.toUpperCase())}function _(e,i){return i||e.split("-").map(s=>s.charAt(0).toUpperCase()+s.slice(1)).join(" ")}const mt="#e05050";function v(e){if(typeof document>"u")return;const i=e||mt,s=parseInt(i.slice(1,3),16),f=parseInt(i.slice(3,5),16),c=parseInt(i.slice(5,7),16),E=[document.documentElement,document.querySelector("[data-theme]")].filter(Boolean);for(const h of E)h.style.setProperty("--color-accent",i),h.style.setProperty("--color-accent-hover",yt(i,15)),h.style.setProperty("--color-accent-muted",`rgba(${s}, ${f}, ${c}, 0.08)`),h.style.setProperty("--color-link",j(i,15)),h.style.setProperty("--color-badge-bg",`rgba(${s}, ${f}, ${c}, 0.1)`),h.style.setProperty("--color-badge-text",j(i,20))}function yt(e,i){const s=Math.max(0,Math.round(parseInt(e.slice(1,3),16)*(1-i/100))),f=Math.max(0,Math.round(parseInt(e.slice(3,5),16)*(1-i/100))),c=Math.max(0,Math.round(parseInt(e.slice(5,7),16)*(1-i/100)));return`#${s.toString(16).padStart(2,"0")}${f.toString(16).padStart(2,"0")}${c.toString(16).padStart(2,"0")}`}function j(e,i){const s=Math.min(255,Math.round(parseInt(e.slice(1,3),16)+(255-parseInt(e.slice(1,3),16))*i/100)),f=Math.min(255,Math.round(parseInt(e.slice(3,5),16)+(255-parseInt(e.slice(3,5),16))*i/100)),c=Math.min(255,Math.round(parseInt(e.slice(5,7),16)+(255-parseInt(e.slice(5,7),16))*i/100));return`#${s.toString(16).padStart(2,"0")}${f.toString(16).padStart(2,"0")}${c.toString(16).padStart(2,"0")}`}function gt(){let e=m(""),i=m(null),s=m(null),f=m(!1),c=m(w([]));const E={};let h=m(w([])),U=m(!1),P=m(null),g=m(w({})),R=w({}),A=w({}),T=w({}),F=m(0),x=m(null),C=m(""),$=null,S=m(0),b=m(0),J=m("alpha");async function W(){u(U,!0),u(P,null),u(S,0),u(b,0);try{const[t,n,r]=await Promise.all([D(),dt().catch(()=>[]),at().catch(()=>({name:""}))]);u(h,n,!0),u(e,r.name,!0),u(i,r.about??null,!0),u(s,r.accent_color??null,!0),u(f,!0),v(o(s)),u(c,t.map(a=>({name:a.name,displayName:_(a.name,a.display_name),type:a.type,private:a.private,sync:a.sync,count:null,entities:[],loading:!1,loaded:!1})),!0),await Promise.all(o(c).map(a=>I(a.name)))}catch(t){u(P,t.message,!0)}finally{u(U,!1)}}function V(t,n,r){const a=o(c).find(l=>l.name===t);a&&(a.entities=a.entities.filter(l=>!(l.id===r&&l.entityType===n)),a.count=a.entities.length)}async function Q(t){o(c).find(r=>r.name===t)&&await I(t,!0)}async function B(){u(S,0),u(b,0),await Promise.all(o(c).map(t=>I(t.name,!0)))}async function I(t,n=!1){const r=o(c).find(l=>l.name===t);if(!r||r.loading||!n&&r.loaded)return;const a=(E[t]??0)+1;E[t]=a,n||(r.loading=!0);try{const l=await pt(t);if(E[t]!==a)return;let y=0,L=0;for(const p of l)y+=p.document?.wikilinks?.length??0,L+=p.subContentCount??0;u(S,o(S)+y),u(b,o(b)+L);const O=new Set(["name","created_at","updated_at"]);r.entities=l.filter(p=>!p.id.toLowerCase().startsWith("readme")).map(p=>({id:p.id,title:p.data?.name??ft(p.id),entityType:p.entityType,repo:t,hasSubContent:!!p.hasSubContent,wikilinks:p.document?.wikilinks??[],createdAt:p.data?.created_at??null,updatedAt:p.data?.updated_at??null,fields:Object.fromEntries(Object.entries(p.data??{}).filter(([M])=>!O.has(M))),status:p.data?.status??void 0,priority:p.data?.priority??void 0,assignee:p.data?.assignee??void 0,dueDate:p.data?.due_date??void 0})).sort((p,M)=>p.title.localeCompare(M.title)),r.count=r.entities.length,r.loaded=!0}catch(l){console.error(`Failed to load entities for ${t}:`,l)}finally{r.loading=!1}}function K(t){o(g)[t]=!o(g)[t]}function q(t){return o(g)[t]??!1}function k(t,n,r){return`${t}/${n}/${r}`}function H(t,n,r){const a=k(t,n,r),l=R[a]??!1;R[a]=!l,!l&&!A[a]?.loaded&&z(t,n,r)}function N(t,n,r){return R[k(t,n,r)]??!1}function Y(t,n,r){return A[k(t,n,r)]??{entries:[],loading:!1,loaded:!1}}async function z(t,n,r){const a=k(t,n,r);A[a]={entries:[],loading:!1,loaded:!0}}function G(t){const n=o(C).trim().toLowerCase();if(!n)return t;const r=[];for(const a of t){const l=a.entities.filter(y=>y.title.toLowerCase().includes(n)||y.id.toLowerCase().includes(n));l.length>0&&r.push({...a,entities:l,count:l.length})}return r}function X(t){if(t&&!o(C)?$={...o(g)}:!t&&o(C)&&$&&(u(g,$,!0),$=null),u(C,t,!0),t){const n=t.trim().toLowerCase();for(const r of o(c)){const a=r.entities.some(l=>l.title.toLowerCase().includes(n)||l.id.toLowerCase().includes(n));o(g)[r.name]=a}}}function Z(t){const n=t.startsWith("type:");T[t]=!(T[t]??n)}function tt(t){return T[t]??!1}function et(t){return T[t]===!1}const nt=it(()=>o(c).reduce((t,n)=>t+(n.count??0),0));function ot(t){return o(h).find(n=>n.entityTypes.includes(t))}function rt(t){v(t||o(s))}return{get name(){return o(e)},get about(){return o(i)},get accentColor(){return o(s)},get nameLoaded(){return o(f)},async updateWorkspace(t){t.accent_color!==void 0&&(u(s,t.accent_color,!0),v(t.accent_color)),await st(t),t.name?.trim()&&u(e,t.name.trim(),!0),typeof t.about=="string"&&u(i,t.about,!0)},get repos(){return o(c)},get apps(){return o(h)},get loading(){return o(U)},get error(){return o(P)},get totalEntities(){return o(nt)},get totalLinks(){return o(S)},get totalFiles(){return o(b)},get hasTasks(){return o(c).some(t=>t.entities.some(n=>n.entityType==="task"))},get sortedRepos(){const t=[...o(c)].sort((n,r)=>n.name.localeCompare(r.name));return G(t)},get filteredIds(){const t=o(C).trim().toLowerCase();if(!t)return null;const n=new Set;for(const r of o(c))for(const a of r.entities)(a.title.toLowerCase().includes(t)||a.id.toLowerCase().includes(t))&&n.add(a.id);return n},get filterQuery(){return o(C)},setFilterQuery:X,get sortMode(){return o(J)},set sortMode(t){u(J,t,!0)},get recentEntities(){const t=o(C).trim().toLowerCase();let n=[];for(const r of o(c))for(const a of r.entities)t&&!a.title.toLowerCase().includes(t)&&!a.id.toLowerCase().includes(t)||n.push(a);return n.sort((r,a)=>{const l=r.updatedAt??"";return(a.updatedAt??"").localeCompare(l)})},get sidebarScrollTop(){return o(F)},set sidebarScrollTop(t){u(F,t,!0)},get lastAutoExpandedFor(){return o(x)},set lastAutoExpandedFor(t){u(x,t,!0)},load:W,loadEntities:I,removeEntity:V,refreshEntities:Q,refreshAll:B,toggleRepo:K,isExpanded:q,toggleEntity:H,isEntityExpanded:N,getEntityContents:Y,toggleFolder:Z,isFolderExpanded:tt,isFolderCollapsed:et,applyUserAccentColor:rt,applyAccentColor:v,getAppForEntityType:ot,async renameCollectionTo(t,n,r){await lt(t,n,r);const a=o(c).find(l=>l.name===t);a&&(a.name=n,a.displayName=r||_(n),o(g)[t]&&(o(g)[n]=!0,delete o(g)[t]))},async removeCollection(t){await ut(t),u(c,o(c).filter(n=>n.name!==t),!0),delete o(g)[t]},async addCollection(t,n,r,a){await ct(t,n,r,a);const l=await D();u(c,l.map(y=>o(c).find(O=>O.name===y.name)??{name:y.name,displayName:_(y.name,y.display_name),type:y.type,private:y.private,count:null,entities:[],loading:!1,loaded:!1}),!0),o(g)[t]=!0,await I(t)}}}const _t=gt();export{Mt as a,kt as b,At as c,Ot as d,Ut as e,Rt as f,vt as g,Et as h,It as i,wt as j,Tt as k,bt as l,St as m,Pt as s,$t as t,Lt as u,_t as w};
1
+ import{e as m,f as w,s as u,g as o,a4 as it}from"./BenpwI6m.js";import{a as d}from"./CieeblIr.js";function at(){return d("/api/workspace")}function st(e){return d("/api/workspace",{method:"PUT",body:JSON.stringify(e)})}function wt(){return d("/api/workspace/mcp-config")}function D(){return d("/api/repos")}function ct(e,i,s,f){return d("/api/repos",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e,display_name:i||void 0,description:s,...f?{private:!0}:{}})})}function lt(e,i,s){return d(`/api/repos/${encodeURIComponent(e)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:i,display_name:s||void 0})})}function ut(e){return d(`/api/repos/${encodeURIComponent(e)}`,{method:"DELETE"})}function dt(){return d("/api/apps")}function pt(e){return d(`/api/repos/${encodeURIComponent(e)}/entities?summary=true`)}function Et(e,i,s){return d(`/api/repos/${encodeURIComponent(e)}/entities/${encodeURIComponent(i)}/${encodeURIComponent(s)}`)}function St(e,i,s,f,c){return d(`/api/repos/${encodeURIComponent(e)}/entities`,{method:"POST",body:JSON.stringify({entityType:i,entityId:s,data:f,content:c})})}function bt(e,i,s){return d(`/api/repos/${encodeURIComponent(e)}/entities/${encodeURIComponent(i)}/${encodeURIComponent(s)}`,{method:"DELETE"})}function It(e,i,s,f){return d(`/api/repos/${encodeURIComponent(e)}/entities/${encodeURIComponent(i)}/${encodeURIComponent(s)}`,{method:"PUT",body:JSON.stringify(f)})}function Tt(e,i,s,f){return d(`/api/repos/${encodeURIComponent(e)}/change-type`,{method:"POST",body:JSON.stringify({entityType:i,entityId:s,newType:f})})}function $t(e,i,s,f,c){return d(`/api/repos/${encodeURIComponent(e)}/transfer`,{method:"POST",body:JSON.stringify({entityType:i,entityId:s,targetRepo:f,mode:c})})}function kt(){return d("/api/insights")}function vt(){return d("/api/insights/generate",{method:"POST"})}function Ut(){return d("/api/preferences")}function Pt(e){return d("/api/preferences",{method:"PUT",body:JSON.stringify(e)})}function Rt(){return d("/api/views")}function At(e,i,s){return d("/api/views",{method:"POST",body:JSON.stringify({name:e,viewType:s??"list",config:i})})}function Lt(e,i){return d(`/api/views/${e}`,{method:"PUT",body:JSON.stringify(i)})}function Ot(e){return d(`/api/views/${e}`,{method:"DELETE"})}function Mt(e){return d(`/api/repos/${encodeURIComponent(e)}/commit`,{method:"POST"})}function ft(e){return e.replace(/-/g," ").replace(/\b\w/g,i=>i.toUpperCase())}function _(e,i){return i||e.split("-").map(s=>s.charAt(0).toUpperCase()+s.slice(1)).join(" ")}const mt="#e05050";function v(e){if(typeof document>"u")return;const i=e||mt,s=parseInt(i.slice(1,3),16),f=parseInt(i.slice(3,5),16),c=parseInt(i.slice(5,7),16),E=[document.documentElement,document.querySelector("[data-theme]")].filter(Boolean);for(const h of E)h.style.setProperty("--color-accent",i),h.style.setProperty("--color-accent-hover",yt(i,15)),h.style.setProperty("--color-accent-muted",`rgba(${s}, ${f}, ${c}, 0.08)`),h.style.setProperty("--color-link",j(i,15)),h.style.setProperty("--color-badge-bg",`rgba(${s}, ${f}, ${c}, 0.1)`),h.style.setProperty("--color-badge-text",j(i,20))}function yt(e,i){const s=Math.max(0,Math.round(parseInt(e.slice(1,3),16)*(1-i/100))),f=Math.max(0,Math.round(parseInt(e.slice(3,5),16)*(1-i/100))),c=Math.max(0,Math.round(parseInt(e.slice(5,7),16)*(1-i/100)));return`#${s.toString(16).padStart(2,"0")}${f.toString(16).padStart(2,"0")}${c.toString(16).padStart(2,"0")}`}function j(e,i){const s=Math.min(255,Math.round(parseInt(e.slice(1,3),16)+(255-parseInt(e.slice(1,3),16))*i/100)),f=Math.min(255,Math.round(parseInt(e.slice(3,5),16)+(255-parseInt(e.slice(3,5),16))*i/100)),c=Math.min(255,Math.round(parseInt(e.slice(5,7),16)+(255-parseInt(e.slice(5,7),16))*i/100));return`#${s.toString(16).padStart(2,"0")}${f.toString(16).padStart(2,"0")}${c.toString(16).padStart(2,"0")}`}function gt(){let e=m(""),i=m(null),s=m(null),f=m(!1),c=m(w([]));const E={};let h=m(w([])),U=m(!1),P=m(null),g=m(w({})),R=w({}),A=w({}),T=w({}),F=m(0),x=m(null),C=m(""),$=null,S=m(0),b=m(0),J=m("alpha");async function W(){u(U,!0),u(P,null),u(S,0),u(b,0);try{const[t,n,r]=await Promise.all([D(),dt().catch(()=>[]),at().catch(()=>({name:""}))]);u(h,n,!0),u(e,r.name,!0),u(i,r.about??null,!0),u(s,r.accent_color??null,!0),u(f,!0),v(o(s)),u(c,t.map(a=>({name:a.name,displayName:_(a.name,a.display_name),type:a.type,private:a.private,sync:a.sync,count:null,entities:[],loading:!1,loaded:!1})),!0),await Promise.all(o(c).map(a=>I(a.name)))}catch(t){u(P,t.message,!0)}finally{u(U,!1)}}function V(t,n,r){const a=o(c).find(l=>l.name===t);a&&(a.entities=a.entities.filter(l=>!(l.id===r&&l.entityType===n)),a.count=a.entities.length)}async function Q(t){o(c).find(r=>r.name===t)&&await I(t,!0)}async function B(){u(S,0),u(b,0),await Promise.all(o(c).map(t=>I(t.name,!0)))}async function I(t,n=!1){const r=o(c).find(l=>l.name===t);if(!r||r.loading||!n&&r.loaded)return;const a=(E[t]??0)+1;E[t]=a,n||(r.loading=!0);try{const l=await pt(t);if(E[t]!==a)return;let y=0,L=0;for(const p of l)y+=p.document?.wikilinks?.length??0,L+=p.subContentCount??0;u(S,o(S)+y),u(b,o(b)+L);const O=new Set(["name","created_at","updated_at"]);r.entities=l.filter(p=>!p.id.toLowerCase().startsWith("readme")).map(p=>({id:p.id,title:p.data?.name??ft(p.id),entityType:p.entityType,repo:t,hasSubContent:!!p.hasSubContent,wikilinks:p.document?.wikilinks??[],createdAt:p.data?.created_at??null,updatedAt:p.data?.updated_at??null,fields:Object.fromEntries(Object.entries(p.data??{}).filter(([M])=>!O.has(M))),status:p.data?.status??void 0,priority:p.data?.priority??void 0,assignee:p.data?.assignee??void 0,dueDate:p.data?.due_date??void 0})).sort((p,M)=>p.title.localeCompare(M.title)),r.count=r.entities.length,r.loaded=!0}catch(l){console.error(`Failed to load entities for ${t}:`,l)}finally{r.loading=!1}}function K(t){o(g)[t]=!o(g)[t]}function q(t){return o(g)[t]??!1}function k(t,n,r){return`${t}/${n}/${r}`}function H(t,n,r){const a=k(t,n,r),l=R[a]??!1;R[a]=!l,!l&&!A[a]?.loaded&&z(t,n,r)}function N(t,n,r){return R[k(t,n,r)]??!1}function Y(t,n,r){return A[k(t,n,r)]??{entries:[],loading:!1,loaded:!1}}async function z(t,n,r){const a=k(t,n,r);A[a]={entries:[],loading:!1,loaded:!0}}function G(t){const n=o(C).trim().toLowerCase();if(!n)return t;const r=[];for(const a of t){const l=a.entities.filter(y=>y.title.toLowerCase().includes(n)||y.id.toLowerCase().includes(n));l.length>0&&r.push({...a,entities:l,count:l.length})}return r}function X(t){if(t&&!o(C)?$={...o(g)}:!t&&o(C)&&$&&(u(g,$,!0),$=null),u(C,t,!0),t){const n=t.trim().toLowerCase();for(const r of o(c)){const a=r.entities.some(l=>l.title.toLowerCase().includes(n)||l.id.toLowerCase().includes(n));o(g)[r.name]=a}}}function Z(t){const n=t.startsWith("type:");T[t]=!(T[t]??n)}function tt(t){return T[t]??!1}function et(t){return T[t]===!1}const nt=it(()=>o(c).reduce((t,n)=>t+(n.count??0),0));function ot(t){return o(h).find(n=>n.entityTypes.includes(t))}function rt(t){v(t||o(s))}return{get name(){return o(e)},get about(){return o(i)},get accentColor(){return o(s)},get nameLoaded(){return o(f)},async updateWorkspace(t){t.accent_color!==void 0&&(u(s,t.accent_color,!0),v(t.accent_color)),await st(t),t.name?.trim()&&u(e,t.name.trim(),!0),typeof t.about=="string"&&u(i,t.about,!0)},get repos(){return o(c)},get apps(){return o(h)},get loading(){return o(U)},get error(){return o(P)},get totalEntities(){return o(nt)},get totalLinks(){return o(S)},get totalFiles(){return o(b)},get hasTasks(){return o(c).some(t=>t.entities.some(n=>n.entityType==="task"))},get sortedRepos(){const t=[...o(c)].sort((n,r)=>n.name.localeCompare(r.name));return G(t)},get filteredIds(){const t=o(C).trim().toLowerCase();if(!t)return null;const n=new Set;for(const r of o(c))for(const a of r.entities)(a.title.toLowerCase().includes(t)||a.id.toLowerCase().includes(t))&&n.add(a.id);return n},get filterQuery(){return o(C)},setFilterQuery:X,get sortMode(){return o(J)},set sortMode(t){u(J,t,!0)},get recentEntities(){const t=o(C).trim().toLowerCase();let n=[];for(const r of o(c))for(const a of r.entities)t&&!a.title.toLowerCase().includes(t)&&!a.id.toLowerCase().includes(t)||n.push(a);return n.sort((r,a)=>{const l=r.updatedAt??"";return(a.updatedAt??"").localeCompare(l)})},get sidebarScrollTop(){return o(F)},set sidebarScrollTop(t){u(F,t,!0)},get lastAutoExpandedFor(){return o(x)},set lastAutoExpandedFor(t){u(x,t,!0)},load:W,loadEntities:I,removeEntity:V,refreshEntities:Q,refreshAll:B,toggleRepo:K,isExpanded:q,toggleEntity:H,isEntityExpanded:N,getEntityContents:Y,toggleFolder:Z,isFolderExpanded:tt,isFolderCollapsed:et,applyUserAccentColor:rt,applyAccentColor:v,getAppForEntityType:ot,async renameCollectionTo(t,n,r){await lt(t,n,r);const a=o(c).find(l=>l.name===t);a&&(a.name=n,a.displayName=r||_(n),o(g)[t]&&(o(g)[n]=!0,delete o(g)[t]))},async removeCollection(t){await ut(t),u(c,o(c).filter(n=>n.name!==t),!0),delete o(g)[t]},async addCollection(t,n,r,a){await ct(t,n,r,a);const l=await D();u(c,l.map(y=>o(c).find(O=>O.name===y.name)??{name:y.name,displayName:_(y.name,y.display_name),type:y.type,private:y.private,count:null,entities:[],loading:!1,loaded:!1}),!0),o(g)[t]=!0,await I(t)}}}const _t=gt();export{Mt as a,kt as b,At as c,Ot as d,Ut as e,Rt as f,vt as g,Et as h,It as i,wt as j,Tt as k,bt as l,St as m,Pt as s,$t as t,Lt as u,_t as w};
@@ -1 +1 @@
1
- import{g as t,s as e,e as u}from"./sZJoCX5N.js";import{a as p}from"./DvmL5xMZ.js";function E(){let l=u(null),i=u(null),r=u(null),o=u(null),s=u("entity"),f=u(null),g=u(null),d=u("preferences"),h=u(!1);function v(n,c){t(l)&&(t(l)!==n||t(r)!==c)&&p(t(l)).catch(()=>{})}function w(n,c,a,V){v(n,a),e(l,n,!0),e(i,c,!0),e(r,a,!0),e(o,V??null,!0)}function y(){e(s,"entity")}function b(){e(s,"graph")}function I(n){e(s,"view"),e(f,n,!0)}function S(){e(s,"settings"),e(d,"preferences")}function m(n,c,a){t(r)===a&&t(l)===n?(e(l,null),e(i,null),e(r,null)):(e(l,n,!0),e(i,c,!0),e(r,a,!0)),e(o,null)}function T(){t(l)&&p(t(l)).catch(()=>{}),e(l,null),e(i,null),e(r,null),e(o,null)}return{get selectedRepo(){return t(l)},get selectedType(){return t(i)},get selectedId(){return t(r)},get selectedSubPath(){return t(o)},get activeView(){return t(s)},get entityPath(){return t(l)&&t(i)&&t(r)?`/${t(l)}/${t(i)}/${t(r)}`:null},get hoveredEntityId(){return t(g)},set hoveredEntityId(n){e(g,n,!0)},get settingsTab(){return t(d)},set settingsTab(n){e(d,n,!0)},get hideSidebar(){return t(h)},set hideSidebar(n){e(h,n,!0)},select:w,deselect:T,selectOnGraph:m,showEntity:y,showGraph:b,get activeViewId(){return t(f)},showView:I,showSettings:S}}const $=E();export{$ as n};
1
+ import{g as t,s as e,e as u}from"./BenpwI6m.js";import{a as p}from"./BjAmYrTY.js";function E(){let l=u(null),i=u(null),r=u(null),o=u(null),s=u("entity"),f=u(null),g=u(null),d=u("preferences"),h=u(!1);function v(n,c){t(l)&&(t(l)!==n||t(r)!==c)&&p(t(l)).catch(()=>{})}function w(n,c,a,V){v(n,a),e(l,n,!0),e(i,c,!0),e(r,a,!0),e(o,V??null,!0)}function y(){e(s,"entity")}function b(){e(s,"graph")}function I(n){e(s,"view"),e(f,n,!0)}function S(){e(s,"settings"),e(d,"preferences")}function m(n,c,a){t(r)===a&&t(l)===n?(e(l,null),e(i,null),e(r,null)):(e(l,n,!0),e(i,c,!0),e(r,a,!0)),e(o,null)}function T(){t(l)&&p(t(l)).catch(()=>{}),e(l,null),e(i,null),e(r,null),e(o,null)}return{get selectedRepo(){return t(l)},get selectedType(){return t(i)},get selectedId(){return t(r)},get selectedSubPath(){return t(o)},get activeView(){return t(s)},get entityPath(){return t(l)&&t(i)&&t(r)?`/${t(l)}/${t(i)}/${t(r)}`:null},get hoveredEntityId(){return t(g)},set hoveredEntityId(n){e(g,n,!0)},get settingsTab(){return t(d)},set settingsTab(n){e(d,n,!0)},get hideSidebar(){return t(h)},set hideSidebar(n){e(h,n,!0)},select:w,deselect:T,selectOnGraph:m,showEntity:y,showGraph:b,get activeViewId(){return t(f)},showView:I,showSettings:S}}const $=E();export{$ as n};
@@ -1 +1 @@
1
- import{e as i,f as y,g as r,s as n}from"./sZJoCX5N.js";import{g as l}from"./B95ZQgm6.js";import{d as v,u as V,c as F,f as h}from"./DvmL5xMZ.js";const d={selectedType:null,groupBy:null,sortKey:"name",sortAsc:!0,filters:{text:{},enum:{},date:{}}};function x(){let a=i(y([])),o=i(null),c=i(!1);async function w(){try{n(a,await h(),!0),n(c,!0)}catch(e){console.error("Failed to load views:",e)}}async function f(e,t="list"){const s=t==="calendar"?{...d,calendar:{dateField:"due_date",year:new Date().getFullYear(),month:new Date().getMonth()+1}}:d,u=await F(e,s,t);return n(a,[...r(a),u],!0),u}async function g(e,t){await V(e,t),n(a,r(a).map(s=>s.id===e?{...s,...t}:s),!0)}async function m(e){if(await v(e),n(a,r(a).filter(t=>t.id!==e),!0),r(o)===e){const t=r(a)[0];t?(n(o,t.id,!0),l(`/views/${t.id}`,{replaceState:!0})):(n(o,null),l("/",{replaceState:!0}))}}function p(e){n(o,e,!0)}return{get views(){return r(a)},get activeViewId(){return r(o)},get loaded(){return r(c)},load:w,create:f,update:g,remove:m,setActive:p}}const D=x();export{D as v};
1
+ import{e as i,f as y,g as r,s as n}from"./BenpwI6m.js";import{g as l}from"./DQBH1xkO.js";import{d as v,u as V,c as F,f as h}from"./BjAmYrTY.js";const d={selectedType:null,groupBy:null,sortKey:"name",sortAsc:!0,filters:{text:{},enum:{},date:{}}};function x(){let a=i(y([])),o=i(null),c=i(!1);async function w(){try{n(a,await h(),!0),n(c,!0)}catch(e){console.error("Failed to load views:",e)}}async function f(e,t="list"){const s=t==="calendar"?{...d,calendar:{dateField:"due_date",year:new Date().getFullYear(),month:new Date().getMonth()+1}}:d,u=await F(e,s,t);return n(a,[...r(a),u],!0),u}async function g(e,t){await V(e,t),n(a,r(a).map(s=>s.id===e?{...s,...t}:s),!0)}async function m(e){if(await v(e),n(a,r(a).filter(t=>t.id!==e),!0),r(o)===e){const t=r(a)[0];t?(n(o,t.id,!0),l(`/views/${t.id}`,{replaceState:!0})):(n(o,null),l("/",{replaceState:!0}))}}function p(e){n(o,e,!0)}return{get views(){return r(a)},get activeViewId(){return r(o)},get loaded(){return r(c)},load:w,create:f,update:g,remove:m,setActive:p}}const D=x();export{D as v};
@@ -1 +1 @@
1
- import{a as c,s as M,f as h}from"./BdF6nRVd.js";import{i as A}from"./faGDeGnG.js";import{p as C,l as v,s as u,d as n,g as r,a as B,c as p,n as N,r as m,b as P,m as g,t as R}from"./sZJoCX5N.js";import{i as Y}from"./BSSN_IAc.js";import{a as k}from"./BKUmpdNY.js";import{l as _,p as b}from"./DNrFMx27.js";var L=h("<title> </title>"),j=h('<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 K(x,t){const e=_(t,["children","$$slots","$$events","$$legacy"]),w=_(e,["size","title"]);C(t,!1);const a=g(),d=g();let f=b(t,"size",8,16),i=b(t,"title",8,void 0);v(()=>(n(e),n(i())),()=>{u(a,e["aria-label"]||e["aria-labelledby"]||i())}),v(()=>(r(a),n(e)),()=>{u(d,{"aria-hidden":r(a)?void 0:!0,role:r(a)?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})}),B(),A();var s=j();k(s,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:f(),height:f(),...r(d),...w}));var z=p(s);{var $=l=>{var o=L(),y=p(o,!0);m(o),R(()=>M(y,i())),c(l,o)};Y(z,l=>{i()&&l($)})}N(),m(s),c(x,s),P()}var q=h("<title> </title>"),D=h('<svg><!><path d="M17 15 17 5 15 5 15 15 5 15 5 17 15 17 15 27 17 27 17 17 27 17 27 15 17 15z"></path></svg>');function O(x,t){const e=_(t,["children","$$slots","$$events","$$legacy"]),w=_(e,["size","title"]);C(t,!1);const a=g(),d=g();let f=b(t,"size",8,16),i=b(t,"title",8,void 0);v(()=>(n(e),n(i())),()=>{u(a,e["aria-label"]||e["aria-labelledby"]||i())}),v(()=>(r(a),n(e)),()=>{u(d,{"aria-hidden":r(a)?void 0:!0,role:r(a)?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})}),B(),A();var s=D();k(s,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:f(),height:f(),...r(d),...w}));var z=p(s);{var $=l=>{var o=q(),y=p(o,!0);m(o),R(()=>M(y,i())),c(l,o)};Y(z,l=>{i()&&l($)})}N(),m(s),c(x,s),P()}export{O as A,K as C};
1
+ import{a as c,s as M,f as h}from"./COik51fd.js";import{i as A}from"./BSBiehHY.js";import{p as C,l as v,s as u,d as n,g as r,a as B,c as p,n as N,r as m,b as P,m as g,t as R}from"./BenpwI6m.js";import{i as Y}from"./Dvv4bkXH.js";import{a as k}from"./CStpN6HQ.js";import{l as _,p as b}from"./wWaI7EIw.js";var L=h("<title> </title>"),j=h('<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 K(x,t){const e=_(t,["children","$$slots","$$events","$$legacy"]),w=_(e,["size","title"]);C(t,!1);const a=g(),d=g();let f=b(t,"size",8,16),i=b(t,"title",8,void 0);v(()=>(n(e),n(i())),()=>{u(a,e["aria-label"]||e["aria-labelledby"]||i())}),v(()=>(r(a),n(e)),()=>{u(d,{"aria-hidden":r(a)?void 0:!0,role:r(a)?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})}),B(),A();var s=j();k(s,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:f(),height:f(),...r(d),...w}));var z=p(s);{var $=l=>{var o=L(),y=p(o,!0);m(o),R(()=>M(y,i())),c(l,o)};Y(z,l=>{i()&&l($)})}N(),m(s),c(x,s),P()}var q=h("<title> </title>"),D=h('<svg><!><path d="M17 15 17 5 15 5 15 15 5 15 5 17 15 17 15 27 17 27 17 17 27 17 27 15 17 15z"></path></svg>');function O(x,t){const e=_(t,["children","$$slots","$$events","$$legacy"]),w=_(e,["size","title"]);C(t,!1);const a=g(),d=g();let f=b(t,"size",8,16),i=b(t,"title",8,void 0);v(()=>(n(e),n(i())),()=>{u(a,e["aria-label"]||e["aria-labelledby"]||i())}),v(()=>(r(a),n(e)),()=>{u(d,{"aria-hidden":r(a)?void 0:!0,role:r(a)?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})}),B(),A();var s=D();k(s,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:f(),height:f(),...r(d),...w}));var z=p(s);{var $=l=>{var o=q(),y=p(o,!0);m(o),R(()=>M(y,i())),c(l,o)};Y(z,l=>{i()&&l($)})}N(),m(s),c(x,s),P()}export{O as A,K as C};
@@ -1,2 +1,2 @@
1
- import{aX as ae,g as K,aB as oe,a7 as le,aY as q,S as N,N as Q,x as l,j as _,an as b,aZ as z,i as ue,q as H,H as fe,a_ as U,D as m,h as R,a$ as I,Q as C,az as ce,b0 as X,b1 as de,b2 as G,b3 as he,b4 as _e,ay as M,b5 as O,b6 as Z,b7 as pe,b8 as ee,a5 as te,z as ve,W as F,k as S,n as ge,v as be,b9 as D,Y as me,$ as ye,ba as Ee,bb as Te,ah as we,bc as Ne,ai as Re,bd as Se,o as A,be as Ae,bf as De,bg as ke,bh as Le,bi as Me,bj as Oe,C as B,bk as P,Z as xe,X as Ie,bl as V,w as k,bm as Ce,V as Fe,bn as Pe,K as Ve,p as We,y as Ye,bo as $e,b as He}from"./sZJoCX5N.js";function Be(t){let e=0,r=Q(0),s;return()=>{ae()&&(K(r),oe(()=>(e===0&&(s=le(()=>t(()=>q(r)))),e+=1,()=>{N(()=>{e-=1,e===0&&(s?.(),s=void 0,q(r))})})))}}var je=me|ye;function qe(t,e,r,s){new ze(t,e,r,s)}class ze{parent;is_pending=!1;transform_error;#t;#v=_?l:null;#s;#u;#e;#i=null;#r=null;#n=null;#a=null;#f=0;#l=0;#c=!1;#d=new Set;#h=new Set;#o=null;#m=Be(()=>(this.#o=Q(this.#f),()=>{this.#o=null}));constructor(e,r,s,i){this.#t=e,this.#s=r,this.#u=n=>{var a=b;a.b=this,a.f|=z,s(n)},this.parent=b.b,this.transform_error=i??this.parent?.transform_error??(n=>n),this.#e=ue(()=>{if(_){const n=this.#v;H();const a=n.data===fe;if(n.data.startsWith(U)){const o=JSON.parse(n.data.slice(U.length));this.#E(o)}else a?this.#T():this.#y()}else this.#g()},je),_&&(this.#t=l)}#y(){try{this.#i=m(()=>this.#u(this.#t))}catch(e){this.error(e)}}#E(e){const r=this.#s.failed;r&&(this.#n=m(()=>{r(this.#t,()=>e,()=>()=>{})}))}#T(){const e=this.#s.pending;e&&(this.is_pending=!0,this.#r=m(()=>e(this.#t)),N(()=>{var r=this.#a=document.createDocumentFragment(),s=R();r.append(s),this.#i=this.#p(()=>(I.ensure(),m(()=>this.#u(s)))),this.#l===0&&(this.#t.before(r),this.#a=null,C(this.#r,()=>{this.#r=null}),this.#_())}))}#g(){try{if(this.is_pending=this.has_pending_snippet(),this.#l=0,this.#f=0,this.#i=m(()=>{this.#u(this.#t)}),this.#l>0){var e=this.#a=document.createDocumentFragment();ce(this.#i,e);const r=this.#s.pending;this.#r=m(()=>r(this.#t))}else this.#_()}catch(r){this.error(r)}}#_(){this.is_pending=!1;for(const e of this.#d)X(e,de),G(e);for(const e of this.#h)X(e,he),G(e);this.#d.clear(),this.#h.clear()}defer_effect(e){_e(e,this.#d,this.#h)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#s.pending}#p(e){var r=b,s=ee,i=te;M(this.#e),O(this.#e),Z(this.#e.ctx);try{return e()}catch(n){return pe(n),null}finally{M(r),O(s),Z(i)}}#b(e){if(!this.has_pending_snippet()){this.parent&&this.parent.#b(e);return}this.#l+=e,this.#l===0&&(this.#_(),this.#r&&C(this.#r,()=>{this.#r=null}),this.#a&&(this.#t.before(this.#a),this.#a=null))}update_pending_count(e){this.#b(e),this.#f+=e,!(!this.#o||this.#c)&&(this.#c=!0,N(()=>{this.#c=!1,this.#o&&ve(this.#o,this.#f)}))}get_effect_pending(){return this.#m(),K(this.#o)}error(e){var r=this.#s.onerror;let s=this.#s.failed;if(!r&&!s)throw e;this.#i&&(F(this.#i),this.#i=null),this.#r&&(F(this.#r),this.#r=null),this.#n&&(F(this.#n),this.#n=null),_&&(S(this.#v),ge(),S(be()));var i=!1,n=!1;const a=()=>{if(i){Te();return}i=!0,n&&Ee(),this.#n!==null&&C(this.#n,()=>{this.#n=null}),this.#p(()=>{I.ensure(),this.#g()})},f=o=>{try{n=!0,r?.(o,a),n=!1}catch(u){D(u,this.#e&&this.#e.parent)}s&&(this.#n=this.#p(()=>{I.ensure();try{return m(()=>{var u=b;u.b=this,u.f|=z,s(this.#t,()=>o,()=>a)})}catch(u){return D(u,this.#e.parent),null}}))};N(()=>{var o;try{o=this.transform_error(e)}catch(u){D(u,this.#e&&this.#e.parent);return}o!==null&&typeof o=="object"&&typeof o.then=="function"?o.then(f,u=>D(u,this.#e&&this.#e.parent)):f(o)})}}function st(t){return t.endsWith("capture")&&t!=="gotpointercapture"&&t!=="lostpointercapture"}const Ue=["beforeinput","click","change","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"];function it(t){return Ue.includes(t)}const Xe={formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly",defaultvalue:"defaultValue",defaultchecked:"defaultChecked",srcobject:"srcObject",novalidate:"noValidate",allowfullscreen:"allowFullscreen",disablepictureinpicture:"disablePictureInPicture",disableremoteplayback:"disableRemotePlayback"};function at(t){return t=t.toLowerCase(),Xe[t]??t}const Ge=["touchstart","touchmove"];function Ze(t){return Ge.includes(t)}const Je=["textarea","script","style","title"];function ot(t){return Je.includes(t)}const w=Symbol("events"),re=new Set,W=new Set;function ne(t,e,r,s={}){function i(n){if(s.capture||Y.call(e,n),!n.cancelBubble)return Ne(()=>r?.call(this,n))}return t.startsWith("pointer")||t.startsWith("touch")||t==="wheel"?N(()=>{e.addEventListener(t,i,s)}):e.addEventListener(t,i,s),i}function lt(t,e,r,s={}){var i=ne(e,t,r,s);return()=>{t.removeEventListener(e,i,s)}}function ut(t,e,r,s,i){var n={capture:s,passive:i},a=ne(t,e,r,n);(e===document.body||e===window||e===document||e instanceof HTMLMediaElement)&&we(()=>{e.removeEventListener(t,a,n)})}function ft(t,e,r){(e[w]??={})[t]=r}function ct(t){for(var e=0;e<t.length;e++)re.add(t[e]);for(var r of W)r(t)}let J=null;function Y(t){var e=this,r=e.ownerDocument,s=t.type,i=t.composedPath?.()||[],n=i[0]||t.target;J=t;var a=0,f=J===t&&t[w];if(f){var o=i.indexOf(f);if(o!==-1&&(e===document||e===window)){t[w]=e;return}var u=i.indexOf(e);if(u===-1)return;o<=u&&(a=o)}if(n=i[a]||t.target,n!==e){Re(t,"currentTarget",{configurable:!0,get(){return n||r}});var y=ee,T=b;O(null),M(null);try{for(var g,d=[];n!==null;){var c=n.assignedSlot||n.parentNode||n.host||null;try{var h=n[w]?.[s];h!=null&&(!n.disabled||t.target===n)&&h.call(n,t)}catch(p){g?d.push(p):g=p}if(t.cancelBubble||c===e||c===null)break;n=c}if(g){for(let p of d)queueMicrotask(()=>{throw p});throw g}}finally{t[w]=e,delete t.currentTarget,O(y),M(T)}}}const Ke=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:t=>t});function Qe(t){return Ke?.createHTML(t)??t}function se(t){var e=Se("template");return e.innerHTML=Qe(t.replaceAll("<!>","<!---->")),e.content}function v(t,e){var r=b;r.nodes===null&&(r.nodes={start:t,end:e,a:null,t:null})}function dt(t,e){var r=(e&De)!==0,s=(e&ke)!==0,i,n=!t.startsWith("<!>");return()=>{if(_)return v(l,null),l;i===void 0&&(i=se(n?t:"<!>"+t),r||(i=A(i)));var a=s||Ae?document.importNode(i,!0):i.cloneNode(!0);if(r){var f=A(a),o=a.lastChild;v(f,o)}else v(a,a);return a}}function et(t,e,r="svg"){var s=!t.startsWith("<!>"),i=`<${r}>${s?t:"<!>"+t}</${r}>`,n;return()=>{if(_)return v(l,null),l;if(!n){var a=se(i),f=A(a);n=A(f)}var o=n.cloneNode(!0);return v(o,o),o}}function ht(t,e){return et(t,e,"svg")}function _t(t=""){if(!_){var e=R(t+"");return v(e,e),e}var r=l;return r.nodeType!==Le?(r.before(r=R()),S(r)):Me(r),v(r,r),r}function pt(){if(_)return v(l,null),l;var t=document.createDocumentFragment(),e=document.createComment(""),r=R();return t.append(e,r),v(e,r),t}function vt(t,e){if(_){var r=b;((r.f&Oe)===0||r.nodes.end===null)&&(r.nodes.end=l),H();return}t!==null&&t.before(e)}function gt(){if(_&&l&&l.nodeType===B&&l.textContent?.startsWith("$")){const t=l.textContent.substring(1);return H(),t}return(window.__svelte??={}).uid??=1,`c${window.__svelte.uid++}`}function bt(t,e){var r=e==null?"":typeof e=="object"?`${e}`:e;r!==(t.__t??=t.nodeValue)&&(t.__t=r,t.nodeValue=`${r}`)}function tt(t,e){return ie(t,e)}function mt(t,e){P(),e.intro=e.intro??!1;const r=e.target,s=_,i=l;try{for(var n=A(r);n&&(n.nodeType!==B||n.data!==xe);)n=Ie(n);if(!n)throw V;k(!0),S(n);const a=ie(t,{...e,anchor:n});return k(!1),a}catch(a){if(a instanceof Error&&a.message.split(`
1
+ import{aY as ae,g as K,aB as oe,a7 as le,aZ as q,S as N,N as Q,x as l,j as _,an as b,a_ as z,i as ue,q as H,H as fe,a$ as U,D as m,h as R,b0 as I,Q as C,az as ce,b1 as X,b2 as de,b3 as G,b4 as he,b5 as _e,ay as M,b6 as O,b7 as Z,b8 as pe,b9 as ee,a5 as te,z as ve,W as F,k as S,n as ge,v as be,ba as D,Y as me,$ as ye,bb as Ee,bc as Te,ah as we,bd as Ne,ai as Re,be as Se,o as A,bf as Ae,bg as De,bh as ke,bi as Le,bj as Me,bk as Oe,C as B,bl as P,Z as xe,X as Ie,bm as V,w as k,bn as Ce,V as Fe,bo as Pe,K as Ve,p as We,y as Ye,bp as $e,b as He}from"./BenpwI6m.js";function Be(t){let e=0,r=Q(0),s;return()=>{ae()&&(K(r),oe(()=>(e===0&&(s=le(()=>t(()=>q(r)))),e+=1,()=>{N(()=>{e-=1,e===0&&(s?.(),s=void 0,q(r))})})))}}var je=me|ye;function qe(t,e,r,s){new ze(t,e,r,s)}class ze{parent;is_pending=!1;transform_error;#t;#v=_?l:null;#s;#u;#e;#i=null;#r=null;#n=null;#a=null;#f=0;#l=0;#c=!1;#d=new Set;#h=new Set;#o=null;#m=Be(()=>(this.#o=Q(this.#f),()=>{this.#o=null}));constructor(e,r,s,i){this.#t=e,this.#s=r,this.#u=n=>{var a=b;a.b=this,a.f|=z,s(n)},this.parent=b.b,this.transform_error=i??this.parent?.transform_error??(n=>n),this.#e=ue(()=>{if(_){const n=this.#v;H();const a=n.data===fe;if(n.data.startsWith(U)){const o=JSON.parse(n.data.slice(U.length));this.#E(o)}else a?this.#T():this.#y()}else this.#g()},je),_&&(this.#t=l)}#y(){try{this.#i=m(()=>this.#u(this.#t))}catch(e){this.error(e)}}#E(e){const r=this.#s.failed;r&&(this.#n=m(()=>{r(this.#t,()=>e,()=>()=>{})}))}#T(){const e=this.#s.pending;e&&(this.is_pending=!0,this.#r=m(()=>e(this.#t)),N(()=>{var r=this.#a=document.createDocumentFragment(),s=R();r.append(s),this.#i=this.#p(()=>(I.ensure(),m(()=>this.#u(s)))),this.#l===0&&(this.#t.before(r),this.#a=null,C(this.#r,()=>{this.#r=null}),this.#_())}))}#g(){try{if(this.is_pending=this.has_pending_snippet(),this.#l=0,this.#f=0,this.#i=m(()=>{this.#u(this.#t)}),this.#l>0){var e=this.#a=document.createDocumentFragment();ce(this.#i,e);const r=this.#s.pending;this.#r=m(()=>r(this.#t))}else this.#_()}catch(r){this.error(r)}}#_(){this.is_pending=!1;for(const e of this.#d)X(e,de),G(e);for(const e of this.#h)X(e,he),G(e);this.#d.clear(),this.#h.clear()}defer_effect(e){_e(e,this.#d,this.#h)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#s.pending}#p(e){var r=b,s=ee,i=te;M(this.#e),O(this.#e),Z(this.#e.ctx);try{return e()}catch(n){return pe(n),null}finally{M(r),O(s),Z(i)}}#b(e){if(!this.has_pending_snippet()){this.parent&&this.parent.#b(e);return}this.#l+=e,this.#l===0&&(this.#_(),this.#r&&C(this.#r,()=>{this.#r=null}),this.#a&&(this.#t.before(this.#a),this.#a=null))}update_pending_count(e){this.#b(e),this.#f+=e,!(!this.#o||this.#c)&&(this.#c=!0,N(()=>{this.#c=!1,this.#o&&ve(this.#o,this.#f)}))}get_effect_pending(){return this.#m(),K(this.#o)}error(e){var r=this.#s.onerror;let s=this.#s.failed;if(!r&&!s)throw e;this.#i&&(F(this.#i),this.#i=null),this.#r&&(F(this.#r),this.#r=null),this.#n&&(F(this.#n),this.#n=null),_&&(S(this.#v),ge(),S(be()));var i=!1,n=!1;const a=()=>{if(i){Te();return}i=!0,n&&Ee(),this.#n!==null&&C(this.#n,()=>{this.#n=null}),this.#p(()=>{I.ensure(),this.#g()})},f=o=>{try{n=!0,r?.(o,a),n=!1}catch(u){D(u,this.#e&&this.#e.parent)}s&&(this.#n=this.#p(()=>{I.ensure();try{return m(()=>{var u=b;u.b=this,u.f|=z,s(this.#t,()=>o,()=>a)})}catch(u){return D(u,this.#e.parent),null}}))};N(()=>{var o;try{o=this.transform_error(e)}catch(u){D(u,this.#e&&this.#e.parent);return}o!==null&&typeof o=="object"&&typeof o.then=="function"?o.then(f,u=>D(u,this.#e&&this.#e.parent)):f(o)})}}function st(t){return t.endsWith("capture")&&t!=="gotpointercapture"&&t!=="lostpointercapture"}const Ue=["beforeinput","click","change","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"];function it(t){return Ue.includes(t)}const Xe={formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly",defaultvalue:"defaultValue",defaultchecked:"defaultChecked",srcobject:"srcObject",novalidate:"noValidate",allowfullscreen:"allowFullscreen",disablepictureinpicture:"disablePictureInPicture",disableremoteplayback:"disableRemotePlayback"};function at(t){return t=t.toLowerCase(),Xe[t]??t}const Ge=["touchstart","touchmove"];function Ze(t){return Ge.includes(t)}const Je=["textarea","script","style","title"];function ot(t){return Je.includes(t)}const w=Symbol("events"),re=new Set,W=new Set;function ne(t,e,r,s={}){function i(n){if(s.capture||Y.call(e,n),!n.cancelBubble)return Ne(()=>r?.call(this,n))}return t.startsWith("pointer")||t.startsWith("touch")||t==="wheel"?N(()=>{e.addEventListener(t,i,s)}):e.addEventListener(t,i,s),i}function lt(t,e,r,s={}){var i=ne(e,t,r,s);return()=>{t.removeEventListener(e,i,s)}}function ut(t,e,r,s,i){var n={capture:s,passive:i},a=ne(t,e,r,n);(e===document.body||e===window||e===document||e instanceof HTMLMediaElement)&&we(()=>{e.removeEventListener(t,a,n)})}function ft(t,e,r){(e[w]??={})[t]=r}function ct(t){for(var e=0;e<t.length;e++)re.add(t[e]);for(var r of W)r(t)}let J=null;function Y(t){var e=this,r=e.ownerDocument,s=t.type,i=t.composedPath?.()||[],n=i[0]||t.target;J=t;var a=0,f=J===t&&t[w];if(f){var o=i.indexOf(f);if(o!==-1&&(e===document||e===window)){t[w]=e;return}var u=i.indexOf(e);if(u===-1)return;o<=u&&(a=o)}if(n=i[a]||t.target,n!==e){Re(t,"currentTarget",{configurable:!0,get(){return n||r}});var y=ee,T=b;O(null),M(null);try{for(var g,d=[];n!==null;){var c=n.assignedSlot||n.parentNode||n.host||null;try{var h=n[w]?.[s];h!=null&&(!n.disabled||t.target===n)&&h.call(n,t)}catch(p){g?d.push(p):g=p}if(t.cancelBubble||c===e||c===null)break;n=c}if(g){for(let p of d)queueMicrotask(()=>{throw p});throw g}}finally{t[w]=e,delete t.currentTarget,O(y),M(T)}}}const Ke=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:t=>t});function Qe(t){return Ke?.createHTML(t)??t}function se(t){var e=Se("template");return e.innerHTML=Qe(t.replaceAll("<!>","<!---->")),e.content}function v(t,e){var r=b;r.nodes===null&&(r.nodes={start:t,end:e,a:null,t:null})}function dt(t,e){var r=(e&De)!==0,s=(e&ke)!==0,i,n=!t.startsWith("<!>");return()=>{if(_)return v(l,null),l;i===void 0&&(i=se(n?t:"<!>"+t),r||(i=A(i)));var a=s||Ae?document.importNode(i,!0):i.cloneNode(!0);if(r){var f=A(a),o=a.lastChild;v(f,o)}else v(a,a);return a}}function et(t,e,r="svg"){var s=!t.startsWith("<!>"),i=`<${r}>${s?t:"<!>"+t}</${r}>`,n;return()=>{if(_)return v(l,null),l;if(!n){var a=se(i),f=A(a);n=A(f)}var o=n.cloneNode(!0);return v(o,o),o}}function ht(t,e){return et(t,e,"svg")}function _t(t=""){if(!_){var e=R(t+"");return v(e,e),e}var r=l;return r.nodeType!==Le?(r.before(r=R()),S(r)):Me(r),v(r,r),r}function pt(){if(_)return v(l,null),l;var t=document.createDocumentFragment(),e=document.createComment(""),r=R();return t.append(e,r),v(e,r),t}function vt(t,e){if(_){var r=b;((r.f&Oe)===0||r.nodes.end===null)&&(r.nodes.end=l),H();return}t!==null&&t.before(e)}function gt(){if(_&&l&&l.nodeType===B&&l.textContent?.startsWith("$")){const t=l.textContent.substring(1);return H(),t}return(window.__svelte??={}).uid??=1,`c${window.__svelte.uid++}`}function bt(t,e){var r=e==null?"":typeof e=="object"?`${e}`:e;r!==(t.__t??=t.nodeValue)&&(t.__t=r,t.nodeValue=`${r}`)}function tt(t,e){return ie(t,e)}function mt(t,e){P(),e.intro=e.intro??!1;const r=e.target,s=_,i=l;try{for(var n=A(r);n&&(n.nodeType!==B||n.data!==xe);)n=Ie(n);if(!n)throw V;k(!0),S(n);const a=ie(t,{...e,anchor:n});return k(!1),a}catch(a){if(a instanceof Error&&a.message.split(`
2
2
  `).some(f=>f.startsWith("https://svelte.dev/e/")))throw a;return a!==V&&console.warn("Failed to hydrate: ",a),e.recover===!1&&Ce(),P(),Fe(r),k(!1),tt(t,e)}finally{k(s),S(i)}}const L=new Map;function ie(t,{target:e,anchor:r,props:s={},events:i,context:n,intro:a=!0,transformError:f}){P();var o=void 0,u=Pe(()=>{var y=r??e.appendChild(R());qe(y,{pending:()=>{}},d=>{We({});var c=te;if(n&&(c.c=n),i&&(s.$$events=i),_&&v(d,null),o=t(d,s)||{},_&&(b.nodes.end=l,l===null||l.nodeType!==B||l.data!==Ye))throw $e(),V;He()},f);var T=new Set,g=d=>{for(var c=0;c<d.length;c++){var h=d[c];if(!T.has(h)){T.add(h);var p=Ze(h);for(const x of[e,document]){var E=L.get(x);E===void 0&&(E=new Map,L.set(x,E));var j=E.get(h);j===void 0?(x.addEventListener(h,Y,{passive:p}),E.set(h,1)):E.set(h,j+1)}}}};return g(Ve(re)),W.add(g),()=>{for(var d of T)for(const p of[e,document]){var c=L.get(p),h=c.get(d);--h==0?(p.removeEventListener(d,Y),c.delete(d),c.size===0&&L.delete(p)):c.set(d,h)}W.delete(g),y!==r&&y.parentNode?.removeChild(y)}});return $.set(o,u),o}let $=new WeakMap;function yt(t,e){const r=$.get(t);return r?($.delete(t),r(e)):Promise.resolve()}const rt="5";typeof window<"u"&&((window.__svelte??={}).v??=new Set).add(rt);export{vt as a,dt as b,pt as c,ct as d,ft as e,ht as f,ut as g,mt as h,st as i,ne as j,it as k,Be as l,tt as m,at as n,lt as o,gt as p,v as q,ot as r,bt as s,_t as t,yt as u};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./CO5wfegi.js","./sZJoCX5N.js","./DvmL5xMZ.js","./OZfYVFGq.js"])))=>i.map(i=>d[i]);
2
- import{_ as G}from"./PPVm8Dsz.js";import{aW as Y,a1 as C,aV as q,e as S,f as P,g,s as c,a7 as D,a4 as z}from"./sZJoCX5N.js";import{i as K}from"./B95ZQgm6.js";import{i as H,w as h}from"./DvmL5xMZ.js";import{a as Q}from"./BtBweNkk.js";import{n as $}from"./CkIXD8Ce.js";import{l as X,o as N}from"./BdF6nRVd.js";function Ct(...t){return t.filter(Boolean).join(" ")}const Z=typeof document<"u",v=typeof window<"u"?window:void 0;function tt(t){let e=t.activeElement;for(;e?.shadowRoot;){const s=e.shadowRoot.activeElement;if(s===e)break;e=s}return e}class et{#e;#t;constructor(e={}){const{window:s=v,document:i=s?.document}=e;s!==void 0&&(this.#e=i,this.#t=X(n=>{const r=N(s,"focusin",n),o=N(s,"focusout",n);return()=>{r(),o()}}))}get current(){return this.#t?.(),this.#e?tt(this.#e):null}}new et;class st{#e;#t;constructor(e){this.#e=e,this.#t=Symbol(e)}get key(){return this.#t}exists(){return Y(this.#t)}get(){const e=C(this.#t);if(e===void 0)throw new Error(`Context "${this.#e}" not found`);return e}getOr(e){const s=C(this.#t);return s===void 0?e:s}set(e){return q(this.#t,e)}}const it=new st("<Toaster/>");let U=0;class nt{#e=S(P([]));get toasts(){return g(this.#e)}set toasts(e){c(this.#e,e,!0)}#t=S(P([]));get heights(){return g(this.#t)}set heights(e){c(this.#t,e,!0)}#s=e=>{const s=this.toasts.findIndex(i=>i.id===e);return s===-1?null:s};addToast=e=>{Z&&this.toasts.unshift(e)};updateToast=({id:e,data:s,type:i,message:n})=>{const r=this.toasts.findIndex(f=>f.id===e),o=this.toasts[r];this.toasts[r]={...o,...s,id:e,title:n,type:i,updated:!0}};create=e=>{const{message:s,...i}=e,n=typeof e?.id=="number"||e.id&&e.id?.length>0?e.id:U++,r=e.dismissible!==void 0?e.dismissible:e.dismissable!==void 0?e.dismissable:!0,o=e.type===void 0?"default":e.type;return D(()=>{this.toasts.find(E=>E.id===n)?this.updateToast({id:n,data:e,type:o,message:s,dismissible:r}):this.addToast({...i,id:n,title:s,dismissible:r,type:o})}),n};dismiss=e=>(D(()=>{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 n=e instanceof Promise?e:e();let r=i!==void 0;return n.then(o=>{if(typeof o=="object"&&o&&"ok"in o&&typeof o.ok=="boolean"&&!o.ok){r=!1;const f=rt(o);this.create({id:i,type:"error",message:f})}else if(s.success!==void 0){r=!1;const f=typeof s.success=="function"?s.success(o):s.success;this.create({id:i,type:"success",message:f})}}).catch(o=>{if(s.error!==void 0){r=!1;const f=typeof s.error=="function"?s.error(o):s.error;this.create({id:i,type:"error",message:f})}}).finally(()=>{r&&(this.dismiss(i),i=void 0),s.finally?.()}),i};custom=(e,s)=>{const i=s?.id||U++;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 rt(t){return t&&typeof t=="object"&&"status"in t?`HTTP error! Status: ${t.status}`:`Error! ${t}`}const d=new nt;function ot(t,e){return d.create({message:t,...e})}class Pt{#e=z(()=>d.toasts.filter(e=>!e.dismiss));get toasts(){return g(this.#e)}}function Dt(){return it.get()}const ct=ot,u=Object.assign(ct,{success:d.success,info:d.info,warning:d.warning,error:d.error,custom:d.custom,message:d.message,promise:d.promise,dismiss:d.dismiss,loading:d.loading,getActiveToasts:()=>d.toasts.filter(t=>!t.dismiss)}),at=800;function ut(){let t=S(!1),e=S(null),s=S(null),i=null,n=null,r=!1;function o(p,w,m,l){i&&i.repo===p&&i.type===w&&i.id===m?(l.data!==void 0&&(i.payload.data=l.data),l.content!==void 0&&(i.payload.content=l.content)):i={repo:p,type:w,id:m,payload:{...l}},f()}function f(){n&&clearTimeout(n),n=setTimeout(E,at)}async function E(){if(n=null,!r&&i){const{repo:p,type:w,id:m,payload:l}=i;i=null,r=!0,c(t,!0),c(s,null);try{if(await H(p,w,m,l),c(e,new Date,!0),l.data?.name){const b=h.repos.find(O=>O.name===p)?.entities.find(O=>O.id===m);b&&(b.title=l.data.name)}}catch(y){c(s,y.message??"Save failed",!0);const b=y.status??y.statusCode;(!b||b>=500)&&(i={repo:p,type:w,id:m,payload:l})}finally{c(t,!1),r=!1,i&&E()}}}function J(){n&&(clearTimeout(n),n=null),i&&E()}async function V(p,w,m,l){c(t,!0),c(s,null);try{const y=await H(p,w,m,l);return c(e,new Date,!0),y}catch(y){return c(s,y.message??"Save failed",!0),null}finally{c(t,!1)}}function L(){c(s,null),c(e,null),i=null,n&&(clearTimeout(n),n=null)}return{get saving(){return g(t)},get lastSaved(){return g(e)},get error(){return g(s)},get hasPending(){return!!(i||r)},scheduleAutoSave:o,flush:J,saveEntity:V,reset:L}}const lt=ut();let a=null,B=null,R=null,W=[],I=null,_=1e3,k=S(!1),F=S(null);const T=new Map,x={},A={};function j(t,e){T.delete(t);const s=e.entities.length,i=s===1?`${t} updated ${e.entities[0]}`:`${t} updated ${s} entities`;u(i)}function dt(t){for(const[e,s]of T)s.repo===t&&(clearTimeout(s.timer),T.delete(e))}function ft(t){const e=Q.user?.displayName;if(t.type==="sync_progress"){const s=x[t.repo];if(s){const i=t.message.trim(),n=i.match(/^Syncing from source:\s*(.+)$/i);n&&(A[t.repo]=`Syncing ${n[1].trim()}…`);const r=A[t.repo]??`Syncing ${t.repo}…`;u.loading(r,{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),$.selectedRepo===t.repo&&$.selectedType===t.entityType&&$.selectedId===t.entityId){lt.hasPending?u(`${t.actor} also saved changes to this entity`):K();return}const i=T.get(t.actor);if(i)clearTimeout(i.timer),i.entities.includes(t.entityId)||i.entities.push(t.entityId),i.timer=setTimeout(()=>j(t.actor,i),1e4);else{const n={entities:[t.entityId],repo:t.repo,timer:setTimeout(()=>j(t.actor,n),1e4)};T.set(t.actor,n)}return}if(t.type==="session_commit"){if(e&&t.actor===e){c(F,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}`;u(i),h.refreshEntities(t.repo);return}if(t.type==="sync_complete"){if(dt(t.repo),!x[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}`;u.success(i)}h.refreshEntities(t.repo);return}if(t.type==="collection_created"){u(`${t.actor} created collection ${t.repo}`),h.refreshEntities(t.repo);return}if(t.type==="collection_deleted"){u(`${t.actor} deleted collection ${t.repo}`);return}if(t.type==="repo_sync"){u(`${t.actor} pushed to ${t.repo}`),h.refreshEntities(t.repo);return}if(t.type==="presence"){B?.(t);return}if(t.type==="online"){R?.(t);return}if(t.type==="insights_updated"){G(()=>import("./CO5wfegi.js"),__vite__mapDeps([0,1,2,3]),import.meta.url).then(s=>s.insightsStore.load());return}if(t.type==="access_granted"||t.type==="access_revoked"){t.type==="access_revoked"&&$.selectedRepo===t.repo&&$.deselect(),h.load();return}}function M(){if(typeof window>"u"||a&&(a.readyState===WebSocket.OPEN||a.readyState===WebSocket.CONNECTING))return;const e=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`;a=new WebSocket(e),a.binaryType="arraybuffer",a.onopen=()=>{c(k,!0),_=1e3,h.refreshAll();for(const s of W)s()},a.onmessage=s=>{if(!(s.data instanceof ArrayBuffer))try{const i=JSON.parse(s.data);if(i?.type==="ping"){a?.send(JSON.stringify({type:"pong"}));return}const n=i;n.type&&n.type!=="toast"&&ft(n)}catch{}},a.onclose=()=>{c(k,!1),a=null,I=setTimeout(()=>{_=Math.min(_*2,1e4),M()},_)},a.onerror=()=>{}}function ht(){I&&(clearTimeout(I),I=null),a&&(a.close(),a=null),c(k,!1);for(const[,t]of T)clearTimeout(t.timer);T.clear()}function pt(t,e=4e3){u(t,{duration:e})}function mt(t,e){const s=crypto.randomUUID();return e?.loading?u.loading(t,{id:s,duration:36e5}):u(t,{id:s}),s}function yt(t,e,s){if(s?.loading){u.loading(e,{id:t});return}/failed|error/i.test(e)?u.error(e,{id:t,duration:s?.duration??6e3}):u.success(e,{id:t,duration:s?.duration??4e3})}function gt(t){const e=crypto.randomUUID();x[t]=e,u.loading(`Syncing ${t}…`,{id:e,duration:36e5})}function wt(t,e,s){const i=x[t];i&&(delete x[t],delete A[t],s?u.error(e,{id:i,duration:6e3}):u.success(e,{id:i,duration:4e3}))}function St(t){B=t}function Tt(t){R=t}function Et(t){W.push(t)}function bt(t){a?.readyState===WebSocket.OPEN&&a.send(JSON.stringify(t))}const Ht={get connected(){return g(k)},get lastAutoSaved(){return g(F)},get ws(){return a},connect:M,disconnect:ht,showToast:pt,showPersistentToast:mt,updateToast:yt,startSyncToast:gt,finishSyncToast:wt,send:bt,setPresenceHandler:St,setOnlineHandler:Tt,addConnectHandler:Et};export{Pt as S,d as a,Ct as c,lt as e,Ht as r,it as s,u as t,Dt as u};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./DC1nGnOD.js","./BenpwI6m.js","./BjAmYrTY.js","./CieeblIr.js"])))=>i.map(i=>d[i]);
2
+ import{_ as G}from"./PPVm8Dsz.js";import{aX as X,a1 as C,aW as Y,e as S,f as P,g,s as c,a7 as D,a4 as q}from"./BenpwI6m.js";import{i as z}from"./DQBH1xkO.js";import{i as H,w as h}from"./BjAmYrTY.js";import{a as K}from"./B0qTqRR8.js";import{n as $}from"./CDFdgZ9U.js";import{l as Q,o as N}from"./COik51fd.js";function Ct(...t){return t.filter(Boolean).join(" ")}const Z=typeof document<"u",v=typeof window<"u"?window:void 0;function tt(t){let e=t.activeElement;for(;e?.shadowRoot;){const s=e.shadowRoot.activeElement;if(s===e)break;e=s}return e}class et{#e;#t;constructor(e={}){const{window:s=v,document:i=s?.document}=e;s!==void 0&&(this.#e=i,this.#t=Q(n=>{const r=N(s,"focusin",n),o=N(s,"focusout",n);return()=>{r(),o()}}))}get current(){return this.#t?.(),this.#e?tt(this.#e):null}}new et;class st{#e;#t;constructor(e){this.#e=e,this.#t=Symbol(e)}get key(){return this.#t}exists(){return X(this.#t)}get(){const e=C(this.#t);if(e===void 0)throw new Error(`Context "${this.#e}" not found`);return e}getOr(e){const s=C(this.#t);return s===void 0?e:s}set(e){return Y(this.#t,e)}}const it=new st("<Toaster/>");let U=0;class nt{#e=S(P([]));get toasts(){return g(this.#e)}set toasts(e){c(this.#e,e,!0)}#t=S(P([]));get heights(){return g(this.#t)}set heights(e){c(this.#t,e,!0)}#s=e=>{const s=this.toasts.findIndex(i=>i.id===e);return s===-1?null:s};addToast=e=>{Z&&this.toasts.unshift(e)};updateToast=({id:e,data:s,type:i,message:n})=>{const r=this.toasts.findIndex(f=>f.id===e),o=this.toasts[r];this.toasts[r]={...o,...s,id:e,title:n,type:i,updated:!0}};create=e=>{const{message:s,...i}=e,n=typeof e?.id=="number"||e.id&&e.id?.length>0?e.id:U++,r=e.dismissible!==void 0?e.dismissible:e.dismissable!==void 0?e.dismissable:!0,o=e.type===void 0?"default":e.type;return D(()=>{this.toasts.find(E=>E.id===n)?this.updateToast({id:n,data:e,type:o,message:s,dismissible:r}):this.addToast({...i,id:n,title:s,dismissible:r,type:o})}),n};dismiss=e=>(D(()=>{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 n=e instanceof Promise?e:e();let r=i!==void 0;return n.then(o=>{if(typeof o=="object"&&o&&"ok"in o&&typeof o.ok=="boolean"&&!o.ok){r=!1;const f=rt(o);this.create({id:i,type:"error",message:f})}else if(s.success!==void 0){r=!1;const f=typeof s.success=="function"?s.success(o):s.success;this.create({id:i,type:"success",message:f})}}).catch(o=>{if(s.error!==void 0){r=!1;const f=typeof s.error=="function"?s.error(o):s.error;this.create({id:i,type:"error",message:f})}}).finally(()=>{r&&(this.dismiss(i),i=void 0),s.finally?.()}),i};custom=(e,s)=>{const i=s?.id||U++;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 rt(t){return t&&typeof t=="object"&&"status"in t?`HTTP error! Status: ${t.status}`:`Error! ${t}`}const d=new nt;function ot(t,e){return d.create({message:t,...e})}class Pt{#e=q(()=>d.toasts.filter(e=>!e.dismiss));get toasts(){return g(this.#e)}}function Dt(){return it.get()}const ct=ot,u=Object.assign(ct,{success:d.success,info:d.info,warning:d.warning,error:d.error,custom:d.custom,message:d.message,promise:d.promise,dismiss:d.dismiss,loading:d.loading,getActiveToasts:()=>d.toasts.filter(t=>!t.dismiss)}),at=800;function ut(){let t=S(!1),e=S(null),s=S(null),i=null,n=null,r=!1;function o(p,w,m,l){i&&i.repo===p&&i.type===w&&i.id===m?(l.data!==void 0&&(i.payload.data=l.data),l.content!==void 0&&(i.payload.content=l.content)):i={repo:p,type:w,id:m,payload:{...l}},f()}function f(){n&&clearTimeout(n),n=setTimeout(E,at)}async function E(){if(n=null,!r&&i){const{repo:p,type:w,id:m,payload:l}=i;i=null,r=!0,c(t,!0),c(s,null);try{if(await H(p,w,m,l),c(e,new Date,!0),l.data?.name){const b=h.repos.find(O=>O.name===p)?.entities.find(O=>O.id===m);b&&(b.title=l.data.name)}}catch(y){c(s,y.message??"Save failed",!0);const b=y.status??y.statusCode;(!b||b>=500)&&(i={repo:p,type:w,id:m,payload:l})}finally{c(t,!1),r=!1,i&&E()}}}function J(){n&&(clearTimeout(n),n=null),i&&E()}async function L(p,w,m,l){c(t,!0),c(s,null);try{const y=await H(p,w,m,l);return c(e,new Date,!0),y}catch(y){return c(s,y.message??"Save failed",!0),null}finally{c(t,!1)}}function V(){c(s,null),c(e,null),i=null,n&&(clearTimeout(n),n=null)}return{get saving(){return g(t)},get lastSaved(){return g(e)},get error(){return g(s)},get hasPending(){return!!(i||r)},scheduleAutoSave:o,flush:J,saveEntity:L,reset:V}}const lt=ut();let a=null,B=null,R=null,W=[],I=null,_=1e3,k=S(!1),F=S(null);const T=new Map,x={},A={};function j(t,e){T.delete(t);const s=e.entities.length,i=s===1?`${t} updated ${e.entities[0]}`:`${t} updated ${s} entities`;u(i)}function dt(t){for(const[e,s]of T)s.repo===t&&(clearTimeout(s.timer),T.delete(e))}function ft(t){const e=K.user?.displayName;if(t.type==="sync_progress"){const s=x[t.repo];if(s){const i=t.message.trim(),n=i.match(/^Syncing from source:\s*(.+)$/i);n&&(A[t.repo]=`Syncing ${n[1].trim()}…`);const r=A[t.repo]??`Syncing ${t.repo}…`;u.loading(r,{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),$.selectedRepo===t.repo&&$.selectedType===t.entityType&&$.selectedId===t.entityId){lt.hasPending?u(`${t.actor} also saved changes to this entity`):z();return}const i=T.get(t.actor);if(i)clearTimeout(i.timer),i.entities.includes(t.entityId)||i.entities.push(t.entityId),i.timer=setTimeout(()=>j(t.actor,i),1e4);else{const n={entities:[t.entityId],repo:t.repo,timer:setTimeout(()=>j(t.actor,n),1e4)};T.set(t.actor,n)}return}if(t.type==="session_commit"){if(e&&t.actor===e){c(F,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}`;u(i),h.refreshEntities(t.repo);return}if(t.type==="sync_complete"){if(dt(t.repo),!x[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}`;u.success(i)}h.refreshEntities(t.repo);return}if(t.type==="collection_created"){u(`${t.actor} created collection ${t.repo}`),h.refreshEntities(t.repo);return}if(t.type==="collection_deleted"){u(`${t.actor} deleted collection ${t.repo}`);return}if(t.type==="repo_sync"){u(`${t.actor} pushed to ${t.repo}`),h.refreshEntities(t.repo);return}if(t.type==="presence"){B?.(t);return}if(t.type==="online"){R?.(t);return}if(t.type==="insights_updated"){G(()=>import("./DC1nGnOD.js"),__vite__mapDeps([0,1,2,3]),import.meta.url).then(s=>s.insightsStore.load());return}if(t.type==="access_granted"||t.type==="access_revoked"){t.type==="access_revoked"&&$.selectedRepo===t.repo&&$.deselect(),h.load();return}}function M(){if(typeof window>"u"||a&&(a.readyState===WebSocket.OPEN||a.readyState===WebSocket.CONNECTING))return;const e=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`;a=new WebSocket(e),a.binaryType="arraybuffer",a.onopen=()=>{c(k,!0),_=1e3,h.refreshAll();for(const s of W)s()},a.onmessage=s=>{if(!(s.data instanceof ArrayBuffer))try{const i=JSON.parse(s.data);if(i?.type==="ping"){a?.send(JSON.stringify({type:"pong"}));return}const n=i;n.type&&n.type!=="toast"&&ft(n)}catch{}},a.onclose=()=>{c(k,!1),a=null,I=setTimeout(()=>{_=Math.min(_*2,1e4),M()},_)},a.onerror=()=>{}}function ht(){I&&(clearTimeout(I),I=null),a&&(a.close(),a=null),c(k,!1);for(const[,t]of T)clearTimeout(t.timer);T.clear()}function pt(t,e=4e3){u(t,{duration:e})}function mt(t,e){const s=crypto.randomUUID();return e?.loading?u.loading(t,{id:s,duration:36e5}):u(t,{id:s}),s}function yt(t,e,s){if(s?.loading){u.loading(e,{id:t});return}/failed|error/i.test(e)?u.error(e,{id:t,duration:s?.duration??6e3}):u.success(e,{id:t,duration:s?.duration??4e3})}function gt(t){const e=crypto.randomUUID();x[t]=e,u.loading(`Syncing ${t}…`,{id:e,duration:36e5})}function wt(t,e,s){const i=x[t];i&&(delete x[t],delete A[t],s?u.error(e,{id:i,duration:6e3}):u.success(e,{id:i,duration:4e3}))}function St(t){B=t}function Tt(t){R=t}function Et(t){W.push(t)}function bt(t){a?.readyState===WebSocket.OPEN&&a.send(JSON.stringify(t))}const Ht={get connected(){return g(k)},get lastAutoSaved(){return g(F)},get ws(){return a},connect:M,disconnect:ht,showToast:pt,showPersistentToast:mt,updateToast:yt,startSyncToast:gt,finishSyncToast:wt,send:bt,setPresenceHandler:St,setOnlineHandler:Tt,addConnectHandler:Et};export{Pt as S,d as a,Ct as c,lt as e,Ht as r,it as s,u as t,Dt as u};
@@ -1 +1 @@
1
- import{i as z,Y as Q,aG as K,W as P,D as V,aA as Y,j as g,J as W,aH as X,aI as Z,ah as m,aJ as x,aK as ee,aL as se,g as re,aM as ae,aN as te,aO as I,w as H,aP as ie,aQ as fe,S as ue,aR as oe,aS as le}from"./sZJoCX5N.js";import{B as ce}from"./BSSN_IAc.js";import{i as ne,e as ve,d as _e,j as de,n as be,k as he}from"./BdF6nRVd.js";import{t as pe,c as Ae,s as ge}from"./OZfYVFGq.js";function Ue(e,r,...s){var a=new ce(e);z(()=>{const t=r()??null;a.ensure(t,t&&(c=>t(c,...s)))},Q)}function ye(e,r){var s=void 0,a;K(()=>{s!==(s=r())&&(a&&(P(a),a=null),s&&(a=V(()=>{Y(()=>s(e))})))})}function w(e,r={},s,a){for(var t in s){var c=s[t];r[t]!==c&&(s[t]==null?e.style.removeProperty(t):e.style.setProperty(t,c,a))}}function Te(e,r,s,a){var t=e.__style;if(g||t!==r){var c=pe(r,a);(!g||c!==e.getAttribute("style"))&&(c==null?e.removeAttribute("style"):e.style.cssText=c),e.__style=r}else a&&(Array.isArray(a)?(w(e,s?.[0],a[0]),w(e,s?.[1],a[1],"important")):w(e,s,a));return a}function M(e,r,s=!1){if(e.multiple){if(r==null)return;if(!W(r))return X();for(var a of e.options)a.selected=r.includes(j(a));return}for(a of e.options){var t=j(a);if(Z(t,r)){a.selected=!0;return}}(!s||r!==void 0)&&(e.selectedIndex=-1)}function Se(e){var r=new MutationObserver(()=>{M(e,e.__value)});r.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),m(()=>{r.disconnect()})}function j(e){return"__value"in e?e.__value:e.value}const N=Symbol("class"),E=Symbol("style"),$=Symbol("is custom element"),D=Symbol("is html"),Ne=I?"link":"LINK",Ee=I?"input":"INPUT",Ie=I?"option":"OPTION",Le=I?"select":"SELECT",Oe=I?"progress":"PROGRESS";function ke(e){if(g){var r=!1,s=()=>{if(!r){if(r=!0,e.hasAttribute("value")){var a=e.value;O(e,"value",null),e.value=a}if(e.hasAttribute("checked")){var t=e.checked;O(e,"checked",null),e.checked=t}}};e.__on_r=s,ue(s),oe()}}function He(e,r){var s=C(e);s.value===(s.value=r??void 0)||e.value===r&&(r!==0||e.nodeName!==Oe)||(e.value=r??"")}function we(e,r){r?e.hasAttribute("selected")||e.setAttribute("selected",""):e.removeAttribute("selected")}function O(e,r,s,a){var t=C(e);g&&(t[r]=e.getAttribute(r),r==="src"||r==="srcset"||r==="href"&&e.nodeName===Ne)||t[r]!==(t[r]=s)&&(r==="loading"&&(e[le]=s),s==null?e.removeAttribute(r):typeof s!="string"&&F(e).includes(r)?e[r]=s:e.setAttribute(r,s))}function Pe(e,r,s,a,t=!1,c=!1){if(g&&t&&e.nodeName===Ee){var b=e,k=b.type==="checkbox"?"defaultChecked":"defaultValue";k in s||ke(b)}var h=C(e),_=h[$],p=!h[D];let y=g&&_;y&&H(!1);var u=r||{},T=e.nodeName===Ie;for(var d in r)d in s||(s[d]=null);s.class?s.class=Ae(s.class):(a||s[N])&&(s.class=null),s[E]&&(s.style??=null);var L=F(e);for(const i in s){let f=s[i];if(T&&i==="value"&&f==null){e.value=e.__value="",u[i]=f;continue}if(i==="class"){var S=e.namespaceURI==="http://www.w3.org/1999/xhtml";ge(e,S,f,a,r?.[N],s[N]),u[i]=f,u[N]=s[N];continue}if(i==="style"){Te(e,f,r?.[E],s[E]),u[i]=f,u[E]=s[E];continue}var n=u[i];if(!(f===n&&!(f===void 0&&e.hasAttribute(i)))){u[i]=f;var R=i[0]+i[1];if(R!=="$$")if(R==="on"){const v={},A="$$"+i;let l=i.slice(2);var G=he(l);if(ne(l)&&(l=l.slice(0,-7),v.capture=!0),!G&&n){if(f!=null)continue;e.removeEventListener(l,u[A],v),u[A]=null}if(G)ve(l,e,f),_e([l]);else if(f!=null){let J=function(q){u[i].call(this,q)};u[A]=de(l,e,J,v)}}else if(i==="style")O(e,i,f);else if(i==="autofocus")ie(e,!!f);else if(!_&&(i==="__value"||i==="value"&&f!=null))e.value=e.__value=f;else if(i==="selected"&&T)we(e,f);else{var o=i;p||(o=be(o));var U=o==="defaultValue"||o==="defaultChecked";if(f==null&&!_&&!U)if(h[i]=null,o==="value"||o==="checked"){let v=e;const A=r===void 0;if(o==="value"){let l=v.defaultValue;v.removeAttribute(o),v.defaultValue=l,v.value=v.__value=A?l:null}else{let l=v.defaultChecked;v.removeAttribute(o),v.defaultChecked=l,v.checked=A?l:!1}}else e.removeAttribute(i);else U||L.includes(o)&&(_||typeof f!="string")?(e[o]=f,o in h&&(h[o]=fe)):typeof f!="function"&&O(e,o,f)}}}return y&&H(!0),u}function je(e,r,s=[],a=[],t=[],c,b=!1,k=!1){x(t,s,a,h=>{var _=void 0,p={},y=e.nodeName===Le,u=!1;if(K(()=>{var d=r(...h.map(re)),L=Pe(e,_,d,c,b,k);u&&y&&"value"in d&&M(e,d.value);for(let n of Object.getOwnPropertySymbols(p))d[n]||P(p[n]);for(let n of Object.getOwnPropertySymbols(d)){var S=d[n];n.description===ae&&(!_||S!==_[n])&&(p[n]&&P(p[n]),p[n]=V(()=>ye(e,()=>S))),L[n]=S}_=L}),y){var T=e;Y(()=>{M(T,_.value,!0),Se(T)})}u=!0})}function C(e){return e.__attributes??={[$]:e.nodeName.includes("-"),[D]:e.namespaceURI===ee}}var B=new Map;function F(e){var r=e.getAttribute("is")||e.nodeName,s=B.get(r);if(s)return s;B.set(r,s=[]);for(var a,t=e,c=Element.prototype;c!==t;){a=te(t);for(var b in a)a[b].set&&s.push(b);t=se(t)}return s}export{E as S,je as a,O as b,Te as c,He as d,ke as r,Ue as s};
1
+ import{i as z,Y as Q,aG as K,W as P,D as V,aA as Y,j as g,J as W,aH as X,aI as Z,ah as m,aJ as x,aK as ee,aL as se,g as re,aM as ae,aN as te,aO as I,w as H,aP as ie,aQ as fe,S as ue,aR as oe,aS as le}from"./BenpwI6m.js";import{B as ce}from"./Dvv4bkXH.js";import{i as ne,e as ve,d as _e,j as de,n as be,k as he}from"./COik51fd.js";import{t as pe,c as Ae,s as ge}from"./CieeblIr.js";function Ue(e,r,...s){var a=new ce(e);z(()=>{const t=r()??null;a.ensure(t,t&&(c=>t(c,...s)))},Q)}function ye(e,r){var s=void 0,a;K(()=>{s!==(s=r())&&(a&&(P(a),a=null),s&&(a=V(()=>{Y(()=>s(e))})))})}function w(e,r={},s,a){for(var t in s){var c=s[t];r[t]!==c&&(s[t]==null?e.style.removeProperty(t):e.style.setProperty(t,c,a))}}function Te(e,r,s,a){var t=e.__style;if(g||t!==r){var c=pe(r,a);(!g||c!==e.getAttribute("style"))&&(c==null?e.removeAttribute("style"):e.style.cssText=c),e.__style=r}else a&&(Array.isArray(a)?(w(e,s?.[0],a[0]),w(e,s?.[1],a[1],"important")):w(e,s,a));return a}function M(e,r,s=!1){if(e.multiple){if(r==null)return;if(!W(r))return X();for(var a of e.options)a.selected=r.includes(j(a));return}for(a of e.options){var t=j(a);if(Z(t,r)){a.selected=!0;return}}(!s||r!==void 0)&&(e.selectedIndex=-1)}function Se(e){var r=new MutationObserver(()=>{M(e,e.__value)});r.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),m(()=>{r.disconnect()})}function j(e){return"__value"in e?e.__value:e.value}const N=Symbol("class"),E=Symbol("style"),$=Symbol("is custom element"),D=Symbol("is html"),Ne=I?"link":"LINK",Ee=I?"input":"INPUT",Ie=I?"option":"OPTION",Le=I?"select":"SELECT",Oe=I?"progress":"PROGRESS";function ke(e){if(g){var r=!1,s=()=>{if(!r){if(r=!0,e.hasAttribute("value")){var a=e.value;O(e,"value",null),e.value=a}if(e.hasAttribute("checked")){var t=e.checked;O(e,"checked",null),e.checked=t}}};e.__on_r=s,ue(s),oe()}}function He(e,r){var s=C(e);s.value===(s.value=r??void 0)||e.value===r&&(r!==0||e.nodeName!==Oe)||(e.value=r??"")}function we(e,r){r?e.hasAttribute("selected")||e.setAttribute("selected",""):e.removeAttribute("selected")}function O(e,r,s,a){var t=C(e);g&&(t[r]=e.getAttribute(r),r==="src"||r==="srcset"||r==="href"&&e.nodeName===Ne)||t[r]!==(t[r]=s)&&(r==="loading"&&(e[le]=s),s==null?e.removeAttribute(r):typeof s!="string"&&F(e).includes(r)?e[r]=s:e.setAttribute(r,s))}function Pe(e,r,s,a,t=!1,c=!1){if(g&&t&&e.nodeName===Ee){var b=e,k=b.type==="checkbox"?"defaultChecked":"defaultValue";k in s||ke(b)}var h=C(e),_=h[$],p=!h[D];let y=g&&_;y&&H(!1);var u=r||{},T=e.nodeName===Ie;for(var d in r)d in s||(s[d]=null);s.class?s.class=Ae(s.class):(a||s[N])&&(s.class=null),s[E]&&(s.style??=null);var L=F(e);for(const i in s){let f=s[i];if(T&&i==="value"&&f==null){e.value=e.__value="",u[i]=f;continue}if(i==="class"){var S=e.namespaceURI==="http://www.w3.org/1999/xhtml";ge(e,S,f,a,r?.[N],s[N]),u[i]=f,u[N]=s[N];continue}if(i==="style"){Te(e,f,r?.[E],s[E]),u[i]=f,u[E]=s[E];continue}var n=u[i];if(!(f===n&&!(f===void 0&&e.hasAttribute(i)))){u[i]=f;var R=i[0]+i[1];if(R!=="$$")if(R==="on"){const v={},A="$$"+i;let l=i.slice(2);var G=he(l);if(ne(l)&&(l=l.slice(0,-7),v.capture=!0),!G&&n){if(f!=null)continue;e.removeEventListener(l,u[A],v),u[A]=null}if(G)ve(l,e,f),_e([l]);else if(f!=null){let J=function(q){u[i].call(this,q)};u[A]=de(l,e,J,v)}}else if(i==="style")O(e,i,f);else if(i==="autofocus")ie(e,!!f);else if(!_&&(i==="__value"||i==="value"&&f!=null))e.value=e.__value=f;else if(i==="selected"&&T)we(e,f);else{var o=i;p||(o=be(o));var U=o==="defaultValue"||o==="defaultChecked";if(f==null&&!_&&!U)if(h[i]=null,o==="value"||o==="checked"){let v=e;const A=r===void 0;if(o==="value"){let l=v.defaultValue;v.removeAttribute(o),v.defaultValue=l,v.value=v.__value=A?l:null}else{let l=v.defaultChecked;v.removeAttribute(o),v.defaultChecked=l,v.checked=A?l:!1}}else e.removeAttribute(i);else U||L.includes(o)&&(_||typeof f!="string")?(e[o]=f,o in h&&(h[o]=fe)):typeof f!="function"&&O(e,o,f)}}}return y&&H(!0),u}function je(e,r,s=[],a=[],t=[],c,b=!1,k=!1){x(t,s,a,h=>{var _=void 0,p={},y=e.nodeName===Le,u=!1;if(K(()=>{var d=r(...h.map(re)),L=Pe(e,_,d,c,b,k);u&&y&&"value"in d&&M(e,d.value);for(let n of Object.getOwnPropertySymbols(p))d[n]||P(p[n]);for(let n of Object.getOwnPropertySymbols(d)){var S=d[n];n.description===ae&&(!_||S!==_[n])&&(p[n]&&P(p[n]),p[n]=V(()=>ye(e,()=>S))),L[n]=S}_=L}),y){var T=e;Y(()=>{M(T,_.value,!0),Se(T)})}u=!0})}function C(e){return e.__attributes??={[$]:e.nodeName.includes("-"),[D]:e.namespaceURI===ee}}var B=new Map;function F(e){var r=e.getAttribute("is")||e.nodeName,s=B.get(r);if(s)return s;B.set(r,s=[]);for(var a,t=e,c=Element.prototype;c!==t;){a=te(t);for(var b in a)a[b].set&&s.push(b);t=se(t)}return s}export{E as S,je as a,O as b,Te as c,He as d,ke as r,Ue as s};
@@ -1,4 +1,4 @@
1
- import{e as h,f as U,s as a,g as t,ax as x}from"./sZJoCX5N.js";import{i as L,g as V}from"./B95ZQgm6.js";import{n as y}from"./CkIXD8Ce.js";import{w as W}from"./DvmL5xMZ.js";function X(g,c,o){fetch("/api/chat/stream",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(g),signal:o}).then(async n=>{if(!n.ok){c({type:"error",message:`HTTP ${n.status}`});return}const r=n.body?.getReader();if(!r){c({type:"error",message:"No response body"});return}const p=new TextDecoder;let m="";for(;;){const{done:k,value:O}=await r.read();if(k)break;m+=p.decode(O,{stream:!0});const A=m.split(`
1
+ import{e as h,f as U,s as a,g as t,ax as x}from"./BenpwI6m.js";import{i as L,g as V}from"./DQBH1xkO.js";import{n as y}from"./CDFdgZ9U.js";import{w as W}from"./BjAmYrTY.js";function X(g,c,o){fetch("/api/chat/stream",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(g),signal:o}).then(async n=>{if(!n.ok){c({type:"error",message:`HTTP ${n.status}`});return}const r=n.body?.getReader();if(!r){c({type:"error",message:"No response body"});return}const p=new TextDecoder;let m="";for(;;){const{done:k,value:O}=await r.read();if(k)break;m+=p.decode(O,{stream:!0});const A=m.split(`
2
2
  `);m=A.pop()??"";for(const C of A)if(C.startsWith("data: "))try{const f=JSON.parse(C.slice(6));c(f)}catch{}}}).catch(n=>{n.name!=="AbortError"&&c({type:"error",message:n.message})})}const D="sg-chat-sessions",J="sg-chat-version",z=14;function b(){try{const g=localStorage.getItem(D);if(!g)return[];if(localStorage.getItem(J)==="2")return JSON.parse(g);const n=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(p=>p.role==="user")?.content.slice(0,50)||"New chat",messages:r.messages}));return localStorage.setItem(D,JSON.stringify(n)),localStorage.setItem(J,"2"),n}catch{return[]}}function _(g){const o=[...g].sort((n,r)=>r.updatedAt.localeCompare(n.updatedAt)).slice(0,z);try{localStorage.setItem(D,JSON.stringify(o)),localStorage.setItem(J,"2")}catch{}}function N(g,c){const o=b(),n=c.map(({streaming:p,...m})=>m),r=o.findIndex(p=>p.id===g);r>=0&&(o[r].messages=n,o[r].updatedAt=new Date().toISOString()),_(o)}function B(){const c=b().sort((e,i)=>i.updatedAt.localeCompare(e.updatedAt))[0];let o=h(U(c?c.messages.map(e=>({...e,streaming:!1})):[])),n=h(U(c?.id??null)),r=h(!1),p=h(0),m=h(0),k=h(0),O=h(null),A=null,C=h(""),f=h(U(!!c));const R=new Set(["create_entity","update_entity","delete_entity","move_entity"]);function M(){$();const e=crypto.randomUUID();a(n,e,!0),a(o,[],!0),a(f,!1)}function E(){if(t(n)&&t(f))return t(n);const e=t(n)||crypto.randomUUID();a(n,e,!0);const i=new Date().toISOString(),d=b();return d.push({id:e,createdAt:i,updatedAt:i,title:"New chat",messages:[]}),_(d),a(f,!0),e}function K(e){if(!e.trim()||t(r))return;a(O,null);const i=E();t(o).push({role:"user",content:e}),t(o).push({role:"agent",content:"",segments:[],streaming:!0}),a(r,!0);const d=b(),l=d.find(s=>s.id===i);l&&l.title==="New chat"&&(l.title=e.slice(0,50),_(d)),N(i,t(o));let T=!1,w=null;A=new AbortController;const G=y.selectedSubPath?`${y.selectedRepo}/${y.selectedType}/${y.selectedId}/${y.selectedSubPath}`:y.selectedId?`${y.selectedRepo}/${y.selectedType}/${y.selectedId}`:null,P=t(o).slice(0,-2).map(s=>({role:s.role==="agent"?"assistant":s.role,content:s.content})),H={message:e,context:G??void 0,sessionId:i,history:P.length>0?P:void 0};X(H,s=>{if(!t(r))return;const u=t(o)[t(o).length-1];if(!u||u.role!=="agent")return;const S=u.segments;switch(s.type){case"token":{u.content+=s.text??"";const I=S[S.length-1];I&&I.type==="text"?I.content+=s.text??"":S.push({type:"text",content:s.text??""}),u.segments=S,x(m);break}case"tool_start":if(s.name){R.has(s.name)&&(T=!0);const I=S[S.length-1];I&&I.type==="tools"?I.names=[...I.names,s.name]:S.push({type:"tools",names:[s.name]}),u.segments=S,x(m)}break;case"mutation":T=!0,s.action==="created"&&s.repo&&s.entityType&&s.entityId&&(w={repo:s.repo,entityType:s.entityType,entityId:s.entityId}),window.StudioChrome?.emitMutation?.({action:s.action,repo:s.repo,entityType:s.entityType,entityId:s.entityId});break;case"highlight":a(O,s.entityIds&&s.entityIds.length>0?new Set(s.entityIds):null,!0);break;case"done":s.message&&!u.content&&(u.content=s.message,u.segments=[{type:"text",content:s.message}]),u.streaming=!1,a(r,!1),N(i,t(o)),T&&(L().then(()=>{x(p)}),W.refreshAll().then(()=>{w&&V(`/${w.repo}/${w.entityType}/${w.entityId}`)}));break;case"error":u.content+=`
3
3
 
4
4
  Error: ${s.message}`,u.streaming=!1,a(r,!1),N(i,t(o));break}},A.signal)}function $(){if(!t(r))return;fetch("/api/chat/abort",{method:"POST",credentials:"include"}).catch(()=>{}),A?.abort(),A=null,a(r,!1);const e=t(o)[t(o).length-1];e?.streaming&&(e.streaming=!1,t(n)&&N(t(n),t(o)))}function Y(){$(),a(o,[],!0),t(n)&&t(f)&&N(t(n),t(o))}function Z(e){const d=b().filter(l=>l.id!==e);if(_(d),t(n)===e){const l=d.sort((T,w)=>w.updatedAt.localeCompare(T.updatedAt));l.length>0?(a(n,l[0].id,!0),a(o,l[0].messages.map(T=>({...T,streaming:!1})),!0),a(f,!0)):(a(n,null),a(o,[],!0),a(f,!1))}}function j(e){const d=b().find(l=>l.id===e);d&&($(),a(n,d.id,!0),a(o,d.messages.map(l=>({...l,streaming:!1})),!0),a(f,!0))}function q(){return b().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===t(n)}))}return{get messages(){return t(o)},get streaming(){return t(r)},get mutationCount(){return t(p)},get scrollTick(){return t(m)},get forceScroll(){return t(k)},triggerScroll(){x(k)},get highlightedIds(){return t(O)},get activeSessionId(){return t(n)},get draftInput(){return t(C)},set draftInput(e){a(C,e,!0)},send:K,stop:$,clear:Y,newSession:M,deleteSession:Z,getSessions:q,loadSession:j}}const te=B();export{te as chatStore};
@@ -1 +1 @@
1
- import{i as v,j as o,q as y,Y as f,u as l,v as m,k as p,w as i,Z as T,x as A}from"./sZJoCX5N.js";import{B as R}from"./BSSN_IAc.js";function x(d,_,e){var s;o&&(s=A,y());var r=new R(d);v(()=>{var a=_()??null;if(o){var h=l(s),u=h===T,c=a!==null;if(u!==c){var t=m();p(t),r.anchor=t,i(!1),r.ensure(a,a&&(n=>e(n,a))),i(!0);return}}r.ensure(a,a&&(n=>e(n,a)))},f)}export{x as c};
1
+ import{i as v,j as o,q as y,Y as f,u as l,v as m,k as p,w as i,Z as T,x as A}from"./BenpwI6m.js";import{B as R}from"./Dvv4bkXH.js";function x(d,_,e){var s;o&&(s=A,y());var r=new R(d);v(()=>{var a=_()??null;if(o){var h=l(s),u=h===T,c=a!==null;if(u!==c){var t=m();p(t),r.anchor=t,i(!1),r.ensure(a,a&&(n=>e(n,a))),i(!0);return}}r.ensure(a,a&&(n=>e(n,a)))},f)}export{x as c};
@@ -1,2 +1,2 @@
1
- import{j as h}from"./sZJoCX5N.js";function v(r){var i,t,f="";if(typeof r=="string"||typeof r=="number")f+=r;else if(typeof r=="object")if(Array.isArray(r)){var o=r.length;for(i=0;i<o;i++)r[i]&&(t=v(r[i]))&&(f&&(f+=" "),f+=t)}else for(t in r)r[t]&&(f&&(f+=" "),f+=t);return f}function S(){for(var r,i,t=0,f="",o=arguments.length;t<o;t++)(r=arguments[t])&&(i=v(r))&&(f&&(f+=" "),f+=i);return f}function $(r){return typeof r=="object"?S(r):r??""}const j=[...`
1
+ import{j as h}from"./BenpwI6m.js";function v(r){var i,t,f="";if(typeof r=="string"||typeof r=="number")f+=r;else if(typeof r=="object")if(Array.isArray(r)){var o=r.length;for(i=0;i<o;i++)r[i]&&(t=v(r[i]))&&(f&&(f+=" "),f+=t)}else for(t in r)r[t]&&(f&&(f+=" "),f+=t);return f}function S(){for(var r,i,t=0,f="",o=arguments.length;t<o;t++)(r=arguments[t])&&(i=v(r))&&(f&&(f+=" "),f+=i);return f}function $(r){return typeof r=="object"?S(r):r??""}const j=[...`
2
2
  \r\f \v\uFEFF`];function T(r,i,t){var f=r==null?"":""+r;if(i&&(f=f?f+" "+i:i),t){for(var o of Object.keys(t))if(t[o])f=f?f+" "+o:o;else if(f.length)for(var n=o.length,u=0;(u=f.indexOf(o,u))>=0;){var s=u+n;(u===0||j.includes(f[u-1]))&&(s===f.length||j.includes(f[s]))?f=(u===0?"":f.substring(0,u))+f.substring(s+1):u=s}}return f===""?null:f}function A(r,i=!1){var t=i?" !important;":";",f="";for(var o of Object.keys(r)){var n=r[o];n!=null&&n!==""&&(f+=" "+o+": "+n+t)}return f}function p(r){return r[0]!=="-"||r[1]!=="-"?r.toLowerCase():r}function L(r,i){if(i){var t="",f,o;if(Array.isArray(i)?(f=i[0],o=i[1]):f=i,r){r=String(r).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var n=!1,u=0,s=!1,c=[];f&&c.push(...Object.keys(f).map(p)),o&&c.push(...Object.keys(o).map(p));var l=0,g=-1;const b=r.length;for(var e=0;e<b;e++){var a=r[e];if(s?a==="/"&&r[e-1]==="*"&&(s=!1):n?n===a&&(n=!1):a==="/"&&r[e+1]==="*"?s=!0:a==='"'||a==="'"?n=a:a==="("?u++:a===")"&&u--,!s&&n===!1&&u===0){if(a===":"&&g===-1)g=e;else if(a===";"||e===b-1){if(g!==-1){var O=p(r.substring(l,g).trim());if(!c.includes(O)){a!==";"&&e++;var d=r.substring(l,e).trim();t+=" "+d+";"}}l=e+1,g=-1}}}}return f&&(t+=A(f)),o&&(t+=A(o,!0)),t=t.trim(),t===""?null:t}return r==null?null:String(r)}function z(r,i,t,f,o,n){var u=r.__className;if(h||u!==t||u===void 0){var s=T(t,f,n);(!h||s!==r.getAttribute("class"))&&(s==null?r.removeAttribute("class"):i?r.className=s:r.setAttribute("class",s)),r.__className=t}else if(n&&o!==n)for(var c in n){var l=!!n[c];(o==null||l!==!!o[c])&&r.classList.toggle(c,l)}return n}const E="";class w extends Error{constructor(i,t){super(t),this.status=i,this.name="ApiError"}}async function C(r,i){const t={...i?.headers};i?.body&&(t["Content-Type"]=t["Content-Type"]??"application/json");const f=await fetch(`${E}${r}`,{...i,headers:t});if(!f.ok){const o=await f.json().catch(()=>({error:f.statusText}));throw f.status===401&&typeof window<"u"&&!r.startsWith("/api/auth/")&&window.location.pathname!=="/login"&&(window.location.href="/login"),new w(f.status,o.error??f.statusText)}return f.json()}const B=Object.freeze(Object.defineProperty({__proto__:null,ApiError:w,apiFetch:C},Symbol.toStringTag,{value:"Module"}));export{C as a,S as b,$ as c,B as d,z as s,L as t};