gooseworks 0.5.7-dev.46.ade46de2 → 0.5.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/dist/kit/core/run.d.ts +1 -5
  2. package/dist/kit/core/run.d.ts.map +1 -1
  3. package/dist/kit/core/run.js +0 -10
  4. package/dist/kit/core/run.js.map +1 -1
  5. package/dist/kit/core/style.d.ts +0 -1
  6. package/dist/kit/core/style.d.ts.map +1 -1
  7. package/dist/kit/maker/encode.d.ts +0 -5
  8. package/dist/kit/maker/encode.d.ts.map +1 -1
  9. package/dist/kit/maker/encode.js +1 -7
  10. package/dist/kit/maker/encode.js.map +1 -1
  11. package/dist/kit/maker/inputs.d.ts +3 -48
  12. package/dist/kit/maker/inputs.d.ts.map +1 -1
  13. package/dist/kit/maker/inputs.js +22 -151
  14. package/dist/kit/maker/inputs.js.map +1 -1
  15. package/dist/kit/maker/make.d.ts +1 -20
  16. package/dist/kit/maker/make.d.ts.map +1 -1
  17. package/dist/kit/maker/make.js +19 -125
  18. package/dist/kit/maker/make.js.map +1 -1
  19. package/dist/kit/maker/page.d.ts.map +1 -1
  20. package/dist/kit/maker/page.js +1 -49
  21. package/dist/kit/maker/page.js.map +1 -1
  22. package/dist/kit/maker/parts/html-frames/1.1.0/part.json +199 -0
  23. package/dist/kit/maker/parts/html-frames/src/part.d.ts.map +1 -1
  24. package/dist/kit/maker/parts/html-frames/src/part.js +1 -4
  25. package/dist/kit/maker/parts/html-frames/src/part.js.map +1 -1
  26. package/dist/kit/maker/runtime.d.ts.map +1 -1
  27. package/dist/kit/maker/runtime.js +7 -54
  28. package/dist/kit/maker/runtime.js.map +1 -1
  29. package/dist/skills/master-skill.d.ts +3 -3
  30. package/dist/skills/master-skill.d.ts.map +1 -1
  31. package/dist/skills/master-skill.js +18 -20
  32. package/dist/skills/master-skill.js.map +1 -1
  33. package/dist/skills/production-video-skills.json +5 -0
  34. package/package.json +3 -3
  35. package/skills/goose-video/SKILL.md +599 -23
  36. package/skills/goose-video-local/SKILL.md +1572 -3
  37. package/skills/make-custom-video/SKILL.md +689 -23
  38. package/skills/manifest.json +4 -4
  39. package/dist/kit/maker/cues.d.ts +0 -67
  40. package/dist/kit/maker/cues.d.ts.map +0 -1
  41. package/dist/kit/maker/cues.js +0 -204
  42. package/dist/kit/maker/cues.js.map +0 -1
  43. package/dist/kit/maker/facts.d.ts +0 -46
  44. package/dist/kit/maker/facts.d.ts.map +0 -1
  45. package/dist/kit/maker/facts.js +0 -159
  46. package/dist/kit/maker/facts.js.map +0 -1
  47. package/dist/kit/maker/parts/html-frames/1.2.0/part.json +0 -1083
  48. package/dist/kit/maker/timing.d.ts +0 -74
  49. package/dist/kit/maker/timing.d.ts.map +0 -1
  50. package/dist/kit/maker/timing.js +0 -152
  51. package/dist/kit/maker/timing.js.map +0 -1
  52. package/dist/kit/maker/under.d.ts +0 -126
  53. package/dist/kit/maker/under.d.ts.map +0 -1
  54. package/dist/kit/maker/under.js +0 -299
  55. package/dist/kit/maker/under.js.map +0 -1
