@beff/aula-cli 0.13.0 → 0.13.1
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/README.md +2 -2
- package/dist/src/aula-render.core.wasm +0 -0
- package/dist/src/{aula-voice-tts-H2OQFQ5J.js → aula-voice-tts-FEFKNA2I.js} +1 -1
- package/dist/src/aula.js +2 -2
- package/dist/src/{chunk-UBVMGS2E.js → chunk-2BEUK7M7.js} +1 -1
- package/dist/src/{chunk-G44UMBPW.js → chunk-2VD3JPLV.js} +3 -5
- package/dist/src/chunk-4N5SDSCV.js +63 -0
- package/dist/src/{chunk-THZNJBUF.js → chunk-F37DXY3P.js} +95 -100
- package/dist/src/{chunk-S6IM5XXK.js → chunk-FGTN34N7.js} +3 -3
- package/dist/src/{chunk-D5N3QDDF.js → chunk-GQSFMINU.js} +3 -33
- package/dist/src/{chunk-XIVHJMET.js → chunk-N3YZ7K5L.js} +3 -3
- package/dist/src/{chunk-F5RPEFZR.js → chunk-T7S65ZHW.js} +4306 -1645
- package/dist/src/{chunk-4FWDTPLR.js → chunk-V3GJ4XSW.js} +118 -66
- package/dist/src/{chunk-WV2UYZND.js → chunk-VJAXVLXZ.js} +1 -1
- package/dist/src/{chunk-UQOXT6QN.js → chunk-Z7VLJSDG.js} +132 -35
- package/dist/src/cli.js +27 -74
- package/dist/src/{commands-PLST75CP.js → commands-ZTGXXVOO.js} +10 -9
- package/dist/src/generated/aula.core5.wasm +0 -0
- package/dist/src/generated/aula.js +4076 -1341
- package/dist/src/generated/interfaces/aula-engine-engine.d.ts +39 -0
- package/dist/src/problems-BDPV4IRL.js +17 -0
- package/dist/src/project-XHL7FN7B.js +16 -0
- package/dist/src/{run-NE5HOAXA.js → run-LZVKYMKT.js} +14 -11
- package/dist/src/{server-KXIU66BB.js → server-H7XOUJNL.js} +8 -8
- package/dist/src/{site-HUWODSZ3.js → site-7MLO35NA.js} +6 -6
- package/dist/src/{workspace-load-DOHFEZFR.js → workspace-load-OQXB2ZOC.js} +6 -6
- package/dist/web/app/assets/{62289de9 → 15e78332}/aula-method.js +1 -1
- package/dist/web/app/assets/{62289de9 → 15e78332}/aula.js +1 -1
- package/dist/web/app/assets/{62289de9 → 15e78332}/build-worker.js +2 -2
- package/dist/web/app/assets/15e78332/index.js +51 -0
- package/dist/web/app/assets/__vite-browser-external-CCI-9X_7.js +1 -0
- package/dist/web/app/assets/aula-voice-worker-bYZ7BKji.js +1 -0
- package/dist/web/app/assets/{aula.core5-CQ2oHbtB.wasm → aula.core5-CtBp7wFf.wasm} +0 -0
- package/dist/web/app/assets/protocol-j759xoXL.js +15 -0
- package/dist/web/app/assets/src-BjcN7H3T.js +6 -0
- package/dist/web/{site/assets/tex-mathjax-DrZV_cwB.js → app/assets/tex-mathjax-Bbh2jsAv.js} +1 -1
- package/dist/web/app/index.html +4 -4
- package/dist/web/site/assets/{82618540 → 671a8ee2}/aula-method.js +1 -1
- package/dist/web/site/assets/{82618540 → 671a8ee2}/aula.js +1 -1
- package/dist/web/site/assets/{82618540 → 671a8ee2}/build-worker.js +2 -2
- package/dist/web/site/assets/671a8ee2/index.js +51 -0
- package/dist/web/site/assets/__vite-browser-external-CrZYh5ba.js +1 -0
- package/dist/web/site/assets/aula-voice-worker-Doyh20uI.js +1 -0
- package/dist/web/site/assets/{aula.core5-CQ2oHbtB.wasm → aula.core5-CtBp7wFf.wasm} +0 -0
- package/dist/web/site/assets/protocol-ByKVs3Yn.js +15 -0
- package/dist/web/site/assets/src-BwnY0kQu.js +6 -0
- package/dist/web/{app/assets/tex-mathjax-eWNptbJg.js → site/assets/tex-mathjax-DKtiwFu-.js} +1 -1
- package/dist/web/site/index.html +4 -4
- package/package.json +1 -1
- package/dist/src/problems-EI4DOEZ4.js +0 -17
- package/dist/src/project-7EROVEUE.js +0 -16
- package/dist/web/app/assets/62289de9/index.js +0 -51
- package/dist/web/app/assets/__vite-browser-external-BHESVS8k.js +0 -1
- package/dist/web/app/assets/aula-voice-worker-CJpoa9h-.js +0 -1
- package/dist/web/app/assets/protocol-kcdbhuRm.js +0 -15
- package/dist/web/app/assets/src-DWqZcp-P.js +0 -6
- package/dist/web/site/assets/82618540/index.js +0 -51
- package/dist/web/site/assets/__vite-browser-external-DQubyTsZ.js +0 -1
- package/dist/web/site/assets/aula-voice-worker-BRrzyFz3.js +0 -1
- package/dist/web/site/assets/protocol-XMWr-E-D.js +0 -15
- package/dist/web/site/assets/src-DfPcHwz-.js +0 -6
|
@@ -28,6 +28,18 @@ export function polyline(points: Array<Point>): Mobject;
|
|
|
28
28
|
* @throws {Error & { payload: Diagnostic }} The error of the result, as the `payload` of the thrown error.
|
|
29
29
|
*/
|
|
30
30
|
export function pathBoolean(op: BooleanOp, shapes: Array<Array<Array<Point>>>): Array<Point>;
|
|
31
|
+
/**
|
|
32
|
+
* @throws {Error & { payload: Diagnostic }} The error of the result, as the `payload` of the thrown error.
|
|
33
|
+
*/
|
|
34
|
+
export function smoothHandles(anchors: Array<Point>): [Array<Point>, Array<Point>];
|
|
35
|
+
/**
|
|
36
|
+
* @throws {Error & { payload: Diagnostic }} The error of the result, as the `payload` of the thrown error.
|
|
37
|
+
*/
|
|
38
|
+
export function cubicPartial(curve: Array<Point>, t0: number, t1: number): Array<Point>;
|
|
39
|
+
/**
|
|
40
|
+
* @throws {Error & { payload: Diagnostic }} The error of the result, as the `payload` of the thrown error.
|
|
41
|
+
*/
|
|
42
|
+
export function insertCurves(points: Array<Point>, n: number): Array<Point>;
|
|
31
43
|
/**
|
|
32
44
|
* @throws {Error & { payload: Diagnostic }} The error of the result, as the `payload` of the thrown error.
|
|
33
45
|
*/
|
|
@@ -224,6 +236,7 @@ export function narrationScript(title: Array<SayPart>, lexicon: Array<LexiconEnt
|
|
|
224
236
|
export function chapterNarration(cues: Array<ScriptCue>, spoken: Array<SpokenCue>, sampleRate: number): Narration;
|
|
225
237
|
export function check(text: ChapterText): Array<Diagnostic>;
|
|
226
238
|
export function timeline(narration: Narration, text: ChapterText): Array<string>;
|
|
239
|
+
export function scriptBeats(narration: Narration, text: ChapterText): Array<ScriptBeat>;
|
|
227
240
|
export function moveFrames(narration: Narration, text: ChapterText): Array<ParagraphFrames>;
|
|
228
241
|
export function estimateNarration(cues: Array<ScriptCue>): Narration;
|
|
229
242
|
export function words(text: string): Array<string>;
|
|
@@ -234,6 +247,10 @@ export function fps(): number;
|
|
|
234
247
|
* @throws {Error & { payload: Diagnostic }} The error of the result, as the `payload` of the thrown error.
|
|
235
248
|
*/
|
|
236
249
|
export function phonemize(text: string, lexicon: Array<LexiconEntry>): string;
|
|
250
|
+
/**
|
|
251
|
+
* @throws {Error & { payload: Diagnostic }} The error of the result, as the `payload` of the thrown error.
|
|
252
|
+
*/
|
|
253
|
+
export function phonemizeWithUnknowns(text: string, lexicon: Array<LexiconEntry>): G2pResult;
|
|
237
254
|
/**
|
|
238
255
|
* @throws {Error & { payload: Diagnostic }} The error of the result, as the `payload` of the thrown error.
|
|
239
256
|
*/
|
|
@@ -244,6 +261,10 @@ export function checkTitle(place: Location, parts: Array<SayPart>): Array<Diagno
|
|
|
244
261
|
* @throws {Error & { payload: Diagnostic }} The error of the result, as the `payload` of the thrown error.
|
|
245
262
|
*/
|
|
246
263
|
export function unclearWords(words: Array<string>): Array<UnclearWord>;
|
|
264
|
+
/**
|
|
265
|
+
* @throws {Error & { payload: Diagnostic }} The error of the result, as the `payload` of the thrown error.
|
|
266
|
+
*/
|
|
267
|
+
export function unclearWordsFrom(words: Array<string>, unknowns: Array<string>, alonePhonemes: Array<string>): Array<UnclearWord>;
|
|
247
268
|
/**
|
|
248
269
|
* @throws {Error & { payload: Diagnostic }} The error of the result, as the `payload` of the thrown error.
|
|
249
270
|
*/
|
|
@@ -591,6 +612,10 @@ export interface UnclearWord {
|
|
|
591
612
|
kind: UnclearKind,
|
|
592
613
|
reading: string,
|
|
593
614
|
}
|
|
615
|
+
export interface G2pResult {
|
|
616
|
+
phonemes: string,
|
|
617
|
+
unknowns: Array<string>,
|
|
618
|
+
}
|
|
594
619
|
export interface LexiconEntry {
|
|
595
620
|
word: string,
|
|
596
621
|
reading: Pronunciation,
|
|
@@ -617,6 +642,20 @@ export interface SpokenCue {
|
|
|
617
642
|
samples: number,
|
|
618
643
|
starts?: Float64Array,
|
|
619
644
|
}
|
|
645
|
+
/**
|
|
646
|
+
* # Variants
|
|
647
|
+
*
|
|
648
|
+
* ## `"say"`
|
|
649
|
+
*
|
|
650
|
+
* ## `"embed"`
|
|
651
|
+
*/
|
|
652
|
+
export type ScriptBeatKind = "say" | "embed";
|
|
653
|
+
export interface ScriptBeat {
|
|
654
|
+
seconds: number,
|
|
655
|
+
kind: ScriptBeatKind,
|
|
656
|
+
text: string,
|
|
657
|
+
onScreen: Array<string>,
|
|
658
|
+
}
|
|
620
659
|
export interface ParagraphFrames {
|
|
621
660
|
start: number,
|
|
622
661
|
moves: Uint32Array,
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import {
|
|
2
|
+
printDiagnostics
|
|
3
|
+
} from "./chunk-FGTN34N7.js";
|
|
4
|
+
import "./chunk-F37DXY3P.js";
|
|
5
|
+
import "./chunk-V3GJ4XSW.js";
|
|
6
|
+
import "./chunk-2VD3JPLV.js";
|
|
7
|
+
import {
|
|
8
|
+
diagnosticsOf
|
|
9
|
+
} from "./chunk-VJAXVLXZ.js";
|
|
10
|
+
import "./chunk-GQSFMINU.js";
|
|
11
|
+
import "./chunk-T7S65ZHW.js";
|
|
12
|
+
import "./chunk-VX7UVLQW.js";
|
|
13
|
+
import "./chunk-CZ7CSFO4.js";
|
|
14
|
+
export {
|
|
15
|
+
diagnosticsOf,
|
|
16
|
+
printDiagnostics
|
|
17
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import {
|
|
2
|
+
exists,
|
|
3
|
+
host,
|
|
4
|
+
loadProject
|
|
5
|
+
} from "./chunk-2BEUK7M7.js";
|
|
6
|
+
import "./chunk-2VD3JPLV.js";
|
|
7
|
+
import "./chunk-VJAXVLXZ.js";
|
|
8
|
+
import "./chunk-GQSFMINU.js";
|
|
9
|
+
import "./chunk-T7S65ZHW.js";
|
|
10
|
+
import "./chunk-VX7UVLQW.js";
|
|
11
|
+
import "./chunk-CZ7CSFO4.js";
|
|
12
|
+
export {
|
|
13
|
+
exists,
|
|
14
|
+
host,
|
|
15
|
+
loadProject
|
|
16
|
+
};
|
|
@@ -4,20 +4,21 @@ import {
|
|
|
4
4
|
preview,
|
|
5
5
|
script,
|
|
6
6
|
timeline
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-Z7VLJSDG.js";
|
|
8
8
|
import "./chunk-THQ5Y74K.js";
|
|
9
|
+
import "./chunk-4N5SDSCV.js";
|
|
9
10
|
import "./chunk-F4XRXW6M.js";
|
|
10
11
|
import "./chunk-4N4NUMKP.js";
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-FGTN34N7.js";
|
|
13
|
+
import "./chunk-F37DXY3P.js";
|
|
14
|
+
import "./chunk-V3GJ4XSW.js";
|
|
15
|
+
import "./chunk-2BEUK7M7.js";
|
|
16
|
+
import "./chunk-2VD3JPLV.js";
|
|
16
17
|
import {
|
|
17
18
|
wrongArgument
|
|
18
|
-
} from "./chunk-
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-
|
|
19
|
+
} from "./chunk-VJAXVLXZ.js";
|
|
20
|
+
import "./chunk-GQSFMINU.js";
|
|
21
|
+
import "./chunk-T7S65ZHW.js";
|
|
21
22
|
import "./chunk-VX7UVLQW.js";
|
|
22
23
|
import "./chunk-CZ7CSFO4.js";
|
|
23
24
|
|
|
@@ -41,8 +42,10 @@ aula check <folder> [<chapter> ...] [--json] [--include-drafts]
|
|
|
41
42
|
every check, with no narration and no frames, and
|
|
42
43
|
a note for each word whose reading is not clear;
|
|
43
44
|
finds the projects in the folder; skips draft:
|
|
44
|
-
true unless --include-drafts;
|
|
45
|
-
|
|
45
|
+
true unless --include-drafts; a playlist prints
|
|
46
|
+
progress and a short summary on stderr, and checks
|
|
47
|
+
projects at the same time up to the CPU count;
|
|
48
|
+
--json prints each result as one JSON object
|
|
46
49
|
aula preview <folder> <out> [<chapter>[:<line>] ...] [--include-drafts]
|
|
47
50
|
PNG pictures for review: per chapter, stills,
|
|
48
51
|
motion stills, contact sheets and moves.md
|
|
@@ -3,23 +3,23 @@ import {
|
|
|
3
3
|
} from "./chunk-A5QHTZKT.js";
|
|
4
4
|
import {
|
|
5
5
|
resolveRootProjects
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-N3YZ7K5L.js";
|
|
7
7
|
import {
|
|
8
8
|
nodeTree
|
|
9
9
|
} from "./chunk-THQ5Y74K.js";
|
|
10
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-F37DXY3P.js";
|
|
11
11
|
import {
|
|
12
12
|
SERVER_WEIGHTS_PATH
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-V3GJ4XSW.js";
|
|
14
14
|
import {
|
|
15
15
|
exists
|
|
16
|
-
} from "./chunk-
|
|
17
|
-
import "./chunk-
|
|
16
|
+
} from "./chunk-2BEUK7M7.js";
|
|
17
|
+
import "./chunk-2VD3JPLV.js";
|
|
18
18
|
import {
|
|
19
19
|
Problems
|
|
20
|
-
} from "./chunk-
|
|
21
|
-
import "./chunk-
|
|
22
|
-
import "./chunk-
|
|
20
|
+
} from "./chunk-VJAXVLXZ.js";
|
|
21
|
+
import "./chunk-GQSFMINU.js";
|
|
22
|
+
import "./chunk-T7S65ZHW.js";
|
|
23
23
|
import {
|
|
24
24
|
AulaError,
|
|
25
25
|
fault
|
|
@@ -3,17 +3,17 @@ import {
|
|
|
3
3
|
} from "./chunk-A5QHTZKT.js";
|
|
4
4
|
import {
|
|
5
5
|
resolveRootProjects
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-N3YZ7K5L.js";
|
|
7
7
|
import "./chunk-THQ5Y74K.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-F37DXY3P.js";
|
|
9
9
|
import {
|
|
10
10
|
AULA_VOICE_WEIGHTS
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-V3GJ4XSW.js";
|
|
12
12
|
import {
|
|
13
13
|
wrongArgument
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
14
|
+
} from "./chunk-VJAXVLXZ.js";
|
|
15
|
+
import "./chunk-GQSFMINU.js";
|
|
16
|
+
import "./chunk-T7S65ZHW.js";
|
|
17
17
|
import {
|
|
18
18
|
fault
|
|
19
19
|
} from "./chunk-VX7UVLQW.js";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveOneProject,
|
|
3
3
|
resolveRootProjects
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-N3YZ7K5L.js";
|
|
5
5
|
import "./chunk-THQ5Y74K.js";
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-F37DXY3P.js";
|
|
7
|
+
import "./chunk-V3GJ4XSW.js";
|
|
8
|
+
import "./chunk-VJAXVLXZ.js";
|
|
9
|
+
import "./chunk-GQSFMINU.js";
|
|
10
|
+
import "./chunk-T7S65ZHW.js";
|
|
11
11
|
import "./chunk-VX7UVLQW.js";
|
|
12
12
|
import "./chunk-CZ7CSFO4.js";
|
|
13
13
|
export {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{f as e}from"../src-
|
|
1
|
+
import{f as e}from"../src-BjcN7H3T.js";import"./aula.js";var t=e=>JSON.stringify(e);function n(e){return!/\s/.test(e)&&!e.includes(`://`)&&/[/.]/.test(e)}function r(e,t){if(t.length!==1||t.raw.length!==1)throw Error(`${e}: a \${…} is not allowed in this tag`);let n=t[0]??``;if(n.includes(`
|
|
2
2
|
`))throw Error(`${e}: the text must be one line`);return n}function i(e,r,i){let a=[],o=(t,n,r=e.place)=>{a.push({code:t,message:n,...r===void 0?{}:{at:r}})};i.mechanism.trim()===``&&o(`method-no-mechanism`,`the paragraph has no mechanism: name the one mechanism that the viewer must understand`);for(let e of i.sources)n(e)&&!r.exists(e)&&o(`method-missing-source`,`${t(e)}: this path is not a file: correct the path or add the file`);return a}function a(t){let n=r(`paragraph`,t);return({sources:t},r)=>e({mechanism:n,sources:t},(e,a)=>[...i(e,a,{mechanism:n,sources:t}),...r?.(e,a)??[]])}export{a as paragraph};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{c as defineChapter,l as defineProject,u as embed,y as loadEngine,o as m,f as paragraph,p as pronounce,m as say,h as show}from"../src-
|
|
1
|
+
export{c as defineChapter,l as defineProject,u as embed,y as loadEngine,o as m,f as paragraph,p as pronounce,m as say,h as show}from"../src-BjcN7H3T.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as e,t}from"../rolldown-runtime-BLXQ4ufn.js";import{_ as n,a as r,d as i,f as a,g as o,i as s,l as c,m as l,n as u,o as d,p as f,u as p}from"../protocol-kcdbhuRm.js";import{S as m,g as h,v as g,y as _}from"../src-DWqZcp-P.js";var v=44,y=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,b=new Uint8Array(64),x=new Uint8Array(128);for(let e=0;e<y.length;e++){let t=y.charCodeAt(e);b[e]=t,x[t]=e}function S(e){let t=0,n=0,r=0;do r=x[e.next()],t|=(r&31)<<n,n+=5;while(r&32);return t}function C(e){return e&1?-0x80000000|-(e>>>1):e>>>1}function w(e,t){return e.pos>=t?!1:e.peek()!==v}var ee=class{constructor(e){this.pos=0,this.buffer=e}next(){return this.buffer.charCodeAt(this.pos++)}peek(){return this.buffer.charCodeAt(this.pos)}indexOf(e){let{buffer:t,pos:n}=this,r=t.indexOf(e,n);return r===-1?t.length:r}};function te(e){let{length:t}=e,n=new ee(e),r=[],i=0,a=0,o=0,s=0,c=0;do{let e=n.indexOf(`;`),t=[],l=!0,u=0;for(i=0;n.pos<e;){let r;i+=C(S(n)),i<u&&(l=!1),u=i,w(n,e)?(a+=C(S(n)),o+=C(S(n)),s+=C(S(n)),w(n,e)?(c+=C(S(n)),r=[i,a,o,s,c]):r=[i,a,o,s]):r=[i],t.push(r),n.pos++}l||T(t),r.push(t),n.pos=e+1}while(n.pos<=t);return r}function T(e){e.sort(E)}function E(e,t){return e[0]-t[0]}var ne=e(t(((e,t,n)=>{var r;(function(n,i){typeof e==`object`&&t!==void 0?t.exports=i():typeof r==`function`&&r.amd?r(i):(n=typeof globalThis<`u`?globalThis:n||self,n.resolveURI=i())})(n,(function(){let e=/^[\w+.-]+:\/\//,t=/^([\w+.-]+:)\/\/([^@/#?]*@)?(\[[^\]]+\]|[^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/,n=/^file:(?:\/\/((?![a-z]:)[^/#?]*)?)?(\/?[^#?]*)(\?[^#]*)?(#.*)?/i;function r(t){return e.test(t)}function i(e){return e.startsWith(`//`)}function a(e){return e.startsWith(`/`)}function o(e){return e.startsWith(`file:`)}function s(e){return/^[.?#]/.test(e)}function c(e){let n=t.exec(e);return u(n[1],n[2]||``,n[3],n[4]||``,n[5]||`/`,n[6]||``,n[7]||``)}function l(e){let t=n.exec(e),r=t[2];return u(`file:`,``,t[1]||``,``,a(r)?r:`/`+r,t[3]||``,t[4]||``)}function u(e,t,n,r,i,a,o){return{scheme:e,user:t,host:n,port:r,path:i,query:a,hash:o,type:7}}function d(e){if(i(e)){let t=c(`http:`+e);return t.scheme=``,t.type=6,t}if(a(e)){let t=c(`http://foo.com`+e);return t.scheme=``,t.host=``,t.type=5,t}if(o(e))return l(e);if(r(e))return c(e);let t=c(`http://foo.com/`+e);return t.scheme=``,t.host=``,t.type=e?e.startsWith(`?`)?3:e.startsWith(`#`)?2:4:1,t}function f(e){if(e.endsWith(`/..`))return e;let t=e.lastIndexOf(`/`);return e.slice(0,t+1)}function p(e,t){m(t,t.type),e.path=e.path===`/`?t.path:f(t.path)+e.path}function m(e,t){let n=t<=4,r=e.path.split(`/`),i=1,a=0,o=!1;for(let e=1;e<r.length;e++){let t=r[e];t?(o=!1,t!==`.`&&(t===`..`?a?(o=!0,a--,i--):n&&(r[i++]=t):(r[i++]=t,a++))):o=!0}let s=``;for(let e=1;e<i;e++)s+=`/`+r[e];(!s||o&&!s.endsWith(`/..`))&&(s+=`/`),e.path=s}function h(e,t){if(!e&&!t)return``;let n=d(e),r=n.type;if(t&&r!==7){let e=d(t),i=e.type;switch(r){case 1:n.hash=e.hash;case 2:n.query=e.query;case 3:case 4:p(n,e);case 5:n.user=e.user,n.host=e.host,n.port=e.port;case 6:n.scheme=e.scheme}i>r&&(r=i)}m(n,r);let i=n.query+n.hash;switch(r){case 2:case 3:return i;case 4:{let r=n.path.slice(1);return r?s(t||e)&&!s(r)?`./`+r+i:r+i:i||`.`}case 5:return n.path+i;default:return n.scheme+`//`+n.user+n.host+n.port+n.path+i}}return h}))}))(),1);function D(e){if(!e)return``;let t=e.lastIndexOf(`/`);return e.slice(0,t+1)}function re(e,t){let n=D(e),r=t?t+`/`:``;return e=>(0,ne.default)(r+(e||``),n)}var O=0,ie=1,ae=2,k=3,A=4;function j(e,t){let n=M(e,0);if(n===e.length)return e;t||(e=e.slice());for(let r=n;r<e.length;r=M(e,r+1))e[r]=P(e[r],t);return e}function M(e,t){for(let n=t;n<e.length;n++)if(!N(e[n]))return n;return e.length}function N(e){for(let t=1;t<e.length;t++)if(e[t][O]<e[t-1][O])return!1;return!0}function P(e,t){return t||(e=e.slice()),e.sort(F)}function F(e,t){return e[O]-t[O]}var I=!1;function L(e,t,n,r){for(;n<=r;){let i=n+(r-n>>1),a=e[i][O]-t;if(a===0)return I=!0,i;a<0?n=i+1:r=i-1}return I=!1,n-1}function R(e,t,n){for(let r=n+1;r<e.length&&e[r][O]===t;n=r++);return n}function z(e,t,n){for(let r=n-1;r>=0&&e[r][O]===t;n=r--);return n}function B(){return{lastKey:-1,lastNeedle:-1,lastIndex:-1}}function V(e,t,n,r){let{lastKey:i,lastNeedle:a,lastIndex:o}=n,s=0,c=e.length-1;if(r===i){if(t===a)return I=o!==-1&&e[o][O]===t,o;t>=a?s=o===-1?0:o:c=o}return n.lastKey=r,n.lastNeedle=t,n.lastIndex=L(e,t,s,c)}function H(e){return typeof e==`string`?JSON.parse(e):e}var U="`line` must be greater than 0 (lines start at line 1)",oe="`column` must be greater than or equal to 0 (columns start at column 0)",W=class{constructor(e,t){let n=typeof e==`string`;if(!n&&e._decodedMemo)return e;let r=H(e),{version:i,file:a,names:o,sourceRoot:s,sources:c,sourcesContent:l}=r;this.version=i,this.file=a,this.names=o||[],this.sourceRoot=s,this.sources=c,this.sourcesContent=l,this.ignoreList=r.ignoreList||r.x_google_ignoreList||void 0;let u=re(t,s);this.resolvedSources=c.map(u);let{mappings:d}=r;if(typeof d==`string`)this._encoded=d,this._decoded=void 0;else if(Array.isArray(d))this._encoded=void 0,this._decoded=j(d,n);else if(r.sections)throw Error(`TraceMap passed sectioned source map, please use FlattenMap export instead`);else throw Error(`invalid source map: ${JSON.stringify(r)}`);this._decodedMemo=B(),this._bySources=void 0,this._bySourceMemos=void 0}};function G(e){return e}function K(e){var t;return(t=G(e))._decoded||(t._decoded=te(G(e)._encoded))}function q(e,t){let{line:n,column:r,bias:i}=t;if(n--,n<0)throw Error(U);if(r<0)throw Error(oe);let a=K(e);if(n>=a.length)return J(null,null,null,null);let o=a[n],s=se(o,G(e)._decodedMemo,n,r,i||1);if(s===-1)return J(null,null,null,null);let c=o[s];if(c.length===1)return J(null,null,null,null);let{names:l,resolvedSources:u}=e;return J(u[c[ie]],c[ae]+1,c[k],c.length===5?l[c[A]]:null)}function J(e,t,n,r){return{source:e,line:t,column:n,name:r}}function se(e,t,n,r,i){let a=V(e,r,t,n);return I?a=(i===-1?R:z)(e,r,a):i===-1&&a++,a===-1||a===e.length?-1:a}var Y=new Map;function ce(e,t,n){Y.set(e,{map:new W(t),prefix:n})}function le(e,t,n){let r=Y.get(e);if(!r)return{file:e,line:t,column:n};let i=q(r.map,{line:t,column:n-1});return i.source===null||i.line===null||i.column===null?{file:e,line:t,column:n}:{file:i.source.startsWith(r.prefix)?i.source.slice(r.prefix.length):i.source,line:i.line,column:i.column+1}}var X=n(le);function ue(e){let t=0,n=new Map;e.then(e=>{e.addEventListener(`message`,t=>{let i=t.data;if(i.kind===`error`)throw e.close(),new r(`the narrator stopped: ${i.message}`,i.stack);let a=n.get(i.id);n.delete(i.id),a?.(i)}),e.start()});let i=async(r,i)=>{let a=await e;return new Promise(e=>{let o=t++;n.set(o,e),a.postMessage({id:o,kind:r,words:i})})};return{speak:async e=>{let t=await i(`speak`,e);if(t.kind!==`speech`)throw Error(`the narrator answered ${t.kind} to a speech`);return{samples:t.samples,sampleRate:t.sampleRate,words:t.words}},time:async e=>{let t=await i(`time`,e);if(t.kind!==`timing`)throw Error(`the narrator answered ${t.kind} to a clock`);return{samples:t.samples,sampleRate:t.sampleRate,words:t.words}}}}function de(e){let t=0,n=0,r=!1,l=new Map,d=n=>{let r=r=>{let i=t++,{promise:a,resolve:o}=Promise.withResolvers();return l.set(i,o),e.post({kind:`files`,id:i,tree:n,question:r},[]),a};return{bundle:async()=>{let e=await r({kind:`bundle`});if(e.kind!==`bundle`)throw Error(`the page answered ${e.kind} to a question of the bundle`);return e.result},name:async()=>{let e=await r({kind:`name`});if(e.kind!==`name`)throw Error(`the page answered ${e.kind} to a question of the name`);return e.name},read:async e=>{let t=await r({kind:`read`,path:e});if(t.kind!==`read`)throw Error(`the page answered ${t.kind} to a read of ${e}`);return t.text},bytes:async e=>{let t=await r({kind:`bytes`,path:e});if(t.kind!==`bytes`)throw Error(`the page answered ${t.kind} to a read of the bytes of ${e}`);return t.bytes},list:async e=>{let t=await r({kind:`list`,folder:e});if(t.kind!==`list`)throw Error(`the page answered ${t.kind} to a list of ${e}`);return t.names}}},m=async()=>{let t=d(n++),o=new Map,s=new Set,c=e=>{let t=o.get(e);return t===void 0&&s.add(e),t?{size:t.length,read:()=>t}:void 0},[l]=await Promise.all([t.bundle(),_().then(async()=>{await g(),e.post({kind:`stage`,stage:`engine`},[])})]),u,m=!1;if(l!==null){if(l._tag===`Left`)return e.post({kind:`stage`,stage:`project`},[]),l;m=l.right.includeDrafts===!0,u=await i(l.right,f(X,c),e.modules,e.player)}else{let n=await t.name();if(n===null)return e.post({kind:`stage`,stage:`project`},[]),{_tag:`Right`,right:[]};let r={name:()=>Promise.resolve(n),read:t.read,list:t.list},i=await e.bundler();u=await a(r,f(X,c),e.modules,i,e.player)}if(e.post({kind:`stage`,stage:`project`},[]),u._tag===`Left`)return u;u={_tag:`Right`,right:p(u.right,{includeDrafts:m})},r||(r=!0,e.post({kind:`narrator`},[]));let v=async e=>{for(;;){s.clear();let n=e(),r=[...s].filter(e=>!o.has(e));if(r.length===0)return n;await Promise.all(r.map(async e=>o.set(e,await t.bytes(e))))}};return{_tag:`Right`,right:u.right.map(e=>{let t=new Set;return{...e,readScript:async()=>(await h(),v(()=>e.script())),readChapter:async n=>{t.has(n)||(await h(),await v(()=>e.walk?.(n)),t.add(n))}}})}},v=Promise.withResolvers(),y=o(c.create({voice:ue(v.promise),workspace:{projects:m}})),b=[],x=(t,{chapters:n,...r})=>{let i=[],a=[],o=[];n.forEach((e,t)=>{let n=b[t];if(e===n)return;if(!e){i.push([t,void 0]);return}let r=n?.cues.map(e=>e.samples)??[];if(e.animation!==n?.animation){let{animation:n,cues:a,...o}=e,c=a.map(e=>{let t=e.samples?r.indexOf(e.samples):-1;return t===-1?null:t}),l=a.map(({at:e,length:t},n)=>({at:e,length:t,keep:c[n]??null}));i.push([t,{...o,lottie:s(n),cues:l}]),r=c.map(e=>e===null?void 0:r[e])}e.cues.forEach((e,n)=>{if(!e.samples||e.samples===r[n])return;let i=e.samples.slice();o.push(i.buffer),a.push({chapter:t,cue:n,samples:i})})}),b=n;let c={building:r.building,timeline:r.timeline,duration:r.duration,errors:u(r.errors)};e.post({kind:`state`,watch:t,state:c,count:n.length,drawings:i,sounds:a},o)};return t=>{switch(t.kind){case`list`:y.build.list().then(n=>{let r=n._tag===`Left`?{_tag:`Left`,left:u(n.left)}:n;e.post({kind:`listed`,id:t.id,videos:r},[])});return;case`watch`:b=[],y.build.watch(t.name,{changed:e=>{x(t.watch,e)}});return;case`seek`:y.build.seek(t.name,t.place);return;case`halt`:y.halt();return;case`refresh`:y.refresh(t.place);return;case`files`:{let e=l.get(t.id);l.delete(t.id),e?.(t.answer);return}case`narrator`:v.resolve(t.port);return}}}var Z=(e,t=[])=>{self.postMessage(e,{transfer:t})},Q=e=>{let t=d(e,X);Z({kind:`error`,message:t.message,stack:t.stack.map(e=>` ${e}`).join(`
|
|
2
|
-
`)})};self.addEventListener(`error`,e=>{e.preventDefault(),Q(e.error??Error(e.message))}),self.addEventListener(`unhandledrejection`,e=>{e.preventDefault(),Q(e.reason)});var fe={"@beff/aula":new URL(`./aula.js`,import.meta.url).href,"@beff/aula-method":new URL(`./aula-method.js`,import.meta.url).href},pe={load:async({code:e,map:t})=>{let n=URL.createObjectURL(new Blob([e],{type:`text/javascript`}));return ce(n,t,
|
|
1
|
+
import{r as e,t}from"../rolldown-runtime-BLXQ4ufn.js";import{_ as n,a as r,d as i,f as a,i as o,l as s,m as c,n as l,o as u,p as d,u as f,v as p}from"../protocol-j759xoXL.js";import{S as m,g as h,v as g,y as _}from"../src-BjcN7H3T.js";var v=44,y=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,b=new Uint8Array(64),x=new Uint8Array(128);for(let e=0;e<y.length;e++){let t=y.charCodeAt(e);b[e]=t,x[t]=e}function S(e){let t=0,n=0,r=0;do r=x[e.next()],t|=(r&31)<<n,n+=5;while(r&32);return t}function C(e){return e&1?-0x80000000|-(e>>>1):e>>>1}function w(e,t){return e.pos>=t?!1:e.peek()!==v}var ee=class{constructor(e){this.pos=0,this.buffer=e}next(){return this.buffer.charCodeAt(this.pos++)}peek(){return this.buffer.charCodeAt(this.pos)}indexOf(e){let{buffer:t,pos:n}=this,r=t.indexOf(e,n);return r===-1?t.length:r}};function te(e){let{length:t}=e,n=new ee(e),r=[],i=0,a=0,o=0,s=0,c=0;do{let e=n.indexOf(`;`),t=[],l=!0,u=0;for(i=0;n.pos<e;){let r;i+=C(S(n)),i<u&&(l=!1),u=i,w(n,e)?(a+=C(S(n)),o+=C(S(n)),s+=C(S(n)),w(n,e)?(c+=C(S(n)),r=[i,a,o,s,c]):r=[i,a,o,s]):r=[i],t.push(r),n.pos++}l||T(t),r.push(t),n.pos=e+1}while(n.pos<=t);return r}function T(e){e.sort(E)}function E(e,t){return e[0]-t[0]}var ne=e(t(((e,t,n)=>{var r;(function(n,i){typeof e==`object`&&t!==void 0?t.exports=i():typeof r==`function`&&r.amd?r(i):(n=typeof globalThis<`u`?globalThis:n||self,n.resolveURI=i())})(n,(function(){let e=/^[\w+.-]+:\/\//,t=/^([\w+.-]+:)\/\/([^@/#?]*@)?(\[[^\]]+\]|[^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/,n=/^file:(?:\/\/((?![a-z]:)[^/#?]*)?)?(\/?[^#?]*)(\?[^#]*)?(#.*)?/i;function r(t){return e.test(t)}function i(e){return e.startsWith(`//`)}function a(e){return e.startsWith(`/`)}function o(e){return e.startsWith(`file:`)}function s(e){return/^[.?#]/.test(e)}function c(e){let n=t.exec(e);return u(n[1],n[2]||``,n[3],n[4]||``,n[5]||`/`,n[6]||``,n[7]||``)}function l(e){let t=n.exec(e),r=t[2];return u(`file:`,``,t[1]||``,``,a(r)?r:`/`+r,t[3]||``,t[4]||``)}function u(e,t,n,r,i,a,o){return{scheme:e,user:t,host:n,port:r,path:i,query:a,hash:o,type:7}}function d(e){if(i(e)){let t=c(`http:`+e);return t.scheme=``,t.type=6,t}if(a(e)){let t=c(`http://foo.com`+e);return t.scheme=``,t.host=``,t.type=5,t}if(o(e))return l(e);if(r(e))return c(e);let t=c(`http://foo.com/`+e);return t.scheme=``,t.host=``,t.type=e?e.startsWith(`?`)?3:e.startsWith(`#`)?2:4:1,t}function f(e){if(e.endsWith(`/..`))return e;let t=e.lastIndexOf(`/`);return e.slice(0,t+1)}function p(e,t){m(t,t.type),e.path=e.path===`/`?t.path:f(t.path)+e.path}function m(e,t){let n=t<=4,r=e.path.split(`/`),i=1,a=0,o=!1;for(let e=1;e<r.length;e++){let t=r[e];t?(o=!1,t!==`.`&&(t===`..`?a?(o=!0,a--,i--):n&&(r[i++]=t):(r[i++]=t,a++))):o=!0}let s=``;for(let e=1;e<i;e++)s+=`/`+r[e];(!s||o&&!s.endsWith(`/..`))&&(s+=`/`),e.path=s}function h(e,t){if(!e&&!t)return``;let n=d(e),r=n.type;if(t&&r!==7){let e=d(t),i=e.type;switch(r){case 1:n.hash=e.hash;case 2:n.query=e.query;case 3:case 4:p(n,e);case 5:n.user=e.user,n.host=e.host,n.port=e.port;case 6:n.scheme=e.scheme}i>r&&(r=i)}m(n,r);let i=n.query+n.hash;switch(r){case 2:case 3:return i;case 4:{let r=n.path.slice(1);return r?s(t||e)&&!s(r)?`./`+r+i:r+i:i||`.`}case 5:return n.path+i;default:return n.scheme+`//`+n.user+n.host+n.port+n.path+i}}return h}))}))(),1);function D(e){if(!e)return``;let t=e.lastIndexOf(`/`);return e.slice(0,t+1)}function re(e,t){let n=D(e),r=t?t+`/`:``;return e=>(0,ne.default)(r+(e||``),n)}var O=0,ie=1,ae=2,k=3,A=4;function j(e,t){let n=M(e,0);if(n===e.length)return e;t||(e=e.slice());for(let r=n;r<e.length;r=M(e,r+1))e[r]=P(e[r],t);return e}function M(e,t){for(let n=t;n<e.length;n++)if(!N(e[n]))return n;return e.length}function N(e){for(let t=1;t<e.length;t++)if(e[t][O]<e[t-1][O])return!1;return!0}function P(e,t){return t||(e=e.slice()),e.sort(F)}function F(e,t){return e[O]-t[O]}var I=!1;function L(e,t,n,r){for(;n<=r;){let i=n+(r-n>>1),a=e[i][O]-t;if(a===0)return I=!0,i;a<0?n=i+1:r=i-1}return I=!1,n-1}function R(e,t,n){for(let r=n+1;r<e.length&&e[r][O]===t;n=r++);return n}function z(e,t,n){for(let r=n-1;r>=0&&e[r][O]===t;n=r--);return n}function B(){return{lastKey:-1,lastNeedle:-1,lastIndex:-1}}function V(e,t,n,r){let{lastKey:i,lastNeedle:a,lastIndex:o}=n,s=0,c=e.length-1;if(r===i){if(t===a)return I=o!==-1&&e[o][O]===t,o;t>=a?s=o===-1?0:o:c=o}return n.lastKey=r,n.lastNeedle=t,n.lastIndex=L(e,t,s,c)}function H(e){return typeof e==`string`?JSON.parse(e):e}var U="`line` must be greater than 0 (lines start at line 1)",oe="`column` must be greater than or equal to 0 (columns start at column 0)",W=class{constructor(e,t){let n=typeof e==`string`;if(!n&&e._decodedMemo)return e;let r=H(e),{version:i,file:a,names:o,sourceRoot:s,sources:c,sourcesContent:l}=r;this.version=i,this.file=a,this.names=o||[],this.sourceRoot=s,this.sources=c,this.sourcesContent=l,this.ignoreList=r.ignoreList||r.x_google_ignoreList||void 0;let u=re(t,s);this.resolvedSources=c.map(u);let{mappings:d}=r;if(typeof d==`string`)this._encoded=d,this._decoded=void 0;else if(Array.isArray(d))this._encoded=void 0,this._decoded=j(d,n);else if(r.sections)throw Error(`TraceMap passed sectioned source map, please use FlattenMap export instead`);else throw Error(`invalid source map: ${JSON.stringify(r)}`);this._decodedMemo=B(),this._bySources=void 0,this._bySourceMemos=void 0}};function G(e){return e}function K(e){var t;return(t=G(e))._decoded||(t._decoded=te(G(e)._encoded))}function q(e,t){let{line:n,column:r,bias:i}=t;if(n--,n<0)throw Error(U);if(r<0)throw Error(oe);let a=K(e);if(n>=a.length)return J(null,null,null,null);let o=a[n],s=se(o,G(e)._decodedMemo,n,r,i||1);if(s===-1)return J(null,null,null,null);let c=o[s];if(c.length===1)return J(null,null,null,null);let{names:l,resolvedSources:u}=e;return J(u[c[ie]],c[ae]+1,c[k],c.length===5?l[c[A]]:null)}function J(e,t,n,r){return{source:e,line:t,column:n,name:r}}function se(e,t,n,r,i){let a=V(e,r,t,n);return I?a=(i===-1?R:z)(e,r,a):i===-1&&a++,a===-1||a===e.length?-1:a}var Y=new Map;function ce(e,t,n){Y.set(e,{map:new W(t),prefix:n})}function le(e,t,n){let r=Y.get(e);if(!r)return{file:e,line:t,column:n};let i=q(r.map,{line:t,column:n-1});return i.source===null||i.line===null||i.column===null?{file:e,line:t,column:n}:{file:i.source.startsWith(r.prefix)?i.source.slice(r.prefix.length):i.source,line:i.line,column:i.column+1}}var X=p(le);function ue(e){let t=0,n=new Map;e.then(e=>{e.addEventListener(`message`,t=>{let i=t.data;if(i.kind===`error`)throw e.close(),new r(`the narrator stopped: ${i.message}`,i.stack);let a=n.get(i.id);n.delete(i.id),a?.(i)}),e.start()});let i=async(r,i)=>{let a=await e;return new Promise(e=>{let o=t++;n.set(o,e),a.postMessage({id:o,kind:r,words:i})})};return{speak:async e=>{let t=await i(`speak`,e);if(t.kind!==`speech`)throw Error(`the narrator answered ${t.kind} to a speech`);return{samples:t.samples,sampleRate:t.sampleRate,words:t.words}},time:async e=>{let t=await i(`time`,e);if(t.kind!==`timing`)throw Error(`the narrator answered ${t.kind} to a clock`);return{samples:t.samples,sampleRate:t.sampleRate,words:t.words}}}}function de(e){let t=0,r=0,c=!1,u=new Map,p=n=>{let r=r=>{let i=t++,{promise:a,resolve:o}=Promise.withResolvers();return u.set(i,o),e.post({kind:`files`,id:i,tree:n,question:r},[]),a};return{bundle:async()=>{let e=await r({kind:`bundle`});if(e.kind!==`bundle`)throw Error(`the page answered ${e.kind} to a question of the bundle`);return e.result},name:async()=>{let e=await r({kind:`name`});if(e.kind!==`name`)throw Error(`the page answered ${e.kind} to a question of the name`);return e.name},read:async e=>{let t=await r({kind:`read`,path:e});if(t.kind!==`read`)throw Error(`the page answered ${t.kind} to a read of ${e}`);return t.text},bytes:async e=>{let t=await r({kind:`bytes`,path:e});if(t.kind!==`bytes`)throw Error(`the page answered ${t.kind} to a read of the bytes of ${e}`);return t.bytes},list:async e=>{let t=await r({kind:`list`,folder:e});if(t.kind!==`list`)throw Error(`the page answered ${t.kind} to a list of ${e}`);return t.names}}},m=async()=>{let t=p(r++),n=new Map,o=new Set,s=e=>{let t=n.get(e);return t===void 0&&o.add(e),t?{size:t.length,read:()=>t}:void 0},[l]=await Promise.all([t.bundle(),_().then(async()=>{await g(),e.post({kind:`stage`,stage:`engine`},[])})]),u,m=!1;if(l!==null){if(l._tag===`Left`)return e.post({kind:`stage`,stage:`project`},[]),l;m=l.right.includeDrafts===!0,u=await i(l.right,d(X,s),e.modules,e.player)}else{let n=await t.name();if(n===null)return e.post({kind:`stage`,stage:`project`},[]),{_tag:`Right`,right:[]};let r={name:()=>Promise.resolve(n),read:t.read,list:t.list},i=await e.bundler();u=await a(r,d(X,s),e.modules,i,e.player)}if(e.post({kind:`stage`,stage:`project`},[]),u._tag===`Left`)return u;u={_tag:`Right`,right:f(u.right,{includeDrafts:m})},c||(c=!0,e.post({kind:`narrator`},[]));let v=async e=>{for(;;){o.clear();let r=e(),i=[...o].filter(e=>!n.has(e));if(i.length===0)return r;await Promise.all(i.map(async e=>n.set(e,await t.bytes(e))))}};return{_tag:`Right`,right:u.right.map(e=>{let t=new Set;return{...e,readScript:async()=>(await h(),v(()=>e.script())),readChapter:async n=>{t.has(n)||(await h(),await v(()=>e.walk?.(n)),t.add(n))}}})}},v=Promise.withResolvers(),y=n(s.create({voice:ue(v.promise),workspace:{projects:m}})),b=[],x=(t,{chapters:n,...r})=>{let i=[],a=[],s=[];n.forEach((e,t)=>{let n=b[t];if(e===n)return;if(!e){i.push([t,void 0]);return}let r=n?.cues.map(e=>e.samples)??[];if(e.animation!==n?.animation){let{animation:n,cues:a,...s}=e,c=a.map(e=>{let t=e.samples?r.indexOf(e.samples):-1;return t===-1?null:t}),l=a.map(({at:e,length:t},n)=>({at:e,length:t,keep:c[n]??null}));i.push([t,{...s,lottie:o(n),cues:l}]),r=c.map(e=>e===null?void 0:r[e])}e.cues.forEach((e,n)=>{if(!e.samples||e.samples===r[n])return;let i=e.samples.slice();s.push(i.buffer),a.push({chapter:t,cue:n,samples:i})})}),b=n;let c={building:r.building,timeline:r.timeline,duration:r.duration,errors:l(r.errors)};e.post({kind:`state`,watch:t,state:c,count:n.length,drawings:i,sounds:a},s)};return t=>{switch(t.kind){case`list`:y.build.list().then(n=>{let r=n._tag===`Left`?{_tag:`Left`,left:l(n.left)}:n;e.post({kind:`listed`,id:t.id,videos:r},[])});return;case`watch`:b=[],y.build.watch(t.name,{changed:e=>{x(t.watch,e)}});return;case`seek`:y.build.seek(t.name,t.place);return;case`halt`:y.halt();return;case`refresh`:y.refresh(t.place);return;case`files`:{let e=u.get(t.id);u.delete(t.id),e?.(t.answer);return}case`narrator`:v.resolve(t.port);return}}}var Z=(e,t=[])=>{self.postMessage(e,{transfer:t})},Q=e=>{let t=u(e,X);Z({kind:`error`,message:t.message,stack:t.stack.map(e=>` ${e}`).join(`
|
|
2
|
+
`)})};self.addEventListener(`error`,e=>{e.preventDefault(),Q(e.error??Error(e.message))}),self.addEventListener(`unhandledrejection`,e=>{e.preventDefault(),Q(e.reason)});var fe={"@beff/aula":new URL(`./aula.js`,import.meta.url).href,"@beff/aula-method":new URL(`./aula-method.js`,import.meta.url).href},pe={load:async({code:e,map:t})=>{let n=URL.createObjectURL(new Blob([e],{type:`text/javascript`}));return ce(n,t,c),{url:n,exports:await import(n)}}},$=null;function me(){return $??=(async()=>{let t=performance.now(),[n,r]=await Promise.all([m(()=>import(`../browser-sNTR4ahh.js`).then(t=>e(t.default,1)),[]),m(()=>import(`../esbuild-D6hmBtXM.js`),[])]);return await n.initialize({wasmURL:r.default,worker:!1}),console.log(`aula: esbuild loaded in ${((performance.now()-t)/1e3).toFixed(1)} s`),n})(),$}var he=de({post:Z,bundler:me,modules:pe,player:fe});self.addEventListener(`message`,e=>{he(e.data)});
|