@livestore/devtools-vite 0.3.0-dev.4 → 0.3.0-dev.40

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.
@@ -0,0 +1,4 @@
1
+ import { d as a } from "./devtools-react-bundle-1K1hg3N1.js";
2
+ export {
3
+ a as run
4
+ };
@@ -0,0 +1,368 @@
1
+ const E = new TextDecoder(), U = new TextEncoder();
2
+ function W() {
3
+ let e, t, n = {}, r = "", i = "", u = "";
4
+ return {
5
+ setInstance(o) {
6
+ e = o;
7
+ },
8
+ setHostFormatter(o) {
9
+ t = o;
10
+ },
11
+ createImportObject() {
12
+ let o = new Uint8Array(0), s = 0;
13
+ const g = (l) => {
14
+ o = new Uint8Array(l), s = 0;
15
+ };
16
+ return {
17
+ dprint: {
18
+ host_clear_bytes: (l) => {
19
+ g(l);
20
+ },
21
+ host_read_buffer: (l, a) => {
22
+ o.set(A(e, l, a), s), s += a;
23
+ },
24
+ host_write_buffer: (l, a, _) => {
25
+ A(e, l, _).set(o.slice(a, a + _));
26
+ },
27
+ host_take_file_path: () => {
28
+ r = E.decode(o), g(0);
29
+ },
30
+ host_take_override_config: () => {
31
+ n = JSON.parse(E.decode(o)), g(0);
32
+ },
33
+ host_format: () => {
34
+ const l = E.decode(o);
35
+ try {
36
+ return i = t?.({
37
+ filePath: r,
38
+ fileText: l,
39
+ overrideConfig: n
40
+ }) ?? l, l === i ? 0 : 1;
41
+ } catch (a) {
42
+ return u = String(a), 2;
43
+ }
44
+ },
45
+ host_get_formatted_text: () => (o = U.encode(i), s = 0, o.length),
46
+ host_get_error_text: () => (o = U.encode(u), s = 0, o.length)
47
+ }
48
+ };
49
+ }
50
+ };
51
+ }
52
+ function D(e, t) {
53
+ t.setInstance(e);
54
+ const n = e.exports, { get_plugin_schema_version: r, set_file_path: i, set_override_config: u, get_formatted_text: o, format: s, get_error_text: g, get_plugin_info: l, get_resolved_config: a, get_config_diagnostics: _, set_global_config: b, set_plugin_config: x, get_license_text: p, reset_config: S } = n, h = r(), v = 3;
55
+ if (h !== 2 && h !== v)
56
+ throw new Error(`Not compatible plugin. Expected schema ${v}, but plugin had ${h}.`);
57
+ let y = !1;
58
+ return {
59
+ setConfig(c, d) {
60
+ C(c, d);
61
+ },
62
+ getConfigDiagnostics() {
63
+ T();
64
+ const c = _();
65
+ return JSON.parse(N(e, c));
66
+ },
67
+ getResolvedConfig() {
68
+ T();
69
+ const c = a();
70
+ return JSON.parse(N(e, c));
71
+ },
72
+ getFileMatchingInfo() {
73
+ const c = l(), d = JSON.parse(N(e, c));
74
+ return {
75
+ // deno-lint-ignore no-explicit-any
76
+ fileExtensions: d.fileExtensions ?? [],
77
+ // deno-lint-ignore no-explicit-any
78
+ fileNames: d.fileNames ?? []
79
+ };
80
+ },
81
+ getPluginInfo() {
82
+ const c = l(), d = JSON.parse(N(e, c));
83
+ return delete d.fileNames, delete d.fileExtensions, d;
84
+ },
85
+ getLicenseText() {
86
+ const c = p();
87
+ return N(e, c);
88
+ },
89
+ formatText(c, d) {
90
+ if (c.bytesRange != null)
91
+ return c.fileText;
92
+ if (t.setHostFormatter(d), T(), c.overrideConfig != null) {
93
+ if (h === 2)
94
+ throw new Error("Cannot set the override configuration for this old plugin.");
95
+ P(e, JSON.stringify(c.overrideConfig)), u();
96
+ }
97
+ P(e, c.filePath), i(), P(e, c.fileText);
98
+ const w = s();
99
+ switch (w) {
100
+ case 0:
101
+ return c.fileText;
102
+ case 1:
103
+ return N(e, o());
104
+ case 2:
105
+ throw new Error(N(e, g()));
106
+ default:
107
+ throw new Error(`Unexpected response code: ${w}`);
108
+ }
109
+ }
110
+ };
111
+ function T() {
112
+ y || C({}, {});
113
+ }
114
+ function C(c, d) {
115
+ S?.(), P(e, JSON.stringify(c)), b(), P(e, JSON.stringify(d)), x(), y = !0;
116
+ }
117
+ }
118
+ function P(e, t) {
119
+ const n = e.exports, r = U.encode(t), i = r.length, u = n.get_wasm_memory_buffer_size(), o = F(e);
120
+ n.clear_shared_bytes(i);
121
+ let s = 0;
122
+ for (; s < i; ) {
123
+ const g = Math.min(i - s, u);
124
+ A(e, o, g).set(r.slice(s, s + g)), n.add_to_shared_bytes_from_buffer(g), s += g;
125
+ }
126
+ return i;
127
+ }
128
+ function N(e, t) {
129
+ const n = e.exports, r = n.get_wasm_memory_buffer_size(), i = F(e), u = new Uint8Array(t);
130
+ let o = 0;
131
+ for (; o < t; ) {
132
+ const s = Math.min(t - o, r);
133
+ n.set_buffer_with_shared_bytes(o, s);
134
+ const g = A(e, i, s);
135
+ u.set(g, o), o += s;
136
+ }
137
+ return E.decode(u);
138
+ }
139
+ function F(e) {
140
+ return e.exports.get_wasm_memory_buffer();
141
+ }
142
+ function A(e, t, n) {
143
+ return new Uint8Array(
144
+ // deno-lint-ignore no-explicit-any
145
+ e.exports.memory.buffer,
146
+ t,
147
+ n
148
+ );
149
+ }
150
+ const V = {}, H = K(globalThis, V);
151
+ function K(e, t) {
152
+ return new Proxy(e, {
153
+ get(n, r, i) {
154
+ return r in t ? t[r] : e[r];
155
+ },
156
+ set(n, r, i) {
157
+ return r in t && delete t[r], e[r] = i, !0;
158
+ },
159
+ deleteProperty(n, r) {
160
+ let i = !1;
161
+ return r in t && (delete t[r], i = !0), r in e && (delete e[r], i = !0), i;
162
+ },
163
+ ownKeys(n) {
164
+ const r = Reflect.ownKeys(e), i = Reflect.ownKeys(t), u = new Set(i);
165
+ return [...r.filter((o) => !u.has(o)), ...i];
166
+ },
167
+ defineProperty(n, r, i) {
168
+ return r in t && delete t[r], Reflect.defineProperty(e, r, i), !0;
169
+ },
170
+ getOwnPropertyDescriptor(n, r) {
171
+ return r in t ? Reflect.getOwnPropertyDescriptor(t, r) : Reflect.getOwnPropertyDescriptor(e, r);
172
+ },
173
+ has(n, r) {
174
+ return r in t || r in e;
175
+ }
176
+ });
177
+ }
178
+ const M = new TextDecoder(), R = new TextEncoder();
179
+ function I() {
180
+ function e(o) {
181
+ try {
182
+ const s = H;
183
+ s.Deno ? s.Deno.stderr.writeSync(o) : s.process && s.process.stderr.writeSync(o);
184
+ } catch {
185
+ }
186
+ }
187
+ let t, n, r = "", i = "";
188
+ return {
189
+ setInstance(o) {
190
+ t = o;
191
+ },
192
+ setHostFormatter(o) {
193
+ n = o;
194
+ },
195
+ createImportObject() {
196
+ let o = new Uint8Array(0);
197
+ return {
198
+ env: {
199
+ fd_write: (s, g, l, a) => {
200
+ let _ = 0;
201
+ const b = t.exports.memory.buffer, x = new DataView(b);
202
+ for (let p = 0; p < l; p++) {
203
+ const S = g + p * 8, h = x.getUint32(S, !0), v = x.getUint32(S + 4, !0), y = new Uint8Array(b, h, v);
204
+ if (s === 1 || s === 2)
205
+ e(y);
206
+ else
207
+ return 1;
208
+ _ += v;
209
+ }
210
+ return x.setUint32(a, _, !0), 0;
211
+ }
212
+ },
213
+ dprint: {
214
+ host_has_cancelled: () => 0,
215
+ host_write_buffer: (s) => {
216
+ J(t, s, o.length).set(o);
217
+ },
218
+ host_format: (s, g, l, a, _, b, x, p) => {
219
+ const S = u(s, g), h = u(_, b), v = h === "" ? {} : JSON.parse(h), y = u(x, p), T = l === 0 && a === p ? void 0 : [l, a];
220
+ try {
221
+ return r = n?.({
222
+ filePath: S,
223
+ fileText: y,
224
+ bytesRange: T,
225
+ overrideConfig: v
226
+ }) ?? y, y === r ? 0 : 1;
227
+ } catch (C) {
228
+ return i = String(C), 2;
229
+ }
230
+ },
231
+ host_get_formatted_text: () => (o = R.encode(r), o.length),
232
+ host_get_error_text: () => (o = R.encode(i), o.length)
233
+ }
234
+ };
235
+ }
236
+ };
237
+ function u(o, s) {
238
+ return M.decode(J(t, o, s));
239
+ }
240
+ }
241
+ function O(e, t) {
242
+ t.setInstance(e);
243
+ const n = 1, r = e.exports, { get_shared_bytes_ptr: i, set_file_path: u, set_override_config: o, clear_shared_bytes: s, get_formatted_text: g, format: l, format_range: a, get_error_text: _, get_plugin_info: b, get_config_file_matching: x, get_resolved_config: p, get_config_diagnostics: S, get_license_text: h, register_config: v, release_config: y } = r;
244
+ let T = !1;
245
+ return {
246
+ setConfig(f, m) {
247
+ c(f, m);
248
+ },
249
+ getConfigDiagnostics() {
250
+ C();
251
+ const f = S(n);
252
+ return JSON.parse(w(f));
253
+ },
254
+ getResolvedConfig() {
255
+ C();
256
+ const f = p(n);
257
+ return JSON.parse(w(f));
258
+ },
259
+ getFileMatchingInfo() {
260
+ const f = x(n);
261
+ return JSON.parse(w(f));
262
+ },
263
+ getPluginInfo() {
264
+ const f = b();
265
+ return JSON.parse(w(f));
266
+ },
267
+ getLicenseText() {
268
+ const f = h();
269
+ return w(f);
270
+ },
271
+ formatText(f, m) {
272
+ if (f.bytesRange != null && a == null)
273
+ return f.fileText;
274
+ t.setHostFormatter(m), C(), f.overrideConfig != null && (d(JSON.stringify(f.overrideConfig)), o()), d(f.filePath), u(), d(f.fileText);
275
+ const B = f.bytesRange != null ? a(n, f.bytesRange[0], f.bytesRange[1]) : l(n);
276
+ switch (B) {
277
+ case 0:
278
+ return f.fileText;
279
+ case 1:
280
+ return w(g());
281
+ case 2:
282
+ throw new Error(w(_()));
283
+ default:
284
+ throw new Error(`Unexpected response code: ${B}`);
285
+ }
286
+ }
287
+ };
288
+ function C() {
289
+ T || c({}, {});
290
+ }
291
+ function c(f, m) {
292
+ y(n), d(JSON.stringify({
293
+ global: f,
294
+ plugin: m
295
+ })), v(n), T = !0;
296
+ }
297
+ function d(f) {
298
+ const m = R.encode(f), B = s(m.length);
299
+ J(e, B, m.length).set(m);
300
+ }
301
+ function w(f) {
302
+ const m = i();
303
+ return M.decode(J(e, m, f));
304
+ }
305
+ }
306
+ function J(e, t, n) {
307
+ return new Uint8Array(
308
+ // deno-lint-ignore no-explicit-any
309
+ e.exports.memory.buffer,
310
+ t,
311
+ n
312
+ );
313
+ }
314
+ async function L(e) {
315
+ const t = await e;
316
+ if (t.status !== 200)
317
+ throw new Error(`Unexpected status code: ${t.status}
318
+ ${await t.text()}`);
319
+ if (typeof WebAssembly.instantiateStreaming == "function" && t.headers.get("content-type") === "application/wasm") {
320
+ const n = await WebAssembly.compileStreaming(t);
321
+ return $(n);
322
+ } else
323
+ return t.arrayBuffer().then((n) => z(n));
324
+ }
325
+ function z(e) {
326
+ const t = new WebAssembly.Module(e);
327
+ return $(t);
328
+ }
329
+ function $(e) {
330
+ if (k(e) === 3) {
331
+ const n = W(), r = new WebAssembly.Instance(e, n.createImportObject());
332
+ return D(r, n);
333
+ } else {
334
+ const n = I(), r = new WebAssembly.Instance(e, n.createImportObject());
335
+ return O(r, n);
336
+ }
337
+ }
338
+ function k(e) {
339
+ const t = G(e);
340
+ if (t == null)
341
+ throw new Error("Couldn't determine dprint plugin version. Maybe the js-formatter version is too old?");
342
+ if (t === 3 || t === 4)
343
+ return t;
344
+ throw t > 4 ? new Error(`Unsupported new dprint plugin version '${t}'. Maybe the js-formatter version is too old?`) : new Error(`Unsupported old dprint plugin version '${t}'. Please upgrade the plugin.`);
345
+ }
346
+ function G(e) {
347
+ function t(r) {
348
+ if (r === "get_plugin_schema_version")
349
+ return 3;
350
+ const i = "dprint_plugin_version_";
351
+ if (r.startsWith(i)) {
352
+ const u = parseInt(r.substring(i.length), 10);
353
+ if (!isNaN(u))
354
+ return u;
355
+ }
356
+ }
357
+ const n = WebAssembly.Module.exports(e);
358
+ for (const r of n) {
359
+ const i = t(r.name);
360
+ if (i != null)
361
+ return i;
362
+ }
363
+ }
364
+ export {
365
+ z as createFromBuffer,
366
+ $ as createFromWasmModule,
367
+ L as createStreaming
368
+ };