@screenreader-speech-capture/bridge 0.2.1 → 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.
- package/dist/cli.mjs +70 -26
- package/dist/ui/adapter-node.js +1 -1
- package/dist/ui/client/ui/_app/immutable/chunks/{CTnnxqUD.js → C75l7c5l.js} +1 -1
- package/dist/ui/client/ui/_app/immutable/chunks/C75l7c5l.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/C75l7c5l.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/Cb63XE4v.js +33 -0
- package/dist/ui/client/ui/_app/immutable/chunks/Cb63XE4v.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/Cb63XE4v.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/{BLbj0ykL.js → DWjfB3ah.js} +1 -1
- package/dist/ui/client/ui/_app/immutable/chunks/DWjfB3ah.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/DWjfB3ah.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/entry/{app.CHExvln1.js → app.B2MXuPeH.js} +2 -2
- package/dist/ui/client/ui/_app/immutable/entry/app.B2MXuPeH.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/entry/app.B2MXuPeH.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/0.CEfoZ0Mb.js +1 -0
- package/dist/ui/client/ui/_app/immutable/nodes/0.CEfoZ0Mb.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/0.CEfoZ0Mb.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/{3.D9AmPYb5.js → 3.BzIz3rja.js} +2 -2
- package/dist/ui/client/ui/_app/immutable/nodes/3.BzIz3rja.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/3.BzIz3rja.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/{4.DxNIrNp_.js → 4.B9Ke6ZBV.js} +1 -1
- package/dist/ui/client/ui/_app/immutable/nodes/4.B9Ke6ZBV.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/4.B9Ke6ZBV.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/{6.D9jpgBJB.js → 6.B_1Pts2e.js} +1 -1
- package/dist/ui/client/ui/_app/immutable/nodes/6.B_1Pts2e.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/6.B_1Pts2e.js.gz +0 -0
- package/dist/ui/client/ui/_app/version.json +1 -1
- package/dist/ui/client/ui/_app/version.json.br +0 -0
- package/dist/ui/client/ui/_app/version.json.gz +0 -0
- package/dist/ui/server/.vite/manifest.json +17 -4
- package/dist/ui/server/chunks/instance.js +3 -3
- package/dist/ui/server/chunks/internal.js +1 -1
- package/dist/ui/server/chunks/rules.js +1 -6
- package/dist/ui/server/chunks/rules.js.map +1 -1
- package/dist/ui/server/chunks/src.js +20 -31
- package/dist/ui/server/chunks/src.js.map +1 -1
- package/dist/ui/server/chunks/validate.js +23 -0
- package/dist/ui/server/chunks/validate.js.map +1 -0
- package/dist/ui/server/entries/endpoints/api/config/_server.ts.js +2 -1
- package/dist/ui/server/entries/endpoints/api/config/_server.ts.js.map +1 -1
- package/dist/ui/server/entries/endpoints/api/input/keys/_server.ts.js +2 -1
- package/dist/ui/server/entries/endpoints/api/input/keys/_server.ts.js.map +1 -1
- package/dist/ui/server/entries/endpoints/api/markers/_server.ts.js +2 -1
- package/dist/ui/server/entries/endpoints/api/markers/_server.ts.js.map +1 -1
- package/dist/ui/server/entries/endpoints/api/sessions/_server.ts.js +2 -1
- package/dist/ui/server/entries/endpoints/api/sessions/_server.ts.js.map +1 -1
- package/dist/ui/server/entries/hooks.server.js +2 -1
- package/dist/ui/server/entries/hooks.server.js.map +1 -1
- package/dist/ui/server/entries/pages/_layout.svelte.js +2 -1
- package/dist/ui/server/entries/pages/_layout.svelte.js.map +1 -1
- package/dist/ui/server/manifest-full.js +1 -1
- package/dist/ui/server/manifest.js +1 -1
- package/dist/ui/server/nodes/0.js +1 -1
- package/dist/ui/server/nodes/3.js +1 -1
- package/dist/ui/server/nodes/4.js +1 -1
- package/dist/ui/server/nodes/6.js +1 -1
- package/dist/ui/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/ui/client/ui/_app/immutable/chunks/BLbj0ykL.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/BLbj0ykL.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/CTnnxqUD.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/CTnnxqUD.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/R_4U_-zb.js +0 -33
- package/dist/ui/client/ui/_app/immutable/chunks/R_4U_-zb.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/R_4U_-zb.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/entry/app.CHExvln1.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/entry/app.CHExvln1.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/0.DENUQERM.js +0 -1
- package/dist/ui/client/ui/_app/immutable/nodes/0.DENUQERM.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/0.DENUQERM.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/3.D9AmPYb5.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/3.D9AmPYb5.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/4.DxNIrNp_.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/4.DxNIrNp_.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/6.D9jpgBJB.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/6.D9jpgBJB.js.gz +0 -0
|
Binary file
|
|
Binary file
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{$ as e,A as t,D as n,E as r,F as i,G as a,I as o,J as s,K as c,M as l,N as u,O as d,P as f,Q as p,R as m,S as h,U as g,V as _,X as v,Y as y,_ as b,a as x,d as S,f as C,g as w,j as T,k as E,l as D,m as O,n as k,nt as A,r as j,rt as M,s as N,t as P,u as F,v as I,w as L,y as R}from"../chunks/B__KpOuX.js";import{r as z}from"../chunks/JsC3ASJq.js";import{t as B}from"../chunks/BkoDSEOx.js";import"../chunks/UKukklIc.js";import{n as V}from"../chunks/BEImj5AP.js";import"../chunks/C06IiL6m.js";import{A as H,S as U,j as W,k as G,n as K}from"../chunks/DRNNJMYk.js";import{n as q}from"../chunks/w5i9ZoX_.js";import{n as J,t as Y}from"../chunks/BuwZGWCm.js";import{t as X}from"../chunks/
|
|
1
|
+
import{$ as e,A as t,D as n,E as r,F as i,G as a,I as o,J as s,K as c,M as l,N as u,O as d,P as f,Q as p,R as m,S as h,U as g,V as _,X as v,Y as y,_ as b,a as x,d as S,f as C,g as w,j as T,k as E,l as D,m as O,n as k,nt as A,r as j,rt as M,s as N,t as P,u as F,v as I,w as L,y as R}from"../chunks/B__KpOuX.js";import{r as z}from"../chunks/JsC3ASJq.js";import{t as B}from"../chunks/BkoDSEOx.js";import"../chunks/UKukklIc.js";import{n as V}from"../chunks/BEImj5AP.js";import"../chunks/C06IiL6m.js";import{A as H,S as U,j as W,k as G,n as K}from"../chunks/DRNNJMYk.js";import{n as q}from"../chunks/w5i9ZoX_.js";import{n as J,t as Y}from"../chunks/BuwZGWCm.js";import{t as X}from"../chunks/DWjfB3ah.js";import{a as Z,d as ee,i as te,n as ne,o as re,r as ie,s as ae}from"../chunks/Cb63XE4v.js";import"../chunks/OAsMjdHF.js";import"../chunks/vPs9G1oN.js";var oe=r(`<div class="banner svelte-qexebn" role="note"><md-icon>warning</md-icon> <p class="svelte-qexebn"><strong>The speech log is hidden from the screen reader.</strong> This page is opened on the bridge's own machine (loopback or its own network address): the screen
|
|
2
2
|
reader would read new rows aloud and they would be recorded again. Open the UI from another machine
|
|
3
3
|
to read the log with a screen reader.</p></div>`,2);function se(e){var t=oe(),n=u(t);N(n,`aria-hidden`,`true`),F(n,1,`svelte-qexebn`),A(2),M(t),L(e,t)}var ce=class extends J{renderElevationOrOutline(){return U`<md-elevation part="elevation"></md-elevation>`}},le=G`:host{--_container-color: var(--md-filled-tonal-button-container-color, var(--md-sys-color-secondary-container, #e8def8));--_container-elevation: var(--md-filled-tonal-button-container-elevation, 0);--_container-height: var(--md-filled-tonal-button-container-height, 40px);--_container-shadow-color: var(--md-filled-tonal-button-container-shadow-color, var(--md-sys-color-shadow, #000));--_disabled-container-color: var(--md-filled-tonal-button-disabled-container-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-container-elevation: var(--md-filled-tonal-button-disabled-container-elevation, 0);--_disabled-container-opacity: var(--md-filled-tonal-button-disabled-container-opacity, 0.12);--_disabled-label-text-color: var(--md-filled-tonal-button-disabled-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-label-text-opacity: var(--md-filled-tonal-button-disabled-label-text-opacity, 0.38);--_focus-container-elevation: var(--md-filled-tonal-button-focus-container-elevation, 0);--_focus-label-text-color: var(--md-filled-tonal-button-focus-label-text-color, var(--md-sys-color-on-secondary-container, #1d192b));--_hover-container-elevation: var(--md-filled-tonal-button-hover-container-elevation, 1);--_hover-label-text-color: var(--md-filled-tonal-button-hover-label-text-color, var(--md-sys-color-on-secondary-container, #1d192b));--_hover-state-layer-color: var(--md-filled-tonal-button-hover-state-layer-color, var(--md-sys-color-on-secondary-container, #1d192b));--_hover-state-layer-opacity: var(--md-filled-tonal-button-hover-state-layer-opacity, 0.08);--_label-text-color: var(--md-filled-tonal-button-label-text-color, var(--md-sys-color-on-secondary-container, #1d192b));--_label-text-font: var(--md-filled-tonal-button-label-text-font, var(--md-sys-typescale-label-large-font, var(--md-ref-typeface-plain, Roboto)));--_label-text-line-height: var(--md-filled-tonal-button-label-text-line-height, var(--md-sys-typescale-label-large-line-height, 1.25rem));--_label-text-size: var(--md-filled-tonal-button-label-text-size, var(--md-sys-typescale-label-large-size, 0.875rem));--_label-text-weight: var(--md-filled-tonal-button-label-text-weight, var(--md-sys-typescale-label-large-weight, var(--md-ref-typeface-weight-medium, 500)));--_pressed-container-elevation: var(--md-filled-tonal-button-pressed-container-elevation, 0);--_pressed-label-text-color: var(--md-filled-tonal-button-pressed-label-text-color, var(--md-sys-color-on-secondary-container, #1d192b));--_pressed-state-layer-color: var(--md-filled-tonal-button-pressed-state-layer-color, var(--md-sys-color-on-secondary-container, #1d192b));--_pressed-state-layer-opacity: var(--md-filled-tonal-button-pressed-state-layer-opacity, 0.12);--_disabled-icon-color: var(--md-filled-tonal-button-disabled-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-icon-opacity: var(--md-filled-tonal-button-disabled-icon-opacity, 0.38);--_focus-icon-color: var(--md-filled-tonal-button-focus-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_hover-icon-color: var(--md-filled-tonal-button-hover-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_icon-color: var(--md-filled-tonal-button-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_icon-size: var(--md-filled-tonal-button-icon-size, 18px);--_pressed-icon-color: var(--md-filled-tonal-button-pressed-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_container-shape-start-start: var(--md-filled-tonal-button-container-shape-start-start, var(--md-filled-tonal-button-container-shape, var(--md-sys-shape-corner-full, 9999px)));--_container-shape-start-end: var(--md-filled-tonal-button-container-shape-start-end, var(--md-filled-tonal-button-container-shape, var(--md-sys-shape-corner-full, 9999px)));--_container-shape-end-end: var(--md-filled-tonal-button-container-shape-end-end, var(--md-filled-tonal-button-container-shape, var(--md-sys-shape-corner-full, 9999px)));--_container-shape-end-start: var(--md-filled-tonal-button-container-shape-end-start, var(--md-filled-tonal-button-container-shape, var(--md-sys-shape-corner-full, 9999px)));--_leading-space: var(--md-filled-tonal-button-leading-space, 24px);--_trailing-space: var(--md-filled-tonal-button-trailing-space, 24px);--_with-leading-icon-leading-space: var(--md-filled-tonal-button-with-leading-icon-leading-space, 16px);--_with-leading-icon-trailing-space: var(--md-filled-tonal-button-with-leading-icon-trailing-space, 24px);--_with-trailing-icon-leading-space: var(--md-filled-tonal-button-with-trailing-icon-leading-space, 24px);--_with-trailing-icon-trailing-space: var(--md-filled-tonal-button-with-trailing-icon-trailing-space, 16px)}
|
|
4
4
|
`;le.styleSheet;var Q=class extends ce{};Q.styles=[Y,q,le],Q=W([H(`md-filled-tonal-button`)],Q);var ue=r(`<p role="alert" class="failure svelte-qieqgw"> </p>`),de=r(`<md-dialog><div slot="headline">Clear speech?</div> <div slot="content"><p class="svelte-qieqgw">The speech of <strong> </strong> is removed from the bridge. The session keeps running.
|
|
5
|
-
This cannot be undone.</p> <!></div> <div slot="actions"><md-text-button>Cancel</md-text-button> <md-text-button>Clear</md-text-button></div></md-dialog>`,2);function fe(n,r){e(r,!0);let l=y(``),d=y(!1);c(()=>{r.open&&s(l,``)});async function f(){if(!m(d)){s(l,``),s(d,!0);try{await r.onClear(),r.onClose()}catch(e){s(l,e instanceof Error?e.message:`The speech could not be cleared.`,!0)}finally{s(d,!1)}}}var g=de();a(()=>N(g,`open`,r.open)),F(g,1,`svelte-qieqgw`);var _=o(u(g),2),v=u(_),x=o(u(v)),S=i(x,!0);A(),M(v);var C=o(v,2),w=e=>{var t=ue(),n=i(t,!0);a(()=>h(n,m(l))),L(e,t)};b(C,e=>{m(l)!==``&&e(w)}),M(_);var E=o(_,2),D=u(E);N(D,`type`,`button`);var O=o(D,2);N(O,`type`,`button`),a(()=>N(O,`disabled`,m(d))),M(E),M(g),a(()=>h(S,r.heading)),T(`closed`,g,function(...e){r.onClose?.apply(this,e)}),t(`click`,D,function(...e){r.onClose?.apply(this,e)}),t(`click`,O,f),L(n,g),p()}E([`click`]);var pe=r(`<p role="alert" class="failure svelte-1sof82u"> </p>`),me=r(`<md-dialog><div slot="headline">Delete session?</div> <div slot="content"><p class="svelte-1sof82u"><strong> </strong> and its speech are removed from the bridge. This cannot be undone.</p> <!></div> <div slot="actions"><md-text-button>Cancel</md-text-button> <md-text-button>Delete</md-text-button></div></md-dialog>`,2);function he(n,r){e(r,!0);let l=y(``),d=y(!1);c(()=>{r.open&&s(l,``)});async function f(){if(!m(d)){s(l,``),s(d,!0);try{await r.onDelete(),r.onClose()}catch(e){s(l,e instanceof Error?e.message:`The session could not be deleted.`,!0)}finally{s(d,!1)}}}var g=me();a(()=>N(g,`open`,r.open)),F(g,1,`svelte-1sof82u`);var _=o(u(g),2),v=u(_),x=u(v),S=i(x,!0);A(),M(v);var C=o(v,2),w=e=>{var t=pe(),n=i(t,!0);a(()=>h(n,m(l))),L(e,t)};b(C,e=>{m(l)!==``&&e(w)}),M(_);var E=o(_,2),D=u(E);N(D,`type`,`button`);var O=o(D,2);N(O,`type`,`button`),a(()=>N(O,`disabled`,m(d))),M(E),M(g),a(()=>h(S,r.heading)),T(`closed`,g,function(...e){r.onClose?.apply(this,e)}),t(`click`,D,function(...e){r.onClose?.apply(this,e)}),t(`click`,O,f),L(n,g),p()}E([`click`]);var ge=r(`<p role="alert" class="failure svelte-ttl1x5"> </p>`),_e=r(`<md-dialog><div slot="headline">Add a marker</div> <form slot="content" id="add-marker-form" novalidate="" class="svelte-ttl1x5"><md-outlined-text-field></md-outlined-text-field> <!></form> <div slot="actions"><md-text-button>Cancel</md-text-button> <md-text-button>Add</md-text-button></div></md-dialog>`,2);function ve(n,r){e(r,!0);let l=y(``),d=y(``),f=y(``),g=y(!1);c(()=>{r.open&&(s(l,``),s(d,``),s(f,``))});async function _(e){if(e.preventDefault(),m(g))return;let t=m(l).trim();if(t===``)s(d,`Enter a label.`);else{s(d,``),s(f,``),s(g,!0);try{await r.onAdd(t),r.onClose()}catch(e){s(f,e instanceof Error?e.message:`The marker could not be added.`,!0)}finally{s(g,!1)}}}var v=_e();a(()=>N(v,`open`,r.open)),F(v,1,`svelte-ttl1x5`);var x=o(u(v),2),S=u(x);N(S,`label`,`Label`),N(S,`required`,!0),a(()=>N(S,`maxlength`,X.markerLength)),N(S,`supporting-text`,`Shows in the log as a row of its own, for example “step 3”.`),a(()=>N(S,`value`,m(l))),a(()=>N(S,`error`,m(d)!==``)),a(()=>N(S,`error-text`,m(d)));var C=o(S,2),w=e=>{var t=ge(),n=i(t,!0);a(()=>h(n,m(f))),L(e,t)};b(C,e=>{m(f)!==``&&e(w)}),M(x);var E=o(x,2),D=u(E);N(D,`type`,`button`);var O=o(D,2);N(O,`type`,`submit`),N(O,`form`,`add-marker-form`),a(()=>N(O,`disabled`,m(g))),M(E),M(v),T(`closed`,v,function(...e){r.onClose?.apply(this,e)}),T(`submit`,x,_),t(`input`,S,e=>s(l,e.target.value,!0)),t(`click`,D,function(...e){r.onClose?.apply(this,e)}),L(n,v),p()}E([`input`,`click`]);var ye=r(`<span class="pill svelte-5c13xh"><md-icon>bookmark</md-icon> <span class="visually-hidden">Marker:</span> <span class="label mono svelte-5c13xh"> </span></span>`,2),be=r(`<tr><td class="time mono svelte-5c13xh"> </td><td class="text svelte-5c13xh"><!></td><td class="seq mono svelte-5c13xh"> </td></tr>`),xe=r(`<p hidden=""></p> <table aria-label="Speech" class="svelte-5c13xh"><thead class="svelte-5c13xh"><tr><th scope="col" class="svelte-5c13xh">Received</th><th scope="col" class="svelte-5c13xh">Spoken text</th><th scope="col" class="seq svelte-5c13xh" aria-label="Seq"><span class="seq-head svelte-5c13xh">Seq <span class="help svelte-5c13xh" aria-hidden="true"><md-icon>help</md-icon></span></span></th></tr></thead><tbody class="svelte-5c13xh"></tbody></table>`,3);function Se(t,r){let s=n();e(r,!0);let c=e=>Date.now()-Date.parse(e.receivedAt)<2e3;var l=xe(),g=f(l);g.textContent=`Seq is the entry's number in the API (since, --since). It is large because it starts at the bridge's start time; only its order matters. Numbers can be skipped.`;var _=o(g,2),v=u(_),y=u(v),S=o(u(y),2),C=u(S),w=o(u(C));x(w,`title`,`Seq is the entry's number in the API (since, --since). It is large because it starts at the bridge's start time; only its order matters. Numbers can be skipped.`);var T=u(w);N(T,`aria-hidden`,`true`),F(T,1,`svelte-5c13xh`),M(w),M(C),M(S),M(y),M(v);var E=o(v);O(E,21,()=>r.entries,e=>e.seq,(e,t)=>{var n=be();let r;var s=u(n),l=i(s,!0),f=o(s),p=u(f),g=e=>{var n=ye(),r=u(n);N(r,`aria-hidden`,`true`),F(r,1,`svelte-5c13xh`);var s=o(r,4),c=i(s,!0);M(n),a(()=>{x(n,`title`,m(t).text),h(c,m(t).text)}),L(e,n)},_=e=>{var n=d();a(()=>h(n,m(t).text)),L(e,n)};b(p,e=>{m(t).kind===`marker`?e(g):e(_,-1)}),M(f);var v=o(f),y=i(v);M(n),a((e,i)=>{r=F(n,1,`svelte-5c13xh`,null,r,{fresh:e,marker:m(t).kind===`marker`}),h(l,i),h(y,`#${m(t).seq??``}`)},[()=>c(m(t)),()=>Z(m(t).receivedAt)]),L(e,n)}),M(E),M(_),a(()=>{x(g,`id`,s),x(_,`aria-describedby`,s)}),L(t,l),p()}var Ce=r(`<md-icon-button><md-icon>bookmark_add</md-icon></md-icon-button>`,2),we=r(`<md-icon-button><md-icon>delete_sweep</md-icon></md-icon-button>`,2),Te=r(`<md-icon-button><md-icon>delete</md-icon></md-icon-button>`,2),Ee=r(`<div role="toolbar" aria-label="Log actions"><!> <!> <!></div>`),De=r(`<p class="title svelte-1jnrixz">No entries left</p> <p class="svelte-1jnrixz">This session's entries are no longer in the buffer.</p>`,1),Oe=r(`<p class="title svelte-1jnrixz">No speech yet</p> <p class="svelte-1jnrixz">Make the screen reader speak.</p>`,1),ke=r(`<div class="empty svelte-1jnrixz"><md-icon>mic</md-icon> <!></div>`,2),Ae=r(`<p role="status" class="mono svelte-1jnrixz">Connection lost, reconnecting…</p>`),je=r(`<p role="alert" class="mono failed svelte-1jnrixz">The speech could not be loaded.</p>`),Me=r(`<span></span>`),Ne=r(`<md-filled-tonal-button><md-icon>arrow_downward</md-icon> Jump to latest</md-filled-tonal-button>`,2),Pe=r(`<footer class="svelte-1jnrixz"><!> <!></footer>`),Fe=r(`<section class="log svelte-1jnrixz"><header class="svelte-1jnrixz"><h2 class="trunc svelte-1jnrixz"> </h2> <!></header> <div class="scroll svelte-1jnrixz"><!> <!></div> <!></section> <!> <!> <!>`,1);function Ie(n,r){e(r,!0);let l=P(r,`local`,3,!1),d=y(!1),g=y(!1),_=y(!1),v=y(void 0),S=y(!0);function C(){m(v)&&s(S,m(v).scrollHeight-m(v).scrollTop-m(v).clientHeight<=48)}function w(){s(S,!0),m(v)?.scrollTo({top:m(v).scrollHeight})}function E(e){l()&&e.currentTarget.blur()}c(()=>{r.entries.length===0&&s(S,!0),m(S)&&m(v)&&(m(v).scrollTop=m(v).scrollHeight)});var D=Fe(),O=f(D),j=u(O),I=u(j),R=i(I,!0),z=o(I,2),B=e=>{var n=Ee(),i=u(n),c=e=>{var n=Ce();N(n,`title`,`Add marker`),N(n,`aria-label`,`Add marker`);var r=u(n);N(r,`aria-hidden`,`true`),M(n),t(`click`,n,()=>s(d,!0)),L(e,n)};b(i,e=>{r.canMark&&e(c)});var l=o(i,2),f=e=>{var n=we();N(n,`title`,`Clear speech`),N(n,`aria-label`,`Clear speech`),a(()=>N(n,`disabled`,r.entries.length===0));var i=u(n);N(i,`aria-hidden`,`true`),M(n),t(`click`,n,()=>s(_,!0)),L(e,n)};b(l,e=>{r.canClear&&e(f)});var p=o(l,2),m=e=>{var n=Te();N(n,`title`,`Delete session`),N(n,`aria-label`,`Delete session`);var r=u(n);N(r,`aria-hidden`,`true`),M(n),t(`click`,n,()=>s(g,!0)),L(e,n)};b(p,e=>{r.canDelete&&e(m)}),M(n),L(e,n)};b(z,e=>{(r.canMark||r.canClear||r.canDelete)&&e(B)}),M(j);var V=o(j,2),H=u(V);Se(H,{get entries(){return r.entries}});var U=o(H,2),W=e=>{var t=ke(),n=u(t);N(n,`aria-hidden`,`true`),F(n,1,`svelte-1jnrixz`);var i=o(n,2),a=e=>{var t=De();A(2),L(e,t)},s=e=>{var t=Oe();A(2),L(e,t)};b(i,e=>{r.connection===`ended`?e(a):e(s,-1)}),M(t),L(e,t)};b(U,e=>{r.entries.length===0&&e(W)}),M(V),k(V,e=>s(v,e),()=>m(v));var G=o(V,2),K=e=>{var n=Pe(),i=u(n),a=e=>{var t=Ae();L(e,t)},s=e=>{var t=je();L(e,t)},c=e=>{var t=Me();L(e,t)};b(i,e=>{r.connection===`reconnecting`?e(a):r.connection===`failed`?e(s,1):e(c,-1)});var l=o(i,2),d=e=>{var n=Ne(),r=u(n);N(r,`slot`,`icon`),N(r,`aria-hidden`,`true`),A(),M(n),t(`click`,n,w),L(e,n)};b(l,e=>{m(S)||e(d)}),M(n),L(e,n)};b(G,e=>{r.connection!==`reconnecting`&&r.connection!==`failed`&&m(S)||e(K)}),M(O);var q=o(O,2),J=e=>{ve(e,{get open(){return m(d)},get onAdd(){return r.onAddMarker},onClose:()=>s(d,!1)})};b(q,e=>{r.canMark&&e(J)});var Y=o(q,2),X=e=>{fe(e,{get open(){return m(_)},get heading(){return r.heading},get onClear(){return r.onClear},onClose:()=>s(_,!1)})};b(Y,e=>{r.canClear&&e(X)});var Z=o(Y,2),ee=e=>{he(e,{get open(){return m(g)},get heading(){return r.heading},get onDelete(){return r.onDelete},onClose:()=>s(g,!1)})};b(Z,e=>{r.canDelete&&e(ee)}),a(()=>{h(R,r.heading),x(V,`role`,l()?void 0:`region`),x(V,`aria-label`,l()?void 0:`Speech log`),x(V,`aria-live`,l()?void 0:`off`),x(V,`aria-hidden`,l()?`true`:void 0),x(V,`tabindex`,l()?-1:0)}),T(`scroll`,V,C),T(`focus`,V,E),L(n,D),p()}E([`click`]);var Le=r(`<md-icon>visibility</md-icon>`,2),Re=r(`<span class="subtitle svelte-3qlloz"><!></span>`),ze=r(`<button type="button" role="option"><md-ripple></md-ripple> <span class="marker svelte-3qlloz"><!></span> <span class="text svelte-3qlloz" aria-hidden="true"><span class="title svelte-3qlloz"> </span> <!></span> <span class="visually-hidden"> </span></button>`,2);function Be(e,r){let s=n(),c=P(r,`selected`,3,!1),l=`${s}-name`;var d=ze();let f,p;var m=u(d);N(m,`aria-hidden`,`true`);var g=o(m,2),_=u(g),v=e=>{var t=Le();N(t,`aria-hidden`,`true`),L(e,t)};b(_,e=>{c()&&e(v)}),M(g);var y=o(g,2),S=u(y),C=i(S,!0),w=o(S,2),T=e=>{var t=Re(),n=u(t);R(n,()=>r.subtitle),M(t),L(e,t)};b(w,e=>{r.subtitle&&e(T)}),M(y);var E=o(y,2),O=i(E);M(d),a(()=>{f=F(d,1,`option svelte-3qlloz`,null,f,{selected:c()}),x(d,`aria-selected`,c()),x(d,`aria-labelledby`,l),p=D(d,``,p,{"--list-item-shape":r.shape}),h(C,r.title),x(E,`id`,l),h(O,`${r.title??``}, ${r.description??``}`)}),t(`click`,d,function(...e){r.onSelect?.apply(this,e)}),L(e,d)}E([`click`]);function Ve(e){let t=Math.max(0,Math.floor(e/1e3)),n=Math.floor(t/3600),r=Math.floor(t%3600/60),i=t%60;return n>0?`${n} h ${String(r).padStart(2,`0`)} min`:r>0?`${r} min ${i} s`:`${i} s`}function He(e,t){let n=Ve((e.endedAt===null?t:Date.parse(e.endedAt))-Date.parse(e.startedAt)),r=e.endedAt===null,i=`${e.entries} ${e.entries===1?`entry`:`entries`}`,a=[r?`live`:null,e.run===null?null:`run ${e.run}`,r?null:n,r?null:i,`Session ${e.id}`];return{id:`#${e.id}`,run:e.run,duration:n,entries:i,spoken:a.filter(e=>e!==null).join(`, `)}}var $=`none`,Ue=/^[1-9]\d*$/;function We(e){if(e===`none`)return $;if(!Ue.test(e))return null;let t=Number(e);return Number.isSafeInteger(t)?t:null}function Ge(e,t,n){let r=e===null?null:We(e);return r===`none`?$:r!==null&&t.some(e=>e.id===r)?r:n??`none`}function Ke(e,t){let n=t.findIndex(t=>t.id===e);return n===-1?null:(t[n+1]??t[n-1])?.id??null}var qe=r(`<p class="svelte-17z3k9b">This session has no entries, so ending it deletes it. Its number is not reused.</p>`),Je=r(`<p class="svelte-17z3k9b">Speech captured after this belongs to no session.</p>`),Ye=r(`<p role="alert" class="failure svelte-17z3k9b"> </p>`),Xe=r(`<md-dialog><div slot="headline"> </div> <div slot="content"><!> <!></div> <div slot="actions"><md-text-button>Cancel</md-text-button> <md-text-button>End session</md-text-button></div></md-dialog>`,2);function Ze(n,r){e(r,!0);let l=v(()=>r.entries===0),d=y(``),f=y(!1);c(()=>{r.open&&s(d,``)});async function g(){if(!m(f)){s(d,``),s(f,!0);try{await r.onEnd(),r.onClose()}catch(e){s(d,e instanceof Error?e.message:`The session could not be ended.`,!0)}finally{s(f,!1)}}}var _=Xe();a(()=>N(_,`open`,r.open)),F(_,1,`svelte-17z3k9b`);var x=u(_),S=i(x),C=o(x,2),w=u(C),E=e=>{var t=qe();L(e,t)},D=e=>{var t=Je();L(e,t)};b(w,e=>{m(l)?e(E):e(D,-1)});var O=o(w,2),k=e=>{var t=Ye(),n=i(t,!0);a(()=>h(n,m(d))),L(e,t)};b(O,e=>{m(d)!==``&&e(k)}),M(C);var A=o(C,2),j=u(A);N(j,`type`,`button`);var P=o(j,2);N(P,`type`,`button`),a(()=>N(P,`disabled`,m(f))),M(A),M(_),a(()=>h(S,`${m(l)?`Drop`:`End`} session ${r.sessionId===null?``:`#${r.sessionId}`}?`)),T(`closed`,_,function(...e){r.onClose?.apply(this,e)}),t(`click`,j,function(...e){r.onClose?.apply(this,e)}),t(`click`,P,g),L(n,_),p()}E([`click`]);var Qe=r(`<span class="dot svelte-wvg2ho"></span>`),$e=r(`<span class="run svelte-wvg2ho"> </span>`),et=r(`<span class="meta svelte-wvg2ho"><!> <!> <span class="svelte-wvg2ho"> </span> <span class="svelte-wvg2ho"> </span> <span class="id svelte-wvg2ho"> </span></span>`);function tt(t,n){e(n,!0);let r=e=>{var t=et(),r=u(t),c=e=>{var t=Qe();L(e,t)};b(r,e=>{n.live&&e(c)});var l=o(r,2),d=e=>{var t=$e(),n=i(t,!0);a(()=>h(n,m(s).run)),L(e,t)};b(l,e=>{m(s).run!==null&&e(d)});var f=o(l,2),p=i(f,!0),g=o(f,2),_=i(g,!0),v=o(g,2),y=i(v,!0);M(t),a(()=>{h(p,m(s).duration),h(_,m(s).entries),h(y,m(s).id)}),L(e,t)},s=v(()=>He(n.session,n.now));Be(t,{get title(){return n.session.name},shape:`var(--md-sys-shape-corner-extra-large, 28px)`,get subtitle(){return r},get selected(){return n.selected},get description(){return m(s).spoken},get onSelect(){return n.onSelect}}),p()}var nt=r(`<p role="alert" class="failure svelte-2k1elc"> </p>`),rt=r(`<md-dialog><div slot="headline">Start a session</div> <form slot="content" id="start-session-form" novalidate="" class="svelte-2k1elc"><md-outlined-text-field></md-outlined-text-field> <md-outlined-text-field></md-outlined-text-field> <!></form> <div slot="actions"><md-text-button>Cancel</md-text-button> <md-text-button>Start</md-text-button></div></md-dialog>`,2);function it(n,r){e(r,!0);let l=y(``),d=y(``),f=y(``),g=y(``),_=y(!1);c(()=>{r.open&&(s(l,``),s(d,``),s(f,``),s(g,``))});async function v(e){if(e.preventDefault(),m(_))return;let t=m(l).trim();if(t===``)s(f,`Enter a name.`);else{s(f,``),s(g,``),s(_,!0);try{await r.onStart(t,m(d).trim()===``?null:m(d).trim()),r.onClose()}catch(e){s(g,e instanceof Error?e.message:`The session could not be started.`,!0)}finally{s(_,!1)}}}var x=rt();a(()=>N(x,`open`,r.open)),F(x,1,`svelte-2k1elc`);var S=o(u(x),2),C=u(S);N(C,`label`,`Name`),N(C,`required`,!0),a(()=>N(C,`maxlength`,X.sessionLabelLength)),a(()=>N(C,`value`,m(l))),a(()=>N(C,`error`,m(f)!==``)),a(()=>N(C,`error-text`,m(f)));var w=o(C,2);N(w,`label`,`Run (optional)`),N(w,`supporting-text`,`Groups sessions, for example one run id per test run.`),a(()=>N(w,`maxlength`,X.sessionLabelLength)),a(()=>N(w,`value`,m(d)));var E=o(w,2),D=e=>{var t=nt(),n=i(t,!0);a(()=>h(n,m(g))),L(e,t)};b(E,e=>{m(g)!==``&&e(D)}),M(S);var O=o(S,2),k=u(O);N(k,`type`,`button`);var A=o(k,2);N(A,`type`,`submit`),N(A,`form`,`start-session-form`),a(()=>N(A,`disabled`,m(_))),M(O),M(x),T(`closed`,x,function(...e){r.onClose?.apply(this,e)}),T(`submit`,S,v),t(`input`,C,e=>s(l,e.target.value,!0)),t(`input`,w,e=>s(d,e.target.value,!0)),t(`click`,k,function(...e){r.onClose?.apply(this,e)}),L(n,x),p()}E([`input`,`click`]);var at=r(`<span> </span>`),ot=r(`<md-icon-button><md-icon> </md-icon></md-icon-button>`,2),st=r(`<p class="empty svelte-1fz71rn">No sessions in the buffer. Start one with the play button.</p>`),ct=r(`<!> <div class="listbox svelte-1fz71rn" role="listbox" aria-label="Session to show"><!> <div class="outside svelte-1fz71rn"><!></div></div>`,1),lt=r(`<section aria-labelledby="sessions-heading"><header class="svelte-1fz71rn"><!> <h2 id="sessions-heading">Sessions</h2> <md-icon-button><md-icon> </md-icon></md-icon-button></header> <!></section> <!> <!>`,3);function ut(n,r){e(r,!0);let c=e=>{var t=at(),n=i(t,!0);a(()=>h(n,m(T))),L(e,t)},l=P(r,`collapsed`,3,!1),d=y(!1),g=y(!1),_=y(0),x=v(()=>r.currentId===null?`Start a session`:`End session ${r.currentId}`),C=v(()=>l()?`Expand sessions`:`Collapse sessions`),T=v(()=>r.outsideEntries===1?`1 entry`:`${r.outsideEntries} entries`),E=v(()=>[`Speech captured while no session was running`,...r.currentId===null?[]:[m(T)]].join(`, `));var k=lt(),A=f(k);let I;var R=u(A),z=u(R),B=e=>{var n=ot();F(n,1,`collapse`),a(()=>N(n,`title`,m(C))),a(()=>N(n,`aria-label`,m(C))),a(()=>N(n,`aria-expanded`,!l()));var o=u(n);N(o,`aria-hidden`,`true`);var s=i(o,!0);M(n),a(()=>h(s,l()?`left_panel_open`:`left_panel_close`)),t(`click`,n,function(...e){r.onToggleCollapse?.apply(this,e)}),L(e,n)};b(z,e=>{r.onToggleCollapse&&e(B)});var V=o(z,2);let H;var U=o(V,2);a(()=>N(U,`title`,m(x))),a(()=>N(U,`aria-label`,m(x)));var W=u(U);N(W,`aria-hidden`,`true`);var G=i(W,!0);M(U),M(R);var K=o(R,2),q=e=>{},J=e=>{var t=ct(),n=f(t),i=e=>{var t=st();L(e,t)};b(n,e=>{r.sessions.length===0&&e(i)});var l=o(n,2);let d;var p=u(l);O(p,17,()=>r.sessions,e=>e.id,(e,t)=>{{let n=v(()=>m(t).id===r.currentId),i=v(()=>m(t).id===r.selectedId);tt(e,{get session(){return m(t)},get now(){return r.now},get live(){return m(n)},get selected(){return m(i)},onSelect:()=>r.onSelect(m(t).id)})}});var h=o(p,2),g=u(h);{let e=v(()=>r.selectedId===$);Be(g,{title:`Records outside sessions`,shape:`var(--md-sys-shape-corner-extra-large, 28px)`,get subtitle(){return c},get selected(){return m(e)},get description(){return m(E)},onSelect:()=>r.onSelect($)})}M(h),M(l),S(l,()=>ae(`[role="option"]`,{singleTabStop:!0,wrap:!0,leftRight:!0})),a(()=>d=D(l,``,d,{"scroll-padding-bottom":`${m(_)??``}px`})),j(h,`offsetHeight`,e=>s(_,e)),L(e,t)};b(K,e=>{l()?e(q):e(J,-1)}),M(A);var Y=o(A,2);it(Y,{get open(){return m(d)},get onStart(){return r.onStart},onClose:()=>s(d,!1)});var X=o(Y,2);{let e=v(()=>r.sessions.find(e=>e.id===r.currentId)?.entries??null);Ze(X,{get open(){return m(g)},get sessionId(){return r.currentId},get entries(){return m(e)},get onEnd(){return r.onEnd},onClose:()=>s(g,!1)})}a(()=>{I=F(A,1,`svelte-1fz71rn`,null,I,{collapsed:l()}),H=F(V,1,`svelte-1fz71rn`,null,H,{"visually-hidden":l()}),F(U,1,w(r.currentId===null?`start`:`stop`),`svelte-1fz71rn`),h(G,r.currentId===null?`play_arrow`:`stop`)}),t(`click`,U,()=>r.currentId===null?s(d,!0):s(g,!0)),L(n,k),p()}E([`click`]);function dt(e,t,n){return{async start(t,r){await n((await e.start(t,r)).id)},async end(){let t=e.currentId;await e.end(),t!==null&&!e.sessions.some(e=>e.id===t)&&await n(null)},async clear(n){await t.clear(n),await e.refresh()},async remove(t){if(typeof t!=`number`)return;let r=Ke(t,e.sessions);await e.delete(t),await n(r)}}}var ft=r(`<div class="monitor svelte-1uha8ag"><h1 class="visually-hidden">Monitor</h1> <div><!></div> <div class="log svelte-1uha8ag"><!> <div class="log-body svelte-1uha8ag"><!></div></div></div>`);function pt(t,n){e(n,!0);let{sessions:r,speech:i,sessionsPane:s}=K();_(()=>r.seed(n.data.sessions,n.data.now));let d=v(()=>({sessions:r.sessions,currentId:r.currentId,outsideEntries:r.outsideEntries})),f=v(()=>r.now),h=v(()=>Ge(V.url.searchParams.get(`session`),m(d).sessions,m(d).currentId)),y=v(()=>ie(m(h),m(d).sessions)),x=v(()=>te(m(h),m(d).currentId)),S=v(()=>re(m(h),m(d).currentId)),w=v(()=>ee(m(h),m(d).currentId));I(()=>(s.init(),r.init())),c(()=>i.open(m(h),_(()=>ne(m(h),m(d).currentId))));function T(e){return z(e===null?B(`/`):`${B(`/`)}?session=${e}`,{reset:!1})}let E=dt(r,i,T);var D=ft();C(`1uha8ag`,e=>{g(()=>{l.title=`Monitor · Speech Capture`})});var O=o(u(D),2);let k;ut(u(O),{get collapsed(){return s.collapsed},onToggleCollapse:()=>s.toggle(),get sessions(){return m(d).sessions},get currentId(){return m(d).currentId},get outsideEntries(){return m(d).outsideEntries},get selectedId(){return m(h)},get now(){return m(f)},onSelect:e=>void T(e),onStart:(e,t)=>E.start(e,t),onEnd:()=>E.end()}),M(O);var A=o(O,2),j=u(A),N=e=>{se(e,{})};b(j,e=>{n.data.local&&e(N)});var P=o(j,2);Ie(u(P),{get heading(){return m(y)},get local(){return n.data.local},get entries(){return i.entries},get connection(){return i.connection},get canMark(){return m(x)},onAddMarker:e=>i.addMarker(e),get canClear(){return m(S)},onClear:()=>E.clear(m(h)),get canDelete(){return m(w)},onDelete:()=>E.remove(m(h))}),M(P),M(A),M(D),a(()=>k=F(O,1,`sessions svelte-1uha8ag`,null,k,{collapsed:s.collapsed})),L(t,D),p()}export{pt as component};
|
|
5
|
+
This cannot be undone.</p> <!></div> <div slot="actions"><md-text-button>Cancel</md-text-button> <md-text-button>Clear</md-text-button></div></md-dialog>`,2);function fe(n,r){e(r,!0);let l=y(``),d=y(!1);c(()=>{r.open&&s(l,``)});async function f(){if(!m(d)){s(l,``),s(d,!0);try{await r.onClear(),r.onClose()}catch(e){s(l,e instanceof Error?e.message:`The speech could not be cleared.`,!0)}finally{s(d,!1)}}}var g=de();a(()=>N(g,`open`,r.open)),F(g,1,`svelte-qieqgw`);var _=o(u(g),2),v=u(_),x=o(u(v)),S=i(x,!0);A(),M(v);var C=o(v,2),w=e=>{var t=ue(),n=i(t,!0);a(()=>h(n,m(l))),L(e,t)};b(C,e=>{m(l)!==``&&e(w)}),M(_);var E=o(_,2),D=u(E);N(D,`type`,`button`);var O=o(D,2);N(O,`type`,`button`),a(()=>N(O,`disabled`,m(d))),M(E),M(g),a(()=>h(S,r.heading)),T(`closed`,g,function(...e){r.onClose?.apply(this,e)}),t(`click`,D,function(...e){r.onClose?.apply(this,e)}),t(`click`,O,f),L(n,g),p()}E([`click`]);var pe=r(`<p role="alert" class="failure svelte-1sof82u"> </p>`),me=r(`<md-dialog><div slot="headline">Delete session?</div> <div slot="content"><p class="svelte-1sof82u"><strong> </strong> and its speech are removed from the bridge. This cannot be undone.</p> <!></div> <div slot="actions"><md-text-button>Cancel</md-text-button> <md-text-button>Delete</md-text-button></div></md-dialog>`,2);function he(n,r){e(r,!0);let l=y(``),d=y(!1);c(()=>{r.open&&s(l,``)});async function f(){if(!m(d)){s(l,``),s(d,!0);try{await r.onDelete(),r.onClose()}catch(e){s(l,e instanceof Error?e.message:`The session could not be deleted.`,!0)}finally{s(d,!1)}}}var g=me();a(()=>N(g,`open`,r.open)),F(g,1,`svelte-1sof82u`);var _=o(u(g),2),v=u(_),x=u(v),S=i(x,!0);A(),M(v);var C=o(v,2),w=e=>{var t=pe(),n=i(t,!0);a(()=>h(n,m(l))),L(e,t)};b(C,e=>{m(l)!==``&&e(w)}),M(_);var E=o(_,2),D=u(E);N(D,`type`,`button`);var O=o(D,2);N(O,`type`,`button`),a(()=>N(O,`disabled`,m(d))),M(E),M(g),a(()=>h(S,r.heading)),T(`closed`,g,function(...e){r.onClose?.apply(this,e)}),t(`click`,D,function(...e){r.onClose?.apply(this,e)}),t(`click`,O,f),L(n,g),p()}E([`click`]);var ge=r(`<p role="alert" class="failure svelte-ttl1x5"> </p>`),_e=r(`<md-dialog><div slot="headline">Add a marker</div> <form slot="content" id="add-marker-form" novalidate="" class="svelte-ttl1x5"><md-outlined-text-field></md-outlined-text-field> <!></form> <div slot="actions"><md-text-button>Cancel</md-text-button> <md-text-button>Add</md-text-button></div></md-dialog>`,2);function ve(n,r){e(r,!0);let l=y(``),d=y(``),f=y(``),g=y(!1);c(()=>{r.open&&(s(l,``),s(d,``),s(f,``))});async function _(e){if(e.preventDefault(),m(g))return;let t=m(l).trim();if(t===``)s(d,`Enter a label.`);else{s(d,``),s(f,``),s(g,!0);try{await r.onAdd(t),r.onClose()}catch(e){s(f,e instanceof Error?e.message:`The marker could not be added.`,!0)}finally{s(g,!1)}}}var v=_e();a(()=>N(v,`open`,r.open)),F(v,1,`svelte-ttl1x5`);var x=o(u(v),2),S=u(x);N(S,`label`,`Label`),N(S,`required`,!0),a(()=>N(S,`maxlength`,X.markerLength)),N(S,`supporting-text`,`Shows in the log as a row of its own, for example “step 3”.`),a(()=>N(S,`value`,m(l))),a(()=>N(S,`error`,m(d)!==``)),a(()=>N(S,`error-text`,m(d)));var C=o(S,2),w=e=>{var t=ge(),n=i(t,!0);a(()=>h(n,m(f))),L(e,t)};b(C,e=>{m(f)!==``&&e(w)}),M(x);var E=o(x,2),D=u(E);N(D,`type`,`button`);var O=o(D,2);N(O,`type`,`submit`),N(O,`form`,`add-marker-form`),a(()=>N(O,`disabled`,m(g))),M(E),M(v),T(`closed`,v,function(...e){r.onClose?.apply(this,e)}),T(`submit`,x,_),t(`input`,S,e=>s(l,e.target.value,!0)),t(`click`,D,function(...e){r.onClose?.apply(this,e)}),L(n,v),p()}E([`input`,`click`]);var ye=r(`<span class="pill svelte-5c13xh"><md-icon>bookmark</md-icon> <span class="visually-hidden">Marker:</span> <span class="label mono svelte-5c13xh"> </span></span>`,2),be=r(`<tr><td class="time mono svelte-5c13xh"> </td><td class="text svelte-5c13xh"><!></td><td class="seq mono svelte-5c13xh"> </td></tr>`),xe=r(`<p hidden=""></p> <table aria-label="Speech" class="svelte-5c13xh"><thead class="svelte-5c13xh"><tr><th scope="col" class="svelte-5c13xh">Received</th><th scope="col" class="svelte-5c13xh">Spoken text</th><th scope="col" class="seq svelte-5c13xh" aria-label="Seq"><span class="seq-head svelte-5c13xh">Seq <span class="help svelte-5c13xh" aria-hidden="true"><md-icon>help</md-icon></span></span></th></tr></thead><tbody class="svelte-5c13xh"></tbody></table>`,3);function Se(t,r){let s=n();e(r,!0);let c=e=>Date.now()-Date.parse(e.receivedAt)<2e3;var l=xe(),g=f(l);g.textContent=`Seq is the entry's number in the API (since, --since). It is large because it starts at the bridge's start time; only its order matters. Numbers can be skipped.`;var _=o(g,2),v=u(_),y=u(v),S=o(u(y),2),C=u(S),w=o(u(C));x(w,`title`,`Seq is the entry's number in the API (since, --since). It is large because it starts at the bridge's start time; only its order matters. Numbers can be skipped.`);var T=u(w);N(T,`aria-hidden`,`true`),F(T,1,`svelte-5c13xh`),M(w),M(C),M(S),M(y),M(v);var E=o(v);O(E,21,()=>r.entries,e=>e.seq,(e,t)=>{var n=be();let r;var s=u(n),l=i(s,!0),f=o(s),p=u(f),g=e=>{var n=ye(),r=u(n);N(r,`aria-hidden`,`true`),F(r,1,`svelte-5c13xh`);var s=o(r,4),c=i(s,!0);M(n),a(()=>{x(n,`title`,m(t).text),h(c,m(t).text)}),L(e,n)},_=e=>{var n=d();a(()=>h(n,m(t).text)),L(e,n)};b(p,e=>{m(t).kind===`marker`?e(g):e(_,-1)}),M(f);var v=o(f),y=i(v);M(n),a((e,i)=>{r=F(n,1,`svelte-5c13xh`,null,r,{fresh:e,marker:m(t).kind===`marker`}),h(l,i),h(y,`#${m(t).seq??``}`)},[()=>c(m(t)),()=>Z(m(t).receivedAt)]),L(e,n)}),M(E),M(_),a(()=>{x(g,`id`,s),x(_,`aria-describedby`,s)}),L(t,l),p()}var Ce=r(`<md-icon-button><md-icon>bookmark_add</md-icon></md-icon-button>`,2),we=r(`<md-icon-button><md-icon>delete_sweep</md-icon></md-icon-button>`,2),Te=r(`<md-icon-button><md-icon>delete</md-icon></md-icon-button>`,2),Ee=r(`<div role="toolbar" aria-label="Log actions"><!> <!> <!></div>`),De=r(`<p class="title svelte-1jnrixz">No entries left</p> <p class="svelte-1jnrixz">This session's entries are no longer in the buffer.</p>`,1),Oe=r(`<p class="title svelte-1jnrixz">No speech yet</p> <p class="svelte-1jnrixz">Make the screen reader speak.</p>`,1),ke=r(`<div class="empty svelte-1jnrixz"><md-icon>mic</md-icon> <!></div>`,2),Ae=r(`<p role="status" class="mono svelte-1jnrixz">Connection lost, reconnecting…</p>`),je=r(`<p role="alert" class="mono failed svelte-1jnrixz">The speech could not be loaded.</p>`),Me=r(`<span></span>`),Ne=r(`<md-filled-tonal-button><md-icon>arrow_downward</md-icon> Jump to latest</md-filled-tonal-button>`,2),Pe=r(`<footer class="svelte-1jnrixz"><!> <!></footer>`),Fe=r(`<section class="log svelte-1jnrixz"><header class="svelte-1jnrixz"><h2 class="trunc svelte-1jnrixz"> </h2> <!></header> <div class="scroll svelte-1jnrixz"><!> <!></div> <!></section> <!> <!> <!>`,1);function Ie(n,r){e(r,!0);let l=P(r,`local`,3,!1),d=y(!1),g=y(!1),_=y(!1),v=y(void 0),S=y(!0);function C(){m(v)&&s(S,m(v).scrollHeight-m(v).scrollTop-m(v).clientHeight<=48)}function w(){s(S,!0),m(v)?.scrollTo({top:m(v).scrollHeight})}function E(e){l()&&e.currentTarget.blur()}c(()=>{r.entries.length===0&&s(S,!0),m(S)&&m(v)&&(m(v).scrollTop=m(v).scrollHeight)});var D=Fe(),O=f(D),j=u(O),I=u(j),R=i(I,!0),z=o(I,2),B=e=>{var n=Ee(),i=u(n),c=e=>{var n=Ce();N(n,`title`,`Add marker`),N(n,`aria-label`,`Add marker`);var r=u(n);N(r,`aria-hidden`,`true`),M(n),t(`click`,n,()=>s(d,!0)),L(e,n)};b(i,e=>{r.canMark&&e(c)});var l=o(i,2),f=e=>{var n=we();N(n,`title`,`Clear speech`),N(n,`aria-label`,`Clear speech`),a(()=>N(n,`disabled`,r.entries.length===0));var i=u(n);N(i,`aria-hidden`,`true`),M(n),t(`click`,n,()=>s(_,!0)),L(e,n)};b(l,e=>{r.canClear&&e(f)});var p=o(l,2),m=e=>{var n=Te();N(n,`title`,`Delete session`),N(n,`aria-label`,`Delete session`);var r=u(n);N(r,`aria-hidden`,`true`),M(n),t(`click`,n,()=>s(g,!0)),L(e,n)};b(p,e=>{r.canDelete&&e(m)}),M(n),L(e,n)};b(z,e=>{(r.canMark||r.canClear||r.canDelete)&&e(B)}),M(j);var V=o(j,2),H=u(V);Se(H,{get entries(){return r.entries}});var U=o(H,2),W=e=>{var t=ke(),n=u(t);N(n,`aria-hidden`,`true`),F(n,1,`svelte-1jnrixz`);var i=o(n,2),a=e=>{var t=De();A(2),L(e,t)},s=e=>{var t=Oe();A(2),L(e,t)};b(i,e=>{r.connection===`ended`?e(a):e(s,-1)}),M(t),L(e,t)};b(U,e=>{r.entries.length===0&&e(W)}),M(V),k(V,e=>s(v,e),()=>m(v));var G=o(V,2),K=e=>{var n=Pe(),i=u(n),a=e=>{var t=Ae();L(e,t)},s=e=>{var t=je();L(e,t)},c=e=>{var t=Me();L(e,t)};b(i,e=>{r.connection===`reconnecting`?e(a):r.connection===`failed`?e(s,1):e(c,-1)});var l=o(i,2),d=e=>{var n=Ne(),r=u(n);N(r,`slot`,`icon`),N(r,`aria-hidden`,`true`),A(),M(n),t(`click`,n,w),L(e,n)};b(l,e=>{m(S)||e(d)}),M(n),L(e,n)};b(G,e=>{r.connection!==`reconnecting`&&r.connection!==`failed`&&m(S)||e(K)}),M(O);var q=o(O,2),J=e=>{ve(e,{get open(){return m(d)},get onAdd(){return r.onAddMarker},onClose:()=>s(d,!1)})};b(q,e=>{r.canMark&&e(J)});var Y=o(q,2),X=e=>{fe(e,{get open(){return m(_)},get heading(){return r.heading},get onClear(){return r.onClear},onClose:()=>s(_,!1)})};b(Y,e=>{r.canClear&&e(X)});var Z=o(Y,2),ee=e=>{he(e,{get open(){return m(g)},get heading(){return r.heading},get onDelete(){return r.onDelete},onClose:()=>s(g,!1)})};b(Z,e=>{r.canDelete&&e(ee)}),a(()=>{h(R,r.heading),x(V,`role`,l()?void 0:`region`),x(V,`aria-label`,l()?void 0:`Speech log`),x(V,`aria-live`,l()?void 0:`off`),x(V,`aria-hidden`,l()?`true`:void 0),x(V,`tabindex`,l()?-1:0)}),T(`scroll`,V,C),T(`focus`,V,E),L(n,D),p()}E([`click`]);var Le=r(`<md-icon>visibility</md-icon>`,2),Re=r(`<span class="subtitle svelte-3qlloz"><!></span>`),ze=r(`<button type="button" role="option"><md-ripple></md-ripple> <span class="marker svelte-3qlloz"><!></span> <span class="text svelte-3qlloz" aria-hidden="true"><span class="title svelte-3qlloz"> </span> <!></span> <span class="visually-hidden"> </span></button>`,2);function Be(e,r){let s=n(),c=P(r,`selected`,3,!1),l=`${s}-name`;var d=ze();let f,p;var m=u(d);N(m,`aria-hidden`,`true`);var g=o(m,2),_=u(g),v=e=>{var t=Le();N(t,`aria-hidden`,`true`),L(e,t)};b(_,e=>{c()&&e(v)}),M(g);var y=o(g,2),S=u(y),C=i(S,!0),w=o(S,2),T=e=>{var t=Re(),n=u(t);R(n,()=>r.subtitle),M(t),L(e,t)};b(w,e=>{r.subtitle&&e(T)}),M(y);var E=o(y,2),O=i(E);M(d),a(()=>{f=F(d,1,`option svelte-3qlloz`,null,f,{selected:c()}),x(d,`aria-selected`,c()),x(d,`aria-labelledby`,l),p=D(d,``,p,{"--list-item-shape":r.shape}),h(C,r.title),x(E,`id`,l),h(O,`${r.title??``}, ${r.description??``}`)}),t(`click`,d,function(...e){r.onSelect?.apply(this,e)}),L(e,d)}E([`click`]);function Ve(e){let t=Math.max(0,Math.floor(e/1e3)),n=Math.floor(t/3600),r=Math.floor(t%3600/60),i=t%60;return n>0?`${n} h ${String(r).padStart(2,`0`)} min`:r>0?`${r} min ${i} s`:`${i} s`}function He(e,t){let n=Ve((e.endedAt===null?t:Date.parse(e.endedAt))-Date.parse(e.startedAt)),r=e.endedAt===null,i=`${e.entries} ${e.entries===1?`entry`:`entries`}`,a=[r?`live`:null,e.run===null?null:`run ${e.run}`,r?null:n,r?null:i,`Session ${e.id}`];return{id:`#${e.id}`,run:e.run,duration:n,entries:i,spoken:a.filter(e=>e!==null).join(`, `)}}var $=`none`,Ue=/^[1-9]\d*$/;function We(e){if(e===`none`)return $;if(!Ue.test(e))return null;let t=Number(e);return Number.isSafeInteger(t)?t:null}function Ge(e,t,n){let r=e===null?null:We(e);return r===`none`?$:r!==null&&t.some(e=>e.id===r)?r:n??`none`}function Ke(e,t){let n=t.findIndex(t=>t.id===e);return n===-1?null:(t[n+1]??t[n-1])?.id??null}var qe=r(`<p class="svelte-17z3k9b">This session has no entries, so ending it deletes it. Its number is not reused.</p>`),Je=r(`<p class="svelte-17z3k9b">Speech captured after this belongs to no session.</p>`),Ye=r(`<p role="alert" class="failure svelte-17z3k9b"> </p>`),Xe=r(`<md-dialog><div slot="headline"> </div> <div slot="content"><!> <!></div> <div slot="actions"><md-text-button>Cancel</md-text-button> <md-text-button>End session</md-text-button></div></md-dialog>`,2);function Ze(n,r){e(r,!0);let l=v(()=>r.entries===0),d=y(``),f=y(!1);c(()=>{r.open&&s(d,``)});async function g(){if(!m(f)){s(d,``),s(f,!0);try{await r.onEnd(),r.onClose()}catch(e){s(d,e instanceof Error?e.message:`The session could not be ended.`,!0)}finally{s(f,!1)}}}var _=Xe();a(()=>N(_,`open`,r.open)),F(_,1,`svelte-17z3k9b`);var x=u(_),S=i(x),C=o(x,2),w=u(C),E=e=>{var t=qe();L(e,t)},D=e=>{var t=Je();L(e,t)};b(w,e=>{m(l)?e(E):e(D,-1)});var O=o(w,2),k=e=>{var t=Ye(),n=i(t,!0);a(()=>h(n,m(d))),L(e,t)};b(O,e=>{m(d)!==``&&e(k)}),M(C);var A=o(C,2),j=u(A);N(j,`type`,`button`);var P=o(j,2);N(P,`type`,`button`),a(()=>N(P,`disabled`,m(f))),M(A),M(_),a(()=>h(S,`${m(l)?`Drop`:`End`} session ${r.sessionId===null?``:`#${r.sessionId}`}?`)),T(`closed`,_,function(...e){r.onClose?.apply(this,e)}),t(`click`,j,function(...e){r.onClose?.apply(this,e)}),t(`click`,P,g),L(n,_),p()}E([`click`]);var Qe=r(`<span class="dot svelte-wvg2ho"></span>`),$e=r(`<span class="run svelte-wvg2ho"> </span>`),et=r(`<span class="meta svelte-wvg2ho"><!> <!> <span class="svelte-wvg2ho"> </span> <span class="svelte-wvg2ho"> </span> <span class="id svelte-wvg2ho"> </span></span>`);function tt(t,n){e(n,!0);let r=e=>{var t=et(),r=u(t),c=e=>{var t=Qe();L(e,t)};b(r,e=>{n.live&&e(c)});var l=o(r,2),d=e=>{var t=$e(),n=i(t,!0);a(()=>h(n,m(s).run)),L(e,t)};b(l,e=>{m(s).run!==null&&e(d)});var f=o(l,2),p=i(f,!0),g=o(f,2),_=i(g,!0),v=o(g,2),y=i(v,!0);M(t),a(()=>{h(p,m(s).duration),h(_,m(s).entries),h(y,m(s).id)}),L(e,t)},s=v(()=>He(n.session,n.now));Be(t,{get title(){return n.session.name},shape:`var(--md-sys-shape-corner-extra-large, 28px)`,get subtitle(){return r},get selected(){return n.selected},get description(){return m(s).spoken},get onSelect(){return n.onSelect}}),p()}var nt=r(`<p role="alert" class="failure svelte-2k1elc"> </p>`),rt=r(`<md-dialog><div slot="headline">Start a session</div> <form slot="content" id="start-session-form" novalidate="" class="svelte-2k1elc"><md-outlined-text-field></md-outlined-text-field> <md-outlined-text-field></md-outlined-text-field> <!></form> <div slot="actions"><md-text-button>Cancel</md-text-button> <md-text-button>Start</md-text-button></div></md-dialog>`,2);function it(n,r){e(r,!0);let l=y(``),d=y(``),f=y(``),g=y(``),_=y(!1);c(()=>{r.open&&(s(l,``),s(d,``),s(f,``),s(g,``))});async function v(e){if(e.preventDefault(),m(_))return;let t=m(l).trim();if(t===``)s(f,`Enter a name.`);else{s(f,``),s(g,``),s(_,!0);try{await r.onStart(t,m(d).trim()===``?null:m(d).trim()),r.onClose()}catch(e){s(g,e instanceof Error?e.message:`The session could not be started.`,!0)}finally{s(_,!1)}}}var x=rt();a(()=>N(x,`open`,r.open)),F(x,1,`svelte-2k1elc`);var S=o(u(x),2),C=u(S);N(C,`label`,`Name`),N(C,`required`,!0),a(()=>N(C,`maxlength`,X.sessionLabelLength)),a(()=>N(C,`value`,m(l))),a(()=>N(C,`error`,m(f)!==``)),a(()=>N(C,`error-text`,m(f)));var w=o(C,2);N(w,`label`,`Run (optional)`),N(w,`supporting-text`,`Groups sessions, for example one run id per test run.`),a(()=>N(w,`maxlength`,X.sessionLabelLength)),a(()=>N(w,`value`,m(d)));var E=o(w,2),D=e=>{var t=nt(),n=i(t,!0);a(()=>h(n,m(g))),L(e,t)};b(E,e=>{m(g)!==``&&e(D)}),M(S);var O=o(S,2),k=u(O);N(k,`type`,`button`);var A=o(k,2);N(A,`type`,`submit`),N(A,`form`,`start-session-form`),a(()=>N(A,`disabled`,m(_))),M(O),M(x),T(`closed`,x,function(...e){r.onClose?.apply(this,e)}),T(`submit`,S,v),t(`input`,C,e=>s(l,e.target.value,!0)),t(`input`,w,e=>s(d,e.target.value,!0)),t(`click`,k,function(...e){r.onClose?.apply(this,e)}),L(n,x),p()}E([`input`,`click`]);var at=r(`<span> </span>`),ot=r(`<md-icon-button><md-icon> </md-icon></md-icon-button>`,2),st=r(`<p class="empty svelte-1fz71rn">No sessions in the buffer. Start one with the play button.</p>`),ct=r(`<!> <div class="listbox svelte-1fz71rn" role="listbox" aria-label="Session to show"><!> <div class="outside svelte-1fz71rn"><!></div></div>`,1),lt=r(`<section aria-labelledby="sessions-heading"><header class="svelte-1fz71rn"><!> <h2 id="sessions-heading">Sessions</h2> <md-icon-button><md-icon> </md-icon></md-icon-button></header> <!></section> <!> <!>`,3);function ut(n,r){e(r,!0);let c=e=>{var t=at(),n=i(t,!0);a(()=>h(n,m(T))),L(e,t)},l=P(r,`collapsed`,3,!1),d=y(!1),g=y(!1),_=y(0),x=v(()=>r.currentId===null?`Start a session`:`End session ${r.currentId}`),C=v(()=>l()?`Expand sessions`:`Collapse sessions`),T=v(()=>r.outsideEntries===1?`1 entry`:`${r.outsideEntries} entries`),E=v(()=>[`Speech captured while no session was running`,...r.currentId===null?[]:[m(T)]].join(`, `));var k=lt(),A=f(k);let I;var R=u(A),z=u(R),B=e=>{var n=ot();F(n,1,`collapse`),a(()=>N(n,`title`,m(C))),a(()=>N(n,`aria-label`,m(C))),a(()=>N(n,`aria-expanded`,!l()));var o=u(n);N(o,`aria-hidden`,`true`);var s=i(o,!0);M(n),a(()=>h(s,l()?`left_panel_open`:`left_panel_close`)),t(`click`,n,function(...e){r.onToggleCollapse?.apply(this,e)}),L(e,n)};b(z,e=>{r.onToggleCollapse&&e(B)});var V=o(z,2);let H;var U=o(V,2);a(()=>N(U,`title`,m(x))),a(()=>N(U,`aria-label`,m(x)));var W=u(U);N(W,`aria-hidden`,`true`);var G=i(W,!0);M(U),M(R);var K=o(R,2),q=e=>{},J=e=>{var t=ct(),n=f(t),i=e=>{var t=st();L(e,t)};b(n,e=>{r.sessions.length===0&&e(i)});var l=o(n,2);let d;var p=u(l);O(p,17,()=>r.sessions,e=>e.id,(e,t)=>{{let n=v(()=>m(t).id===r.currentId),i=v(()=>m(t).id===r.selectedId);tt(e,{get session(){return m(t)},get now(){return r.now},get live(){return m(n)},get selected(){return m(i)},onSelect:()=>r.onSelect(m(t).id)})}});var h=o(p,2),g=u(h);{let e=v(()=>r.selectedId===$);Be(g,{title:`Records outside sessions`,shape:`var(--md-sys-shape-corner-extra-large, 28px)`,get subtitle(){return c},get selected(){return m(e)},get description(){return m(E)},onSelect:()=>r.onSelect($)})}M(h),M(l),S(l,()=>ee(`[role="option"]`,{singleTabStop:!0,wrap:!0,leftRight:!0})),a(()=>d=D(l,``,d,{"scroll-padding-bottom":`${m(_)??``}px`})),j(h,`offsetHeight`,e=>s(_,e)),L(e,t)};b(K,e=>{l()?e(q):e(J,-1)}),M(A);var Y=o(A,2);it(Y,{get open(){return m(d)},get onStart(){return r.onStart},onClose:()=>s(d,!1)});var X=o(Y,2);{let e=v(()=>r.sessions.find(e=>e.id===r.currentId)?.entries??null);Ze(X,{get open(){return m(g)},get sessionId(){return r.currentId},get entries(){return m(e)},get onEnd(){return r.onEnd},onClose:()=>s(g,!1)})}a(()=>{I=F(A,1,`svelte-1fz71rn`,null,I,{collapsed:l()}),H=F(V,1,`svelte-1fz71rn`,null,H,{"visually-hidden":l()}),F(U,1,w(r.currentId===null?`start`:`stop`),`svelte-1fz71rn`),h(G,r.currentId===null?`play_arrow`:`stop`)}),t(`click`,U,()=>r.currentId===null?s(d,!0):s(g,!0)),L(n,k),p()}E([`click`]);function dt(e,t,n){return{async start(t,r){await n((await e.start(t,r)).id)},async end(){let t=e.currentId;await e.end(),t!==null&&!e.sessions.some(e=>e.id===t)&&await n(null)},async clear(n){await t.clear(n),await e.refresh()},async remove(t){if(typeof t!=`number`)return;let r=Ke(t,e.sessions);await e.delete(t),await n(r)}}}var ft=r(`<div class="monitor svelte-1uha8ag"><h1 class="visually-hidden">Monitor</h1> <div><!></div> <div class="log svelte-1uha8ag"><!> <div class="log-body svelte-1uha8ag"><!></div></div></div>`);function pt(t,n){e(n,!0);let{sessions:r,speech:i,sessionsPane:s}=K();_(()=>r.seed(n.data.sessions,n.data.now));let d=v(()=>({sessions:r.sessions,currentId:r.currentId,outsideEntries:r.outsideEntries})),f=v(()=>r.now),h=v(()=>Ge(V.url.searchParams.get(`session`),m(d).sessions,m(d).currentId)),y=v(()=>ae(m(h),m(d).sessions)),x=v(()=>ne(m(h),m(d).currentId)),S=v(()=>ie(m(h),m(d).currentId)),w=v(()=>te(m(h),m(d).currentId));I(()=>(s.init(),r.init())),c(()=>i.open(m(h),_(()=>re(m(h),m(d).currentId))));function T(e){return z(e===null?B(`/`):`${B(`/`)}?session=${e}`,{reset:!1})}let E=dt(r,i,T);var D=ft();C(`1uha8ag`,e=>{g(()=>{l.title=`Monitor · Speech Capture`})});var O=o(u(D),2);let k;ut(u(O),{get collapsed(){return s.collapsed},onToggleCollapse:()=>s.toggle(),get sessions(){return m(d).sessions},get currentId(){return m(d).currentId},get outsideEntries(){return m(d).outsideEntries},get selectedId(){return m(h)},get now(){return m(f)},onSelect:e=>void T(e),onStart:(e,t)=>E.start(e,t),onEnd:()=>E.end()}),M(O);var A=o(O,2),j=u(A),N=e=>{se(e,{})};b(j,e=>{n.data.local&&e(N)});var P=o(j,2);Ie(u(P),{get heading(){return m(y)},get local(){return n.data.local},get entries(){return i.entries},get connection(){return i.connection},get canMark(){return m(x)},onAddMarker:e=>i.addMarker(e),get canClear(){return m(S)},onClear:()=>E.clear(m(h)),get canDelete(){return m(w)},onDelete:()=>E.remove(m(h))}),M(P),M(A),M(D),a(()=>k=F(O,1,`sessions svelte-1uha8ag`,null,k,{collapsed:s.collapsed})),L(t,D),p()}export{pt as component};
|
|
Binary file
|
|
Binary file
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{$ as e,A as t,B as n,D as r,E as i,F as a,G as o,I as s,J as c,L as l,M as u,N as d,O as f,P as p,Q as m,R as h,S as g,T as _,U as v,V as y,X as b,Y as x,_ as S,a as C,c as w,f as T,h as E,i as D,j as ee,k as O,m as k,n as te,nt as ne,o as re,rt as A,s as j,u as M,v as N,w as P}from"../chunks/B__KpOuX.js";import"../chunks/CAZ56n62.js";import{A as F,D as I,E as ie,O as L,S as R,T as z,_ as B,a as ae,d as oe,f as se,i as ce,j as V,k as H,n as le,p as ue,s as de,u as fe,v as U,y as pe}from"../chunks/DRNNJMYk.js";import{a as me,i as he,n as ge,o as _e,r as ve,s as ye,t as be}from"../chunks/vPs9G1oN.js";import"../chunks/
|
|
1
|
+
import{$ as e,A as t,B as n,D as r,E as i,F as a,G as o,I as s,J as c,L as l,M as u,N as d,O as f,P as p,Q as m,R as h,S as g,T as _,U as v,V as y,X as b,Y as x,_ as S,a as C,c as w,f as T,h as E,i as D,j as ee,k as O,m as k,n as te,nt as ne,o as re,rt as A,s as j,u as M,v as N,w as P}from"../chunks/B__KpOuX.js";import"../chunks/CAZ56n62.js";import{A as F,D as I,E as ie,O as L,S as R,T as z,_ as B,a as ae,d as oe,f as se,i as ce,j as V,k as H,n as le,p as ue,s as de,u as fe,v as U,y as pe}from"../chunks/DRNNJMYk.js";import{a as me,i as he,n as ge,o as _e,r as ve,s as ye,t as be}from"../chunks/vPs9G1oN.js";import"../chunks/DWjfB3ah.js";import{a as xe,i as Se,n as Ce,r as we,s as Te,t as Ee}from"../chunks/C75l7c5l.js";import{t as De}from"../chunks/BlC5mir6.js";import{r as Oe}from"../chunks/BuwZGWCm.js";import{a as ke,i as Ae,n as je}from"../chunks/VxDST09k.js";import{t as Me}from"../chunks/w5i9ZoX_.js";var Ne;function Pe(e){return(t,n)=>ie(t,n,{get(){return(this.renderRoot??(Ne??=document.createDocumentFragment())).querySelectorAll(e)}})}function Fe(e){return(t,n)=>{let{slot:r}=e??{},i=`slot`+(r?`[name=${r}]`:`:not([name])`);return ie(t,n,{get(){return(this.renderRoot?.querySelector(i))?.assignedNodes(e)??[]}})}}var Ie=fe(B),W=class extends Ie{constructor(){super(...arguments),this.value=0,this.max=1,this.indeterminate=!1,this.fourColor=!1}render(){let{ariaLabel:e}=this;return R`
|
|
2
2
|
<div
|
|
3
3
|
class="progress ${ue(this.getRenderClasses())}"
|
|
4
4
|
role="progressbar"
|
|
Binary file
|
|
Binary file
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{$ as e,A as t,E as n,F as r,G as i,I as a,J as o,M as s,N as c,O as l,P as u,Q as d,R as f,S as p,U as m,X as h,Y as g,_,a as v,f as y,k as b,nt as x,rt as S,s as C,v as w,w as T}from"../chunks/B__KpOuX.js";import{t as E}from"../chunks/BkoDSEOx.js";import"../chunks/C06IiL6m.js";import{n as D}from"../chunks/BEImj5AP.js";import"../chunks/UKukklIc.js";import"../chunks/BuwZGWCm.js";import{n as O}from"../chunks/DRNNJMYk.js";import{t as k}from"../chunks/BquQTeuV.js";import{i as A}from"../chunks/
|
|
1
|
+
import{$ as e,A as t,E as n,F as r,G as i,I as a,J as o,M as s,N as c,O as l,P as u,Q as d,R as f,S as p,U as m,X as h,Y as g,_,a as v,f as y,k as b,nt as x,rt as S,s as C,v as w,w as T}from"../chunks/B__KpOuX.js";import{t as E}from"../chunks/BkoDSEOx.js";import"../chunks/C06IiL6m.js";import{n as D}from"../chunks/BEImj5AP.js";import"../chunks/UKukklIc.js";import"../chunks/BuwZGWCm.js";import{n as O}from"../chunks/DRNNJMYk.js";import{t as k}from"../chunks/BquQTeuV.js";import{i as A}from"../chunks/DWjfB3ah.js";import{a as j,s as M}from"../chunks/Bxh3K0TK.js";var N=`/playwright-mcp`,P=n(`<div class="command svelte-1c2bq9d"><pre class="svelte-1c2bq9d"><code class="svelte-1c2bq9d"> </code></pre> <md-text-button><md-icon>content_copy</md-icon> Copy</md-text-button></div> <p role="status" class="svelte-1c2bq9d"> </p>`,3);function F(n,s){e(s,!0);let l=g(null),m=h(()=>f(l)===null||f(l).text!==s.text?``:f(l).ok?`Copied.`:`Copying failed: select the text and copy it.`);async function _(){let e=s.text;o(l,null),o(l,{text:e,ok:await s.onCopy(e)},!0)}var v=P(),y=u(v),b=c(y),w=c(b),E=r(w,!0);S(b);var D=a(b,2);C(D,`type`,`button`),i(()=>C(D,`aria-label`,`Copy ${s.label??``}`));var O=c(D);C(O,`slot`,`icon`),C(O,`aria-hidden`,`true`),x(),S(D),S(y);var k=a(y,2),A=r(k,!0);i(()=>{p(E,s.text),p(A,f(m))}),t(`click`,D,()=>void _()),T(n,v),d()}b([`click`]);var I=`127.0.0.1`,L=`npm install -g text-to-socket-engine
|
|
2
2
|
text-to-socket-engine-register`;function R({host:e,port:t}){let n=[`0.0.0.0`,`::`,`localhost`].includes(e)?I:e,r=`Text To Socket ${n}:${t}`;if(n===I&&t===4449)return{name:r,addVoice:null};let i=`ssc${t}`;return{name:r,addVoice:`text-to-socket-engine-add-voice ${i} "${r}" ${n} ${t} voice=${i}`}}var z=e=>[`localhost`,`::1`,`[::1]`].includes(e)||/^127(\.\d+){3}$/.test(e);function B(e,t){let{hostname:n,origin:r}=e;return(/^\[[0-9a-fA-F:.]+\]$/.test(n)||n!==`*`&&A.test(n))&&!z(n)&&n!==`0.0.0.0`?{url:r,placeholder:!1}:{url:`http://<vm-ip>:${t}`,placeholder:!0}}function V(e){return z(e)}function H(e){return`New-NetFirewallRule -DisplayName "screenreader-speech-capture" \`
|
|
3
3
|
-Direction Inbound -Protocol TCP -LocalPort ${e} -Action Allow -Profile Any \`\n -RemoteAddress <test-machine-ip>`}function U(e){return[`npx @screenreader-speech-capture/client config set url ${e}`,`npx @screenreader-speech-capture/client status`].join(`
|
|
4
4
|
`)}function W(e){return`npm i -D --save-exact @screenreader-speech-capture/client @playwright/test@${e} @types/node`}function G(e){let t={type:`http`,url:`${e}${N}`};return JSON.stringify({mcpServers:{"screenreader-vm":t}},null,2)}var K=n(`<p class="warning svelte-2oo2iv">The bridge only listens on its own machine, so other machines can't connect. Start it without <code class="svelte-2oo2iv">--http-host</code>, or with an address they reach.</p>`),q=n(`<p class="svelte-2oo2iv">Windows can block the port without asking. On the bridge's machine, in an <strong>administrator</strong> PowerShell (<!>):</p> <!> <p class="svelte-2oo2iv">Replace <code class="svelte-2oo2iv"><test-machine-ip></code> with the test machine's address, or its subnet.</p>`,1),J=n(`<p class="svelte-2oo2iv">This machine already reaches the bridge, so the firewall lets it through.</p>`),Y=n(`<p class="svelte-2oo2iv">Replace <code class="svelte-2oo2iv"><vm-ip></code> with the VM's address: one from the <code class="svelte-2oo2iv">HTTP API</code> row of the bridge's start output, or from <code class="svelte-2oo2iv">ipconfig</code> on the VM.</p>`),X=n(`<p class="svelte-2oo2iv">The Playwright server is off. <a class="svelte-2oo2iv">Turn it on in Settings.</a></p>`),Z=n(`<p class="svelte-2oo2iv">In the test project, with the bridge's Playwright version:</p> <!>`,1),Q=n(`<p class="svelte-2oo2iv">Playwright MCP is off. <a class="svelte-2oo2iv">Turn it on in Settings.</a></p>`),$=n(`<p class="svelte-2oo2iv">Point the agent's MCP client at the bridge:</p> <!>`,1),ee=n(`<section class="part" aria-labelledby="machine-heading"><h2 id="machine-heading">Test machine</h2> <!> <!> <p class="svelte-2oo2iv">On the test machine (Node 20 or newer), store the bridge's address and check it:</p> <!> <!> <h3 class="svelte-2oo2iv">Playwright tests</h3> <!> <p class="svelte-2oo2iv"><!></p> <h3 class="svelte-2oo2iv">AI agents</h3> <!> <p class="svelte-2oo2iv"><!></p></section>`);function te(t,n){e(n,!0);let r=e=>M(n.version,e);var o=ee(),s=a(c(o),2),p=e=>{var t=K();T(e,t)};_(s,e=>{n.loopbackOnly&&e(p)});var m=a(s,2),g=e=>{var t=q(),i=u(t),o=a(c(i),3);{let e=h(()=>r(`usage/vm-setup.md#firewall`));k(o,{get href(){return f(e)},children:(e,t)=>{x();var n=l(`firewall`);T(e,n)},$$slots:{default:!0}})}x(),S(i);var s=a(i,2);{let e=h(()=>H(n.httpPort));F(s,{label:`the firewall command`,get text(){return f(e)},get onCopy(){return n.onCopy}})}x(2),T(e,t)},y=e=>{var t=J();T(e,t)};_(m,e=>{n.local?e(g):e(y,-1)});var b=a(m,4);{let e=h(()=>U(n.address.url));F(b,{label:`the client commands`,get text(){return f(e)},get onCopy(){return n.onCopy}})}var C=a(b,2),w=e=>{var t=Y();T(e,t)};_(C,e=>{n.address.placeholder&&e(w)});var D=a(C,4),O=e=>{var t=X(),n=a(c(t));S(t),i(e=>v(n,`href`,e),[()=>E(`/settings`)]),T(e,t)},A=e=>{var t=Z(),r=a(u(t),2);{let e=h(()=>W(n.playwright.version));F(r,{label:`the test packages command`,get text(){return f(e)},get onCopy(){return n.onCopy}})}T(e,t)};_(D,e=>{n.playwright?.state===`stopped`?e(O):n.playwright!==null&&e(A,1)});var j=a(D,2),N=c(j);{let e=h(()=>r(`usage/client.md`));k(N,{get href(){return f(e)},children:(e,t)=>{x();var n=l(`Set up the tests with the test client`);T(e,n)},$$slots:{default:!0}})}S(j);var P=a(j,4),I=e=>{var t=Q(),n=a(c(t));S(t),i(e=>v(n,`href`,e),[()=>E(`/settings`)]),T(e,t)},L=e=>{var t=$(),r=a(u(t),2);{let e=h(()=>G(n.address.url));F(r,{label:`the MCP configuration`,get text(){return f(e)},get onCopy(){return n.onCopy}})}T(e,t)};_(P,e=>{n.mcp?.state===`stopped`?e(I):e(L,-1)});var R=a(P,2),z=c(R);{let e=h(()=>r(`usage/agents.md`));k(z,{get href(){return f(e)},children:(e,t)=>{x();var n=l(`How agents use the bridge`);T(e,n)},$$slots:{default:!0}})}S(R),S(o),T(t,o),d()}var ne=n(`<p class="svelte-1tbxerf">The default voice doesn't send to where this bridge listens. Add a voice that does, in the
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"
|
|
1
|
+
{"version":"1796401962885"}
|
|
Binary file
|
|
Binary file
|
|
@@ -461,6 +461,13 @@
|
|
|
461
461
|
"_app-context.js"
|
|
462
462
|
]
|
|
463
463
|
},
|
|
464
|
+
"_validate.js": {
|
|
465
|
+
"file": "chunks/validate.js",
|
|
466
|
+
"name": "validate",
|
|
467
|
+
"imports": [
|
|
468
|
+
"_src.js"
|
|
469
|
+
]
|
|
470
|
+
},
|
|
464
471
|
"_vocabulary.js": {
|
|
465
472
|
"file": "chunks/vocabulary.js",
|
|
466
473
|
"name": "vocabulary"
|
|
@@ -473,7 +480,8 @@
|
|
|
473
480
|
"imports": [
|
|
474
481
|
"_src.js",
|
|
475
482
|
"_config.js",
|
|
476
|
-
"_exports.js"
|
|
483
|
+
"_exports.js",
|
|
484
|
+
"_validate.js"
|
|
477
485
|
]
|
|
478
486
|
},
|
|
479
487
|
"src/params.ts": {
|
|
@@ -510,6 +518,7 @@
|
|
|
510
518
|
"_internal.js",
|
|
511
519
|
"_server2.js",
|
|
512
520
|
"_index-server.js",
|
|
521
|
+
"_validate.js",
|
|
513
522
|
"_paths.js",
|
|
514
523
|
"_state.js",
|
|
515
524
|
"_app-context.js",
|
|
@@ -600,6 +609,7 @@
|
|
|
600
609
|
"imports": [
|
|
601
610
|
"_exports.js",
|
|
602
611
|
"_src.js",
|
|
612
|
+
"_validate.js",
|
|
603
613
|
"_config-state.js"
|
|
604
614
|
]
|
|
605
615
|
},
|
|
@@ -610,7 +620,8 @@
|
|
|
610
620
|
"isEntry": true,
|
|
611
621
|
"imports": [
|
|
612
622
|
"_exports.js",
|
|
613
|
-
"_src.js"
|
|
623
|
+
"_src.js",
|
|
624
|
+
"_validate.js"
|
|
614
625
|
]
|
|
615
626
|
},
|
|
616
627
|
"src/routes/api/markers/+server.ts": {
|
|
@@ -620,7 +631,8 @@
|
|
|
620
631
|
"isEntry": true,
|
|
621
632
|
"imports": [
|
|
622
633
|
"_exports.js",
|
|
623
|
-
"_src.js"
|
|
634
|
+
"_src.js",
|
|
635
|
+
"_validate.js"
|
|
624
636
|
]
|
|
625
637
|
},
|
|
626
638
|
"src/routes/api/sessions/+server.ts": {
|
|
@@ -630,7 +642,8 @@
|
|
|
630
642
|
"isEntry": true,
|
|
631
643
|
"imports": [
|
|
632
644
|
"_exports.js",
|
|
633
|
-
"_src.js"
|
|
645
|
+
"_src.js",
|
|
646
|
+
"_validate.js"
|
|
634
647
|
]
|
|
635
648
|
},
|
|
636
649
|
"src/routes/api/sessions/[id=id]/+server.ts": {
|
|
@@ -212,7 +212,7 @@ function server_data_serializer(event, state) {
|
|
|
212
212
|
let promise_id = 1;
|
|
213
213
|
let max_nodes = -1;
|
|
214
214
|
const iterator = create_async_iterator();
|
|
215
|
-
const global = "
|
|
215
|
+
const global = "__sveltekit_1daqh8x";
|
|
216
216
|
/** @param {number} index */
|
|
217
217
|
function get_replacer(index) {
|
|
218
218
|
/** @param {any} thing */
|
|
@@ -1485,7 +1485,7 @@ async function render_response({ branch, fetched, page_config, status, error = n
|
|
|
1485
1485
|
"crossorigin"
|
|
1486
1486
|
]);
|
|
1487
1487
|
}
|
|
1488
|
-
const global = "
|
|
1488
|
+
const global = "__sveltekit_1daqh8x";
|
|
1489
1489
|
const { data, chunks } = data_serializer.get_data(csp);
|
|
1490
1490
|
if (page_config.ssr && page_config.csr) body += `\n\t\t\t${fetched.map((item) => serialize_data(item, resolve_opts.filterSerializedResponseHeaders, is_prerendering(state))).join("\n ")}`;
|
|
1491
1491
|
if (page_config.csr && client) {
|
|
@@ -1509,7 +1509,7 @@ async function render_response({ branch, fetched, page_config, status, error = n
|
|
|
1509
1509
|
}
|
|
1510
1510
|
}
|
|
1511
1511
|
const blocks = [];
|
|
1512
|
-
const properties = [`base: ${base_expression}`, `version: ${s("
|
|
1512
|
+
const properties = [`base: ${base_expression}`, `version: ${s("1796401962885")}`];
|
|
1513
1513
|
if (assets) properties.push(`assets: ${s(assets)}`);
|
|
1514
1514
|
if (client.uses_env_dynamic_public) properties.push(`env: ${load_env_eagerly ? "null" : uneval(rendered_env)}`);
|
|
1515
1515
|
if (chunks) {
|
|
@@ -2679,7 +2679,7 @@ function is_prerendering(state) {
|
|
|
2679
2679
|
* @param {Response} response
|
|
2680
2680
|
*/
|
|
2681
2681
|
function with_version_header(response) {
|
|
2682
|
-
response.headers.set("x-sveltekit-version", "
|
|
2682
|
+
response.headers.set("x-sveltekit-version", "1796401962885");
|
|
2683
2683
|
return response;
|
|
2684
2684
|
}
|
|
2685
2685
|
/**
|
|
@@ -87,11 +87,6 @@ var CONFIG_LIMITS = {
|
|
|
87
87
|
var EXACT_VERSION_PATTERN = /^\d+\.\d+\.\d+(-[0-9A-Za-z.-]+)?$/;
|
|
88
88
|
/** A host name without port or scheme, or `*` (`http.allowedHosts`). */
|
|
89
89
|
var HOST_NAME_PATTERN = /^(\*|[A-Za-z0-9]([A-Za-z0-9.-]*[A-Za-z0-9])?)$/;
|
|
90
|
-
/** Whether `text` is a usable label: not empty after trimming, at most `max` characters trimmed. */
|
|
91
|
-
var isTrimmedLabel = (text, max) => {
|
|
92
|
-
const trimmed = text.trim();
|
|
93
|
-
return trimmed !== "" && trimmed.length <= max;
|
|
94
|
-
};
|
|
95
90
|
// ../shared/src/rules/key-chord.ts
|
|
96
91
|
/**
|
|
97
92
|
* The key names of `POST /input/keys` (docs/usage/native-input.md#key-names). The bridge parses
|
|
@@ -173,6 +168,6 @@ var NAMED_KEYS = [
|
|
|
173
168
|
...DIGITS
|
|
174
169
|
];
|
|
175
170
|
new Set(MODIFIER_KEYS);
|
|
176
|
-
export {
|
|
171
|
+
export { HOST_NAME_PATTERN as i, CONFIG_LIMITS as n, EXACT_VERSION_PATTERN as r, API_LIMITS as t };
|
|
177
172
|
|
|
178
173
|
//# sourceMappingURL=rules.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rules.js","names":[],"sources":["../../../../shared/src/rules/limits.ts","../../../../shared/src/rules/key-chord.ts"],"sourcesContent":["// Limits and patterns of the HTTP API, used by the bridge (to check), the client and the schemas\n// (so docs/usage/openapi.yaml shows them).\n\n/** Ranges of the speech endpoints. */\nexport const API_LIMITS = {\n /** `GET /speech?limit=`: the default and the most a caller may ask for. */\n list: { default: 1000, max: 10_000 },\n wait: {\n /** `GET /speech/wait?timeoutMs=`. */\n timeoutMs: { default: 5000, max: 300_000 },\n /** Entries the timeout answer holds at most: the last ones seen. */\n seen: 1000,\n /** Longest `regex`. */\n regexLength: 500,\n },\n /** Longest marker label (trimmed). */\n markerLength: 1000,\n /** Longest session `name`, `run` or client name (trimmed). */\n sessionLabelLength: 1000,\n /** `POST /input/click` and `POST /input/keys`. */\n input: {\n /** Largest absolute screen coordinate (physical pixels). */\n coordinate: 100_000,\n /** Pause between the chords of a sequence. */\n delayMs: { default: 50, max: 10_000 },\n /** Most chords in one request. */\n maxKeys: 100,\n /** Longest `title` of `POST /input/focus`. */\n focusTitleLength: 200,\n },\n /**\n * `capture` of `POST /input/click` and `POST /input/keys` (and the client's `record()`, which\n * uses the same defaults): the defaults and ranges in milliseconds.\n */\n capture: {\n /** Silence that ends the capture. */\n quietForMs: { default: 500, min: 1, max: 60_000 },\n /** How long the first speech may take after the input. */\n firstWithinMs: { default: 2000, max: 300_000 },\n /** Longest capture, counted from the input. */\n timeoutMs: { default: 10_000, max: 300_000 },\n /** Silence to wait for before the input (0: none). */\n settleMs: { default: 0, max: 60_000 },\n /** Entries the answer holds at most: the first ones. */\n entries: 10_000,\n },\n} as const;\n\n/** Ranges of the settings (`GET` / `PUT /config`). */\nexport const CONFIG_LIMITS = {\n port: { min: 0, max: 65_535 },\n maxLineBytes: { min: 1024, max: 16 * 1024 * 1024 },\n maxEntries: { min: 1, max: 1_000_000 },\n} as const;\n\n/**\n * An exact npm version (`1.56.1`, `1.57.0-beta-1`): `playwright.version` ends up on an\n * `npm install` command line, so nothing else may get through.\n */\nexport const EXACT_VERSION_PATTERN = /^\\d+\\.\\d+\\.\\d+(-[0-9A-Za-z.-]+)?$/;\n\n/** A host name without port or scheme, or `*` (`http.allowedHosts`). */\nexport const HOST_NAME_PATTERN = /^(\\*|[A-Za-z0-9]([A-Za-z0-9.-]*[A-Za-z0-9])?)$/;\n
|
|
1
|
+
{"version":3,"file":"rules.js","names":[],"sources":["../../../../shared/src/rules/limits.ts","../../../../shared/src/rules/key-chord.ts"],"sourcesContent":["// Limits and patterns of the HTTP API, used by the bridge (to check), the client and the schemas\n// (so docs/usage/openapi.yaml shows them).\n\n/** Ranges of the speech endpoints. */\nexport const API_LIMITS = {\n /** `GET /speech?limit=`: the default and the most a caller may ask for. */\n list: { default: 1000, max: 10_000 },\n wait: {\n /** `GET /speech/wait?timeoutMs=`. */\n timeoutMs: { default: 5000, max: 300_000 },\n /** Entries the timeout answer holds at most: the last ones seen. */\n seen: 1000,\n /** Longest `regex`. */\n regexLength: 500,\n },\n /** Longest marker label (trimmed). */\n markerLength: 1000,\n /** Longest session `name`, `run` or client name (trimmed). */\n sessionLabelLength: 1000,\n /** `POST /input/click` and `POST /input/keys`. */\n input: {\n /** Largest absolute screen coordinate (physical pixels). */\n coordinate: 100_000,\n /** Pause between the chords of a sequence. */\n delayMs: { default: 50, max: 10_000 },\n /** Most chords in one request. */\n maxKeys: 100,\n /** Longest `title` of `POST /input/focus`. */\n focusTitleLength: 200,\n },\n /**\n * `capture` of `POST /input/click` and `POST /input/keys` (and the client's `record()`, which\n * uses the same defaults): the defaults and ranges in milliseconds.\n */\n capture: {\n /** Silence that ends the capture. */\n quietForMs: { default: 500, min: 1, max: 60_000 },\n /** How long the first speech may take after the input. */\n firstWithinMs: { default: 2000, max: 300_000 },\n /** Longest capture, counted from the input. */\n timeoutMs: { default: 10_000, max: 300_000 },\n /** Silence to wait for before the input (0: none). */\n settleMs: { default: 0, max: 60_000 },\n /** Entries the answer holds at most: the first ones. */\n entries: 10_000,\n },\n} as const;\n\n/** Ranges of the settings (`GET` / `PUT /config`). */\nexport const CONFIG_LIMITS = {\n port: { min: 0, max: 65_535 },\n maxLineBytes: { min: 1024, max: 16 * 1024 * 1024 },\n maxEntries: { min: 1, max: 1_000_000 },\n} as const;\n\n/**\n * An exact npm version (`1.56.1`, `1.57.0-beta-1`): `playwright.version` ends up on an\n * `npm install` command line, so nothing else may get through.\n */\nexport const EXACT_VERSION_PATTERN = /^\\d+\\.\\d+\\.\\d+(-[0-9A-Za-z.-]+)?$/;\n\n/** A host name without port or scheme, or `*` (`http.allowedHosts`). */\nexport const HOST_NAME_PATTERN = /^(\\*|[A-Za-z0-9]([A-Za-z0-9.-]*[A-Za-z0-9])?)$/;\n","/**\n * The key names of `POST /input/keys` (docs/usage/native-input.md#key-names). The bridge parses\n * chords with this rule, and the CLI checks them before sending and lists the names in `--help`,\n * so both use this one copy. Like `text-match.ts`, it belongs to the contract, not to either side.\n */\n\nconst DIGITS = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'] as const;\nconst FUNCTION_KEYS = [\n 'f1',\n 'f2',\n 'f3',\n 'f4',\n 'f5',\n 'f6',\n 'f7',\n 'f8',\n 'f9',\n 'f10',\n 'f11',\n 'f12',\n] as const;\n\ntype Letter =\n | 'a'\n | 'b'\n | 'c'\n | 'd'\n | 'e'\n | 'f'\n | 'g'\n | 'h'\n | 'i'\n | 'j'\n | 'k'\n | 'l'\n | 'm'\n | 'n'\n | 'o'\n | 'p'\n | 'q'\n | 'r'\n | 's'\n | 't'\n | 'u'\n | 'v'\n | 'w'\n | 'x'\n | 'y'\n | 'z';\nconst LETTERS = 'abcdefghijklmnopqrstuvwxyz'.split('') as Letter[];\n\n/** Keys that can be held down while another key is pressed. `Insert` and `CapsLock` are the screen reader keys. */\nexport const MODIFIER_KEYS = ['control', 'shift', 'alt', 'win', 'insert', 'capslock'] as const;\n\n/**\n * The keys of the numeric keypad (API 1.30), which NVDA's desktop layout and JAWS use for\n * reading commands. With NumLock off they are those commands, with NumLock on they type.\n */\nexport const NUMPAD_KEYS = [\n ...DIGITS.map((digit) => `numpad${digit}` as const),\n 'numpadplus',\n 'numpadminus',\n 'numpadmultiply',\n 'numpaddivide',\n 'numpaddecimal',\n 'numpadenter',\n] as const;\n\n/** Keys with a name, besides `a`–`z` and `0`–`9`. */\nexport const NAMED_KEYS = [\n 'enter',\n 'tab',\n 'escape',\n 'space',\n 'backspace',\n 'delete',\n 'up',\n 'down',\n 'left',\n 'right',\n 'home',\n 'end',\n 'pageup',\n 'pagedown',\n ...FUNCTION_KEYS,\n ...NUMPAD_KEYS,\n] as const;\n\n/** Aliases accepted in a chord, by their lower-case spelling. */\nexport const KEY_ALIASES: Readonly<Record<string, KeyName>> = {\n ctrl: 'control',\n windows: 'win',\n meta: 'win',\n esc: 'escape',\n return: 'enter',\n del: 'delete',\n ins: 'insert',\n pgup: 'pageup',\n pgdn: 'pagedown',\n numpaddelete: 'numpaddecimal',\n};\n\nconst KEYS: ReadonlySet<string> = new Set([...MODIFIER_KEYS, ...NAMED_KEYS, ...LETTERS, ...DIGITS]);\n\nconst isKeyName = (name: string): name is KeyName => KEYS.has(name);\n\nconst MODIFIER_SET: ReadonlySet<string> = new Set(MODIFIER_KEYS);\n\n/** A key by its canonical lower-case name: `a`–`z`, `0`–`9` or one of the lists above. */\nexport type KeyName =\n (typeof MODIFIER_KEYS)[number] | (typeof NAMED_KEYS)[number] | Letter | (typeof DIGITS)[number];\n\n/** One chord: the modifiers held down while `key` is pressed, for example `Insert+T`. */\nexport interface KeyChord {\n readonly modifiers: readonly KeyName[];\n readonly key: KeyName;\n}\n\n/** A parsed chord, or why it is invalid (callers report that in their own way). */\nexport type KeyChordResult = { ok: true; chord: KeyChord } | { ok: false; message: string };\n\n/**\n * Parses `Insert+T` or `Control+Shift+Home`: modifiers and one last key, joined with `+`, names\n * case-insensitive. Only modifiers may come before the last key, and none twice. A lone modifier\n * (`Insert`) is a chord of that key.\n */\nexport function parseKeyChord(chord: string): KeyChordResult {\n const names: KeyName[] = [];\n for (const part of chord.split('+')) {\n const lower = part.trim().toLowerCase();\n const name = KEY_ALIASES[lower] ?? lower;\n if (!isKeyName(name))\n return { ok: false, message: `unknown key \"${part.trim()}\" in \"${chord}\"` };\n names.push(name);\n }\n const key = names.pop()!;\n if (new Set(names).size !== names.length || names.includes(key)) {\n return { ok: false, message: `\"${chord}\" repeats a key` };\n }\n const notModifier = names.find((name) => !MODIFIER_SET.has(name));\n if (notModifier !== undefined) {\n return { ok: false, message: `\"${notModifier}\" in \"${chord}\" is not a modifier` };\n }\n return { ok: true, chord: { modifiers: names, key } };\n}\n"],"mappings":";;AAIA,IAAa,aAAa;;CAExB,MAAM;EAAE,SAAS;EAAM,KAAK;CAAO;CACnC,MAAM;;EAEJ,WAAW;GAAE,SAAS;GAAM,KAAK;EAAQ;;EAEzC,MAAM;;EAEN,aAAa;CACf;;CAEA,cAAc;;CAEd,oBAAoB;;CAEpB,OAAO;;EAEL,YAAY;;EAEZ,SAAS;GAAE,SAAS;GAAI,KAAK;EAAO;;EAEpC,SAAS;;EAET,kBAAkB;CACpB;;;;;CAKA,SAAS;;EAEP,YAAY;GAAE,SAAS;GAAK,KAAK;GAAG,KAAK;EAAO;;EAEhD,eAAe;GAAE,SAAS;GAAM,KAAK;EAAQ;;EAE7C,WAAW;GAAE,SAAS;GAAQ,KAAK;EAAQ;;EAE3C,UAAU;GAAE,SAAS;GAAG,KAAK;EAAO;;EAEpC,SAAS;CACX;AACF;;AAGA,IAAa,gBAAgB;CAC3B,MAAM;EAAE,KAAK;EAAG,KAAK;CAAO;CAC5B,cAAc;EAAE,KAAK;EAAM,KAAK;CAAiB;CACjD,YAAY;EAAE,KAAK;EAAG,KAAK;CAAU;AACvC;;;;;AAMA,IAAa,wBAAwB;;AAGrC,IAAa,oBAAoB;;;;;;;ACxDjC,IAAM,SAAS;CAAC;CAAK;CAAK;CAAK;CAAK;CAAK;CAAK;CAAK;CAAK;CAAK;AAAG;AAChE,IAAM,gBAAgB;CACpB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AA6BA,IAAM,UAAU,6BAA6B,MAAM,EAAE;;AAGrD,IAAa,gBAAgB;CAAC;CAAW;CAAS;CAAO;CAAO;CAAU;AAAU;;;;;AAMpF,IAAa,cAAc;CACzB,GAAG,OAAO,KAAK,UAAU,SAAS,OAAgB;CAClD;CACA;CACA;CACA;CACA;CACA;AACF;;AAGA,IAAa,aAAa;CACxB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA,GAAG;CACH,GAAG;AACL;AAgB0C;CAAC,GAAG;CAAe,GAAG;CAAY,GAAG;CAAS,GAAG;AAAM;AAIvD,IAAI,IAAI,aAAa"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { i as HOST_NAME_PATTERN, n as CONFIG_LIMITS, r as EXACT_VERSION_PATTERN, t as API_LIMITS } from "./rules.js";
|
|
2
2
|
import { n as LOG_LEVELS, t as FOCUS_TARGETS } from "./vocabulary.js";
|
|
3
3
|
var DEFAULT_CONFIG = {
|
|
4
4
|
lang: void 0,
|
|
@@ -882,6 +882,21 @@ var ConfigPatchSchema = /* @__PURE__ */ pipe(/* @__PURE__ */ strictObject({
|
|
|
882
882
|
buffer: /* @__PURE__ */ optional(patchOf(sections.buffer)),
|
|
883
883
|
log: /* @__PURE__ */ optional(patchOf(sections.log))
|
|
884
884
|
}), /* @__PURE__ */ description("Any subset of `Config` (`PUT /config`). Settings left out keep their value; unknown ones are rejected. Ranges as in `Config`."));
|
|
885
|
+
/**
|
|
886
|
+
* An error body as a client must accept it: like `ErrorBodySchema`, but with any `code`, since
|
|
887
|
+
* new codes may come in minor versions.
|
|
888
|
+
*/
|
|
889
|
+
var AnyErrorBodySchema = /* @__PURE__ */ object({ error: /* @__PURE__ */ object({
|
|
890
|
+
code: /* @__PURE__ */ string(),
|
|
891
|
+
message: /* @__PURE__ */ string(),
|
|
892
|
+
details: /* @__PURE__ */ optional(/* @__PURE__ */ record(/* @__PURE__ */ string(), /* @__PURE__ */ unknown()))
|
|
893
|
+
}) });
|
|
894
|
+
// ../shared/src/rules/labels.ts
|
|
895
|
+
/** Whether `text` is a usable label: not empty after trimming, at most `max` characters trimmed. */
|
|
896
|
+
var isTrimmedLabel = (text, max) => {
|
|
897
|
+
const trimmed = text.trim();
|
|
898
|
+
return trimmed !== "" && trimmed.length <= max;
|
|
899
|
+
};
|
|
885
900
|
// ../shared/src/speech.ts
|
|
886
901
|
var integer$2 = (min) => /* @__PURE__ */ pipe(/* @__PURE__ */ number(), /* @__PURE__ */ integer$3(), /* @__PURE__ */ minValue(min));
|
|
887
902
|
var timestamp$2 = /* @__PURE__ */ pipe(/* @__PURE__ */ string(), /* @__PURE__ */ isoTimestamp());
|
|
@@ -921,6 +936,7 @@ var capture = /* @__PURE__ */ optional(/* @__PURE__ */ pipe(/* @__PURE__ */ stri
|
|
|
921
936
|
timeoutMs: ms(0, CAPTURE.timeoutMs.max, `Longest capture, counted from the input; speech that goes on until then is \`timeout\`. ${CAPTURE.timeoutMs.default} if omitted.`),
|
|
922
937
|
settleMs: ms(0, CAPTURE.settleMs.max, "Before the input, wait until nothing was spoken for this long (at most `timeoutMs`), so speech still trailing from an earlier step is not captured. The input is sent after `timeoutMs` even if the speech did not pause. 0 (no wait) if omitted.")
|
|
923
938
|
}), /* @__PURE__ */ description("Records the speech the input causes and answers with it (`InputCapture` instead of `InputResult`). Times are in milliseconds and measured on the bridge, from when it received the speech. Added in API 1.19.")));
|
|
939
|
+
var mark = /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Put a marker into the speech log right before the input is sent (`keys: Tab`, `click: left 640,12`), `true` if omitted (docs/usage/native-input.md#markers-in-the-speech-log). Added in API 1.34."));
|
|
924
940
|
/** `window` of the answers of `POST /input/click` and `POST /input/keys`. */
|
|
925
941
|
var inputWindow = /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ nullable(/* @__PURE__ */ pipe(/* @__PURE__ */ object({
|
|
926
942
|
title: /* @__PURE__ */ pipe(/* @__PURE__ */ string(), /* @__PURE__ */ description("The window title, empty for a window without one.")),
|
|
@@ -932,7 +948,7 @@ var InputCaptureSchema = /* @__PURE__ */ pipe(/* @__PURE__ */ object({
|
|
|
932
948
|
"no-speech",
|
|
933
949
|
"timeout"
|
|
934
950
|
]), /* @__PURE__ */ description("`silent`: speech came and paused for `quietForMs`. `no-speech`: nothing was spoken within `firstWithinMs`. `timeout`: the speech went on until `timeoutMs`; `entries` holds what was said until then. The input was sent in every case.")),
|
|
935
|
-
startSeq: /* @__PURE__ */ pipe(/* @__PURE__ */ pipe(/* @__PURE__ */ number(), /* @__PURE__ */ integer$3(), /* @__PURE__ */ minValue(0)), /* @__PURE__ */ description("The `seq` of the newest entry right before the input was sent: the capture holds the speech after it.")),
|
|
951
|
+
startSeq: /* @__PURE__ */ pipe(/* @__PURE__ */ pipe(/* @__PURE__ */ number(), /* @__PURE__ */ integer$3(), /* @__PURE__ */ minValue(0)), /* @__PURE__ */ description("The `seq` of the newest entry right before the input was sent, since API 1.34 the input's own marker unless it said `mark: false`: the capture holds the speech after it.")),
|
|
936
952
|
entries: /* @__PURE__ */ pipe(/* @__PURE__ */ array(SpeechEntrySchema), /* @__PURE__ */ maxLength(CAPTURE.entries), /* @__PURE__ */ description(`The speech entries (no markers) after \`startSeq\`, oldest first, at most the first ${CAPTURE.entries}.`)),
|
|
937
953
|
omitted: /* @__PURE__ */ pipe(/* @__PURE__ */ pipe(/* @__PURE__ */ number(), /* @__PURE__ */ integer$3(), /* @__PURE__ */ minValue(0)), /* @__PURE__ */ description("How many later speech entries were left out.")),
|
|
938
954
|
truncated: /* @__PURE__ */ pipe(/* @__PURE__ */ boolean(), /* @__PURE__ */ description("`true` when entries after `startSeq` were dropped because the buffer was full.")),
|
|
@@ -943,6 +959,7 @@ var KeysRequestSchema = /* @__PURE__ */ pipe(/* @__PURE__ */ strictObject({
|
|
|
943
959
|
keys: /* @__PURE__ */ pipe(/* @__PURE__ */ union([/* @__PURE__ */ pipe(/* @__PURE__ */ string(), /* @__PURE__ */ nonEmpty()), /* @__PURE__ */ pipe(/* @__PURE__ */ array(/* @__PURE__ */ pipe(/* @__PURE__ */ string(), /* @__PURE__ */ nonEmpty())), /* @__PURE__ */ minLength(1), /* @__PURE__ */ maxLength(maxKeys))]), /* @__PURE__ */ description(`One chord (\`Insert+T\`) or a sequence of chords (\`["h", "h", "Insert+Down"]\`). Chords join modifiers (\`Control\`, \`Shift\`, \`Alt\`, \`Win\`, \`Insert\`, \`CapsLock\`) and one key with \`+\`. Names are case-insensitive (docs/usage/native-input.md#key-names); the numpad keys (\`numpad7\`, \`numpadEnter\`, …) since API 1.30. At most ${maxKeys} chords.`), /* @__PURE__ */ examples(["Insert+T"])),
|
|
944
960
|
delayMs: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ pipe(/* @__PURE__ */ number(), /* @__PURE__ */ integer$3(), /* @__PURE__ */ minValue(0), /* @__PURE__ */ maxValue(delayMs.max))), /* @__PURE__ */ description(`Pause between the chords of a sequence in milliseconds, ${delayMs.default} if omitted.`)),
|
|
945
961
|
expectedTarget: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ picklist(FOCUS_TARGETS)), /* @__PURE__ */ description("Only send the keys while a window of this browser is in front: `mcp` (Playwright MCP) or `playwright` (the Playwright server). Checked before every chord; otherwise, and where the bridge cannot tell, `409 WRONG_WINDOW` and no further chord is sent (docs/usage/native-input.md#requiring-a-target-window). Added in API 1.32.")),
|
|
962
|
+
mark,
|
|
946
963
|
capture
|
|
947
964
|
}), /* @__PURE__ */ description("`POST /input/keys`: send key presses to the focused window. Added in API 1.14."));
|
|
948
965
|
API_LIMITS.input.focusTitleLength;
|
|
@@ -1056,34 +1073,6 @@ var StatusSchema = /* @__PURE__ */ pipe(/* @__PURE__ */ object({
|
|
|
1056
1073
|
focus: /* @__PURE__ */ pipe(InputAvailabilitySchema, /* @__PURE__ */ description("`POST /input/focus` (koffi, Windows only)."))
|
|
1057
1074
|
}), /* @__PURE__ */ description("Native input (docs/usage/native-input.md). When a feature is not available, its endpoints answer `409 INPUT_DISABLED`. Added in API 1.24."))
|
|
1058
1075
|
}), /* @__PURE__ */ description("`GET /status`. `playwright` since API 1.1, `mcp` since 1.2, `session` since 1.3, `input` since 1.24, `tcp.lastSpeechAt` and the services’ `lastError` since 1.33."));
|
|
1059
|
-
|
|
1060
|
-
/**
|
|
1061
|
-
* Checks `value` against `schema`. Unknown keys of an answer don't fail it and are left out of the
|
|
1062
|
-
* result: a newer bridge of the same major version may add fields. The request schemas are strict
|
|
1063
|
-
* and refuse them (docs/usage/http-api.md#requests).
|
|
1064
|
-
*/
|
|
1065
|
-
function checkDto(schema, value) {
|
|
1066
|
-
const result = /* @__PURE__ */ safeParse(schema, value);
|
|
1067
|
-
if (result.success) return {
|
|
1068
|
-
ok: true,
|
|
1069
|
-
value: result.output
|
|
1070
|
-
};
|
|
1071
|
-
const [issue] = result.issues;
|
|
1072
|
-
return {
|
|
1073
|
-
ok: false,
|
|
1074
|
-
field: /* @__PURE__ */ getDotPath(issue) ?? "(body)",
|
|
1075
|
-
message: issue.message
|
|
1076
|
-
};
|
|
1077
|
-
}
|
|
1078
|
-
/**
|
|
1079
|
-
* An error body as a client must accept it: like `ErrorBodySchema`, but with any `code`, since
|
|
1080
|
-
* new codes may come in minor versions.
|
|
1081
|
-
*/
|
|
1082
|
-
var AnyErrorBodySchema = /* @__PURE__ */ object({ error: /* @__PURE__ */ object({
|
|
1083
|
-
code: /* @__PURE__ */ string(),
|
|
1084
|
-
message: /* @__PURE__ */ string(),
|
|
1085
|
-
details: /* @__PURE__ */ optional(/* @__PURE__ */ record(/* @__PURE__ */ string(), /* @__PURE__ */ unknown()))
|
|
1086
|
-
}) });
|
|
1087
|
-
export { SessionListSchema as a, InputCaptureSchema as c, SpeechEntrySchema as d, SpeechListSchema as f, ConfigSchema as h, CLIENT_HEADER as i, KeysRequestSchema as l, ConfigPatchSchema as m, checkDto as n, StartSessionRequestSchema as o, ConfigOverridesSchema as p, StatusSchema as r, StartSessionResponseSchema as s, AnyErrorBodySchema as t, MarkerRequestSchema as u };
|
|
1076
|
+
export { StartSessionResponseSchema as a, MarkerRequestSchema as c, AnyErrorBodySchema as d, ConfigOverridesSchema as f, safeParse as g, getDotPath as h, StartSessionRequestSchema as i, SpeechEntrySchema as l, ConfigSchema as m, CLIENT_HEADER as n, InputCaptureSchema as o, ConfigPatchSchema as p, SessionListSchema as r, KeysRequestSchema as s, StatusSchema as t, SpeechListSchema as u };
|
|
1088
1077
|
|
|
1089
1078
|
//# sourceMappingURL=src.js.map
|