trellis 3.2.0 → 3.2.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.
Files changed (258) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/README.md +61 -171
  3. package/dist/browser/index.d.ts +18 -0
  4. package/dist/browser/index.d.ts.map +1 -0
  5. package/dist/browser/index.js +95 -0
  6. package/dist/{chunk-3ETIIPPB.js → chunk-2W3MHTMG.js} +190 -27
  7. package/dist/{chunk-MBNBTJCR.js → chunk-6GEZ6DN5.js} +2 -2
  8. package/dist/chunk-7ZFRVCUE.js +211 -0
  9. package/dist/chunk-CAG4FULI.js +121 -0
  10. package/dist/{chunk-GD5QJXSS.js → chunk-FWRS4CSC.js} +2 -2
  11. package/dist/{chunk-36VSSTL7.js → chunk-GU374KWZ.js} +1 -1
  12. package/dist/{chunk-3GDRZTAW.js → chunk-H6JB3PZ3.js} +1 -1
  13. package/dist/{chunk-ZHVI7BQN.js → chunk-IZX2PLIB.js} +191 -28
  14. package/dist/chunk-J2TXUFCZ.js +289 -0
  15. package/dist/{chunk-BJ7EZ7FP.js → chunk-JHHEXEDM.js} +17 -0
  16. package/dist/{chunk-X762XWVC.js → chunk-KIJITUZB.js} +1 -1
  17. package/dist/{chunk-7WQGTFVJ.js → chunk-L5N5PR2S.js} +130 -75
  18. package/dist/{chunk-BXSTJVE3.js → chunk-N6MYZT4O.js} +2 -1
  19. package/dist/{chunk-KKDRMIV6.js → chunk-QB5ISE47.js} +1 -1
  20. package/dist/{chunk-HO4TURXW.js → chunk-S3XLFZ27.js} +28 -11
  21. package/dist/{chunk-BQBUVMRN.js → chunk-S6GBJ2ZB.js} +25 -14
  22. package/dist/{chunk-IUWVEEOX.js → chunk-SGMDTWJJ.js} +4 -0
  23. package/dist/{chunk-FZVCXDYW.js → chunk-UQISRW6T.js} +65 -12
  24. package/dist/{chunk-B3ZIFA2O.js → chunk-VBYUTRXX.js} +1 -1
  25. package/dist/cli/deploy-cli.d.ts +18 -0
  26. package/dist/cli/deploy-cli.d.ts.map +1 -0
  27. package/dist/cli/index.d.ts +1 -1
  28. package/dist/cli/index.d.ts.map +1 -1
  29. package/dist/cli/index.js +153 -100
  30. package/dist/client/index.browser.d.ts +29 -0
  31. package/dist/client/index.browser.d.ts.map +1 -0
  32. package/dist/client/index.browser.js +64 -0
  33. package/dist/client/index.js +10 -10
  34. package/dist/client/sdk.browser.d.ts +104 -0
  35. package/dist/client/sdk.browser.d.ts.map +1 -0
  36. package/dist/{sdk-LZ7W3EEY.js → client/sdk.browser.js} +2 -2
  37. package/dist/client/sdk.js +1 -1
  38. package/dist/core/index.js +6 -6
  39. package/dist/db/index.js +18 -18
  40. package/dist/db/inspector.js +6 -6
  41. package/dist/db/trellis.css +1 -1
  42. package/dist/decisions/index.js +2 -2
  43. package/dist/deploy-LQ7GUGJ5.js +9 -0
  44. package/dist/{deploy-66EC752W.js → deploy-YNVG5E4E.js} +1 -1
  45. package/dist/deploy-cli-24BCHAXY.js +67 -0
  46. package/dist/deploy-cli-C35HTITO.js +67 -0
  47. package/dist/embeddings/auto-embed.d.ts.map +1 -1
  48. package/dist/embeddings/index.js +1 -1
  49. package/dist/embeddings/store.d.ts.map +1 -1
  50. package/dist/engine.d.ts +27 -7
  51. package/dist/engine.d.ts.map +1 -1
  52. package/dist/index.js +6 -6
  53. package/dist/mcp/server.d.ts.map +1 -1
  54. package/dist/react/index.js +2 -2
  55. package/dist/react/schema-hooks.js +7 -7
  56. package/dist/{remote-manager-SG545WNY.js → remote-manager-ODE3T2KR.js} +5 -5
  57. package/dist/scaffold/seed.d.ts.map +1 -1
  58. package/dist/scaffold/write.d.ts +1 -1
  59. package/dist/scaffold/write.d.ts.map +1 -1
  60. package/dist/schema/index.js +4 -3
  61. package/dist/server/deploy-meta.d.ts +25 -0
  62. package/dist/server/deploy-meta.d.ts.map +1 -0
  63. package/dist/server/deploy.d.ts +7 -2
  64. package/dist/server/deploy.d.ts.map +1 -1
  65. package/dist/server/index.d.ts +5 -2
  66. package/dist/server/index.d.ts.map +1 -1
  67. package/dist/server/index.js +52 -18
  68. package/dist/server/realtime.d.ts +4 -1
  69. package/dist/server/realtime.d.ts.map +1 -1
  70. package/dist/server/server.d.ts +1 -0
  71. package/dist/server/server.d.ts.map +1 -1
  72. package/dist/server/sprites.d.ts +18 -1
  73. package/dist/server/sprites.d.ts.map +1 -1
  74. package/dist/server/tenancy.d.ts +4 -0
  75. package/dist/server/tenancy.d.ts.map +1 -1
  76. package/dist/server/usage-meter.d.ts +53 -0
  77. package/dist/server/usage-meter.d.ts.map +1 -0
  78. package/dist/{server-IGBIIJSF.js → server-MB3OPSPI.js} +6 -1
  79. package/dist/{server-BOH7M4TT.js → server-ZVWGLLRF.js} +7 -2
  80. package/dist/sprites-KQGTGM6W.js +27 -0
  81. package/dist/{tenancy-S676GLID.js → tenancy-NBLLGCNJ.js} +1 -1
  82. package/dist/{tenancy-OP34NFFS.js → tenancy-POMWQP6M.js} +5 -3
  83. package/dist/vcs/index.js +3 -3
  84. package/dist/vcs/types.d.ts +2 -0
  85. package/dist/vcs/types.d.ts.map +1 -1
  86. package/package.json +17 -6
  87. package/dist/better-sqlite-backend-PII64VE6.js +0 -159
  88. package/dist/better-sqlite-backend-VUBVQ7SN.js +0 -209
  89. package/dist/better-sqlite-backend-Y3AQN65E.js +0 -159
  90. package/dist/better-sqlite-backend-Y3M7DXOX.js +0 -159
  91. package/dist/boot-middleware-FJDGVUM4.js +0 -9
  92. package/dist/boot-middleware-MLJUTLUM.js +0 -9
  93. package/dist/boot-middleware-ZZPDZNYR.js +0 -9
  94. package/dist/chunk-276LKLZR.js +0 -359
  95. package/dist/chunk-2CX5UCRV.js +0 -111
  96. package/dist/chunk-2ESYSVXG.js +0 -48
  97. package/dist/chunk-2I5JU73Y.js +0 -340
  98. package/dist/chunk-2UNSRRNB.js +0 -171
  99. package/dist/chunk-335UEHQR.js +0 -907
  100. package/dist/chunk-4CF2L46N.js +0 -29
  101. package/dist/chunk-5CINODKT.js +0 -41
  102. package/dist/chunk-5ESGWJ5L.js +0 -45
  103. package/dist/chunk-5FGLQGMF.js +0 -1676
  104. package/dist/chunk-5IQZFITY.js +0 -357
  105. package/dist/chunk-5JWFAQDW.js +0 -150
  106. package/dist/chunk-62UHTVU3.js +0 -141
  107. package/dist/chunk-66UJQT2I.js +0 -35
  108. package/dist/chunk-6RNNVOAS.js +0 -355
  109. package/dist/chunk-6X23PZ6H.js +0 -969
  110. package/dist/chunk-7C7LL6MB.js +0 -315
  111. package/dist/chunk-7F4HM3JG.js +0 -394
  112. package/dist/chunk-7KJ7T4D3.js +0 -910
  113. package/dist/chunk-7QQQNUB5.js +0 -92
  114. package/dist/chunk-7QWJBS72.js +0 -946
  115. package/dist/chunk-7R36OZK3.js +0 -957
  116. package/dist/chunk-7UPKCOHE.js +0 -946
  117. package/dist/chunk-A3BONW34.js +0 -35
  118. package/dist/chunk-AHMDVHBL.js +0 -141
  119. package/dist/chunk-AW6A4OZY.js +0 -171
  120. package/dist/chunk-BJ5EKCJ5.js +0 -458
  121. package/dist/chunk-BRGYDO7D.js +0 -223
  122. package/dist/chunk-C5KPSEDN.js +0 -359
  123. package/dist/chunk-CCTNYTUC.js +0 -940
  124. package/dist/chunk-CYQ2OVD2.js +0 -35
  125. package/dist/chunk-DDAK7YOE.js +0 -299
  126. package/dist/chunk-DRILKBY6.js +0 -965
  127. package/dist/chunk-DXE24HNN.js +0 -45
  128. package/dist/chunk-E7ICUNW7.js +0 -945
  129. package/dist/chunk-EAL2PUOE.js +0 -10022
  130. package/dist/chunk-ELT7MLZB.js +0 -109
  131. package/dist/chunk-EWEIRF6G.js +0 -171
  132. package/dist/chunk-F5VDGQJC.js +0 -120
  133. package/dist/chunk-FCPL3IEQ.js +0 -98
  134. package/dist/chunk-FDPKYSV7.js +0 -96
  135. package/dist/chunk-FES3TC24.js +0 -171
  136. package/dist/chunk-FOWKR5TW.js +0 -129
  137. package/dist/chunk-G3XIHPSQ.js +0 -361
  138. package/dist/chunk-GKJLYLVU.js +0 -359
  139. package/dist/chunk-GNXHXNVQ.js +0 -113
  140. package/dist/chunk-GSR6ILTM.js +0 -277
  141. package/dist/chunk-GWRIMRSX.js +0 -45
  142. package/dist/chunk-H72UW2HJ.js +0 -45
  143. package/dist/chunk-HGI74PXB.js +0 -7417
  144. package/dist/chunk-HGRA37LO.js +0 -145
  145. package/dist/chunk-HXSRQO3L.js +0 -145
  146. package/dist/chunk-IG2X2BVO.js +0 -373
  147. package/dist/chunk-IIJVDD54.js +0 -373
  148. package/dist/chunk-IX4BBOIT.js +0 -394
  149. package/dist/chunk-IXU4RMQM.js +0 -349
  150. package/dist/chunk-J6OUIION.js +0 -857
  151. package/dist/chunk-K46RNFDE.js +0 -171
  152. package/dist/chunk-KAGU2XMY.js +0 -359
  153. package/dist/chunk-KCVYJNVX.js +0 -394
  154. package/dist/chunk-KYLIQ3YI.js +0 -399
  155. package/dist/chunk-KZYJJIRN.js +0 -946
  156. package/dist/chunk-LFOX744K.js +0 -96
  157. package/dist/chunk-LHOVJEWR.js +0 -7403
  158. package/dist/chunk-LOPXTPF3.js +0 -120
  159. package/dist/chunk-LZR3VIFU.js +0 -907
  160. package/dist/chunk-MCKGQKYU.js +0 -15
  161. package/dist/chunk-MU6EOS6F.js +0 -0
  162. package/dist/chunk-MWRQ2TXT.js +0 -357
  163. package/dist/chunk-NO73OK2I.js +0 -102
  164. package/dist/chunk-NPE2YJHK.js +0 -394
  165. package/dist/chunk-NSDXU6QX.js +0 -2213
  166. package/dist/chunk-NXIRDSZ6.js +0 -145
  167. package/dist/chunk-NZWFNHCS.js +0 -407
  168. package/dist/chunk-OB4CMMX6.js +0 -260
  169. package/dist/chunk-OBKU74FU.js +0 -7411
  170. package/dist/chunk-OQNDWRDE.js +0 -145
  171. package/dist/chunk-OVWAJMB6.js +0 -394
  172. package/dist/chunk-PDHLBTTD.js +0 -45
  173. package/dist/chunk-PEQNRKLG.js +0 -210
  174. package/dist/chunk-QERIS7QY.js +0 -7403
  175. package/dist/chunk-QHA2DM3C.js +0 -373
  176. package/dist/chunk-QLM4HSYC.js +0 -45
  177. package/dist/chunk-S2OT3TQJ.js +0 -283
  178. package/dist/chunk-S5PHSN5K.js +0 -907
  179. package/dist/chunk-SIAA4J6H.js +0 -21
  180. package/dist/chunk-SQBNLUIA.js +0 -171
  181. package/dist/chunk-STLN6A6B.js +0 -355
  182. package/dist/chunk-U7HV7GU2.js +0 -17
  183. package/dist/chunk-UGZHOGRA.js +0 -39
  184. package/dist/chunk-UICF66FS.js +0 -359
  185. package/dist/chunk-UK3EQREE.js +0 -1078
  186. package/dist/chunk-UPKPURVY.js +0 -394
  187. package/dist/chunk-URC74VCN.js +0 -959
  188. package/dist/chunk-V3G7Q3QQ.js +0 -102
  189. package/dist/chunk-VUJ6SA55.js +0 -303
  190. package/dist/chunk-VUJQLIML.js +0 -141
  191. package/dist/chunk-VWKLKLYB.js +0 -267
  192. package/dist/chunk-VYC3RZMK.js +0 -277
  193. package/dist/chunk-WMERMSWI.js +0 -154
  194. package/dist/chunk-WMR777PO.js +0 -2213
  195. package/dist/chunk-X46IECAC.js +0 -517
  196. package/dist/chunk-XEN3OEYY.js +0 -2234
  197. package/dist/chunk-XZQ66K7A.js +0 -124
  198. package/dist/chunk-YY3GF7DH.js +0 -7411
  199. package/dist/chunk-ZE5R3H4C.js +0 -907
  200. package/dist/chunk-ZMN5LUB7.js +0 -7411
  201. package/dist/chunk-ZUV4MD5U.js +0 -94
  202. package/dist/config-KMY6RRK3.js +0 -19
  203. package/dist/config-VDMK2DUJ.js +0 -19
  204. package/dist/deploy-SO7AFK6L.js +0 -9
  205. package/dist/engine-7GXBM4IT.js +0 -7
  206. package/dist/engine-NSR6BIF7.js +0 -7
  207. package/dist/factory-2P64OC7M.js +0 -34
  208. package/dist/factory-YP4ZZK5K.js +0 -34
  209. package/dist/import-AJLYHFIA.js +0 -10
  210. package/dist/launch-explorer-AI6L2AWJ.js +0 -91
  211. package/dist/query-GJL3CVGN.js +0 -31
  212. package/dist/query-MBJSK3EB.js +0 -31
  213. package/dist/query-TJHEVSKL.js +0 -31
  214. package/dist/query-WUIKOHPE.js +0 -524
  215. package/dist/remote-manager-BLJZ6KF6.js +0 -224
  216. package/dist/remote-manager-BPYE46SI.js +0 -223
  217. package/dist/remote-manager-FMESEAFA.js +0 -224
  218. package/dist/remote-manager-K2WZ5RHY.js +0 -223
  219. package/dist/remote-manager-SG5PQKCH.js +0 -224
  220. package/dist/remote-manager-WGP6MIQZ.js +0 -224
  221. package/dist/sdk-3KBB3E6V.js +0 -16
  222. package/dist/sdk-4ZQO6UTU.js +0 -16
  223. package/dist/sdk-6JA6GV3G.js +0 -16
  224. package/dist/sdk-6VTP5UTZ.js +0 -16
  225. package/dist/sdk-7VS6TYCD.js +0 -16
  226. package/dist/sdk-HQ3FTLRT.js +0 -16
  227. package/dist/sdk-HZ7NU3XE.js +0 -15
  228. package/dist/sdk-KBQE2OXT.js +0 -16
  229. package/dist/sdk-MSCDZ7JU.js +0 -15
  230. package/dist/sdk-WNZOGO3S.js +0 -15
  231. package/dist/sdk-YLV33ZCW.js +0 -9
  232. package/dist/sdk-ZSUD2LLJ.js +0 -16
  233. package/dist/server-AFXFFBWA.js +0 -11
  234. package/dist/server-AGHC4VUL.js +0 -11
  235. package/dist/server-DBUY2KY5.js +0 -11
  236. package/dist/server-GWBQJPRG.js +0 -11
  237. package/dist/server-JZZFULVU.js +0 -11
  238. package/dist/server-L5XAF4M5.js +0 -11
  239. package/dist/server-NYFUHANA.js +0 -12
  240. package/dist/server-OABUB2LO.js +0 -12
  241. package/dist/server-P2CKZWWV.js +0 -12
  242. package/dist/sprites-XVSMQLSI.js +0 -15
  243. package/dist/sql-wasm-FORCZFHZ.js +0 -2148
  244. package/dist/sql-wasm-JZH76RLO.js +0 -2148
  245. package/dist/sqljs-backend-CJQOIQYE.js +0 -266
  246. package/dist/sqljs-backend-KWXBUDUO.js +0 -266
  247. package/dist/state-demo.bundle.js +0 -1033
  248. package/dist/tenancy-CBWYEVUB.js +0 -11
  249. package/dist/tenancy-FO6WVYFN.js +0 -13
  250. package/dist/tenancy-FWDBESMX.js +0 -14
  251. package/dist/tenancy-HGPIS5QA.js +0 -13
  252. package/dist/tenancy-HXFALA37.js +0 -14
  253. package/dist/tenancy-V7ARWNNV.js +0 -14
  254. package/dist/tenancy-ZDN4GXK5.js +0 -13
  255. package/dist/tenancy-ZT5VMY7B.js +0 -14
  256. package/dist/vm-config-YZRJ3KUB.js +0 -21
  257. /package/dist/{chunk-2BRTCEHB.js → chunk-PZ4XYZ4J.js} +0 -0
  258. /package/dist/{chunk-EO3J7GRP.js → chunk-WXSWA3MV.js} +0 -0
