@vite-hub/comments 0.1.0 → 0.3.0

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 (87) hide show
  1. package/README.md +79 -31
  2. package/dist/anchor.d.ts +7 -4
  3. package/dist/anchor.js +10 -5
  4. package/dist/client-diagnostics-CcFpkbAk.js +40 -0
  5. package/dist/client.d.ts +78 -3
  6. package/dist/client.js +198 -13
  7. package/dist/{console-BIz9t2cO.d.ts → console-h4KlhIik.d.ts} +97 -8
  8. package/dist/context-BqIsmYP1.js +61 -0
  9. package/dist/database/postgres.d.ts +738 -347
  10. package/dist/database/postgres.js +28 -7
  11. package/dist/{database-Cb2xjC1V.d.ts → database-CA1aHKN7.d.ts} +675 -276
  12. package/dist/database.d.ts +6 -98
  13. package/dist/database.js +2 -3
  14. package/dist/define-43mMR39K.js +89 -0
  15. package/dist/define-B3TF9zzn.d.ts +204 -0
  16. package/dist/errors-4gelGVmK.js +57 -0
  17. package/dist/errors-C6qptPoG.js +135 -0
  18. package/dist/errors-CyQyKAvy.d.ts +185 -0
  19. package/dist/fold-name-B7Zb3-MF.js +7 -0
  20. package/dist/{identity-3qtVC4rF.js → identity-CBOzgxSf.js} +7 -2
  21. package/dist/index-DNhy69Wt.d.ts +83 -0
  22. package/dist/index.d.ts +7 -7
  23. package/dist/index.js +196 -5
  24. package/dist/install-BcMPgPk_.js +1154 -0
  25. package/dist/install-W9ghhGoh.d.ts +36 -0
  26. package/dist/installed-B-PfERBU.js +30 -0
  27. package/dist/invariant-D8_xBqmZ.js +22 -0
  28. package/dist/migrate-B0k_0swk.d.ts +54 -0
  29. package/dist/migrate-BDQ8xqUs.js +289 -0
  30. package/dist/object-Da1zyPCR.js +11 -0
  31. package/dist/{operations-0B0QTVWX.d.ts → operations-D4A1Fcgf.d.ts} +37 -15
  32. package/dist/operations-DMMIfYPW.js +1159 -0
  33. package/dist/operations-GLeOqgMt.d.ts +257 -0
  34. package/dist/operations.d.ts +3 -7
  35. package/dist/operations.js +3 -2
  36. package/dist/overlay/client-DmsSMOzi.js +4 -0
  37. package/dist/overlay/dist-BoHMOFax.js +14 -0
  38. package/dist/overlay/dist-yIZmvSaU.js +1 -0
  39. package/dist/overlay/overlay.js +183 -177
  40. package/dist/page/loader.js +138 -18
  41. package/dist/{page-BuroSMXO.js → page-B41ozN63.js} +8 -6
  42. package/dist/{page-BtXADR6d.d.ts → page-DtbMOEMd.d.ts} +6 -5
  43. package/dist/page-tools-shared-NHUjKI8E.js +117 -0
  44. package/dist/path--zk6PEMz.js +18 -0
  45. package/dist/plugin-PS8PMYus.js +74 -0
  46. package/dist/realtime.d.ts +6 -12
  47. package/dist/realtime.js +23 -24
  48. package/dist/rpc-HBcWtg0T.d.ts +17 -0
  49. package/dist/rpc-RKPAusHp.js +153 -0
  50. package/dist/rpc.d.ts +2 -29
  51. package/dist/rpc.js +2 -75
  52. package/dist/runtime/auth.d.ts +5 -3
  53. package/dist/runtime/auth.js +8 -5
  54. package/dist/runtime/console.d.ts +1 -1
  55. package/dist/runtime/console.js +26 -21
  56. package/dist/runtime/index.d.ts +108 -60
  57. package/dist/runtime/index.js +684 -236
  58. package/dist/{server-BomGg3Gb.js → server-D8k-0GXe.js} +16 -7
  59. package/dist/server.d.ts +14 -88
  60. package/dist/server.js +7 -326
  61. package/dist/service-CFVm23k7.d.ts +158 -0
  62. package/dist/service-GHhhyQj4.js +609 -0
  63. package/dist/session-DVx-1Tym.d.ts +14 -0
  64. package/dist/session-EkudzUmm.js +503 -0
  65. package/dist/testing.d.ts +1 -1
  66. package/dist/testing.js +14 -2
  67. package/dist/tokens-DSbwkVSy.js +58 -0
  68. package/dist/types-BIS0hCEl.d.ts +124 -0
  69. package/dist/types-CZujrMFd.d.ts +322 -0
  70. package/dist/vite.d.ts +91 -87
  71. package/dist/vite.js +535 -796
  72. package/package.json +24 -27
  73. package/dist/database-BSnVrwHn.js +0 -60
  74. package/dist/database-C-ktS9Do.js +0 -95
  75. package/dist/define-BzW2Ychn.d.ts +0 -46
  76. package/dist/define-Cbhl6QVJ.js +0 -32
  77. package/dist/errors-BAQYcy3_.d.ts +0 -89
  78. package/dist/errors-DeD6wTCl.js +0 -77
  79. package/dist/h3-v1-request-DDGXJ9E7.js +0 -166
  80. package/dist/index-DklG2Etf.d.ts +0 -111
  81. package/dist/operations-NZG5dB8y.js +0 -732
  82. package/dist/page-tools-shared-D-amu6sx.js +0 -53
  83. package/dist/plugin-QElKQYkA.js +0 -725
  84. package/dist/request-DVc3M_AG.js +0 -14
  85. package/dist/src-CRTwnaEG.js +0 -1362
  86. package/dist/types-Cj8K7Vx7.d.ts +0 -176
  87. package/dist/types-Un2dcJWD.d.ts +0 -288
