@marimo-team/islands 0.25.1-dev2 → 0.25.1-dev4
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/dist/{ErrorBoundary-DO0ie20N.js → ErrorBoundary-pV36lYEK.js} +1 -1
- package/dist/{cells-DYIkSxs6.js → cells-B5-y5EY3.js} +4121 -4148
- package/dist/{chat-ui-BXj3uYjy.js → chat-ui-HJZsTl7o.js} +45 -45
- package/dist/{code-visibility-64_ACQvC.js → code-visibility-CgZS2a3W.js} +17 -17
- package/dist/{common-LlPE7GR6.js → common-DnMDPPaW.js} +611 -611
- package/dist/{data-grid-overlay-editor-BUvmnptP.js → data-grid-overlay-editor-hHYgD_Sm.js} +1 -1
- package/dist/{error-entries-C0NsUqXl.js → error-entries-Bkbpx0T0.js} +18 -18
- package/dist/{feedback-button-B98mEc3M.js → feedback-button-CvKssdG_.js} +19 -19
- package/dist/{formats-BR5iGb4s.js → formats-C8rLgZT9.js} +1 -1
- package/dist/{glide-data-editor-CBIPbkXG.js → glide-data-editor-Ohetlgag.js} +3 -3
- package/dist/{globals-VpAtGRbg.js → globals-CPNNcOJI.js} +1 -1
- package/dist/{html-to-image-CeYYvQNb.js → html-to-image-BAgJOlSW.js} +31 -30
- package/dist/main.js +581 -581
- package/dist/{number-overlay-editor-ClZmv3Qw.js → number-overlay-editor-CHWg5gGO.js} +1 -1
- package/dist/{process-output-BCTjlyuH.js → process-output-zDX4jbhd.js} +2 -2
- package/dist/{reveal-component-C1s_K6O8.js → reveal-component-BujcZI2B.js} +744 -743
- package/dist/{toDate-WXg1yLcI.js → toDate-C67bxMWn.js} +139 -111
- package/dist/{vega-component-D0QXopU8.js → vega-component-CNf5gcrm.js} +9 -9
- package/package.json +1 -1
- package/src/core/kernel/__tests__/session.test.ts +110 -1
- package/src/core/kernel/session.ts +46 -15
|
@@ -2,9 +2,9 @@ import { t as e } from "./rolldown-runtime-Cb76FRpK.js";
|
|
|
2
2
|
import { g as t } from "./button-DdXAm8iz.js";
|
|
3
3
|
import { t as n } from "./compiler-runtime-Cj8ZWiNS.js";
|
|
4
4
|
import { g as r } from "./tooltip-qB8NlSqV.js";
|
|
5
|
-
import {
|
|
6
|
-
import { t as
|
|
7
|
-
var
|
|
5
|
+
import { C as i, E as a, _ as o, a as s, b as c } from "./useTheme-DzXmYZ5V.js";
|
|
6
|
+
import { t as l } from "./invariant-DLmrl-hA.js";
|
|
7
|
+
var u = r("circle-question-mark", [
|
|
8
8
|
["circle", {
|
|
9
9
|
cx: "12",
|
|
10
10
|
cy: "12",
|
|
@@ -19,14 +19,18 @@ var l = r("circle-question-mark", [
|
|
|
19
19
|
d: "M12 17h.01",
|
|
20
20
|
key: "p32p05"
|
|
21
21
|
}]
|
|
22
|
-
]);
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
]), d = n();
|
|
23
|
+
function f(e, t) {
|
|
24
|
+
if (e == null) throw Error(t || `Expected value but got ${e}`);
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
27
|
+
//#region src/core/wasm/utils.ts
|
|
28
|
+
function p() {
|
|
25
29
|
return typeof document < "u" && document.querySelector("marimo-wasm") !== null;
|
|
26
30
|
}
|
|
27
31
|
//#endregion
|
|
28
32
|
//#region src/utils/Deferred.ts
|
|
29
|
-
var
|
|
33
|
+
var m = class {
|
|
30
34
|
promise;
|
|
31
35
|
resolve;
|
|
32
36
|
reject;
|
|
@@ -37,17 +41,36 @@ var d = class {
|
|
|
37
41
|
this.reject = (e) => {
|
|
38
42
|
this.status = "rejected", t(e);
|
|
39
43
|
}, this.resolve = (t) => {
|
|
40
|
-
this.status = "resolved",
|
|
44
|
+
this.status = "resolved", h(t) || (this.value = t), e(t);
|
|
41
45
|
};
|
|
42
46
|
});
|
|
43
47
|
}
|
|
44
48
|
};
|
|
45
|
-
function
|
|
49
|
+
function h(e) {
|
|
46
50
|
return typeof e == "object" && !!e && "then" in e && typeof e.then == "function";
|
|
47
51
|
}
|
|
48
52
|
//#endregion
|
|
53
|
+
//#region src/core/mode.ts
|
|
54
|
+
function g() {
|
|
55
|
+
let e = o.get(v);
|
|
56
|
+
return f(e, "internal-error: initial mode not found"), l(e !== "present", "internal-error: initial mode cannot be 'present'"), e;
|
|
57
|
+
}
|
|
58
|
+
var _ = a({
|
|
59
|
+
mode: c() ? "read" : "not-set",
|
|
60
|
+
cellAnchor: null
|
|
61
|
+
}), v = a(void 0);
|
|
62
|
+
function y() {
|
|
63
|
+
let e = o.get(v);
|
|
64
|
+
return e !== "home" && e !== "gallery";
|
|
65
|
+
}
|
|
66
|
+
var b = a(!1);
|
|
67
|
+
function x() {
|
|
68
|
+
let e = (0, d.c)(1), { mode: t } = i(_), n = i(b), r;
|
|
69
|
+
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (r = new URLSearchParams(window.location.search).get(s.kiosk), e[0] = r) : r = e[0], t !== "read" && !n && r !== "true";
|
|
70
|
+
}
|
|
71
|
+
//#endregion
|
|
49
72
|
//#region ../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/_u64.js
|
|
50
|
-
var
|
|
73
|
+
var S = /* @__PURE__ */ e(((e) => {
|
|
51
74
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.toBig = e.shrSL = e.shrSH = e.rotrSL = e.rotrSH = e.rotrBL = e.rotrBH = e.rotr32L = e.rotr32H = e.rotlSL = e.rotlSH = e.rotlBL = e.rotlBH = e.add5L = e.add5H = e.add4L = e.add4H = e.add3L = e.add3H = void 0, e.add = v, e.fromBig = r, e.split = i;
|
|
52
75
|
var t = /* @__PURE__ */ BigInt(2 ** 32 - 1), n = /* @__PURE__ */ BigInt(32);
|
|
53
76
|
function r(e, r = !1) {
|
|
@@ -135,11 +158,11 @@ var p = /* @__PURE__ */ e(((e) => {
|
|
|
135
158
|
add5H: w,
|
|
136
159
|
add5L: C
|
|
137
160
|
};
|
|
138
|
-
})),
|
|
161
|
+
})), C = /* @__PURE__ */ e(((e) => {
|
|
139
162
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.crypto = void 0, e.crypto = typeof globalThis == "object" && "crypto" in globalThis ? globalThis.crypto : void 0;
|
|
140
|
-
})),
|
|
141
|
-
Object.defineProperty(e, "__esModule", { value: !0 }), e.wrapXOFConstructorWithOpts = e.wrapConstructorWithOpts = e.wrapConstructor = e.Hash = e.nextTick = e.swap32IfBE = e.byteSwapIfBE = e.swap8IfBE = e.isLE = void 0, e.isBytes = n, e.anumber = r, e.abytes = i, e.ahash = a, e.aexists = o, e.aoutput = s, e.u8 = c, e.u32 = l, e.clean = u, e.createView = d, e.rotr = f, e.rotl = p, e.byteSwap =
|
|
142
|
-
var t =
|
|
163
|
+
})), w = /* @__PURE__ */ e(((e) => {
|
|
164
|
+
Object.defineProperty(e, "__esModule", { value: !0 }), e.wrapXOFConstructorWithOpts = e.wrapConstructorWithOpts = e.wrapConstructor = e.Hash = e.nextTick = e.swap32IfBE = e.byteSwapIfBE = e.swap8IfBE = e.isLE = void 0, e.isBytes = n, e.anumber = r, e.abytes = i, e.ahash = a, e.aexists = o, e.aoutput = s, e.u8 = c, e.u32 = l, e.clean = u, e.createView = d, e.rotr = f, e.rotl = p, e.byteSwap = m, e.byteSwap32 = h, e.bytesToHex = v, e.hexToBytes = x, e.asyncLoop = S, e.utf8ToBytes = w, e.bytesToUtf8 = T, e.toBytes = E, e.kdfInputToBytes = D, e.concatBytes = O, e.checkOpts = k, e.createHasher = A, e.createOptHasher = j, e.createXOFer = M, e.randomBytes = N;
|
|
165
|
+
var t = C();
|
|
143
166
|
function n(e) {
|
|
144
167
|
return e instanceof Uint8Array || ArrayBuffer.isView(e) && e.constructor.name === "Uint8Array";
|
|
145
168
|
}
|
|
@@ -182,23 +205,23 @@ var p = /* @__PURE__ */ e(((e) => {
|
|
|
182
205
|
return e << t | e >>> 32 - t >>> 0;
|
|
183
206
|
}
|
|
184
207
|
e.isLE = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68;
|
|
185
|
-
function
|
|
208
|
+
function m(e) {
|
|
186
209
|
return e << 24 & 4278190080 | e << 8 & 16711680 | e >>> 8 & 65280 | e >>> 24 & 255;
|
|
187
210
|
}
|
|
188
|
-
e.swap8IfBE = e.isLE ? (e) => e : (e) =>
|
|
189
|
-
function
|
|
190
|
-
for (let t = 0; t < e.length; t++) e[t] =
|
|
211
|
+
e.swap8IfBE = e.isLE ? (e) => e : (e) => m(e), e.byteSwapIfBE = e.swap8IfBE;
|
|
212
|
+
function h(e) {
|
|
213
|
+
for (let t = 0; t < e.length; t++) e[t] = m(e[t]);
|
|
191
214
|
return e;
|
|
192
215
|
}
|
|
193
|
-
e.swap32IfBE = e.isLE ? (e) => e :
|
|
194
|
-
var
|
|
195
|
-
function
|
|
196
|
-
if (i(e),
|
|
216
|
+
e.swap32IfBE = e.isLE ? (e) => e : h;
|
|
217
|
+
var g = typeof Uint8Array.from([]).toHex == "function" && typeof Uint8Array.fromHex == "function", _ = /* @__PURE__ */ Array.from({ length: 256 }, (e, t) => t.toString(16).padStart(2, "0"));
|
|
218
|
+
function v(e) {
|
|
219
|
+
if (i(e), g) return e.toHex();
|
|
197
220
|
let t = "";
|
|
198
|
-
for (let n = 0; n < e.length; n++) t +=
|
|
221
|
+
for (let n = 0; n < e.length; n++) t += _[e[n]];
|
|
199
222
|
return t;
|
|
200
223
|
}
|
|
201
|
-
var
|
|
224
|
+
var y = {
|
|
202
225
|
_0: 48,
|
|
203
226
|
_9: 57,
|
|
204
227
|
A: 65,
|
|
@@ -206,19 +229,19 @@ var p = /* @__PURE__ */ e(((e) => {
|
|
|
206
229
|
a: 97,
|
|
207
230
|
f: 102
|
|
208
231
|
};
|
|
209
|
-
function
|
|
210
|
-
if (e >=
|
|
211
|
-
if (e >=
|
|
212
|
-
if (e >=
|
|
232
|
+
function b(e) {
|
|
233
|
+
if (e >= y._0 && e <= y._9) return e - y._0;
|
|
234
|
+
if (e >= y.A && e <= y.F) return e - (y.A - 10);
|
|
235
|
+
if (e >= y.a && e <= y.f) return e - (y.a - 10);
|
|
213
236
|
}
|
|
214
|
-
function
|
|
237
|
+
function x(e) {
|
|
215
238
|
if (typeof e != "string") throw Error("hex string expected, got " + typeof e);
|
|
216
|
-
if (
|
|
239
|
+
if (g) return Uint8Array.fromHex(e);
|
|
217
240
|
let t = e.length, n = t / 2;
|
|
218
241
|
if (t % 2) throw Error("hex string expected, got unpadded hex of length " + t);
|
|
219
242
|
let r = new Uint8Array(n);
|
|
220
243
|
for (let t = 0, i = 0; t < n; t++, i += 2) {
|
|
221
|
-
let n =
|
|
244
|
+
let n = b(e.charCodeAt(i)), a = b(e.charCodeAt(i + 1));
|
|
222
245
|
if (n === void 0 || a === void 0) {
|
|
223
246
|
let t = e[i] + e[i + 1];
|
|
224
247
|
throw Error("hex string expected, got non-hex character \"" + t + "\" at index " + i);
|
|
@@ -228,7 +251,7 @@ var p = /* @__PURE__ */ e(((e) => {
|
|
|
228
251
|
return r;
|
|
229
252
|
}
|
|
230
253
|
e.nextTick = async () => {};
|
|
231
|
-
async function
|
|
254
|
+
async function S(t, n, r) {
|
|
232
255
|
let i = Date.now();
|
|
233
256
|
for (let a = 0; a < t; a++) {
|
|
234
257
|
r(a);
|
|
@@ -285,38 +308,38 @@ var p = /* @__PURE__ */ e(((e) => {
|
|
|
285
308
|
if (t.crypto && typeof t.crypto.randomBytes == "function") return Uint8Array.from(t.crypto.randomBytes(e));
|
|
286
309
|
throw Error("crypto.getRandomValues must be defined");
|
|
287
310
|
}
|
|
288
|
-
})),
|
|
289
|
-
Object.defineProperty(e, "__esModule", { value: !0 }), e.shake256 = e.shake128 = e.keccak_512 = e.keccak_384 = e.keccak_256 = e.keccak_224 = e.sha3_512 = e.sha3_384 = e.sha3_256 = e.sha3_224 = e.Keccak = void 0, e.keccakP =
|
|
290
|
-
var t =
|
|
311
|
+
})), T = /* @__PURE__ */ e(((e) => {
|
|
312
|
+
Object.defineProperty(e, "__esModule", { value: !0 }), e.shake256 = e.shake128 = e.keccak_512 = e.keccak_384 = e.keccak_256 = e.keccak_224 = e.sha3_512 = e.sha3_384 = e.sha3_256 = e.sha3_224 = e.Keccak = void 0, e.keccakP = _;
|
|
313
|
+
var t = S(), n = w(), r = BigInt(0), i = BigInt(1), a = BigInt(2), o = BigInt(7), s = BigInt(256), c = BigInt(113), l = [], u = [], d = [];
|
|
291
314
|
for (let e = 0, t = i, n = 1, f = 0; e < 24; e++) {
|
|
292
315
|
[n, f] = [f, (2 * n + 3 * f) % 5], l.push(2 * (5 * f + n)), u.push((e + 1) * (e + 2) / 2 % 64);
|
|
293
316
|
let p = r;
|
|
294
317
|
for (let e = 0; e < 7; e++) t = (t << i ^ (t >> o) * c) % s, t & a && (p ^= i << (i << /* @__PURE__ */ BigInt(e)) - i);
|
|
295
318
|
d.push(p);
|
|
296
319
|
}
|
|
297
|
-
var f = (0, t.split)(d, !0),
|
|
298
|
-
function
|
|
320
|
+
var f = (0, t.split)(d, !0), p = f[0], m = f[1], h = (e, n, r) => r > 32 ? (0, t.rotlBH)(e, n, r) : (0, t.rotlSH)(e, n, r), g = (e, n, r) => r > 32 ? (0, t.rotlBL)(e, n, r) : (0, t.rotlSL)(e, n, r);
|
|
321
|
+
function _(e, t = 24) {
|
|
299
322
|
let r = /* @__PURE__ */ new Uint32Array(10);
|
|
300
323
|
for (let n = 24 - t; n < 24; n++) {
|
|
301
324
|
for (let t = 0; t < 10; t++) r[t] = e[t] ^ e[t + 10] ^ e[t + 20] ^ e[t + 30] ^ e[t + 40];
|
|
302
325
|
for (let t = 0; t < 10; t += 2) {
|
|
303
|
-
let n = (t + 8) % 10, i = (t + 2) % 10, a = r[i], o = r[i + 1], s =
|
|
326
|
+
let n = (t + 8) % 10, i = (t + 2) % 10, a = r[i], o = r[i + 1], s = h(a, o, 1) ^ r[n], c = g(a, o, 1) ^ r[n + 1];
|
|
304
327
|
for (let n = 0; n < 50; n += 10) e[t + n] ^= s, e[t + n + 1] ^= c;
|
|
305
328
|
}
|
|
306
329
|
let t = e[2], i = e[3];
|
|
307
330
|
for (let n = 0; n < 24; n++) {
|
|
308
|
-
let r = u[n], a =
|
|
331
|
+
let r = u[n], a = h(t, i, r), o = g(t, i, r), s = l[n];
|
|
309
332
|
t = e[s], i = e[s + 1], e[s] = a, e[s + 1] = o;
|
|
310
333
|
}
|
|
311
334
|
for (let t = 0; t < 50; t += 10) {
|
|
312
335
|
for (let n = 0; n < 10; n++) r[n] = e[t + n];
|
|
313
336
|
for (let n = 0; n < 10; n++) e[t + n] ^= ~r[(n + 2) % 10] & r[(n + 4) % 10];
|
|
314
337
|
}
|
|
315
|
-
e[0] ^=
|
|
338
|
+
e[0] ^= p[n], e[1] ^= m[n];
|
|
316
339
|
}
|
|
317
340
|
(0, n.clean)(r);
|
|
318
341
|
}
|
|
319
|
-
var
|
|
342
|
+
var v = class e extends n.Hash {
|
|
320
343
|
constructor(e, t, r, i = !1, a = 24) {
|
|
321
344
|
if (super(), this.pos = 0, this.posOut = 0, this.finished = !1, this.destroyed = !1, this.enableXOF = !1, this.blockLen = e, this.suffix = t, this.outputLen = r, this.enableXOF = i, this.rounds = a, (0, n.anumber)(r), !(0 < e && e < 200)) throw Error("only keccak-f1600 function is supported");
|
|
322
345
|
this.state = /* @__PURE__ */ new Uint8Array(200), this.state32 = (0, n.u32)(this.state);
|
|
@@ -325,7 +348,7 @@ var p = /* @__PURE__ */ e(((e) => {
|
|
|
325
348
|
return this._cloneInto();
|
|
326
349
|
}
|
|
327
350
|
keccak() {
|
|
328
|
-
(0, n.swap32IfBE)(this.state32),
|
|
351
|
+
(0, n.swap32IfBE)(this.state32), _(this.state32, this.rounds), (0, n.swap32IfBE)(this.state32), this.posOut = 0, this.pos = 0;
|
|
329
352
|
}
|
|
330
353
|
update(e) {
|
|
331
354
|
(0, n.aexists)(this), e = (0, n.toBytes)(e), (0, n.abytes)(e);
|
|
@@ -375,13 +398,13 @@ var p = /* @__PURE__ */ e(((e) => {
|
|
|
375
398
|
return t ||= new e(n, r, i, o, a), t.state32.set(this.state32), t.pos = this.pos, t.posOut = this.posOut, t.finished = this.finished, t.rounds = a, t.suffix = r, t.outputLen = i, t.enableXOF = o, t.destroyed = this.destroyed, t;
|
|
376
399
|
}
|
|
377
400
|
};
|
|
378
|
-
e.Keccak =
|
|
379
|
-
var
|
|
380
|
-
e.sha3_224 =
|
|
381
|
-
var
|
|
382
|
-
e.shake128 =
|
|
383
|
-
})),
|
|
384
|
-
var { sha3_512: n } =
|
|
401
|
+
e.Keccak = v;
|
|
402
|
+
var y = (e, t, r) => (0, n.createHasher)(() => new v(t, e, r));
|
|
403
|
+
e.sha3_224 = y(6, 144, 28), e.sha3_256 = y(6, 136, 32), e.sha3_384 = y(6, 104, 48), e.sha3_512 = y(6, 72, 64), e.keccak_224 = y(1, 144, 28), e.keccak_256 = y(1, 136, 32), e.keccak_384 = y(1, 104, 48), e.keccak_512 = y(1, 72, 64);
|
|
404
|
+
var b = (e, t, r) => (0, n.createXOFer)((n = {}) => new v(t, e, n.dkLen === void 0 ? r : n.dkLen, !0));
|
|
405
|
+
e.shake128 = b(31, 168, 16), e.shake256 = b(31, 136, 32);
|
|
406
|
+
})), E = /* @__PURE__ */ e(((e, t) => {
|
|
407
|
+
var { sha3_512: n } = T(), r = 24, i = 32, a = (e = 4, t = Math.random) => {
|
|
385
408
|
let n = "";
|
|
386
409
|
for (; n.length < e;) n += Math.floor(t() * 36).toString(36);
|
|
387
410
|
return n;
|
|
@@ -411,19 +434,19 @@ var p = /* @__PURE__ */ e(((e) => {
|
|
|
411
434
|
defaultLength: r,
|
|
412
435
|
bigLength: i
|
|
413
436
|
}), t.exports.init = p, t.exports.createId = m, t.exports.bufToBigInt = o, t.exports.createCounter = d, t.exports.createFingerprint = u, t.exports.isCuid = h;
|
|
414
|
-
})),
|
|
415
|
-
var { createId: n, init: r, getConstants: i, isCuid: a } =
|
|
437
|
+
})), D = /* @__PURE__ */ e(((e, t) => {
|
|
438
|
+
var { createId: n, init: r, getConstants: i, isCuid: a } = E();
|
|
416
439
|
t.exports.createId = n, t.exports.init = r, t.exports.getConstants = i, t.exports.isCuid = a;
|
|
417
|
-
})),
|
|
418
|
-
function
|
|
440
|
+
})), O = D();
|
|
441
|
+
function k(e) {
|
|
419
442
|
let t = new URL(window.location.href);
|
|
420
443
|
e(t.searchParams), window.history.replaceState({}, "", t.toString());
|
|
421
444
|
}
|
|
422
|
-
var
|
|
423
|
-
function
|
|
424
|
-
return typeof e == "string" &&
|
|
445
|
+
var A = /^(https?:\/\/\S+)$/;
|
|
446
|
+
function j(e) {
|
|
447
|
+
return typeof e == "string" && A.test(e);
|
|
425
448
|
}
|
|
426
|
-
function
|
|
449
|
+
function M({ href: e, queryParams: t, keys: n }) {
|
|
427
450
|
let r = typeof t == "string" ? new URLSearchParams(t) : t;
|
|
428
451
|
if (r.size === 0 || e.startsWith("http://") || e.startsWith("https://")) return e;
|
|
429
452
|
let i = e.startsWith("#"), a = i && e.includes("?");
|
|
@@ -444,49 +467,54 @@ function C({ href: e, queryParams: t, keys: n }) {
|
|
|
444
467
|
}
|
|
445
468
|
//#endregion
|
|
446
469
|
//#region src/core/kernel/session.ts
|
|
447
|
-
var
|
|
448
|
-
function
|
|
449
|
-
return `s_${
|
|
470
|
+
var N = (0, O.init)({ length: 6 });
|
|
471
|
+
function P() {
|
|
472
|
+
return `s_${N()}`;
|
|
450
473
|
}
|
|
451
|
-
function
|
|
474
|
+
function F(e) {
|
|
452
475
|
return e ? /^s_[\da-z]{6}$/.test(e) : !1;
|
|
453
476
|
}
|
|
454
|
-
var
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
477
|
+
var I = null;
|
|
478
|
+
function L() {
|
|
479
|
+
let e = o.get(v) === "edit", n = new URL(window.location.href).searchParams.get(s.sessionId), r = F(n) ? n : null;
|
|
480
|
+
return k((t) => {
|
|
481
|
+
if (!e) {
|
|
482
|
+
t.delete(s.sessionId), t.delete(s.kiosk);
|
|
483
|
+
return;
|
|
484
|
+
}
|
|
485
|
+
t.has(s.kiosk) || t.delete(s.sessionId);
|
|
486
|
+
}), r === null ? (t.debug("Starting a new session", { sessionId: n }), P()) : e ? (t.debug("Connecting to existing session", { sessionId: r }), r) : (t.debug("Ignoring session_id from URL outside the editor", { sessionId: r }), P());
|
|
487
|
+
}
|
|
488
|
+
function R() {
|
|
489
|
+
return I === null && (I = L()), I;
|
|
462
490
|
}
|
|
463
491
|
//#endregion
|
|
464
492
|
//#region src/core/static/static-state.ts
|
|
465
|
-
function
|
|
493
|
+
function z(e) {
|
|
466
494
|
if (typeof e != "object" || !e || Array.isArray(e)) return !1;
|
|
467
495
|
for (let t of Object.values(e)) if (typeof t != "string") return !1;
|
|
468
496
|
return !0;
|
|
469
497
|
}
|
|
470
|
-
function
|
|
498
|
+
function B(e) {
|
|
471
499
|
if (typeof e != "object" || !e || Array.isArray(e)) return !1;
|
|
472
500
|
let t = e;
|
|
473
|
-
return !(!
|
|
501
|
+
return !(!z(t.files) || t.modelNotifications !== void 0 && !Array.isArray(t.modelNotifications));
|
|
474
502
|
}
|
|
475
|
-
function
|
|
503
|
+
function V() {
|
|
476
504
|
let e = typeof window > "u" ? void 0 : window.__MARIMO_STATIC__;
|
|
477
|
-
return
|
|
505
|
+
return B(e) ? e : void 0;
|
|
478
506
|
}
|
|
479
|
-
function
|
|
480
|
-
return
|
|
507
|
+
function H() {
|
|
508
|
+
return V() !== void 0;
|
|
481
509
|
}
|
|
482
|
-
function
|
|
483
|
-
let e =
|
|
484
|
-
return
|
|
510
|
+
function U() {
|
|
511
|
+
let e = V();
|
|
512
|
+
return l(e !== void 0, "Not a static notebook"), e.files;
|
|
485
513
|
}
|
|
486
514
|
//#endregion
|
|
487
515
|
//#region src/core/runtime/runtime.ts
|
|
488
|
-
var
|
|
489
|
-
initialHealthyCheck = new
|
|
516
|
+
var W = class {
|
|
517
|
+
initialHealthyCheck = new m();
|
|
490
518
|
config;
|
|
491
519
|
lazy;
|
|
492
520
|
constructor(e, t = !1) {
|
|
@@ -508,23 +536,23 @@ var P = class {
|
|
|
508
536
|
return this.httpURL.origin === window.location.origin;
|
|
509
537
|
}
|
|
510
538
|
get isServerless() {
|
|
511
|
-
return
|
|
539
|
+
return p() || c() || H();
|
|
512
540
|
}
|
|
513
541
|
formatHttpURL({ path: e = "", searchParams: t, restrictToKnownQueryParams: n = !0 }) {
|
|
514
542
|
let r = this.httpURL, i = new URLSearchParams(window.location.search);
|
|
515
543
|
if (t) for (let [e, n] of t.entries()) r.searchParams.set(e, n);
|
|
516
|
-
for (let [e, t] of i.entries()) n && !Object.values(
|
|
544
|
+
for (let [e, t] of i.entries()) n && !Object.values(s).includes(e) || r.searchParams.set(e, t);
|
|
517
545
|
return r.pathname = `${r.pathname.replace(/\/$/, "")}/${e.replace(/^\//, "")}`, r.hash = "", r;
|
|
518
546
|
}
|
|
519
547
|
appendCrossOriginAuth(e) {
|
|
520
|
-
return !this.isSameOrigin && this.config.authToken && e.searchParams.set(
|
|
548
|
+
return !this.isSameOrigin && this.config.authToken && e.searchParams.set(s.accessToken, this.config.authToken), e;
|
|
521
549
|
}
|
|
522
550
|
formatNavigableHttpURL(e, t) {
|
|
523
551
|
let n = this.formatHttpURL({
|
|
524
552
|
path: e,
|
|
525
553
|
searchParams: t
|
|
526
554
|
});
|
|
527
|
-
return n.searchParams.delete(
|
|
555
|
+
return n.searchParams.delete(s.accessToken), this.appendCrossOriginAuth(n);
|
|
528
556
|
}
|
|
529
557
|
formatWsURL(e, t) {
|
|
530
558
|
let n = this.formatHttpURL({
|
|
@@ -532,13 +560,13 @@ var P = class {
|
|
|
532
560
|
searchParams: t,
|
|
533
561
|
restrictToKnownQueryParams: !1
|
|
534
562
|
});
|
|
535
|
-
return
|
|
563
|
+
return G(this.appendCrossOriginAuth(n).toString());
|
|
536
564
|
}
|
|
537
565
|
getSessionSearchParams(e) {
|
|
538
566
|
let t = new URL(this.config.url), n = new URLSearchParams(t.search);
|
|
539
567
|
return new URLSearchParams(window.location.search).forEach((e, t) => {
|
|
540
568
|
n.has(t) || n.set(t, e);
|
|
541
|
-
}), n.set(
|
|
569
|
+
}), n.set(s.sessionId, e), n;
|
|
542
570
|
}
|
|
543
571
|
getWsURL(e) {
|
|
544
572
|
return this.formatWsURL("/ws", this.getSessionSearchParams(e));
|
|
@@ -549,7 +577,7 @@ var P = class {
|
|
|
549
577
|
searchParams: this.getSessionSearchParams(e),
|
|
550
578
|
restrictToKnownQueryParams: !1
|
|
551
579
|
});
|
|
552
|
-
return t.searchParams.delete(
|
|
580
|
+
return t.searchParams.delete(s.accessToken), t;
|
|
553
581
|
}
|
|
554
582
|
getWsSyncURL(e) {
|
|
555
583
|
return this.formatWsURL("/ws_sync", this.getSessionSearchParams(e));
|
|
@@ -560,8 +588,8 @@ var P = class {
|
|
|
560
588
|
}
|
|
561
589
|
getLSPURL(e) {
|
|
562
590
|
if (e === "copilot") {
|
|
563
|
-
let t = this.formatWsURL(`/lsp/${e}`), n = t.searchParams.get(
|
|
564
|
-
return t.search = "", n && t.searchParams.set(
|
|
591
|
+
let t = this.formatWsURL(`/lsp/${e}`), n = t.searchParams.get(s.accessToken);
|
|
592
|
+
return t.search = "", n && t.searchParams.set(s.accessToken, n), t;
|
|
565
593
|
}
|
|
566
594
|
return this.formatWsURL(`/lsp/${e}`);
|
|
567
595
|
}
|
|
@@ -618,17 +646,17 @@ var P = class {
|
|
|
618
646
|
}
|
|
619
647
|
headers() {
|
|
620
648
|
let e = {
|
|
621
|
-
"Marimo-Session-Id":
|
|
649
|
+
"Marimo-Session-Id": R(),
|
|
622
650
|
"Marimo-Server-Token": this.config.serverToken ?? "",
|
|
623
651
|
"x-runtime-url": this.httpURL.toString()
|
|
624
652
|
};
|
|
625
653
|
return this.config.authToken && (e.Authorization = `Bearer ${this.config.authToken}`), e;
|
|
626
654
|
}
|
|
627
655
|
sessionHeaders() {
|
|
628
|
-
return { "Marimo-Session-Id":
|
|
656
|
+
return { "Marimo-Session-Id": R() };
|
|
629
657
|
}
|
|
630
658
|
};
|
|
631
|
-
function
|
|
659
|
+
function G(e) {
|
|
632
660
|
if (!e.startsWith("http")) {
|
|
633
661
|
t.warn(`URL must start with http: ${e}`);
|
|
634
662
|
let n = new URL(e);
|
|
@@ -638,39 +666,39 @@ function F(e) {
|
|
|
638
666
|
}
|
|
639
667
|
//#endregion
|
|
640
668
|
//#region src/core/runtime/config.ts
|
|
641
|
-
function
|
|
669
|
+
function K() {
|
|
642
670
|
let e = new URL(document.baseURI);
|
|
643
671
|
return e.search = "", e.hash = "", e.toString();
|
|
644
672
|
}
|
|
645
|
-
var
|
|
673
|
+
var q = {
|
|
646
674
|
lazy: !0,
|
|
647
|
-
url:
|
|
648
|
-
},
|
|
649
|
-
let t = e(
|
|
650
|
-
return new
|
|
675
|
+
url: K()
|
|
676
|
+
}, J = a(q), Y = a((e) => {
|
|
677
|
+
let t = e(J);
|
|
678
|
+
return new W(t, t.lazy);
|
|
651
679
|
});
|
|
652
|
-
function
|
|
653
|
-
return
|
|
680
|
+
function X() {
|
|
681
|
+
return o.get(Y);
|
|
654
682
|
}
|
|
655
|
-
function
|
|
683
|
+
function ee(e) {
|
|
656
684
|
if (e.startsWith("http")) return new URL(e);
|
|
657
|
-
let t =
|
|
685
|
+
let t = X().httpURL.toString();
|
|
658
686
|
return t.startsWith("blob:") && (t = t.replace("blob:", "")), new URL(e, t);
|
|
659
687
|
}
|
|
660
688
|
//#endregion
|
|
661
689
|
//#region ../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/constants.js
|
|
662
|
-
var
|
|
663
|
-
|
|
664
|
-
var
|
|
690
|
+
var te = 365.2425, ne = 6048e5, re = 864e5, ie = 6e4, ae = 36e5, oe = 1e3, Z = 86400;
|
|
691
|
+
Z * 7, Z * te / 12 * 3;
|
|
692
|
+
var Q = Symbol.for("constructDateFrom");
|
|
665
693
|
//#endregion
|
|
666
694
|
//#region ../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/constructFrom.js
|
|
667
|
-
function
|
|
668
|
-
return typeof e == "function" ? e(t) : e && typeof e == "object" &&
|
|
695
|
+
function $(e, t) {
|
|
696
|
+
return typeof e == "function" ? e(t) : e && typeof e == "object" && Q in e ? e[Q](t) : e instanceof Date ? new e.constructor(t) : new Date(t);
|
|
669
697
|
}
|
|
670
698
|
//#endregion
|
|
671
699
|
//#region ../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/toDate.js
|
|
672
|
-
function
|
|
673
|
-
return
|
|
700
|
+
function se(e, t) {
|
|
701
|
+
return $(t || e, e);
|
|
674
702
|
}
|
|
675
703
|
//#endregion
|
|
676
|
-
export { u as _,
|
|
704
|
+
export { p as C, m as S, u as T, v as _, ie as a, x as b, ee as c, H as d, M as f, g, D as h, ae as i, X as l, k as m, $ as n, oe as o, j as p, re as r, ne as s, se as t, U as u, y as v, f as w, _ as x, b as y };
|
|
@@ -3,7 +3,7 @@ import { g as t, h as n, m as r, o as i } from "./button-DdXAm8iz.js";
|
|
|
3
3
|
import { t as a } from "./react-ofJbxM4x.js";
|
|
4
4
|
import { t as o } from "./compiler-runtime-Cj8ZWiNS.js";
|
|
5
5
|
import { t as s } from "./tooltip-qB8NlSqV.js";
|
|
6
|
-
import { c,
|
|
6
|
+
import { T as c, c as l } from "./toDate-C67bxMWn.js";
|
|
7
7
|
import { t as u } from "./jsx-runtime-DgDPJV9S.js";
|
|
8
8
|
import { n as d } from "./error-banner-B94dcDmP.js";
|
|
9
9
|
import { t as f } from "./debounce-C3jyATpc.js";
|
|
@@ -11,7 +11,7 @@ import { A as p, n as ee } from "./useTheme-DzXmYZ5V.js";
|
|
|
11
11
|
import { c as m } from "./arrays-CN1djC4k.js";
|
|
12
12
|
import { t as te } from "./objects-CzUgoMIF.js";
|
|
13
13
|
import { t as h } from "./useAsyncData-BD6AStMt.js";
|
|
14
|
-
import { a as ne, i as re, n as ie, t as g } from "./formats-
|
|
14
|
+
import { a as ne, i as re, n as ie, t as g } from "./formats-C8rLgZT9.js";
|
|
15
15
|
import { M as ae, n as oe } from "./vega-loader.browser-D95WfUcj.js";
|
|
16
16
|
import { t as se } from "./react-vega-5AcMW8gG.js";
|
|
17
17
|
import { a as ce, n as _ } from "./loader-D2W4oM-3.js";
|
|
@@ -21,7 +21,7 @@ import { t as de } from "./use-vega-container-remeasure-4DwJbPWu.js";
|
|
|
21
21
|
//#region src/plugins/impl/vega/fix-relative-url.ts
|
|
22
22
|
var fe = /* @__PURE__ */ e(a(), 1), pe = o();
|
|
23
23
|
function me(e) {
|
|
24
|
-
return e.data && "url" in e.data && (e.data.url =
|
|
24
|
+
return e.data && "url" in e.data && (e.data.url = l(e.data.url).href), e;
|
|
25
25
|
}
|
|
26
26
|
//#endregion
|
|
27
27
|
//#region src/plugins/impl/vega/types.ts
|
|
@@ -492,7 +492,7 @@ async function U(e) {
|
|
|
492
492
|
}), !e.data || !("url" in e.data)) return e;
|
|
493
493
|
let i;
|
|
494
494
|
try {
|
|
495
|
-
i =
|
|
495
|
+
i = l(e.data.url);
|
|
496
496
|
} catch {
|
|
497
497
|
return e;
|
|
498
498
|
}
|
|
@@ -530,7 +530,7 @@ var G = (e) => {
|
|
|
530
530
|
embedOptions: s
|
|
531
531
|
}), t[5] = i, t[6] = s, t[7] = a, t[8] = u, t[9] = r, t[10] = n, t[11] = p) : p = t[11], p;
|
|
532
532
|
}, K = (e) => {
|
|
533
|
-
let a = (0, pe.c)(50), { value: o, setValue:
|
|
533
|
+
let a = (0, pe.c)(50), { value: o, setValue: l, chartSelection: u, fieldSelection: d, spec: m, embedOptions: h } = e, { theme: ne } = ee(), g = (0, fe.useRef)(null), oe = (0, fe.useRef)(void 0), [_, ue] = (0, fe.useState)(), v;
|
|
534
534
|
bb0: {
|
|
535
535
|
if (h && "actions" in h) {
|
|
536
536
|
v = h.actions;
|
|
@@ -550,12 +550,12 @@ var G = (e) => {
|
|
|
550
550
|
let C = S, w;
|
|
551
551
|
a[5] === C ? w = a[6] : (w = T(C), a[5] = C, a[6] = w);
|
|
552
552
|
let E = w, D;
|
|
553
|
-
a[7] !==
|
|
554
|
-
|
|
553
|
+
a[7] !== l || a[8] !== o ? (D = (e) => {
|
|
554
|
+
l({
|
|
555
555
|
...o,
|
|
556
556
|
...e
|
|
557
557
|
});
|
|
558
|
-
}, a[7] =
|
|
558
|
+
}, a[7] = l, a[8] = o, a[9] = D) : D = a[9];
|
|
559
559
|
let O = p(D), k;
|
|
560
560
|
a[10] === O ? k = a[11] : (k = f((e, n) => {
|
|
561
561
|
t.debug("[Vega signal]", e, n);
|
|
@@ -592,7 +592,7 @@ var G = (e) => {
|
|
|
592
592
|
className: "text-xs flex flex-col",
|
|
593
593
|
children: e.map(ve)
|
|
594
594
|
}),
|
|
595
|
-
children: /* @__PURE__ */ (0, W.jsx)(
|
|
595
|
+
children: /* @__PURE__ */ (0, W.jsx)(c, { className: "absolute bottom-1 right-0 m-2 h-4 w-4 cursor-help text-muted-foreground hover:text-foreground" })
|
|
596
596
|
});
|
|
597
597
|
}, a[20] = E, a[21] = R);
|
|
598
598
|
let z = R, B = ne === "dark" ? "dark" : void 0, V;
|