agestra 4.12.0 → 4.12.2
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/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/.gemini/commands/agestra/design.toml +1 -1
- package/README.ja.md +26 -7
- package/README.ko.md +15 -11
- package/README.md +15 -11
- package/README.zh.md +26 -7
- package/agents/agestra-team-lead.md +4 -0
- package/commands/design.md +50 -40
- package/dist/bundle.js +173 -172
- package/package.json +1 -3
- package/skills/design.md +49 -37
- package/skills/review.md +21 -15
- package/dist/sql-wasm.cjs +0 -198
- package/dist/sql-wasm.wasm +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agestra",
|
|
3
|
-
"version": "4.12.
|
|
3
|
+
"version": "4.12.2",
|
|
4
4
|
"description": "Multi-host AI orchestration toolkit for Claude Code, Codex CLI, and Gemini CLI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"packageManager": "npm@11.11.0",
|
|
@@ -15,8 +15,6 @@
|
|
|
15
15
|
},
|
|
16
16
|
"files": [
|
|
17
17
|
"dist/bundle.js",
|
|
18
|
-
"dist/sql-wasm.cjs",
|
|
19
|
-
"dist/sql-wasm.wasm",
|
|
20
18
|
".claude-plugin/",
|
|
21
19
|
".gemini/",
|
|
22
20
|
"AGENTS.md",
|
package/skills/design.md
CHANGED
|
@@ -74,49 +74,61 @@ Brownfield: modifying or extending existing code.
|
|
|
74
74
|
|
|
75
75
|
### Phase 2: Check environment and select mode
|
|
76
76
|
|
|
77
|
-
Call `environment_check` to determine available providers.
|
|
77
|
+
Call `environment_check` and `provider_list` to determine available providers.
|
|
78
78
|
|
|
79
79
|
- If **no providers are available**: proceed to Phase 3 (Explore → Propose → Refine → Document) directly using `agestra:agestra-designer` host specialist (Leader-host only).
|
|
80
80
|
- If **1+ providers are available**: proceed to consensus debate execution below.
|
|
81
81
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
**팀 구성:** `agestra:agestra-moderator` (조율) + `agestra:agestra-designer` (현재 호스트의 설계 전문 에이전트) + 사용 가능한 외부 AI (gemini, codex 등)
|
|
85
|
-
|
|
86
|
-
1. Independent work + initial aggregation:
|
|
87
|
-
|
|
88
|
-
a. In parallel:
|
|
89
|
-
- Spawn the `agestra:agestra-designer` agent for host-local independent architecture exploration.
|
|
90
|
-
After the agent completes, save the host designer's result as a document via `workspace_create_document`:
|
|
91
|
-
- **title:** `Architecture Design — host/designer`
|
|
92
|
-
- **metadata:** `{ "Provider": "host/designer", "Task": "{subject}", "Mode": "Independent" }`
|
|
93
|
-
- **content:** The designer agent's full output.
|
|
94
|
-
- For each available provider, call `ai_chat` with `save_as_document`:
|
|
95
|
-
- **save_as_document.title:** `Architecture Design — {provider}`
|
|
96
|
-
- **save_as_document.metadata:** `{ "Task": "{subject}", "Mode": "Independent" }`
|
|
97
|
-
- **prompt:** Create a complete design document for [subject]. Include: 1) Problem definition — what exactly we're solving and why. 2) Constraints and requirements — technical limits, compatibility needs, performance targets. 3) 2-3 architecture approaches — each with detailed pros/cons, component diagrams, data flow, and effort estimates. 4) Recommended approach — pick one and justify the choice. 5) Implementation plan — step-by-step build sequence with dependencies. 6) Risks and mitigations. Be thorough and detailed — this document will be debated and refined.
|
|
98
|
-
|
|
99
|
-
b. Collect all document IDs.
|
|
82
|
+
**Hard rule:** Only providers reported `Available` by `environment_check` and allowed by setup may be invoked. A provider marked `Not found`, unavailable, or disabled is an explicit opt-out. Do not probe or fall back to disabled providers.
|
|
100
83
|
|
|
101
|
-
|
|
102
|
-
- Pass the document ID list.
|
|
103
|
-
- Moderator reads each document, classifies consensus/unique/disputed approaches.
|
|
104
|
-
- Moderator creates an aggregated document. This becomes the starting document.
|
|
105
|
-
|
|
106
|
-
2. Start a turn-based debate session with `agent_debate_create`.
|
|
107
|
-
|
|
108
|
-
3. Document review rounds (no max — until all agree):
|
|
109
|
-
a. Moderator sends the current document to each AI for review.
|
|
110
|
-
b. Moderator collects all feedback and updates the working document.
|
|
111
|
-
c. If all providers agree on all sections → consensus reached.
|
|
112
|
-
d. If not → next round with the revised document.
|
|
113
|
-
e. **Every 10 rounds:** Ask the user whether to continue or stop with current state.
|
|
114
|
-
|
|
115
|
-
4. When consensus is reached, record the final synthesis with `agent_debate_conclude`.
|
|
84
|
+
### Phase 3: Execute consensus debate
|
|
116
85
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
86
|
+
**팀 구성:** `agestra:agestra-moderator` (조율) + `agestra:agestra-designer` (현재 호스트의 설계 전문 에이전트) + `environment_check`가 Available로 보고한 외부 AI (gemini, codex 등)
|
|
87
|
+
|
|
88
|
+
This workflow follows `docs/superpowers/specs/2026-04-25-structured-consensus-documents-design.md` and the command/prompt alignment rules from `docs/superpowers/plans/2026-04-25-json-ledger-consensus-implementation-plan.md`.
|
|
89
|
+
|
|
90
|
+
Every generated artifact has a fixed role:
|
|
91
|
+
|
|
92
|
+
| Phase | `kind` | Folder | Role |
|
|
93
|
+
|-------|--------|--------|------|
|
|
94
|
+
| Individual design exploration | `"individual"` | `individual/` | Raw first-pass source material from each provider |
|
|
95
|
+
| Consensus ledger + debate mirror | `"debate"` | `debates/` | JSON consensus ledger is authoritative; debate Markdown is generated from it |
|
|
96
|
+
| Final design decision | `"synthesis"` | `synthesis/` | Self-contained final design document, written after leader approval |
|
|
97
|
+
|
|
98
|
+
The JSON consensus ledger is the source of truth. Markdown is a readable artifact only. Do not parse generated Markdown as state and do not hand-edit it to change provider stances, item status, or consensus state.
|
|
99
|
+
|
|
100
|
+
1. Start an approval-gated structured debate with `agent_debate_structured`.
|
|
101
|
+
- **topic:** the design subject.
|
|
102
|
+
- **participants:** only providers reported available by `environment_check` / `provider_list`, plus the host design specialist when the engine supports it.
|
|
103
|
+
- **scope:** the design subject, user constraints, relevant code areas, and any related existing design docs.
|
|
104
|
+
- **leader:** the current leader identity when known.
|
|
105
|
+
- **locale:** the setup locale when known.
|
|
106
|
+
- **individual_review_prompt:** ask every participant to produce a complete design document covering:
|
|
107
|
+
1. Problem definition — what exactly is being solved and why.
|
|
108
|
+
2. Constraints and requirements — technical limits, compatibility needs, performance targets.
|
|
109
|
+
3. 2-3 architecture approaches — pros/cons, component boundaries, data flow, and effort estimate.
|
|
110
|
+
4. Recommended approach — one choice with justification.
|
|
111
|
+
5. Implementation plan — step-by-step build sequence with dependencies.
|
|
112
|
+
6. Risks and mitigations.
|
|
113
|
+
|
|
114
|
+
2. Let the MCP moderator engine own the consensus flow.
|
|
115
|
+
- The engine creates one individual first-pass document per participant under `individual/`.
|
|
116
|
+
- The engine owns provider turn order, JSON turn packets, response validation, ledger updates, aggregated debate Markdown rendering, synthesis rendering, and the final terminal table.
|
|
117
|
+
- Participants submit explicit JSON stances through the MCP consensus turn packet.
|
|
118
|
+
- The leader/moderator must not infer agreement from prose, must not vote, and must not edit provider stances manually.
|
|
119
|
+
- There must be exactly one generated aggregated debate Markdown document per workflow run, not one Markdown document per provider turn or round.
|
|
120
|
+
|
|
121
|
+
3. Use the approval gate.
|
|
122
|
+
- If the result is `ready-for-approval`, inspect the terminal report and call exactly one:
|
|
123
|
+
- `agent_debate_approve` to write the synthesis document.
|
|
124
|
+
- `agent_debate_continue` to run 3, 5, or 10 additional rounds.
|
|
125
|
+
- `agent_debate_reject` to close without synthesis.
|
|
126
|
+
- If the result is `error`, report the orchestration failure and do not approve.
|
|
127
|
+
|
|
128
|
+
4. Present the result to the user.
|
|
129
|
+
- Name the individual document paths when surfaced, debate Markdown path, consensus JSON ledger path, approval snapshot path if surfaced, and synthesis path if approved.
|
|
130
|
+
- Summarize accepted design decisions, excluded options, and unresolved/disputed items.
|
|
131
|
+
- Preserve each provider's rationale for disputed positions.
|
|
120
132
|
|
|
121
133
|
### Phase 4: Design process (Leader-host-only mode)
|
|
122
134
|
|
package/skills/review.md
CHANGED
|
@@ -66,7 +66,7 @@ Call `environment_check` to determine available providers.
|
|
|
66
66
|
- Exclude `ollama` from review workflows. Use only review-capable external providers (gemini, codex, registered host-backed reviewers).
|
|
67
67
|
- Treat the host reviewer agent as asynchronous work that may take several minutes. Poll about once per minute.
|
|
68
68
|
- Do NOT stop or replace the host reviewer unless there is an explicit error, user cancellation, or no visible progress for 8+ minutes.
|
|
69
|
-
-
|
|
69
|
+
- Use the approval-gated structured flow (`agent_debate_structured` + `agent_debate_approve`/`_continue`/`_reject`) so the MCP server owns provider turns, JSON consensus validation, durable ledger persistence, generated debate markdown, and final synthesis. Do not invoke the legacy `agent_debate_create`/`_turn`/`_conclude` primitives for review consensus — they are diagnostic-only per `skills/leader.md:159-161`.
|
|
70
70
|
|
|
71
71
|
**팀 구성:** `agestra:agestra-moderator` (조율) + `agestra:agestra-reviewer` (현재 호스트의 리뷰 전문 에이전트) + 리뷰용 외부 AI (gemini, codex 등; ollama 제외)
|
|
72
72
|
|
|
@@ -91,20 +91,26 @@ Call `environment_check` to determine available providers.
|
|
|
91
91
|
- Moderator creates an aggregated document via `workspace_create_document`.
|
|
92
92
|
- The moderator's integrated document becomes the starting document.
|
|
93
93
|
|
|
94
|
-
2. Start a
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
-
|
|
107
|
-
-
|
|
94
|
+
2. Start a structured debate session with `agent_debate_structured`.
|
|
95
|
+
- Use the integrated document's title/topic as the debate topic.
|
|
96
|
+
- Reuse the same reviewer set from step 1, excluding `ollama`.
|
|
97
|
+
- Pass the independent document IDs as source context when available.
|
|
98
|
+
|
|
99
|
+
3. Let the MCP moderator engine run the consensus loop.
|
|
100
|
+
- The engine assigns stable `ITEM-*` IDs, builds `{sessionId}.consensus.json`, and sends each provider a JSON turn packet.
|
|
101
|
+
- Every active provider must answer every assigned item with exactly one structured stance: `agree`, `disagree`, `opinion`, or `revise`.
|
|
102
|
+
- The engine retries malformed JSON once, records non-responses explicitly, and removes unavailable providers from the active participant set with a moderator note.
|
|
103
|
+
- The engine regenerates the aggregate debate markdown from the JSON ledger. Do not hand-edit the generated markdown to change consensus state.
|
|
104
|
+
|
|
105
|
+
4. Use the approval gate.
|
|
106
|
+
- If the terminal report says the session is `ready-for-approval`, call `agent_debate_approve` to write the synthesis.
|
|
107
|
+
- If more discussion is needed, call `agent_debate_continue`.
|
|
108
|
+
- If the result should be closed without synthesis, call `agent_debate_reject`.
|
|
109
|
+
|
|
110
|
+
5. Present the final result:
|
|
111
|
+
- Link the debate markdown, consensus JSON ledger, and synthesis document if created.
|
|
112
|
+
- Show the terminal consensus table in chat.
|
|
113
|
+
- Explain accepted, excluded, and still-open items in plain language.
|
|
108
114
|
|
|
109
115
|
### Phase 5: TRUST 5 Quality Gate
|
|
110
116
|
|
package/dist/sql-wasm.cjs
DELETED
|
@@ -1,198 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
// We are modularizing this manually because the current modularize setting in Emscripten has some issues:
|
|
3
|
-
// https://github.com/kripken/emscripten/issues/5820
|
|
4
|
-
// In addition, When you use emcc's modularization, it still expects to export a global object called `Module`,
|
|
5
|
-
// which is able to be used/called before the WASM is loaded.
|
|
6
|
-
// The modularization below exports a promise that loads and resolves to the actual sql.js module.
|
|
7
|
-
// That way, this module can't be used before the WASM is finished loading.
|
|
8
|
-
|
|
9
|
-
// We are going to define a function that a user will call to start loading initializing our Sql.js library
|
|
10
|
-
// However, that function might be called multiple times, and on subsequent calls, we don't actually want it to instantiate a new instance of the Module
|
|
11
|
-
// Instead, we want to return the previously loaded module
|
|
12
|
-
|
|
13
|
-
// TODO: Make this not declare a global if used in the browser
|
|
14
|
-
var initSqlJsPromise = undefined;
|
|
15
|
-
|
|
16
|
-
var initSqlJs = function (moduleConfig) {
|
|
17
|
-
|
|
18
|
-
if (initSqlJsPromise){
|
|
19
|
-
return initSqlJsPromise;
|
|
20
|
-
}
|
|
21
|
-
// If we're here, we've never called this function before
|
|
22
|
-
initSqlJsPromise = new Promise(function (resolveModule, reject) {
|
|
23
|
-
|
|
24
|
-
// We are modularizing this manually because the current modularize setting in Emscripten has some issues:
|
|
25
|
-
// https://github.com/kripken/emscripten/issues/5820
|
|
26
|
-
|
|
27
|
-
// The way to affect the loading of emcc compiled modules is to create a variable called `Module` and add
|
|
28
|
-
// properties to it, like `preRun`, `postRun`, etc
|
|
29
|
-
// We are using that to get notified when the WASM has finished loading.
|
|
30
|
-
// Only then will we return our promise
|
|
31
|
-
|
|
32
|
-
// If they passed in a moduleConfig object, use that
|
|
33
|
-
// Otherwise, initialize Module to the empty object
|
|
34
|
-
var Module = typeof moduleConfig !== 'undefined' ? moduleConfig : {};
|
|
35
|
-
|
|
36
|
-
// EMCC only allows for a single onAbort function (not an array of functions)
|
|
37
|
-
// So if the user defined their own onAbort function, we remember it and call it
|
|
38
|
-
var originalOnAbortFunction = Module['onAbort'];
|
|
39
|
-
Module['onAbort'] = function (errorThatCausedAbort) {
|
|
40
|
-
reject(new Error(errorThatCausedAbort));
|
|
41
|
-
if (originalOnAbortFunction){
|
|
42
|
-
originalOnAbortFunction(errorThatCausedAbort);
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
Module['postRun'] = Module['postRun'] || [];
|
|
47
|
-
Module['postRun'].push(function () {
|
|
48
|
-
// When Emscripted calls postRun, this promise resolves with the built Module
|
|
49
|
-
resolveModule(Module);
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
// There is a section of code in the emcc-generated code below that looks like this:
|
|
53
|
-
// (Note that this is lowercase `module`)
|
|
54
|
-
// if (typeof module !== 'undefined') {
|
|
55
|
-
// module['exports'] = Module;
|
|
56
|
-
// }
|
|
57
|
-
// When that runs, it's going to overwrite our own modularization export efforts in shell-post.js!
|
|
58
|
-
// The only way to tell emcc not to emit it is to pass the MODULARIZE=1 or MODULARIZE_INSTANCE=1 flags,
|
|
59
|
-
// but that carries with it additional unnecessary baggage/bugs we don't want either.
|
|
60
|
-
// So, we have three options:
|
|
61
|
-
// 1) We undefine `module`
|
|
62
|
-
// 2) We remember what `module['exports']` was at the beginning of this function and we restore it later
|
|
63
|
-
// 3) We write a script to remove those lines of code as part of the Make process.
|
|
64
|
-
//
|
|
65
|
-
// Since those are the only lines of code that care about module, we will undefine it. It's the most straightforward
|
|
66
|
-
// of the options, and has the side effect of reducing emcc's efforts to modify the module if its output were to change in the future.
|
|
67
|
-
// That's a nice side effect since we're handling the modularization efforts ourselves
|
|
68
|
-
module = undefined;
|
|
69
|
-
|
|
70
|
-
// The emcc-generated code and shell-post.js code goes below,
|
|
71
|
-
// meaning that all of it runs inside of this promise. If anything throws an exception, our promise will abort
|
|
72
|
-
|
|
73
|
-
var e;e||(e=typeof Module !== 'undefined' ? Module : {});"use strict";
|
|
74
|
-
e.onRuntimeInitialized=function(){function a(g,m){switch(typeof m){case "boolean":gc(g,m?1:0);break;case "number":hc(g,m);break;case "string":ic(g,m,-1,-1);break;case "object":if(null===m)ib(g);else if(null!=m.length){var n=aa(m.length);ba(m,n);jc(g,n,m.length,-1);ca(n)}else xa(g,"Wrong API use : tried to return a value of an unknown type ("+m+").",-1);break;default:ib(g)}}function b(g,m){for(var n=[],p=0;p<g;p+=1){var v=l(m+4*p,"i32"),y=kc(v);if(1===y||2===y)v=lc(v);else if(3===y)v=mc(v);else if(4===
|
|
75
|
-
y){y=v;v=nc(y);y=oc(y);for(var J=new Uint8Array(v),H=0;H<v;H+=1)J[H]=r[y+H];v=J}else v=null;n.push(v)}return n}function c(g,m){this.Ma=g;this.db=m;this.Ka=1;this.hb=[]}function d(g,m){this.db=m;this.$a=da(g);if(null===this.$a)throw Error("Unable to allocate memory for the SQL string");this.gb=this.$a;this.Wa=this.kb=null}function f(g){this.filename="dbfile_"+(4294967295*Math.random()>>>0);if(null!=g){var m=this.filename,n="/",p=m;n&&(n="string"==typeof n?n:ea(n),p=m?t(n+"/"+m):n);m=fa(!0,!0);p=ha(p,
|
|
76
|
-
(void 0!==m?m:438)&4095|32768,0);if(g){if("string"==typeof g){n=Array(g.length);for(var v=0,y=g.length;v<y;++v)n[v]=g.charCodeAt(v);g=n}ia(p,m|146);n=ja(p,577);ka(n,g,0,g.length,0);la(n);ia(p,m)}}this.handleError(q(this.filename,h));this.db=l(h,"i32");lb(this.db);this.ab={};this.Oa={}}var h=u(4),k=e.cwrap,q=k("sqlite3_open","number",["string","number"]),w=k("sqlite3_close_v2","number",["number"]),x=k("sqlite3_exec","number",["number","string","number","number","number"]),z=k("sqlite3_changes","number",
|
|
77
|
-
["number"]),Q=k("sqlite3_prepare_v2","number",["number","string","number","number","number"]),mb=k("sqlite3_sql","string",["number"]),pc=k("sqlite3_normalized_sql","string",["number"]),nb=k("sqlite3_prepare_v2","number",["number","number","number","number","number"]),qc=k("sqlite3_bind_text","number",["number","number","number","number","number"]),ob=k("sqlite3_bind_blob","number",["number","number","number","number","number"]),rc=k("sqlite3_bind_double","number",["number","number","number"]),sc=
|
|
78
|
-
k("sqlite3_bind_int","number",["number","number","number"]),tc=k("sqlite3_bind_parameter_index","number",["number","string"]),uc=k("sqlite3_step","number",["number"]),vc=k("sqlite3_errmsg","string",["number"]),wc=k("sqlite3_column_count","number",["number"]),xc=k("sqlite3_data_count","number",["number"]),yc=k("sqlite3_column_double","number",["number","number"]),pb=k("sqlite3_column_text","string",["number","number"]),zc=k("sqlite3_column_blob","number",["number","number"]),Ac=k("sqlite3_column_bytes",
|
|
79
|
-
"number",["number","number"]),Bc=k("sqlite3_column_type","number",["number","number"]),Cc=k("sqlite3_column_name","string",["number","number"]),Dc=k("sqlite3_reset","number",["number"]),Ec=k("sqlite3_clear_bindings","number",["number"]),Fc=k("sqlite3_finalize","number",["number"]),qb=k("sqlite3_create_function_v2","number","number string number number number number number number number".split(" ")),kc=k("sqlite3_value_type","number",["number"]),nc=k("sqlite3_value_bytes","number",["number"]),mc=k("sqlite3_value_text",
|
|
80
|
-
"string",["number"]),oc=k("sqlite3_value_blob","number",["number"]),lc=k("sqlite3_value_double","number",["number"]),hc=k("sqlite3_result_double","",["number","number"]),ib=k("sqlite3_result_null","",["number"]),ic=k("sqlite3_result_text","",["number","string","number","number"]),jc=k("sqlite3_result_blob","",["number","number","number","number"]),gc=k("sqlite3_result_int","",["number","number"]),xa=k("sqlite3_result_error","",["number","string","number"]),rb=k("sqlite3_aggregate_context","number",
|
|
81
|
-
["number","number"]),lb=k("RegisterExtensionFunctions","number",["number"]),sb=k("sqlite3_update_hook","number",["number","number","number"]);c.prototype.bind=function(g){if(!this.Ma)throw"Statement closed";this.reset();return Array.isArray(g)?this.zb(g):null!=g&&"object"===typeof g?this.Ab(g):!0};c.prototype.step=function(){if(!this.Ma)throw"Statement closed";this.Ka=1;var g=uc(this.Ma);switch(g){case 100:return!0;case 101:return!1;default:throw this.db.handleError(g);}};c.prototype.ub=function(g){null==
|
|
82
|
-
g&&(g=this.Ka,this.Ka+=1);return yc(this.Ma,g)};c.prototype.Db=function(g){null==g&&(g=this.Ka,this.Ka+=1);g=pb(this.Ma,g);if("function"!==typeof BigInt)throw Error("BigInt is not supported");return BigInt(g)};c.prototype.Eb=function(g){null==g&&(g=this.Ka,this.Ka+=1);return pb(this.Ma,g)};c.prototype.getBlob=function(g){null==g&&(g=this.Ka,this.Ka+=1);var m=Ac(this.Ma,g);g=zc(this.Ma,g);for(var n=new Uint8Array(m),p=0;p<m;p+=1)n[p]=r[g+p];return n};c.prototype.get=function(g,m){m=m||{};null!=g&&
|
|
83
|
-
this.bind(g)&&this.step();g=[];for(var n=xc(this.Ma),p=0;p<n;p+=1)switch(Bc(this.Ma,p)){case 1:var v=m.useBigInt?this.Db(p):this.ub(p);g.push(v);break;case 2:g.push(this.ub(p));break;case 3:g.push(this.Eb(p));break;case 4:g.push(this.getBlob(p));break;default:g.push(null)}return g};c.prototype.getColumnNames=function(){for(var g=[],m=wc(this.Ma),n=0;n<m;n+=1)g.push(Cc(this.Ma,n));return g};c.prototype.getAsObject=function(g,m){g=this.get(g,m);m=this.getColumnNames();for(var n={},p=0;p<m.length;p+=
|
|
84
|
-
1)n[m[p]]=g[p];return n};c.prototype.getSQL=function(){return mb(this.Ma)};c.prototype.getNormalizedSQL=function(){return pc(this.Ma)};c.prototype.run=function(g){null!=g&&this.bind(g);this.step();return this.reset()};c.prototype.pb=function(g,m){null==m&&(m=this.Ka,this.Ka+=1);g=da(g);this.hb.push(g);this.db.handleError(qc(this.Ma,m,g,-1,0))};c.prototype.yb=function(g,m){null==m&&(m=this.Ka,this.Ka+=1);var n=aa(g.length);ba(g,n);this.hb.push(n);this.db.handleError(ob(this.Ma,m,n,g.length,0))};c.prototype.ob=
|
|
85
|
-
function(g,m){null==m&&(m=this.Ka,this.Ka+=1);this.db.handleError((g===(g|0)?sc:rc)(this.Ma,m,g))};c.prototype.Bb=function(g){null==g&&(g=this.Ka,this.Ka+=1);ob(this.Ma,g,0,0,0)};c.prototype.qb=function(g,m){null==m&&(m=this.Ka,this.Ka+=1);switch(typeof g){case "string":this.pb(g,m);return;case "number":this.ob(g,m);return;case "bigint":this.pb(g.toString(),m);return;case "boolean":this.ob(g+0,m);return;case "object":if(null===g){this.Bb(m);return}if(null!=g.length){this.yb(g,m);return}}throw"Wrong API use : tried to bind a value of an unknown type ("+
|
|
86
|
-
g+").";};c.prototype.Ab=function(g){var m=this;Object.keys(g).forEach(function(n){var p=tc(m.Ma,n);0!==p&&m.qb(g[n],p)});return!0};c.prototype.zb=function(g){for(var m=0;m<g.length;m+=1)this.qb(g[m],m+1);return!0};c.prototype.reset=function(){this.freemem();return 0===Ec(this.Ma)&&0===Dc(this.Ma)};c.prototype.freemem=function(){for(var g;void 0!==(g=this.hb.pop());)ca(g)};c.prototype.free=function(){this.freemem();var g=0===Fc(this.Ma);delete this.db.ab[this.Ma];this.Ma=0;return g};d.prototype.next=
|
|
87
|
-
function(){if(null===this.$a)return{done:!0};null!==this.Wa&&(this.Wa.free(),this.Wa=null);if(!this.db.db)throw this.ib(),Error("Database closed");var g=ma(),m=u(4);na(h);na(m);try{this.db.handleError(nb(this.db.db,this.gb,-1,h,m));this.gb=l(m,"i32");var n=l(h,"i32");if(0===n)return this.ib(),{done:!0};this.Wa=new c(n,this.db);this.db.ab[n]=this.Wa;return{value:this.Wa,done:!1}}catch(p){throw this.kb=A(this.gb),this.ib(),p;}finally{oa(g)}};d.prototype.ib=function(){ca(this.$a);this.$a=null};d.prototype.getRemainingSQL=
|
|
88
|
-
function(){return null!==this.kb?this.kb:A(this.gb)};"function"===typeof Symbol&&"symbol"===typeof Symbol.iterator&&(d.prototype[Symbol.iterator]=function(){return this});f.prototype.run=function(g,m){if(!this.db)throw"Database closed";if(m){g=this.prepare(g,m);try{g.step()}finally{g.free()}}else this.handleError(x(this.db,g,0,0,h));return this};f.prototype.exec=function(g,m,n){if(!this.db)throw"Database closed";var p=null,v=null,y=null;try{y=v=da(g);var J=u(4);for(g=[];0!==l(y,"i8");){na(h);na(J);
|
|
89
|
-
this.handleError(nb(this.db,y,-1,h,J));var H=l(h,"i32");y=l(J,"i32");if(0!==H){var G=null;p=new c(H,this);for(null!=m&&p.bind(m);p.step();)null===G&&(G={columns:p.getColumnNames(),values:[]},g.push(G)),G.values.push(p.get(null,n));p.free()}}return g}catch(K){throw p&&p.free(),K;}finally{v&&ca(v)}};f.prototype.each=function(g,m,n,p,v){"function"===typeof m&&(p=n,n=m,m=void 0);g=this.prepare(g,m);try{for(;g.step();)n(g.getAsObject(null,v))}finally{g.free()}if("function"===typeof p)return p()};f.prototype.prepare=
|
|
90
|
-
function(g,m){na(h);this.handleError(Q(this.db,g,-1,h,0));g=l(h,"i32");if(0===g)throw"Nothing to prepare";var n=new c(g,this);null!=m&&n.bind(m);return this.ab[g]=n};f.prototype.iterateStatements=function(g){return new d(g,this)};f.prototype["export"]=function(){Object.values(this.ab).forEach(function(m){m.free()});Object.values(this.Oa).forEach(B);this.Oa={};this.handleError(w(this.db));var g=pa(this.filename);this.handleError(q(this.filename,h));this.db=l(h,"i32");lb(this.db);return g};f.prototype.close=
|
|
91
|
-
function(){null!==this.db&&(Object.values(this.ab).forEach(function(g){g.free()}),Object.values(this.Oa).forEach(B),this.Oa={},this.Va&&(B(this.Va),this.Va=void 0),this.handleError(w(this.db)),qa("/"+this.filename),this.db=null)};f.prototype.handleError=function(g){if(0===g)return null;g=vc(this.db);throw Error(g);};f.prototype.getRowsModified=function(){return z(this.db)};f.prototype.create_function=function(g,m){Object.prototype.hasOwnProperty.call(this.Oa,g)&&(B(this.Oa[g]),delete this.Oa[g]);
|
|
92
|
-
var n=ra(function(p,v,y){v=b(v,y);try{var J=m.apply(null,v)}catch(H){xa(p,H,-1);return}a(p,J)},"viii");this.Oa[g]=n;this.handleError(qb(this.db,g,m.length,1,0,n,0,0,0));return this};f.prototype.create_aggregate=function(g,m){var n=m.init||function(){return null},p=m.finalize||function(G){return G},v=m.step;if(!v)throw"An aggregate function must have a step function in "+g;var y={};Object.hasOwnProperty.call(this.Oa,g)&&(B(this.Oa[g]),delete this.Oa[g]);m=g+"__finalize";Object.hasOwnProperty.call(this.Oa,
|
|
93
|
-
m)&&(B(this.Oa[m]),delete this.Oa[m]);var J=ra(function(G,K,Pa){var Z=rb(G,1);Object.hasOwnProperty.call(y,Z)||(y[Z]=n());K=b(K,Pa);K=[y[Z]].concat(K);try{y[Z]=v.apply(null,K)}catch(Hc){delete y[Z],xa(G,Hc,-1)}},"viii"),H=ra(function(G){var K=rb(G,1);try{var Pa=p(y[K])}catch(Z){delete y[K];xa(G,Z,-1);return}a(G,Pa);delete y[K]},"vi");this.Oa[g]=J;this.Oa[m]=H;this.handleError(qb(this.db,g,v.length-1,1,0,0,J,H,0));return this};f.prototype.updateHook=function(g){this.Va&&(sb(this.db,0,0),B(this.Va),
|
|
94
|
-
this.Va=void 0);if(!g)return this;this.Va=ra(function(m,n,p,v,y){switch(n){case 18:m="insert";break;case 23:m="update";break;case 9:m="delete";break;default:throw"unknown operationCode in updateHook callback: "+n;}p=A(p);v=A(v);if(y>Number.MAX_SAFE_INTEGER)throw"rowId too big to fit inside a Number";g(m,p,v,Number(y))},"viiiij");sb(this.db,this.Va,0);return this};e.Database=f};
|
|
95
|
-
var sa=Object.assign({},e),ta="./this.program",ua="object"==typeof window,va="function"==typeof importScripts,wa="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,C="",ya,za,Aa;
|
|
96
|
-
if(wa){var fs=require("fs"),Ba=require("path");C=va?Ba.dirname(C)+"/":__dirname+"/";ya=(a,b)=>{a=a.startsWith("file://")?new URL(a):Ba.normalize(a);return fs.readFileSync(a,b?void 0:"utf8")};Aa=a=>{a=ya(a,!0);a.buffer||(a=new Uint8Array(a));return a};za=(a,b,c)=>{a=a.startsWith("file://")?new URL(a):Ba.normalize(a);fs.readFile(a,function(d,f){d?c(d):b(f.buffer)})};1<process.argv.length&&(ta=process.argv[1].replace(/\\/g,"/"));process.argv.slice(2);"undefined"!=typeof module&&(module.exports=e);e.inspect=
|
|
97
|
-
function(){return"[Emscripten Module object]"}}else if(ua||va)va?C=self.location.href:"undefined"!=typeof document&&document.currentScript&&(C=document.currentScript.src),C=0!==C.indexOf("blob:")?C.substr(0,C.replace(/[?#].*/,"").lastIndexOf("/")+1):"",ya=a=>{var b=new XMLHttpRequest;b.open("GET",a,!1);b.send(null);return b.responseText},va&&(Aa=a=>{var b=new XMLHttpRequest;b.open("GET",a,!1);b.responseType="arraybuffer";b.send(null);return new Uint8Array(b.response)}),za=(a,b,c)=>{var d=new XMLHttpRequest;
|
|
98
|
-
d.open("GET",a,!0);d.responseType="arraybuffer";d.onload=()=>{200==d.status||0==d.status&&d.response?b(d.response):c()};d.onerror=c;d.send(null)};var Ca=e.print||console.log.bind(console),Da=e.printErr||console.warn.bind(console);Object.assign(e,sa);sa=null;e.thisProgram&&(ta=e.thisProgram);var Ea;e.wasmBinary&&(Ea=e.wasmBinary);var noExitRuntime=e.noExitRuntime||!0;"object"!=typeof WebAssembly&&D("no native wasm support detected");
|
|
99
|
-
var Fa,Ga=!1,Ha="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;
|
|
100
|
-
function Ia(a,b,c){var d=b+c;for(c=b;a[c]&&!(c>=d);)++c;if(16<c-b&&a.buffer&&Ha)return Ha.decode(a.subarray(b,c));for(d="";b<c;){var f=a[b++];if(f&128){var h=a[b++]&63;if(192==(f&224))d+=String.fromCharCode((f&31)<<6|h);else{var k=a[b++]&63;f=224==(f&240)?(f&15)<<12|h<<6|k:(f&7)<<18|h<<12|k<<6|a[b++]&63;65536>f?d+=String.fromCharCode(f):(f-=65536,d+=String.fromCharCode(55296|f>>10,56320|f&1023))}}else d+=String.fromCharCode(f)}return d}function A(a,b){return a?Ia(E,a,b):""}
|
|
101
|
-
function Ja(a,b,c,d){if(!(0<d))return 0;var f=c;d=c+d-1;for(var h=0;h<a.length;++h){var k=a.charCodeAt(h);if(55296<=k&&57343>=k){var q=a.charCodeAt(++h);k=65536+((k&1023)<<10)|q&1023}if(127>=k){if(c>=d)break;b[c++]=k}else{if(2047>=k){if(c+1>=d)break;b[c++]=192|k>>6}else{if(65535>=k){if(c+2>=d)break;b[c++]=224|k>>12}else{if(c+3>=d)break;b[c++]=240|k>>18;b[c++]=128|k>>12&63}b[c++]=128|k>>6&63}b[c++]=128|k&63}}b[c]=0;return c-f}
|
|
102
|
-
function Ka(a){for(var b=0,c=0;c<a.length;++c){var d=a.charCodeAt(c);127>=d?b++:2047>=d?b+=2:55296<=d&&57343>=d?(b+=4,++c):b+=3}return b}var La,r,E,Ma,F,I,Na,Oa;function Qa(){var a=Fa.buffer;La=a;e.HEAP8=r=new Int8Array(a);e.HEAP16=Ma=new Int16Array(a);e.HEAP32=F=new Int32Array(a);e.HEAPU8=E=new Uint8Array(a);e.HEAPU16=new Uint16Array(a);e.HEAPU32=I=new Uint32Array(a);e.HEAPF32=Na=new Float32Array(a);e.HEAPF64=Oa=new Float64Array(a)}var L,Ra=[],Sa=[],Ta=[];
|
|
103
|
-
function Ua(){var a=e.preRun.shift();Ra.unshift(a)}var Va=0,Wa=null,Xa=null;function D(a){if(e.onAbort)e.onAbort(a);a="Aborted("+a+")";Da(a);Ga=!0;throw new WebAssembly.RuntimeError(a+". Build with -sASSERTIONS for more info.");}function Ya(){return M.startsWith("data:application/octet-stream;base64,")}var M;M="sql-wasm.wasm";if(!Ya()){var Za=M;M=e.locateFile?e.locateFile(Za,C):C+Za}
|
|
104
|
-
function $a(){var a=M;try{if(a==M&&Ea)return new Uint8Array(Ea);if(Aa)return Aa(a);throw"both async and sync fetching of the wasm failed";}catch(b){D(b)}}
|
|
105
|
-
function ab(){if(!Ea&&(ua||va)){if("function"==typeof fetch&&!M.startsWith("file://"))return fetch(M,{credentials:"same-origin"}).then(function(a){if(!a.ok)throw"failed to load wasm binary file at '"+M+"'";return a.arrayBuffer()}).catch(function(){return $a()});if(za)return new Promise(function(a,b){za(M,function(c){a(new Uint8Array(c))},b)})}return Promise.resolve().then(function(){return $a()})}var N,O;function bb(a){for(;0<a.length;)a.shift()(e)}
|
|
106
|
-
function l(a,b="i8"){b.endsWith("*")&&(b="*");switch(b){case "i1":return r[a>>0];case "i8":return r[a>>0];case "i16":return Ma[a>>1];case "i32":return F[a>>2];case "i64":return F[a>>2];case "float":return Na[a>>2];case "double":return Oa[a>>3];case "*":return I[a>>2];default:D("invalid type for getValue: "+b)}return null}
|
|
107
|
-
function na(a){var b="i32";b.endsWith("*")&&(b="*");switch(b){case "i1":r[a>>0]=0;break;case "i8":r[a>>0]=0;break;case "i16":Ma[a>>1]=0;break;case "i32":F[a>>2]=0;break;case "i64":O=[0,(N=0,1<=+Math.abs(N)?0<N?(Math.min(+Math.floor(N/4294967296),4294967295)|0)>>>0:~~+Math.ceil((N-+(~~N>>>0))/4294967296)>>>0:0)];F[a>>2]=O[0];F[a+4>>2]=O[1];break;case "float":Na[a>>2]=0;break;case "double":Oa[a>>3]=0;break;case "*":I[a>>2]=0;break;default:D("invalid type for setValue: "+b)}}
|
|
108
|
-
var cb=(a,b)=>{for(var c=0,d=a.length-1;0<=d;d--){var f=a[d];"."===f?a.splice(d,1):".."===f?(a.splice(d,1),c++):c&&(a.splice(d,1),c--)}if(b)for(;c;c--)a.unshift("..");return a},t=a=>{var b="/"===a.charAt(0),c="/"===a.substr(-1);(a=cb(a.split("/").filter(d=>!!d),!b).join("/"))||b||(a=".");a&&c&&(a+="/");return(b?"/":"")+a},db=a=>{var b=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(a).slice(1);a=b[0];b=b[1];if(!a&&!b)return".";b&&(b=b.substr(0,b.length-1));return a+b},eb=a=>{if("/"===
|
|
109
|
-
a)return"/";a=t(a);a=a.replace(/\/$/,"");var b=a.lastIndexOf("/");return-1===b?a:a.substr(b+1)};function fb(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var a=new Uint8Array(1);return()=>{crypto.getRandomValues(a);return a[0]}}if(wa)try{var b=require("crypto");return()=>b.randomBytes(1)[0]}catch(c){}return()=>D("randomDevice")}
|
|
110
|
-
function gb(){for(var a="",b=!1,c=arguments.length-1;-1<=c&&!b;c--){b=0<=c?arguments[c]:"/";if("string"!=typeof b)throw new TypeError("Arguments to path.resolve must be strings");if(!b)return"";a=b+"/"+a;b="/"===b.charAt(0)}a=cb(a.split("/").filter(d=>!!d),!b).join("/");return(b?"/":"")+a||"."}var hb=[];function jb(a,b){hb[a]={input:[],output:[],Za:b};kb(a,tb)}
|
|
111
|
-
var tb={open:function(a){var b=hb[a.node.rdev];if(!b)throw new P(43);a.tty=b;a.seekable=!1},close:function(a){a.tty.Za.fsync(a.tty)},fsync:function(a){a.tty.Za.fsync(a.tty)},read:function(a,b,c,d){if(!a.tty||!a.tty.Za.vb)throw new P(60);for(var f=0,h=0;h<d;h++){try{var k=a.tty.Za.vb(a.tty)}catch(q){throw new P(29);}if(void 0===k&&0===f)throw new P(6);if(null===k||void 0===k)break;f++;b[c+h]=k}f&&(a.node.timestamp=Date.now());return f},write:function(a,b,c,d){if(!a.tty||!a.tty.Za.lb)throw new P(60);
|
|
112
|
-
try{for(var f=0;f<d;f++)a.tty.Za.lb(a.tty,b[c+f])}catch(h){throw new P(29);}d&&(a.node.timestamp=Date.now());return f}},ub={vb:function(a){if(!a.input.length){var b=null;if(wa){var c=Buffer.alloc(256),d=0;try{d=fs.readSync(process.stdin.fd,c,0,256,-1)}catch(f){if(f.toString().includes("EOF"))d=0;else throw f;}0<d?b=c.slice(0,d).toString("utf-8"):b=null}else"undefined"!=typeof window&&"function"==typeof window.prompt?(b=window.prompt("Input: "),null!==b&&(b+="\n")):"function"==typeof readline&&(b=
|
|
113
|
-
readline(),null!==b&&(b+="\n"));if(!b)return null;c=Array(Ka(b)+1);b=Ja(b,c,0,c.length);c.length=b;a.input=c}return a.input.shift()},lb:function(a,b){null===b||10===b?(Ca(Ia(a.output,0)),a.output=[]):0!=b&&a.output.push(b)},fsync:function(a){a.output&&0<a.output.length&&(Ca(Ia(a.output,0)),a.output=[])}},vb={lb:function(a,b){null===b||10===b?(Da(Ia(a.output,0)),a.output=[]):0!=b&&a.output.push(b)},fsync:function(a){a.output&&0<a.output.length&&(Da(Ia(a.output,0)),a.output=[])}},R={Ra:null,Sa:function(){return R.createNode(null,
|
|
114
|
-
"/",16895,0)},createNode:function(a,b,c,d){if(24576===(c&61440)||4096===(c&61440))throw new P(63);R.Ra||(R.Ra={dir:{node:{Qa:R.Ha.Qa,Pa:R.Ha.Pa,lookup:R.Ha.lookup,cb:R.Ha.cb,rename:R.Ha.rename,unlink:R.Ha.unlink,rmdir:R.Ha.rmdir,readdir:R.Ha.readdir,symlink:R.Ha.symlink},stream:{Ua:R.Ia.Ua}},file:{node:{Qa:R.Ha.Qa,Pa:R.Ha.Pa},stream:{Ua:R.Ia.Ua,read:R.Ia.read,write:R.Ia.write,nb:R.Ia.nb,eb:R.Ia.eb,fb:R.Ia.fb}},link:{node:{Qa:R.Ha.Qa,Pa:R.Ha.Pa,readlink:R.Ha.readlink},stream:{}},rb:{node:{Qa:R.Ha.Qa,
|
|
115
|
-
Pa:R.Ha.Pa},stream:wb}});c=xb(a,b,c,d);16384===(c.mode&61440)?(c.Ha=R.Ra.dir.node,c.Ia=R.Ra.dir.stream,c.Ja={}):32768===(c.mode&61440)?(c.Ha=R.Ra.file.node,c.Ia=R.Ra.file.stream,c.Na=0,c.Ja=null):40960===(c.mode&61440)?(c.Ha=R.Ra.link.node,c.Ia=R.Ra.link.stream):8192===(c.mode&61440)&&(c.Ha=R.Ra.rb.node,c.Ia=R.Ra.rb.stream);c.timestamp=Date.now();a&&(a.Ja[b]=c,a.timestamp=c.timestamp);return c},Kb:function(a){return a.Ja?a.Ja.subarray?a.Ja.subarray(0,a.Na):new Uint8Array(a.Ja):new Uint8Array(0)},
|
|
116
|
-
sb:function(a,b){var c=a.Ja?a.Ja.length:0;c>=b||(b=Math.max(b,c*(1048576>c?2:1.125)>>>0),0!=c&&(b=Math.max(b,256)),c=a.Ja,a.Ja=new Uint8Array(b),0<a.Na&&a.Ja.set(c.subarray(0,a.Na),0))},Hb:function(a,b){if(a.Na!=b)if(0==b)a.Ja=null,a.Na=0;else{var c=a.Ja;a.Ja=new Uint8Array(b);c&&a.Ja.set(c.subarray(0,Math.min(b,a.Na)));a.Na=b}},Ha:{Qa:function(a){var b={};b.dev=8192===(a.mode&61440)?a.id:1;b.ino=a.id;b.mode=a.mode;b.nlink=1;b.uid=0;b.gid=0;b.rdev=a.rdev;16384===(a.mode&61440)?b.size=4096:32768===
|
|
117
|
-
(a.mode&61440)?b.size=a.Na:40960===(a.mode&61440)?b.size=a.link.length:b.size=0;b.atime=new Date(a.timestamp);b.mtime=new Date(a.timestamp);b.ctime=new Date(a.timestamp);b.Cb=4096;b.blocks=Math.ceil(b.size/b.Cb);return b},Pa:function(a,b){void 0!==b.mode&&(a.mode=b.mode);void 0!==b.timestamp&&(a.timestamp=b.timestamp);void 0!==b.size&&R.Hb(a,b.size)},lookup:function(){throw yb[44];},cb:function(a,b,c,d){return R.createNode(a,b,c,d)},rename:function(a,b,c){if(16384===(a.mode&61440)){try{var d=zb(b,
|
|
118
|
-
c)}catch(h){}if(d)for(var f in d.Ja)throw new P(55);}delete a.parent.Ja[a.name];a.parent.timestamp=Date.now();a.name=c;b.Ja[c]=a;b.timestamp=a.parent.timestamp;a.parent=b},unlink:function(a,b){delete a.Ja[b];a.timestamp=Date.now()},rmdir:function(a,b){var c=zb(a,b),d;for(d in c.Ja)throw new P(55);delete a.Ja[b];a.timestamp=Date.now()},readdir:function(a){var b=[".",".."],c;for(c in a.Ja)a.Ja.hasOwnProperty(c)&&b.push(c);return b},symlink:function(a,b,c){a=R.createNode(a,b,41471,0);a.link=c;return a},
|
|
119
|
-
readlink:function(a){if(40960!==(a.mode&61440))throw new P(28);return a.link}},Ia:{read:function(a,b,c,d,f){var h=a.node.Ja;if(f>=a.node.Na)return 0;a=Math.min(a.node.Na-f,d);if(8<a&&h.subarray)b.set(h.subarray(f,f+a),c);else for(d=0;d<a;d++)b[c+d]=h[f+d];return a},write:function(a,b,c,d,f,h){b.buffer===r.buffer&&(h=!1);if(!d)return 0;a=a.node;a.timestamp=Date.now();if(b.subarray&&(!a.Ja||a.Ja.subarray)){if(h)return a.Ja=b.subarray(c,c+d),a.Na=d;if(0===a.Na&&0===f)return a.Ja=b.slice(c,c+d),a.Na=
|
|
120
|
-
d;if(f+d<=a.Na)return a.Ja.set(b.subarray(c,c+d),f),d}R.sb(a,f+d);if(a.Ja.subarray&&b.subarray)a.Ja.set(b.subarray(c,c+d),f);else for(h=0;h<d;h++)a.Ja[f+h]=b[c+h];a.Na=Math.max(a.Na,f+d);return d},Ua:function(a,b,c){1===c?b+=a.position:2===c&&32768===(a.node.mode&61440)&&(b+=a.node.Na);if(0>b)throw new P(28);return b},nb:function(a,b,c){R.sb(a.node,b+c);a.node.Na=Math.max(a.node.Na,b+c)},eb:function(a,b,c,d,f){if(32768!==(a.node.mode&61440))throw new P(43);a=a.node.Ja;if(f&2||a.buffer!==La){if(0<
|
|
121
|
-
c||c+b<a.length)a.subarray?a=a.subarray(c,c+b):a=Array.prototype.slice.call(a,c,c+b);c=!0;b=65536*Math.ceil(b/65536);(f=Ab(65536,b))?(E.fill(0,f,f+b),b=f):b=0;if(!b)throw new P(48);r.set(a,b)}else c=!1,b=a.byteOffset;return{Gb:b,xb:c}},fb:function(a,b,c,d){R.Ia.write(a,b,0,d,c,!1);return 0}}},Bb=null,Cb={},S=[],Db=1,T=null,Eb=!0,P=null,yb={},U=(a,b={})=>{a=gb(a);if(!a)return{path:"",node:null};b=Object.assign({tb:!0,mb:0},b);if(8<b.mb)throw new P(32);a=a.split("/").filter(k=>!!k);for(var c=Bb,d="/",
|
|
122
|
-
f=0;f<a.length;f++){var h=f===a.length-1;if(h&&b.parent)break;c=zb(c,a[f]);d=t(d+"/"+a[f]);c.Xa&&(!h||h&&b.tb)&&(c=c.Xa.root);if(!h||b.Ta)for(h=0;40960===(c.mode&61440);)if(c=Fb(d),d=gb(db(d),c),c=U(d,{mb:b.mb+1}).node,40<h++)throw new P(32);}return{path:d,node:c}},ea=a=>{for(var b;;){if(a===a.parent)return a=a.Sa.wb,b?"/"!==a[a.length-1]?a+"/"+b:a+b:a;b=b?a.name+"/"+b:a.name;a=a.parent}},Gb=(a,b)=>{for(var c=0,d=0;d<b.length;d++)c=(c<<5)-c+b.charCodeAt(d)|0;return(a+c>>>0)%T.length},Hb=a=>{var b=
|
|
123
|
-
Gb(a.parent.id,a.name);if(T[b]===a)T[b]=a.Ya;else for(b=T[b];b;){if(b.Ya===a){b.Ya=a.Ya;break}b=b.Ya}},zb=(a,b)=>{var c;if(c=(c=Ib(a,"x"))?c:a.Ha.lookup?0:2)throw new P(c,a);for(c=T[Gb(a.id,b)];c;c=c.Ya){var d=c.name;if(c.parent.id===a.id&&d===b)return c}return a.Ha.lookup(a,b)},xb=(a,b,c,d)=>{a=new Jb(a,b,c,d);b=Gb(a.parent.id,a.name);a.Ya=T[b];return T[b]=a},Kb={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},Lb=a=>{var b=["r","w","rw"][a&3];a&512&&(b+="w");return b},Ib=(a,b)=>{if(Eb)return 0;if(!b.includes("r")||
|
|
124
|
-
a.mode&292){if(b.includes("w")&&!(a.mode&146)||b.includes("x")&&!(a.mode&73))return 2}else return 2;return 0},Mb=(a,b)=>{try{return zb(a,b),20}catch(c){}return Ib(a,"wx")},Nb=(a,b,c)=>{try{var d=zb(a,b)}catch(f){return f.La}if(a=Ib(a,"wx"))return a;if(c){if(16384!==(d.mode&61440))return 54;if(d===d.parent||"/"===ea(d))return 10}else if(16384===(d.mode&61440))return 31;return 0},Ob=(a=0)=>{for(;4096>=a;a++)if(!S[a])return a;throw new P(33);},Qb=(a,b)=>{Pb||(Pb=function(){this.bb={}},Pb.prototype={},
|
|
125
|
-
Object.defineProperties(Pb.prototype,{object:{get:function(){return this.node},set:function(c){this.node=c}},flags:{get:function(){return this.bb.flags},set:function(c){this.bb.flags=c}},position:{get:function(){return this.bb.position},set:function(c){this.bb.position=c}}}));a=Object.assign(new Pb,a);b=Ob(b);a.fd=b;return S[b]=a},wb={open:a=>{a.Ia=Cb[a.node.rdev].Ia;a.Ia.open&&a.Ia.open(a)},Ua:()=>{throw new P(70);}},kb=(a,b)=>{Cb[a]={Ia:b}},Rb=(a,b)=>{var c="/"===b,d=!b;if(c&&Bb)throw new P(10);
|
|
126
|
-
if(!c&&!d){var f=U(b,{tb:!1});b=f.path;f=f.node;if(f.Xa)throw new P(10);if(16384!==(f.mode&61440))throw new P(54);}b={type:a,Lb:{},wb:b,Fb:[]};a=a.Sa(b);a.Sa=b;b.root=a;c?Bb=a:f&&(f.Xa=b,f.Sa&&f.Sa.Fb.push(b))},ha=(a,b,c)=>{var d=U(a,{parent:!0}).node;a=eb(a);if(!a||"."===a||".."===a)throw new P(28);var f=Mb(d,a);if(f)throw new P(f);if(!d.Ha.cb)throw new P(63);return d.Ha.cb(d,a,b,c)},V=(a,b)=>ha(a,(void 0!==b?b:511)&1023|16384,0),Sb=(a,b,c)=>{"undefined"==typeof c&&(c=b,b=438);ha(a,b|8192,c)},Tb=
|
|
127
|
-
(a,b)=>{if(!gb(a))throw new P(44);var c=U(b,{parent:!0}).node;if(!c)throw new P(44);b=eb(b);var d=Mb(c,b);if(d)throw new P(d);if(!c.Ha.symlink)throw new P(63);c.Ha.symlink(c,b,a)},Ub=a=>{var b=U(a,{parent:!0}).node;a=eb(a);var c=zb(b,a),d=Nb(b,a,!0);if(d)throw new P(d);if(!b.Ha.rmdir)throw new P(63);if(c.Xa)throw new P(10);b.Ha.rmdir(b,a);Hb(c)},qa=a=>{var b=U(a,{parent:!0}).node;if(!b)throw new P(44);a=eb(a);var c=zb(b,a),d=Nb(b,a,!1);if(d)throw new P(d);if(!b.Ha.unlink)throw new P(63);if(c.Xa)throw new P(10);
|
|
128
|
-
b.Ha.unlink(b,a);Hb(c)},Fb=a=>{a=U(a).node;if(!a)throw new P(44);if(!a.Ha.readlink)throw new P(28);return gb(ea(a.parent),a.Ha.readlink(a))},Vb=(a,b)=>{a=U(a,{Ta:!b}).node;if(!a)throw new P(44);if(!a.Ha.Qa)throw new P(63);return a.Ha.Qa(a)},Wb=a=>Vb(a,!0),ia=(a,b)=>{a="string"==typeof a?U(a,{Ta:!0}).node:a;if(!a.Ha.Pa)throw new P(63);a.Ha.Pa(a,{mode:b&4095|a.mode&-4096,timestamp:Date.now()})},Xb=(a,b)=>{if(0>b)throw new P(28);a="string"==typeof a?U(a,{Ta:!0}).node:a;if(!a.Ha.Pa)throw new P(63);if(16384===
|
|
129
|
-
(a.mode&61440))throw new P(31);if(32768!==(a.mode&61440))throw new P(28);var c=Ib(a,"w");if(c)throw new P(c);a.Ha.Pa(a,{size:b,timestamp:Date.now()})},ja=(a,b,c)=>{if(""===a)throw new P(44);if("string"==typeof b){var d=Kb[b];if("undefined"==typeof d)throw Error("Unknown file open mode: "+b);b=d}c=b&64?("undefined"==typeof c?438:c)&4095|32768:0;if("object"==typeof a)var f=a;else{a=t(a);try{f=U(a,{Ta:!(b&131072)}).node}catch(h){}}d=!1;if(b&64)if(f){if(b&128)throw new P(20);}else f=ha(a,c,0),d=!0;if(!f)throw new P(44);
|
|
130
|
-
8192===(f.mode&61440)&&(b&=-513);if(b&65536&&16384!==(f.mode&61440))throw new P(54);if(!d&&(c=f?40960===(f.mode&61440)?32:16384===(f.mode&61440)&&("r"!==Lb(b)||b&512)?31:Ib(f,Lb(b)):44))throw new P(c);b&512&&!d&&Xb(f,0);b&=-131713;f=Qb({node:f,path:ea(f),flags:b,seekable:!0,position:0,Ia:f.Ia,Jb:[],error:!1});f.Ia.open&&f.Ia.open(f);!e.logReadFiles||b&1||(Yb||(Yb={}),a in Yb||(Yb[a]=1));return f},la=a=>{if(null===a.fd)throw new P(8);a.jb&&(a.jb=null);try{a.Ia.close&&a.Ia.close(a)}catch(b){throw b;
|
|
131
|
-
}finally{S[a.fd]=null}a.fd=null},Zb=(a,b,c)=>{if(null===a.fd)throw new P(8);if(!a.seekable||!a.Ia.Ua)throw new P(70);if(0!=c&&1!=c&&2!=c)throw new P(28);a.position=a.Ia.Ua(a,b,c);a.Jb=[]},$b=(a,b,c,d,f)=>{if(0>d||0>f)throw new P(28);if(null===a.fd)throw new P(8);if(1===(a.flags&2097155))throw new P(8);if(16384===(a.node.mode&61440))throw new P(31);if(!a.Ia.read)throw new P(28);var h="undefined"!=typeof f;if(!h)f=a.position;else if(!a.seekable)throw new P(70);b=a.Ia.read(a,b,c,d,f);h||(a.position+=
|
|
132
|
-
b);return b},ka=(a,b,c,d,f)=>{if(0>d||0>f)throw new P(28);if(null===a.fd)throw new P(8);if(0===(a.flags&2097155))throw new P(8);if(16384===(a.node.mode&61440))throw new P(31);if(!a.Ia.write)throw new P(28);a.seekable&&a.flags&1024&&Zb(a,0,2);var h="undefined"!=typeof f;if(!h)f=a.position;else if(!a.seekable)throw new P(70);b=a.Ia.write(a,b,c,d,f,void 0);h||(a.position+=b);return b},pa=a=>{var b="binary";if("utf8"!==b&&"binary"!==b)throw Error('Invalid encoding type "'+b+'"');var c;var d=ja(a,d||0);
|
|
133
|
-
a=Vb(a).size;var f=new Uint8Array(a);$b(d,f,0,a,0);"utf8"===b?c=Ia(f,0):"binary"===b&&(c=f);la(d);return c},ac=()=>{P||(P=function(a,b){this.node=b;this.Ib=function(c){this.La=c};this.Ib(a);this.message="FS error"},P.prototype=Error(),P.prototype.constructor=P,[44].forEach(a=>{yb[a]=new P(a);yb[a].stack="<generic error, no stack>"}))},bc,fa=(a,b)=>{var c=0;a&&(c|=365);b&&(c|=146);return c},dc=(a,b,c)=>{a=t("/dev/"+a);var d=fa(!!b,!!c);cc||(cc=64);var f=cc++<<8|0;kb(f,{open:h=>{h.seekable=!1},close:()=>
|
|
134
|
-
{c&&c.buffer&&c.buffer.length&&c(10)},read:(h,k,q,w)=>{for(var x=0,z=0;z<w;z++){try{var Q=b()}catch(mb){throw new P(29);}if(void 0===Q&&0===x)throw new P(6);if(null===Q||void 0===Q)break;x++;k[q+z]=Q}x&&(h.node.timestamp=Date.now());return x},write:(h,k,q,w)=>{for(var x=0;x<w;x++)try{c(k[q+x])}catch(z){throw new P(29);}w&&(h.node.timestamp=Date.now());return x}});Sb(a,d,f)},cc,W={},Pb,Yb;
|
|
135
|
-
function ec(a,b,c){if("/"===b.charAt(0))return b;a=-100===a?"/":X(a).path;if(0==b.length){if(!c)throw new P(44);return a}return t(a+"/"+b)}
|
|
136
|
-
function fc(a,b,c){try{var d=a(b)}catch(h){if(h&&h.node&&t(b)!==t(ea(h.node)))return-54;throw h;}F[c>>2]=d.dev;F[c+8>>2]=d.ino;F[c+12>>2]=d.mode;I[c+16>>2]=d.nlink;F[c+20>>2]=d.uid;F[c+24>>2]=d.gid;F[c+28>>2]=d.rdev;O=[d.size>>>0,(N=d.size,1<=+Math.abs(N)?0<N?(Math.min(+Math.floor(N/4294967296),4294967295)|0)>>>0:~~+Math.ceil((N-+(~~N>>>0))/4294967296)>>>0:0)];F[c+40>>2]=O[0];F[c+44>>2]=O[1];F[c+48>>2]=4096;F[c+52>>2]=d.blocks;a=d.atime.getTime();b=d.mtime.getTime();var f=d.ctime.getTime();O=[Math.floor(a/
|
|
137
|
-
1E3)>>>0,(N=Math.floor(a/1E3),1<=+Math.abs(N)?0<N?(Math.min(+Math.floor(N/4294967296),4294967295)|0)>>>0:~~+Math.ceil((N-+(~~N>>>0))/4294967296)>>>0:0)];F[c+56>>2]=O[0];F[c+60>>2]=O[1];I[c+64>>2]=a%1E3*1E3;O=[Math.floor(b/1E3)>>>0,(N=Math.floor(b/1E3),1<=+Math.abs(N)?0<N?(Math.min(+Math.floor(N/4294967296),4294967295)|0)>>>0:~~+Math.ceil((N-+(~~N>>>0))/4294967296)>>>0:0)];F[c+72>>2]=O[0];F[c+76>>2]=O[1];I[c+80>>2]=b%1E3*1E3;O=[Math.floor(f/1E3)>>>0,(N=Math.floor(f/1E3),1<=+Math.abs(N)?0<N?(Math.min(+Math.floor(N/
|
|
138
|
-
4294967296),4294967295)|0)>>>0:~~+Math.ceil((N-+(~~N>>>0))/4294967296)>>>0:0)];F[c+88>>2]=O[0];F[c+92>>2]=O[1];I[c+96>>2]=f%1E3*1E3;O=[d.ino>>>0,(N=d.ino,1<=+Math.abs(N)?0<N?(Math.min(+Math.floor(N/4294967296),4294967295)|0)>>>0:~~+Math.ceil((N-+(~~N>>>0))/4294967296)>>>0:0)];F[c+104>>2]=O[0];F[c+108>>2]=O[1];return 0}var Gc=void 0;function Ic(){Gc+=4;return F[Gc-4>>2]}function X(a){a=S[a];if(!a)throw new P(8);return a}function Jc(a){return I[a>>2]+4294967296*F[a+4>>2]}
|
|
139
|
-
var Kc=[0,31,60,91,121,152,182,213,244,274,305,335],Lc=[0,31,59,90,120,151,181,212,243,273,304,334];function Mc(a){var b=Ka(a)+1,c=aa(b);c&&Ja(a,r,c,b);return c}var Nc;Nc=wa?()=>{var a=process.hrtime();return 1E3*a[0]+a[1]/1E6}:()=>performance.now();var Oc={};
|
|
140
|
-
function Pc(){if(!Qc){var a={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:ta||"./this.program"},b;for(b in Oc)void 0===Oc[b]?delete a[b]:a[b]=Oc[b];var c=[];for(b in a)c.push(b+"="+a[b]);Qc=c}return Qc}var Qc;function ba(a,b){r.set(a,b)}
|
|
141
|
-
function Rc(a,b,c,d){var f={string:x=>{var z=0;if(null!==x&&void 0!==x&&0!==x){var Q=(x.length<<2)+1;z=u(Q);Ja(x,E,z,Q)}return z},array:x=>{var z=u(x.length);ba(x,z);return z}};a=e["_"+a];var h=[],k=0;if(d)for(var q=0;q<d.length;q++){var w=f[c[q]];w?(0===k&&(k=ma()),h[q]=w(d[q])):h[q]=d[q]}c=a.apply(null,h);return c=function(x){0!==k&&oa(k);return"string"===b?A(x):"boolean"===b?!!x:x}(c)}function da(a){var b=Ka(a)+1,c=aa(b);Ja(a,E,c,b);return c}var Y=void 0,Sc=[];
|
|
142
|
-
function B(a){Y.delete(L.get(a));Sc.push(a)}
|
|
143
|
-
function ra(a,b){if(!Y){Y=new WeakMap;var c=L.length;if(Y)for(var d=0;d<0+c;d++){var f=L.get(d);f&&Y.set(f,d)}}if(Y.has(a))return Y.get(a);if(Sc.length)c=Sc.pop();else{try{L.grow(1)}catch(q){if(!(q instanceof RangeError))throw q;throw"Unable to grow wasm table. Set ALLOW_TABLE_GROWTH.";}c=L.length-1}try{L.set(c,a)}catch(q){if(!(q instanceof TypeError))throw q;if("function"==typeof WebAssembly.Function){d=WebAssembly.Function;f={i:"i32",j:"i32",f:"f32",d:"f64",p:"i32"};for(var h={parameters:[],results:"v"==
|
|
144
|
-
b[0]?[]:[f[b[0]]]},k=1;k<b.length;++k)h.parameters.push(f[b[k]]),"j"===b[k]&&h.parameters.push("i32");b=new d(h,a)}else{d=[1];f=b.slice(0,1);b=b.slice(1);h={i:127,p:127,j:126,f:125,d:124};d.push(96);k=b.length;128>k?d.push(k):d.push(k%128|128,k>>7);for(k=0;k<b.length;++k)d.push(h[b[k]]);"v"==f?d.push(0):d.push(1,h[f]);b=[0,97,115,109,1,0,0,0,1];f=d.length;128>f?b.push(f):b.push(f%128|128,f>>7);b.push.apply(b,d);b.push(2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0);b=new WebAssembly.Module(new Uint8Array(b));
|
|
145
|
-
b=(new WebAssembly.Instance(b,{e:{f:a}})).exports.f}L.set(c,b)}Y.set(a,c);return c}function Jb(a,b,c,d){a||(a=this);this.parent=a;this.Sa=a.Sa;this.Xa=null;this.id=Db++;this.name=b;this.mode=c;this.Ha={};this.Ia={};this.rdev=d}Object.defineProperties(Jb.prototype,{read:{get:function(){return 365===(this.mode&365)},set:function(a){a?this.mode|=365:this.mode&=-366}},write:{get:function(){return 146===(this.mode&146)},set:function(a){a?this.mode|=146:this.mode&=-147}}});ac();T=Array(4096);Rb(R,"/");
|
|
146
|
-
V("/tmp");V("/home");V("/home/web_user");(()=>{V("/dev");kb(259,{read:()=>0,write:(b,c,d,f)=>f});Sb("/dev/null",259);jb(1280,ub);jb(1536,vb);Sb("/dev/tty",1280);Sb("/dev/tty1",1536);var a=fb();dc("random",a);dc("urandom",a);V("/dev/shm");V("/dev/shm/tmp")})();(()=>{V("/proc");var a=V("/proc/self");V("/proc/self/fd");Rb({Sa:()=>{var b=xb(a,"fd",16895,73);b.Ha={lookup:(c,d)=>{var f=S[+d];if(!f)throw new P(8);c={parent:null,Sa:{wb:"fake"},Ha:{readlink:()=>f.path}};return c.parent=c}};return b}},"/proc/self/fd")})();
|
|
147
|
-
var Uc={a:function(a,b,c,d){D("Assertion failed: "+A(a)+", at: "+[b?A(b):"unknown filename",c,d?A(d):"unknown function"])},g:function(a,b){try{return a=A(a),ia(a,b),0}catch(c){if("undefined"==typeof W||!(c instanceof P))throw c;return-c.La}},H:function(a,b,c){try{b=A(b);b=ec(a,b);if(c&-8)return-28;var d=U(b,{Ta:!0}).node;if(!d)return-44;a="";c&4&&(a+="r");c&2&&(a+="w");c&1&&(a+="x");return a&&Ib(d,a)?-2:0}catch(f){if("undefined"==typeof W||!(f instanceof P))throw f;return-f.La}},h:function(a,b){try{var c=
|
|
148
|
-
S[a];if(!c)throw new P(8);ia(c.node,b);return 0}catch(d){if("undefined"==typeof W||!(d instanceof P))throw d;return-d.La}},f:function(a){try{var b=S[a];if(!b)throw new P(8);var c=b.node;var d="string"==typeof c?U(c,{Ta:!0}).node:c;if(!d.Ha.Pa)throw new P(63);d.Ha.Pa(d,{timestamp:Date.now()});return 0}catch(f){if("undefined"==typeof W||!(f instanceof P))throw f;return-f.La}},b:function(a,b,c){Gc=c;try{var d=X(a);switch(b){case 0:var f=Ic();return 0>f?-28:Qb(d,f).fd;case 1:case 2:return 0;case 3:return d.flags;
|
|
149
|
-
case 4:return f=Ic(),d.flags|=f,0;case 5:return f=Ic(),Ma[f+0>>1]=2,0;case 6:case 7:return 0;case 16:case 8:return-28;case 9:return F[Tc()>>2]=28,-1;default:return-28}}catch(h){if("undefined"==typeof W||!(h instanceof P))throw h;return-h.La}},G:function(a,b){try{var c=X(a);return fc(Vb,c.path,b)}catch(d){if("undefined"==typeof W||!(d instanceof P))throw d;return-d.La}},k:function(a,b,c){try{b=c+2097152>>>0<4194305-!!b?(b>>>0)+4294967296*c:NaN;if(isNaN(b))return-61;var d=S[a];if(!d)throw new P(8);
|
|
150
|
-
if(0===(d.flags&2097155))throw new P(28);Xb(d.node,b);return 0}catch(f){if("undefined"==typeof W||!(f instanceof P))throw f;return-f.La}},B:function(a,b){try{if(0===b)return-28;var c=Ka("/")+1;if(b<c)return-68;Ja("/",E,a,b);return c}catch(d){if("undefined"==typeof W||!(d instanceof P))throw d;return-d.La}},E:function(a,b){try{return a=A(a),fc(Wb,a,b)}catch(c){if("undefined"==typeof W||!(c instanceof P))throw c;return-c.La}},y:function(a,b,c){try{return b=A(b),b=ec(a,b),b=t(b),"/"===b[b.length-1]&&
|
|
151
|
-
(b=b.substr(0,b.length-1)),V(b,c),0}catch(d){if("undefined"==typeof W||!(d instanceof P))throw d;return-d.La}},D:function(a,b,c,d){try{b=A(b);var f=d&256;b=ec(a,b,d&4096);return fc(f?Wb:Vb,b,c)}catch(h){if("undefined"==typeof W||!(h instanceof P))throw h;return-h.La}},v:function(a,b,c,d){Gc=d;try{b=A(b);b=ec(a,b);var f=d?Ic():0;return ja(b,c,f).fd}catch(h){if("undefined"==typeof W||!(h instanceof P))throw h;return-h.La}},t:function(a,b,c,d){try{b=A(b);b=ec(a,b);if(0>=d)return-28;var f=Fb(b),h=Math.min(d,
|
|
152
|
-
Ka(f)),k=r[c+h];Ja(f,E,c,d+1);r[c+h]=k;return h}catch(q){if("undefined"==typeof W||!(q instanceof P))throw q;return-q.La}},s:function(a){try{return a=A(a),Ub(a),0}catch(b){if("undefined"==typeof W||!(b instanceof P))throw b;return-b.La}},F:function(a,b){try{return a=A(a),fc(Vb,a,b)}catch(c){if("undefined"==typeof W||!(c instanceof P))throw c;return-c.La}},p:function(a,b,c){try{return b=A(b),b=ec(a,b),0===c?qa(b):512===c?Ub(b):D("Invalid flags passed to unlinkat"),0}catch(d){if("undefined"==typeof W||
|
|
153
|
-
!(d instanceof P))throw d;return-d.La}},o:function(a,b,c){try{b=A(b);b=ec(a,b,!0);if(c){var d=Jc(c),f=F[c+8>>2];h=1E3*d+f/1E6;c+=16;d=Jc(c);f=F[c+8>>2];k=1E3*d+f/1E6}else var h=Date.now(),k=h;a=h;var q=U(b,{Ta:!0}).node;q.Ha.Pa(q,{timestamp:Math.max(a,k)});return 0}catch(w){if("undefined"==typeof W||!(w instanceof P))throw w;return-w.La}},i:function(a,b){a=new Date(1E3*Jc(a));F[b>>2]=a.getSeconds();F[b+4>>2]=a.getMinutes();F[b+8>>2]=a.getHours();F[b+12>>2]=a.getDate();F[b+16>>2]=a.getMonth();F[b+
|
|
154
|
-
20>>2]=a.getFullYear()-1900;F[b+24>>2]=a.getDay();var c=a.getFullYear();F[b+28>>2]=(0!==c%4||0===c%100&&0!==c%400?Lc:Kc)[a.getMonth()]+a.getDate()-1|0;F[b+36>>2]=-(60*a.getTimezoneOffset());c=(new Date(a.getFullYear(),6,1)).getTimezoneOffset();var d=(new Date(a.getFullYear(),0,1)).getTimezoneOffset();F[b+32>>2]=(c!=d&&a.getTimezoneOffset()==Math.min(d,c))|0},w:function(a,b,c,d,f,h,k){try{var q=X(d);if(0!==(b&2)&&0===(c&2)&&2!==(q.flags&2097155))throw new P(2);if(1===(q.flags&2097155))throw new P(2);
|
|
155
|
-
if(!q.Ia.eb)throw new P(43);var w=q.Ia.eb(q,a,f,b,c);var x=w.Gb;F[h>>2]=w.xb;I[k>>2]=x;return 0}catch(z){if("undefined"==typeof W||!(z instanceof P))throw z;return-z.La}},x:function(a,b,c,d,f,h){try{var k=X(f);if(c&2){if(32768!==(k.node.mode&61440))throw new P(43);if(!(d&2)){var q=E.slice(a,a+b);k.Ia.fb&&k.Ia.fb(k,q,h,b,d)}}}catch(w){if("undefined"==typeof W||!(w instanceof P))throw w;return-w.La}},n:function(a,b,c){function d(w){return(w=w.toTimeString().match(/\(([A-Za-z ]+)\)$/))?w[1]:"GMT"}var f=
|
|
156
|
-
(new Date).getFullYear(),h=new Date(f,0,1),k=new Date(f,6,1);f=h.getTimezoneOffset();var q=k.getTimezoneOffset();I[a>>2]=60*Math.max(f,q);F[b>>2]=Number(f!=q);a=d(h);b=d(k);a=Mc(a);b=Mc(b);q<f?(I[c>>2]=a,I[c+4>>2]=b):(I[c>>2]=b,I[c+4>>2]=a)},d:function(){return Date.now()},q:function(){return 2147483648},c:Nc,l:function(a){var b=E.length;a>>>=0;if(2147483648<a)return!1;for(var c=1;4>=c;c*=2){var d=b*(1+.2/c);d=Math.min(d,a+100663296);var f=Math;d=Math.max(a,d);f=f.min.call(f,2147483648,d+(65536-d%
|
|
157
|
-
65536)%65536);a:{try{Fa.grow(f-La.byteLength+65535>>>16);Qa();var h=1;break a}catch(k){}h=void 0}if(h)return!0}return!1},z:function(a,b){var c=0;Pc().forEach(function(d,f){var h=b+c;f=I[a+4*f>>2]=h;for(h=0;h<d.length;++h)r[f++>>0]=d.charCodeAt(h);r[f>>0]=0;c+=d.length+1});return 0},A:function(a,b){var c=Pc();I[a>>2]=c.length;var d=0;c.forEach(function(f){d+=f.length+1});I[b>>2]=d;return 0},e:function(a){try{var b=X(a);la(b);return 0}catch(c){if("undefined"==typeof W||!(c instanceof P))throw c;return c.La}},
|
|
158
|
-
m:function(a,b){try{var c=X(a);r[b>>0]=c.tty?2:16384===(c.mode&61440)?3:40960===(c.mode&61440)?7:4;return 0}catch(d){if("undefined"==typeof W||!(d instanceof P))throw d;return d.La}},u:function(a,b,c,d){try{a:{var f=X(a);a=b;for(var h=b=0;h<c;h++){var k=I[a>>2],q=I[a+4>>2];a+=8;var w=$b(f,r,k,q);if(0>w){var x=-1;break a}b+=w;if(w<q)break}x=b}I[d>>2]=x;return 0}catch(z){if("undefined"==typeof W||!(z instanceof P))throw z;return z.La}},j:function(a,b,c,d,f){try{b=c+2097152>>>0<4194305-!!b?(b>>>0)+4294967296*
|
|
159
|
-
c:NaN;if(isNaN(b))return 61;var h=X(a);Zb(h,b,d);O=[h.position>>>0,(N=h.position,1<=+Math.abs(N)?0<N?(Math.min(+Math.floor(N/4294967296),4294967295)|0)>>>0:~~+Math.ceil((N-+(~~N>>>0))/4294967296)>>>0:0)];F[f>>2]=O[0];F[f+4>>2]=O[1];h.jb&&0===b&&0===d&&(h.jb=null);return 0}catch(k){if("undefined"==typeof W||!(k instanceof P))throw k;return k.La}},C:function(a){try{var b=X(a);return b.Ia&&b.Ia.fsync?b.Ia.fsync(b):0}catch(c){if("undefined"==typeof W||!(c instanceof P))throw c;return c.La}},r:function(a,
|
|
160
|
-
b,c,d){try{a:{var f=X(a);a=b;for(var h=b=0;h<c;h++){var k=I[a>>2],q=I[a+4>>2];a+=8;var w=ka(f,r,k,q);if(0>w){var x=-1;break a}b+=w}x=b}I[d>>2]=x;return 0}catch(z){if("undefined"==typeof W||!(z instanceof P))throw z;return z.La}}};
|
|
161
|
-
(function(){function a(f){e.asm=f.exports;Fa=e.asm.I;Qa();L=e.asm.Ba;Sa.unshift(e.asm.J);Va--;e.monitorRunDependencies&&e.monitorRunDependencies(Va);0==Va&&(null!==Wa&&(clearInterval(Wa),Wa=null),Xa&&(f=Xa,Xa=null,f()))}function b(f){a(f.instance)}function c(f){return ab().then(function(h){return WebAssembly.instantiate(h,d)}).then(function(h){return h}).then(f,function(h){Da("failed to asynchronously prepare wasm: "+h);D(h)})}var d={a:Uc};Va++;e.monitorRunDependencies&&e.monitorRunDependencies(Va);
|
|
162
|
-
if(e.instantiateWasm)try{return e.instantiateWasm(d,a)}catch(f){return Da("Module.instantiateWasm callback failed with error: "+f),!1}(function(){return Ea||"function"!=typeof WebAssembly.instantiateStreaming||Ya()||M.startsWith("file://")||wa||"function"!=typeof fetch?c(b):fetch(M,{credentials:"same-origin"}).then(function(f){return WebAssembly.instantiateStreaming(f,d).then(b,function(h){Da("wasm streaming compile failed: "+h);Da("falling back to ArrayBuffer instantiation");return c(b)})})})();
|
|
163
|
-
return{}})();e.___wasm_call_ctors=function(){return(e.___wasm_call_ctors=e.asm.J).apply(null,arguments)};e._sqlite3_free=function(){return(e._sqlite3_free=e.asm.K).apply(null,arguments)};e._sqlite3_value_text=function(){return(e._sqlite3_value_text=e.asm.L).apply(null,arguments)};var Tc=e.___errno_location=function(){return(Tc=e.___errno_location=e.asm.M).apply(null,arguments)};e._sqlite3_prepare_v2=function(){return(e._sqlite3_prepare_v2=e.asm.N).apply(null,arguments)};
|
|
164
|
-
e._sqlite3_step=function(){return(e._sqlite3_step=e.asm.O).apply(null,arguments)};e._sqlite3_reset=function(){return(e._sqlite3_reset=e.asm.P).apply(null,arguments)};e._sqlite3_exec=function(){return(e._sqlite3_exec=e.asm.Q).apply(null,arguments)};e._sqlite3_finalize=function(){return(e._sqlite3_finalize=e.asm.R).apply(null,arguments)};e._sqlite3_column_name=function(){return(e._sqlite3_column_name=e.asm.S).apply(null,arguments)};
|
|
165
|
-
e._sqlite3_column_text=function(){return(e._sqlite3_column_text=e.asm.T).apply(null,arguments)};e._sqlite3_column_type=function(){return(e._sqlite3_column_type=e.asm.U).apply(null,arguments)};e._sqlite3_errmsg=function(){return(e._sqlite3_errmsg=e.asm.V).apply(null,arguments)};e._sqlite3_clear_bindings=function(){return(e._sqlite3_clear_bindings=e.asm.W).apply(null,arguments)};e._sqlite3_value_blob=function(){return(e._sqlite3_value_blob=e.asm.X).apply(null,arguments)};
|
|
166
|
-
e._sqlite3_value_bytes=function(){return(e._sqlite3_value_bytes=e.asm.Y).apply(null,arguments)};e._sqlite3_value_double=function(){return(e._sqlite3_value_double=e.asm.Z).apply(null,arguments)};e._sqlite3_value_int=function(){return(e._sqlite3_value_int=e.asm._).apply(null,arguments)};e._sqlite3_value_type=function(){return(e._sqlite3_value_type=e.asm.$).apply(null,arguments)};e._sqlite3_result_blob=function(){return(e._sqlite3_result_blob=e.asm.aa).apply(null,arguments)};
|
|
167
|
-
e._sqlite3_result_double=function(){return(e._sqlite3_result_double=e.asm.ba).apply(null,arguments)};e._sqlite3_result_error=function(){return(e._sqlite3_result_error=e.asm.ca).apply(null,arguments)};e._sqlite3_result_int=function(){return(e._sqlite3_result_int=e.asm.da).apply(null,arguments)};e._sqlite3_result_int64=function(){return(e._sqlite3_result_int64=e.asm.ea).apply(null,arguments)};e._sqlite3_result_null=function(){return(e._sqlite3_result_null=e.asm.fa).apply(null,arguments)};
|
|
168
|
-
e._sqlite3_result_text=function(){return(e._sqlite3_result_text=e.asm.ga).apply(null,arguments)};e._sqlite3_aggregate_context=function(){return(e._sqlite3_aggregate_context=e.asm.ha).apply(null,arguments)};e._sqlite3_column_count=function(){return(e._sqlite3_column_count=e.asm.ia).apply(null,arguments)};e._sqlite3_data_count=function(){return(e._sqlite3_data_count=e.asm.ja).apply(null,arguments)};e._sqlite3_column_blob=function(){return(e._sqlite3_column_blob=e.asm.ka).apply(null,arguments)};
|
|
169
|
-
e._sqlite3_column_bytes=function(){return(e._sqlite3_column_bytes=e.asm.la).apply(null,arguments)};e._sqlite3_column_double=function(){return(e._sqlite3_column_double=e.asm.ma).apply(null,arguments)};e._sqlite3_bind_blob=function(){return(e._sqlite3_bind_blob=e.asm.na).apply(null,arguments)};e._sqlite3_bind_double=function(){return(e._sqlite3_bind_double=e.asm.oa).apply(null,arguments)};e._sqlite3_bind_int=function(){return(e._sqlite3_bind_int=e.asm.pa).apply(null,arguments)};
|
|
170
|
-
e._sqlite3_bind_text=function(){return(e._sqlite3_bind_text=e.asm.qa).apply(null,arguments)};e._sqlite3_bind_parameter_index=function(){return(e._sqlite3_bind_parameter_index=e.asm.ra).apply(null,arguments)};e._sqlite3_sql=function(){return(e._sqlite3_sql=e.asm.sa).apply(null,arguments)};e._sqlite3_normalized_sql=function(){return(e._sqlite3_normalized_sql=e.asm.ta).apply(null,arguments)};e._sqlite3_changes=function(){return(e._sqlite3_changes=e.asm.ua).apply(null,arguments)};
|
|
171
|
-
e._sqlite3_close_v2=function(){return(e._sqlite3_close_v2=e.asm.va).apply(null,arguments)};e._sqlite3_create_function_v2=function(){return(e._sqlite3_create_function_v2=e.asm.wa).apply(null,arguments)};e._sqlite3_update_hook=function(){return(e._sqlite3_update_hook=e.asm.xa).apply(null,arguments)};e._sqlite3_open=function(){return(e._sqlite3_open=e.asm.ya).apply(null,arguments)};
|
|
172
|
-
var aa=e._malloc=function(){return(aa=e._malloc=e.asm.za).apply(null,arguments)},ca=e._free=function(){return(ca=e._free=e.asm.Aa).apply(null,arguments)};e._RegisterExtensionFunctions=function(){return(e._RegisterExtensionFunctions=e.asm.Ca).apply(null,arguments)};
|
|
173
|
-
var Ab=e._emscripten_builtin_memalign=function(){return(Ab=e._emscripten_builtin_memalign=e.asm.Da).apply(null,arguments)},ma=e.stackSave=function(){return(ma=e.stackSave=e.asm.Ea).apply(null,arguments)},oa=e.stackRestore=function(){return(oa=e.stackRestore=e.asm.Fa).apply(null,arguments)},u=e.stackAlloc=function(){return(u=e.stackAlloc=e.asm.Ga).apply(null,arguments)};e.UTF8ToString=A;e.stackAlloc=u;e.stackSave=ma;e.stackRestore=oa;e.stringToNewUTF8=da;
|
|
174
|
-
e.cwrap=function(a,b,c,d){c=c||[];var f=c.every(h=>"number"===h||"boolean"===h);return"string"!==b&&f&&!d?e["_"+a]:function(){return Rc(a,b,c,arguments)}};e.addFunction=ra;e.removeFunction=B;e.writeArrayToMemory=ba;var Vc;Xa=function Wc(){Vc||Xc();Vc||(Xa=Wc)};
|
|
175
|
-
function Xc(){function a(){if(!Vc&&(Vc=!0,e.calledRun=!0,!Ga)){e.noFSInit||bc||(bc=!0,ac(),e.stdin=e.stdin,e.stdout=e.stdout,e.stderr=e.stderr,e.stdin?dc("stdin",e.stdin):Tb("/dev/tty","/dev/stdin"),e.stdout?dc("stdout",null,e.stdout):Tb("/dev/tty","/dev/stdout"),e.stderr?dc("stderr",null,e.stderr):Tb("/dev/tty1","/dev/stderr"),ja("/dev/stdin",0),ja("/dev/stdout",1),ja("/dev/stderr",1));Eb=!1;bb(Sa);if(e.onRuntimeInitialized)e.onRuntimeInitialized();if(e.postRun)for("function"==typeof e.postRun&&
|
|
176
|
-
(e.postRun=[e.postRun]);e.postRun.length;){var b=e.postRun.shift();Ta.unshift(b)}bb(Ta)}}if(!(0<Va)){if(e.preRun)for("function"==typeof e.preRun&&(e.preRun=[e.preRun]);e.preRun.length;)Ua();bb(Ra);0<Va||(e.setStatus?(e.setStatus("Running..."),setTimeout(function(){setTimeout(function(){e.setStatus("")},1);a()},1)):a())}}if(e.preInit)for("function"==typeof e.preInit&&(e.preInit=[e.preInit]);0<e.preInit.length;)e.preInit.pop()();Xc();
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
// The shell-pre.js and emcc-generated code goes above
|
|
180
|
-
return Module;
|
|
181
|
-
}); // The end of the promise being returned
|
|
182
|
-
|
|
183
|
-
return initSqlJsPromise;
|
|
184
|
-
} // The end of our initSqlJs function
|
|
185
|
-
|
|
186
|
-
// This bit below is copied almost exactly from what you get when you use the MODULARIZE=1 flag with emcc
|
|
187
|
-
// However, we don't want to use the emcc modularization. See shell-pre.js
|
|
188
|
-
if (typeof exports === 'object' && typeof module === 'object'){
|
|
189
|
-
module.exports = initSqlJs;
|
|
190
|
-
// This will allow the module to be used in ES6 or CommonJS
|
|
191
|
-
module.exports.default = initSqlJs;
|
|
192
|
-
}
|
|
193
|
-
else if (typeof define === 'function' && define['amd']) {
|
|
194
|
-
define([], function() { return initSqlJs; });
|
|
195
|
-
}
|
|
196
|
-
else if (typeof exports === 'object'){
|
|
197
|
-
exports["Module"] = initSqlJs;
|
|
198
|
-
}
|
package/dist/sql-wasm.wasm
DELETED
|
Binary file
|