@@ -1,22 +1,142 @@
1
- function e(e){let t=document.createElementNS(`http://www.w3.org/2000/svg`,`svg`);for(let[e,n]of Object.entries({width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.75`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`}))t.setAttribute(e,n);let n=document.createElementNS(`http://www.w3.org/2000/svg`,`path`);return n.setAttribute(`d`,e),t.append(n),t}function t(t){let n=document.createElement(`vitehub-window`);n.hidden=!0;let r=n.attachShadow({mode:`open`}),i=document.createElement(`style`);i.textContent=`
2
- :host{all:initial;--surface:light-dark(#fff,#000);--text:light-dark(#18181b,#fafafa);--muted:light-dark(#52525b,#a1a1aa);--line:light-dark(#d4d4d8,#3f3f46);--hover:light-dark(#f4f4f5,#27272a);--focus:#3b82f6;position:fixed;inset:0;z-index:2147483000;pointer-events:none;color:var(--text);font:400 .875rem/1.5 system-ui,sans-serif;color-scheme:light dark}
1
+ const e=`vitehub`,t=[`comment`];function n(e,n){let r=new URLSearchParams(e);if(r.has(`vitehub`)||t.some(e=>r.has(e)))return!0;let i=n.split(`;`).map(e=>e.trim());return i.includes(`vitehub-tools=1`)?!0:i.includes(`vitehub_session=1`)&&!i.some(e=>e.startsWith(`vitehub-tools=`))}const r=`/_vitehub/page/session`,i=`button{all:unset;box-sizing:border-box;display:inline-flex;align-items:center;justify-content:var(--vitehub-pill-justify,center);gap:4px;min-width:28px;height:28px;padding:0 8px;border-radius:8px;font:inherit;white-space:nowrap;color:var(--vitehub-pill-text);cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent;transition-property:background-color,color,scale;transition-duration:150ms;transition-timing-function:cubic-bezier(.23,1,.32,1)}
2
+ @media(hover:hover){button:where(:not(:disabled):hover){background:var(--vitehub-pill-hover);color:var(--vitehub-pill-strong)}}
3
+ button:where(:not(:disabled):active){scale:.96}
4
+ button[aria-pressed=true],button[aria-expanded=true]{background:var(--vitehub-pill-on);color:var(--vitehub-pill-on-text)}
5
+ :host([aria-busy=true]) button,button[aria-busy=true]{background:var(--vitehub-pill-on);color:var(--vitehub-pill-on-text);cursor:progress}
6
+ button:focus-visible{outline:2px solid var(--vitehub-pill-on);outline-offset:1px}
7
+ button svg{width:14px;height:14px;flex:none}
8
+ @media(any-pointer:coarse){button{min-width:44px;height:44px}}
9
+ @media(prefers-reduced-motion:reduce){button{transition:none}}`;function a(e){let t=new URL(e,`http://localhost`).pathname,n=t.lastIndexOf(`/_vitehub/page/assets/`);return n===-1?r:`${t.slice(0,n)}${r}`}function o(e){return typeof e==`string`&&e?e:void 0}function s(e){if(typeof e!=`object`||!e)return;let t=o(Reflect.get(e,`id`)),n=o(Reflect.get(e,`script`));if(!t||!n)return;let r={id:t,label:o(Reflect.get(e,`label`))??t,icon:o(Reflect.get(e,`icon`))??``,script:n};Reflect.get(e,`lazy`)===!0&&(r.lazy=!0);let i=o(Reflect.get(e,`hotkey`));i&&(r.hotkey=i);let a=o(Reflect.get(e,`param`));return a&&(r.param=a),r}function c(e){if(typeof e!=`object`||!e)return;let t=o(Reflect.get(e,`name`)),n=o(Reflect.get(e,`signOut`));if(!t||!n?.startsWith(`/`)||n.startsWith(`//`)||n.includes(`\\`))return;let r={name:t,signOut:n},i=o(Reflect.get(e,`email`));i&&(r.email=i);let a=o(Reflect.get(e,`image`));return a&&/^https?:\/\//i.test(a)&&(r.image=a),Reflect.get(e,`via`)===`console`&&(r.via=`console`),r}function l(e){let t=typeof e==`object`&&e?Reflect.get(e,`tools`):void 0,n={tools:Array.isArray(t)?t.map(s).filter(e=>!!e):[]},r=typeof e==`object`&&e?c(Reflect.get(e,`account`)):void 0;return r&&(n.account=r),n}const u=[[-.28,-.453],[-.208,-.5],[.208,-.5],[.28,-.453],[.488,-.047],[.488,.047],[.28,.453],[.208,.5],[-.208,.5],[-.28,.453],[-.488,.047],[-.488,-.047]],d=e=>`polygon(${e.map(([e,t])=>`calc(50% + var(--vitehub-hex-w) * ${e}) calc(50% + var(--vitehub-hex-h) * ${t})`).join(`,`)})`,f=d(u),p=d([[-.5,-.5],[-.5,-.5],[.5,-.5],[.5,-.5],[.5,0],[.5,0],[.5,.5],[.5,.5],[-.5,.5],[-.5,.5],[-.5,0],[-.5,0]]),m=e=>`calc(var(--start) + ${e} / 2 + (100% - var(--start) - var(--end) - ${e}) * var(--at) / 100)`,h=`:host{all:initial;position:fixed;z-index:2147483001;pointer-events:none;filter:drop-shadow(0 8px 24px rgb(0 0 0/25%));color-scheme:dark;font:500 12px/1 ui-sans-serif,system-ui,sans-serif;color:#d4d4d4;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;--vitehub-pill-text:#d4d4d4;--vitehub-pill-strong:#fafafa;--vitehub-pill-muted:#a3a3a3;--vitehub-pill-hover:rgb(255 255 255/8%);--vitehub-pill-on:#fafafa;--vitehub-pill-on-text:#0a0a0a;--vitehub-pill-line:rgb(255 255 255/12%);--vitehub-pill-surface:#111;--vitehub-pill-flow:row;--vitehub-pill-ease:cubic-bezier(.32,.72,0,1);--vitehub-hex-h:24px;--vitehub-hex-w:calc(var(--vitehub-hex-h) * 10 / 9);--vitehub-pill-morph:280ms;--vitehub-pill-fade:opacity 160ms ease-out 80ms,visibility 0s;--vitehub-pill-fade-end:opacity 160ms ease-out 120ms,visibility 0s;--at:50;--margin:16px;--safe-top:env(safe-area-inset-top,0px);--safe-right:env(safe-area-inset-right,0px);--safe-bottom:env(safe-area-inset-bottom,0px);--safe-left:env(safe-area-inset-left,0px);transition-property:left,top,right,bottom,translate;transition-duration:var(--vitehub-pill-morph);transition-timing-function:var(--vitehub-pill-ease);transition-delay:var(--vitehub-pill-wait,0s)}
10
+ :host([collapsed]){--margin:2px;--vitehub-pill-morph:240ms;--vitehub-pill-wait:40ms;--vitehub-pill-fade:opacity 80ms ease-out,visibility 0s 80ms;--vitehub-pill-fade-end:opacity 40ms ease-out,visibility 0s 40ms}
11
+ :host(:is([edge=top],[edge=bottom])){left:${m(`0px`)};--start:max(var(--margin),var(--safe-left));--end:max(var(--margin),var(--safe-right));--x:calc(var(--at) * -1%)}
12
+ :host(:is([edge=left],[edge=right])){top:${m(`0px`)};--start:max(var(--margin),var(--safe-top));--end:max(var(--margin),var(--safe-bottom));--y:calc(var(--at) * -1%);--vitehub-pill-flow:column;--vitehub-pill-justify:flex-start}
13
+ :host([edge=bottom]){bottom:max(16px,var(--safe-bottom))}
14
+ :host([edge=top]){top:max(16px,var(--safe-top))}
15
+ :host([edge=right]){right:max(16px,var(--safe-right))}
16
+ :host([edge=left]){left:max(16px,var(--safe-left))}
17
+ :host([collapsed]:is([edge=top],[edge=bottom])){left:${m(`var(--vitehub-hex-w)`)};--x:-50%}
18
+ :host([collapsed]:is([edge=left],[edge=right])){top:${m(`var(--vitehub-hex-h)`)};--y:-50%}
19
+ :host([collapsed][edge=bottom]){bottom:calc(max(2px,var(--safe-bottom)) + var(--vitehub-hex-h) / 2);--y:50%}
20
+ :host([collapsed][edge=top]){top:calc(max(2px,var(--safe-top)) + var(--vitehub-hex-h) / 2);--y:-50%}
21
+ :host([collapsed][edge=right]){right:calc(max(2px,var(--safe-right)) + var(--vitehub-hex-w) / 2);--x:50%}
22
+ :host([collapsed][edge=left]){left:calc(max(2px,var(--safe-left)) + var(--vitehub-hex-w) / 2);--x:-50%}
23
+ :host{translate:var(--x,0) var(--y,0)}
24
+ :host([dragging]){transition:none;cursor:grabbing;user-select:none;-webkit-user-select:none}
25
+ div{position:relative;box-sizing:border-box;max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px);overflow:auto;scrollbar-width:none;display:flex;flex-direction:var(--vitehub-pill-flow);align-items:center;gap:8px;padding:4px;border:1px solid var(--vitehub-pill-line);border-radius:12px;background:rgb(17 17 17/92%);pointer-events:auto;clip-path:polygon(0 6px,6px 0,calc(100% - 6px) 0,100% 6px,100% 50%,100% 50%,100% calc(100% - 6px),calc(100% - 6px) 100%,6px 100%,0 calc(100% - 6px),0 50%,0 50%);transition:clip-path var(--vitehub-pill-morph) var(--vitehub-pill-ease) var(--vitehub-pill-wait,0s),background-color 150ms ease-out,scale 150ms ease-out}
26
+ :host(:is([edge=left],[edge=right])) div{display:grid;grid-template-columns:auto 1fr;align-items:stretch;gap:8px 2px}
27
+ :host([collapsed]) div{clip-path:${f}}
28
+ @media(hover:hover){:host([collapsed]) div:hover{background:rgb(38 38 38/94%)}}
29
+ :host([collapsed]) div:active{scale:.96}
30
+ :host([dragging]) div{transition:none;scale:none}
31
+ ::slotted(*){flex-shrink:0;display:flex;flex-direction:var(--vitehub-pill-flow);align-items:center;gap:2px;transition:var(--vitehub-pill-fade)}
32
+ :host(:is([edge=left],[edge=right])) ::slotted(*){grid-column:1/-1;align-items:stretch}
33
+ ::slotted([hidden]){display:none!important}
34
+ :host([collapsed]) ::slotted(*),:host([collapsed]) .exit{opacity:0;visibility:hidden}
35
+ .tabs{position:absolute;display:flex;width:max-content;height:max-content;max-width:calc(100vw - max(16px,var(--safe-left)) - max(16px,var(--safe-right)));max-height:calc(100dvh - max(16px,var(--safe-top)) - max(16px,var(--safe-bottom)));gap:4px;overflow:auto;pointer-events:auto}
36
+ :host([collapsed]) .tabs{visibility:hidden}
37
+ :host(:is([edge=top],[edge=bottom])) .tabs{left:calc(var(--at) * 1%);translate:calc(var(--at) * -1%) 0;max-height:calc(100dvh - max(16px,var(--safe-top)) - max(16px,var(--safe-bottom)) - 100%)}
38
+ :host(:is([edge=left],[edge=right])) .tabs{top:calc(var(--at) * 1%);translate:0 calc(var(--at) * -1%);max-width:calc(100vw - max(16px,var(--safe-left)) - max(16px,var(--safe-right)) - 100%);flex-direction:column}
39
+ :host([edge=bottom]) .tabs{bottom:100%;align-items:safe flex-end}
40
+ :host([edge=top]) .tabs{top:100%;align-items:flex-start}
41
+ :host([edge=left]) .tabs{left:100%;align-items:flex-start}
42
+ :host([edge=right]) .tabs{right:100%;align-items:safe flex-end}
43
+ ::slotted([slot=tab]){padding:3px;border:1px solid var(--vitehub-pill-line);background:rgb(17 17 17/92%);pointer-events:auto}
44
+ :host([edge=bottom]) ::slotted([slot=tab]){border-bottom:0;border-radius:10px 10px 0 0}
45
+ :host([edge=top]) ::slotted([slot=tab]){border-top:0;border-radius:0 0 10px 10px}
46
+ :host([edge=left]) ::slotted([slot=tab]){border-left:0;border-radius:0 10px 10px 0}
47
+ :host([edge=right]) ::slotted([slot=tab]){border-right:0;border-radius:10px 0 0 10px}
48
+ ${i}
49
+ button{flex-shrink:0;padding:0;justify-content:center}
50
+ .exit{position:sticky;right:0;bottom:0;transition:background-color 150ms,color 150ms,scale 150ms,var(--vitehub-pill-fade-end)}
51
+ :host(:is([edge=left],[edge=right])) .mark{justify-self:start}
52
+ :host(:is([edge=left],[edge=right])) .exit{grid-area:1/2;justify-self:end;top:0;bottom:auto}
53
+ .mark{position:sticky;left:0;top:0;z-index:1;cursor:grab}
54
+ :host([dragging]) .mark{cursor:grabbing}
55
+ .mark,.mark[aria-expanded=true]{background:none;color:var(--vitehub-pill-strong)}
56
+ @media(hover:hover){.mark:hover{background:var(--vitehub-pill-hover)}}
57
+ .mark svg{width:16px;height:16px;transition:opacity 160ms ease-out 120ms,scale 160ms ease-out 120ms}
58
+ :host([collapsed]) .mark svg{opacity:0;scale:.6;transition-duration:40ms;transition-delay:0s;transition-timing-function:ease-out}
59
+ :host([collapsed]) .mark:is(:hover,:active){background:none;scale:none}
60
+ :host([collapsed]) .mark{translate:var(--vitehub-mark-x,0) var(--vitehub-mark-y,0);transition:translate 0s 80ms}
61
+ :host([collapsed]) .mark::before{content:"";position:absolute;inset:-8px}
62
+ :host([fold=mark]){transition-property:left,top,right,bottom,translate,filter}
63
+ :host([fold=mark][collapsed]){filter:drop-shadow(0 1px 2px rgb(0 0 0/25%))}
64
+ :host([fold=mark]:not([dragging])) div{transition:clip-path var(--vitehub-pill-morph) var(--vitehub-pill-ease) var(--vitehub-pill-wait,0s),background-color 120ms ease-out,border-color 120ms ease-out,scale 150ms ease-out}
65
+ :host([fold=mark][collapsed]) div,:host([fold=mark][collapsed]) div:hover{clip-path:${p};background-color:transparent;border-color:transparent}
66
+ :host([fold=mark]) .mark{transition-property:background-color,color,scale,translate;transition-duration:150ms,150ms,150ms,var(--vitehub-pill-morph);transition-timing-function:ease-out,ease-out,ease-out,var(--vitehub-pill-ease);transition-delay:0s,0s,0s,var(--vitehub-pill-wait,0s)}
67
+ :host([fold=mark]) .mark svg{transition:scale var(--vitehub-pill-morph) var(--vitehub-pill-ease) var(--vitehub-pill-wait,0s)}
68
+ :host([fold=mark][collapsed]) .mark svg{opacity:1;scale:1.5}
69
+ @media(any-pointer:coarse){:host{--vitehub-hex-h:40px}:host([fold=mark][collapsed]) .mark svg{scale:2.5}}
70
+ @media(prefers-reduced-motion:reduce){:host,div,::slotted(*),.exit,.mark svg,:host([collapsed]) .mark,:host([fold=mark]) :is(div,.mark,.mark svg){transition:none}}`;function g(e,t,n){let r=document.createElementNS(`http://www.w3.org/2000/svg`,`svg`);for(let[t,i]of Object.entries({viewBox:e,"aria-hidden":`true`,...n}))r.setAttribute(t,i);let i=document.createElementNS(`http://www.w3.org/2000/svg`,`path`);return i.setAttribute(`d`,t),r.append(i),r}const _=[`top`,`right`,`bottom`,`left`];function v(e){return _.some(t=>t===e)}function y(e){let t=typeof e==`object`&&e?Reflect.get(e,`edge`):void 0,n=typeof e==`object`&&e?Reflect.get(e,`at`):void 0;return v(t)&&typeof n==`number`&&n>=0&&n<=100?{edge:t,at:n}:void 0}function b(e){try{return y(JSON.parse(localStorage.getItem(e)??`null`))}catch{return}}function x(e,t,n,r){let i=Math.min(70,r/4),a=Math.atan2(t-r/2,e-n/2),o=Math.atan2(i-r/2,-n/2),s=Math.atan2(i-r/2,n/2),c=Math.atan2(r/2-i,n/2),l=Math.atan2(r/2-i,-n/2);return a>=o&&a<=s?`top`:a>s&&a<c?`right`:a>=c&&a<=l?`bottom`:`left`}function S(e,t,n,r,i){let a=i-n-r-t,o=a>0?Math.min(100,Math.max(0,(e-n-t/2)/a*100)):50;return o<2?0:o>98?100:Math.abs(o-50)<3?50:Math.round(o*10)/10}function C(e){let{signal:t}=e,n=document.createElement(e.name);n.style.viewTransitionName=e.name,e.fold===`mark`&&n.setAttribute(`fold`,`mark`);let r=n.attachShadow({mode:`open`}),i=document.createElement(`style`);i.textContent=h;let a=document.createElement(`div`);a.setAttribute(`role`,`toolbar`),a.setAttribute(`aria-label`,e.label);let o=document.createElement(`button`);o.className=`mark`,o.append(e.mark);let s=e.initial?.collapsed===!0,c=t=>{t&&a.scrollTo(0,0),n.toggleAttribute(`collapsed`,t),o.setAttribute(`aria-expanded`,String(!t)),o.setAttribute(`aria-label`,`${t?`Show`:`Hide`} ${e.label}`),o.title=`${o.getAttribute(`aria-label`)}. Drag to move.`},l=()=>e.markOnly?.active()===!0,u=e.markOnly?.opened===!0,d=()=>l()?!u:D(e.storage.collapsed)??s;c(d()),o.addEventListener(`click`,()=>{if(S())return;let t=!n.hasAttribute(`collapsed`);if(c(t),x(_),l()){u=!t;return}try{t===s?localStorage.removeItem(e.storage.collapsed):localStorage.setItem(e.storage.collapsed,t?`1`:`0`)}catch{}});let f=e.exit,p;f&&(p=document.createElement(`button`),p.className=`exit`,p.setAttribute(`aria-label`,f.label),p.title=f.label,p.append(g(`0 0 24 24`,`M18 6 6 18M6 6l12 12`,{width:`15`,height:`15`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`})),p.addEventListener(`click`,e=>f.press(e.detail===0))),a.append(o,...p?[p]:[]);let m=document.createElement(`slot`);m.name=`tab`,m.className=`tabs`,r.append(i,m,a);for(let t of e.slots){let e=document.createElement(`slot`);e.name=t,a.insertBefore(e,p??null)}let _=b(e.storage.dock)??e.initial?.dock??{edge:`bottom`,at:50},v=_,y=()=>_.edge===`left`||_.edge===`right`,x=t=>{_=t,v=l()&&!n.hasAttribute(`dragging`)&&t.edge===`bottom`?{edge:`bottom`,at:t.at<50?0:100}:t,n.setAttribute(`edge`,v.edge),n.style.setProperty(`--at`,String(v.at));let r=n.hasAttribute(`collapsed`),i=r?y()?E(n).width:E(n).height:y()?a.offsetWidth:a.offsetHeight;e.onPlace?.({...v,collapsed:r,thickness:i}),o.style.setProperty(`--vitehub-mark-x`,`${a.clientWidth/2-o.offsetLeft-o.offsetWidth/2}px`),o.style.setProperty(`--vitehub-mark-y`,`${a.clientHeight/2-o.offsetTop-o.offsetHeight/2}px`)},S=T({host:n,handle:o,dock:()=>_,shape:e=>{let t=n.hasAttribute(`collapsed`),r=t?e?n.offsetHeight:n.offsetWidth:e?a.offsetHeight:a.offsetWidth;return{size:r,lead:t?r/2:e?o.offsetTop+o.offsetHeight/2:o.offsetLeft+o.offsetWidth/2,part:t?e?E(n).height:E(n).width:r,margin:t?2:16}},place:x,drop:()=>{x(_);try{localStorage.setItem(e.storage.dock,JSON.stringify({edge:_.edge,at:_.at}))}catch{}},signal:t}),C=/* @__PURE__ */ new Map,w={width:0,height:0},O=()=>{let e=a.getBoundingClientRect();C=new Map([[o,{x:0,y:0}],...[...[...n.children].filter(e=>e.slot!==`tab`),...p?[p]:[]].map(t=>{let n=t.getBoundingClientRect();return[t,{x:n.left-e.left,y:n.top-e.top}]})]),w={width:a.offsetWidth,height:a.offsetHeight}};if(t.aborted)return n;let k=new ResizeObserver(()=>{let e={parts:C,box:w};for(let t of[a,...e.parts.keys()])for(let e of t.getAnimations())e.id===`vitehub-pill-glide`&&e.cancel();if(O(),x(_),!e.box.width||n.hasAttribute(`collapsed`)||n.hasAttribute(`dragging`)||matchMedia(`(prefers-reduced-motion: reduce)`).matches)return;let t={x:w.width-e.box.width,y:w.height-e.box.height},r={x:y()?v.edge===`right`?t.x:0:t.x*v.at/100,y:y()?t.y*v.at/100:v.edge===`bottom`?t.y:0},i={duration:250,easing:`cubic-bezier(.32,.72,0,1)`,id:`vitehub-pill-glide`};for(let[t,n]of C){let a=e.parts.get(t);if(!a)continue;let o=a.x+r.x-n.x,s=a.y+r.y-n.y;(Math.abs(o)>.5||Math.abs(s)>.5)&&t.animate([{translate:`${o}px ${s}px`},{translate:`0 0`}],i)}let o=Math.max(0,r.y),s=Math.max(0,r.x),c=Math.max(0,t.x-r.x),l=Math.max(0,t.y-r.y);(o||s||c||l)&&a.animate([{clipPath:`inset(${o}px ${c}px ${l}px ${s}px round 12px)`},{clipPath:`inset(0 round 12px)`}],i)});return t.addEventListener(`abort`,()=>{n.remove(),k.disconnect()},{once:!0}),(e.parent??document.documentElement).append(n),x(_),t.aborted||(k.observe(a),e.markOnly?.watch(()=>{u=!1;let e=n.contains(document.activeElement);c(d()),e&&n.hasAttribute(`collapsed`)&&o.focus({preventScroll:!0}),x(_)},t)),n}async function w(e){if(e.inert=!0,e.hasAttribute(`collapsed`)||matchMedia(`(prefers-reduced-motion: reduce)`).matches)return;let t=e.shadowRoot?.querySelector(`div`);t&&Object.assign(t.style,{width:`${t.offsetWidth}px`,height:`${t.offsetHeight}px`}),e.setAttribute(`collapsed`,``);let n=t?.getAnimations?.().find(e=>`transitionProperty`in e&&e.transitionProperty===`clip-path`);n&&await Promise.race([n.finished.catch(()=>{}),new Promise(e=>setTimeout(e,400))])}function T(e){let{host:t,handle:n}=e,r,i=!1;return n.style.touchAction=`none`,n.addEventListener(`pointerdown`,a=>{if(a.button!==0||r!==void 0)return;r=a.pointerId,i=!1;let o=n.getBoundingClientRect(),s={x:a.clientX-o.left-o.width/2,y:a.clientY-o.top-o.height/2};n.setPointerCapture(a.pointerId);let c=n=>{if(n.pointerId!==a.pointerId||!i&&Math.hypot(n.clientX-a.clientX,n.clientY-a.clientY)<4)return;i=!0,t.setAttribute(`dragging`,``);let r=document.documentElement.clientWidth,o=document.documentElement.clientHeight,c=n.clientX-s.x,l=n.clientY-s.y,u=x(c,l,r,o);u!==e.dock().edge&&e.place({edge:u,at:e.dock().at});let d=u===`left`||u===`right`,{size:f,lead:p,part:m,margin:h}=e.shape(d),g=(d?l:c)-p+f/2,_=getComputedStyle(t),v=Math.max(h,Number.parseFloat(_.getPropertyValue(d?`--safe-top`:`--safe-left`))||0),y=Math.max(h,Number.parseFloat(_.getPropertyValue(d?`--safe-bottom`:`--safe-right`))||0);e.place({edge:u,at:S(g,m,v,y,d?o:r)})};n.addEventListener(`pointermove`,c);let l=o=>{o.pointerId===a.pointerId&&(n.removeEventListener(`pointermove`,c),n.removeEventListener(`lostpointercapture`,l),r=void 0,i&&(t.removeAttribute(`dragging`),e.drop(),setTimeout(()=>{i=!1})))};n.addEventListener(`lostpointercapture`,l)},{signal:e.signal}),()=>i}function E(e){let t=Number.parseFloat(getComputedStyle(e).getPropertyValue(`--vitehub-hex-h`))||24;return{width:t*10/9,height:t}}function D(e){try{let t=localStorage.getItem(e);return t===`1`||t!==`0`&&void 0}catch{return}}const O=`${i}
71
+ .who{align-self:flex-start;padding:0 3px}
72
+ .avatar{box-sizing:border-box;display:grid;place-items:center;width:22px;height:22px;flex:none;overflow:hidden;border-radius:50%;background:#404040;color:var(--vitehub-pill-strong);font-size:10px;font-weight:600;line-height:1}
73
+ .avatar img{display:block;width:100%;height:100%;object-fit:cover}
74
+ [role=menu]{position:fixed;inset:auto;box-sizing:border-box;width:max-content;min-width:220px;max-width:min(300px,calc(100vw - 16px));margin:0;padding:6px;overflow:visible;border:1px solid var(--vitehub-pill-line);border-radius:12px;background:#171717;color:var(--vitehub-pill-text);font:500 13px/1.3 ui-sans-serif,system-ui,sans-serif;box-shadow:0 16px 40px rgb(0 0 0/30%);color-scheme:dark}
75
+ .me{display:flex;align-items:center;gap:10px;margin-bottom:4px;padding:8px 8px 10px;border-bottom:1px solid var(--vitehub-pill-line)}
76
+ .me .avatar{width:32px;height:32px;font-size:12px}
77
+ .me div{min-width:0}
78
+ .me b,.me small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
79
+ .me b{color:var(--vitehub-pill-strong);font-weight:500}
80
+ .me small{margin-top:2px;color:var(--vitehub-pill-muted);font-size:12px}
81
+ .via{display:flex;align-items:center;gap:6px;padding:6px 8px;color:var(--vitehub-pill-muted);font-size:12px}
82
+ .via svg{width:11px;height:10px;flex:none;fill:var(--vitehub-pill-text)}
83
+ [role=menuitem]{display:flex;width:100%;height:32px;justify-content:flex-start;gap:8px;font-size:13px}
84
+ [role=menuitem] svg{width:15px;height:15px;color:var(--vitehub-pill-muted)}
85
+ [role=menuitem][hidden]{display:none}
86
+ [role=menuitem][aria-disabled=true]{cursor:progress}
87
+ @media(any-pointer:coarse){[role=menuitem]{height:44px}}`;function k(e){return e.trim().split(/\s+/).slice(0,2).map(e=>[...e][0]??``).join(``).toLocaleUpperCase()}function A(e){let t=document.createElement(`span`);if(t.className=`avatar`,t.setAttribute(`aria-hidden`,`true`),t.textContent=k(e.name),e.image){let n=document.createElement(`img`);n.alt=``,n.referrerPolicy=`no-referrer`,n.src=e.image,n.addEventListener(`load`,()=>t.replaceChildren(n),{once:!0})}return t}function j(e,t){let n=document.createElement(`button`);n.type=`button`,n.setAttribute(`role`,`menuitem`),n.tabIndex=-1,n.insertAdjacentHTML(`beforeend`,e);let r=document.createElement(`span`);return r.textContent=t,n.append(r),{item:n,label:r}}function ee(){let n=new URL(location.href);for(let r of[e,...t])n.searchParams.delete(r);return n}function te(e){let{account:t,bar:n,signal:r}=e,i=n.parentElement,a=n.attachShadow({mode:`open`}),o=document.createElement(`style`);o.textContent=O;let s=document.createElement(`div`);s.id=`account-menu`,s.setAttribute(`popover`,`auto`),s.setAttribute(`role`,`menu`),s.setAttribute(`aria-label`,t.name);let c=document.createElement(`button`);c.type=`button`,c.className=`who`,c.title=t.email?`${t.name} (${t.email})`:t.name,c.setAttribute(`aria-label`,`Account: ${t.name}`),c.setAttribute(`aria-haspopup`,`menu`),c.setAttribute(`aria-expanded`,`false`),c.setAttribute(`aria-controls`,s.id),c.setAttribute(`popovertarget`,s.id),c.append(A(t));let l=document.createElement(`div`);l.className=`me`,l.setAttribute(`role`,`none`);let u=document.createElement(`div`),d=document.createElement(`b`);if(d.textContent=t.name,u.append(d),t.email){let e=document.createElement(`small`);e.textContent=t.email,u.append(e)}if(l.append(A(t),u),s.append(l),t.via===`console`){let t=document.createElement(`div`);t.className=`via`,t.setAttribute(`role`,`none`),t.append(g(`0 0 20 18`,e.mark,{}),`Signed in with ViteHub Console`),s.append(t)}let f=j(`<svg viewBox="0 0 24 24" aria-hidden="true" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M7 7h10v10M7 17 17 7"/></svg>`,`Open in the Console`),p=j(`<svg viewBox="0 0 24 24" aria-hidden="true" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m16 17 5-5-5-5M21 12H9M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"/></svg>`,`Sign out of ${location.host}`);s.append(f.item,p.item),a.append(o,c,s);let m=()=>[...s.querySelectorAll(`[role=menuitem]`)].filter(e=>!e.hidden),h,_=e=>{let t=document.documentElement.clientWidth,r=document.documentElement.clientHeight,a=(i??n).getBoundingClientRect(),o=c.getBoundingClientRect(),l={top:`auto`,right:`auto`,bottom:`auto`,left:`auto`};e===`bottom`||e===`top`?(l.right=`${Math.max(8,t-o.right)}px`,e===`bottom`?l.bottom=`${r-a.top+8}px`:l.top=`${a.bottom+8}px`):(o.top<r/2?l.top=`${Math.max(8,o.top)}px`:l.bottom=`${Math.max(8,r-o.bottom)}px`,e===`left`?l.left=`${a.right+8}px`:l.right=`${t-a.left+8}px`),Object.assign(s.style,l)},v=e=>{if(e!==`bottom`&&e!==`top`)return;let t=document.documentElement.clientWidth,n=c.getBoundingClientRect(),r=s.getBoundingClientRect().width;s.style.right=`auto`,s.style.left=`${Math.max(8,Math.min(n.right-r,t-r-8))}px`};if(s.addEventListener(`beforetoggle`,t=>{if(t.newState===`closed`){s.contains(a.activeElement)&&c.focus({preventScroll:!0});return}h=e.openConsole?.(),f.item.hidden=!h;let n=i?.getAttribute(`edge`)??`bottom`;_(n),requestAnimationFrame(()=>v(n))},{signal:r}),s.addEventListener(`toggle`,e=>{let t=e.newState===`open`;c.setAttribute(`aria-expanded`,String(t)),t&&m()[0]?.focus({preventScroll:!0})},{signal:r}),s.addEventListener(`keydown`,e=>{let t=m(),n=t.findIndex(e=>e===a.activeElement),r=e.key===`ArrowDown`?n+1:e.key===`ArrowUp`?n-1:e.key===`Home`?0:e.key===`End`?t.length-1:void 0;r===void 0?e.key===`Escape`?e.stopPropagation():e.key===`Tab`&&s.hidePopover():(e.preventDefault(),t[(r+t.length)%t.length]?.focus())},{signal:r}),f.item.addEventListener(`click`,()=>{s.hidePopover(),h?.()},{signal:r}),p.item.addEventListener(`click`,async()=>{if(p.item.getAttribute(`aria-disabled`)===`true`)return;p.item.setAttribute(`aria-disabled`,`true`),p.label.textContent=`Signing out…`;let e=await fetch(t.signOut,{method:`POST`,credentials:`same-origin`,headers:{"content-type":`application/json`},body:`{}`}).catch(e=>e);if(!(e instanceof Response)||!e.ok){console.error(`[vitehub] The sign-out failed. The session stays.`,e instanceof Response?`The sign-out answered ${e.status}.`:e),p.item.removeAttribute(`aria-disabled`),p.label.textContent=`Could not sign out. Try again`;return}let n=ee();n.href===location.href?location.reload():location.replace(n)},{signal:r}),i){let e=new MutationObserver(e=>{e.some(e=>e.oldValue!==i.getAttribute(e.attributeName??``))&&s.hidePopover()});e.observe(i,{attributes:!0,attributeOldValue:!0,attributeFilter:[`collapsed`,`dragging`,`edge`]}),r.addEventListener(`abort`,()=>e.disconnect(),{once:!0})}r.addEventListener(`abort`,()=>s.hidePopover(),{once:!0})}function M(e,...t){return typeof e==`function`?e(...t):e}const ne=Error.captureStackTrace;var N=class e extends Error{get why(){return this.message}constructor(t,n=e){super(t.why,{cause:t.cause}),this.code=this.name=t.code,this.docs=t.docs,this.fix=t.fix,this.sources=t.sources,this.data=t.data,ne?.(this,n)}toJSON(){return{name:this.name,why:this.why,fix:this.fix,docs:this.docs,sources:this.sources,cause:this.cause,data:this.data,stack:this.stack}}};function re(e,t){return typeof e==`string`?`${e}/${t.toLowerCase()}`:e?.(t)}const P=e=>t=>t instanceof N&&e in t;/* @__NO_SIDE_EFFECTS__ */
88
+ function ie(e){let t=e.reporters??[],n=Symbol(),r=Object.defineProperty({},"is",{value:P(n)}),{docsBase:i}=e;for(let a of Object.keys(e.codes)){let o=e.codes[a],s=o.docs===!1?void 0:o.docs||re(i,a),c=(e={},r={})=>{let i=new N({code:a,why:M(o.why,e),fix:M(o.fix,e),docs:s,cause:e.cause,sources:e.sources,data:M(o.data,e)},c);i[n]=1;for(let e of t)e(i,r);return i};c.is=e=>r.is(e)&&e.code===a,r[a]=c}return r}const ae=/*#__PURE__*/ ie({docsBase:`https://vitehub.dev/docs/development/diagnostics`,codes:{INTERNAL_INVARIANT_FAILED:{why:({what:e})=>`ViteHub reached a state that it does not expect: ${e}`,fix:`This is a ViteHub bug. Open an issue at https://github.com/vite-hub/vitehub/issues with this error message and its stack trace.`}}});function oe(e){return ae.INTERNAL_INVARIANT_FAILED({what:e})}function se(e,t){if(!e)throw oe(t)}let F={edge:`bottom`,at:50};const I=/* @__PURE__ */ new Set;let ce=0;function L(e){e.setAttribute(`edge`,F.edge),e.toggleAttribute(`collapsed`,!!F.collapsed),e.style.setProperty(`--at`,String(F.at)),F.thickness?e.style.setProperty(`--thickness`,`${F.thickness}px`):e.style.removeProperty(`--thickness`);for(let t of[`top`,`right`,`bottom`,`left`])e.shadowRoot.querySelector(`.grip.${t}`).hidden=R(t)===0}function R(e){return(e===`top`||e===`bottom`)==(F.edge===`top`||F.edge===`bottom`)?1:e===`top`||e===`left`?F.at/100:1-F.at/100}function le(e){F=e;for(let e of I)L(e)}function z(e){let t=document.createElementNS(`http://www.w3.org/2000/svg`,`svg`);for(let[e,n]of Object.entries({width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.75`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`}))t.setAttribute(e,n);let n=document.createElementNS(`http://www.w3.org/2000/svg`,`path`);return n.setAttribute(`d`,e),t.append(n),t}function ue(e){let t=document.createElement(`vitehub-window`);t.hidden=!0;let n=t.attachShadow({mode:`open`}),r=document.createElement(`style`);r.textContent=`
89
+ :host{all:initial;--surface:light-dark(#fff,#0a0a0a);--text:light-dark(#18181b,#fafafa);--muted:light-dark(#71717a,#a1a1aa);--line:light-dark(rgb(0 0 0/8%),rgb(255 255 255/9%));--hover:light-dark(rgb(0 0 0/5%),rgb(255 255 255/7%));--focus:light-dark(#18181b,#fafafa);--safe-top:env(safe-area-inset-top,0px);--safe-right:env(safe-area-inset-right,0px);--safe-bottom:env(safe-area-inset-bottom,0px);--safe-left:env(safe-area-inset-left,0px);--at:50;--margin:16px;--start:max(var(--margin),var(--safe-left));--end:max(var(--margin),var(--safe-right));--far:max(16px,var(--safe-top));--along:calc(var(--start) + (100% - var(--start) - var(--end)) * var(--at) / 100);--shift:calc(var(--at) * -1%);--dock:calc(max(var(--margin),var(--safe-bottom)) + var(--thickness,38px) + 8px);--width:calc(100vw - var(--start) - var(--end));--height:calc(100dvh - var(--dock) - var(--far));position:fixed;inset:0;z-index:2147483000;pointer-events:none;color:var(--text);font:400 .875rem/1.5 system-ui,sans-serif;color-scheme:light dark;transition:display 150ms allow-discrete}
90
+ :host([collapsed]){--margin:2px}
91
+ :host([edge=top]){--dock:calc(max(var(--margin),var(--safe-top)) + var(--thickness,38px) + 8px);--far:max(16px,var(--safe-bottom))}
92
+ :host(:is([edge=left],[edge=right])){--start:max(var(--margin),var(--safe-top));--end:max(var(--margin),var(--safe-bottom));--width:calc(100vw - var(--dock) - var(--far));--height:calc(100dvh - var(--start) - var(--end))}
93
+ :host([edge=right]){--dock:calc(max(var(--margin),var(--safe-right)) + var(--thickness,38px) + 8px);--far:max(16px,var(--safe-left))}
94
+ :host([edge=left]){--dock:calc(max(var(--margin),var(--safe-left)) + var(--thickness,38px) + 8px);--far:max(16px,var(--safe-right))}
3
95
  :host([hidden]){display:none}
4
- .window{position:absolute;right:16px;bottom:76px;width:min(600px,calc(100vw - 32px));height:min(640px,calc(100dvh - 100px));min-width:300px;min-height:240px;max-width:calc(100vw - 32px);max-height:calc(100dvh - 100px);display:flex;flex-direction:column;overflow:hidden;resize:both;pointer-events:auto;background:var(--surface);border:1px solid var(--line);border-radius:12px;box-shadow:0 8px 32px #0002}
5
- .window.expanded{inset:12px 12px 76px;width:auto!important;height:auto!important;max-width:none;max-height:none;resize:none}
6
- header{display:flex;align-items:center;gap:4px;min-height:44px;padding:0 8px;border-bottom:1px solid var(--line);flex:none}
96
+ .window{position:absolute;width:min(600px,var(--width));height:min(640px,var(--height));min-width:min(300px,var(--width));min-height:min(240px,var(--height));max-width:var(--width);max-height:var(--height);display:flex;flex-direction:column;pointer-events:auto;background:var(--surface);border-radius:12px;box-shadow:0 0 0 1px light-dark(rgb(0 0 0/8%),rgb(255 255 255/10%)),0 2px 4px light-dark(rgb(0 0 0/4%),rgb(0 0 0/24%)),0 16px 40px -8px light-dark(rgb(0 0 0/18%),rgb(0 0 0/56%));outline:none;transition:opacity 200ms cubic-bezier(.23,1,.32,1),scale 200ms cubic-bezier(.23,1,.32,1)}
97
+ :host([edge=bottom]) .window{bottom:var(--dock);left:var(--along);translate:var(--shift) 0;transform-origin:calc(var(--at) * 1%) 100%}
98
+ :host([edge=top]) .window{top:var(--dock);left:var(--along);translate:var(--shift) 0;transform-origin:calc(var(--at) * 1%) 0}
99
+ :host([edge=right]) .window{right:var(--dock);top:var(--along);translate:0 var(--shift);transform-origin:100% calc(var(--at) * 1%)}
100
+ :host([edge=left]) .window{left:var(--dock);top:var(--along);translate:0 var(--shift);transform-origin:0 calc(var(--at) * 1%)}
101
+ @starting-style{.window{opacity:0;scale:.96}}
102
+ :host([hidden]) .window{opacity:0;scale:.96;transition-duration:150ms;transition-timing-function:ease-in}
103
+ :host([edge]) .window.expanded{inset:max(12px,var(--safe-top)) max(12px,var(--safe-right)) max(12px,var(--safe-bottom)) max(12px,var(--safe-left));translate:none;width:auto!important;height:auto!important;max-width:none;max-height:none}
104
+ :host([edge=bottom]) .window.expanded{bottom:var(--dock)}:host([edge=top]) .window.expanded{top:var(--dock)}:host([edge=right]) .window.expanded{right:var(--dock)}:host([edge=left]) .window.expanded{left:var(--dock)}
105
+ .frame{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden;border-radius:inherit}
106
+ .grip{position:absolute;z-index:1;touch-action:none}
107
+ .grip.top,.grip.bottom{left:12px;right:12px;height:8px;cursor:ns-resize}
108
+ .grip.top{top:-4px}.grip.bottom{bottom:-4px}
109
+ .grip.left,.grip.right{top:12px;bottom:12px;width:8px;cursor:ew-resize}
110
+ .grip.left{left:-4px}.grip.right{right:-4px}
111
+ :host([edge=bottom]) .grip.bottom,:host([edge=top]) .grip.top,:host([edge=right]) .grip.right,:host([edge=left]) .grip.left,.expanded .grip{display:none}
112
+ header{display:flex;align-items:center;gap:2px;min-height:44px;padding:0 6px 0 8px;border-bottom:1px solid var(--line);flex:none}
7
113
  h2{font:600 .875rem/1.5 system-ui,sans-serif;margin:0;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:0 8px}
8
- button{display:grid;place-items:center;width:36px;height:36px;border:0;border-radius:6px;background:transparent;color:var(--muted);cursor:pointer;font:inherit}
9
- button:hover{background:var(--hover);color:var(--text)}
10
- button:focus-visible{outline:2px solid var(--focus);outline-offset:-2px}
114
+ header :is(button,a){display:grid;place-items:center;width:32px;height:32px;border:0;border-radius:8px;background:transparent;color:var(--muted);cursor:pointer;font:inherit;touch-action:manipulation;transition:background-color 150ms ease-out,color 150ms ease-out}
115
+ header a[hidden]{display:none}
116
+ @media(hover:hover){header :is(button,a):hover{background:var(--hover);color:var(--text)}}
117
+ header :is(button,a):focus-visible{outline:2px solid var(--focus);outline-offset:-2px}
118
+ @media(any-pointer:coarse){:host{--thickness:54px}.grip{display:none}header :is(button,a){width:44px;height:44px}}
11
119
  .body{flex:1;min-height:0;overflow:auto;position:relative}iframe{display:block;border:0;width:100%;height:100%;background:var(--surface)}
12
- @media(max-width:640px){.window,.window.expanded{inset:0 0 68px;width:auto!important;height:auto!important;max-width:none;max-height:none;min-width:0;min-height:0;border-radius:0;resize:none}button{width:44px;height:44px}.expand{display:none}}
13
- @media(forced-colors:active){.window{border:1px solid CanvasText}button:focus-visible{outline-color:Highlight}}
14
- `;let a=document.createElement(`section`);a.className=`window`,a.setAttribute(`role`,`dialog`),a.setAttribute(`aria-labelledby`,`title`);let o=document.createElement(`header`),s=document.createElement(`h2`);s.id=`title`,s.textContent=t.title;let c=document.createElement(`div`);c.className=`body`;let l=(t,n,r)=>{let i=document.createElement(`button`);return i.className=t,i.type=`button`,i.setAttribute(`aria-label`,n),i.title=n,i.append(e(r)),i},u=l(`expand`,`Expand window`,`M8 3H3v5m13-5h5v5M3 16v5h5m13-5v5h-5`),d=l(`hide`,`Minimize window`,`M5 12h14`);o.append(s,u,d),a.append(o,c),r.append(i,a);let f=`vitehub-window:${t.id}`;try{let e=JSON.parse(localStorage.getItem(f)??`null`);e&&typeof e==`object`&&`width`in e&&`height`in e&&typeof e.width==`number`&&typeof e.height==`number`&&(Number.isFinite(e.width)&&(a.style.width=`${Math.max(300,e.width)}px`),Number.isFinite(e.height)&&(a.style.height=`${Math.max(240,e.height)}px`))}catch{}let p=new ResizeObserver(()=>{if(n.hidden||a.classList.contains(`expanded`)||innerWidth<=640)return;let{width:e,height:t}=a.getBoundingClientRect();try{localStorage.setItem(f,JSON.stringify({width:e,height:t}))}catch{}});p.observe(a);let m=()=>{n.hidden=!0,t.trigger.setAttribute(`aria-expanded`,`false`),t.trigger.focus({preventScroll:!0}),t.onHide?.()};u.addEventListener(`click`,()=>{let e=a.classList.toggle(`expanded`);u.setAttribute(`aria-label`,e?`Restore window size`:`Expand window`),u.title=e?`Restore window size`:`Expand window`,u.setAttribute(`aria-pressed`,String(e))}),d.addEventListener(`click`,m),r.addEventListener(`keydown`,e=>{e instanceof KeyboardEvent&&e.key===`Escape`&&!e.defaultPrevented&&(e.preventDefault(),e.stopPropagation(),m())});let h=()=>{p.disconnect(),n.remove()};return t.signal.aborted?h():(t.signal.addEventListener(`abort`,h,{once:!0}),document.body.append(n)),{body:c,show(){t.signal.aborted||(n.style.colorScheme=getComputedStyle(t.trigger).colorScheme,n.hidden=!1,t.trigger.setAttribute(`aria-expanded`,`true`),d.focus({preventScroll:!0}))},hide:m,destroy:h}}const n=`vitehub`,r=`/_vitehub/page/session`;function i(e){let t=new URL(e,`http://localhost`).pathname,n=t.lastIndexOf(`/_vitehub/page/assets/`);return n===-1?r:`${t.slice(0,n)}${r}`}function a(e){return typeof e==`string`&&e?e:void 0}function o(e){if(typeof e!=`object`||!e)return;let t=a(Reflect.get(e,`id`)),n=a(Reflect.get(e,`script`));if(!t||!n)return;let r={id:t,label:a(Reflect.get(e,`label`))??t,icon:a(Reflect.get(e,`icon`))??``,script:n};Reflect.get(e,`lazy`)===!0&&(r.lazy=!0);let i=a(Reflect.get(e,`hotkey`));return i&&(r.hotkey=i),r}function s(e){let t=typeof e==`object`&&e?Reflect.get(e,`tools`):void 0;return{tools:Array.isArray(t)?t.map(o).filter(e=>!!e):[]}}function c(e){let t=typeof e==`object`&&e?Reflect.get(e,`default`):void 0;return t instanceof Function?t:void 0}function l(){let e=document.documentElement;if(e.classList.contains(`dark`)||e.dataset.theme===`dark`)return!0;if(e.classList.contains(`light`)||e.dataset.theme===`light`)return!1;let t=getComputedStyle(e).colorScheme;return t===`dark`||t.includes(`dark`)&&matchMedia(`(prefers-color-scheme: dark)`).matches}function u(e,t,n){let r=document.createElement(`vitehub-pill`),i=r.attachShadow({mode:`open`}),a=document.createElement(`style`);a.textContent=`:host{all:initial;position:fixed;left:50%;bottom:16px;translate:-50% 0;z-index:2147483001;font-size:13px;line-height:1.5;color:light-dark(#3f3f46,#e4e4e7);-webkit-font-smoothing:antialiased}
15
- div{max-width:calc(100vw - 24px);overflow-x:auto;--line:light-dark(#0000000f,#ffffff12);display:flex;align-items:center;gap:2px;padding:4px;border-radius:999px;background:light-dark(#fff,#1c1c1f);box-shadow:0 0 0 1px light-dark(#00000014,#ffffff1a),0 1px 2px #0000000a,0 8px 24px -6px light-dark(#00000029,#0009)}
16
- ::slotted(*){flex-shrink:0;display:flex;align-items:center;padding-right:5px;margin-right:3px;background:linear-gradient(var(--line),var(--line)) right/1px 16px no-repeat}
17
- ::slotted([hidden]){display:none!important}
18
- button{all:unset;flex-shrink:0;position:sticky;right:0;width:32px;height:32px;border-radius:50%;display:grid;place-items:center;cursor:pointer;color:light-dark(#71717a,#a1a1aa)}
19
- button:hover{background:light-dark(#0000000d,#ffffff0f);color:light-dark(#18181b,#fafafa)}
20
- :focus-visible{outline:2px solid #2563eb;outline-offset:2px}`;let o=document.createElement(`div`);o.setAttribute(`role`,`toolbar`),o.setAttribute(`aria-label`,`ViteHub tools`);let s=document.createElement(`button`);s.setAttribute(`aria-label`,`Turn off ViteHub tools`),s.title=`Turn off ViteHub tools`;let c=document.createElementNS(`http://www.w3.org/2000/svg`,`svg`);for(let[e,t]of Object.entries({width:`15`,height:`15`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"aria-hidden":`true`}))c.setAttribute(e,t);let u=document.createElementNS(`http://www.w3.org/2000/svg`,`path`);u.setAttribute(`d`,`M18 6 6 18M6 6l12 12`),c.append(u),s.append(c),o.append(s),i.append(a,o);for(let t of e){let e=document.createElement(`slot`);e.name=t.id,o.insertBefore(e,s)}s.addEventListener(`click`,t),r.style.fontFamily=getComputedStyle(document.body).fontFamily;let d=()=>{r.style.colorScheme=l()?`dark`:`light`};d();let f=new MutationObserver(d);return f.observe(document.documentElement,{attributes:!0,attributeFilter:[`class`,`style`,`data-theme`]}),matchMedia(`(prefers-color-scheme: dark)`).addEventListener(`change`,d,{signal:n}),n.addEventListener(`abort`,()=>{f.disconnect(),r.remove()},{once:!0}),document.body.append(r),r}async function d(e={}){let r=new URLSearchParams(location.search);if(!r.has(`vitehub`)&&!document.cookie.split(`;`).some(e=>e.trim()===`vitehub-tools=1`))return[];let a=e.load??(e=>import(
120
+ @media(max-width:640px){:host([edge]) .window,:host([edge]) .window.expanded{inset:var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left);translate:none;width:auto!important;height:auto!important;max-width:none;max-height:none;min-width:0;min-height:0;border-radius:0}:host([edge=bottom]) :is(.window,.window.expanded){bottom:var(--dock)}:host([edge=top]) :is(.window,.window.expanded){top:var(--dock)}:host([edge=right]) :is(.window,.window.expanded){right:var(--dock)}:host([edge=left]) :is(.window,.window.expanded){left:var(--dock)}:host(:is([edge=top],[edge=bottom])) .window:not(.expanded){left:var(--start);right:var(--end)}:host(:is([edge=left],[edge=right])) .window:not(.expanded){top:var(--start);bottom:var(--end)}.grip{display:none}header :is(button,a){width:44px;height:44px}.expand{display:none}}
121
+ @media(prefers-reduced-motion:reduce){:host,.window{transition:none}}
122
+ @media(forced-colors:active){.window{border:1px solid CanvasText}header :is(button,a):focus-visible{outline-color:Highlight}}
123
+ `;let i=document.createElement(`section`);i.className=`window`,i.setAttribute(`role`,`dialog`),i.setAttribute(`aria-labelledby`,`title`),i.tabIndex=-1;let a=document.createElement(`header`),o=document.createElement(`h2`);o.id=`title`,o.textContent=e.title;let s=document.createElement(`div`);s.className=`body`;let c=(e,t,n)=>{let r=document.createElement(`button`);return r.className=e,r.type=`button`,r.setAttribute(`aria-label`,t),r.title=t,r.append(z(n)),r},l=c(`expand`,`Expand window`,`M8 3H3v5m13-5h5v5M3 16v5h5m13-5v5h-5`),u=c(`hide`,`Minimize window`,`M5 12h14`),d=document.createElement(`a`);d.className=`tab`,d.target=`_blank`,d.rel=`noopener`,d.setAttribute(`aria-label`,`Open in new tab`),d.title=`Open in new tab`,d.append(z(`M15 3h6v6M10 14 21 3M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`));let f=()=>{let t=e.href?.();d.hidden=!t,t?d.href=t:d.removeAttribute(`href`)};for(let e of[`pointerenter`,`pointerdown`,`focus`,`click`,`contextmenu`])d.addEventListener(e,f);f(),a.append(o,...e.href?[d]:[],l,u);let p=document.createElement(`div`);p.className=`frame`,p.append(a,s);let m=[`top`,`right`,`bottom`,`left`].map(e=>{let t=document.createElement(`div`);return t.className=`grip ${e}`,t.addEventListener(`pointerdown`,n=>{if(n.button!==0)return;let r=R(e);if(r===0)return;n.preventDefault(),t.setPointerCapture(n.pointerId);let a=e===`top`||e===`bottom`,o=a?i.offsetHeight:i.offsetWidth,s=t=>{let s=a?t.clientY-n.clientY:t.clientX-n.clientX,c=o+(e===`top`||e===`left`?-s:s)/r;a?i.style.height=`${Math.max(240,c)}px`:i.style.width=`${Math.max(300,c)}px`};t.addEventListener(`pointermove`,s),t.addEventListener(`lostpointercapture`,()=>t.removeEventListener(`pointermove`,s),{once:!0})}),t});i.append(p,...m),n.append(r,i);let h=`vitehub-window:${e.id}`;try{let e=JSON.parse(localStorage.getItem(h)??`null`);e&&typeof e==`object`&&`width`in e&&`height`in e&&typeof e.width==`number`&&typeof e.height==`number`&&(Number.isFinite(e.width)&&(i.style.width=`${Math.max(300,e.width)}px`),Number.isFinite(e.height)&&(i.style.height=`${Math.max(240,e.height)}px`))}catch{}let g=new ResizeObserver(()=>{if(t.hidden||i.classList.contains(`expanded`)||innerWidth<=640)return;let e=i.offsetWidth,n=i.offsetHeight;try{localStorage.setItem(h,JSON.stringify({width:e,height:n}))}catch{}});g.observe(i);let _=()=>{t.hidden=!0,e.trigger.setAttribute(`aria-expanded`,`false`),e.trigger.focus({preventScroll:!0}),e.onHide?.()};l.addEventListener(`click`,()=>{let e=i.classList.toggle(`expanded`);l.setAttribute(`aria-label`,e?`Restore window size`:`Expand window`),l.title=e?`Restore window size`:`Expand window`,l.setAttribute(`aria-pressed`,String(e))}),u.addEventListener(`click`,_),e.colorScheme&&addEventListener(`storage`,()=>{t.style.colorScheme=e.colorScheme?.()??``},{signal:e.signal}),n.addEventListener(`keydown`,e=>{e instanceof KeyboardEvent&&e.key===`Escape`&&!e.defaultPrevented&&(e.preventDefault(),e.stopPropagation(),_())}),t.style.viewTransitionName=`vitehub-window-${++ce}`,L(t);let v=()=>{I.delete(t),g.disconnect(),t.remove()};return e.signal.aborted?v():(e.signal.addEventListener(`abort`,v,{once:!0}),I.add(t),document.documentElement.append(t)),{body:s,show(){e.signal.aborted||(t.style.colorScheme=e.colorScheme?.()??``,f(),t.hidden=!1,e.trigger.setAttribute(`aria-expanded`,`true`),i.focus({preventScroll:!0}))},hide:_,destroy:v}}function de(e){let t=typeof e==`object`&&e?Reflect.get(e,`default`):void 0;return t instanceof Function?t:void 0}const B=`vitehub-tools-off`,V=`vitehub-tools-collapsed`,H=`vitehub-tools-dock`,U=`vitehub-account`,W=`M19.734 8.156 15.576.844A1.66 1.66 0 0 0 14.135 0H5.819C5.226 0 4.677.32 4.38.844L.222 8.156a1.71 1.71 0 0 0 0 1.688l4.158 7.312c.297.523.846.844 1.439.844h8.316c.593 0 1.142-.32 1.438-.844l4.158-7.312c.3-.523.3-1.165.003-1.688Z`;function fe(){try{return localStorage.getItem(B)===`1`}catch{return!1}}function G(e){try{e?localStorage.setItem(B,`1`):localStorage.removeItem(B)}catch{}}function K(){return document.documentElement.getAttribute(`data-vitehub-pill`)===`mark`||q}let q=!1,J=!1;function Y(){try{return localStorage.getItem(H)}catch{return null}}function X(){if(J||typeof document.elementsFromPoint!=`function`)return!1;let e=e=>{let t=e.getBoundingClientRect();return t.width*t.height<innerWidth*innerHeight/2},t=Array.from({length:36},(e,t)=>[Math.min(innerWidth-1,Math.max(0,innerWidth/2-140+t%18*16+8)),innerHeight-(t<18?24:44)]),n=/* @__PURE__ */ new Set;for(let[r,i]of t)for(let t of document.elementsFromPoint(r,i))if(!n.has(t)){n.add(t);for(let n=t;n&&n!==document.body&&n!==document.documentElement&&!n.localName.startsWith(`vitehub-`);n=n.parentElement){let r=getComputedStyle(n);if(r.position===`fixed`||r.position===`sticky`&&r.bottom!==`auto`){if(e(n)||n!==t&&e(t))return!0;break}if(/auto|scroll/.test(r.overflowY)&&n.scrollHeight>n.clientHeight)break}}return!1}function pe(e){return e.edge===`bottom`?{edge:`bottom`,at:e.at<50?0:100}:e}function Z(e,t){let n=K(),r=Y(),i=()=>{J||=Y()!==r;let t=q;if(q=X(),t&&!q&&J&&document.querySelector(`vitehub-pill`)?.hasAttribute(`collapsed`))try{localStorage.setItem(V,`1`)}catch{}K()!==n&&(n=!n,e())},a=new MutationObserver(i);a.observe(document.documentElement,{attributes:!0,attributeFilter:[`data-vitehub-pill`]});let o,s=()=>{o??=setTimeout(()=>{o=void 0,i()},200)},c=new MutationObserver(e=>{e.some(e=>!(e.target instanceof Element&&e.target.localName.startsWith(`vitehub-`)))&&s()});c.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`hidden`,`class`,`style`]}),addEventListener(`scroll`,s,{capture:!0,passive:!0,signal:t}),addEventListener(`resize`,s,{signal:t}),addEventListener(`storage`,e=>{(e.key===null||e.key===H)&&(r=Y()),s()},{signal:t}),document.addEventListener(`pointerup`,s,{signal:t}),t.addEventListener(`abort`,()=>{a.disconnect(),c.disconnect(),clearTimeout(o)},{once:!0})}function Q(e,t,n,r){if(e.aborted)return;let i=document.createElement(`vitehub-tools-off`);i.setAttribute(`off`,``),i.setAttribute(`collapsed`,``),r&&i.setAttribute(`closing`,``),i.style.viewTransitionName=`vitehub-pill`;let a=b(H)??{edge:`bottom`,at:50},o=()=>{let e=K()&&!i.hasAttribute(`dragging`)?pe(a):a;i.setAttribute(`edge`,e.edge),i.style.setProperty(`--at`,String(e.at))};o();let s=new AbortController;e.addEventListener(`abort`,()=>{s.abort(),i.remove()},{once:!0,signal:s.signal}),Z(o,s.signal);let c=i.attachShadow({mode:`open`}),l=document.createElement(`style`);l.textContent=`${h}\n:host([off]){--vitehub-hex-h:14px;filter:drop-shadow(0 1px 2px rgb(0 0 0/25%))}
124
+ :host([off]) button{position:relative;display:block;width:var(--vitehub-hex-w);min-width:0;height:var(--vitehub-hex-h);padding:0;border-radius:4px;pointer-events:auto;cursor:grab;opacity:.55;transition:opacity 150ms ease-out;animation:vitehub-off-in 200ms cubic-bezier(.23,1,.32,1)}
125
+ :host([off][edge=bottom]) button{transform-origin:calc(var(--at) * 1%) 100%}
126
+ :host([off][edge=top]) button{transform-origin:calc(var(--at) * 1%) 0}
127
+ :host([off][edge=left]) button{transform-origin:0 calc(var(--at) * 1%)}
128
+ :host([off][edge=right]) button{transform-origin:100% calc(var(--at) * 1%)}
129
+ :host([off][closing]) button{animation:vitehub-off-from-pill 240ms cubic-bezier(.23,1,.32,1)}
130
+ :host([off][dragging]) button{opacity:1;cursor:grabbing}
131
+ :host([off]) button::before{content:"";position:absolute;inset:-6px}
132
+ svg{display:block;width:100%;height:100%;overflow:visible;fill:rgb(17 17 17/92%);stroke:rgb(255 255 255/18%);stroke-width:1px;vector-effect:non-scaling-stroke;transition:fill 150ms ease-out,scale 150ms ease-out}
133
+ :host([off]) button:focus-visible{opacity:1}
134
+ :host([off][dragging]) svg{scale:none}
135
+ @media(hover:hover){:host([off]) button:hover{opacity:1;background:none}button:hover svg{fill:rgb(38 38 38/94%)}}
136
+ button:active svg{scale:.96}
137
+ @media(any-pointer:coarse){:host([off]){--vitehub-hex-h:20px}:host([off]) button{min-width:0;height:var(--vitehub-hex-h)}:host([off]) button::before{inset:-10px}}
138
+ @keyframes vitehub-off-in{from{opacity:0;scale:.6}}
139
+ @keyframes vitehub-off-from-pill{from{opacity:1;scale:var(--vitehub-off-from)}}
140
+ @media(prefers-reduced-motion:reduce){:host([off]) button,svg{animation:none;transition:none}}`;let u=document.createElement(`button`);u.type=`button`,u.setAttribute(`aria-label`,`Turn on ViteHub tools`),u.title=`Turn on ViteHub tools`,u.append(g(`0 0 20 18`,W,{})),c.append(l,u),document.documentElement.append(i),r&&(i.style.setProperty(`--vitehub-off-from`,String(r/E(i).height)),u.addEventListener(`animationend`,()=>i.removeAttribute(`closing`),{once:!0}));let d=T({host:i,handle:u,dock:()=>a,shape:e=>{let t=e?i.offsetHeight:i.offsetWidth,n=E(i);return{size:t,lead:t/2,part:e?n.height:n.width,margin:2}},place:e=>{a=e,o()},drop:()=>{o();try{localStorage.setItem(H,JSON.stringify(a))}catch{}},signal:s.signal});u.addEventListener(`click`,()=>{d()||(s.abort(),i.remove(),t())}),n&&u.focus({preventScroll:!0})}async function me(e={}){return await $(e,!1)}let he=new AbortController;async function $(t,r){let o=new URLSearchParams(location.search);if(!n(location.search,document.cookie))return[];let{signal:s}=he;J=b(H)!==void 0,q=X();let c=t.load??(e=>import(
21
141
  /* @vite-ignore */
22
- e)),o;try{let t=await fetch(e.session??i(import.meta.url),{credentials:`same-origin`,headers:{accept:`application/json`}});if(!t.ok)return[];o=s(await t.json())}catch{return[]}if(o.tools.length===0||document.querySelector(`vitehub-pill`))return[];let l=r.get(n),d=o.tools.some(e=>e.id===l),f=new AbortController,p=o.tools.map(()=>new AbortController),m=/* @__PURE__ */ new Set,h=()=>{if([...m].some(e=>!e()))return;for(let e of o.tools)y(e.id,!1);document.cookie=`vitehub-tools=; Path=/; Max-Age=0; SameSite=Lax`;let e=new URL(location.href);e.searchParams.has(`vitehub`)&&(e.searchParams.delete(n),history.replaceState(history.state,``,e));for(let e of p)e.abort();f.abort()},g=u(o.tools,h,f.signal),_=/* @__PURE__ */ new Map,v=t=>`vitehub-open:${e.session??i(import.meta.url)}:${t}`,y=(e,t)=>{try{sessionStorage.setItem(v(e),String(t))}catch{}},b=e=>{try{return sessionStorage.getItem(v(e))===`true`}catch{return!1}},x=/* @__PURE__ */ new Map,S=async(e,t)=>await x.get(e)?.(t)??!1,C=(await Promise.all(o.tools.map(async(e,n)=>{let{signal:r}=p[n],i=document.createElement(`vitehub-tool`);i.slot=e.id,g.append(i);let o,s,u=!1,f=()=>{let t=document.createElement(`vitehub-tool`);t.slot=e.id,i.replaceWith(t),i=t},v=()=>{let e=i.attachShadow({mode:`open`}),t=document.createElement(`style`);t.textContent=`button{all:unset;display:block;box-sizing:border-box;font:inherit;color:inherit;border-radius:999px;padding:0 12px;min-height:36px;cursor:pointer}button:focus-visible{outline:2px solid #2563eb;outline-offset:-2px}`,e.append(t,w)},C=(n,d=!0)=>r.aborted?Promise.resolve(!1):u?(o?.(n),Promise.resolve(!0)):s?s.then(e=>(e&&o?.(n),e)):(s=(async()=>{let p=new AbortController,g=()=>p.abort();r.addEventListener(`abort`,g,{once:!0});try{i.setAttribute(`aria-busy`,`true`);let s=c(await a(e.script));if(!s)throw TypeError(`The script ${e.script} has no default export function.`);if(r.aborted)return!1;w.remove(),i.shadowRoot?f():i.replaceChildren();let g=s({beforeExit:e=>{let t=()=>e();m.add(t),p.signal.addEventListener(`abort`,()=>m.delete(t),{once:!0})},tool:e,bar:i,signal:p.signal,open:d&&(e.lazy===!0||e.id===l||b(e.id)),exit:h,createWindow:n=>{let r=t({...n,signal:p.signal,onHide:()=>{y(e.id,!1),n.onHide?.()}}),i={...r,show(){if(!p.signal.aborted){for(let[t,n]of _)t!==e.id&&n.hide();y(e.id,!0),r.show()}},destroy(){_.get(e.id)===i&&(_.delete(e.id),y(e.id,!1)),r.destroy()}};return _.set(e.id,i),i},openTool:S,onOpen:e=>{o=e}});return u=!0,n&&o?.(n),!i.shadowRoot&&!i.hasChildNodes()&&(i.hidden=!0),g instanceof Function&&(r.aborted?g():p.signal.addEventListener(`abort`,()=>g(),{once:!0})),!r.aborted}catch(t){return p.abort(),r.removeEventListener(`abort`,g),_.delete(e.id)&&y(e.id,!1),o=void 0,u=!1,console.error(`[vitehub] The page tool "${e.id}" did not start.`,t),e.lazy?(f(),w.textContent=`Retry ${e.label}`,w.title=`The tool could not load. Try again.`,i.hidden=!1,v()):(x.delete(e.id),i.remove()),!1}finally{i.removeAttribute(`aria-busy`),s=void 0}})(),s),w=document.createElement(`button`);if(w.type=`button`,w.textContent=e.label,w.addEventListener(`click`,()=>void C()),x.set(e.id,C),e.lazy&&e.id!==l&&!b(e.id))return v(),e;let T=await C(void 0,!d||e.id===l);return!r.aborted&&(T||e.lazy)?e:void 0}))).filter(e=>!!e);return C.length===0&&f.abort(),C}d({session:new URL(`../session`,import.meta.url).pathname});
142
+ e)),u;try{let e=new URL(t.session??a(import.meta.url),location.href);e.searchParams.set(`page`,location.pathname);let n=await fetch(e.origin===location.origin?`${e.pathname}${e.search}`:e.href,{credentials:`same-origin`,headers:{accept:`application/json`}});if(!n.ok)return[];u=l(await n.json())}catch{return[]}if(s.aborted||u.tools.length===0||document.querySelector(`vitehub-pill, vitehub-tools-off`))return[];let d=u.tools.find(e=>e.param&&o.has(e.param));if(o.has(`vitehub`)||d)G(!1);else if(fe())return Q(s,()=>{G(!1),$(t,!0)},!1),[];let f=o.get(`vitehub`)||d?.id,p=u.tools.some(e=>e.id===f),m=new AbortController,h=u.tools.map(()=>new AbortController);s.addEventListener(`abort`,()=>{for(let e of h)e.abort();m.abort()},{once:!0,signal:m.signal});let _=/* @__PURE__ */ new Set,v=!1,y=(n=!1)=>{if(v||[..._].some(e=>!e()))return;v=!0;let r=u.tools.filter(e=>O(e.id));for(let e of u.tools)D(e.id,!1);G(!0);let i=new URL(location.href);i.searchParams.delete(e);for(let e of u.tools)e.param&&i.searchParams.delete(e.param);i.href!==location.href&&history.replaceState(history.state,``,i);let a=x.hasAttribute(`collapsed`)?void 0:E(x).height,o=w(x);for(let e of h)e.abort();o.then(()=>{m.abort(),Q(s,()=>{G(!1);for(let e of r)D(e.id,!0);$(t,!0)},n,a&&!matchMedia(`(prefers-reduced-motion: reduce)`).matches?a:void 0)})},x=C({name:`vitehub-pill`,label:`ViteHub tools`,mark:g(`0 0 20 18`,W,{fill:`currentColor`}),slots:[...u.tools.map(e=>e.id),...u.account?[U]:[]],storage:{collapsed:V,dock:H},exit:{label:`Turn off ViteHub tools`,press:y},onPlace:le,markOnly:{active:K,watch:Z,opened:r},signal:m.signal});if(u.account){let e=document.createElement(`vitehub-account`);e.slot=U,x.append(e),te({account:u.account,bar:e,mark:W,openConsole:()=>{let e=x.querySelector(`vitehub-tool[slot="console"]`);return e&&!e.hidden?()=>void A(`console`):void 0},signal:m.signal})}let S=/* @__PURE__ */ new Map,T=e=>`vitehub-open:${t.session??a(import.meta.url)}:${e}`,D=(e,t)=>{try{sessionStorage.setItem(T(e),String(t))}catch{}},O=e=>{try{return sessionStorage.getItem(T(e))===`true`}catch{return!1}},k=/* @__PURE__ */ new Map,A=async(e,t)=>await k.get(e)?.(t)??!1,j=(await Promise.all(u.tools.map(async(e,t)=>{let{signal:n}=h[t],r=document.createElement(`vitehub-tool`);r.slot=e.id,x.append(r);let a,o,s,l=()=>(s||(s=c(e.script),s.catch(()=>{s=void 0})),s),u=!1,d=()=>{let t=document.createElement(`vitehub-tool`);t.slot=e.id,r.replaceWith(t),r=t},m=()=>{let e=r.attachShadow({mode:`open`}),t=document.createElement(`style`);t.textContent=i,e.append(t,v)},g=(t,i=!0)=>n.aborted?Promise.resolve(!1):u?(a?.(t),Promise.resolve(!0)):o?o.then(e=>(e&&a?.(t),e)):(o=(async()=>{let s=new AbortController,c=()=>s.abort();n.addEventListener(`abort`,c,{once:!0});try{r.setAttribute(`aria-busy`,`true`);let o=de(await l());if(se(o,`the script of a page tool default-exports a function (${e.script})`),n.aborted)return!1;v.remove(),r.shadowRoot?d():r.replaceChildren();let c=o({beforeExit:e=>{let t=()=>e();_.add(t),s.signal.addEventListener(`abort`,()=>_.delete(t),{once:!0})},tool:e,bar:r,signal:s.signal,open:i&&(e.lazy===!0||e.id===f||O(e.id)),exit:()=>y(),createWindow:t=>{let n=ue({...t,signal:s.signal,onHide:()=>{D(e.id,!1),x.hasAttribute(`collapsed`)&&x.shadowRoot.querySelector(`button.mark`).focus({preventScroll:!0}),t.onHide?.()}}),r={...n,show(){if(!s.signal.aborted){for(let[t,n]of S)t!==e.id&&n.hide();D(e.id,!0),n.show()}},destroy(){S.get(e.id)===r&&(S.delete(e.id),D(e.id,!1)),n.destroy()}};return S.set(e.id,r),r},openTool:A,createTab:()=>{let e=document.createElement(`vitehub-tab`);if(e.slot=`tab`,x.append(e),s.signal.addEventListener(`abort`,()=>e.remove(),{once:!0}),!matchMedia(`(prefers-reduced-motion: reduce)`).matches){let t=x.getAttribute(`edge`),n=t===`top`?`0 -100%`:t===`left`?`-100% 0`:t===`right`?`100% 0`:`0 100%`;e.animate([{translate:n,opacity:0},{translate:`0 0`,opacity:1}],{duration:220,easing:`cubic-bezier(.32,.72,0,1)`})}return e},onOpen:e=>{a=e}});return u=!0,t&&a?.(t),!r.shadowRoot&&!r.hasChildNodes()&&(r.hidden=!0),c instanceof Function&&(n.aborted?c():s.signal.addEventListener(`abort`,()=>c(),{once:!0})),!n.aborted}catch(t){return s.abort(),n.removeEventListener(`abort`,c),S.delete(e.id)&&D(e.id,!1),a=void 0,u=!1,console.error(`[vitehub] The page tool "${e.id}" did not start.`,t),d(),v.textContent=`Retry ${e.label}`,v.title=`The tool could not load. Try again.`,r.hidden=!1,m(),!1}finally{r.removeAttribute(`aria-busy`),o=void 0}})(),o),v=document.createElement(`button`);v.type=`button`,v.textContent=e.label,v.addEventListener(`click`,()=>void g());for(let e of[`pointerenter`,`pointerdown`,`focus`])v.addEventListener(e,()=>void l());return k.set(e.id,g),e.lazy&&e.id!==f&&!O(e.id)?(m(),e):(await g(void 0,!p||e.id===f),n.aborted?void 0:e)}))).filter(e=>!!e);return j.length===0&&m.abort(),j}me({session:new URL(`../session`,import.meta.url).pathname});
@@ -1,10 +1,11 @@
1
+ import { n as pagePathOf } from "./path--zk6PEMz.js";
1
2
  //#region src/page.ts
2
- /** Name of the Realtime Definition that holds one presence room per page. */
3
3
  /**
4
- * The scope of the threads that people pin on the app's pages with the overlay. Threads that app code starts in its
5
- * own UI use their own scope, such as `doc:42`.
4
+ * The numbering scope of page threads: subjects of kind `page`, which the overlay pins on the app's pages. Threads on
5
+ * subjects of your own, such as `drop`, take the scope that their subject definition gives.
6
6
  */
7
- const commentsPageScope = "pages";
7
+ const commentsPageScope = "site";
8
+ /** Name of the Realtime Definition that holds one presence room per page. */
8
9
  const commentsRealtimeDefinition = "comments";
9
10
  /** The route prefix of the Comments API, below the app base. */
10
11
  const commentsRoute = "/api/_vitehub/comments";
@@ -14,10 +15,11 @@ function mountedCommentsRoute(base = "/") {
14
15
  }
15
16
  /**
16
17
  * The key of a page: its pathname without query or hash, and without a trailing slash except for `/`. Threads and
17
- * presence rooms belong to a page key.
18
+ * presence rooms belong to a page key. A full URL of the page, such as `https://site.test/pricing/`, gives the key of
19
+ * its path, `/pricing`.
18
20
  */
19
21
  function normalizeCommentPage(path) {
20
- let pathname = path.split(/[?#]/, 1)[0] ?? "";
22
+ let pathname = pagePathOf(path).split(/[?#]/, 1)[0] ?? "";
21
23
  if (!pathname.startsWith("/")) pathname = `/${pathname}`;
22
24
  pathname = pathname.replace(/\/{2,}/g, "/");
23
25
  if (pathname.length > 1) pathname = pathname.replace(/\/+$/, "");
@@ -1,10 +1,10 @@
1
1
  //#region src/page.d.ts
2
- /** Name of the Realtime Definition that holds one presence room per page. */
3
2
  /**
4
- * The scope of the threads that people pin on the app's pages with the overlay. Threads that app code starts in its
5
- * own UI use their own scope, such as `doc:42`.
3
+ * The numbering scope of page threads: subjects of kind `page`, which the overlay pins on the app's pages. Threads on
4
+ * subjects of your own, such as `drop`, take the scope that their subject definition gives.
6
5
  */
7
- declare const commentsPageScope = "pages";
6
+ declare const commentsPageScope = "site";
7
+ /** Name of the Realtime Definition that holds one presence room per page. */
8
8
  declare const commentsRealtimeDefinition = "comments";
9
9
  /** The route prefix of the Comments API, below the app base. */
10
10
  declare const commentsRoute = "/api/_vitehub/comments";
@@ -12,7 +12,8 @@ declare const commentsRoute = "/api/_vitehub/comments";
12
12
  declare function mountedCommentsRoute(base?: string): string;
13
13
  /**
14
14
  * The key of a page: its pathname without query or hash, and without a trailing slash except for `/`. Threads and
15
- * presence rooms belong to a page key.
15
+ * presence rooms belong to a page key. A full URL of the page, such as `https://site.test/pricing/`, gives the key of
16
+ * its path, `/pricing`.
16
17
  */
17
18
  declare function normalizeCommentPage(path: string): string;
18
19
  /** The Realtime document id of the presence room of a page: `pages/<hash>`, a safe Workspace path for any page. */
@@ -0,0 +1,117 @@
1
+ //#region ../internal/src/runtime/page-tools-shared.ts
2
+ /**
3
+ * The names and the session answer that the page tools server and the browser loader share. It has no DOM and no Node
4
+ * code, so both sides import it.
5
+ */
6
+ /** The query that turns the page tools on for a page. `?vitehub=<tool id>` also opens that tool. */
7
+ const viteHubPageToolsQuery = "vitehub";
8
+ /**
9
+ * Query parameters of links into a tool, such as `?comment=3` of Comments. Like `?vitehub`, they load the page tools,
10
+ * so a person who follows a link sees what it points at. The tool with that `param` opens.
11
+ */
12
+ const viteHubPageToolsLinkParams = ["comment"];
13
+ /**
14
+ * The cookie that remembers the session route's answer for this browser: `1` when a tool allows the person, `0` when
15
+ * none does or the person turned the tools off. It is a hint, never a credential, and it is not HttpOnly, because the
16
+ * page's bootstrap script reads it.
17
+ */
18
+ const viteHubPageToolsCookie = "vitehub-tools";
19
+ /**
20
+ * The cookie that tells page scripts that an app Auth session exists. `@vite-hub/auth` sets it to `1` next to the
21
+ * session cookie and clears it on sign-out. It is not HttpOnly and holds no secret.
22
+ */
23
+ const viteHubSessionMarkerCookie = "vitehub_session";
24
+ const hintMaxAge = 2592e3;
25
+ /** The `Set-Cookie` value that stores the session route's answer for 30 days. */
26
+ function viteHubPageToolsHintCookie(allowed) {
27
+ return `${viteHubPageToolsCookie}=${allowed ? 1 : 0}; Path=/; Max-Age=${hintMaxAge}; SameSite=Lax`;
28
+ }
29
+ /**
30
+ * Whether a page loads the page tools loader, from its query string and its `Cookie` header or `document.cookie`:
31
+ * - the `?vitehub` query, or
32
+ * - `vitehub-tools=1`, the session route allowed this person, or
33
+ * - `vitehub_session=1` without any `vitehub-tools` cookie: a person signed in and the session route has not answered
34
+ * for this session yet.
35
+ *
36
+ * `vitehub-tools=0` stops the last case, so a signed-in person without access causes one session request per session.
37
+ */
38
+ function viteHubPageToolsWanted(search, cookie) {
39
+ const query = new URLSearchParams(search);
40
+ if (query.has("vitehub") || viteHubPageToolsLinkParams.some((param) => query.has(param))) return true;
41
+ const parts = cookie.split(";").map((part) => part.trim());
42
+ if (parts.includes(`vitehub-tools=1`)) return true;
43
+ return parts.includes(`vitehub_session=1`) && !parts.some((part) => part.startsWith(`vitehub-tools=`));
44
+ }
45
+ /**
46
+ * The URL prefix of the built page tools scripts, such as the loader. It is not `/_vitehub/page`: Nitro answers 404 for
47
+ * any path under a public asset prefix that has no file, and gives the whole prefix the asset cache headers.
48
+ */
49
+ const viteHubPageToolsAssets = "/_vitehub/page/assets";
50
+ /** The route of the visitor check. */
51
+ const viteHubPageSessionPath = "/_vitehub/page/session";
52
+ /**
53
+ * The URL of the loader script, below the app base. Its version query changes when the loader changes, so caches keep
54
+ * it 5 minutes.
55
+ */
56
+ const viteHubPageToolsLoader = "/_vitehub/page/assets/loader.js?v=21";
57
+ /** The attribute of the script that loads the page tools. A page that has it does not get a second one. */
58
+ const viteHubPageToolsMarker = "data-vitehub-page-tools";
59
+ /** The bootstrap's opening tag, so the server can recognize the generated bootstrap when it replaces it. */
60
+ const viteHubPageToolsInlineStart = `<script type="module" ${viteHubPageToolsMarker}>`;
61
+ /**
62
+ * The exact page tools bootstrap: an inline module script that imports `<base>/_vitehub/page/assets/loader.js` only
63
+ * when `viteHubPageToolsWanted()` is true in the browser. Without the hint it makes no request. Vite adds it to a
64
+ * single page app's `index.html`, and the server adds it to every rendered and prerendered page, so static hosts serve
65
+ * it too. A `nonce` goes on the tag for a Content Security Policy with nonces.
66
+ */
67
+ function viteHubPageToolsInlineScript(base, nonce) {
68
+ const tools = JSON.stringify(`${viteHubPageToolsCookie}=`);
69
+ const hint = `${JSON.stringify([viteHubPageToolsQuery, ...viteHubPageToolsLinkParams])}.some(p=>new URLSearchParams(location.search).has(p))||c.includes(${JSON.stringify(`${viteHubPageToolsCookie}=1`)})||c.includes(${JSON.stringify(`${viteHubSessionMarkerCookie}=1`)})&&!c.some(p=>p.startsWith(${tools}))`;
70
+ return `${nonce ? `<script type="module" nonce="${nonce}" ${viteHubPageToolsMarker}>` : viteHubPageToolsInlineStart}const c=document.cookie.split("; ");if(${hint})import(${JSON.stringify(`${viteHubBasePath(base)}${viteHubPageToolsLoader}`)})<\/script>`;
71
+ }
72
+ /**
73
+ * The path of an app base, without the trailing slash: `/portal/` and `https://cdn.example/portal/` give `/portal`.
74
+ * The root and relative bases (`""`, `"./"`) give `""`. The Console mounts its routes with the same rule.
75
+ */
76
+ function viteHubBasePath(base) {
77
+ if (!base || base === "./") return "";
78
+ let pathname = base;
79
+ if (/^https?:\/\//.test(pathname)) try {
80
+ pathname = new URL(pathname).pathname;
81
+ } catch {
82
+ return "";
83
+ }
84
+ if (!pathname.startsWith("/") || pathname.startsWith("//")) return "";
85
+ return pathname.replace(/\/+$/, "");
86
+ }
87
+ /**
88
+ * Adds the app base to a path, such as the `script` of a tool. Full URLs and protocol-relative URLs stay as they are.
89
+ */
90
+ function withViteHubBase(base, path) {
91
+ return path.startsWith("/") && !path.startsWith("//") ? `${base}${path}` : path;
92
+ }
93
+ function text(value) {
94
+ return typeof value === "string" && value ? value : void 0;
95
+ }
96
+ /**
97
+ * An account from untrusted input, or `undefined` when it has no name or its `signOut` is not a path of this origin. The
98
+ * browser posts to `signOut` with the session cookie, so it never goes to another site.
99
+ */
100
+ function readViteHubPageAccount(value) {
101
+ if (value === null || typeof value !== "object") return void 0;
102
+ const name = text(Reflect.get(value, "name"));
103
+ const signOut = text(Reflect.get(value, "signOut"));
104
+ if (!name || !signOut?.startsWith("/") || signOut.startsWith("//") || signOut.includes("\\")) return void 0;
105
+ const account = {
106
+ name,
107
+ signOut
108
+ };
109
+ const email = text(Reflect.get(value, "email"));
110
+ if (email) account.email = email;
111
+ const image = text(Reflect.get(value, "image"));
112
+ if (image && /^https?:\/\//i.test(image)) account.image = image;
113
+ if (Reflect.get(value, "via") === "console") account.via = "console";
114
+ return account;
115
+ }
116
+ //#endregion
117
+ export { viteHubPageToolsCookie as a, viteHubPageToolsInlineStart as c, viteHubPageToolsQuery as d, viteHubPageToolsWanted as f, viteHubPageToolsAssets as i, viteHubPageToolsLoader as l, viteHubBasePath as n, viteHubPageToolsHintCookie as o, withViteHubBase as p, viteHubPageSessionPath as r, viteHubPageToolsInlineScript as s, readViteHubPageAccount as t, viteHubPageToolsMarker as u };
@@ -0,0 +1,18 @@
1
+ /**
2
+ * An app path: one slash, then no second slash or backslash (`//host` and `/\host` leave the site), no whitespace,
3
+ * and no `?` or `#`, which a link adds itself.
4
+ */
5
+ const pagePath = /^\/(?![/\\])[^\s\\?#]*$/;
6
+ function isPagePath(value) {
7
+ return value.length <= 500 && pagePath.test(value) && !new URL(value, "https://comments.invalid").pathname.startsWith("//");
8
+ }
9
+ const pageURL = /^https?:\/\//i;
10
+ /**
11
+ * The path of a page that a person names by its full URL, such as `https://site.test/pricing?plan=pro`: `/pricing`.
12
+ * Other values return unchanged, so a path stays a path and garbage stays garbage.
13
+ */
14
+ function pagePathOf(value) {
15
+ return pageURL.test(value) && URL.canParse(value) ? new URL(value).pathname : value;
16
+ }
17
+ //#endregion
18
+ export { pagePathOf as n, isPagePath as t };
@@ -0,0 +1,74 @@
1
+ import { t as commentsErrorDiagnostics } from "./errors-C6qptPoG.js";
2
+ import { r as commentsRoleGrants } from "./define-43mMR39K.js";
3
+ import { i as installCommentsRuntime } from "./server-D8k-0GXe.js";
4
+ import { i as runtimeBuilds } from "./installed-B-PfERBU.js";
5
+ import { i as registerViteHubPageTool, n as resolveCommentsPage, r as installViteHubPageTools, t as resolveCommentsIdentity } from "./session-EkudzUmm.js";
6
+ import { installRequestStandardContext } from "@vite-hub/runtime/internal/h3";
7
+ //#region src/runtime/plugin.ts
8
+ const runtimeKey = Symbol.for("vitehub.comments.installed");
9
+ /** The Comments definition that the Nitro plugin installed, for the Console reader. */
10
+ function installedComments() {
11
+ const value = Reflect.get(globalThis, runtimeKey);
12
+ return value === void 0 ? void 0 : value;
13
+ }
14
+ /**
15
+ * The Nitro plugin of Comments. It connects the definition to its Database, and registers the overlay as the
16
+ * `comments` page tool: a visitor may load it when `authorize` allows `read` or GitHub sign-in is available.
17
+ */
18
+ function defineCommentsPlugin(options) {
19
+ return (nitroApp) => {
20
+ let warned = false;
21
+ let building;
22
+ const build = () => building ??= (async () => {
23
+ const database = await options.database();
24
+ if (!database) {
25
+ if (!warned) console.warn(options.missingDatabase ?? "[vitehub] Comments has no Database. Enable one with `vitehub({ database: true })`, or set `defineComments({ database })` to a Database name.");
26
+ warned = true;
27
+ throw Object.assign(commentsErrorDiagnostics.COMMENTS_R0010(), { status: 503 });
28
+ }
29
+ const { installComments } = await import("./install-BcMPgPk_.js").then((n) => n.n);
30
+ return installComments(options.comments, {
31
+ database,
32
+ development: options.development === true,
33
+ ...options.schema ? { schema: options.schema } : {},
34
+ ...options.tables ? { tables: options.tables } : {},
35
+ ...options.dialect ? { dialect: options.dialect } : {},
36
+ ...options.users ? { users: options.users } : {},
37
+ ...options.attachments ? { attachments: options.attachments } : {},
38
+ ...options.rateLimit ? { rateLimit: options.rateLimit } : {}
39
+ });
40
+ })().catch((error) => {
41
+ building = void 0;
42
+ throw error;
43
+ });
44
+ runtimeBuilds.set(options.comments, build);
45
+ installCommentsRuntime(build);
46
+ Reflect.set(globalThis, runtimeKey, options.comments);
47
+ if (options.overlay === false) return;
48
+ const script = options.overlay;
49
+ registerViteHubPageTool(nitroApp, {
50
+ id: "comments",
51
+ label: "Comments",
52
+ icon: "i-lucide-message-square-text",
53
+ script,
54
+ param: "comment",
55
+ grants: commentsRoleGrants,
56
+ async allowed({ request }) {
57
+ installRequestStandardContext(request);
58
+ const event = request;
59
+ const { user, gate } = await resolveCommentsIdentity(options.comments, event, options);
60
+ const page = new URL(request.url).searchParams.get("page");
61
+ const subject = page ? (await resolveCommentsPage(options.comments, event, request, page)).subject : void 0;
62
+ if (await options.comments.can({
63
+ user,
64
+ action: "read",
65
+ ...subject ? { subject } : {}
66
+ }, gate)) return true;
67
+ return !options.comments.options.identify && options.githubLogin?.configured() && (!user || user.github) ? "lazy" : false;
68
+ }
69
+ });
70
+ installViteHubPageTools(nitroApp, { base: options.base });
71
+ };
72
+ }
73
+ //#endregion
74
+ export { installedComments as n, defineCommentsPlugin as t };
@@ -1,18 +1,12 @@
1
- import { x as CommentsUser } from "./types-Un2dcJWD.js";
2
- import { t as Comments } from "./index-DklG2Etf.js";
3
- import { H3Event } from "h3";
1
+ import { t as Comments } from "./index-DNhy69Wt.js";
2
+ import { t as CommentsSessionOptions } from "./session-DVx-1Tym.js";
4
3
  import { RealtimeDefinition } from "@vite-hub/realtime";
5
4
  //#region src/realtime.d.ts
6
5
  /**
7
6
  * The Realtime Definition of the page presence rooms: who is on a page and where their cursor is. Rooms hold no
8
- * document; threads stay in the Database. Connections are read-only, and the server binds account presence to the user
9
- * that Comments resolves. Guests name themselves in the browser. ViteHub adds it as the `comments` definition when the
10
- * host has a room authority.
7
+ * document; threads stay in the Database. The server binds account presence to the user that Comments resolves.
8
+ * Guests name themselves in the browser. ViteHub adds it as the `comments` definition when the host has a room
9
+ * authority.
11
10
  */
12
- export declare function commentsRealtime(comments: Comments, options?: {
13
- /** Auth fallback, skipped when custom `identify` is configured. */
14
- session?: (event: H3Event) => Promise<CommentsUser | null | undefined>;
15
- /** Console section access, checked before custom `identify` or Comments policies. */
16
- consoleSession?: (event: H3Event) => Promise<CommentsUser | null | undefined | false>;
17
- }): RealtimeDefinition;
11
+ export declare function commentsRealtime(comments: Comments, options?: CommentsSessionOptions): RealtimeDefinition;
18
12
  //#endregion