@@ -1,74 +0,0 @@
1
- import type { Timeline } from '../part-interface';
2
- export type SpeechEntry = Timeline['speech'][number];
3
- export type SpokenWord = {
4
- text: string;
5
- start_s: number;
6
- end_s: number;
7
- };
8
- export interface PaceSpec {
9
- base_s: number;
10
- per_word_s: number;
11
- min_s?: number;
12
- max_s?: number;
13
- last_min_s?: number;
14
- }
15
- export interface Zone {
16
- x: number;
17
- y: number;
18
- w: number;
19
- h: number;
20
- }
21
- /** Words as a reader counts them: runs of letters or digits, joined by ' or -. */
22
- export declare function countWords(text: string | null): number;
23
- /** A scene with neither on-screen text nor a line (skip_blank looks for these). */
24
- export declare function isBlankScene(scene: {
25
- line: string | null;
26
- on_screen: string | null;
27
- }): boolean;
28
- /**
29
- * Which speech entries belong to which scene. Entries that name a scene_id go
30
- * to that scene (entries with none are left out of the timing). When no entry
31
- * names a scene, entries pair with scenes in order, which needs the same count.
32
- * Returns the reason in plain words when they cannot be paired.
33
- */
34
- export declare function speechByScene(ids: string[], speech: SpeechEntry[]): SpeechEntry[][] | string;
35
- /**
36
- * Scene start times from a voice track. The first scene starts at 0; a scene
37
- * with speech starts at its first entry. Scenes with no speech share the time
38
- * between the speech before them and the next scene's start (or the end) evenly.
39
- * The video lasts until the last entry ends, plus tail_s.
40
- */
41
- export declare function speechTimes(ids: string[], speech: SpeechEntry[], tailS: number): {
42
- starts: number[];
43
- seconds: number;
44
- } | string;
45
- /** How long each scene holds under `pace`: base_s plus per_word_s a word, kept between min_s and max_s; the last at least last_min_s. */
46
- export declare function paceHolds(scenes: Array<{
47
- line: string | null;
48
- on_screen: string | null;
49
- }>, pace: PaceSpec): number[] | string;
50
- /** Start times from holds, plus the whole length. */
51
- export declare function startsOfHolds(holds: number[]): {
52
- starts: number[];
53
- seconds: number;
54
- };
55
- /**
56
- * Scene start frames from start times, with the end appended. Returns the
57
- * index of the first scene that would get no frame, or the frames.
58
- */
59
- export declare function framesOfStarts(starts: number[], fps: number, frameCount: number): number[] | {
60
- empty: number;
61
- };
62
- /** Each scene's spoken words, by when each word starts (on the video's frames); words after the end go to the last scene. */
63
- export declare function wordsByScene(speech: SpeechEntry[], sceneFrames: number[], fps: number): SpokenWord[][];
64
- /** The caption zone kept to the page; null when none of it is on the page. */
65
- export declare function clipZone(zone: Zone, page: {
66
- width: number;
67
- height: number;
68
- }): Zone | null;
69
- /** A zone in the page's CSS pixels as video pixels, rounded inward so captions stay inside it. */
70
- export declare function zoneOnVideo(zone: Zone, scale: number, size: {
71
- width: number;
72
- height: number;
73
- }): Zone | null;
74
- //# sourceMappingURL=timing.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"timing.d.ts","sourceRoot":"","sources":["../../../src/kit/maker/timing.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAElD,MAAM,MAAM,WAAW,GAAG,QAAQ,CAAC,QAAQ,CAAC,C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M,GAAG,IAAI,CAAA;CAAE,CAAC,EAAE,IAAI,EAAE,QAAQ,GAAG,MAAM,EAAE,GAAG,MAAM,CAU7H;AAED,qDAAqD;AACrD,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG;IAAE,MAAM,EAAE,MAAM,EAAE,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAQpF;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAK9G;AAED,6HAA6H;AAC7H,wBAAgB,YAAY,CAAC,MAAM,EAAE,WAAW,EAAE,EAAE,WAAW,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,GAAG,UAAU,EAAE,EAAE,CAWtG;AAED,8EAA8E;AAC9E,wBAAgB,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,GAAG,IAAI,CAOzF;AAED,kGAAkG;AAClG,wBAAgB,WAAW,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,GAAG,IAAI,CAO3G"}
@@ -1,152 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.countWords = countWords;
4
- exports.isBlankScene = isBlankScene;
5
- exports.speechByScene = speechByScene;
6
- exports.speechTimes = speechTimes;
7
- exports.paceHolds = paceHolds;
8
- exports.startsOfHolds = startsOfHolds;
9
- exports.framesOfStarts = framesOfStarts;
10
- exports.wordsByScene = wordsByScene;
11
- exports.clipZone = clipZone;
12
- exports.zoneOnVideo = zoneOnVideo;
13
- /** Words as a reader counts them: runs of letters or digits, joined by ' or -. */
14
- function countWords(text) {
15
- if (!text)
16
- return 0;
17
- return text.split(/\s+/u).filter((token) => /[\p{L}\p{N}]/u.test(token)).length;
18
- }
19
- /** A scene with neither on-screen text nor a line (skip_blank looks for these). */
20
- function isBlankScene(scene) {
21
- return !scene.on_screen?.trim() && !scene.line?.trim();
22
- }
23
- /**
24
- * Which speech entries belong to which scene. Entries that name a scene_id go
25
- * to that scene (entries with none are left out of the timing). When no entry
26
- * names a scene, entries pair with scenes in order, which needs the same count.
27
- * Returns the reason in plain words when they cannot be paired.
28
- */
29
- function speechByScene(ids, speech) {
30
- const byScene = ids.map(() => []);
31
- if (speech.some((entry) => typeof entry.scene_id === 'string')) {
32
- const index = new Map(ids.map((id, i) => [id, i]));
33
- for (const entry of speech) {
34
- if (typeof entry.scene_id !== 'string')
35
- continue;
36
- const i = index.get(entry.scene_id);
37
- if (i === undefined)
38
- return `speech names scene "${entry.scene_id}", which is not one of the scenes`;
39
- byScene[i].push(entry);
40
- }
41
- return byScene;
42
- }
43
- if (speech.length !== ids.length) {
44
- return `speech has ${speech.length} entries without scene ids, so they cannot be paired with ${ids.length} scenes`;
45
- }
46
- speech.forEach((entry, i) => byScene[i].push(entry));
47
- return byScene;
48
- }
49
- /**
50
- * Scene start times from a voice track. The first scene starts at 0; a scene
51
- * with speech starts at its first entry. Scenes with no speech share the time
52
- * between the speech before them and the next scene's start (or the end) evenly.
53
- * The video lasts until the last entry ends, plus tail_s.
54
- */
55
- function speechTimes(ids, speech, tailS) {
56
- for (const [k, entry] of speech.entries()) {
57
- if (entry.end_s < entry.start_s)
58
- return `speech entry ${k + 1} ends (${entry.end_s} s) before it starts (${entry.start_s} s)`;
59
- }
60
- const byScene = speechByScene(ids, speech);
61
- if (typeof byScene === 'string')
62
- return byScene;
63
- const seconds = Math.max(...speech.map((entry) => entry.end_s)) + tailS;
64
- const first = byScene.map((entries) => (entries.length ? Math.min(...entries.map((e) => e.start_s)) : null));
65
- const last = byScene.map((entries) => (entries.length ? Math.max(...entries.map((e) => e.end_s)) : null));
66
- const starts = ids.map((_, i) => (i === 0 ? 0 : first[i]));
67
- for (let a = 1; a < ids.length; a++) {
68
- if (starts[a] !== null)
69
- continue;
70
- let b = a;
71
- while (b + 1 < ids.length && starts[b + 1] === null)
72
- b++;
73
- const to = b + 1 < ids.length ? starts[b + 1] : seconds;
74
- const spoken = last.slice(0, a).filter((v) => v !== null);
75
- const from = Math.min(to, Math.max(starts[a - 1], ...spoken));
76
- const count = b - a + 1;
77
- for (let k = 0; k < count; k++)
78
- starts[a + k] = from + ((to - from) * k) / count;
79
- a = b;
80
- }
81
- return { starts: starts, seconds };
82
- }
83
- /** How long each scene holds under `pace`: base_s plus per_word_s a word, kept between min_s and max_s; the last at least last_min_s. */
84
- function paceHolds(scenes, pace) {
85
- const min = pace.min_s ?? 0;
86
- const max = pace.max_s ?? Infinity;
87
- if (min > max)
88
- return `pace.min_s (${min}) is more than pace.max_s (${max})`;
89
- const holds = scenes.map((scene) => {
90
- const words = countWords(scene.on_screen) || countWords(scene.line);
91
- return Math.min(max, Math.max(min, pace.base_s + pace.per_word_s * words));
92
- });
93
- holds[holds.length - 1] = Math.max(holds[holds.length - 1], pace.last_min_s ?? 0);
94
- return holds;
95
- }
96
- /** Start times from holds, plus the whole length. */
97
- function startsOfHolds(holds) {
98
- const starts = [];
99
- let at = 0;
100
- for (const hold of holds) {
101
- starts.push(at);
102
- at += hold;
103
- }
104
- return { starts, seconds: at };
105
- }
106
- /**
107
- * Scene start frames from start times, with the end appended. Returns the
108
- * index of the first scene that would get no frame, or the frames.
109
- */
110
- function framesOfStarts(starts, fps, frameCount) {
111
- const frames = starts.map((s, i) => (i === 0 ? 0 : Math.min(frameCount, Math.max(0, Math.round(s * fps)))));
112
- frames.push(frameCount);
113
- for (let i = 0; i + 1 < frames.length; i++)
114
- if (frames[i + 1] <= frames[i])
115
- return { empty: i };
116
- return frames;
117
- }
118
- /** Each scene's spoken words, by when each word starts (on the video's frames); words after the end go to the last scene. */
119
- function wordsByScene(speech, sceneFrames, fps) {
120
- const scenes = sceneFrames.length - 1;
121
- const out = Array.from({ length: scenes }, () => []);
122
- const words = speech.flatMap((entry) => entry.words ?? []).slice().sort((a, b) => a.start_s - b.start_s);
123
- for (const word of words) {
124
- const frame = Math.round(word.start_s * fps);
125
- let i = scenes - 1;
126
- while (i > 0 && frame < sceneFrames[i])
127
- i--;
128
- out[i].push({ text: word.text, start_s: word.start_s, end_s: word.end_s });
129
- }
130
- return out;
131
- }
132
- /** The caption zone kept to the page; null when none of it is on the page. */
133
- function clipZone(zone, page) {
134
- const x0 = Math.max(0, zone.x);
135
- const y0 = Math.max(0, zone.y);
136
- const x1 = Math.min(page.width, zone.x + zone.w);
137
- const y1 = Math.min(page.height, zone.y + zone.h);
138
- if (x1 - x0 < 1 || y1 - y0 < 1)
139
- return null;
140
- return { x: x0, y: y0, w: x1 - x0, h: y1 - y0 };
141
- }
142
- /** A zone in the page's CSS pixels as video pixels, rounded inward so captions stay inside it. */
143
- function zoneOnVideo(zone, scale, size) {
144
- const x0 = Math.max(0, Math.ceil(zone.x * scale - 1e-6));
145
- const y0 = Math.max(0, Math.ceil(zone.y * scale - 1e-6));
146
- const x1 = Math.min(size.width, Math.floor((zone.x + zone.w) * scale + 1e-6));
147
- const y1 = Math.min(size.height, Math.floor((zone.y + zone.h) * scale + 1e-6));
148
- if (x1 - x0 < 1 || y1 - y0 < 1)
149
- return null;
150
- return { x: x0, y: y0, w: x1 - x0, h: y1 - y0 };
151
- }
152
- //# sourceMappingURL=timing.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"timing.js","sourceRoot":"","sources":["../../../src/kit/maker/timing.ts"],"names":[],"mappings":";;AAyBA,gCAGC;AAGD,oCAEC;AAQD,sCAiBC;AAQD,kCAsBC;AAGD,8BAUC;AAGD,sCAQC;AAMD,wCAKC;AAGD,oCAWC;AAGD,4BAOC;AAGD,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,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC;AAClD,CAAC"}
@@ -1,126 +0,0 @@
1
- import type { FileRef, KitTools, Timeline } from '../part-interface';
2
- /** What the maker measures of the video it draws over. */
3
- export interface UnderInfo {
4
- /** Length of its picture, in seconds. */
5
- seconds: number;
6
- width: number;
7
- height: number;
8
- fps: number | null;
9
- hasAudio: boolean;
10
- }
11
- /** A band of rows, as fractions of the height (0 at the top). */
12
- export interface QuietBand {
13
- y0: number;
14
- y1: number;
15
- }
16
- /** The band a quiet band is looked for in, and its height, as fractions of the height. */
17
- export declare const QUIET_SAFE: {
18
- readonly top: 0.15;
19
- readonly bottom: 0.85;
20
- readonly height: 0.15;
21
- };
22
- /** Reads the video's picture length, size, frame rate and whether it has sound, with ffprobe. */
23
- export declare function probeUnder(tools: Pick<KitTools, 'exec'>, file: string): Promise<UnderInfo | null>;
24
- /** How the video is fitted to the page: scaled to cover it, then cropped to the middle. */
25
- export interface CoverFit {
26
- scale: number;
27
- offsetX: number;
28
- offsetY: number;
29
- }
30
- export declare function coverFit(from: {
31
- width: number;
32
- height: number;
33
- }, to: {
34
- width: number;
35
- height: number;
36
- }): CoverFit;
37
- /** The ffmpeg filter that fits the video to the page: cover, centre crop, square pixels. */
38
- export declare function coverFilter(size: {
39
- width: number;
40
- height: number;
41
- }): string;
42
- /**
43
- * The emptiest band of a grey picture: rows are scored by how much the picture
44
- * changes along and down them (the per-row gradient), and the band of
45
- * QUIET_SAFE.height whose rows change least, inside QUIET_SAFE, wins. Ties go
46
- * to the band nearer the bottom, where captions usually sit.
47
- */
48
- export declare function quietBandOf(gray: Uint8Array, width: number, height: number): QuietBand;
49
- /**
50
- * Each scene's quiet band, from the video's frame at the middle of the scene,
51
- * fitted to the page the way the last pass fits it (cover, centre crop), so the
52
- * band describes what shows. Frames are read one at a time as raw grey pixels into `dir`.
53
- */
54
- export declare function quietBands(tools: Pick<KitTools, 'exec'>, file: string, info: UnderInfo, times: Array<{
55
- start_s: number;
56
- end_s: number;
57
- }>, dir: string, page: {
58
- width: number;
59
- height: number;
60
- }): Promise<QuietBand[]>;
61
- /**
62
- * True when the plan's scenes share the video drawn over evenly: that video is
63
- * one scene (one clip, say) and the plan has several.
64
- */
65
- export declare function underIsShared(ids: string[], timeline: Pick<Timeline, 'scenes'>): boolean;
66
- /**
67
- * Scene start frames from the timeline of the video drawn over. Each plan scene
68
- * takes the time of the timeline scene with its id; when ids do not match and
69
- * both list the same number of scenes, they pair in order. When that video is
70
- * one scene and the plan has several, the plan's scenes share it evenly on
71
- * whole frames, as they share a video of a given length. Returns null when the
72
- * scenes cannot be paired.
73
- */
74
- export declare function underSceneFrames(ids: string[], timeline: Pick<Timeline, 'scenes'>, fps: number, frameCount: number): number[] | null;
75
- /** One segment of transparent page frames, kept with their alpha (PNG in MOV), to be laid over the video later. */
76
- export declare function alphaSegmentArgs(opts: {
77
- framesDir: string;
78
- framePattern: string;
79
- start: number;
80
- count: number;
81
- fps: number;
82
- out: string;
83
- }): string[];
84
- /**
85
- * The last pass: the video fitted to the page, the page's frames laid over it,
86
- * encoded like every html-frames video, with the video's sound kept as AAC.
87
- */
88
- export declare function compositeArgs(opts: {
89
- tools: Pick<KitTools, 'encodeArgs'>;
90
- under: string;
91
- list: string;
92
- size: {
93
- width: number;
94
- height: number;
95
- };
96
- fps: number;
97
- frames: number;
98
- hasAudio: boolean;
99
- out: string;
100
- }): string[];
101
- /**
102
- * The timeline of a video drawn over: the video's own scenes, speech, end card
103
- * and safe zones carried through (cut to the new length, zones moved to the
104
- * new picture), with this video's length, size and frame rate. When the plan's
105
- * scenes shared a one-scene video (`scenes` given), they are the scenes, and a
106
- * speech entry that names a scene names the one it starts in.
107
- */
108
- export declare function passThroughTimeline(under: Timeline, out: {
109
- duration_s: number;
110
- width: number;
111
- height: number;
112
- fps: number;
113
- }, scenes?: Array<{
114
- id: string;
115
- start_s: number;
116
- end_s: number;
117
- }>): Timeline;
118
- /** The under video as the part takes it: the file and its timeline. */
119
- export interface UnderSpec {
120
- file: FileRef;
121
- timeline: Timeline;
122
- info: UnderInfo;
123
- /** Each plan scene's quiet band, measured before the page is built (kit.under.quiet_band). */
124
- quietBands?: QuietBand[];
125
- }
126
- //# sourceMappingURL=under.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"under.d.ts","sourceRoot":"","sources":["../../../src/kit/maker/under.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAGrE,0DAA0D;AAC1D,MAAM,WAAW,SAAS;IACxB,yCAAyC;IACzC,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,iEAAiE;AACjE,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,0FAA0F;AAC1F,eAAO,MAAM,UAAU;;;;CAAqD,CAAC;AAiB7E,iGAAiG;AACjG,wBAAsB,UAAU,CAAC,KAAK,EAAE,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,CA0BvG;AAED,2FAA2F;AAC3F,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,QAAQ,CAAC,IAAI,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,EAAE,EAAE,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;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