@rimelabs/sdk 0.1.0-alpha.12 → 0.1.0-alpha.13

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/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.1.0-alpha.13](https://github.com/rimelabs/rime-sdk/compare/typescript-v0.1.0-alpha.12...typescript-v0.1.0-alpha.13) (2026-10-11)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * **tts:** remove complete-text synthesis option ([#61](https://github.com/rimelabs/rime-sdk/issues/61)) ([4e3c133](https://github.com/rimelabs/rime-sdk/commit/4e3c1338dc9b129a0201a462f12fb414eeb520d1))
9
+
3
10
  ## [0.1.0-alpha.12](https://github.com/rimelabs/rime-sdk/compare/typescript-v0.1.0-alpha.11...typescript-v0.1.0-alpha.12) (2026-10-10)
4
11
 
5
12
 
package/README.md CHANGED
@@ -64,7 +64,8 @@ Coda is the default model. Use `new Rime({ model: "mistv3" })` for Mist v3, or p
64
64
  The default output is mono 24 kHz PCM16. The example adds its WAV header.
65
65
  Use `client.tts.synthesize(text)` for a complete string. To supply text from an LLM,
66
66
  pass an async iterable of strings to `client.tts.stream(chunks)`. Both methods
67
- return streaming audio. The SDK handles sentence boundaries.
67
+ return streaming audio. Rime automatically combines text fragments into
68
+ sentences for speech.
68
69
 
69
70
  ## STT quick start
70
71
 
@@ -201,5 +202,4 @@ See [Rime documentation](https://docs.rime.ai/) for API keys, TTS models, and de
201
202
  The examples above run with the installed package. No source checkout is required.
202
203
 
203
204
  SDK code uses the MIT license. The Prism protocol module uses Apache 2.0.
204
- BlingFire retains its MIT license. License texts and notices are included in the package.
205
- Its WASM runtime ships with the package. The SDK downloads no code or models at runtime.
205
+ The SDK downloads no code or models at runtime.
package/dist/grpc.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as grpc from "@grpc/grpc-js";
2
2
  import { type DescMessage, type MessageShape } from "@bufbuild/protobuf";
3
3
  import * as errors from "./errors.js";
4
- export declare function rpcError(code: number, requestId?: string | null): errors.RimeError;
4
+ export declare function rpcError(code: number, requestId?: string | null, details?: string): errors.RimeError;
5
5
  export declare function serializer<D extends DescMessage>(desc: D): (message: MessageShape<D>) => Buffer<ArrayBuffer>;
6
6
  export declare function deserializer<D extends DescMessage>(desc: D): (data: Buffer) => MessageShape<D>;
7
7
  export declare function requestId(metadata?: grpc.Metadata): string | null;
@@ -18,10 +18,10 @@ export declare class BidiCall<Input, Output> {
18
18
  get done(): boolean;
19
19
  cancel(): void;
20
20
  private error;
21
- write(message: Input): Promise<void>;
22
- finishInput(): void;
23
21
  headers(): Promise<grpc.Metadata>;
24
22
  responses(): AsyncGenerator<Output>;
23
+ write(message: Input): Promise<void>;
24
+ finishInput(): void;
25
25
  }
26
26
  export declare function connect(client: grpc.Client, signal: AbortSignal, seconds: number): Promise<void>;
27
27
  export declare function metadata(value: string): grpc.Metadata;
package/dist/grpc.js CHANGED
@@ -2,7 +2,7 @@ import { abortable } from "./cancellation.js";
2
2
  import * as grpc from "@grpc/grpc-js";
3
3
  import { fromBinary, toBinary, } from "@bufbuild/protobuf";
4
4
  import * as errors from "./errors.js";
5
- export function rpcError(code, requestId = null) {
5
+ export function rpcError(code, requestId = null, details) {
6
6
  const classes = {
7
7
  [grpc.status.UNAUTHENTICATED]: errors.RimeAuthenticationError,
8
8
  [grpc.status.PERMISSION_DENIED]: errors.RimePermissionError,
@@ -13,7 +13,9 @@ export function rpcError(code, requestId = null) {
13
13
  [grpc.status.CANCELLED]: errors.RimeCancelledError,
14
14
  };
15
15
  const ErrorType = classes[code] ?? errors.RimeStreamError;
16
- return new ErrorType(`Rime operation failed: ${grpc.status[code] ?? "UNKNOWN"}`, requestId);
16
+ return new ErrorType(details?.trim()
17
+ ? details
18
+ : `Rime operation failed: ${grpc.status[code] ?? "UNKNOWN"}`, requestId);
17
19
  }
18
20
  export function serializer(desc) {
19
21
  return (message) => Buffer.from(toBinary(desc, message));
@@ -32,7 +34,9 @@ export function nativeError(error, id) {
32
34
  "code" in error &&
33
35
  typeof error.code === "number") {
34
36
  const metadata = "metadata" in error ? error.metadata : null;
35
- return rpcError(error.code, id ?? (metadata instanceof grpc.Metadata ? requestId(metadata) : null));
37
+ return rpcError(error.code, id ?? (metadata instanceof grpc.Metadata ? requestId(metadata) : null), "details" in error && typeof error.details === "string"
38
+ ? error.details
39
+ : undefined);
36
40
  }
37
41
  return new errors.RimeStreamError("Rime transport failed", id, {
38
42
  cause: error,
@@ -81,16 +85,60 @@ export class BidiCall {
81
85
  this.id ??= failure.requestId;
82
86
  return failure;
83
87
  }
88
+ async headers() {
89
+ try {
90
+ return await abortable(this.metadataPromise, this.signal);
91
+ }
92
+ catch (error) {
93
+ if (this.signal.aborted)
94
+ throw this.signal.reason;
95
+ throw this.error(error);
96
+ }
97
+ }
98
+ async *responses() {
99
+ try {
100
+ await this.headers();
101
+ const responses = this.call;
102
+ for await (const response of responses)
103
+ yield response;
104
+ const status = await abortable(this.statusPromise, this.signal);
105
+ if (status.code !== grpc.status.OK)
106
+ throw rpcError(status.code, this.id, status.details);
107
+ }
108
+ catch (error) {
109
+ if (this.signal.aborted)
110
+ throw this.signal.reason;
111
+ throw this.error(error);
112
+ }
113
+ }
84
114
  async write(message) {
85
115
  try {
86
116
  this.signal.throwIfAborted();
87
117
  if (this.status) {
88
118
  if (this.status.code !== grpc.status.OK)
89
- throw rpcError(this.status.code, this.id);
119
+ throw rpcError(this.status.code, this.id, this.status.details);
90
120
  throw new errors.RimeStreamError("The service completed before input finished", this.id);
91
121
  }
92
122
  await abortable(new Promise((resolve, reject) => {
93
- this.call.write(message, (error) => error ? reject(error) : resolve());
123
+ const finish = (error) => {
124
+ this.call.removeListener("status", onStatus);
125
+ if (error)
126
+ reject(error);
127
+ else
128
+ resolve();
129
+ };
130
+ // A rejected native write can emit final status without invoking its
131
+ // callback (for example, when exceeding the send-message limit).
132
+ const onStatus = (status) => finish(status.code === grpc.status.OK
133
+ ? new errors.RimeStreamError("The service completed before input finished", this.id)
134
+ : rpcError(status.code, this.id, status.details));
135
+ this.call.once("status", onStatus);
136
+ try {
137
+ this.call.write(message, finish);
138
+ }
139
+ catch (error) {
140
+ finish(error);
141
+ }
94
142
  }), this.signal);
95
143
  }
96
144
  catch (error) {
@@ -102,7 +150,7 @@ export class BidiCall {
102
150
  // server rejection even if the reader has not consumed a response.
103
151
  const status = await abortable(this.statusPromise, this.signal);
104
152
  if (status.code !== grpc.status.OK)
105
- throw rpcError(status.code, this.id);
153
+ throw rpcError(status.code, this.id, status.details);
106
154
  throw this.error(error);
107
155
  }
108
156
  }
@@ -114,32 +162,6 @@ export class BidiCall {
114
162
  throw this.error(error);
115
163
  }
116
164
  }
117
- async headers() {
118
- try {
119
- return await abortable(this.metadataPromise, this.signal);
120
- }
121
- catch (error) {
122
- if (this.signal.aborted)
123
- throw this.signal.reason;
124
- throw this.error(error);
125
- }
126
- }
127
- async *responses() {
128
- try {
129
- await this.headers();
130
- const responses = this.call;
131
- for await (const response of responses)
132
- yield response;
133
- const status = await abortable(this.statusPromise, this.signal);
134
- if (status.code !== grpc.status.OK)
135
- throw rpcError(status.code, this.id);
136
- }
137
- catch (error) {
138
- if (this.signal.aborted)
139
- throw this.signal.reason;
140
- throw this.error(error);
141
- }
142
- }
143
165
  }
144
166
  export async function connect(client, signal, seconds) {
145
167
  await abortable(new Promise((resolve, reject) => client.waitForReady(Date.now() + seconds * 1000, (error) => error
package/dist/index.d.ts CHANGED
@@ -1,6 +1,8 @@
1
1
  export { Rime, type RimeOptions, type SynthesisOptions, type DiscoveryOptions, type VoiceListOptions, } from "./client.js";
2
2
  export { AudioStream } from "./tts/stream.js";
3
3
  export { AudioFormat } from "./tts/audio.js";
4
+ export type { PronunciationEntry } from "./tts/lexicon.js";
5
+ export type { TimestampResult, TimestampStatus, WordTimestamp, } from "./tts/timestamps.js";
4
6
  export * from "./errors.js";
5
7
  export { RealtimeSession } from "./realtime/session.js";
6
8
  export * from "./realtime/types.js";
@@ -1,4 +1,5 @@
1
1
  import { AudioFormat } from "./audio.js";
2
+ import { type PronunciationEntry } from "./lexicon.js";
2
3
  import { AudioStream, type TextSource } from "./stream.js";
3
4
  import { Credentials } from "../auth.js";
4
5
  import { policy } from "./policy.js";
@@ -6,6 +7,10 @@ export interface SynthesisOptions {
6
7
  voice?: string | null;
7
8
  language?: string;
8
9
  audioFormat?: AudioFormat | null;
10
+ /** Request final word timestamps. Supported only with model="mistv3". */
11
+ timestamps?: boolean;
12
+ /** Request-wide pronunciation overrides; requires a phoneme-capable Coda deployment. */
13
+ customLexicon?: readonly PronunciationEntry[];
9
14
  timeout?: number | null;
10
15
  }
11
16
  export interface DiscoveryOptions {
@@ -1,4 +1,5 @@
1
1
  import { AudioFormat } from "./audio.js";
2
+ import { snapshot } from "./lexicon.js";
2
3
  import { AudioStream, constructionKey } from "./stream.js";
3
4
  import { policy, timeout, nonempty } from "./policy.js";
4
5
  import { abortable } from "../cancellation.js";
@@ -56,6 +57,12 @@ export class TTS {
56
57
  !text ||
57
58
  typeof text[Symbol.asyncIterator] !== "function")
58
59
  throw new RimeInputError("text must be an async iterable of strings; use synthesize() for a string");
60
+ const lexicon = snapshot(options.customLexicon);
61
+ const timestamps = options.timestamps === undefined ? false : options.timestamps;
62
+ if (typeof timestamps !== "boolean")
63
+ throw new RimeInputError("timestamps must be a boolean");
64
+ if (timestamps && this.deployment.model !== "mistv3")
65
+ throw new RimeInputError("Word timestamps are supported only with model='mistv3'");
59
66
  const voice = options.voice === undefined || options.voice === null
60
67
  ? this.deployment.defaultVoice
61
68
  : nonempty(options.voice, "voice");
@@ -67,7 +74,7 @@ export class TTS {
67
74
  prepare: (s) => this.prepare(s),
68
75
  checkOpen: () => this.checkOpen(),
69
76
  forget: (s) => this.streams.delete(s),
70
- }, text, voice, language, format, timeout(options.timeout, this.defaultTimeout));
77
+ }, text, voice, language, format, timeout(options.timeout, this.defaultTimeout), timestamps, lexicon);
71
78
  this.streams.add(audio);
72
79
  return audio;
73
80
  }
@@ -0,0 +1,7 @@
1
+ /** A word or phrase and its space-separated X-SAMPA pronunciation. */
2
+ export interface PronunciationEntry {
3
+ readonly spelling: string;
4
+ readonly pronunciation: string;
5
+ }
6
+ /** Copy request options now; model and linguistic validation belong to the service. */
7
+ export declare function snapshot(entries?: readonly PronunciationEntry[]): readonly PronunciationEntry[];
@@ -0,0 +1,23 @@
1
+ import { RimeInputError } from "../errors.js";
2
+ // Unicode mode treats valid surrogate pairs as one code point outside this range.
3
+ const unpairedSurrogate = /[\uD800-\uDFFF]/u;
4
+ /** Copy request options now; model and linguistic validation belong to the service. */
5
+ export function snapshot(entries = []) {
6
+ if (!Array.isArray(entries))
7
+ throw new RimeInputError("customLexicon must be an array of pronunciation entries");
8
+ // Array.from also visits holes, which are invalid entries.
9
+ return Object.freeze(Array.from(entries, (entry) => {
10
+ if (!entry ||
11
+ typeof entry !== "object" ||
12
+ typeof entry.spelling !== "string" ||
13
+ typeof entry.pronunciation !== "string")
14
+ throw new RimeInputError("Lexicon entries must have string spelling and pronunciation fields");
15
+ if (unpairedSurrogate.test(entry.spelling) ||
16
+ unpairedSurrogate.test(entry.pronunciation))
17
+ throw new RimeInputError("Lexicon spelling and pronunciation must contain valid Unicode");
18
+ return Object.freeze({
19
+ spelling: entry.spelling,
20
+ pronunciation: entry.pronunciation,
21
+ });
22
+ }));
23
+ }
@@ -1,10 +1,10 @@
1
1
  export { timeout } from "../validation.js";
2
2
  export declare const policy: {
3
+ model: string;
3
4
  target: string;
4
5
  audience: string;
5
6
  defaultVoice: string;
6
7
  exchangeUrl: string;
7
- sentenceBytes: number;
8
8
  sourceChars: number;
9
9
  outputBytes: number;
10
10
  outputChunkBytes: number;
@@ -3,11 +3,11 @@ export { timeout } from "../validation.js";
3
3
  import { RimeInputError } from "../errors.js";
4
4
  const codaHostname = "coda.api.rime.ai";
5
5
  export const policy = {
6
+ model: "coda",
6
7
  target: `${codaHostname}:443`,
7
8
  audience: codaHostname,
8
9
  defaultVoice: "clementine",
9
10
  exchangeUrl: "https://themis.api.rime.ai/v1/token",
10
- sentenceBytes: 65536,
11
11
  sourceChars: 1024,
12
12
  outputBytes: 96000,
13
13
  outputChunkBytes: 9600,
@@ -20,7 +20,7 @@ export const policy = {
20
20
  cleanupTimeout: 2,
21
21
  };
22
22
  export function resolve(model, endpoint) {
23
- const deployment = { ...policy };
23
+ const deployment = { ...policy, model };
24
24
  if (model === "mistv3") {
25
25
  const hostname = "mist.api.rime.ai";
26
26
  deployment.target = `${hostname}:443`;
@@ -1,4 +1,6 @@
1
1
  import { AudioFormat } from "./audio.js";
2
+ import type { TimestampResult } from "./timestamps.js";
3
+ import type { PronunciationEntry } from "./lexicon.js";
2
4
  import { type PreparedConnection } from "./transport.js";
3
5
  export interface StreamOwner {
4
6
  prepare(signal: AbortSignal): Promise<PreparedConnection>;
@@ -14,6 +16,8 @@ export declare class AudioStream implements AsyncIterableIterator<Uint8Array> {
14
16
  private language;
15
17
  private formatValue;
16
18
  private timeout;
19
+ private timestampsRequested;
20
+ private customLexicon;
17
21
  private readonly controller;
18
22
  private readonly queue;
19
23
  private worker;
@@ -31,9 +35,14 @@ export declare class AudioStream implements AsyncIterableIterator<Uint8Array> {
31
35
  private readonly operationId;
32
36
  private bytesReceived;
33
37
  private bytesDelivered;
34
- constructor(key: symbol, owner: StreamOwner, source: TextSource | null, voice: string, language: string, formatValue: AudioFormat, timeout: number | null);
38
+ constructor(key: symbol, owner: StreamOwner, source: TextSource | null, voice: string, language: string, formatValue: AudioFormat, timeout: number | null, timestampsRequested?: boolean, customLexicon?: readonly PronunciationEntry[]);
35
39
  get format(): AudioFormat;
36
40
  get requestId(): string | null;
41
+ /** Read requested timestamps after consuming all audio; never drains audio.
42
+ * Calling before iteration completes rejects with RimeInputError. Synthesis
43
+ * errors reject here too; alignment failures are returned in status.
44
+ */
45
+ timestamps(): Promise<TimestampResult>;
37
46
  private start;
38
47
  private fail;
39
48
  private produce;
@@ -5,7 +5,6 @@ import { Converter } from "./audio.js";
5
5
  import { policy } from "./policy.js";
6
6
  import { abortable } from "../cancellation.js";
7
7
  import { ByteQueue } from "./queue.js";
8
- import { SentenceBuffer, ready } from "./sentences.js";
9
8
  import { SynthesisCall } from "./transport.js";
10
9
  import { RimeError, RimeInputError, RimeCancelledError, RimeTimeoutError, RimeStreamError, } from "../errors.js";
11
10
  export const constructionKey = Symbol("private stream constructor");
@@ -16,6 +15,8 @@ export class AudioStream {
16
15
  language;
17
16
  formatValue;
18
17
  timeout;
18
+ timestampsRequested;
19
+ customLexicon;
19
20
  controller = new AbortController();
20
21
  queue = new ByteQueue(policy.outputBytes, policy.outputChunkBytes);
21
22
  worker = null;
@@ -33,13 +34,15 @@ export class AudioStream {
33
34
  operationId = randomUUID();
34
35
  bytesReceived = 0;
35
36
  bytesDelivered = 0;
36
- constructor(key, owner, source, voice, language, formatValue, timeout) {
37
+ constructor(key, owner, source, voice, language, formatValue, timeout, timestampsRequested = false, customLexicon = []) {
37
38
  this.owner = owner;
38
39
  this.source = source;
39
40
  this.voice = voice;
40
41
  this.language = language;
41
42
  this.formatValue = formatValue;
42
43
  this.timeout = timeout;
44
+ this.timestampsRequested = timestampsRequested;
45
+ this.customLexicon = customLexicon;
43
46
  if (key !== constructionKey)
44
47
  throw new TypeError("AudioStream is returned by client.tts.synthesize() or client.tts.stream()");
45
48
  }
@@ -49,6 +52,19 @@ export class AudioStream {
49
52
  get requestId() {
50
53
  return this.call?.requestId ?? null;
51
54
  }
55
+ /** Read requested timestamps after consuming all audio; never drains audio.
56
+ * Calling before iteration completes rejects with RimeInputError. Synthesis
57
+ * errors reject here too; alignment failures are returned in status.
58
+ */
59
+ async timestamps() {
60
+ if (!this.timestampsRequested)
61
+ throw new RimeInputError("Enable timestamps: true when creating the stream");
62
+ if (this.failure)
63
+ throw this.failure;
64
+ if (!this.finished)
65
+ throw new RimeInputError("Consume all audio before reading timestamps");
66
+ return this.call.timestampResult();
67
+ }
52
68
  start() {
53
69
  if (this.failure)
54
70
  throw this.failure;
@@ -96,7 +112,7 @@ export class AudioStream {
96
112
  async produce() {
97
113
  const source = this.source;
98
114
  let iterator;
99
- const buffer = new SentenceBuffer(policy.sentenceBytes);
115
+ let highSurrogate = "";
100
116
  let meaningful = false;
101
117
  try {
102
118
  try {
@@ -127,35 +143,39 @@ export class AudioStream {
127
143
  }
128
144
  if (result.done)
129
145
  break;
130
- const chunk = result.value;
131
- if (typeof chunk !== "string")
146
+ if (typeof result.value !== "string")
132
147
  throw new RimeInputError("The text source must yield strings");
148
+ let chunk = highSurrogate + result.value;
149
+ highSurrogate = "";
150
+ // A JavaScript source may split one Unicode character across yields.
151
+ if (/[\uD800-\uDBFF]$/.test(chunk)) {
152
+ highSurrogate = chunk.slice(-1);
153
+ chunk = chunk.slice(0, -1);
154
+ }
133
155
  if (chunk.trim())
134
156
  meaningful = true;
135
- // Never split a surrogate pair when limiting native detector input size.
157
+ // Bound wire messages without splitting a Unicode character.
136
158
  for (let offset = 0; offset < chunk.length;) {
137
159
  let end = Math.min(chunk.length, offset + policy.sourceChars);
138
160
  if (end < chunk.length && /[\uD800-\uDBFF]/.test(chunk[end - 1]))
139
161
  end++;
140
- for (const sentence of buffer.feed(chunk.slice(offset, end))) {
141
- if (!this.submitted)
142
- this.progressAt = performance.now();
143
- this.submitted = true;
144
- await this.call.write(sentence);
145
- }
162
+ const part = chunk.slice(offset, end);
163
+ if (/[\uD800-\uDFFF]/u.test(part))
164
+ throw new RimeInputError("Text must contain valid Unicode");
165
+ if (!this.submitted)
166
+ this.progressAt = performance.now();
167
+ this.submitted = true;
168
+ await this.call.write(part);
169
+ this.progressAt = performance.now();
146
170
  offset = end;
147
171
  }
148
172
  }
173
+ if (highSurrogate)
174
+ throw new RimeInputError("Text must contain valid Unicode");
149
175
  if (!meaningful)
150
176
  throw new RimeInputError("The text source contained no meaningful text");
151
- for (const sentence of buffer.feed("", true)) {
152
- if (!this.submitted)
153
- this.progressAt = performance.now();
154
- this.submitted = true;
155
- await this.call.write(sentence);
156
- }
157
- this.call.finishInput();
158
177
  this.inputDone = true;
178
+ this.call.finishInput();
159
179
  }
160
180
  catch (error) {
161
181
  if (error instanceof RimeError || this.controller.signal.aborted)
@@ -196,10 +216,9 @@ export class AudioStream {
196
216
  async run() {
197
217
  let tasks = [];
198
218
  try {
199
- await abortable(ready, this.controller.signal);
200
219
  const prepared = await this.owner.prepare(this.controller.signal);
201
220
  this.call = new SynthesisCall(prepared, this.controller.signal);
202
- await this.call.start(this.voice, this.language);
221
+ await this.call.start(this.voice, this.language, this.timestampsRequested, this.customLexicon);
203
222
  tasks = [this.produce(), this.read()];
204
223
  await Promise.all(tasks);
205
224
  this.queue.finish();
@@ -0,0 +1,24 @@
1
+ import type { SynthesisResponseTrailer } from "@rimelabs/api";
2
+ /** A spoken, normalized word with start/end seconds from synthesis start. */
3
+ export interface WordTimestamp {
4
+ readonly text: string;
5
+ readonly start: number;
6
+ readonly end: number;
7
+ }
8
+ /** Alignment's google.rpc.Code (0 means OK) and service explanation. */
9
+ export interface TimestampStatus {
10
+ readonly code: number;
11
+ readonly message: string;
12
+ }
13
+ /** Final alignment status and words. Non-OK statuses carry no spans. */
14
+ export interface TimestampResult {
15
+ readonly status: TimestampStatus;
16
+ readonly spans: readonly WordTimestamp[];
17
+ }
18
+ export declare class TimestampTrailer {
19
+ seen: boolean;
20
+ invalid: boolean;
21
+ private value;
22
+ accept(trailer: SynthesisResponseTrailer): void;
23
+ result(requestId: string | null): TimestampResult;
24
+ }
@@ -0,0 +1,46 @@
1
+ import { RimeStreamError } from "../errors.js";
2
+ export class TimestampTrailer {
3
+ seen = false;
4
+ invalid = false;
5
+ value;
6
+ accept(trailer) {
7
+ if (this.seen)
8
+ this.invalid = true;
9
+ else {
10
+ this.seen = true;
11
+ this.value = trailer.timestamps;
12
+ }
13
+ }
14
+ result(requestId) {
15
+ const malformed = () => new RimeStreamError("Invalid timestamp trailer", requestId);
16
+ if (this.invalid)
17
+ throw malformed();
18
+ const value = this.value;
19
+ if (!value)
20
+ throw new RimeStreamError("The service did not return requested timestamps", requestId);
21
+ if (!value.status || (value.status.code !== 0 && value.spans.length))
22
+ throw malformed();
23
+ const seconds = (duration) => {
24
+ if (!duration ||
25
+ duration.seconds < 0n ||
26
+ duration.seconds > 315576000000n ||
27
+ duration.nanos < 0 ||
28
+ duration.nanos >= 1000000000)
29
+ throw malformed();
30
+ return Number(duration.seconds) + duration.nanos / 1e9;
31
+ };
32
+ const spans = value.spans.map((span) => {
33
+ const start = seconds(span.start), end = seconds(span.end);
34
+ if (!span.text.trim() || end < start)
35
+ throw malformed();
36
+ return Object.freeze({ text: span.text, start, end });
37
+ });
38
+ return Object.freeze({
39
+ status: Object.freeze({
40
+ code: value.status.code,
41
+ message: value.status.message,
42
+ }),
43
+ spans: Object.freeze(spans),
44
+ });
45
+ }
46
+ }
@@ -1,6 +1,7 @@
1
1
  export { metadata } from "../grpc.js";
2
2
  export { rpcError } from "../grpc.js";
3
3
  import * as grpc from "@grpc/grpc-js";
4
+ import type { PronunciationEntry } from "./lexicon.js";
4
5
  export type Connection = grpc.Client;
5
6
  export interface PreparedConnection {
6
7
  client: Connection;
@@ -13,13 +14,16 @@ export declare const transport: {
13
14
  export declare function connect(client: grpc.Client, signal: AbortSignal): Promise<void>;
14
15
  export declare function discover(prepared: PreparedConnection, kind: DiscoveryKind, language: string | null | undefined, signal: AbortSignal): Promise<string[]>;
15
16
  export declare class SynthesisCall {
17
+ private timestampsRequested;
18
+ private readonly timestampTrailer;
16
19
  private readonly rpc;
17
20
  constructor(prepared: PreparedConnection, signal: AbortSignal);
18
21
  get requestId(): string | null;
19
22
  get done(): boolean;
20
23
  cancel(): void;
21
- start(voice: string, language: string): Promise<void>;
22
- write(sentence: string): Promise<void>;
24
+ start(voice: string, language: string, timestamps?: boolean, customLexicon?: readonly PronunciationEntry[]): Promise<void>;
25
+ timestampResult(): import("./timestamps.js").TimestampResult;
26
+ write(text: string): Promise<void>;
23
27
  finishInput(): void;
24
28
  private checkFormat;
25
29
  audio(): AsyncGenerator<Uint8Array>;
@@ -8,11 +8,12 @@ import * as schema from "@rimelabs/api";
8
8
  import { policy } from "./policy.js";
9
9
  import { abortable } from "../cancellation.js";
10
10
  import * as errors from "../errors.js";
11
+ import { TimestampTrailer } from "./timestamps.js";
11
12
  export const transport = {
12
13
  makeClient: (target) => new grpc.Client(target, grpc.credentials.createSsl(), {
13
14
  "grpc.enable_retries": 0,
14
15
  "grpc.max_receive_message_length": policy.receiveBytes,
15
- "grpc.max_send_message_length": policy.sentenceBytes + 65536,
16
+ "grpc.max_send_message_length": 131072,
16
17
  }),
17
18
  };
18
19
  export function connect(client, signal) {
@@ -21,14 +22,17 @@ export function connect(client, signal) {
21
22
  function openStream(client, auth) {
22
23
  return client.makeBidiStreamRequest("/rime.TextToSpeech/SynthesizeStreaming", serializer(schema.StreamingSynthesisRequestSchema), deserializer(schema.SynthesisResponseStreamSchema), auth);
23
24
  }
24
- function header(voice, language) {
25
+ function header(voice, language, timestamps, customLexicon) {
25
26
  return create(schema.StreamingSynthesisRequestSchema, {
26
27
  payload: {
27
28
  case: "header",
28
29
  value: create(schema.SynthesisRequestSchema, {
29
30
  speaker: voice,
30
31
  language,
32
+ splitStrategy: schema.SplitStrategy.ACCUMULATE_SENTENCE,
31
33
  audioParameters: { audioFormat: "audio/pcm", samplingRate: 24000 },
34
+ timestamps: timestamps ? { enable: true } : undefined,
35
+ customLexicon: [...customLexicon],
32
36
  }),
33
37
  },
34
38
  });
@@ -75,6 +79,8 @@ export async function discover(prepared, kind, language, signal) {
75
79
  return response.languages;
76
80
  }
77
81
  export class SynthesisCall {
82
+ timestampsRequested = false;
83
+ timestampTrailer = new TimestampTrailer();
78
84
  rpc;
79
85
  constructor(prepared, signal) {
80
86
  this.rpc = new BidiCall(openStream(prepared.client, prepared.metadata), signal);
@@ -88,11 +94,16 @@ export class SynthesisCall {
88
94
  cancel() {
89
95
  this.rpc.cancel();
90
96
  }
91
- start(voice, language) {
92
- return this.rpc.write(header(voice, language));
97
+ start(voice, language, timestamps = false, customLexicon = []) {
98
+ this.timestampsRequested = timestamps;
99
+ const message = header(voice, language, timestamps, customLexicon);
100
+ return this.rpc.write(message);
93
101
  }
94
- write(sentence) {
95
- return this.rpc.write(textMessage(sentence));
102
+ timestampResult() {
103
+ return this.timestampTrailer.result(this.requestId);
104
+ }
105
+ write(text) {
106
+ return this.rpc.write(textMessage(text));
96
107
  }
97
108
  finishInput() {
98
109
  this.rpc.finishInput();
@@ -105,8 +116,12 @@ export class SynthesisCall {
105
116
  const headers = await this.rpc.headers();
106
117
  const contentType = headers.get("x-rime-audio-content-type")[0];
107
118
  for await (const response of this.rpc.responses()) {
119
+ if (response.payload.case === "trailer" && this.timestampsRequested)
120
+ this.timestampTrailer.accept(response.payload.value);
108
121
  if (response.payload.case !== "audio")
109
122
  continue;
123
+ if (this.timestampTrailer.seen)
124
+ this.timestampTrailer.invalid = true;
110
125
  if (response.payload.value.length)
111
126
  this.checkFormat(contentType);
112
127
  yield response.payload.value;
package/docs/tts.md CHANGED
@@ -1,10 +1,18 @@
1
1
  # TTS for Node.js
2
2
 
3
- You supply text; the SDK handles sentence boundaries and streams audio back.
3
+ Send text as it becomes available; Rime automatically combines fragments into
4
+ sentences for speech. For nonblank input, ending the text stream flushes any
5
+ remaining text, even without final punctuation. Pausing the stream may delay
6
+ speech for an unfinished sentence.
7
+
8
+ If the source ends without any non-whitespace text, audio iteration rejects with
9
+ `RimeInputError`.
10
+
11
+ The SDK sends text in order with its whitespace preserved and streams audio back.
4
12
  Your application owns playback. Start with the complete WAV example in the
5
13
  [package quick start](../README.md#tts-save-speech).
6
14
 
7
- ## Complete text
15
+ ## String input
8
16
 
9
17
  Use `client.tts.synthesize(text)` for one nonblank string. It returns an audio
10
18
  stream; it does not wait for all audio to be generated. Do not await this call.
@@ -23,8 +31,8 @@ async function* text() {
23
31
  ```
24
32
 
25
33
  Use `client.tts.stream(text())` with the same file write and cleanup.
26
- The SDK handles sentence boundaries. Do not await `tts.stream()`; the first
27
- iterator read starts work. The quick start collects chunks before writing a WAV file.
34
+ Do not await `tts.stream()`; the first iterator read starts work. The quick start
35
+ collects chunks before writing a WAV file.
28
36
 
29
37
  ## Configuration
30
38
 
@@ -60,6 +68,8 @@ async iterable of strings for `stream`. Both accept the following optional setti
60
68
  | `voice` | Model's default voice | Voice name from `client.voices.list()` |
61
69
  | `language` | `"en"` | Language code |
62
70
  | `audioFormat` | `AudioFormat.PCM_24000` | Output profile, imported from `@rimelabs/sdk` |
71
+ | `timestamps` | `false` | Request final word timestamps; requires `model: "mistv3"` |
72
+ | `customLexicon` | `[]` | Array of pronunciation overrides for this request; requires Coda |
63
73
  | `timeout` | Client setting | Seconds; pass `null` to disable the overall deadline |
64
74
 
65
75
  ### Audio formats
@@ -81,6 +91,99 @@ connection and progress limits active. Discovery allows at most 10 seconds;
81
91
  a shorter supplied timeout takes precedence. Omit an operation's `timeout` or
82
92
  pass `undefined` to inherit the client setting.
83
93
 
94
+ ## Custom pronunciations (Coda)
95
+
96
+ Pass words or phrases and their space-separated X-SAMPA pronunciations:
97
+
98
+ ```javascript
99
+ import { writeFile } from "node:fs/promises";
100
+ import { Rime, RimeInputError } from "@rimelabs/sdk";
101
+
102
+ const lexicon = [{ spelling: "hello", pronunciation: 'h @ . " l oU' }];
103
+ const client = new Rime({ model: "coda", timeout: 60 });
104
+ try {
105
+ await writeFile("speech.pcm", client.tts.synthesize("Hello world.", {
106
+ language: "en",
107
+ customLexicon: lexicon,
108
+ }));
109
+ } catch (error) {
110
+ if (error instanceof RimeInputError) {
111
+ console.error(`Invalid synthesis request: ${error.message}; requestId=${error.requestId}`);
112
+ }
113
+ throw error;
114
+ } finally {
115
+ await client.close();
116
+ }
117
+ ```
118
+
119
+ TypeScript callers can import the `PronunciationEntry` type from `@rimelabs/sdk`.
120
+ The SDK copies the array and entries when `tts.synthesize()` or `tts.stream()`
121
+ is called. The same lexicon applies to the entire request, including an async
122
+ text source; subsequent requests have their own options. Omit the option or
123
+ pass an empty array for default pronunciation.
124
+
125
+ The service matches whole words or phrases case-insensitively and applies the
126
+ pronunciation after text normalization. Longest matches take precedence; the
127
+ last entry for a repeated spelling wins. Inline `pronounce(...)` directives are
128
+ not supported.
129
+
130
+ Coda accepts custom pronunciations in German, English, Spanish, French,
131
+ Italian, and Portuguese, with up to 500 entries per request. The service validates
132
+ supported languages and pronunciation rules. Mist rejects nonempty lexicons.
133
+
134
+ Malformed option types and invalid Unicode in lexicon fields throw locally.
135
+ The service rejects unsupported models or languages, oversized lexicons, and
136
+ ill-formed entries with `RimeInputError`
137
+ before producing audio. Catch it around consuming the stream. Its `message`
138
+ preserves the offending spelling and checks such as `no-primary-stress` or
139
+ `unknown-phone`, and `requestId` identifies the request. The whole request fails;
140
+ entries are never silently skipped or repaired.
141
+
142
+ ## Word timestamps (Mist v3)
143
+
144
+ Enable timestamps on a synthesis, consume all audio, then read its result:
145
+
146
+ ```javascript
147
+ import { writeFile } from "node:fs/promises";
148
+ import { Rime } from "@rimelabs/sdk";
149
+
150
+ const client = new Rime({ model: "mistv3", timeout: 60 });
151
+ try {
152
+ const audio = client.tts.synthesize("Hello world.", { timestamps: true });
153
+ await writeFile("speech.pcm", audio);
154
+ const result = await audio.timestamps();
155
+ if (result.status.code === 0) {
156
+ for (const word of result.spans) {
157
+ console.log(word.text, word.start, word.end);
158
+ }
159
+ } else {
160
+ console.log("Timestamps unavailable:", result.status.code, result.status.message);
161
+ }
162
+ } finally {
163
+ await client.close();
164
+ }
165
+ ```
166
+
167
+ `TimestampResult`, `TimestampStatus`, and `WordTimestamp` are exported types from
168
+ `@rimelabs/sdk`. The result is immutable. `spans` is an array of words with `text`,
169
+ `start`, and `end`; times are seconds from the beginning of the entire synthesis,
170
+ including when text arrives incrementally. Resampling to `MULAW_8000` does not
171
+ change these times. Words reflect normalized spoken text, so a number may become
172
+ several words. The model supplies the timings; the SDK does not estimate them.
173
+
174
+ Timestamps arrive once, after generation finishes. They are not incremental
175
+ events for live interruption handling. `timestamps()` never consumes audio or
176
+ waits for you to consume it: calling before successful iteration finishes, or
177
+ without enabling timestamps, rejects with `RimeInputError`. Results remain
178
+ accessible after a successfully consumed stream or its client is closed.
179
+
180
+ `status.code` is a numeric `google.rpc.Code`: `0` is success. Nonzero codes such as
181
+ `12` (unimplemented) or `4` (deadline exceeded) carry an explanation and no spans;
182
+ they do not fail successful audio. Missing or malformed timestamp responses reject
183
+ with `RimeStreamError` only when reading timestamps. A synthesis error or
184
+ cancellation also prevents reading a successful timestamp result. Enabling
185
+ timestamps with Coda throws `RimeInputError` before any request is sent.
186
+
84
187
  ## Discover voices and languages
85
188
 
86
189
  List voices and languages while the client is open:
@@ -129,6 +232,9 @@ Each SDK error inherits from `RimeError`:
129
232
  | `RimeCancelledError` | Operation cancelled |
130
233
  | `RimeStreamError` | Other stream or transport failure |
131
234
 
235
+ Service errors retain their diagnostic message and request ID when provided.
236
+ Use the exception type for programmatic handling; message wording may change.
237
+
132
238
  Partial audio can arrive before an error. Output is complete only after successful
133
239
  iteration. Synthesis is not retried automatically.
134
240
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rimelabs/sdk",
3
- "version": "0.1.0-alpha.12",
3
+ "version": "0.1.0-alpha.13",
4
4
  "description": "Rime streaming TTS, STT and Prism realtime SDK for Node.js",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -17,7 +17,6 @@
17
17
  "files": [
18
18
  "dist",
19
19
  "docs",
20
- "vendor",
21
20
  "LICENSE",
22
21
  "LICENSE-PRISM",
23
22
  "NOTICE-PRISM",
@@ -1,21 +0,0 @@
1
- interface BlingFire {
2
- ready: Promise<BlingFire>;
3
- _malloc(n: number): number;
4
- _free(p: number): void;
5
- _TextToSentences(input: number, length: number, output: number, capacity: number): number;
6
- HEAPU8: Uint8Array;
7
- }
8
- export declare const ready: Promise<BlingFire>;
9
- export declare class SentenceBuffer {
10
- private limit;
11
- private pending;
12
- private committed;
13
- private parts;
14
- private untilScan;
15
- private sincePunctuation;
16
- private highSurrogate;
17
- constructor(limit: number);
18
- feed(fragment: string, final?: boolean): Generator<string>;
19
- private scan;
20
- }
21
- export {};
@@ -1,142 +0,0 @@
1
- import { createRequire } from "node:module";
2
- import { RimeInputError, RimeResourceLimitError } from "../errors.js";
3
- const require = createRequire(import.meta.url);
4
- const module = require("../../vendor/blingfire.cjs");
5
- export const ready = module.ready;
6
- // These marks schedule scans. Only BlingFire decides sentence boundaries.
7
- // Keep the set and code-point counts in sync with Python's _sentences.py.
8
- const scanTriggers = new Set("\r\n.!?\u01c3\u06d4\u061f\u2024\u2026\u203c\u203d\u2048\u2049" +
9
- "\u2404\ufe52\uff0e\uff61\u3002\uff1f\uff01\u2028\u2029\u00bf\u00a1");
10
- const lookahead = 16, scanInterval = 1024, contextSize = 128;
11
- function sentenceEnds(text) {
12
- if (!text.trim())
13
- return [];
14
- const input = Buffer.from(text), capacity = input.length * 3 + 16;
15
- const source = module._malloc(input.length + 1), output = module._malloc(capacity);
16
- let normalized;
17
- try {
18
- module.HEAPU8.set(input, source);
19
- module.HEAPU8[source + input.length] = 0;
20
- const length = module._TextToSentences(source, input.length, output, capacity);
21
- if (length < 0 || length > capacity)
22
- throw new RimeInputError("Sentence detection failed");
23
- normalized = Buffer.from(module.HEAPU8.subarray(output, output + length))
24
- .toString("utf8")
25
- .replace(/\0+$/, "");
26
- }
27
- finally {
28
- module._free(source);
29
- module._free(output);
30
- }
31
- let position = 0;
32
- const ends = [];
33
- for (const sentence of normalized.split("\n")) {
34
- if (!sentence.trim())
35
- continue;
36
- for (const char of sentence) {
37
- if (/\s/u.test(char))
38
- continue;
39
- // BlingFire removes zero-width spaces, direction marks, and BOM at
40
- // boundaries. Match first to preserve marks retained inside a sentence.
41
- while (position < text.length &&
42
- text[position] !== char &&
43
- /[\s\u200b\u200e\u200f\ufeff]/u.test(text[position]))
44
- position++;
45
- const original = String.fromCodePoint(text.codePointAt(position) ?? 0);
46
- if (original !== char)
47
- throw new RimeInputError("Sentence detector could not preserve source offsets");
48
- position += char.length;
49
- }
50
- ends.push(position);
51
- }
52
- return ends;
53
- }
54
- export class SentenceBuffer {
55
- limit;
56
- pending = "";
57
- committed = 0;
58
- parts = [];
59
- untilScan = scanInterval;
60
- sincePunctuation = lookahead;
61
- highSurrogate = "";
62
- constructor(limit) {
63
- this.limit = limit;
64
- }
65
- *feed(fragment, final = false) {
66
- fragment = this.highSurrogate + fragment;
67
- this.highSurrogate = "";
68
- if (!final && /[\uD800-\uDBFF]$/.test(fragment)) {
69
- this.highSurrogate = fragment.slice(-1);
70
- fragment = fragment.slice(0, -1);
71
- }
72
- for (const char of fragment) {
73
- this.parts.push(char);
74
- this.untilScan--;
75
- this.sincePunctuation = Math.min(this.sincePunctuation + 1, lookahead);
76
- if (scanTriggers.has(char)) {
77
- this.sincePunctuation = 0;
78
- this.untilScan = Math.min(this.untilScan, lookahead);
79
- }
80
- if (this.untilScan === 0)
81
- yield* this.scan(false);
82
- }
83
- if (final)
84
- yield* this.scan(true);
85
- }
86
- *scan(final) {
87
- this.pending += this.parts.join("");
88
- this.parts = [];
89
- if (!this.pending)
90
- return;
91
- const ends = sentenceEnds(this.pending);
92
- if (final && ends.length)
93
- ends[ends.length - 1] = this.pending.length;
94
- // Retained lookahead can contain multiple separately limited sentences.
95
- let start = this.committed;
96
- for (const end of [...ends, this.pending.length]) {
97
- if (end <= start)
98
- continue;
99
- if (Buffer.byteLength(this.pending.slice(start, end)) > this.limit)
100
- throw new RimeResourceLimitError("Sentence exceeds the supported byte limit");
101
- start = end;
102
- }
103
- const committedEnds = final
104
- ? ends
105
- : ends
106
- .slice(0, -1)
107
- .filter((end) => [...this.pending.slice(end).trim()].length >= lookahead);
108
- for (const end of committedEnds) {
109
- if (end <= this.committed)
110
- continue;
111
- const sentence = this.pending.slice(this.committed, end);
112
- this.committed = end;
113
- if (sentence.trim())
114
- yield sentence;
115
- }
116
- if (final) {
117
- const residual = this.pending.slice(this.committed);
118
- if (residual.trim())
119
- yield residual;
120
- this.pending = "";
121
- this.committed = 0;
122
- this.untilScan = scanInterval;
123
- this.sincePunctuation = lookahead;
124
- return;
125
- }
126
- this.untilScan =
127
- this.sincePunctuation < lookahead ? lookahead : scanInterval;
128
- for (const end of ends) {
129
- if (this.committed < end && end < this.pending.length) {
130
- const needed = Math.max(1, lookahead - [...this.pending.slice(end).trimStart()].length);
131
- this.untilScan = Math.min(this.untilScan, needed);
132
- break;
133
- }
134
- }
135
- // Bound history by code points, without cutting a UTF-16 surrogate pair.
136
- const context = [...this.pending.slice(0, this.committed)]
137
- .slice(-contextSize)
138
- .join("");
139
- this.pending = context + this.pending.slice(this.committed);
140
- this.committed = context.length;
141
- }
142
- }
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) Microsoft Corporation. All rights reserved.
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE
package/vendor/README.md DELETED
@@ -1,11 +0,0 @@
1
- # BlingFire runtime
2
-
3
- The WASM binary and generated runtime come from Microsoft/BlingFire commit
4
- `18e9a19e586095fb60d629fa850fb610d5bca605`, under the included MIT license.
5
-
6
- `blingfire.cjs` loads the local WASM bytes, exposes initialization as a promise,
7
- and removes the generated global process exception handlers. It otherwise uses
8
- the upstream runtime. No code or model is downloaded at runtime.
9
-
10
- The SDK copies output before freeing WASM memory. It maps normalized detector
11
- output back to source text, so synthesis preserves the original text.
@@ -1,4 +0,0 @@
1
- var resolveReady, rejectReady; var ready=new Promise((resolve,reject)=>{resolveReady=resolve;rejectReady=reject}); var Module={wasmBinary:require("node:fs").readFileSync(require("node:path").join(__dirname,"blingfire.wasm")),onRuntimeInitialized:()=>resolveReady(Module),onAbort:rejectReady};
2
- var Module=typeof Module!="undefined"?Module:{};var moduleOverrides=Object.assign({},Module);var arguments_=[];var thisProgram="./this.program";var quit_=(status,toThrow)=>{throw toThrow};var ENVIRONMENT_IS_WEB=typeof window=="object";var ENVIRONMENT_IS_WORKER=typeof importScripts=="function";var ENVIRONMENT_IS_NODE=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string";var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;function logExceptionOnExit(e){if(e instanceof ExitStatus)return;let toLog=e;err("exiting due to exception: "+toLog)}var fs;var nodePath;var requireNodeFS;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}requireNodeFS=()=>{if(!nodePath){fs=require("fs");nodePath=require("path")}};read_=function shell_read(filename,binary){requireNodeFS();filename=nodePath["normalize"](filename);return fs.readFileSync(filename,binary?undefined:"utf8")};readBinary=filename=>{var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}return ret};readAsync=(filename,onload,onerror)=>{requireNodeFS();filename=nodePath["normalize"](filename);fs.readFile(filename,function(err,data){if(err)onerror(err);else onload(data.buffer)})};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!="undefined"){module["exports"]=Module}quit_=(status,toThrow)=>{if(keepRuntimeAlive()){process["exitCode"]=status;throw toThrow}logExceptionOnExit(toThrow);process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.replace(/[?#].*/,"").lastIndexOf("/")+1)}else{scriptDirectory=""}{read_=url=>{var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=url=>{var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=(url,onload,onerror)=>{var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=()=>{if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=title=>document.title=title}else{}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);Object.assign(Module,moduleOverrides);moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var tempRet0=0;var setTempRet0=value=>{tempRet0=value};var getTempRet0=()=>tempRet0;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!="object"){abort("no native wasm support detected")}var wasmMemory;var ABORT=false;var EXITSTATUS;var UTF8Decoder=typeof TextDecoder!="undefined"?new TextDecoder("utf8"):undefined;function UTF8ArrayToString(heapOrArray,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var endPtr=idx;while(heapOrArray[endPtr]&&!(endPtr>=endIdx))++endPtr;if(endPtr-idx>16&&heapOrArray.buffer&&UTF8Decoder){return UTF8Decoder.decode(heapOrArray.subarray(idx,endPtr))}else{var str="";while(idx<endPtr){var u0=heapOrArray[idx++];if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heapOrArray[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heapOrArray[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heapOrArray[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i<str.length;++i){var u=str.charCodeAt(i);if(u>=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i<str.length;++i){var u=str.charCodeAt(i);if(u>=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i<str.length;++i){HEAP8[buffer++>>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;function keepRuntimeAlive(){return noExitRuntime}function preRun(){if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;callRuntimeCallbacks(__ATINIT__)}function postRun(){if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function addRunDependency(id){runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}function abort(what){{if(Module["onAbort"]){Module["onAbort"](what)}}what="Aborted("+what+")";err(what);ABORT=true;EXITSTATUS=1;what+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile;wasmBinaryFile="blingfire.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch=="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmMemory=Module["asm"]["N"];updateGlobalBufferAndViews(wasmMemory.buffer);wasmTable=Module["asm"]["W"];addOnInit(Module["asm"]["O"]);removeRunDependency("wasm-instantiate")}addRunDependency("wasm-instantiate");function receiveInstantiationResult(result){receiveInstance(result["instance"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){return WebAssembly.instantiate(binary,info)}).then(function(instance){return instance}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming=="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&!ENVIRONMENT_IS_NODE&&typeof fetch=="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){callbacks.shift()(Module)}}var wasmTableMirror=[];function getWasmTableEntry(funcPtr){var func=wasmTableMirror[funcPtr];if(!func){if(funcPtr>=wasmTableMirror.length)wasmTableMirror.length=funcPtr+1;wasmTableMirror[funcPtr]=func=wasmTable.get(funcPtr)}return func}function ___cxa_allocate_exception(size){return _malloc(size+24)+24}var exceptionCaught=[];function exception_addRef(info){info.add_ref()}var uncaughtExceptionCount=0;function ___cxa_begin_catch(ptr){var info=new ExceptionInfo(ptr);if(!info.get_caught()){info.set_caught(true);uncaughtExceptionCount--}info.set_rethrown(false);exceptionCaught.push(info);exception_addRef(info);return info.get_exception_ptr()}var exceptionLast=0;function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-24;this.set_type=function(type){HEAPU32[this.ptr+4>>2]=type};this.get_type=function(){return HEAPU32[this.ptr+4>>2]};this.set_destructor=function(destructor){HEAPU32[this.ptr+8>>2]=destructor};this.get_destructor=function(){return HEAPU32[this.ptr+8>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+12>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+12>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+13>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+13>>0]!=0};this.init=function(type,destructor){this.set_adjusted_ptr(0);this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){var value=HEAP32[this.ptr>>2];HEAP32[this.ptr>>2]=value+1};this.release_ref=function(){var prev=HEAP32[this.ptr>>2];HEAP32[this.ptr>>2]=prev-1;return prev===1};this.set_adjusted_ptr=function(adjustedPtr){HEAPU32[this.ptr+16>>2]=adjustedPtr};this.get_adjusted_ptr=function(){return HEAPU32[this.ptr+16>>2]};this.get_exception_ptr=function(){var isPointer=___cxa_is_pointer_type(this.get_type());if(isPointer){return HEAPU32[this.excPtr>>2]}var adjusted=this.get_adjusted_ptr();if(adjusted!==0)return adjusted;return this.excPtr}}function ___cxa_free_exception(ptr){return _free(new ExceptionInfo(ptr).ptr)}function exception_decRef(info){if(info.release_ref()&&!info.get_rethrown()){var destructor=info.get_destructor();if(destructor){getWasmTableEntry(destructor)(info.excPtr)}___cxa_free_exception(info.excPtr)}}function ___cxa_end_catch(){_setThrew(0);var info=exceptionCaught.pop();exception_decRef(info);exceptionLast=0}function ___resumeException(ptr){if(!exceptionLast){exceptionLast=ptr}throw ptr}function ___cxa_find_matching_catch_2(){var thrown=exceptionLast;if(!thrown){setTempRet0(0);return 0}var info=new ExceptionInfo(thrown);info.set_adjusted_ptr(thrown);var thrownType=info.get_type();if(!thrownType){setTempRet0(0);return thrown}var typeArray=Array.prototype.slice.call(arguments);for(var i=0;i<typeArray.length;i++){var caughtType=typeArray[i];if(caughtType===0||caughtType===thrownType){break}var adjusted_ptr_addr=info.ptr+16;if(___cxa_can_catch(caughtType,thrownType,adjusted_ptr_addr)){setTempRet0(caughtType);return thrown}}setTempRet0(thrownType);return thrown}function ___cxa_find_matching_catch_3(){var thrown=exceptionLast;if(!thrown){setTempRet0(0);return 0}var info=new ExceptionInfo(thrown);info.set_adjusted_ptr(thrown);var thrownType=info.get_type();if(!thrownType){setTempRet0(0);return thrown}var typeArray=Array.prototype.slice.call(arguments);for(var i=0;i<typeArray.length;i++){var caughtType=typeArray[i];if(caughtType===0||caughtType===thrownType){break}var adjusted_ptr_addr=info.ptr+16;if(___cxa_can_catch(caughtType,thrownType,adjusted_ptr_addr)){setTempRet0(caughtType);return thrown}}setTempRet0(thrownType);return thrown}function ___cxa_rethrow(){var info=exceptionCaught.pop();if(!info){abort("no exception to throw")}var ptr=info.excPtr;if(!info.get_rethrown()){exceptionCaught.push(info);info.set_rethrown(true);info.set_caught(false);uncaughtExceptionCount++}exceptionLast=ptr;throw ptr}function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}function ___cxa_uncaught_exceptions(){return uncaughtExceptionCount}function _abort(){abort("")}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function getHeapMax(){return 2147483648}function emscripten_realloc_buffer(size){try{wasmMemory.grow(size-buffer.byteLength+65535>>>16);updateGlobalBufferAndViews(wasmMemory.buffer);return 1}catch(e){}}function _emscripten_resize_heap(requestedSize){var oldSize=HEAPU8.length;requestedSize=requestedSize>>>0;var maxHeapSize=getHeapMax();if(requestedSize>maxHeapSize){return false}let alignUp=(x,multiple)=>x+(multiple-x%multiple)%multiple;for(var cutDown=1;cutDown<=4;cutDown*=2){var overGrownHeapSize=oldSize*(1+.2/cutDown);overGrownHeapSize=Math.min(overGrownHeapSize,requestedSize+100663296);var newSize=Math.min(maxHeapSize,alignUp(Math.max(requestedSize,overGrownHeapSize),65536));var replacement=emscripten_realloc_buffer(newSize);if(replacement){return true}}return false}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){if(ENV[x]===undefined)delete env[x];else env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}var SYSCALLS={varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret}};function _environ_get(__environ,environ_buf){var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAPU32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}function _environ_sizes_get(penviron_count,penviron_buf_size){var strings=getEnvStrings();HEAPU32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAPU32[penviron_buf_size>>2]=bufSize;return 0}function _getTempRet0(){return getTempRet0()}function _setTempRet0(val){setTempRet0(val)}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value=="number"?value.toString():value||"";while(str.length<digits){str=character[0]+str}return str}function leadingNulls(value,digits){return leadingSomething(value,digits,"0")}function compareByDay(date1,date2){function sgn(value){return value<0?-1:value>0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var days=date.tm_yday+7-date.tm_wday;return leadingNulls(Math.floor(days/7),2)},"%V":function(date){var val=Math.floor((date.tm_yday+7-(date.tm_wday+6)%7)/7);if((date.tm_wday+371-date.tm_yday-2)%7<=2){val++}if(!val){val=52;var dec31=(date.tm_wday+7-date.tm_yday-1)%7;if(dec31==4||dec31==5&&__isLeapYear(date.tm_year%400-1)){val++}}else if(val==53){var jan1=(date.tm_wday+371-date.tm_yday)%7;if(jan1!=4&&(jan1!=3||!__isLeapYear(date.tm_year)))val=1}return leadingNulls(val,2)},"%w":function(date){return date.tm_wday},"%W":function(date){var days=date.tm_yday+7-(date.tm_wday+6)%7;return leadingNulls(Math.floor(days/7),2)},"%y":function(date){return(date.tm_year+1900).toString().substring(2)},"%Y":function(date){return date.tm_year+1900},"%z":function(date){var off=date.tm_gmtoff;var ahead=off>=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};pattern=pattern.replace(/%%/g,"\0\0");for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}pattern=pattern.replace(/\0\0/g,"%");var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"g":___cxa_allocate_exception,"t":___cxa_begin_catch,"w":___cxa_end_catch,"b":___cxa_find_matching_catch_2,"i":___cxa_find_matching_catch_3,"l":___cxa_free_exception,"D":___cxa_rethrow,"k":___cxa_throw,"K":___cxa_uncaught_exceptions,"e":___resumeException,"z":_abort,"M":_emscripten_memcpy_big,"L":_emscripten_resize_heap,"I":_environ_get,"J":_environ_sizes_get,"a":_getTempRet0,"A":invoke_diii,"B":invoke_fiii,"o":invoke_i,"c":invoke_ii,"d":invoke_iii,"m":invoke_iiii,"h":invoke_iiiii,"E":invoke_iiiiii,"r":invoke_iiiiiii,"C":invoke_iiiiiiii,"y":invoke_iiiiiiiiii,"v":invoke_iiiiiiiiiiii,"F":invoke_jiiii,"j":invoke_v,"n":invoke_vi,"f":invoke_vii,"p":invoke_viii,"x":invoke_viiii,"q":invoke_viiiiiii,"s":invoke_viiiiiiiiii,"u":invoke_viiiiiiiiiiiiiii,"G":_setTempRet0,"H":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["O"]).apply(null,arguments)};var _GetBlingFireTokVersion=Module["_GetBlingFireTokVersion"]=function(){return(_GetBlingFireTokVersion=Module["_GetBlingFireTokVersion"]=Module["asm"]["P"]).apply(null,arguments)};var _TextToSentences=Module["_TextToSentences"]=function(){return(_TextToSentences=Module["_TextToSentences"]=Module["asm"]["Q"]).apply(null,arguments)};var _TextToWords=Module["_TextToWords"]=function(){return(_TextToWords=Module["_TextToWords"]=Module["asm"]["R"]).apply(null,arguments)};var _WordHyphenationWithModel=Module["_WordHyphenationWithModel"]=function(){return(_WordHyphenationWithModel=Module["_WordHyphenationWithModel"]=Module["asm"]["S"]).apply(null,arguments)};var _SetModel=Module["_SetModel"]=function(){return(_SetModel=Module["_SetModel"]=Module["asm"]["T"]).apply(null,arguments)};var _TextToIds=Module["_TextToIds"]=function(){return(_TextToIds=Module["_TextToIds"]=Module["asm"]["U"]).apply(null,arguments)};var _FreeModel=Module["_FreeModel"]=function(){return(_FreeModel=Module["_FreeModel"]=Module["asm"]["V"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["X"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["Y"]).apply(null,arguments)};var _setThrew=Module["_setThrew"]=function(){return(_setThrew=Module["_setThrew"]=Module["asm"]["Z"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["_"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["$"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["aa"]).apply(null,arguments)};var ___cxa_can_catch=Module["___cxa_can_catch"]=function(){return(___cxa_can_catch=Module["___cxa_can_catch"]=Module["asm"]["ba"]).apply(null,arguments)};var ___cxa_is_pointer_type=Module["___cxa_is_pointer_type"]=function(){return(___cxa_is_pointer_type=Module["___cxa_is_pointer_type"]=Module["asm"]["ca"]).apply(null,arguments)};var dynCall_jiiii=Module["dynCall_jiiii"]=function(){return(dynCall_jiiii=Module["dynCall_jiiii"]=Module["asm"]["da"]).apply(null,arguments)};function invoke_ii(index,a1){var sp=stackSave();try{return getWasmTableEntry(index)(a1)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_v(index){var sp=stackSave();try{getWasmTableEntry(index)()}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iiiiii(index,a1,a2,a3,a4,a5){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_vi(index,a1){var sp=stackSave();try{getWasmTableEntry(index)(a1)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iiiii(index,a1,a2,a3,a4){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iiii(index,a1,a2,a3){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_vii(index,a1,a2){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iii(index,a1,a2){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iiiiiii(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viii(index,a1,a2,a3){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiii(index,a1,a2,a3,a4){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iiiiiiii(index,a1,a2,a3,a4,a5,a6,a7){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6,a7)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_fiii(index,a1,a2,a3){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_diii(index,a1,a2,a3){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_i(index){var sp=stackSave();try{return getWasmTableEntry(index)()}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiiiiii(index,a1,a2,a3,a4,a5,a6,a7){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6,a7)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiiiiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_jiiii(index,a1,a2,a3,a4){var sp=stackSave();try{return dynCall_jiiii(index,a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}Module["UTF8ToString"]=UTF8ToString;Module["stringToUTF8"]=stringToUTF8;Module["lengthBytesUTF8"]=lengthBytesUTF8;Module["stackAlloc"]=stackAlloc;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function run(args){args=args||arguments_;if(runDependencies>0){return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}run();
3
-
4
- module.exports.ready=ready;
@@ -1 +0,0 @@
1
- var Module=typeof Module!="undefined"?Module:{};var moduleOverrides=Object.assign({},Module);var arguments_=[];var thisProgram="./this.program";var quit_=(status,toThrow)=>{throw toThrow};var ENVIRONMENT_IS_WEB=typeof window=="object";var ENVIRONMENT_IS_WORKER=typeof importScripts=="function";var ENVIRONMENT_IS_NODE=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string";var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;function logExceptionOnExit(e){if(e instanceof ExitStatus)return;let toLog=e;err("exiting due to exception: "+toLog)}var fs;var nodePath;var requireNodeFS;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}requireNodeFS=()=>{if(!nodePath){fs=require("fs");nodePath=require("path")}};read_=function shell_read(filename,binary){requireNodeFS();filename=nodePath["normalize"](filename);return fs.readFileSync(filename,binary?undefined:"utf8")};readBinary=filename=>{var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}return ret};readAsync=(filename,onload,onerror)=>{requireNodeFS();filename=nodePath["normalize"](filename);fs.readFile(filename,function(err,data){if(err)onerror(err);else onload(data.buffer)})};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",function(reason){throw reason});quit_=(status,toThrow)=>{if(keepRuntimeAlive()){process["exitCode"]=status;throw toThrow}logExceptionOnExit(toThrow);process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.replace(/[?#].*/,"").lastIndexOf("/")+1)}else{scriptDirectory=""}{read_=url=>{var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=url=>{var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=(url,onload,onerror)=>{var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=()=>{if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=title=>document.title=title}else{}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);Object.assign(Module,moduleOverrides);moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var tempRet0=0;var setTempRet0=value=>{tempRet0=value};var getTempRet0=()=>tempRet0;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!="object"){abort("no native wasm support detected")}var wasmMemory;var ABORT=false;var EXITSTATUS;var UTF8Decoder=typeof TextDecoder!="undefined"?new TextDecoder("utf8"):undefined;function UTF8ArrayToString(heapOrArray,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var endPtr=idx;while(heapOrArray[endPtr]&&!(endPtr>=endIdx))++endPtr;if(endPtr-idx>16&&heapOrArray.buffer&&UTF8Decoder){return UTF8Decoder.decode(heapOrArray.subarray(idx,endPtr))}else{var str="";while(idx<endPtr){var u0=heapOrArray[idx++];if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heapOrArray[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heapOrArray[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heapOrArray[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i<str.length;++i){var u=str.charCodeAt(i);if(u>=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i<str.length;++i){var u=str.charCodeAt(i);if(u>=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i<str.length;++i){HEAP8[buffer++>>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;function keepRuntimeAlive(){return noExitRuntime}function preRun(){if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;callRuntimeCallbacks(__ATINIT__)}function postRun(){if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function addRunDependency(id){runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}function abort(what){{if(Module["onAbort"]){Module["onAbort"](what)}}what="Aborted("+what+")";err(what);ABORT=true;EXITSTATUS=1;what+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile;wasmBinaryFile="blingfire.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch=="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmMemory=Module["asm"]["N"];updateGlobalBufferAndViews(wasmMemory.buffer);wasmTable=Module["asm"]["W"];addOnInit(Module["asm"]["O"]);removeRunDependency("wasm-instantiate")}addRunDependency("wasm-instantiate");function receiveInstantiationResult(result){receiveInstance(result["instance"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){return WebAssembly.instantiate(binary,info)}).then(function(instance){return instance}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming=="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&!ENVIRONMENT_IS_NODE&&typeof fetch=="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){callbacks.shift()(Module)}}var wasmTableMirror=[];function getWasmTableEntry(funcPtr){var func=wasmTableMirror[funcPtr];if(!func){if(funcPtr>=wasmTableMirror.length)wasmTableMirror.length=funcPtr+1;wasmTableMirror[funcPtr]=func=wasmTable.get(funcPtr)}return func}function ___cxa_allocate_exception(size){return _malloc(size+24)+24}var exceptionCaught=[];function exception_addRef(info){info.add_ref()}var uncaughtExceptionCount=0;function ___cxa_begin_catch(ptr){var info=new ExceptionInfo(ptr);if(!info.get_caught()){info.set_caught(true);uncaughtExceptionCount--}info.set_rethrown(false);exceptionCaught.push(info);exception_addRef(info);return info.get_exception_ptr()}var exceptionLast=0;function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-24;this.set_type=function(type){HEAPU32[this.ptr+4>>2]=type};this.get_type=function(){return HEAPU32[this.ptr+4>>2]};this.set_destructor=function(destructor){HEAPU32[this.ptr+8>>2]=destructor};this.get_destructor=function(){return HEAPU32[this.ptr+8>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+12>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+12>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+13>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+13>>0]!=0};this.init=function(type,destructor){this.set_adjusted_ptr(0);this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){var value=HEAP32[this.ptr>>2];HEAP32[this.ptr>>2]=value+1};this.release_ref=function(){var prev=HEAP32[this.ptr>>2];HEAP32[this.ptr>>2]=prev-1;return prev===1};this.set_adjusted_ptr=function(adjustedPtr){HEAPU32[this.ptr+16>>2]=adjustedPtr};this.get_adjusted_ptr=function(){return HEAPU32[this.ptr+16>>2]};this.get_exception_ptr=function(){var isPointer=___cxa_is_pointer_type(this.get_type());if(isPointer){return HEAPU32[this.excPtr>>2]}var adjusted=this.get_adjusted_ptr();if(adjusted!==0)return adjusted;return this.excPtr}}function ___cxa_free_exception(ptr){return _free(new ExceptionInfo(ptr).ptr)}function exception_decRef(info){if(info.release_ref()&&!info.get_rethrown()){var destructor=info.get_destructor();if(destructor){getWasmTableEntry(destructor)(info.excPtr)}___cxa_free_exception(info.excPtr)}}function ___cxa_end_catch(){_setThrew(0);var info=exceptionCaught.pop();exception_decRef(info);exceptionLast=0}function ___resumeException(ptr){if(!exceptionLast){exceptionLast=ptr}throw ptr}function ___cxa_find_matching_catch_2(){var thrown=exceptionLast;if(!thrown){setTempRet0(0);return 0}var info=new ExceptionInfo(thrown);info.set_adjusted_ptr(thrown);var thrownType=info.get_type();if(!thrownType){setTempRet0(0);return thrown}var typeArray=Array.prototype.slice.call(arguments);for(var i=0;i<typeArray.length;i++){var caughtType=typeArray[i];if(caughtType===0||caughtType===thrownType){break}var adjusted_ptr_addr=info.ptr+16;if(___cxa_can_catch(caughtType,thrownType,adjusted_ptr_addr)){setTempRet0(caughtType);return thrown}}setTempRet0(thrownType);return thrown}function ___cxa_find_matching_catch_3(){var thrown=exceptionLast;if(!thrown){setTempRet0(0);return 0}var info=new ExceptionInfo(thrown);info.set_adjusted_ptr(thrown);var thrownType=info.get_type();if(!thrownType){setTempRet0(0);return thrown}var typeArray=Array.prototype.slice.call(arguments);for(var i=0;i<typeArray.length;i++){var caughtType=typeArray[i];if(caughtType===0||caughtType===thrownType){break}var adjusted_ptr_addr=info.ptr+16;if(___cxa_can_catch(caughtType,thrownType,adjusted_ptr_addr)){setTempRet0(caughtType);return thrown}}setTempRet0(thrownType);return thrown}function ___cxa_rethrow(){var info=exceptionCaught.pop();if(!info){abort("no exception to throw")}var ptr=info.excPtr;if(!info.get_rethrown()){exceptionCaught.push(info);info.set_rethrown(true);info.set_caught(false);uncaughtExceptionCount++}exceptionLast=ptr;throw ptr}function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}function ___cxa_uncaught_exceptions(){return uncaughtExceptionCount}function _abort(){abort("")}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function getHeapMax(){return 2147483648}function emscripten_realloc_buffer(size){try{wasmMemory.grow(size-buffer.byteLength+65535>>>16);updateGlobalBufferAndViews(wasmMemory.buffer);return 1}catch(e){}}function _emscripten_resize_heap(requestedSize){var oldSize=HEAPU8.length;requestedSize=requestedSize>>>0;var maxHeapSize=getHeapMax();if(requestedSize>maxHeapSize){return false}let alignUp=(x,multiple)=>x+(multiple-x%multiple)%multiple;for(var cutDown=1;cutDown<=4;cutDown*=2){var overGrownHeapSize=oldSize*(1+.2/cutDown);overGrownHeapSize=Math.min(overGrownHeapSize,requestedSize+100663296);var newSize=Math.min(maxHeapSize,alignUp(Math.max(requestedSize,overGrownHeapSize),65536));var replacement=emscripten_realloc_buffer(newSize);if(replacement){return true}}return false}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){if(ENV[x]===undefined)delete env[x];else env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}var SYSCALLS={varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret}};function _environ_get(__environ,environ_buf){var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAPU32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}function _environ_sizes_get(penviron_count,penviron_buf_size){var strings=getEnvStrings();HEAPU32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAPU32[penviron_buf_size>>2]=bufSize;return 0}function _getTempRet0(){return getTempRet0()}function _setTempRet0(val){setTempRet0(val)}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value=="number"?value.toString():value||"";while(str.length<digits){str=character[0]+str}return str}function leadingNulls(value,digits){return leadingSomething(value,digits,"0")}function compareByDay(date1,date2){function sgn(value){return value<0?-1:value>0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var days=date.tm_yday+7-date.tm_wday;return leadingNulls(Math.floor(days/7),2)},"%V":function(date){var val=Math.floor((date.tm_yday+7-(date.tm_wday+6)%7)/7);if((date.tm_wday+371-date.tm_yday-2)%7<=2){val++}if(!val){val=52;var dec31=(date.tm_wday+7-date.tm_yday-1)%7;if(dec31==4||dec31==5&&__isLeapYear(date.tm_year%400-1)){val++}}else if(val==53){var jan1=(date.tm_wday+371-date.tm_yday)%7;if(jan1!=4&&(jan1!=3||!__isLeapYear(date.tm_year)))val=1}return leadingNulls(val,2)},"%w":function(date){return date.tm_wday},"%W":function(date){var days=date.tm_yday+7-(date.tm_wday+6)%7;return leadingNulls(Math.floor(days/7),2)},"%y":function(date){return(date.tm_year+1900).toString().substring(2)},"%Y":function(date){return date.tm_year+1900},"%z":function(date){var off=date.tm_gmtoff;var ahead=off>=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};pattern=pattern.replace(/%%/g,"\0\0");for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}pattern=pattern.replace(/\0\0/g,"%");var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"g":___cxa_allocate_exception,"t":___cxa_begin_catch,"w":___cxa_end_catch,"b":___cxa_find_matching_catch_2,"i":___cxa_find_matching_catch_3,"l":___cxa_free_exception,"D":___cxa_rethrow,"k":___cxa_throw,"K":___cxa_uncaught_exceptions,"e":___resumeException,"z":_abort,"M":_emscripten_memcpy_big,"L":_emscripten_resize_heap,"I":_environ_get,"J":_environ_sizes_get,"a":_getTempRet0,"A":invoke_diii,"B":invoke_fiii,"o":invoke_i,"c":invoke_ii,"d":invoke_iii,"m":invoke_iiii,"h":invoke_iiiii,"E":invoke_iiiiii,"r":invoke_iiiiiii,"C":invoke_iiiiiiii,"y":invoke_iiiiiiiiii,"v":invoke_iiiiiiiiiiii,"F":invoke_jiiii,"j":invoke_v,"n":invoke_vi,"f":invoke_vii,"p":invoke_viii,"x":invoke_viiii,"q":invoke_viiiiiii,"s":invoke_viiiiiiiiii,"u":invoke_viiiiiiiiiiiiiii,"G":_setTempRet0,"H":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["O"]).apply(null,arguments)};var _GetBlingFireTokVersion=Module["_GetBlingFireTokVersion"]=function(){return(_GetBlingFireTokVersion=Module["_GetBlingFireTokVersion"]=Module["asm"]["P"]).apply(null,arguments)};var _TextToSentences=Module["_TextToSentences"]=function(){return(_TextToSentences=Module["_TextToSentences"]=Module["asm"]["Q"]).apply(null,arguments)};var _TextToWords=Module["_TextToWords"]=function(){return(_TextToWords=Module["_TextToWords"]=Module["asm"]["R"]).apply(null,arguments)};var _WordHyphenationWithModel=Module["_WordHyphenationWithModel"]=function(){return(_WordHyphenationWithModel=Module["_WordHyphenationWithModel"]=Module["asm"]["S"]).apply(null,arguments)};var _SetModel=Module["_SetModel"]=function(){return(_SetModel=Module["_SetModel"]=Module["asm"]["T"]).apply(null,arguments)};var _TextToIds=Module["_TextToIds"]=function(){return(_TextToIds=Module["_TextToIds"]=Module["asm"]["U"]).apply(null,arguments)};var _FreeModel=Module["_FreeModel"]=function(){return(_FreeModel=Module["_FreeModel"]=Module["asm"]["V"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["X"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["Y"]).apply(null,arguments)};var _setThrew=Module["_setThrew"]=function(){return(_setThrew=Module["_setThrew"]=Module["asm"]["Z"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["_"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["$"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["aa"]).apply(null,arguments)};var ___cxa_can_catch=Module["___cxa_can_catch"]=function(){return(___cxa_can_catch=Module["___cxa_can_catch"]=Module["asm"]["ba"]).apply(null,arguments)};var ___cxa_is_pointer_type=Module["___cxa_is_pointer_type"]=function(){return(___cxa_is_pointer_type=Module["___cxa_is_pointer_type"]=Module["asm"]["ca"]).apply(null,arguments)};var dynCall_jiiii=Module["dynCall_jiiii"]=function(){return(dynCall_jiiii=Module["dynCall_jiiii"]=Module["asm"]["da"]).apply(null,arguments)};function invoke_ii(index,a1){var sp=stackSave();try{return getWasmTableEntry(index)(a1)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_v(index){var sp=stackSave();try{getWasmTableEntry(index)()}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iiiiii(index,a1,a2,a3,a4,a5){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_vi(index,a1){var sp=stackSave();try{getWasmTableEntry(index)(a1)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iiiii(index,a1,a2,a3,a4){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iiii(index,a1,a2,a3){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_vii(index,a1,a2){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iii(index,a1,a2){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iiiiiii(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viii(index,a1,a2,a3){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiii(index,a1,a2,a3,a4){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iiiiiiii(index,a1,a2,a3,a4,a5,a6,a7){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6,a7)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_fiii(index,a1,a2,a3){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_diii(index,a1,a2,a3){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_i(index){var sp=stackSave();try{return getWasmTableEntry(index)()}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiiiiii(index,a1,a2,a3,a4,a5,a6,a7){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6,a7)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiiiiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_jiiii(index,a1,a2,a3,a4){var sp=stackSave();try{return dynCall_jiiii(index,a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}Module["UTF8ToString"]=UTF8ToString;Module["stringToUTF8"]=stringToUTF8;Module["lengthBytesUTF8"]=lengthBytesUTF8;Module["stackAlloc"]=stackAlloc;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function run(args){args=args||arguments_;if(runDependencies>0){return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}run();
Binary file