@@ -1,2148 +0,0 @@
1
- import {
2
- __commonJS,
3
- __require
4
- } from "./chunk-SIAA4J6H.js";
5
-
6
- // node_modules/.pnpm/sql.js@1.14.1/node_modules/sql.js/dist/sql-wasm.js
7
- var require_sql_wasm = __commonJS({
8
- "node_modules/.pnpm/sql.js@1.14.1/node_modules/sql.js/dist/sql-wasm.js"(exports, module) {
9
- var initSqlJsPromise = void 0;
10
- var initSqlJs = function(moduleConfig) {
11
- if (initSqlJsPromise) {
12
- return initSqlJsPromise;
13
- }
14
- initSqlJsPromise = new Promise(function(resolveModule, reject) {
15
- var Module = typeof moduleConfig !== "undefined" ? moduleConfig : {};
16
- var originalOnAbortFunction = Module["onAbort"];
17
- Module["onAbort"] = function(errorThatCausedAbort) {
18
- reject(new Error(errorThatCausedAbort));
19
- if (originalOnAbortFunction) {
20
- originalOnAbortFunction(errorThatCausedAbort);
21
- }
22
- };
23
- Module["postRun"] = Module["postRun"] || [];
24
- Module["postRun"].push(function() {
25
- resolveModule(Module);
26
- });
27
- module = void 0;
28
- var k;
29
- k ||= typeof Module != "undefined" ? Module : {};
30
- var aa = !!globalThis.window, ba = !!globalThis.WorkerGlobalScope, ca = globalThis.process?.versions?.node && "renderer" != globalThis.process?.type;
31
- k.onRuntimeInitialized = function() {
32
- function a(f, l) {
33
- switch (typeof l) {
34
- case "boolean":
35
- bc(f, l ? 1 : 0);
36
- break;
37
- case "number":
38
- cc(f, l);
39
- break;
40
- case "string":
41
- dc(f, l, -1, -1);
42
- break;
43
- case "object":
44
- if (null === l) lb(f);
45
- else if (null != l.length) {
46
- var n = da(l.length);
47
- m.set(l, n);
48
- ec(f, n, l.length, -1);
49
- ea(n);
50
- } else sa(f, "Wrong API use : tried to return a value of an unknown type (" + l + ").", -1);
51
- break;
52
- default:
53
- lb(f);
54
- }
55
- }
56
- function b(f, l) {
57
- for (var n = [], p = 0; p < f; p += 1) {
58
- var u = r(l + 4 * p, "i32"), v = fc(u);
59
- if (1 === v || 2 === v) u = gc(u);
60
- else if (3 === v) u = hc(u);
61
- else if (4 === v) {
62
- v = u;
63
- u = ic(v);
64
- v = jc(v);
65
- for (var K = new Uint8Array(u), I = 0; I < u; I += 1) K[I] = m[v + I];
66
- u = K;
67
- } else u = null;
68
- n.push(u);
69
- }
70
- return n;
71
- }
72
- function c(f, l) {
73
- this.Qa = f;
74
- this.db = l;
75
- this.Oa = 1;
76
- this.mb = [];
77
- }
78
- function d(f, l) {
79
- this.db = l;
80
- this.fb = fa(f);
81
- if (null === this.fb) throw Error("Unable to allocate memory for the SQL string");
82
- this.lb = this.fb;
83
- this.$a = this.sb = null;
84
- }
85
- function e(f) {
86
- this.filename = "dbfile_" + (4294967295 * Math.random() >>> 0);
87
- if (null != f) {
88
- var l = this.filename, n = "/", p = l;
89
- n && (n = "string" == typeof n ? n : ha(n), p = l ? ia(n + "/" + l) : n);
90
- l = ja(true, true);
91
- p = ka(
92
- p,
93
- l
94
- );
95
- if (f) {
96
- if ("string" == typeof f) {
97
- n = Array(f.length);
98
- for (var u = 0, v = f.length; u < v; ++u) n[u] = f.charCodeAt(u);
99
- f = n;
100
- }
101
- la(p, l | 146);
102
- n = ma(p, 577);
103
- na(n, f, 0, f.length, 0);
104
- oa(n);
105
- la(p, l);
106
- }
107
- }
108
- this.handleError(q(this.filename, g));
109
- this.db = r(g, "i32");
110
- ob(this.db);
111
- this.gb = {};
112
- this.Sa = {};
113
- }
114
- var g = y(4), h = k.cwrap, q = h("sqlite3_open", "number", ["string", "number"]), w = h("sqlite3_close_v2", "number", ["number"]), t = h("sqlite3_exec", "number", ["number", "string", "number", "number", "number"]), x = h("sqlite3_changes", "number", ["number"]), D = h(
115
- "sqlite3_prepare_v2",
116
- "number",
117
- ["number", "string", "number", "number", "number"]
118
- ), pb = h("sqlite3_sql", "string", ["number"]), lc = h("sqlite3_normalized_sql", "string", ["number"]), qb = h("sqlite3_prepare_v2", "number", ["number", "number", "number", "number", "number"]), mc = h("sqlite3_bind_text", "number", ["number", "number", "number", "number", "number"]), rb = h("sqlite3_bind_blob", "number", ["number", "number", "number", "number", "number"]), nc = h("sqlite3_bind_double", "number", ["number", "number", "number"]), oc = h("sqlite3_bind_int", "number", [
119
- "number",
120
- "number",
121
- "number"
122
- ]), pc = h("sqlite3_bind_parameter_index", "number", ["number", "string"]), qc = h("sqlite3_step", "number", ["number"]), rc = h("sqlite3_errmsg", "string", ["number"]), sc = h("sqlite3_column_count", "number", ["number"]), tc = h("sqlite3_data_count", "number", ["number"]), uc = h("sqlite3_column_double", "number", ["number", "number"]), sb = h("sqlite3_column_text", "string", ["number", "number"]), vc = h("sqlite3_column_blob", "number", ["number", "number"]), wc = h("sqlite3_column_bytes", "number", ["number", "number"]), xc = h(
123
- "sqlite3_column_type",
124
- "number",
125
- ["number", "number"]
126
- ), yc = h("sqlite3_column_name", "string", ["number", "number"]), zc = h("sqlite3_reset", "number", ["number"]), Ac = h("sqlite3_clear_bindings", "number", ["number"]), Bc = h("sqlite3_finalize", "number", ["number"]), tb = h("sqlite3_create_function_v2", "number", "number string number number number number number number number".split(" ")), fc = h("sqlite3_value_type", "number", ["number"]), ic = h("sqlite3_value_bytes", "number", ["number"]), hc = h("sqlite3_value_text", "string", ["number"]), jc = h(
127
- "sqlite3_value_blob",
128
- "number",
129
- ["number"]
130
- ), gc = h("sqlite3_value_double", "number", ["number"]), cc = h("sqlite3_result_double", "", ["number", "number"]), lb = h("sqlite3_result_null", "", ["number"]), dc = h("sqlite3_result_text", "", ["number", "string", "number", "number"]), ec = h("sqlite3_result_blob", "", ["number", "number", "number", "number"]), bc = h("sqlite3_result_int", "", ["number", "number"]), sa = h("sqlite3_result_error", "", ["number", "string", "number"]), ub = h("sqlite3_aggregate_context", "number", ["number", "number"]), ob = h(
131
- "RegisterExtensionFunctions",
132
- "number",
133
- ["number"]
134
- ), vb = h("sqlite3_update_hook", "number", ["number", "number", "number"]);
135
- c.prototype.bind = function(f) {
136
- if (!this.Qa) throw "Statement closed";
137
- this.reset();
138
- return Array.isArray(f) ? this.Gb(f) : null != f && "object" === typeof f ? this.Hb(f) : true;
139
- };
140
- c.prototype.step = function() {
141
- if (!this.Qa) throw "Statement closed";
142
- this.Oa = 1;
143
- var f = qc(this.Qa);
144
- switch (f) {
145
- case 100:
146
- return true;
147
- case 101:
148
- return false;
149
- default:
150
- throw this.db.handleError(f);
151
- }
152
- };
153
- c.prototype.Ab = function(f) {
154
- null == f && (f = this.Oa, this.Oa += 1);
155
- return uc(this.Qa, f);
156
- };
157
- c.prototype.Ob = function(f) {
158
- null == f && (f = this.Oa, this.Oa += 1);
159
- f = sb(this.Qa, f);
160
- if ("function" !== typeof BigInt) throw Error("BigInt is not supported");
161
- return BigInt(f);
162
- };
163
- c.prototype.Tb = function(f) {
164
- null == f && (f = this.Oa, this.Oa += 1);
165
- return sb(this.Qa, f);
166
- };
167
- c.prototype.getBlob = function(f) {
168
- null == f && (f = this.Oa, this.Oa += 1);
169
- var l = wc(this.Qa, f);
170
- f = vc(this.Qa, f);
171
- for (var n = new Uint8Array(l), p = 0; p < l; p += 1) n[p] = m[f + p];
172
- return n;
173
- };
174
- c.prototype.get = function(f, l) {
175
- l = l || {};
176
- null != f && this.bind(f) && this.step();
177
- f = [];
178
- for (var n = tc(this.Qa), p = 0; p < n; p += 1) switch (xc(this.Qa, p)) {
179
- case 1:
180
- var u = l.useBigInt ? this.Ob(p) : this.Ab(p);
181
- f.push(u);
182
- break;
183
- case 2:
184
- f.push(this.Ab(p));
185
- break;
186
- case 3:
187
- f.push(this.Tb(p));
188
- break;
189
- case 4:
190
- f.push(this.getBlob(p));
191
- break;
192
- default:
193
- f.push(null);
194
- }
195
- return f;
196
- };
197
- c.prototype.qb = function() {
198
- for (var f = [], l = sc(this.Qa), n = 0; n < l; n += 1) f.push(yc(this.Qa, n));
199
- return f;
200
- };
201
- c.prototype.zb = function(f, l) {
202
- f = this.get(f, l);
203
- l = this.qb();
204
- for (var n = {}, p = 0; p < l.length; p += 1) n[l[p]] = f[p];
205
- return n;
206
- };
207
- c.prototype.Sb = function() {
208
- return pb(this.Qa);
209
- };
210
- c.prototype.Pb = function() {
211
- return lc(this.Qa);
212
- };
213
- c.prototype.run = function(f) {
214
- null != f && this.bind(f);
215
- this.step();
216
- return this.reset();
217
- };
218
- c.prototype.wb = function(f, l) {
219
- null == l && (l = this.Oa, this.Oa += 1);
220
- f = fa(f);
221
- this.mb.push(f);
222
- this.db.handleError(mc(this.Qa, l, f, -1, 0));
223
- };
224
- c.prototype.Fb = function(f, l) {
225
- null == l && (l = this.Oa, this.Oa += 1);
226
- var n = da(f.length);
227
- m.set(f, n);
228
- this.mb.push(n);
229
- this.db.handleError(rb(this.Qa, l, n, f.length, 0));
230
- };
231
- c.prototype.vb = function(f, l) {
232
- null == l && (l = this.Oa, this.Oa += 1);
233
- this.db.handleError((f === (f | 0) ? oc : nc)(
234
- this.Qa,
235
- l,
236
- f
237
- ));
238
- };
239
- c.prototype.Ib = function(f) {
240
- null == f && (f = this.Oa, this.Oa += 1);
241
- rb(this.Qa, f, 0, 0, 0);
242
- };
243
- c.prototype.xb = function(f, l) {
244
- null == l && (l = this.Oa, this.Oa += 1);
245
- switch (typeof f) {
246
- case "string":
247
- this.wb(f, l);
248
- return;
249
- case "number":
250
- this.vb(f, l);
251
- return;
252
- case "bigint":
253
- this.wb(f.toString(), l);
254
- return;
255
- case "boolean":
256
- this.vb(f + 0, l);
257
- return;
258
- case "object":
259
- if (null === f) {
260
- this.Ib(l);
261
- return;
262
- }
263
- if (null != f.length) {
264
- this.Fb(f, l);
265
- return;
266
- }
267
- }
268
- throw "Wrong API use : tried to bind a value of an unknown type (" + f + ").";
269
- };
270
- c.prototype.Hb = function(f) {
271
- var l = this;
272
- Object.keys(f).forEach(function(n) {
273
- var p = pc(l.Qa, n);
274
- 0 !== p && l.xb(f[n], p);
275
- });
276
- return true;
277
- };
278
- c.prototype.Gb = function(f) {
279
- for (var l = 0; l < f.length; l += 1) this.xb(f[l], l + 1);
280
- return true;
281
- };
282
- c.prototype.reset = function() {
283
- this.freemem();
284
- return 0 === Ac(this.Qa) && 0 === zc(this.Qa);
285
- };
286
- c.prototype.freemem = function() {
287
- for (var f; void 0 !== (f = this.mb.pop()); ) ea(f);
288
- };
289
- c.prototype.Ya = function() {
290
- this.freemem();
291
- var f = 0 === Bc(this.Qa);
292
- delete this.db.gb[this.Qa];
293
- this.Qa = 0;
294
- return f;
295
- };
296
- d.prototype.next = function() {
297
- if (null === this.fb) return { done: true };
298
- null !== this.$a && (this.$a.Ya(), this.$a = null);
299
- if (!this.db.db) throw this.ob(), Error("Database closed");
300
- var f = pa(), l = y(4);
301
- qa(g);
302
- qa(l);
303
- try {
304
- this.db.handleError(qb(this.db.db, this.lb, -1, g, l));
305
- this.lb = r(l, "i32");
306
- var n = r(g, "i32");
307
- if (0 === n) return this.ob(), { done: true };
308
- this.$a = new c(n, this.db);
309
- this.db.gb[n] = this.$a;
310
- return { value: this.$a, done: false };
311
- } catch (p) {
312
- throw this.sb = z(this.lb), this.ob(), p;
313
- } finally {
314
- ra(f);
315
- }
316
- };
317
- d.prototype.ob = function() {
318
- ea(this.fb);
319
- this.fb = null;
320
- };
321
- d.prototype.Qb = function() {
322
- return null !== this.sb ? this.sb : z(this.lb);
323
- };
324
- "function" === typeof Symbol && "symbol" === typeof Symbol.iterator && (d.prototype[Symbol.iterator] = function() {
325
- return this;
326
- });
327
- e.prototype.run = function(f, l) {
328
- if (!this.db) throw "Database closed";
329
- if (l) {
330
- f = this.tb(f, l);
331
- try {
332
- f.step();
333
- } finally {
334
- f.Ya();
335
- }
336
- } else this.handleError(t(this.db, f, 0, 0, g));
337
- return this;
338
- };
339
- e.prototype.exec = function(f, l, n) {
340
- if (!this.db) throw "Database closed";
341
- var p = null, u = null, v = null;
342
- try {
343
- v = u = fa(f);
344
- var K = y(4);
345
- for (f = []; 0 !== r(v, "i8"); ) {
346
- qa(g);
347
- qa(K);
348
- this.handleError(qb(this.db, v, -1, g, K));
349
- var I = r(
350
- g,
351
- "i32"
352
- );
353
- v = r(K, "i32");
354
- if (0 !== I) {
355
- var H = null;
356
- p = new c(I, this);
357
- for (null != l && p.bind(l); p.step(); ) null === H && (H = { columns: p.qb(), values: [] }, f.push(H)), H.values.push(p.get(null, n));
358
- p.Ya();
359
- }
360
- }
361
- return f;
362
- } catch (L) {
363
- throw p && p.Ya(), L;
364
- } finally {
365
- u && ea(u);
366
- }
367
- };
368
- e.prototype.Mb = function(f, l, n, p, u) {
369
- "function" === typeof l && (p = n, n = l, l = void 0);
370
- f = this.tb(f, l);
371
- try {
372
- for (; f.step(); ) n(f.zb(null, u));
373
- } finally {
374
- f.Ya();
375
- }
376
- if ("function" === typeof p) return p();
377
- };
378
- e.prototype.tb = function(f, l) {
379
- qa(g);
380
- this.handleError(D(this.db, f, -1, g, 0));
381
- f = r(g, "i32");
382
- if (0 === f) throw "Nothing to prepare";
383
- var n = new c(f, this);
384
- null != l && n.bind(l);
385
- return this.gb[f] = n;
386
- };
387
- e.prototype.Ub = function(f) {
388
- return new d(f, this);
389
- };
390
- e.prototype.Nb = function() {
391
- Object.values(this.gb).forEach(function(l) {
392
- l.Ya();
393
- });
394
- Object.values(this.Sa).forEach(A);
395
- this.Sa = {};
396
- this.handleError(w(this.db));
397
- var f = ta(this.filename);
398
- this.handleError(q(this.filename, g));
399
- this.db = r(g, "i32");
400
- ob(this.db);
401
- return f;
402
- };
403
- e.prototype.close = function() {
404
- null !== this.db && (Object.values(this.gb).forEach(function(f) {
405
- f.Ya();
406
- }), Object.values(this.Sa).forEach(A), this.Sa = {}, this.Za && (A(this.Za), this.Za = void 0), this.handleError(w(this.db)), ua("/" + this.filename), this.db = null);
407
- };
408
- e.prototype.handleError = function(f) {
409
- if (0 === f) return null;
410
- f = rc(this.db);
411
- throw Error(f);
412
- };
413
- e.prototype.Rb = function() {
414
- return x(this.db);
415
- };
416
- e.prototype.Kb = function(f, l) {
417
- Object.prototype.hasOwnProperty.call(this.Sa, f) && (A(this.Sa[f]), delete this.Sa[f]);
418
- var n = va(function(p, u, v) {
419
- u = b(u, v);
420
- try {
421
- var K = l.apply(null, u);
422
- } catch (I) {
423
- sa(p, I, -1);
424
- return;
425
- }
426
- a(p, K);
427
- }, "viii");
428
- this.Sa[f] = n;
429
- this.handleError(tb(
430
- this.db,
431
- f,
432
- l.length,
433
- 1,
434
- 0,
435
- n,
436
- 0,
437
- 0,
438
- 0
439
- ));
440
- return this;
441
- };
442
- e.prototype.Jb = function(f, l) {
443
- var n = l.init || function() {
444
- return null;
445
- }, p = l.finalize || function(H) {
446
- return H;
447
- }, u = l.step;
448
- if (!u) throw "An aggregate function must have a step function in " + f;
449
- var v = {};
450
- Object.hasOwnProperty.call(this.Sa, f) && (A(this.Sa[f]), delete this.Sa[f]);
451
- l = f + "__finalize";
452
- Object.hasOwnProperty.call(this.Sa, l) && (A(this.Sa[l]), delete this.Sa[l]);
453
- var K = va(function(H, L, Pa) {
454
- var V = ub(H, 1);
455
- Object.hasOwnProperty.call(v, V) || (v[V] = n());
456
- L = b(L, Pa);
457
- L = [v[V]].concat(L);
458
- try {
459
- v[V] = u.apply(null, L);
460
- } catch (Dc) {
461
- delete v[V], sa(H, Dc, -1);
462
- }
463
- }, "viii"), I = va(function(H) {
464
- var L = ub(H, 1);
465
- try {
466
- var Pa = p(v[L]);
467
- } catch (V) {
468
- delete v[L];
469
- sa(H, V, -1);
470
- return;
471
- }
472
- a(H, Pa);
473
- delete v[L];
474
- }, "vi");
475
- this.Sa[f] = K;
476
- this.Sa[l] = I;
477
- this.handleError(tb(this.db, f, u.length - 1, 1, 0, 0, K, I, 0));
478
- return this;
479
- };
480
- e.prototype.Zb = function(f) {
481
- this.Za && (vb(this.db, 0, 0), A(this.Za), this.Za = void 0);
482
- if (!f) return this;
483
- this.Za = va(function(l, n, p, u, v) {
484
- switch (n) {
485
- case 18:
486
- l = "insert";
487
- break;
488
- case 23:
489
- l = "update";
490
- break;
491
- case 9:
492
- l = "delete";
493
- break;
494
- default:
495
- throw "unknown operationCode in updateHook callback: " + n;
496
- }
497
- p = z(p);
498
- u = z(u);
499
- if (v > Number.MAX_SAFE_INTEGER) throw "rowId too big to fit inside a Number";
500
- f(l, p, u, Number(v));
501
- }, "viiiij");
502
- vb(this.db, this.Za, 0);
503
- return this;
504
- };
505
- c.prototype.bind = c.prototype.bind;
506
- c.prototype.step = c.prototype.step;
507
- c.prototype.get = c.prototype.get;
508
- c.prototype.getColumnNames = c.prototype.qb;
509
- c.prototype.getAsObject = c.prototype.zb;
510
- c.prototype.getSQL = c.prototype.Sb;
511
- c.prototype.getNormalizedSQL = c.prototype.Pb;
512
- c.prototype.run = c.prototype.run;
513
- c.prototype.reset = c.prototype.reset;
514
- c.prototype.freemem = c.prototype.freemem;
515
- c.prototype.free = c.prototype.Ya;
516
- d.prototype.next = d.prototype.next;
517
- d.prototype.getRemainingSQL = d.prototype.Qb;
518
- e.prototype.run = e.prototype.run;
519
- e.prototype.exec = e.prototype.exec;
520
- e.prototype.each = e.prototype.Mb;
521
- e.prototype.prepare = e.prototype.tb;
522
- e.prototype.iterateStatements = e.prototype.Ub;
523
- e.prototype["export"] = e.prototype.Nb;
524
- e.prototype.close = e.prototype.close;
525
- e.prototype.handleError = e.prototype.handleError;
526
- e.prototype.getRowsModified = e.prototype.Rb;
527
- e.prototype.create_function = e.prototype.Kb;
528
- e.prototype.create_aggregate = e.prototype.Jb;
529
- e.prototype.updateHook = e.prototype.Zb;
530
- k.Database = e;
531
- };
532
- var wa = "./this.program", xa = (a, b) => {
533
- throw b;
534
- }, ya = globalThis.document?.currentScript?.src;
535
- "undefined" != typeof __filename ? ya = __filename : ba && (ya = self.location.href);
536
- var za = "", Aa, Ba;
537
- if (ca) {
538
- var fs = __require("node:fs");
539
- za = __dirname + "/";
540
- Ba = (a) => {
541
- a = Ca(a) ? new URL(a) : a;
542
- return fs.readFileSync(a);
543
- };
544
- Aa = async (a) => {
545
- a = Ca(a) ? new URL(a) : a;
546
- return fs.readFileSync(a, void 0);
547
- };
548
- 1 < process.argv.length && (wa = process.argv[1].replace(/\\/g, "/"));
549
- process.argv.slice(2);
550
- "undefined" != typeof module && (module.exports = k);
551
- xa = (a, b) => {
552
- process.exitCode = a;
553
- throw b;
554
- };
555
- } else if (aa || ba) {
556
- try {
557
- za = new URL(".", ya).href;
558
- } catch {
559
- }
560
- ba && (Ba = (a) => {
561
- var b = new XMLHttpRequest();
562
- b.open("GET", a, false);
563
- b.responseType = "arraybuffer";
564
- b.send(null);
565
- return new Uint8Array(b.response);
566
- });
567
- Aa = async (a) => {
568
- if (Ca(a)) return new Promise((c, d) => {
569
- var e = new XMLHttpRequest();
570
- e.open("GET", a, true);
571
- e.responseType = "arraybuffer";
572
- e.onload = () => {
573
- 200 == e.status || 0 == e.status && e.response ? c(e.response) : d(e.status);
574
- };
575
- e.onerror = d;
576
- e.send(null);
577
- });
578
- var b = await fetch(a, { credentials: "same-origin" });
579
- if (b.ok) return b.arrayBuffer();
580
- throw Error(b.status + " : " + b.url);
581
- };
582
- }
583
- var Da = console.log.bind(console), B = console.error.bind(console), Ea, Fa = false, Ga, Ca = (a) => a.startsWith("file://"), m, C, Ha, E, F, Ia, Ja, G;
584
- function Ka() {
585
- var a = La.buffer;
586
- m = new Int8Array(a);
587
- Ha = new Int16Array(a);
588
- C = new Uint8Array(a);
589
- new Uint16Array(a);
590
- E = new Int32Array(a);
591
- F = new Uint32Array(a);
592
- Ia = new Float32Array(a);
593
- Ja = new Float64Array(a);
594
- G = new BigInt64Array(a);
595
- new BigUint64Array(a);
596
- }
597
- function Ma(a) {
598
- k.onAbort?.(a);
599
- a = "Aborted(" + a + ")";
600
- B(a);
601
- Fa = true;
602
- throw new WebAssembly.RuntimeError(a + ". Build with -sASSERTIONS for more info.");
603
- }
604
- var Na;
605
- async function Oa(a) {
606
- if (!Ea) try {
607
- var b = await Aa(a);
608
- return new Uint8Array(b);
609
- } catch {
610
- }
611
- if (a == Na && Ea) a = new Uint8Array(Ea);
612
- else if (Ba) a = Ba(a);
613
- else throw "both async and sync fetching of the wasm failed";
614
- return a;
615
- }
616
- async function Qa(a, b) {
617
- try {
618
- var c = await Oa(a);
619
- return await WebAssembly.instantiate(c, b);
620
- } catch (d) {
621
- B(`failed to asynchronously prepare wasm: ${d}`), Ma(d);
622
- }
623
- }
624
- async function Ra(a) {
625
- var b = Na;
626
- if (!Ea && !Ca(b) && !ca) try {
627
- var c = fetch(b, { credentials: "same-origin" });
628
- return await WebAssembly.instantiateStreaming(c, a);
629
- } catch (d) {
630
- B(`wasm streaming compile failed: ${d}`), B("falling back to ArrayBuffer instantiation");
631
- }
632
- return Qa(b, a);
633
- }
634
- class Sa {
635
- name = "ExitStatus";
636
- constructor(a) {
637
- this.message = `Program terminated with exit(${a})`;
638
- this.status = a;
639
- }
640
- }
641
- var Ta = (a) => {
642
- for (; 0 < a.length; ) a.shift()(k);
643
- }, Ua = [], Va = [], Wa = () => {
644
- var a = k.preRun.shift();
645
- Va.push(a);
646
- }, J = 0, Xa = null;
647
- function r(a, b = "i8") {
648
- b.endsWith("*") && (b = "*");
649
- switch (b) {
650
- case "i1":
651
- return m[a];
652
- case "i8":
653
- return m[a];
654
- case "i16":
655
- return Ha[a >> 1];
656
- case "i32":
657
- return E[a >> 2];
658
- case "i64":
659
- return G[a >> 3];
660
- case "float":
661
- return Ia[a >> 2];
662
- case "double":
663
- return Ja[a >> 3];
664
- case "*":
665
- return F[a >> 2];
666
- default:
667
- Ma(`invalid type for getValue: ${b}`);
668
- }
669
- }
670
- var Ya = true;
671
- function qa(a) {
672
- var b = "i32";
673
- b.endsWith("*") && (b = "*");
674
- switch (b) {
675
- case "i1":
676
- m[a] = 0;
677
- break;
678
- case "i8":
679
- m[a] = 0;
680
- break;
681
- case "i16":
682
- Ha[a >> 1] = 0;
683
- break;
684
- case "i32":
685
- E[a >> 2] = 0;
686
- break;
687
- case "i64":
688
- G[a >> 3] = BigInt(0);
689
- break;
690
- case "float":
691
- Ia[a >> 2] = 0;
692
- break;
693
- case "double":
694
- Ja[a >> 3] = 0;
695
- break;
696
- case "*":
697
- F[a >> 2] = 0;
698
- break;
699
- default:
700
- Ma(`invalid type for setValue: ${b}`);
701
- }
702
- }
703
- var Za = new TextDecoder(), $a = (a, b, c, d) => {
704
- c = b + c;
705
- if (d) return c;
706
- for (; a[b] && !(b >= c); ) ++b;
707
- return b;
708
- }, z = (a, b, c) => a ? Za.decode(C.subarray(a, $a(C, a, b, c))) : "", ab = (a, b) => {
709
- for (var c = 0, d = a.length - 1; 0 <= d; d--) {
710
- var e = a[d];
711
- "." === e ? a.splice(d, 1) : ".." === e ? (a.splice(d, 1), c++) : c && (a.splice(d, 1), c--);
712
- }
713
- if (b) for (; c; c--) a.unshift("..");
714
- return a;
715
- }, ia = (a) => {
716
- var b = "/" === a.charAt(0), c = "/" === a.slice(-1);
717
- (a = ab(a.split("/").filter((d) => !!d), !b).join("/")) || b || (a = ".");
718
- a && c && (a += "/");
719
- return (b ? "/" : "") + a;
720
- }, bb = (a) => {
721
- var b = /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(a).slice(1);
722
- a = b[0];
723
- b = b[1];
724
- if (!a && !b) return ".";
725
- b &&= b.slice(0, -1);
726
- return a + b;
727
- }, cb = (a) => a && a.match(/([^\/]+|\/)\/*$/)[1], db = () => {
728
- if (ca) {
729
- var a = __require("node:crypto");
730
- return (b) => a.randomFillSync(b);
731
- }
732
- return (b) => crypto.getRandomValues(b);
733
- }, eb = (a) => {
734
- (eb = db())(a);
735
- }, fb = (...a) => {
736
- for (var b = "", c = false, d = a.length - 1; -1 <= d && !c; d--) {
737
- c = 0 <= d ? a[d] : "/";
738
- if ("string" != typeof c) throw new TypeError("Arguments to path.resolve must be strings");
739
- if (!c) return "";
740
- b = c + "/" + b;
741
- c = "/" === c.charAt(0);
742
- }
743
- b = ab(b.split("/").filter((e) => !!e), !c).join("/");
744
- return (c ? "/" : "") + b || ".";
745
- }, gb = (a) => {
746
- var b = $a(a, 0);
747
- return Za.decode(a.buffer ? a.subarray(0, b) : new Uint8Array(a.slice(0, b)));
748
- }, hb = [], ib = (a) => {
749
- for (var b = 0, c = 0; c < a.length; ++c) {
750
- var d = a.charCodeAt(c);
751
- 127 >= d ? b++ : 2047 >= d ? b += 2 : 55296 <= d && 57343 >= d ? (b += 4, ++c) : b += 3;
752
- }
753
- return b;
754
- }, M = (a, b, c, d) => {
755
- if (!(0 < d)) return 0;
756
- var e = c;
757
- d = c + d - 1;
758
- for (var g = 0; g < a.length; ++g) {
759
- var h = a.codePointAt(g);
760
- if (127 >= h) {
761
- if (c >= d) break;
762
- b[c++] = h;
763
- } else if (2047 >= h) {
764
- if (c + 1 >= d) break;
765
- b[c++] = 192 | h >> 6;
766
- b[c++] = 128 | h & 63;
767
- } else if (65535 >= h) {
768
- if (c + 2 >= d) break;
769
- b[c++] = 224 | h >> 12;
770
- b[c++] = 128 | h >> 6 & 63;
771
- b[c++] = 128 | h & 63;
772
- } else {
773
- if (c + 3 >= d) break;
774
- b[c++] = 240 | h >> 18;
775
- b[c++] = 128 | h >> 12 & 63;
776
- b[c++] = 128 | h >> 6 & 63;
777
- b[c++] = 128 | h & 63;
778
- g++;
779
- }
780
- }
781
- b[c] = 0;
782
- return c - e;
783
- }, jb = [];
784
- function kb(a, b) {
785
- jb[a] = { input: [], output: [], eb: b };
786
- mb(a, nb);
787
- }
788
- var nb = { open(a) {
789
- var b = jb[a.node.rdev];
790
- if (!b) throw new N(43);
791
- a.tty = b;
792
- a.seekable = false;
793
- }, close(a) {
794
- a.tty.eb.fsync(a.tty);
795
- }, fsync(a) {
796
- a.tty.eb.fsync(a.tty);
797
- }, read(a, b, c, d) {
798
- if (!a.tty || !a.tty.eb.Bb) throw new N(60);
799
- for (var e = 0, g = 0; g < d; g++) {
800
- try {
801
- var h = a.tty.eb.Bb(a.tty);
802
- } catch (q) {
803
- throw new N(29);
804
- }
805
- if (void 0 === h && 0 === e) throw new N(6);
806
- if (null === h || void 0 === h) break;
807
- e++;
808
- b[c + g] = h;
809
- }
810
- e && (a.node.atime = Date.now());
811
- return e;
812
- }, write(a, b, c, d) {
813
- if (!a.tty || !a.tty.eb.ub) throw new N(60);
814
- try {
815
- for (var e = 0; e < d; e++) a.tty.eb.ub(a.tty, b[c + e]);
816
- } catch (g) {
817
- throw new N(29);
818
- }
819
- d && (a.node.mtime = a.node.ctime = Date.now());
820
- return e;
821
- } }, wb = { Bb() {
822
- a: {
823
- if (!hb.length) {
824
- var a = null;
825
- if (ca) {
826
- var b = Buffer.alloc(256), c = 0, d = process.stdin.fd;
827
- try {
828
- c = fs.readSync(d, b, 0, 256);
829
- } catch (e) {
830
- if (e.toString().includes("EOF")) c = 0;
831
- else throw e;
832
- }
833
- 0 < c && (a = b.slice(0, c).toString("utf-8"));
834
- } else globalThis.window?.prompt && (a = window.prompt("Input: "), null !== a && (a += "\n"));
835
- if (!a) {
836
- a = null;
837
- break a;
838
- }
839
- b = Array(ib(a) + 1);
840
- a = M(a, b, 0, b.length);
841
- b.length = a;
842
- hb = b;
843
- }
844
- a = hb.shift();
845
- }
846
- return a;
847
- }, ub(a, b) {
848
- null === b || 10 === b ? (Da(gb(a.output)), a.output = []) : 0 != b && a.output.push(b);
849
- }, fsync(a) {
850
- 0 < a.output?.length && (Da(gb(a.output)), a.output = []);
851
- }, hc() {
852
- return { bc: 25856, dc: 5, ac: 191, cc: 35387, $b: [3, 28, 127, 21, 4, 0, 1, 0, 17, 19, 26, 0, 18, 15, 23, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] };
853
- }, ic() {
854
- return 0;
855
- }, jc() {
856
- return [24, 80];
857
- } }, xb = { ub(a, b) {
858
- null === b || 10 === b ? (B(gb(a.output)), a.output = []) : 0 != b && a.output.push(b);
859
- }, fsync(a) {
860
- 0 < a.output?.length && (B(gb(a.output)), a.output = []);
861
- } }, O = { Wa: null, Xa() {
862
- return O.createNode(null, "/", 16895, 0);
863
- }, createNode(a, b, c, d) {
864
- if (24576 === (c & 61440) || 4096 === (c & 61440)) throw new N(63);
865
- O.Wa || (O.Wa = { dir: { node: { Ta: O.La.Ta, Ua: O.La.Ua, lookup: O.La.lookup, ib: O.La.ib, rename: O.La.rename, unlink: O.La.unlink, rmdir: O.La.rmdir, readdir: O.La.readdir, symlink: O.La.symlink }, stream: { Va: O.Ma.Va } }, file: { node: { Ta: O.La.Ta, Ua: O.La.Ua }, stream: { Va: O.Ma.Va, read: O.Ma.read, write: O.Ma.write, jb: O.Ma.jb, kb: O.Ma.kb } }, link: { node: { Ta: O.La.Ta, Ua: O.La.Ua, readlink: O.La.readlink }, stream: {} }, yb: { node: { Ta: O.La.Ta, Ua: O.La.Ua }, stream: yb } });
866
- c = zb(a, b, c, d);
867
- P(c.mode) ? (c.La = O.Wa.dir.node, c.Ma = O.Wa.dir.stream, c.Na = {}) : 32768 === (c.mode & 61440) ? (c.La = O.Wa.file.node, c.Ma = O.Wa.file.stream, c.Ra = 0, c.Na = null) : 40960 === (c.mode & 61440) ? (c.La = O.Wa.link.node, c.Ma = O.Wa.link.stream) : 8192 === (c.mode & 61440) && (c.La = O.Wa.yb.node, c.Ma = O.Wa.yb.stream);
868
- c.atime = c.mtime = c.ctime = Date.now();
869
- a && (a.Na[b] = c, a.atime = a.mtime = a.ctime = c.atime);
870
- return c;
871
- }, fc(a) {
872
- return a.Na ? a.Na.subarray ? a.Na.subarray(0, a.Ra) : new Uint8Array(a.Na) : new Uint8Array(0);
873
- }, La: {
874
- Ta(a) {
875
- var b = {};
876
- b.dev = 8192 === (a.mode & 61440) ? a.id : 1;
877
- b.ino = a.id;
878
- b.mode = a.mode;
879
- b.nlink = 1;
880
- b.uid = 0;
881
- b.gid = 0;
882
- b.rdev = a.rdev;
883
- P(a.mode) ? b.size = 4096 : 32768 === (a.mode & 61440) ? b.size = a.Ra : 40960 === (a.mode & 61440) ? b.size = a.link.length : b.size = 0;
884
- b.atime = new Date(a.atime);
885
- b.mtime = new Date(a.mtime);
886
- b.ctime = new Date(a.ctime);
887
- b.blksize = 4096;
888
- b.blocks = Math.ceil(b.size / b.blksize);
889
- return b;
890
- },
891
- Ua(a, b) {
892
- for (var c of ["mode", "atime", "mtime", "ctime"]) null != b[c] && (a[c] = b[c]);
893
- void 0 !== b.size && (b = b.size, a.Ra != b && (0 == b ? (a.Na = null, a.Ra = 0) : (c = a.Na, a.Na = new Uint8Array(b), c && a.Na.set(c.subarray(0, Math.min(b, a.Ra))), a.Ra = b)));
894
- },
895
- lookup() {
896
- O.nb || (O.nb = new N(44), O.nb.stack = "<generic error, no stack>");
897
- throw O.nb;
898
- },
899
- ib(a, b, c, d) {
900
- return O.createNode(a, b, c, d);
901
- },
902
- rename(a, b, c) {
903
- try {
904
- var d = Q(b, c);
905
- } catch (g) {
906
- }
907
- if (d) {
908
- if (P(a.mode)) for (var e in d.Na) throw new N(55);
909
- Ab(d);
910
- }
911
- delete a.parent.Na[a.name];
912
- b.Na[c] = a;
913
- a.name = c;
914
- b.ctime = b.mtime = a.parent.ctime = a.parent.mtime = Date.now();
915
- },
916
- unlink(a, b) {
917
- delete a.Na[b];
918
- a.ctime = a.mtime = Date.now();
919
- },
920
- rmdir(a, b) {
921
- var c = Q(a, b), d;
922
- for (d in c.Na) throw new N(55);
923
- delete a.Na[b];
924
- a.ctime = a.mtime = Date.now();
925
- },
926
- readdir(a) {
927
- return [".", "..", ...Object.keys(a.Na)];
928
- },
929
- symlink(a, b, c) {
930
- a = O.createNode(a, b, 41471, 0);
931
- a.link = c;
932
- return a;
933
- },
934
- readlink(a) {
935
- if (40960 !== (a.mode & 61440)) throw new N(28);
936
- return a.link;
937
- }
938
- }, Ma: { read(a, b, c, d, e) {
939
- var g = a.node.Na;
940
- if (e >= a.node.Ra) return 0;
941
- a = Math.min(a.node.Ra - e, d);
942
- if (8 < a && g.subarray) b.set(g.subarray(e, e + a), c);
943
- else for (d = 0; d < a; d++) b[c + d] = g[e + d];
944
- return a;
945
- }, write(a, b, c, d, e, g) {
946
- b.buffer === m.buffer && (g = false);
947
- if (!d) return 0;
948
- a = a.node;
949
- a.mtime = a.ctime = Date.now();
950
- if (b.subarray && (!a.Na || a.Na.subarray)) {
951
- if (g) return a.Na = b.subarray(c, c + d), a.Ra = d;
952
- if (0 === a.Ra && 0 === e) return a.Na = b.slice(c, c + d), a.Ra = d;
953
- if (e + d <= a.Ra) return a.Na.set(b.subarray(c, c + d), e), d;
954
- }
955
- g = e + d;
956
- var h = a.Na ? a.Na.length : 0;
957
- h >= g || (g = Math.max(g, h * (1048576 > h ? 2 : 1.125) >>> 0), 0 != h && (g = Math.max(g, 256)), h = a.Na, a.Na = new Uint8Array(g), 0 < a.Ra && a.Na.set(h.subarray(0, a.Ra), 0));
958
- if (a.Na.subarray && b.subarray) a.Na.set(b.subarray(c, c + d), e);
959
- else for (g = 0; g < d; g++) a.Na[e + g] = b[c + g];
960
- a.Ra = Math.max(a.Ra, e + d);
961
- return d;
962
- }, Va(a, b, c) {
963
- 1 === c ? b += a.position : 2 === c && 32768 === (a.node.mode & 61440) && (b += a.node.Ra);
964
- if (0 > b) throw new N(28);
965
- return b;
966
- }, jb(a, b, c, d, e) {
967
- if (32768 !== (a.node.mode & 61440)) throw new N(43);
968
- a = a.node.Na;
969
- if (e & 2 || !a || a.buffer !== m.buffer) {
970
- e = true;
971
- d = 65536 * Math.ceil(b / 65536);
972
- var g = Bb(65536, d);
973
- g && C.fill(0, g, g + d);
974
- d = g;
975
- if (!d) throw new N(48);
976
- if (a) {
977
- if (0 < c || c + b < a.length) a.subarray ? a = a.subarray(c, c + b) : a = Array.prototype.slice.call(a, c, c + b);
978
- m.set(a, d);
979
- }
980
- } else e = false, d = a.byteOffset;
981
- return { Xb: d, Eb: e };
982
- }, kb(a, b, c, d) {
983
- O.Ma.write(a, b, 0, d, c, false);
984
- return 0;
985
- } } }, ja = (a, b) => {
986
- var c = 0;
987
- a && (c |= 365);
988
- b && (c |= 146);
989
- return c;
990
- }, Cb = null, Db = {}, Eb = [], Fb = 1, R = null, Gb = false, Hb = true, N = class {
991
- name = "ErrnoError";
992
- constructor(a) {
993
- this.Pa = a;
994
- }
995
- }, Ib = class {
996
- hb = {};
997
- node = null;
998
- get flags() {
999
- return this.hb.flags;
1000
- }
1001
- set flags(a) {
1002
- this.hb.flags = a;
1003
- }
1004
- get position() {
1005
- return this.hb.position;
1006
- }
1007
- set position(a) {
1008
- this.hb.position = a;
1009
- }
1010
- }, Jb = class {
1011
- La = {};
1012
- Ma = {};
1013
- bb = null;
1014
- constructor(a, b, c, d) {
1015
- a ||= this;
1016
- this.parent = a;
1017
- this.Xa = a.Xa;
1018
- this.id = Fb++;
1019
- this.name = b;
1020
- this.mode = c;
1021
- this.rdev = d;
1022
- this.atime = this.mtime = this.ctime = Date.now();
1023
- }
1024
- get read() {
1025
- return 365 === (this.mode & 365);
1026
- }
1027
- set read(a) {
1028
- a ? this.mode |= 365 : this.mode &= -366;
1029
- }
1030
- get write() {
1031
- return 146 === (this.mode & 146);
1032
- }
1033
- set write(a) {
1034
- a ? this.mode |= 146 : this.mode &= -147;
1035
- }
1036
- };
1037
- function S(a, b = {}) {
1038
- if (!a) throw new N(44);
1039
- b.pb ?? (b.pb = true);
1040
- "/" === a.charAt(0) || (a = "//" + a);
1041
- var c = 0;
1042
- a: for (; 40 > c; c++) {
1043
- a = a.split("/").filter((q) => !!q);
1044
- for (var d = Cb, e = "/", g = 0; g < a.length; g++) {
1045
- var h = g === a.length - 1;
1046
- if (h && b.parent) break;
1047
- if ("." !== a[g]) if (".." === a[g]) if (e = bb(e), d === d.parent) {
1048
- a = e + "/" + a.slice(g + 1).join("/");
1049
- c--;
1050
- continue a;
1051
- } else d = d.parent;
1052
- else {
1053
- e = ia(e + "/" + a[g]);
1054
- try {
1055
- d = Q(d, a[g]);
1056
- } catch (q) {
1057
- if (44 === q?.Pa && h && b.Wb) return { path: e };
1058
- throw q;
1059
- }
1060
- !d.bb || h && !b.pb || (d = d.bb.root);
1061
- if (40960 === (d.mode & 61440) && (!h || b.ab)) {
1062
- if (!d.La.readlink) throw new N(52);
1063
- d = d.La.readlink(d);
1064
- "/" === d.charAt(0) || (d = bb(e) + "/" + d);
1065
- a = d + "/" + a.slice(g + 1).join("/");
1066
- continue a;
1067
- }
1068
- }
1069
- }
1070
- return { path: e, node: d };
1071
- }
1072
- throw new N(32);
1073
- }
1074
- function ha(a) {
1075
- for (var b; ; ) {
1076
- if (a === a.parent) return a = a.Xa.Db, b ? "/" !== a[a.length - 1] ? `${a}/${b}` : a + b : a;
1077
- b = b ? `${a.name}/${b}` : a.name;
1078
- a = a.parent;
1079
- }
1080
- }
1081
- function Kb(a, b) {
1082
- for (var c = 0, d = 0; d < b.length; d++) c = (c << 5) - c + b.charCodeAt(d) | 0;
1083
- return (a + c >>> 0) % R.length;
1084
- }
1085
- function Ab(a) {
1086
- var b = Kb(a.parent.id, a.name);
1087
- if (R[b] === a) R[b] = a.cb;
1088
- else for (b = R[b]; b; ) {
1089
- if (b.cb === a) {
1090
- b.cb = a.cb;
1091
- break;
1092
- }
1093
- b = b.cb;
1094
- }
1095
- }
1096
- function Q(a, b) {
1097
- var c = P(a.mode) ? (c = Lb(a, "x")) ? c : a.La.lookup ? 0 : 2 : 54;
1098
- if (c) throw new N(c);
1099
- for (c = R[Kb(a.id, b)]; c; c = c.cb) {
1100
- var d = c.name;
1101
- if (c.parent.id === a.id && d === b) return c;
1102
- }
1103
- return a.La.lookup(a, b);
1104
- }
1105
- function zb(a, b, c, d) {
1106
- a = new Jb(a, b, c, d);
1107
- b = Kb(a.parent.id, a.name);
1108
- a.cb = R[b];
1109
- return R[b] = a;
1110
- }
1111
- function P(a) {
1112
- return 16384 === (a & 61440);
1113
- }
1114
- function Lb(a, b) {
1115
- return Hb ? 0 : b.includes("r") && !(a.mode & 292) || b.includes("w") && !(a.mode & 146) || b.includes("x") && !(a.mode & 73) ? 2 : 0;
1116
- }
1117
- function Mb(a, b) {
1118
- if (!P(a.mode)) return 54;
1119
- try {
1120
- return Q(a, b), 20;
1121
- } catch (c) {
1122
- }
1123
- return Lb(a, "wx");
1124
- }
1125
- function Nb(a, b, c) {
1126
- try {
1127
- var d = Q(a, b);
1128
- } catch (e) {
1129
- return e.Pa;
1130
- }
1131
- if (a = Lb(a, "wx")) return a;
1132
- if (c) {
1133
- if (!P(d.mode)) return 54;
1134
- if (d === d.parent || "/" === ha(d)) return 10;
1135
- } else if (P(d.mode)) return 31;
1136
- return 0;
1137
- }
1138
- function Ob(a) {
1139
- if (!a) throw new N(63);
1140
- return a;
1141
- }
1142
- function T(a) {
1143
- a = Eb[a];
1144
- if (!a) throw new N(8);
1145
- return a;
1146
- }
1147
- function Pb(a, b = -1) {
1148
- a = Object.assign(new Ib(), a);
1149
- if (-1 == b) a: {
1150
- for (b = 0; 4096 >= b; b++) if (!Eb[b]) break a;
1151
- throw new N(33);
1152
- }
1153
- a.fd = b;
1154
- return Eb[b] = a;
1155
- }
1156
- function Qb(a, b = -1) {
1157
- a = Pb(a, b);
1158
- a.Ma?.ec?.(a);
1159
- return a;
1160
- }
1161
- function Rb(a, b, c) {
1162
- var d = a?.Ma.Ua;
1163
- a = d ? a : b;
1164
- d ??= b.La.Ua;
1165
- Ob(d);
1166
- d(a, c);
1167
- }
1168
- var yb = { open(a) {
1169
- a.Ma = Db[a.node.rdev].Ma;
1170
- a.Ma.open?.(a);
1171
- }, Va() {
1172
- throw new N(70);
1173
- } };
1174
- function mb(a, b) {
1175
- Db[a] = { Ma: b };
1176
- }
1177
- function Sb(a, b) {
1178
- var c = "/" === b;
1179
- if (c && Cb) throw new N(10);
1180
- if (!c && b) {
1181
- var d = S(b, { pb: false });
1182
- b = d.path;
1183
- d = d.node;
1184
- if (d.bb) throw new N(10);
1185
- if (!P(d.mode)) throw new N(54);
1186
- }
1187
- b = { type: a, kc: {}, Db: b, Vb: [] };
1188
- a = a.Xa(b);
1189
- a.Xa = b;
1190
- b.root = a;
1191
- c ? Cb = a : d && (d.bb = b, d.Xa && d.Xa.Vb.push(b));
1192
- }
1193
- function Tb(a, b, c) {
1194
- var d = S(a, { parent: true }).node;
1195
- a = cb(a);
1196
- if (!a) throw new N(28);
1197
- if ("." === a || ".." === a) throw new N(20);
1198
- var e = Mb(d, a);
1199
- if (e) throw new N(e);
1200
- if (!d.La.ib) throw new N(63);
1201
- return d.La.ib(d, a, b, c);
1202
- }
1203
- function ka(a, b = 438) {
1204
- return Tb(a, b & 4095 | 32768, 0);
1205
- }
1206
- function U(a, b = 511) {
1207
- return Tb(a, b & 1023 | 16384, 0);
1208
- }
1209
- function Ub(a, b, c) {
1210
- "undefined" == typeof c && (c = b, b = 438);
1211
- Tb(a, b | 8192, c);
1212
- }
1213
- function Vb(a, b) {
1214
- if (!fb(a)) throw new N(44);
1215
- var c = S(b, { parent: true }).node;
1216
- if (!c) throw new N(44);
1217
- b = cb(b);
1218
- var d = Mb(c, b);
1219
- if (d) throw new N(d);
1220
- if (!c.La.symlink) throw new N(63);
1221
- c.La.symlink(c, b, a);
1222
- }
1223
- function Wb(a) {
1224
- var b = S(a, { parent: true }).node;
1225
- a = cb(a);
1226
- var c = Q(b, a), d = Nb(b, a, true);
1227
- if (d) throw new N(d);
1228
- if (!b.La.rmdir) throw new N(63);
1229
- if (c.bb) throw new N(10);
1230
- b.La.rmdir(b, a);
1231
- Ab(c);
1232
- }
1233
- function ua(a) {
1234
- var b = S(a, { parent: true }).node;
1235
- if (!b) throw new N(44);
1236
- a = cb(a);
1237
- var c = Q(b, a), d = Nb(b, a, false);
1238
- if (d) throw new N(d);
1239
- if (!b.La.unlink) throw new N(63);
1240
- if (c.bb) throw new N(10);
1241
- b.La.unlink(b, a);
1242
- Ab(c);
1243
- }
1244
- function Xb(a, b) {
1245
- a = S(a, { ab: !b }).node;
1246
- return Ob(a.La.Ta)(a);
1247
- }
1248
- function Yb(a, b, c, d) {
1249
- Rb(a, b, { mode: c & 4095 | b.mode & -4096, ctime: Date.now(), Lb: d });
1250
- }
1251
- function la(a, b) {
1252
- a = "string" == typeof a ? S(a, { ab: true }).node : a;
1253
- Yb(null, a, b);
1254
- }
1255
- function Zb(a, b, c) {
1256
- if (P(b.mode)) throw new N(31);
1257
- if (32768 !== (b.mode & 61440)) throw new N(28);
1258
- var d = Lb(b, "w");
1259
- if (d) throw new N(d);
1260
- Rb(a, b, { size: c, timestamp: Date.now() });
1261
- }
1262
- function ma(a, b, c = 438) {
1263
- if ("" === a) throw new N(44);
1264
- if ("string" == typeof b) {
1265
- var d = { r: 0, "r+": 2, w: 577, "w+": 578, a: 1089, "a+": 1090 }[b];
1266
- if ("undefined" == typeof d) throw Error(`Unknown file open mode: ${b}`);
1267
- b = d;
1268
- }
1269
- c = b & 64 ? c & 4095 | 32768 : 0;
1270
- if ("object" == typeof a) d = a;
1271
- else {
1272
- var e = a.endsWith("/");
1273
- var g = S(a, { ab: !(b & 131072), Wb: true });
1274
- d = g.node;
1275
- a = g.path;
1276
- }
1277
- g = false;
1278
- if (b & 64) if (d) {
1279
- if (b & 128) throw new N(20);
1280
- } else {
1281
- if (e) throw new N(31);
1282
- d = Tb(a, c | 511, 0);
1283
- g = true;
1284
- }
1285
- if (!d) throw new N(44);
1286
- 8192 === (d.mode & 61440) && (b &= -513);
1287
- if (b & 65536 && !P(d.mode)) throw new N(54);
1288
- if (!g && (d ? 40960 === (d.mode & 61440) ? e = 32 : (e = ["r", "w", "rw"][b & 3], b & 512 && (e += "w"), e = P(d.mode) && ("r" !== e || b & 576) ? 31 : Lb(d, e)) : e = 44, e)) throw new N(e);
1289
- b & 512 && !g && (e = d, e = "string" == typeof e ? S(e, { ab: true }).node : e, Zb(null, e, 0));
1290
- b = Pb({ node: d, path: ha(d), flags: b & -131713, seekable: true, position: 0, Ma: d.Ma, Yb: [], error: false });
1291
- b.Ma.open && b.Ma.open(b);
1292
- g && la(d, c & 511);
1293
- return b;
1294
- }
1295
- function oa(a) {
1296
- if (null === a.fd) throw new N(8);
1297
- a.rb && (a.rb = null);
1298
- try {
1299
- a.Ma.close && a.Ma.close(a);
1300
- } catch (b) {
1301
- throw b;
1302
- } finally {
1303
- Eb[a.fd] = null;
1304
- }
1305
- a.fd = null;
1306
- }
1307
- function $b(a, b, c) {
1308
- if (null === a.fd) throw new N(8);
1309
- if (!a.seekable || !a.Ma.Va) throw new N(70);
1310
- if (0 != c && 1 != c && 2 != c) throw new N(28);
1311
- a.position = a.Ma.Va(a, b, c);
1312
- a.Yb = [];
1313
- }
1314
- function ac(a, b, c, d, e) {
1315
- if (0 > d || 0 > e) throw new N(28);
1316
- if (null === a.fd) throw new N(8);
1317
- if (1 === (a.flags & 2097155)) throw new N(8);
1318
- if (P(a.node.mode)) throw new N(31);
1319
- if (!a.Ma.read) throw new N(28);
1320
- var g = "undefined" != typeof e;
1321
- if (!g) e = a.position;
1322
- else if (!a.seekable) throw new N(70);
1323
- b = a.Ma.read(a, b, c, d, e);
1324
- g || (a.position += b);
1325
- return b;
1326
- }
1327
- function na(a, b, c, d, e) {
1328
- if (0 > d || 0 > e) throw new N(28);
1329
- if (null === a.fd) throw new N(8);
1330
- if (0 === (a.flags & 2097155)) throw new N(8);
1331
- if (P(a.node.mode)) throw new N(31);
1332
- if (!a.Ma.write) throw new N(28);
1333
- a.seekable && a.flags & 1024 && $b(a, 0, 2);
1334
- var g = "undefined" != typeof e;
1335
- if (!g) e = a.position;
1336
- else if (!a.seekable) throw new N(70);
1337
- b = a.Ma.write(a, b, c, d, e, void 0);
1338
- g || (a.position += b);
1339
- return b;
1340
- }
1341
- function ta(a) {
1342
- var b = b || 0;
1343
- var c = "binary";
1344
- "utf8" !== c && "binary" !== c && Ma(`Invalid encoding type "${c}"`);
1345
- b = ma(a, b);
1346
- a = Xb(a).size;
1347
- var d = new Uint8Array(a);
1348
- ac(b, d, 0, a, 0);
1349
- "utf8" === c && (d = gb(d));
1350
- oa(b);
1351
- return d;
1352
- }
1353
- function W(a, b, c) {
1354
- a = ia("/dev/" + a);
1355
- var d = ja(!!b, !!c);
1356
- W.Cb ?? (W.Cb = 64);
1357
- var e = W.Cb++ << 8 | 0;
1358
- mb(e, { open(g) {
1359
- g.seekable = false;
1360
- }, close() {
1361
- c?.buffer?.length && c(10);
1362
- }, read(g, h, q, w) {
1363
- for (var t = 0, x = 0; x < w; x++) {
1364
- try {
1365
- var D = b();
1366
- } catch (pb) {
1367
- throw new N(29);
1368
- }
1369
- if (void 0 === D && 0 === t) throw new N(6);
1370
- if (null === D || void 0 === D) break;
1371
- t++;
1372
- h[q + x] = D;
1373
- }
1374
- t && (g.node.atime = Date.now());
1375
- return t;
1376
- }, write(g, h, q, w) {
1377
- for (var t = 0; t < w; t++) try {
1378
- c(h[q + t]);
1379
- } catch (x) {
1380
- throw new N(29);
1381
- }
1382
- w && (g.node.mtime = g.node.ctime = Date.now());
1383
- return t;
1384
- } });
1385
- Ub(a, d, e);
1386
- }
1387
- var X = {};
1388
- function Y(a, b, c) {
1389
- if ("/" === b.charAt(0)) return b;
1390
- a = -100 === a ? "/" : T(a).path;
1391
- if (0 == b.length) {
1392
- if (!c) throw new N(44);
1393
- return a;
1394
- }
1395
- return a + "/" + b;
1396
- }
1397
- function kc(a, b) {
1398
- F[a >> 2] = b.dev;
1399
- F[a + 4 >> 2] = b.mode;
1400
- F[a + 8 >> 2] = b.nlink;
1401
- F[a + 12 >> 2] = b.uid;
1402
- F[a + 16 >> 2] = b.gid;
1403
- F[a + 20 >> 2] = b.rdev;
1404
- G[a + 24 >> 3] = BigInt(b.size);
1405
- E[a + 32 >> 2] = 4096;
1406
- E[a + 36 >> 2] = b.blocks;
1407
- var c = b.atime.getTime(), d = b.mtime.getTime(), e = b.ctime.getTime();
1408
- G[a + 40 >> 3] = BigInt(Math.floor(c / 1e3));
1409
- F[a + 48 >> 2] = c % 1e3 * 1e6;
1410
- G[a + 56 >> 3] = BigInt(Math.floor(d / 1e3));
1411
- F[a + 64 >> 2] = d % 1e3 * 1e6;
1412
- G[a + 72 >> 3] = BigInt(Math.floor(e / 1e3));
1413
- F[a + 80 >> 2] = e % 1e3 * 1e6;
1414
- G[a + 88 >> 3] = BigInt(b.ino);
1415
- return 0;
1416
- }
1417
- var Cc = void 0, Ec = () => {
1418
- var a = E[+Cc >> 2];
1419
- Cc += 4;
1420
- return a;
1421
- }, Fc = 0, Gc = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335], Hc = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334], Ic = {}, Jc = (a) => {
1422
- Ga = a;
1423
- Ya || 0 < Fc || (k.onExit?.(a), Fa = true);
1424
- xa(a, new Sa(a));
1425
- }, Kc = (a) => {
1426
- if (!Fa) try {
1427
- a();
1428
- } catch (b) {
1429
- b instanceof Sa || "unwind" == b || xa(1, b);
1430
- } finally {
1431
- if (!(Ya || 0 < Fc)) try {
1432
- Ga = a = Ga, Jc(a);
1433
- } catch (b) {
1434
- b instanceof Sa || "unwind" == b || xa(1, b);
1435
- }
1436
- }
1437
- }, Lc = {}, Nc = () => {
1438
- if (!Mc) {
1439
- var a = { USER: "web_user", LOGNAME: "web_user", PATH: "/", PWD: "/", HOME: "/home/web_user", LANG: (globalThis.navigator?.language ?? "C").replace("-", "_") + ".UTF-8", _: wa || "./this.program" }, b;
1440
- for (b in Lc) void 0 === Lc[b] ? delete a[b] : a[b] = Lc[b];
1441
- var c = [];
1442
- for (b in a) c.push(`${b}=${a[b]}`);
1443
- Mc = c;
1444
- }
1445
- return Mc;
1446
- }, Mc, Oc = (a, b, c, d) => {
1447
- var e = { string: (t) => {
1448
- var x = 0;
1449
- if (null !== t && void 0 !== t && 0 !== t) {
1450
- x = ib(t) + 1;
1451
- var D = y(x);
1452
- M(t, C, D, x);
1453
- x = D;
1454
- }
1455
- return x;
1456
- }, array: (t) => {
1457
- var x = y(t.length);
1458
- m.set(t, x);
1459
- return x;
1460
- } };
1461
- a = k["_" + a];
1462
- var g = [], h = 0;
1463
- if (d) for (var q = 0; q < d.length; q++) {
1464
- var w = e[c[q]];
1465
- w ? (0 === h && (h = pa()), g[q] = w(d[q])) : g[q] = d[q];
1466
- }
1467
- c = a(...g);
1468
- return c = function(t) {
1469
- 0 !== h && ra(h);
1470
- return "string" === b ? z(t) : "boolean" === b ? !!t : t;
1471
- }(c);
1472
- }, fa = (a) => {
1473
- var b = ib(a) + 1, c = da(b);
1474
- c && M(a, C, c, b);
1475
- return c;
1476
- }, Pc, Qc = [], A = (a) => {
1477
- Pc.delete(Z.get(a));
1478
- Z.set(a, null);
1479
- Qc.push(a);
1480
- }, Rc = (a) => {
1481
- const b = a.length;
1482
- return [b % 128 | 128, b >> 7, ...a];
1483
- }, Sc = { i: 127, p: 127, j: 126, f: 125, d: 124, e: 111 }, Tc = (a) => Rc(Array.from(a, (b) => Sc[b])), va = (a, b) => {
1484
- if (!Pc) {
1485
- Pc = /* @__PURE__ */ new WeakMap();
1486
- var c = Z.length;
1487
- if (Pc) for (var d = 0; d < 0 + c; d++) {
1488
- var e = Z.get(d);
1489
- e && Pc.set(e, d);
1490
- }
1491
- }
1492
- if (c = Pc.get(a) || 0) return c;
1493
- c = Qc.length ? Qc.pop() : Z.grow(1);
1494
- try {
1495
- Z.set(c, a);
1496
- } catch (g) {
1497
- if (!(g instanceof TypeError)) throw g;
1498
- b = Uint8Array.of(0, 97, 115, 109, 1, 0, 0, 0, 1, ...Rc([1, 96, ...Tc(b.slice(1)), ...Tc("v" === b[0] ? "" : b[0])]), 2, 7, 1, 1, 101, 1, 102, 0, 0, 7, 5, 1, 1, 102, 0, 0);
1499
- b = new WebAssembly.Module(b);
1500
- b = new WebAssembly.Instance(b, { e: { f: a } }).exports.f;
1501
- Z.set(c, b);
1502
- }
1503
- Pc.set(a, c);
1504
- return c;
1505
- };
1506
- R = Array(4096);
1507
- Sb(O, "/");
1508
- U("/tmp");
1509
- U("/home");
1510
- U("/home/web_user");
1511
- (function() {
1512
- U("/dev");
1513
- mb(259, { read: () => 0, write: (d, e, g, h) => h, Va: () => 0 });
1514
- Ub("/dev/null", 259);
1515
- kb(1280, wb);
1516
- kb(1536, xb);
1517
- Ub("/dev/tty", 1280);
1518
- Ub("/dev/tty1", 1536);
1519
- var a = new Uint8Array(1024), b = 0, c = () => {
1520
- 0 === b && (eb(a), b = a.byteLength);
1521
- return a[--b];
1522
- };
1523
- W("random", c);
1524
- W("urandom", c);
1525
- U("/dev/shm");
1526
- U("/dev/shm/tmp");
1527
- })();
1528
- (function() {
1529
- U("/proc");
1530
- var a = U("/proc/self");
1531
- U("/proc/self/fd");
1532
- Sb({ Xa() {
1533
- var b = zb(a, "fd", 16895, 73);
1534
- b.Ma = { Va: O.Ma.Va };
1535
- b.La = { lookup(c, d) {
1536
- c = +d;
1537
- var e = T(c);
1538
- c = { parent: null, Xa: { Db: "fake" }, La: { readlink: () => e.path }, id: c + 1 };
1539
- return c.parent = c;
1540
- }, readdir() {
1541
- return Array.from(Eb.entries()).filter(([, c]) => c).map(([c]) => c.toString());
1542
- } };
1543
- return b;
1544
- } }, "/proc/self/fd");
1545
- })();
1546
- k.noExitRuntime && (Ya = k.noExitRuntime);
1547
- k.print && (Da = k.print);
1548
- k.printErr && (B = k.printErr);
1549
- k.wasmBinary && (Ea = k.wasmBinary);
1550
- k.thisProgram && (wa = k.thisProgram);
1551
- if (k.preInit) for ("function" == typeof k.preInit && (k.preInit = [k.preInit]); 0 < k.preInit.length; ) k.preInit.shift()();
1552
- k.stackSave = () => pa();
1553
- k.stackRestore = (a) => ra(a);
1554
- k.stackAlloc = (a) => y(a);
1555
- k.cwrap = (a, b, c, d) => {
1556
- var e = !c || c.every((g) => "number" === g || "boolean" === g);
1557
- return "string" !== b && e && !d ? k["_" + a] : (...g) => Oc(a, b, c, g);
1558
- };
1559
- k.addFunction = va;
1560
- k.removeFunction = A;
1561
- k.UTF8ToString = z;
1562
- k.stringToNewUTF8 = fa;
1563
- k.writeArrayToMemory = (a, b) => {
1564
- m.set(a, b);
1565
- };
1566
- var da, ea, Bb, Uc, ra, y, pa, La, Z, Vc = {
1567
- a: (a, b, c, d) => Ma(`Assertion failed: ${z(a)}, at: ` + [b ? z(b) : "unknown filename", c, d ? z(d) : "unknown function"]),
1568
- i: function(a, b) {
1569
- try {
1570
- return a = z(a), la(a, b), 0;
1571
- } catch (c) {
1572
- if ("undefined" == typeof X || "ErrnoError" !== c.name) throw c;
1573
- return -c.Pa;
1574
- }
1575
- },
1576
- L: function(a, b, c) {
1577
- try {
1578
- b = z(b);
1579
- b = Y(a, b);
1580
- if (c & -8) return -28;
1581
- var d = S(b, { ab: true }).node;
1582
- if (!d) return -44;
1583
- a = "";
1584
- c & 4 && (a += "r");
1585
- c & 2 && (a += "w");
1586
- c & 1 && (a += "x");
1587
- return a && Lb(d, a) ? -2 : 0;
1588
- } catch (e) {
1589
- if ("undefined" == typeof X || "ErrnoError" !== e.name) throw e;
1590
- return -e.Pa;
1591
- }
1592
- },
1593
- j: function(a, b) {
1594
- try {
1595
- var c = T(a);
1596
- Yb(c, c.node, b, false);
1597
- return 0;
1598
- } catch (d) {
1599
- if ("undefined" == typeof X || "ErrnoError" !== d.name) throw d;
1600
- return -d.Pa;
1601
- }
1602
- },
1603
- h: function(a) {
1604
- try {
1605
- var b = T(a);
1606
- Rb(b, b.node, { timestamp: Date.now(), Lb: false });
1607
- return 0;
1608
- } catch (c) {
1609
- if ("undefined" == typeof X || "ErrnoError" !== c.name) throw c;
1610
- return -c.Pa;
1611
- }
1612
- },
1613
- b: function(a, b, c) {
1614
- Cc = c;
1615
- try {
1616
- var d = T(a);
1617
- switch (b) {
1618
- case 0:
1619
- var e = Ec();
1620
- if (0 > e) break;
1621
- for (; Eb[e]; ) e++;
1622
- return Qb(d, e).fd;
1623
- case 1:
1624
- case 2:
1625
- return 0;
1626
- case 3:
1627
- return d.flags;
1628
- case 4:
1629
- return e = Ec(), d.flags |= e, 0;
1630
- case 12:
1631
- return e = Ec(), Ha[e + 0 >> 1] = 2, 0;
1632
- case 13:
1633
- case 14:
1634
- return 0;
1635
- }
1636
- return -28;
1637
- } catch (g) {
1638
- if ("undefined" == typeof X || "ErrnoError" !== g.name) throw g;
1639
- return -g.Pa;
1640
- }
1641
- },
1642
- g: function(a, b) {
1643
- try {
1644
- var c = T(a), d = c.node, e = c.Ma.Ta;
1645
- a = e ? c : d;
1646
- e ??= d.La.Ta;
1647
- Ob(e);
1648
- var g = e(a);
1649
- return kc(b, g);
1650
- } catch (h) {
1651
- if ("undefined" == typeof X || "ErrnoError" !== h.name) throw h;
1652
- return -h.Pa;
1653
- }
1654
- },
1655
- H: function(a, b) {
1656
- b = -9007199254740992 > b || 9007199254740992 < b ? NaN : Number(b);
1657
- try {
1658
- if (isNaN(b)) return -61;
1659
- var c = T(a);
1660
- if (0 > b || 0 === (c.flags & 2097155)) throw new N(28);
1661
- Zb(c, c.node, b);
1662
- return 0;
1663
- } catch (d) {
1664
- if ("undefined" == typeof X || "ErrnoError" !== d.name) throw d;
1665
- return -d.Pa;
1666
- }
1667
- },
1668
- G: function(a, b) {
1669
- try {
1670
- if (0 === b) return -28;
1671
- var c = ib("/") + 1;
1672
- if (b < c) return -68;
1673
- M("/", C, a, b);
1674
- return c;
1675
- } catch (d) {
1676
- if ("undefined" == typeof X || "ErrnoError" !== d.name) throw d;
1677
- return -d.Pa;
1678
- }
1679
- },
1680
- K: function(a, b) {
1681
- try {
1682
- return a = z(a), kc(b, Xb(a, true));
1683
- } catch (c) {
1684
- if ("undefined" == typeof X || "ErrnoError" !== c.name) throw c;
1685
- return -c.Pa;
1686
- }
1687
- },
1688
- C: function(a, b, c) {
1689
- try {
1690
- return b = z(b), b = Y(a, b), U(b, c), 0;
1691
- } catch (d) {
1692
- if ("undefined" == typeof X || "ErrnoError" !== d.name) throw d;
1693
- return -d.Pa;
1694
- }
1695
- },
1696
- J: function(a, b, c, d) {
1697
- try {
1698
- b = z(b);
1699
- var e = d & 256;
1700
- b = Y(a, b, d & 4096);
1701
- return kc(c, e ? Xb(b, true) : Xb(b));
1702
- } catch (g) {
1703
- if ("undefined" == typeof X || "ErrnoError" !== g.name) throw g;
1704
- return -g.Pa;
1705
- }
1706
- },
1707
- x: function(a, b, c, d) {
1708
- Cc = d;
1709
- try {
1710
- b = z(b);
1711
- b = Y(a, b);
1712
- var e = d ? Ec() : 0;
1713
- return ma(b, c, e).fd;
1714
- } catch (g) {
1715
- if ("undefined" == typeof X || "ErrnoError" !== g.name) throw g;
1716
- return -g.Pa;
1717
- }
1718
- },
1719
- v: function(a, b, c, d) {
1720
- try {
1721
- b = z(b);
1722
- b = Y(a, b);
1723
- if (0 >= d) return -28;
1724
- var e = S(b).node;
1725
- if (!e) throw new N(44);
1726
- if (!e.La.readlink) throw new N(28);
1727
- var g = e.La.readlink(e);
1728
- var h = Math.min(d, ib(g)), q = m[c + h];
1729
- M(
1730
- g,
1731
- C,
1732
- c,
1733
- d + 1
1734
- );
1735
- m[c + h] = q;
1736
- return h;
1737
- } catch (w) {
1738
- if ("undefined" == typeof X || "ErrnoError" !== w.name) throw w;
1739
- return -w.Pa;
1740
- }
1741
- },
1742
- u: function(a) {
1743
- try {
1744
- return a = z(a), Wb(a), 0;
1745
- } catch (b) {
1746
- if ("undefined" == typeof X || "ErrnoError" !== b.name) throw b;
1747
- return -b.Pa;
1748
- }
1749
- },
1750
- f: function(a, b) {
1751
- try {
1752
- return a = z(a), kc(b, Xb(a));
1753
- } catch (c) {
1754
- if ("undefined" == typeof X || "ErrnoError" !== c.name) throw c;
1755
- return -c.Pa;
1756
- }
1757
- },
1758
- r: function(a, b, c) {
1759
- try {
1760
- b = z(b);
1761
- b = Y(a, b);
1762
- if (c) if (512 === c) Wb(b);
1763
- else return -28;
1764
- else ua(b);
1765
- return 0;
1766
- } catch (d) {
1767
- if ("undefined" == typeof X || "ErrnoError" !== d.name) throw d;
1768
- return -d.Pa;
1769
- }
1770
- },
1771
- q: function(a, b, c) {
1772
- try {
1773
- b = z(b);
1774
- b = Y(a, b, true);
1775
- var d = Date.now(), e, g;
1776
- if (c) {
1777
- var h = F[c >> 2] + 4294967296 * E[c + 4 >> 2], q = E[c + 8 >> 2];
1778
- 1073741823 == q ? e = d : 1073741822 == q ? e = null : e = 1e3 * h + q / 1e6;
1779
- c += 16;
1780
- h = F[c >> 2] + 4294967296 * E[c + 4 >> 2];
1781
- q = E[c + 8 >> 2];
1782
- 1073741823 == q ? g = d : 1073741822 == q ? g = null : g = 1e3 * h + q / 1e6;
1783
- } else g = e = d;
1784
- if (null !== (g ?? e)) {
1785
- a = e;
1786
- var w = S(b, { ab: true }).node;
1787
- Ob(w.La.Ua)(w, { atime: a, mtime: g });
1788
- }
1789
- return 0;
1790
- } catch (t) {
1791
- if ("undefined" == typeof X || "ErrnoError" !== t.name) throw t;
1792
- return -t.Pa;
1793
- }
1794
- },
1795
- m: () => Ma(""),
1796
- l: () => {
1797
- Ya = false;
1798
- Fc = 0;
1799
- },
1800
- A: function(a, b) {
1801
- a = -9007199254740992 > a || 9007199254740992 < a ? NaN : Number(a);
1802
- a = new Date(1e3 * a);
1803
- E[b >> 2] = a.getSeconds();
1804
- E[b + 4 >> 2] = a.getMinutes();
1805
- E[b + 8 >> 2] = a.getHours();
1806
- E[b + 12 >> 2] = a.getDate();
1807
- E[b + 16 >> 2] = a.getMonth();
1808
- E[b + 20 >> 2] = a.getFullYear() - 1900;
1809
- E[b + 24 >> 2] = a.getDay();
1810
- var c = a.getFullYear();
1811
- E[b + 28 >> 2] = (0 !== c % 4 || 0 === c % 100 && 0 !== c % 400 ? Hc : Gc)[a.getMonth()] + a.getDate() - 1 | 0;
1812
- E[b + 36 >> 2] = -(60 * a.getTimezoneOffset());
1813
- c = new Date(a.getFullYear(), 6, 1).getTimezoneOffset();
1814
- var d = new Date(a.getFullYear(), 0, 1).getTimezoneOffset();
1815
- E[b + 32 >> 2] = (c != d && a.getTimezoneOffset() == Math.min(d, c)) | 0;
1816
- },
1817
- y: function(a, b, c, d, e, g, h) {
1818
- e = -9007199254740992 > e || 9007199254740992 < e ? NaN : Number(e);
1819
- try {
1820
- var q = T(d);
1821
- if (0 !== (b & 2) && 0 === (c & 2) && 2 !== (q.flags & 2097155)) throw new N(2);
1822
- if (1 === (q.flags & 2097155)) throw new N(2);
1823
- if (!q.Ma.jb) throw new N(43);
1824
- if (!a) throw new N(28);
1825
- var w = q.Ma.jb(q, a, e, b, c);
1826
- var t = w.Xb;
1827
- E[g >> 2] = w.Eb;
1828
- F[h >> 2] = t;
1829
- return 0;
1830
- } catch (x) {
1831
- if ("undefined" == typeof X || "ErrnoError" !== x.name) throw x;
1832
- return -x.Pa;
1833
- }
1834
- },
1835
- z: function(a, b, c, d, e, g) {
1836
- g = -9007199254740992 > g || 9007199254740992 < g ? NaN : Number(g);
1837
- try {
1838
- var h = T(e);
1839
- if (c & 2) {
1840
- c = g;
1841
- if (32768 !== (h.node.mode & 61440)) throw new N(43);
1842
- if (!(d & 2)) {
1843
- var q = C.slice(a, a + b);
1844
- h.Ma.kb && h.Ma.kb(h, q, c, b, d);
1845
- }
1846
- }
1847
- } catch (w) {
1848
- if ("undefined" == typeof X || "ErrnoError" !== w.name) throw w;
1849
- return -w.Pa;
1850
- }
1851
- },
1852
- n: (a, b) => {
1853
- Ic[a] && (clearTimeout(Ic[a].id), delete Ic[a]);
1854
- if (!b) return 0;
1855
- var c = setTimeout(() => {
1856
- delete Ic[a];
1857
- Kc(() => Uc(a, performance.now()));
1858
- }, b);
1859
- Ic[a] = { id: c, lc: b };
1860
- return 0;
1861
- },
1862
- B: (a, b, c, d) => {
1863
- var e = (/* @__PURE__ */ new Date()).getFullYear(), g = new Date(e, 0, 1).getTimezoneOffset();
1864
- e = new Date(e, 6, 1).getTimezoneOffset();
1865
- F[a >> 2] = 60 * Math.max(g, e);
1866
- E[b >> 2] = Number(g != e);
1867
- b = (h) => {
1868
- var q = Math.abs(h);
1869
- return `UTC${0 <= h ? "-" : "+"}${String(Math.floor(q / 60)).padStart(2, "0")}${String(q % 60).padStart(2, "0")}`;
1870
- };
1871
- a = b(g);
1872
- b = b(e);
1873
- e < g ? (M(a, C, c, 17), M(b, C, d, 17)) : (M(a, C, d, 17), M(b, C, c, 17));
1874
- },
1875
- d: () => Date.now(),
1876
- s: () => 2147483648,
1877
- c: () => performance.now(),
1878
- o: (a) => {
1879
- var b = C.length;
1880
- a >>>= 0;
1881
- if (2147483648 < a) return false;
1882
- for (var c = 1; 4 >= c; c *= 2) {
1883
- var d = b * (1 + 0.2 / c);
1884
- d = Math.min(d, a + 100663296);
1885
- a: {
1886
- d = (Math.min(2147483648, 65536 * Math.ceil(Math.max(
1887
- a,
1888
- d
1889
- ) / 65536)) - La.buffer.byteLength + 65535) / 65536 | 0;
1890
- try {
1891
- La.grow(d);
1892
- Ka();
1893
- var e = 1;
1894
- break a;
1895
- } catch (g) {
1896
- }
1897
- e = void 0;
1898
- }
1899
- if (e) return true;
1900
- }
1901
- return false;
1902
- },
1903
- E: (a, b) => {
1904
- var c = 0, d = 0, e;
1905
- for (e of Nc()) {
1906
- var g = b + c;
1907
- F[a + d >> 2] = g;
1908
- c += M(e, C, g, Infinity) + 1;
1909
- d += 4;
1910
- }
1911
- return 0;
1912
- },
1913
- F: (a, b) => {
1914
- var c = Nc();
1915
- F[a >> 2] = c.length;
1916
- a = 0;
1917
- for (var d of c) a += ib(d) + 1;
1918
- F[b >> 2] = a;
1919
- return 0;
1920
- },
1921
- e: function(a) {
1922
- try {
1923
- var b = T(a);
1924
- oa(b);
1925
- return 0;
1926
- } catch (c) {
1927
- if ("undefined" == typeof X || "ErrnoError" !== c.name) throw c;
1928
- return c.Pa;
1929
- }
1930
- },
1931
- p: function(a, b) {
1932
- try {
1933
- var c = T(a);
1934
- m[b] = c.tty ? 2 : P(c.mode) ? 3 : 40960 === (c.mode & 61440) ? 7 : 4;
1935
- Ha[b + 2 >> 1] = 0;
1936
- G[b + 8 >> 3] = BigInt(0);
1937
- G[b + 16 >> 3] = BigInt(0);
1938
- return 0;
1939
- } catch (d) {
1940
- if ("undefined" == typeof X || "ErrnoError" !== d.name) throw d;
1941
- return d.Pa;
1942
- }
1943
- },
1944
- w: function(a, b, c, d) {
1945
- try {
1946
- a: {
1947
- var e = T(a);
1948
- a = b;
1949
- for (var g, h = b = 0; h < c; h++) {
1950
- var q = F[a >> 2], w = F[a + 4 >> 2];
1951
- a += 8;
1952
- var t = ac(e, m, q, w, g);
1953
- if (0 > t) {
1954
- var x = -1;
1955
- break a;
1956
- }
1957
- b += t;
1958
- if (t < w) break;
1959
- "undefined" != typeof g && (g += t);
1960
- }
1961
- x = b;
1962
- }
1963
- F[d >> 2] = x;
1964
- return 0;
1965
- } catch (D) {
1966
- if ("undefined" == typeof X || "ErrnoError" !== D.name) throw D;
1967
- return D.Pa;
1968
- }
1969
- },
1970
- D: function(a, b, c, d) {
1971
- b = -9007199254740992 > b || 9007199254740992 < b ? NaN : Number(b);
1972
- try {
1973
- if (isNaN(b)) return 61;
1974
- var e = T(a);
1975
- $b(e, b, c);
1976
- G[d >> 3] = BigInt(e.position);
1977
- e.rb && 0 === b && 0 === c && (e.rb = null);
1978
- return 0;
1979
- } catch (g) {
1980
- if ("undefined" == typeof X || "ErrnoError" !== g.name) throw g;
1981
- return g.Pa;
1982
- }
1983
- },
1984
- I: function(a) {
1985
- try {
1986
- var b = T(a);
1987
- return b.Ma?.fsync?.(b);
1988
- } catch (c) {
1989
- if ("undefined" == typeof X || "ErrnoError" !== c.name) throw c;
1990
- return c.Pa;
1991
- }
1992
- },
1993
- t: function(a, b, c, d) {
1994
- try {
1995
- a: {
1996
- var e = T(a);
1997
- a = b;
1998
- for (var g, h = b = 0; h < c; h++) {
1999
- var q = F[a >> 2], w = F[a + 4 >> 2];
2000
- a += 8;
2001
- var t = na(e, m, q, w, g);
2002
- if (0 > t) {
2003
- var x = -1;
2004
- break a;
2005
- }
2006
- b += t;
2007
- if (t < w) break;
2008
- "undefined" != typeof g && (g += t);
2009
- }
2010
- x = b;
2011
- }
2012
- F[d >> 2] = x;
2013
- return 0;
2014
- } catch (D) {
2015
- if ("undefined" == typeof X || "ErrnoError" !== D.name) throw D;
2016
- return D.Pa;
2017
- }
2018
- },
2019
- k: Jc
2020
- };
2021
- function Wc() {
2022
- function a() {
2023
- k.calledRun = true;
2024
- if (!Fa) {
2025
- if (!k.noFSInit && !Gb) {
2026
- var b, c;
2027
- Gb = true;
2028
- b ??= k.stdin;
2029
- c ??= k.stdout;
2030
- d ??= k.stderr;
2031
- b ? W("stdin", b) : Vb("/dev/tty", "/dev/stdin");
2032
- c ? W("stdout", null, c) : Vb("/dev/tty", "/dev/stdout");
2033
- d ? W("stderr", null, d) : Vb("/dev/tty1", "/dev/stderr");
2034
- ma("/dev/stdin", 0);
2035
- ma("/dev/stdout", 1);
2036
- ma("/dev/stderr", 1);
2037
- }
2038
- Xc.N();
2039
- Hb = false;
2040
- k.onRuntimeInitialized?.();
2041
- if (k.postRun) for ("function" == typeof k.postRun && (k.postRun = [k.postRun]); k.postRun.length; ) {
2042
- var d = k.postRun.shift();
2043
- Ua.push(d);
2044
- }
2045
- Ta(Ua);
2046
- }
2047
- }
2048
- if (0 < J) Xa = Wc;
2049
- else {
2050
- if (k.preRun) for ("function" == typeof k.preRun && (k.preRun = [k.preRun]); k.preRun.length; ) Wa();
2051
- Ta(Va);
2052
- 0 < J ? Xa = Wc : k.setStatus ? (k.setStatus("Running..."), setTimeout(() => {
2053
- setTimeout(() => k.setStatus(""), 1);
2054
- a();
2055
- }, 1)) : a();
2056
- }
2057
- }
2058
- var Xc;
2059
- (async function() {
2060
- function a(c) {
2061
- c = Xc = c.exports;
2062
- k._sqlite3_free = c.P;
2063
- k._sqlite3_value_text = c.Q;
2064
- k._sqlite3_prepare_v2 = c.R;
2065
- k._sqlite3_step = c.S;
2066
- k._sqlite3_reset = c.T;
2067
- k._sqlite3_exec = c.U;
2068
- k._sqlite3_finalize = c.V;
2069
- k._sqlite3_column_name = c.W;
2070
- k._sqlite3_column_text = c.X;
2071
- k._sqlite3_column_type = c.Y;
2072
- k._sqlite3_errmsg = c.Z;
2073
- k._sqlite3_clear_bindings = c._;
2074
- k._sqlite3_value_blob = c.$;
2075
- k._sqlite3_value_bytes = c.aa;
2076
- k._sqlite3_value_double = c.ba;
2077
- k._sqlite3_value_int = c.ca;
2078
- k._sqlite3_value_type = c.da;
2079
- k._sqlite3_result_blob = c.ea;
2080
- k._sqlite3_result_double = c.fa;
2081
- k._sqlite3_result_error = c.ga;
2082
- k._sqlite3_result_int = c.ha;
2083
- k._sqlite3_result_int64 = c.ia;
2084
- k._sqlite3_result_null = c.ja;
2085
- k._sqlite3_result_text = c.ka;
2086
- k._sqlite3_aggregate_context = c.la;
2087
- k._sqlite3_column_count = c.ma;
2088
- k._sqlite3_data_count = c.na;
2089
- k._sqlite3_column_blob = c.oa;
2090
- k._sqlite3_column_bytes = c.pa;
2091
- k._sqlite3_column_double = c.qa;
2092
- k._sqlite3_bind_blob = c.ra;
2093
- k._sqlite3_bind_double = c.sa;
2094
- k._sqlite3_bind_int = c.ta;
2095
- k._sqlite3_bind_text = c.ua;
2096
- k._sqlite3_bind_parameter_index = c.va;
2097
- k._sqlite3_sql = c.wa;
2098
- k._sqlite3_normalized_sql = c.xa;
2099
- k._sqlite3_changes = c.ya;
2100
- k._sqlite3_close_v2 = c.za;
2101
- k._sqlite3_create_function_v2 = c.Aa;
2102
- k._sqlite3_update_hook = c.Ba;
2103
- k._sqlite3_open = c.Ca;
2104
- da = k._malloc = c.Da;
2105
- ea = k._free = c.Ea;
2106
- k._RegisterExtensionFunctions = c.Fa;
2107
- Bb = c.Ga;
2108
- Uc = c.Ha;
2109
- ra = c.Ia;
2110
- y = c.Ja;
2111
- pa = c.Ka;
2112
- La = c.M;
2113
- Z = c.O;
2114
- Ka();
2115
- J--;
2116
- k.monitorRunDependencies?.(J);
2117
- 0 == J && Xa && (c = Xa, Xa = null, c());
2118
- return Xc;
2119
- }
2120
- J++;
2121
- k.monitorRunDependencies?.(J);
2122
- var b = { a: Vc };
2123
- if (k.instantiateWasm) return new Promise((c) => {
2124
- k.instantiateWasm(b, (d, e) => {
2125
- c(a(d, e));
2126
- });
2127
- });
2128
- Na ??= k.locateFile ? k.locateFile("sql-wasm.wasm", za) : za + "sql-wasm.wasm";
2129
- return a((await Ra(b)).instance);
2130
- })();
2131
- Wc();
2132
- return Module;
2133
- });
2134
- return initSqlJsPromise;
2135
- };
2136
- if (typeof exports === "object" && typeof module === "object") {
2137
- module.exports = initSqlJs;
2138
- module.exports.default = initSqlJs;
2139
- } else if (typeof define === "function" && define["amd"]) {
2140
- define([], function() {
2141
- return initSqlJs;
2142
- });
2143
- } else if (typeof exports === "object") {
2144
- exports["Module"] = initSqlJs;
2145
- }
2146
- }
2147
- });
2148
- export default require_sql_wasm();