@openlv/modal 0.0.1-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +165 -0
- package/README.md +1 -0
- package/dist/index.js +1355 -0
- package/dist/index.js.map +1 -0
- package/dist/modal.css +1 -0
- package/package.json +70 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,1355 @@
|
|
|
1
|
+
var Ye = Object.defineProperty;
|
|
2
|
+
var $e = (e, t, r) => t in e ? Ye(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
|
+
var F = (e, t, r) => $e(e, typeof t != "symbol" ? t + "" : t, r);
|
|
4
|
+
import { jsx as s, jsxs as d, Fragment as et } from "preact/jsx-runtime";
|
|
5
|
+
import { useEffect as L, useContext as ae, useState as y, useCallback as C, useRef as Se, useReducer as Ne, useMemo as Ae, useLayoutEffect as Z, useImperativeHandle as Oe, useId as je, useDebugValue as Re } from "preact/hooks";
|
|
6
|
+
import { createContext as Pe, createElement as R, Fragment as z, Component as B, createRef as tt, toChildArray as j, cloneElement as rt, render as T, hydrate as nt, options as b, h as ot } from "preact";
|
|
7
|
+
import it from "qrcode-generator";
|
|
8
|
+
function at(e) {
|
|
9
|
+
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
10
|
+
}
|
|
11
|
+
var Y = { exports: {} };
|
|
12
|
+
/*!
|
|
13
|
+
Copyright (c) 2018 Jed Watson.
|
|
14
|
+
Licensed under the MIT License (MIT), see
|
|
15
|
+
http://jedwatson.github.io/classnames
|
|
16
|
+
*/
|
|
17
|
+
var fe;
|
|
18
|
+
function st() {
|
|
19
|
+
return fe || (fe = 1, (function(e) {
|
|
20
|
+
(function() {
|
|
21
|
+
var t = {}.hasOwnProperty;
|
|
22
|
+
function r() {
|
|
23
|
+
for (var i = "", a = 0; a < arguments.length; a++) {
|
|
24
|
+
var l = arguments[a];
|
|
25
|
+
l && (i = o(i, n(l)));
|
|
26
|
+
}
|
|
27
|
+
return i;
|
|
28
|
+
}
|
|
29
|
+
function n(i) {
|
|
30
|
+
if (typeof i == "string" || typeof i == "number")
|
|
31
|
+
return i;
|
|
32
|
+
if (typeof i != "object")
|
|
33
|
+
return "";
|
|
34
|
+
if (Array.isArray(i))
|
|
35
|
+
return r.apply(null, i);
|
|
36
|
+
if (i.toString !== Object.prototype.toString && !i.toString.toString().includes("[native code]"))
|
|
37
|
+
return i.toString();
|
|
38
|
+
var a = "";
|
|
39
|
+
for (var l in i)
|
|
40
|
+
t.call(i, l) && i[l] && (a = o(a, l));
|
|
41
|
+
return a;
|
|
42
|
+
}
|
|
43
|
+
function o(i, a) {
|
|
44
|
+
return a ? i ? i + " " + a : i + a : i;
|
|
45
|
+
}
|
|
46
|
+
e.exports ? (r.default = r, e.exports = r) : window.classNames = r;
|
|
47
|
+
})();
|
|
48
|
+
})(Y)), Y.exports;
|
|
49
|
+
}
|
|
50
|
+
var lt = st();
|
|
51
|
+
const Le = /* @__PURE__ */ at(lt), v = Symbol.for("@ts-pattern/matcher"), Ee = Symbol.for("@ts-pattern/isVariadic"), J = "@ts-pattern/anonymous-select-key", ee = (e) => !!(e && typeof e == "object"), V = (e) => e && !!e[v], h = (e, t, r) => {
|
|
52
|
+
if (V(e)) {
|
|
53
|
+
const n = e[v](), { matched: o, selections: i } = n.match(t);
|
|
54
|
+
return o && i && Object.keys(i).forEach((a) => r(a, i[a])), o;
|
|
55
|
+
}
|
|
56
|
+
if (ee(e)) {
|
|
57
|
+
if (!ee(t)) return !1;
|
|
58
|
+
if (Array.isArray(e)) {
|
|
59
|
+
if (!Array.isArray(t)) return !1;
|
|
60
|
+
let n = [], o = [], i = [];
|
|
61
|
+
for (const a of e.keys()) {
|
|
62
|
+
const l = e[a];
|
|
63
|
+
V(l) && l[Ee] ? i.push(l) : i.length ? o.push(l) : n.push(l);
|
|
64
|
+
}
|
|
65
|
+
if (i.length) {
|
|
66
|
+
if (i.length > 1) throw new Error("Pattern error: Using `...P.array(...)` several times in a single pattern is not allowed.");
|
|
67
|
+
if (t.length < n.length + o.length) return !1;
|
|
68
|
+
const a = t.slice(0, n.length), l = o.length === 0 ? [] : t.slice(-o.length), c = t.slice(n.length, o.length === 0 ? 1 / 0 : -o.length);
|
|
69
|
+
return n.every((f, w) => h(f, a[w], r)) && o.every((f, w) => h(f, l[w], r)) && (i.length === 0 || h(i[0], c, r));
|
|
70
|
+
}
|
|
71
|
+
return e.length === t.length && e.every((a, l) => h(a, t[l], r));
|
|
72
|
+
}
|
|
73
|
+
return Reflect.ownKeys(e).every((n) => {
|
|
74
|
+
const o = e[n];
|
|
75
|
+
return (n in t || V(i = o) && i[v]().matcherType === "optional") && h(o, t[n], r);
|
|
76
|
+
var i;
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
return Object.is(t, e);
|
|
80
|
+
}, m = (e) => {
|
|
81
|
+
var t, r, n;
|
|
82
|
+
return ee(e) ? V(e) ? (t = (r = (n = e[v]()).getSelectionKeys) == null ? void 0 : r.call(n)) != null ? t : [] : Array.isArray(e) ? M(e, m) : M(Object.values(e), m) : [];
|
|
83
|
+
}, M = (e, t) => e.reduce((r, n) => r.concat(t(n)), []);
|
|
84
|
+
function ct(...e) {
|
|
85
|
+
if (e.length === 1) {
|
|
86
|
+
const [t] = e;
|
|
87
|
+
return (r) => h(t, r, () => {
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
if (e.length === 2) {
|
|
91
|
+
const [t, r] = e;
|
|
92
|
+
return h(t, r, () => {
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
throw new Error(`isMatching wasn't given the right number of arguments: expected 1 or 2, received ${e.length}.`);
|
|
96
|
+
}
|
|
97
|
+
function g(e) {
|
|
98
|
+
return Object.assign(e, { optional: () => se(e), and: (t) => p(e, t), or: (t) => Fe(e, t), select: (t) => t === void 0 ? W(e) : W(t, e) });
|
|
99
|
+
}
|
|
100
|
+
function te(e) {
|
|
101
|
+
return Object.assign(((t) => Object.assign(t, { [Symbol.iterator]() {
|
|
102
|
+
let r = 0;
|
|
103
|
+
const n = [{ value: Object.assign(t, { [Ee]: !0 }), done: !1 }, { done: !0, value: void 0 }];
|
|
104
|
+
return { next: () => {
|
|
105
|
+
var o;
|
|
106
|
+
return (o = n[r++]) != null ? o : n.at(-1);
|
|
107
|
+
} };
|
|
108
|
+
} }))(e), { optional: () => te(se(e)), select: (t) => te(t === void 0 ? W(e) : W(t, e)) });
|
|
109
|
+
}
|
|
110
|
+
function se(e) {
|
|
111
|
+
return g({ [v]: () => ({ match: (t) => {
|
|
112
|
+
let r = {};
|
|
113
|
+
const n = (o, i) => {
|
|
114
|
+
r[o] = i;
|
|
115
|
+
};
|
|
116
|
+
return t === void 0 ? (m(e).forEach((o) => n(o, void 0)), { matched: !0, selections: r }) : { matched: h(e, t, n), selections: r };
|
|
117
|
+
}, getSelectionKeys: () => m(e), matcherType: "optional" }) });
|
|
118
|
+
}
|
|
119
|
+
const ut = (e, t) => {
|
|
120
|
+
for (const r of e) if (!t(r)) return !1;
|
|
121
|
+
return !0;
|
|
122
|
+
}, dt = (e, t) => {
|
|
123
|
+
for (const [r, n] of e.entries()) if (!t(n, r)) return !1;
|
|
124
|
+
return !0;
|
|
125
|
+
}, pt = (e, t) => {
|
|
126
|
+
const r = Reflect.ownKeys(e);
|
|
127
|
+
for (const n of r) if (!t(n, e[n])) return !1;
|
|
128
|
+
return !0;
|
|
129
|
+
};
|
|
130
|
+
function p(...e) {
|
|
131
|
+
return g({ [v]: () => ({ match: (t) => {
|
|
132
|
+
let r = {};
|
|
133
|
+
const n = (o, i) => {
|
|
134
|
+
r[o] = i;
|
|
135
|
+
};
|
|
136
|
+
return { matched: e.every((o) => h(o, t, n)), selections: r };
|
|
137
|
+
}, getSelectionKeys: () => M(e, m), matcherType: "and" }) });
|
|
138
|
+
}
|
|
139
|
+
function Fe(...e) {
|
|
140
|
+
return g({ [v]: () => ({ match: (t) => {
|
|
141
|
+
let r = {};
|
|
142
|
+
const n = (o, i) => {
|
|
143
|
+
r[o] = i;
|
|
144
|
+
};
|
|
145
|
+
return M(e, m).forEach((o) => n(o, void 0)), { matched: e.some((o) => h(o, t, n)), selections: r };
|
|
146
|
+
}, getSelectionKeys: () => M(e, m), matcherType: "or" }) });
|
|
147
|
+
}
|
|
148
|
+
function u(e) {
|
|
149
|
+
return { [v]: () => ({ match: (t) => ({ matched: !!e(t) }) }) };
|
|
150
|
+
}
|
|
151
|
+
function W(...e) {
|
|
152
|
+
const t = typeof e[0] == "string" ? e[0] : void 0, r = e.length === 2 ? e[1] : typeof e[0] == "string" ? void 0 : e[0];
|
|
153
|
+
return g({ [v]: () => ({ match: (n) => {
|
|
154
|
+
let o = { [t ?? J]: n };
|
|
155
|
+
return { matched: r === void 0 || h(r, n, (i, a) => {
|
|
156
|
+
o[i] = a;
|
|
157
|
+
}), selections: o };
|
|
158
|
+
}, getSelectionKeys: () => [t ?? J].concat(r === void 0 ? [] : m(r)) }) });
|
|
159
|
+
}
|
|
160
|
+
function Be(e) {
|
|
161
|
+
return !0;
|
|
162
|
+
}
|
|
163
|
+
function x(e) {
|
|
164
|
+
return typeof e == "number";
|
|
165
|
+
}
|
|
166
|
+
function S(e) {
|
|
167
|
+
return typeof e == "string";
|
|
168
|
+
}
|
|
169
|
+
function N(e) {
|
|
170
|
+
return typeof e == "bigint";
|
|
171
|
+
}
|
|
172
|
+
const Te = g(u(Be)), ft = g(u(Be)), ht = Te, A = (e) => Object.assign(g(e), { startsWith: (t) => {
|
|
173
|
+
return A(p(e, (r = t, u((n) => S(n) && n.startsWith(r)))));
|
|
174
|
+
var r;
|
|
175
|
+
}, endsWith: (t) => {
|
|
176
|
+
return A(p(e, (r = t, u((n) => S(n) && n.endsWith(r)))));
|
|
177
|
+
var r;
|
|
178
|
+
}, minLength: (t) => A(p(e, ((r) => u((n) => S(n) && n.length >= r))(t))), length: (t) => A(p(e, ((r) => u((n) => S(n) && n.length === r))(t))), maxLength: (t) => A(p(e, ((r) => u((n) => S(n) && n.length <= r))(t))), includes: (t) => {
|
|
179
|
+
return A(p(e, (r = t, u((n) => S(n) && n.includes(r)))));
|
|
180
|
+
var r;
|
|
181
|
+
}, regex: (t) => {
|
|
182
|
+
return A(p(e, (r = t, u((n) => S(n) && !!n.match(r)))));
|
|
183
|
+
var r;
|
|
184
|
+
} }), he = A(u(S)), k = (e) => Object.assign(g(e), { between: (t, r) => k(p(e, ((n, o) => u((i) => x(i) && n <= i && o >= i))(t, r))), lt: (t) => k(p(e, ((r) => u((n) => x(n) && n < r))(t))), gt: (t) => k(p(e, ((r) => u((n) => x(n) && n > r))(t))), lte: (t) => k(p(e, ((r) => u((n) => x(n) && n <= r))(t))), gte: (t) => k(p(e, ((r) => u((n) => x(n) && n >= r))(t))), int: () => k(p(e, u((t) => x(t) && Number.isInteger(t)))), finite: () => k(p(e, u((t) => x(t) && Number.isFinite(t)))), positive: () => k(p(e, u((t) => x(t) && t > 0))), negative: () => k(p(e, u((t) => x(t) && t < 0))) }), gt = k(u(x)), O = (e) => Object.assign(g(e), { between: (t, r) => O(p(e, ((n, o) => u((i) => N(i) && n <= i && o >= i))(t, r))), lt: (t) => O(p(e, ((r) => u((n) => N(n) && n < r))(t))), gt: (t) => O(p(e, ((r) => u((n) => N(n) && n > r))(t))), lte: (t) => O(p(e, ((r) => u((n) => N(n) && n <= r))(t))), gte: (t) => O(p(e, ((r) => u((n) => N(n) && n >= r))(t))), positive: () => O(p(e, u((t) => N(t) && t > 0))), negative: () => O(p(e, u((t) => N(t) && t < 0))) }), mt = O(u(N)), vt = g(u(function(e) {
|
|
185
|
+
return typeof e == "boolean";
|
|
186
|
+
})), bt = g(u(function(e) {
|
|
187
|
+
return typeof e == "symbol";
|
|
188
|
+
})), wt = g(u(function(e) {
|
|
189
|
+
return e == null;
|
|
190
|
+
})), yt = g(u(function(e) {
|
|
191
|
+
return e != null;
|
|
192
|
+
}));
|
|
193
|
+
var le = { __proto__: null, matcher: v, optional: se, array: function(...e) {
|
|
194
|
+
return te({ [v]: () => ({ match: (t) => {
|
|
195
|
+
if (!Array.isArray(t)) return { matched: !1 };
|
|
196
|
+
if (e.length === 0) return { matched: !0 };
|
|
197
|
+
const r = e[0];
|
|
198
|
+
let n = {};
|
|
199
|
+
if (t.length === 0) return m(r).forEach((i) => {
|
|
200
|
+
n[i] = [];
|
|
201
|
+
}), { matched: !0, selections: n };
|
|
202
|
+
const o = (i, a) => {
|
|
203
|
+
n[i] = (n[i] || []).concat([a]);
|
|
204
|
+
};
|
|
205
|
+
return { matched: t.every((i) => h(r, i, o)), selections: n };
|
|
206
|
+
}, getSelectionKeys: () => e.length === 0 ? [] : m(e[0]) }) });
|
|
207
|
+
}, set: function(...e) {
|
|
208
|
+
return g({ [v]: () => ({ match: (t) => {
|
|
209
|
+
if (!(t instanceof Set)) return { matched: !1 };
|
|
210
|
+
let r = {};
|
|
211
|
+
if (t.size === 0) return { matched: !0, selections: r };
|
|
212
|
+
if (e.length === 0) return { matched: !0 };
|
|
213
|
+
const n = (i, a) => {
|
|
214
|
+
r[i] = (r[i] || []).concat([a]);
|
|
215
|
+
}, o = e[0];
|
|
216
|
+
return { matched: ut(t, (i) => h(o, i, n)), selections: r };
|
|
217
|
+
}, getSelectionKeys: () => e.length === 0 ? [] : m(e[0]) }) });
|
|
218
|
+
}, map: function(...e) {
|
|
219
|
+
return g({ [v]: () => ({ match: (t) => {
|
|
220
|
+
if (!(t instanceof Map)) return { matched: !1 };
|
|
221
|
+
let r = {};
|
|
222
|
+
if (t.size === 0) return { matched: !0, selections: r };
|
|
223
|
+
const n = (l, c) => {
|
|
224
|
+
r[l] = (r[l] || []).concat([c]);
|
|
225
|
+
};
|
|
226
|
+
if (e.length === 0) return { matched: !0 };
|
|
227
|
+
var o;
|
|
228
|
+
if (e.length === 1) throw new Error(`\`P.map\` wasn't given enough arguments. Expected (key, value), received ${(o = e[0]) == null ? void 0 : o.toString()}`);
|
|
229
|
+
const [i, a] = e;
|
|
230
|
+
return { matched: dt(t, (l, c) => {
|
|
231
|
+
const f = h(i, c, n), w = h(a, l, n);
|
|
232
|
+
return f && w;
|
|
233
|
+
}), selections: r };
|
|
234
|
+
}, getSelectionKeys: () => e.length === 0 ? [] : [...m(e[0]), ...m(e[1])] }) });
|
|
235
|
+
}, record: function(...e) {
|
|
236
|
+
return g({ [v]: () => ({ match: (t) => {
|
|
237
|
+
if (t === null || typeof t != "object" || Array.isArray(t)) return { matched: !1 };
|
|
238
|
+
var r;
|
|
239
|
+
if (e.length === 0) throw new Error(`\`P.record\` wasn't given enough arguments. Expected (value) or (key, value), received ${(r = e[0]) == null ? void 0 : r.toString()}`);
|
|
240
|
+
let n = {};
|
|
241
|
+
const o = (l, c) => {
|
|
242
|
+
n[l] = (n[l] || []).concat([c]);
|
|
243
|
+
}, [i, a] = e.length === 1 ? [he, e[0]] : e;
|
|
244
|
+
return { matched: pt(t, (l, c) => {
|
|
245
|
+
const f = typeof l != "string" || Number.isNaN(Number(l)) ? null : Number(l), w = f !== null && h(i, f, o), Ge = h(i, l, o), qe = h(a, c, o);
|
|
246
|
+
return (Ge || w) && qe;
|
|
247
|
+
}), selections: n };
|
|
248
|
+
}, getSelectionKeys: () => e.length === 0 ? [] : [...m(e[0]), ...m(e[1])] }) });
|
|
249
|
+
}, intersection: p, union: Fe, not: function(e) {
|
|
250
|
+
return g({ [v]: () => ({ match: (t) => ({ matched: !h(e, t, () => {
|
|
251
|
+
}) }), getSelectionKeys: () => [], matcherType: "not" }) });
|
|
252
|
+
}, when: u, select: W, any: Te, unknown: ft, _: ht, string: he, number: gt, bigint: mt, boolean: vt, symbol: bt, nullish: wt, nonNullable: yt, instanceOf: function(e) {
|
|
253
|
+
return g(u(/* @__PURE__ */ (function(t) {
|
|
254
|
+
return (r) => r instanceof t;
|
|
255
|
+
})(e)));
|
|
256
|
+
}, shape: function(e) {
|
|
257
|
+
return g(u(ct(e)));
|
|
258
|
+
} };
|
|
259
|
+
let xt = class extends Error {
|
|
260
|
+
constructor(t) {
|
|
261
|
+
let r;
|
|
262
|
+
try {
|
|
263
|
+
r = JSON.stringify(t);
|
|
264
|
+
} catch {
|
|
265
|
+
r = t;
|
|
266
|
+
}
|
|
267
|
+
super(`Pattern matching error: no pattern matches value ${r}`), this.input = void 0, this.input = t;
|
|
268
|
+
}
|
|
269
|
+
};
|
|
270
|
+
const re = { matched: !1, value: void 0 };
|
|
271
|
+
function _(e) {
|
|
272
|
+
return new kt(e, re);
|
|
273
|
+
}
|
|
274
|
+
let kt = class ne {
|
|
275
|
+
constructor(t, r) {
|
|
276
|
+
this.input = void 0, this.state = void 0, this.input = t, this.state = r;
|
|
277
|
+
}
|
|
278
|
+
with(...t) {
|
|
279
|
+
if (this.state.matched) return this;
|
|
280
|
+
const r = t[t.length - 1], n = [t[0]];
|
|
281
|
+
let o;
|
|
282
|
+
t.length === 3 && typeof t[1] == "function" ? o = t[1] : t.length > 2 && n.push(...t.slice(1, t.length - 1));
|
|
283
|
+
let i = !1, a = {};
|
|
284
|
+
const l = (f, w) => {
|
|
285
|
+
i = !0, a[f] = w;
|
|
286
|
+
}, c = !n.some((f) => h(f, this.input, l)) || o && !o(this.input) ? re : { matched: !0, value: r(i ? J in a ? a[J] : a : this.input, this.input) };
|
|
287
|
+
return new ne(this.input, c);
|
|
288
|
+
}
|
|
289
|
+
when(t, r) {
|
|
290
|
+
if (this.state.matched) return this;
|
|
291
|
+
const n = !!t(this.input);
|
|
292
|
+
return new ne(this.input, n ? { matched: !0, value: r(this.input, this.input) } : re);
|
|
293
|
+
}
|
|
294
|
+
otherwise(t) {
|
|
295
|
+
return this.state.matched ? this.state.value : t(this.input);
|
|
296
|
+
}
|
|
297
|
+
exhaustive(t = Ct) {
|
|
298
|
+
return this.state.matched ? this.state.value : t(this.input);
|
|
299
|
+
}
|
|
300
|
+
run() {
|
|
301
|
+
return this.exhaustive();
|
|
302
|
+
}
|
|
303
|
+
returnType() {
|
|
304
|
+
return this;
|
|
305
|
+
}
|
|
306
|
+
narrow() {
|
|
307
|
+
return this;
|
|
308
|
+
}
|
|
309
|
+
};
|
|
310
|
+
function Ct(e) {
|
|
311
|
+
throw new xt(e);
|
|
312
|
+
}
|
|
313
|
+
const _t = async (e) => {
|
|
314
|
+
if (!e) return !1;
|
|
315
|
+
try {
|
|
316
|
+
if (navigator?.clipboard?.writeText)
|
|
317
|
+
return await navigator.clipboard.writeText(e), !0;
|
|
318
|
+
} catch {
|
|
319
|
+
}
|
|
320
|
+
try {
|
|
321
|
+
const t = document.createElement("textarea");
|
|
322
|
+
t.value = e, t.style.position = "fixed", t.style.left = "-999999px", t.style.top = "-999999px", document.body.appendChild(t), t.focus(), t.select();
|
|
323
|
+
const r = document.execCommand("copy");
|
|
324
|
+
return document.body.removeChild(t), r;
|
|
325
|
+
} catch {
|
|
326
|
+
return !1;
|
|
327
|
+
}
|
|
328
|
+
}, H = (e, t, r) => {
|
|
329
|
+
L(() => (e?.on(t, r), () => {
|
|
330
|
+
e?.off(t, r);
|
|
331
|
+
}), [e, t]);
|
|
332
|
+
}, De = Pe({
|
|
333
|
+
provider: void 0,
|
|
334
|
+
storage: void 0
|
|
335
|
+
}), St = ({
|
|
336
|
+
provider: e,
|
|
337
|
+
storage: t,
|
|
338
|
+
onClose: r
|
|
339
|
+
}) => /* @__PURE__ */ s(De.Provider, { value: { provider: e, storage: t }, children: /* @__PURE__ */ s(Fr, { onClose: r }) }), E = () => {
|
|
340
|
+
const e = ae(De), { provider: t, storage: r } = e, [n, o] = y(
|
|
341
|
+
t?.getState().status || "disconnected"
|
|
342
|
+
);
|
|
343
|
+
if (H(
|
|
344
|
+
t?.emitter,
|
|
345
|
+
"status_change",
|
|
346
|
+
(i) => {
|
|
347
|
+
o(i);
|
|
348
|
+
}
|
|
349
|
+
), !e.provider) throw new Error("Provider not found");
|
|
350
|
+
return { provider: t, status: n, storage: r };
|
|
351
|
+
}, Nt = (e) => {
|
|
352
|
+
const t = new URLSearchParams();
|
|
353
|
+
return t.set("h", e.h), t.set("k", e.k), e.p && t.set("p", e.p), e.s && t.set("s", e.s), `openlv://${e.sessionId}?${t.toString()}`;
|
|
354
|
+
}, D = (...e) => console.log(
|
|
355
|
+
"%c[modal]%c",
|
|
356
|
+
"color: yellow; font-weight: bold",
|
|
357
|
+
"color: inherit; font-weight: normal",
|
|
358
|
+
...e
|
|
359
|
+
), ce = () => {
|
|
360
|
+
const { storage: e } = E(), [t, r] = y(
|
|
361
|
+
e?.getSettings()
|
|
362
|
+
);
|
|
363
|
+
return H(e?.emitter, "settings_change", (o) => {
|
|
364
|
+
r(o);
|
|
365
|
+
}), { settings: t, updateSettings: (o) => {
|
|
366
|
+
if (!t) return;
|
|
367
|
+
const i = {
|
|
368
|
+
...t,
|
|
369
|
+
...o,
|
|
370
|
+
session: {
|
|
371
|
+
...t?.session || {},
|
|
372
|
+
...o.session || {}
|
|
373
|
+
}
|
|
374
|
+
};
|
|
375
|
+
r(i), e?.setSettings(i);
|
|
376
|
+
} };
|
|
377
|
+
}, G = () => {
|
|
378
|
+
const { provider: e } = E(), [t, r] = y(
|
|
379
|
+
e?.getSession()
|
|
380
|
+
), n = t?.getHandshakeParameters(), o = n ? Nt(n) : void 0, [i, a] = y(
|
|
381
|
+
t?.getState()
|
|
382
|
+
);
|
|
383
|
+
return H(t?.emitter, "state_change", (l) => {
|
|
384
|
+
D("session state change: ", l), a(l);
|
|
385
|
+
}), H(e?.emitter, "session_started", (l) => {
|
|
386
|
+
D("session started: ", l), r(l), a(l.getState());
|
|
387
|
+
}), L(() => {
|
|
388
|
+
t && a(t.getState());
|
|
389
|
+
}, [t]), {
|
|
390
|
+
uri: o,
|
|
391
|
+
status: i
|
|
392
|
+
};
|
|
393
|
+
}, At = () => {
|
|
394
|
+
const { provider: e } = E(), { settings: t } = ce();
|
|
395
|
+
return {
|
|
396
|
+
start: () => {
|
|
397
|
+
e?.createSession(t?.session);
|
|
398
|
+
}
|
|
399
|
+
};
|
|
400
|
+
}, K = ({ state: e }) => {
|
|
401
|
+
const { status: t, uri: r } = G(), { status: n } = E();
|
|
402
|
+
return console.error("Unknown state: ", { state: e, sessionStatus: t, providerStatus: n }), /* @__PURE__ */ d("div", { className: "rounded-md bg-gray-100 p-2 text-gray-500", children: [
|
|
403
|
+
/* @__PURE__ */ d("div", { children: [
|
|
404
|
+
"Unknown state: ",
|
|
405
|
+
JSON.stringify(e)
|
|
406
|
+
] }),
|
|
407
|
+
/* @__PURE__ */ d("div", { children: [
|
|
408
|
+
"URI: ",
|
|
409
|
+
r
|
|
410
|
+
] }),
|
|
411
|
+
/* @__PURE__ */ d("div", { children: [
|
|
412
|
+
"Session Status: ",
|
|
413
|
+
JSON.stringify(t)
|
|
414
|
+
] }),
|
|
415
|
+
/* @__PURE__ */ d("div", { children: [
|
|
416
|
+
"Provider Status: ",
|
|
417
|
+
JSON.stringify(n)
|
|
418
|
+
] })
|
|
419
|
+
] });
|
|
420
|
+
}, Ot = () => /* @__PURE__ */ s("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ s("div", { className: "h-8 w-8 animate-spin rounded-full border-4 border-blue-500 border-t-transparent" }) }), jt = ({ onClose: e, onCopy: t }) => {
|
|
421
|
+
const { uri: r, status: n = { status: "created" } } = G(), o = "", i = C(() => {
|
|
422
|
+
r && t(r);
|
|
423
|
+
}, [r, t]), a = C((l) => {
|
|
424
|
+
const c = it(0, "M");
|
|
425
|
+
return c.addData(l), c.make(), c.createSvgTag({ cellSize: 5, margin: 0, scalable: !0 });
|
|
426
|
+
}, []);
|
|
427
|
+
return _(n).with({ status: "disconnected" }, () => /* @__PURE__ */ s("div", { children: "hi" })).with(
|
|
428
|
+
{ status: le.union("created", "signaling", "connected", "ready") },
|
|
429
|
+
(l) => _(l.signaling).with({ state: "connecting" }, () => /* @__PURE__ */ d("div", { className: "flex flex-col items-center gap-4 p-6", children: [
|
|
430
|
+
/* @__PURE__ */ s(Ot, {}),
|
|
431
|
+
/* @__PURE__ */ d("div", { className: "text-center", children: [
|
|
432
|
+
/* @__PURE__ */ s("h3", { className: "mb-2 font-semibold text-gray-900 text-lg", children: "Connecting" }),
|
|
433
|
+
/* @__PURE__ */ s("p", { className: "text-gray-500 text-sm", children: "Waiting for wallet to connect..." })
|
|
434
|
+
] })
|
|
435
|
+
] })).with({ state: "handshake-open" }, () => /* @__PURE__ */ d("div", { className: "flex flex-col items-center gap-4 px-2", children: [
|
|
436
|
+
/* @__PURE__ */ d("div", { className: "w-full space-y-4 rounded-md border border-neutral-200 bg-neutral-100 p-4", children: [
|
|
437
|
+
r && /* @__PURE__ */ s("div", { className: "relative mx-auto flex w-fit items-center justify-center rounded-lg border-2 border-gray-200 bg-gray-50 p-4", children: /* @__PURE__ */ s(
|
|
438
|
+
"div",
|
|
439
|
+
{
|
|
440
|
+
className: "flex h-[200px] w-[200px] cursor-pointer items-center justify-center",
|
|
441
|
+
onClick: i,
|
|
442
|
+
title: "Click to copy connection URL",
|
|
443
|
+
dangerouslySetInnerHTML: { __html: a(r) }
|
|
444
|
+
}
|
|
445
|
+
) }),
|
|
446
|
+
/* @__PURE__ */ s("div", { className: "w-full", children: /* @__PURE__ */ s(
|
|
447
|
+
"button",
|
|
448
|
+
{
|
|
449
|
+
type: "button",
|
|
450
|
+
onClick: i,
|
|
451
|
+
className: "w-full cursor-pointer rounded-lg border border-gray-300 bg-gray-200 px-4 py-2 text-gray-700 text-sm transition hover:bg-gray-300",
|
|
452
|
+
children: "Copy Connection URL"
|
|
453
|
+
}
|
|
454
|
+
) })
|
|
455
|
+
] }),
|
|
456
|
+
/* @__PURE__ */ d("div", { className: "w-full", children: [
|
|
457
|
+
/* @__PURE__ */ s("span", { children: "Scan the link above using your mobile wallet." }),
|
|
458
|
+
/* @__PURE__ */ s("br", {}),
|
|
459
|
+
/* @__PURE__ */ s("span", { children: "Or copy the link and paste it into your wallet." })
|
|
460
|
+
] })
|
|
461
|
+
] })).with({ state: "handshake-closed" }, () => /* @__PURE__ */ s("div", { className: "flex flex-col items-center gap-4 p-6", children: /* @__PURE__ */ s("div", { className: "text-center", children: /* @__PURE__ */ s("h3", { className: "mb-2 font-semibold text-gray-900 text-lg", children: "Establishing e2e encryption..." }) }) })).with({ state: "xr-encrypted" }, () => /* @__PURE__ */ s("div", { className: "flex flex-col items-center gap-4 p-6", children: /* @__PURE__ */ d("div", { className: "text-center", children: [
|
|
462
|
+
/* @__PURE__ */ s("div", { className: "mb-4 text-4xl", children: "✅" }),
|
|
463
|
+
/* @__PURE__ */ s("h3", { className: "mb-2 font-semibold text-gray-900 text-lg", children: "Connected Successfully!" }),
|
|
464
|
+
o,
|
|
465
|
+
/* @__PURE__ */ s("p", { className: "text-gray-500 text-sm", children: "Your wallet is now connected and ready to use." })
|
|
466
|
+
] }) })).with({ state: "disconnected" }, () => /* @__PURE__ */ d("div", { className: "flex flex-col items-center gap-4 p-6", children: [
|
|
467
|
+
/* @__PURE__ */ d("div", { className: "text-center", children: [
|
|
468
|
+
/* @__PURE__ */ s("div", { className: "mb-4 text-4xl", children: "🔌" }),
|
|
469
|
+
/* @__PURE__ */ s("h3", { className: "mb-2 font-semibold text-gray-900 text-lg", children: "Disconnected" }),
|
|
470
|
+
/* @__PURE__ */ s("p", { className: "mb-4 text-gray-500 text-sm", children: "The connection has been closed." })
|
|
471
|
+
] }),
|
|
472
|
+
/* @__PURE__ */ s(
|
|
473
|
+
"button",
|
|
474
|
+
{
|
|
475
|
+
type: "button",
|
|
476
|
+
onClick: e,
|
|
477
|
+
className: "w-full rounded-lg bg-gray-100 px-4 py-2 font-semibold text-gray-700 text-sm transition hover:bg-gray-200",
|
|
478
|
+
children: "Close"
|
|
479
|
+
}
|
|
480
|
+
)
|
|
481
|
+
] })).otherwise(() => /* @__PURE__ */ s(K, { state: n }))
|
|
482
|
+
).otherwise(() => /* @__PURE__ */ s(K, { state: n }));
|
|
483
|
+
}, Rt = () => {
|
|
484
|
+
const { start: e } = At();
|
|
485
|
+
return /* @__PURE__ */ d("div", { className: "flex flex-col items-center gap-4 p-6", children: [
|
|
486
|
+
/* @__PURE__ */ d("div", { className: "text-center", children: [
|
|
487
|
+
/* @__PURE__ */ s("h3", { className: "mb-2 font-semibold text-gray-900 text-lg", children: "Ready to Connect" }),
|
|
488
|
+
/* @__PURE__ */ s("p", { className: "mb-4 text-gray-500 text-sm", children: "Click the button below to start the connection process." })
|
|
489
|
+
] }),
|
|
490
|
+
/* @__PURE__ */ s(
|
|
491
|
+
"button",
|
|
492
|
+
{
|
|
493
|
+
type: "button",
|
|
494
|
+
onClick: e,
|
|
495
|
+
className: "w-full cursor-pointer rounded-lg bg-blue-500 px-6 py-3 font-semibold text-sm text-white transition hover:bg-blue-600",
|
|
496
|
+
children: "Start Connection"
|
|
497
|
+
}
|
|
498
|
+
)
|
|
499
|
+
] });
|
|
500
|
+
}, Pt = "data:image/webp;base64,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", Lt = () => {
|
|
501
|
+
const { status: e } = G(), { status: t } = E(), r = _(t).with("disconnected", () => {
|
|
502
|
+
}).with(
|
|
503
|
+
le.union("connected", "connecting", "error"),
|
|
504
|
+
() => _(e).with({ status: "disconnected" }, () => ({
|
|
505
|
+
icon: "🫲",
|
|
506
|
+
text: "Disconnected"
|
|
507
|
+
})).with(
|
|
508
|
+
{ status: "signaling" },
|
|
509
|
+
(n) => _(n.signaling).with({ state: "handshake-open" }, () => ({
|
|
510
|
+
icon: "👋",
|
|
511
|
+
text: "Handshake Open"
|
|
512
|
+
})).with({ state: "handshake-closed" }, () => ({
|
|
513
|
+
icon: "🤝",
|
|
514
|
+
text: "Handshake Closed"
|
|
515
|
+
})).otherwise(() => ({
|
|
516
|
+
icon: "❓",
|
|
517
|
+
text: "Unknown " + n.signaling?.state
|
|
518
|
+
}))
|
|
519
|
+
).otherwise((n) => ({
|
|
520
|
+
icon: "❓",
|
|
521
|
+
text: "Unknown " + JSON.stringify(n)
|
|
522
|
+
}))
|
|
523
|
+
).otherwise(() => ({
|
|
524
|
+
icon: "❓",
|
|
525
|
+
text: "Unknown provider status " + JSON.stringify(t)
|
|
526
|
+
}));
|
|
527
|
+
return r ? /* @__PURE__ */ d("div", { className: "group flex items-center gap-2 rounded-md px-2 py-2 hover:bg-neutral-200", children: [
|
|
528
|
+
/* @__PURE__ */ s("div", { className: "text-gray-900 text-xs opacity-0 transition-opacity duration-300 group-hover:opacity-100", children: r.text }),
|
|
529
|
+
/* @__PURE__ */ s("div", { children: r.icon })
|
|
530
|
+
] }) : /* @__PURE__ */ s(et, {});
|
|
531
|
+
}, Et = () => /* @__PURE__ */ d("div", { className: "mt-2 flex items-end justify-between gap-2 px-1 text-gray-500", children: [
|
|
532
|
+
/* @__PURE__ */ d(
|
|
533
|
+
"a",
|
|
534
|
+
{
|
|
535
|
+
href: "https://github.com/v3xlabs/open-lavatory",
|
|
536
|
+
target: "_blank",
|
|
537
|
+
rel: "noreferrer",
|
|
538
|
+
className: "flex items-center gap-2 p-1 font-semibold text-gray-500 text-sm",
|
|
539
|
+
children: [
|
|
540
|
+
/* @__PURE__ */ s(
|
|
541
|
+
"img",
|
|
542
|
+
{
|
|
543
|
+
src: Pt,
|
|
544
|
+
alt: "Open Lavatory Logo",
|
|
545
|
+
width: 20,
|
|
546
|
+
height: 20,
|
|
547
|
+
className: "rounded"
|
|
548
|
+
}
|
|
549
|
+
),
|
|
550
|
+
/* @__PURE__ */ s("span", { children: "openlv" })
|
|
551
|
+
]
|
|
552
|
+
}
|
|
553
|
+
),
|
|
554
|
+
/* @__PURE__ */ s("div", { className: "text-gray-500 text-sm", children: /* @__PURE__ */ s(Lt, {}) })
|
|
555
|
+
] }), Ft = ({ size: e = 24 }) => (
|
|
556
|
+
// biome-ignore lint/a11y/noSvgWithoutTitle: Chevron left icon
|
|
557
|
+
/* @__PURE__ */ s(
|
|
558
|
+
"svg",
|
|
559
|
+
{
|
|
560
|
+
title: "Chevron left icon",
|
|
561
|
+
width: e,
|
|
562
|
+
height: e,
|
|
563
|
+
viewBox: "0 0 24 24",
|
|
564
|
+
fill: "none",
|
|
565
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
566
|
+
children: /* @__PURE__ */ s(
|
|
567
|
+
"path",
|
|
568
|
+
{
|
|
569
|
+
d: "M15.5 19L8.5 12L15.5 5",
|
|
570
|
+
stroke: "currentColor",
|
|
571
|
+
strokeWidth: "2",
|
|
572
|
+
strokeLinecap: "round",
|
|
573
|
+
strokeLinejoin: "round"
|
|
574
|
+
}
|
|
575
|
+
)
|
|
576
|
+
}
|
|
577
|
+
)
|
|
578
|
+
), Bt = ({ size: e = 24 }) => (
|
|
579
|
+
// biome-ignore lint/a11y/noSvgWithoutTitle: Cog icon
|
|
580
|
+
/* @__PURE__ */ d(
|
|
581
|
+
"svg",
|
|
582
|
+
{
|
|
583
|
+
title: "Cog icon",
|
|
584
|
+
width: e,
|
|
585
|
+
height: e,
|
|
586
|
+
viewBox: "0 0 24 24",
|
|
587
|
+
fill: "none",
|
|
588
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
589
|
+
children: [
|
|
590
|
+
/* @__PURE__ */ s(
|
|
591
|
+
"path",
|
|
592
|
+
{
|
|
593
|
+
d: "M12 15C13.6569 15 15 13.6569 15 12C15 10.3431 13.6569 9 12 9C10.3431 9 9 10.3431 9 12C9 13.6569 10.3431 15 12 15Z",
|
|
594
|
+
stroke: "currentColor",
|
|
595
|
+
strokeWidth: "2",
|
|
596
|
+
strokeLinecap: "round",
|
|
597
|
+
strokeLinejoin: "round"
|
|
598
|
+
}
|
|
599
|
+
),
|
|
600
|
+
/* @__PURE__ */ s(
|
|
601
|
+
"path",
|
|
602
|
+
{
|
|
603
|
+
d: "M19.4 15C19.2669 15.3016 19.2272 15.6362 19.286 15.9606C19.3448 16.285 19.4995 16.5843 19.73 16.82L19.79 16.88C19.976 17.0657 20.1235 17.2863 20.2241 17.5291C20.3248 17.7719 20.3766 18.0322 20.3766 18.295C20.3766 18.5578 20.3248 18.8181 20.2241 19.0609C20.1235 19.3037 19.976 19.5243 19.79 19.71C19.6043 19.896 19.3837 20.0435 19.1409 20.1441C18.8981 20.2448 18.6378 20.2966 18.375 20.2966C18.1122 20.2966 17.8519 20.2448 17.6091 20.1441C17.3663 20.0435 17.1457 19.896 16.96 19.71L16.9 19.65C16.6643 19.4195 16.365 19.2648 16.0396 19.206C15.7142 19.1472 15.3796 19.1869 15.078 19.32C14.7841 19.4468 14.532 19.6572 14.3543 19.9255C14.1766 20.1938 14.0813 20.5082 14.08 20.83V21C14.08 21.5304 13.8693 22.0391 13.4893 22.4191C13.1092 22.7992 12.6005 23.01 12.07 23.01C11.5395 23.01 11.0308 22.7992 10.6507 22.4191C10.2707 22.0391 10.06 21.5304 10.06 21V20.91C10.0587 20.5882 9.96337 20.2738 9.78568 20.0055C9.60799 19.7372 9.35593 19.5268 9.062 19.4C8.76038 19.2669 8.42579 19.2272 8.10135 19.286C7.77691 19.3448 7.47663 19.4995 7.242 19.73L7.182 19.79C6.99628 19.976 6.77566 20.1235 6.53284 20.2241C6.29002 20.3248 6.02971 20.3766 5.76693 20.3766C5.50415 20.3766 5.24384 20.3248 5.00102 20.2241C4.7582 20.1235 4.53758 19.976 4.35186 19.79C4.16591 19.6043 4.0184 19.3837 3.91776 19.1409C3.81712 18.8981 3.7654 18.6378 3.7654 18.375C3.7654 18.1122 3.81712 17.8519 3.91776 17.6091C4.0184 17.3663 4.16591 17.1457 4.35186 16.96L4.41186 16.9C4.6424 16.6643 4.79708 16.365 4.85586 16.0396C4.91464 15.7142 4.87497 15.3796 4.74186 15.078C4.615 14.7841 4.40463 14.532 4.13633 14.3543C3.86803 14.1766 3.55362 14.0813 3.23186 14.08H3.16186C2.63142 14.08 2.12271 13.8693 1.74264 13.4893C1.36257 13.1092 1.15186 12.6005 1.15186 12.07C1.15186 11.5395 1.36257 11.0308 1.74264 10.6507C2.12271 10.2707 2.63142 10.06 3.16186 10.06H3.25186C3.57362 10.0587 3.88803 9.96337 4.15633 9.78568C4.42463 9.60799 4.635 9.35593 4.76186 9.062C4.895 8.76038 4.93464 8.42579 4.87586 8.10135C4.81708 7.77691 4.6624 7.47763 4.43186 7.242L4.37186 7.182C4.18591 6.99628 4.0384 6.77566 3.93776 6.53284C3.83712 6.29002 3.7854 6.02971 3.7854 5.76693C3.7854 5.50415 3.83712 5.24384 3.93776 5.00102C4.0384 4.7582 4.18591 4.53758 4.37186 4.35186C4.55758 4.16591 4.7782 4.0184 5.02102 3.91776C5.26384 3.81712 5.52415 3.7654 5.78693 3.7654C6.04971 3.7654 6.31002 3.81712 6.55284 3.91776C6.79566 4.0184 7.01628 4.16591 7.202 4.35186L7.262 4.41186C7.49763 4.6424 7.79691 4.79708 8.12135 4.85586C8.44579 4.91464 8.78038 4.87497 9.082 4.74186C9.37593 4.615 9.62799 4.40463 9.80568 4.13633C9.98337 3.86803 10.0787 3.55362 10.08 3.23186V3.16186C10.08 2.63142 10.2907 2.12271 10.6707 1.74264C11.0508 1.36257 11.5595 1.15186 12.09 1.15186C12.6205 1.15186 13.1292 1.36257 13.5093 1.74264C13.8893 2.12271 14.1 2.63142 14.1 3.16186V3.25186C14.1013 3.57362 14.1966 3.88803 14.3743 4.15633C14.552 4.42463 14.8041 4.635 15.098 4.76186C15.3996 4.895 15.7342 4.93464 16.0586 4.87586C16.3831 4.81708 16.6824 4.6624 16.918 4.43186L16.978 4.37186C17.1637 4.18591 17.3843 4.0384 17.6271 3.93776C17.8699 3.83712 18.1302 3.7854 18.393 3.7854C18.6558 3.7854 18.9161 3.83712 19.1589 3.93776C19.4017 4.0384 19.6223 4.18591 19.808 4.37186C19.994 4.55758 20.1415 4.7782 20.2421 5.02102C20.3428 5.26384 20.3945 5.52415 20.3945 5.78693C20.3945 6.04971 20.3428 6.31002 20.2421 6.55284C20.1415 6.79566 19.994 7.01628 19.808 7.202L19.748 7.262C19.5175 7.49763 19.3628 7.79691 19.304 8.12135C19.2452 8.44579 19.2849 8.78038 19.418 9.082C19.5449 9.37593 19.7552 9.62799 20.0235 9.80568C20.2918 9.98337 20.6062 10.0787 20.928 10.08H20.998C21.5284 10.08 22.0371 10.2907 22.4172 10.6707C22.7973 11.0508 23.008 11.5595 23.008 12.09C23.008 12.6205 22.7973 13.1292 22.4172 13.5093C22.0371 13.8893 21.5284 14.1 20.998 14.1H20.908C20.5862 14.1013 20.2718 14.1966 20.0035 14.3743C19.7352 14.552 19.5248 14.8041 19.398 15.098L19.4 15Z",
|
|
604
|
+
stroke: "currentColor",
|
|
605
|
+
strokeWidth: "2",
|
|
606
|
+
strokeLinecap: "round",
|
|
607
|
+
strokeLinejoin: "round"
|
|
608
|
+
}
|
|
609
|
+
)
|
|
610
|
+
]
|
|
611
|
+
}
|
|
612
|
+
)
|
|
613
|
+
), Tt = ({
|
|
614
|
+
title: e,
|
|
615
|
+
view: t,
|
|
616
|
+
onToggleSettings: r,
|
|
617
|
+
setView: n,
|
|
618
|
+
onClose: o
|
|
619
|
+
}) => {
|
|
620
|
+
const { status: i, provider: a } = E(), l = C(async () => {
|
|
621
|
+
D("closing session"), await a.closeSession();
|
|
622
|
+
}, [a]), c = C(() => {
|
|
623
|
+
D("status", i), _(i).with(
|
|
624
|
+
"disconnected",
|
|
625
|
+
() => _({ view: t }).with({ view: "settings" }, () => n("start")).with({ view: "start" }, o).otherwise(o)
|
|
626
|
+
).with("connecting", l).with("connected", o).otherwise(o);
|
|
627
|
+
}, [i, t, n, o, l]);
|
|
628
|
+
return /* @__PURE__ */ d("div", { className: "flex items-center justify-between px-2 py-2", children: [
|
|
629
|
+
/* @__PURE__ */ s(
|
|
630
|
+
"button",
|
|
631
|
+
{
|
|
632
|
+
type: "button",
|
|
633
|
+
onClick: c,
|
|
634
|
+
"aria-label": t === "settings" ? "Back to QR" : "Close modal",
|
|
635
|
+
className: "flex h-8 w-8 cursor-pointer items-center justify-center rounded-lg transition-colors hover:bg-gray-200",
|
|
636
|
+
children: /* @__PURE__ */ s(Ft, {})
|
|
637
|
+
}
|
|
638
|
+
),
|
|
639
|
+
/* @__PURE__ */ s("h2", { className: "flex items-center justify-center gap-2 font-semibold text-gray-900 text-lg", children: e }),
|
|
640
|
+
/* @__PURE__ */ s(
|
|
641
|
+
"button",
|
|
642
|
+
{
|
|
643
|
+
type: "button",
|
|
644
|
+
"aria-label": t === "settings" ? "Hide connection settings" : "Show connection settings",
|
|
645
|
+
"aria-pressed": t === "settings",
|
|
646
|
+
onClick: r,
|
|
647
|
+
className: "flex h-8 w-8 cursor-pointer items-center justify-center rounded-lg transition-colors hover:bg-gray-200",
|
|
648
|
+
children: /* @__PURE__ */ s(Bt, {})
|
|
649
|
+
}
|
|
650
|
+
)
|
|
651
|
+
] });
|
|
652
|
+
};
|
|
653
|
+
function oe(e, t) {
|
|
654
|
+
for (var r in e) if (r !== "__source" && !(r in t)) return !0;
|
|
655
|
+
for (var n in t) if (n !== "__source" && e[n] !== t[n]) return !0;
|
|
656
|
+
return !1;
|
|
657
|
+
}
|
|
658
|
+
function ie(e, t) {
|
|
659
|
+
this.props = e, this.context = t;
|
|
660
|
+
}
|
|
661
|
+
function Dt(e, t) {
|
|
662
|
+
function r(o) {
|
|
663
|
+
var i = this.props.ref, a = i == o.ref;
|
|
664
|
+
return !a && i && (i.call ? i(null) : i.current = null), t ? !t(this.props, o) || !a : oe(this.props, o);
|
|
665
|
+
}
|
|
666
|
+
function n(o) {
|
|
667
|
+
return this.shouldComponentUpdate = r, R(e, o);
|
|
668
|
+
}
|
|
669
|
+
return n.displayName = "Memo(" + (e.displayName || e.name) + ")", n.prototype.isReactComponent = !0, n.__f = !0, n;
|
|
670
|
+
}
|
|
671
|
+
(ie.prototype = new B()).isPureReactComponent = !0, ie.prototype.shouldComponentUpdate = function(e, t) {
|
|
672
|
+
return oe(this.props, e) || oe(this.state, t);
|
|
673
|
+
};
|
|
674
|
+
var ge = b.__b;
|
|
675
|
+
b.__b = function(e) {
|
|
676
|
+
e.type && e.type.__f && e.ref && (e.props.ref = e.ref, e.ref = null), ge && ge(e);
|
|
677
|
+
};
|
|
678
|
+
var It = typeof Symbol < "u" && Symbol.for && Symbol.for("react.forward_ref") || 3911;
|
|
679
|
+
function zt(e) {
|
|
680
|
+
function t(r) {
|
|
681
|
+
if (!("ref" in r)) return e(r, null);
|
|
682
|
+
var n = r.ref;
|
|
683
|
+
delete r.ref;
|
|
684
|
+
var o = e(r, n);
|
|
685
|
+
return r.ref = n, o;
|
|
686
|
+
}
|
|
687
|
+
return t.$$typeof = It, t.render = t, t.prototype.isReactComponent = t.__f = !0, t.displayName = "ForwardRef(" + (e.displayName || e.name) + ")", t;
|
|
688
|
+
}
|
|
689
|
+
var me = function(e, t) {
|
|
690
|
+
return e == null ? null : j(j(e).map(t));
|
|
691
|
+
}, Mt = { map: me, forEach: me, count: function(e) {
|
|
692
|
+
return e ? j(e).length : 0;
|
|
693
|
+
}, only: function(e) {
|
|
694
|
+
var t = j(e);
|
|
695
|
+
if (t.length !== 1) throw "Children.only";
|
|
696
|
+
return t[0];
|
|
697
|
+
}, toArray: j }, Wt = b.__e;
|
|
698
|
+
b.__e = function(e, t, r, n) {
|
|
699
|
+
if (e.then) {
|
|
700
|
+
for (var o, i = t; i = i.__; ) if ((o = i.__c) && o.__c) return t.__e == null && (t.__e = r.__e, t.__k = r.__k), o.__c(e, t);
|
|
701
|
+
}
|
|
702
|
+
Wt(e, t, r, n);
|
|
703
|
+
};
|
|
704
|
+
var ve = b.unmount;
|
|
705
|
+
function Ie(e, t, r) {
|
|
706
|
+
return e && (e.__c && e.__c.__H && (e.__c.__H.__.forEach(function(n) {
|
|
707
|
+
typeof n.__c == "function" && n.__c();
|
|
708
|
+
}), e.__c.__H = null), (e = (function(n, o) {
|
|
709
|
+
for (var i in o) n[i] = o[i];
|
|
710
|
+
return n;
|
|
711
|
+
})({}, e)).__c != null && (e.__c.__P === r && (e.__c.__P = t), e.__c = null), e.__k = e.__k && e.__k.map(function(n) {
|
|
712
|
+
return Ie(n, t, r);
|
|
713
|
+
})), e;
|
|
714
|
+
}
|
|
715
|
+
function ze(e, t, r) {
|
|
716
|
+
return e && r && (e.__v = null, e.__k = e.__k && e.__k.map(function(n) {
|
|
717
|
+
return ze(n, t, r);
|
|
718
|
+
}), e.__c && e.__c.__P === t && (e.__e && r.appendChild(e.__e), e.__c.__e = !0, e.__c.__P = r)), e;
|
|
719
|
+
}
|
|
720
|
+
function U() {
|
|
721
|
+
this.__u = 0, this.t = null, this.__b = null;
|
|
722
|
+
}
|
|
723
|
+
function Me(e) {
|
|
724
|
+
var t = e.__.__c;
|
|
725
|
+
return t && t.__a && t.__a(e);
|
|
726
|
+
}
|
|
727
|
+
function Vt(e) {
|
|
728
|
+
var t, r, n;
|
|
729
|
+
function o(i) {
|
|
730
|
+
if (t || (t = e()).then(function(a) {
|
|
731
|
+
r = a.default || a;
|
|
732
|
+
}, function(a) {
|
|
733
|
+
n = a;
|
|
734
|
+
}), n) throw n;
|
|
735
|
+
if (!r) throw t;
|
|
736
|
+
return R(r, i);
|
|
737
|
+
}
|
|
738
|
+
return o.displayName = "Lazy", o.__f = !0, o;
|
|
739
|
+
}
|
|
740
|
+
function I() {
|
|
741
|
+
this.u = null, this.o = null;
|
|
742
|
+
}
|
|
743
|
+
b.unmount = function(e) {
|
|
744
|
+
var t = e.__c;
|
|
745
|
+
t && t.__R && t.__R(), t && 32 & e.__u && (e.type = null), ve && ve(e);
|
|
746
|
+
}, (U.prototype = new B()).__c = function(e, t) {
|
|
747
|
+
var r = t.__c, n = this;
|
|
748
|
+
n.t == null && (n.t = []), n.t.push(r);
|
|
749
|
+
var o = Me(n.__v), i = !1, a = function() {
|
|
750
|
+
i || (i = !0, r.__R = null, o ? o(l) : l());
|
|
751
|
+
};
|
|
752
|
+
r.__R = a;
|
|
753
|
+
var l = function() {
|
|
754
|
+
if (!--n.__u) {
|
|
755
|
+
if (n.state.__a) {
|
|
756
|
+
var c = n.state.__a;
|
|
757
|
+
n.__v.__k[0] = ze(c, c.__c.__P, c.__c.__O);
|
|
758
|
+
}
|
|
759
|
+
var f;
|
|
760
|
+
for (n.setState({ __a: n.__b = null }); f = n.t.pop(); ) f.forceUpdate();
|
|
761
|
+
}
|
|
762
|
+
};
|
|
763
|
+
n.__u++ || 32 & t.__u || n.setState({ __a: n.__b = n.__v.__k[0] }), e.then(a, a);
|
|
764
|
+
}, U.prototype.componentWillUnmount = function() {
|
|
765
|
+
this.t = [];
|
|
766
|
+
}, U.prototype.render = function(e, t) {
|
|
767
|
+
if (this.__b) {
|
|
768
|
+
if (this.__v.__k) {
|
|
769
|
+
var r = document.createElement("div"), n = this.__v.__k[0].__c;
|
|
770
|
+
this.__v.__k[0] = Ie(this.__b, r, n.__O = n.__P);
|
|
771
|
+
}
|
|
772
|
+
this.__b = null;
|
|
773
|
+
}
|
|
774
|
+
var o = t.__a && R(z, null, e.fallback);
|
|
775
|
+
return o && (o.__u &= -33), [R(z, null, t.__a ? null : e.children), o];
|
|
776
|
+
};
|
|
777
|
+
var be = function(e, t, r) {
|
|
778
|
+
if (++r[1] === r[0] && e.o.delete(t), e.props.revealOrder && (e.props.revealOrder[0] !== "t" || !e.o.size)) for (r = e.u; r; ) {
|
|
779
|
+
for (; r.length > 3; ) r.pop()();
|
|
780
|
+
if (r[1] < r[0]) break;
|
|
781
|
+
e.u = r = r[2];
|
|
782
|
+
}
|
|
783
|
+
};
|
|
784
|
+
function Ut(e) {
|
|
785
|
+
return this.getChildContext = function() {
|
|
786
|
+
return e.context;
|
|
787
|
+
}, e.children;
|
|
788
|
+
}
|
|
789
|
+
function Jt(e) {
|
|
790
|
+
var t = this, r = e.i;
|
|
791
|
+
t.componentWillUnmount = function() {
|
|
792
|
+
T(null, t.l), t.l = null, t.i = null;
|
|
793
|
+
}, t.i && t.i !== r && t.componentWillUnmount(), t.l || (t.i = r, t.l = { nodeType: 1, parentNode: r, childNodes: [], contains: function() {
|
|
794
|
+
return !0;
|
|
795
|
+
}, appendChild: function(n) {
|
|
796
|
+
this.childNodes.push(n), t.i.appendChild(n);
|
|
797
|
+
}, insertBefore: function(n, o) {
|
|
798
|
+
this.childNodes.push(n), t.i.appendChild(n);
|
|
799
|
+
}, removeChild: function(n) {
|
|
800
|
+
this.childNodes.splice(this.childNodes.indexOf(n) >>> 1, 1), t.i.removeChild(n);
|
|
801
|
+
} }), T(R(Ut, { context: t.context }, e.__v), t.l);
|
|
802
|
+
}
|
|
803
|
+
function Ht(e, t) {
|
|
804
|
+
var r = R(Jt, { __v: e, i: t });
|
|
805
|
+
return r.containerInfo = t, r;
|
|
806
|
+
}
|
|
807
|
+
(I.prototype = new B()).__a = function(e) {
|
|
808
|
+
var t = this, r = Me(t.__v), n = t.o.get(e);
|
|
809
|
+
return n[0]++, function(o) {
|
|
810
|
+
var i = function() {
|
|
811
|
+
t.props.revealOrder ? (n.push(o), be(t, e, n)) : o();
|
|
812
|
+
};
|
|
813
|
+
r ? r(i) : i();
|
|
814
|
+
};
|
|
815
|
+
}, I.prototype.render = function(e) {
|
|
816
|
+
this.u = null, this.o = /* @__PURE__ */ new Map();
|
|
817
|
+
var t = j(e.children);
|
|
818
|
+
e.revealOrder && e.revealOrder[0] === "b" && t.reverse();
|
|
819
|
+
for (var r = t.length; r--; ) this.o.set(t[r], this.u = [1, 0, this.u]);
|
|
820
|
+
return e.children;
|
|
821
|
+
}, I.prototype.componentDidUpdate = I.prototype.componentDidMount = function() {
|
|
822
|
+
var e = this;
|
|
823
|
+
this.o.forEach(function(t, r) {
|
|
824
|
+
be(e, r, t);
|
|
825
|
+
});
|
|
826
|
+
};
|
|
827
|
+
var We = typeof Symbol < "u" && Symbol.for && Symbol.for("react.element") || 60103, Kt = /^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/, Xt = /^on(Ani|Tra|Tou|BeforeInp|Compo)/, Qt = /[A-Z0-9]/g, Zt = typeof document < "u", Gt = function(e) {
|
|
828
|
+
return (typeof Symbol < "u" && typeof Symbol() == "symbol" ? /fil|che|rad/ : /fil|che|ra/).test(e);
|
|
829
|
+
};
|
|
830
|
+
function qt(e, t, r) {
|
|
831
|
+
return t.__k == null && (t.textContent = ""), T(e, t), typeof r == "function" && r(), e ? e.__c : null;
|
|
832
|
+
}
|
|
833
|
+
function Yt(e, t, r) {
|
|
834
|
+
return nt(e, t), typeof r == "function" && r(), e ? e.__c : null;
|
|
835
|
+
}
|
|
836
|
+
B.prototype.isReactComponent = {}, ["componentWillMount", "componentWillReceiveProps", "componentWillUpdate"].forEach(function(e) {
|
|
837
|
+
Object.defineProperty(B.prototype, e, { configurable: !0, get: function() {
|
|
838
|
+
return this["UNSAFE_" + e];
|
|
839
|
+
}, set: function(t) {
|
|
840
|
+
Object.defineProperty(this, e, { configurable: !0, writable: !0, value: t });
|
|
841
|
+
} });
|
|
842
|
+
});
|
|
843
|
+
var we = b.event;
|
|
844
|
+
function $t() {
|
|
845
|
+
}
|
|
846
|
+
function er() {
|
|
847
|
+
return this.cancelBubble;
|
|
848
|
+
}
|
|
849
|
+
function tr() {
|
|
850
|
+
return this.defaultPrevented;
|
|
851
|
+
}
|
|
852
|
+
b.event = function(e) {
|
|
853
|
+
return we && (e = we(e)), e.persist = $t, e.isPropagationStopped = er, e.isDefaultPrevented = tr, e.nativeEvent = e;
|
|
854
|
+
};
|
|
855
|
+
var ue, rr = { enumerable: !1, configurable: !0, get: function() {
|
|
856
|
+
return this.class;
|
|
857
|
+
} }, ye = b.vnode;
|
|
858
|
+
b.vnode = function(e) {
|
|
859
|
+
typeof e.type == "string" && (function(t) {
|
|
860
|
+
var r = t.props, n = t.type, o = {}, i = n.indexOf("-") === -1;
|
|
861
|
+
for (var a in r) {
|
|
862
|
+
var l = r[a];
|
|
863
|
+
if (!(a === "value" && "defaultValue" in r && l == null || Zt && a === "children" && n === "noscript" || a === "class" || a === "className")) {
|
|
864
|
+
var c = a.toLowerCase();
|
|
865
|
+
a === "defaultValue" && "value" in r && r.value == null ? a = "value" : a === "download" && l === !0 ? l = "" : c === "translate" && l === "no" ? l = !1 : c[0] === "o" && c[1] === "n" ? c === "ondoubleclick" ? a = "ondblclick" : c !== "onchange" || n !== "input" && n !== "textarea" || Gt(r.type) ? c === "onfocus" ? a = "onfocusin" : c === "onblur" ? a = "onfocusout" : Xt.test(a) && (a = c) : c = a = "oninput" : i && Kt.test(a) ? a = a.replace(Qt, "-$&").toLowerCase() : l === null && (l = void 0), c === "oninput" && o[a = c] && (a = "oninputCapture"), o[a] = l;
|
|
866
|
+
}
|
|
867
|
+
}
|
|
868
|
+
n == "select" && o.multiple && Array.isArray(o.value) && (o.value = j(r.children).forEach(function(f) {
|
|
869
|
+
f.props.selected = o.value.indexOf(f.props.value) != -1;
|
|
870
|
+
})), n == "select" && o.defaultValue != null && (o.value = j(r.children).forEach(function(f) {
|
|
871
|
+
f.props.selected = o.multiple ? o.defaultValue.indexOf(f.props.value) != -1 : o.defaultValue == f.props.value;
|
|
872
|
+
})), r.class && !r.className ? (o.class = r.class, Object.defineProperty(o, "className", rr)) : (r.className && !r.class || r.class && r.className) && (o.class = o.className = r.className), t.props = o;
|
|
873
|
+
})(e), e.$$typeof = We, ye && ye(e);
|
|
874
|
+
};
|
|
875
|
+
var xe = b.__r;
|
|
876
|
+
b.__r = function(e) {
|
|
877
|
+
xe && xe(e), ue = e.__c;
|
|
878
|
+
};
|
|
879
|
+
var ke = b.diffed;
|
|
880
|
+
b.diffed = function(e) {
|
|
881
|
+
ke && ke(e);
|
|
882
|
+
var t = e.props, r = e.__e;
|
|
883
|
+
r != null && e.type === "textarea" && "value" in t && t.value !== r.value && (r.value = t.value == null ? "" : t.value), ue = null;
|
|
884
|
+
};
|
|
885
|
+
var nr = { ReactCurrentDispatcher: { current: { readContext: function(e) {
|
|
886
|
+
return ue.__n[e.__c].props.value;
|
|
887
|
+
}, useCallback: C, useContext: ae, useDebugValue: Re, useDeferredValue: Ue, useEffect: L, useId: je, useImperativeHandle: Oe, useInsertionEffect: He, useLayoutEffect: Z, useMemo: Ae, useReducer: Ne, useRef: Se, useState: y, useSyncExternalStore: Ke, useTransition: Je } } };
|
|
888
|
+
function or(e) {
|
|
889
|
+
return R.bind(null, e);
|
|
890
|
+
}
|
|
891
|
+
function q(e) {
|
|
892
|
+
return !!e && e.$$typeof === We;
|
|
893
|
+
}
|
|
894
|
+
function ir(e) {
|
|
895
|
+
return q(e) && e.type === z;
|
|
896
|
+
}
|
|
897
|
+
function ar(e) {
|
|
898
|
+
return !!e && !!e.displayName && (typeof e.displayName == "string" || e.displayName instanceof String) && e.displayName.startsWith("Memo(");
|
|
899
|
+
}
|
|
900
|
+
function sr(e) {
|
|
901
|
+
return q(e) ? rt.apply(null, arguments) : e;
|
|
902
|
+
}
|
|
903
|
+
function lr(e) {
|
|
904
|
+
return !!e.__k && (T(null, e), !0);
|
|
905
|
+
}
|
|
906
|
+
function cr(e) {
|
|
907
|
+
return e && (e.base || e.nodeType === 1 && e) || null;
|
|
908
|
+
}
|
|
909
|
+
var ur = function(e, t) {
|
|
910
|
+
return e(t);
|
|
911
|
+
}, dr = function(e, t) {
|
|
912
|
+
return e(t);
|
|
913
|
+
}, pr = z;
|
|
914
|
+
function Ve(e) {
|
|
915
|
+
e();
|
|
916
|
+
}
|
|
917
|
+
function Ue(e) {
|
|
918
|
+
return e;
|
|
919
|
+
}
|
|
920
|
+
function Je() {
|
|
921
|
+
return [!1, Ve];
|
|
922
|
+
}
|
|
923
|
+
var He = Z, fr = q;
|
|
924
|
+
function Ke(e, t) {
|
|
925
|
+
var r = t(), n = y({ h: { __: r, v: t } }), o = n[0].h, i = n[1];
|
|
926
|
+
return Z(function() {
|
|
927
|
+
o.__ = r, o.v = t, $(o) && i({ h: o });
|
|
928
|
+
}, [e, r, t]), L(function() {
|
|
929
|
+
return $(o) && i({ h: o }), e(function() {
|
|
930
|
+
$(o) && i({ h: o });
|
|
931
|
+
});
|
|
932
|
+
}, [e]), r;
|
|
933
|
+
}
|
|
934
|
+
function $(e) {
|
|
935
|
+
var t, r, n = e.v, o = e.__;
|
|
936
|
+
try {
|
|
937
|
+
var i = n();
|
|
938
|
+
return !((t = o) === (r = i) && (t !== 0 || 1 / t == 1 / r) || t != t && r != r);
|
|
939
|
+
} catch {
|
|
940
|
+
return !0;
|
|
941
|
+
}
|
|
942
|
+
}
|
|
943
|
+
var P = { useState: y, useId: je, useReducer: Ne, useEffect: L, useLayoutEffect: Z, useInsertionEffect: He, useTransition: Je, useDeferredValue: Ue, useSyncExternalStore: Ke, startTransition: Ve, useRef: Se, useImperativeHandle: Oe, useMemo: Ae, useCallback: C, useContext: ae, useDebugValue: Re, version: "18.3.1", Children: Mt, render: qt, hydrate: Yt, unmountComponentAtNode: lr, createPortal: Ht, createElement: R, createContext: Pe, createFactory: or, cloneElement: sr, createRef: tt, Fragment: z, isValidElement: q, isElement: fr, isFragment: ir, isMemo: ar, findDOMNode: cr, Component: B, PureComponent: ie, memo: Dt, forwardRef: zt, flushSync: dr, unstable_batchedUpdates: ur, StrictMode: pr, Suspense: U, SuspenseList: I, lazy: Vt, __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: nr }, Xe = {
|
|
944
|
+
color: void 0,
|
|
945
|
+
size: void 0,
|
|
946
|
+
className: void 0,
|
|
947
|
+
style: void 0,
|
|
948
|
+
attr: void 0
|
|
949
|
+
}, Ce = P.createContext && /* @__PURE__ */ P.createContext(Xe), hr = ["attr", "size", "title"];
|
|
950
|
+
function gr(e, t) {
|
|
951
|
+
if (e == null) return {};
|
|
952
|
+
var r = mr(e, t), n, o;
|
|
953
|
+
if (Object.getOwnPropertySymbols) {
|
|
954
|
+
var i = Object.getOwnPropertySymbols(e);
|
|
955
|
+
for (o = 0; o < i.length; o++)
|
|
956
|
+
n = i[o], !(t.indexOf(n) >= 0) && Object.prototype.propertyIsEnumerable.call(e, n) && (r[n] = e[n]);
|
|
957
|
+
}
|
|
958
|
+
return r;
|
|
959
|
+
}
|
|
960
|
+
function mr(e, t) {
|
|
961
|
+
if (e == null) return {};
|
|
962
|
+
var r = {};
|
|
963
|
+
for (var n in e)
|
|
964
|
+
if (Object.prototype.hasOwnProperty.call(e, n)) {
|
|
965
|
+
if (t.indexOf(n) >= 0) continue;
|
|
966
|
+
r[n] = e[n];
|
|
967
|
+
}
|
|
968
|
+
return r;
|
|
969
|
+
}
|
|
970
|
+
function X() {
|
|
971
|
+
return X = Object.assign ? Object.assign.bind() : function(e) {
|
|
972
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
973
|
+
var r = arguments[t];
|
|
974
|
+
for (var n in r)
|
|
975
|
+
Object.prototype.hasOwnProperty.call(r, n) && (e[n] = r[n]);
|
|
976
|
+
}
|
|
977
|
+
return e;
|
|
978
|
+
}, X.apply(this, arguments);
|
|
979
|
+
}
|
|
980
|
+
function _e(e, t) {
|
|
981
|
+
var r = Object.keys(e);
|
|
982
|
+
if (Object.getOwnPropertySymbols) {
|
|
983
|
+
var n = Object.getOwnPropertySymbols(e);
|
|
984
|
+
t && (n = n.filter(function(o) {
|
|
985
|
+
return Object.getOwnPropertyDescriptor(e, o).enumerable;
|
|
986
|
+
})), r.push.apply(r, n);
|
|
987
|
+
}
|
|
988
|
+
return r;
|
|
989
|
+
}
|
|
990
|
+
function Q(e) {
|
|
991
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
992
|
+
var r = arguments[t] != null ? arguments[t] : {};
|
|
993
|
+
t % 2 ? _e(Object(r), !0).forEach(function(n) {
|
|
994
|
+
vr(e, n, r[n]);
|
|
995
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : _e(Object(r)).forEach(function(n) {
|
|
996
|
+
Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n));
|
|
997
|
+
});
|
|
998
|
+
}
|
|
999
|
+
return e;
|
|
1000
|
+
}
|
|
1001
|
+
function vr(e, t, r) {
|
|
1002
|
+
return t = br(t), t in e ? Object.defineProperty(e, t, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = r, e;
|
|
1003
|
+
}
|
|
1004
|
+
function br(e) {
|
|
1005
|
+
var t = wr(e, "string");
|
|
1006
|
+
return typeof t == "symbol" ? t : t + "";
|
|
1007
|
+
}
|
|
1008
|
+
function wr(e, t) {
|
|
1009
|
+
if (typeof e != "object" || !e) return e;
|
|
1010
|
+
var r = e[Symbol.toPrimitive];
|
|
1011
|
+
if (r !== void 0) {
|
|
1012
|
+
var n = r.call(e, t);
|
|
1013
|
+
if (typeof n != "object") return n;
|
|
1014
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1015
|
+
}
|
|
1016
|
+
return (t === "string" ? String : Number)(e);
|
|
1017
|
+
}
|
|
1018
|
+
function Qe(e) {
|
|
1019
|
+
return e && e.map((t, r) => /* @__PURE__ */ P.createElement(t.tag, Q({
|
|
1020
|
+
key: r
|
|
1021
|
+
}, t.attr), Qe(t.child)));
|
|
1022
|
+
}
|
|
1023
|
+
function yr(e) {
|
|
1024
|
+
return (t) => /* @__PURE__ */ P.createElement(xr, X({
|
|
1025
|
+
attr: Q({}, e.attr)
|
|
1026
|
+
}, t), Qe(e.child));
|
|
1027
|
+
}
|
|
1028
|
+
function xr(e) {
|
|
1029
|
+
var t = (r) => {
|
|
1030
|
+
var {
|
|
1031
|
+
attr: n,
|
|
1032
|
+
size: o,
|
|
1033
|
+
title: i
|
|
1034
|
+
} = e, a = gr(e, hr), l = o || r.size || "1em", c;
|
|
1035
|
+
return r.className && (c = r.className), e.className && (c = (c ? c + " " : "") + e.className), /* @__PURE__ */ P.createElement("svg", X({
|
|
1036
|
+
stroke: "currentColor",
|
|
1037
|
+
fill: "currentColor",
|
|
1038
|
+
strokeWidth: "0"
|
|
1039
|
+
}, r.attr, n, a, {
|
|
1040
|
+
className: c,
|
|
1041
|
+
style: Q(Q({
|
|
1042
|
+
color: e.color || r.color
|
|
1043
|
+
}, r.style), e.style),
|
|
1044
|
+
height: l,
|
|
1045
|
+
width: l,
|
|
1046
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
1047
|
+
}), i && /* @__PURE__ */ P.createElement("title", null, i), e.children);
|
|
1048
|
+
};
|
|
1049
|
+
return Ce !== void 0 ? /* @__PURE__ */ P.createElement(Ce.Consumer, null, (r) => t(r)) : t(Xe);
|
|
1050
|
+
}
|
|
1051
|
+
function kr(e) {
|
|
1052
|
+
return yr({ attr: { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "circle", attr: { cx: "12", cy: "12", r: "10" }, child: [] }, { tag: "path", attr: { d: "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3" }, child: [] }, { tag: "path", attr: { d: "M12 17h.01" }, child: [] }] })(e);
|
|
1053
|
+
}
|
|
1054
|
+
const de = ({
|
|
1055
|
+
variant: e,
|
|
1056
|
+
children: t
|
|
1057
|
+
}) => /* @__PURE__ */ d("div", { className: "group relative", children: [
|
|
1058
|
+
/* @__PURE__ */ s("div", { className: "cursor-pointer rounded-md p-1.5 transition-colors hover:bg-neutral-200", children: _(e).with("icon", () => /* @__PURE__ */ s(kr, {})).with("text", () => /* @__PURE__ */ s("div", { children: "Text" })).exhaustive() }),
|
|
1059
|
+
/* @__PURE__ */ s("div", { className: "-translate-x-1/2 absolute top-full left-1/2 z-10 hidden rounded-md bg-neutral-100 p-2 shadow-sm group-hover:block", children: t })
|
|
1060
|
+
] }), pe = ({ options: e, value: t, onChange: r }) => /* @__PURE__ */ s("div", { className: "flex divide-x rounded-md border border-gray-300", children: e.map(([n, o]) => /* @__PURE__ */ s(
|
|
1061
|
+
"button",
|
|
1062
|
+
{
|
|
1063
|
+
type: "button",
|
|
1064
|
+
onClick: () => r(n),
|
|
1065
|
+
"aria-pressed": n === t,
|
|
1066
|
+
className: Le(
|
|
1067
|
+
"px-4 py-2 font-semibold text-xs transition first:rounded-l-md last:rounded-r-md",
|
|
1068
|
+
n === t ? "border-blue-500 bg-blue-50 text-blue-600" : "cursor-pointer border-gray-300 text-gray-600 hover:border-gray-400"
|
|
1069
|
+
),
|
|
1070
|
+
children: o
|
|
1071
|
+
},
|
|
1072
|
+
n
|
|
1073
|
+
)) }), Cr = ({ label: e, value: t, onChange: r }) => /* @__PURE__ */ s(
|
|
1074
|
+
pe,
|
|
1075
|
+
{
|
|
1076
|
+
options: [
|
|
1077
|
+
["true", "Yes"],
|
|
1078
|
+
["false", "No"]
|
|
1079
|
+
],
|
|
1080
|
+
value: t ? "true" : "false",
|
|
1081
|
+
onChange: (n) => r(n === "true")
|
|
1082
|
+
}
|
|
1083
|
+
), _r = () => {
|
|
1084
|
+
const { settings: e, updateSettings: t } = ce();
|
|
1085
|
+
return /* @__PURE__ */ d("div", { children: [
|
|
1086
|
+
/* @__PURE__ */ d("div", { className: "flex items-end justify-between p-2", children: [
|
|
1087
|
+
/* @__PURE__ */ s("div", { children: "Connection preferences" }),
|
|
1088
|
+
/* @__PURE__ */ s(de, { variant: "icon", children: "Something something very cool" })
|
|
1089
|
+
] }),
|
|
1090
|
+
/* @__PURE__ */ s("div", { className: "flex flex-col gap-4 rounded-md bg-[#F4F5F6] p-2", children: [
|
|
1091
|
+
[
|
|
1092
|
+
"Retain session history",
|
|
1093
|
+
"retainHistory",
|
|
1094
|
+
e?.retainHistory ?? !1,
|
|
1095
|
+
(r) => t({ retainHistory: r })
|
|
1096
|
+
],
|
|
1097
|
+
[
|
|
1098
|
+
"Auto reconnect",
|
|
1099
|
+
"autoReconnect",
|
|
1100
|
+
e?.autoReconnect ?? !1,
|
|
1101
|
+
(r) => t({ autoReconnect: r })
|
|
1102
|
+
]
|
|
1103
|
+
].map(([r, n, o, i]) => /* @__PURE__ */ d("div", { className: "flex items-center justify-between", children: [
|
|
1104
|
+
/* @__PURE__ */ s("div", { className: "font-semibold text-gray-900 text-sm", children: r }),
|
|
1105
|
+
/* @__PURE__ */ s(Cr, { label: r, value: o, onChange: i })
|
|
1106
|
+
] }, n)) })
|
|
1107
|
+
] });
|
|
1108
|
+
}, Sr = "h-11 w-full rounded-lg border border-gray-300 bg-white px-3 text-sm text-gray-700 focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-200", Nr = ({
|
|
1109
|
+
// eslint-disable-next-line no-restricted-syntax
|
|
1110
|
+
id: e,
|
|
1111
|
+
value: t,
|
|
1112
|
+
placeholder: r,
|
|
1113
|
+
ariaLabel: n,
|
|
1114
|
+
readOnly: o = !0,
|
|
1115
|
+
onChange: i
|
|
1116
|
+
}) => /* @__PURE__ */ s(
|
|
1117
|
+
"input",
|
|
1118
|
+
{
|
|
1119
|
+
id: e,
|
|
1120
|
+
className: Sr,
|
|
1121
|
+
value: t,
|
|
1122
|
+
placeholder: r,
|
|
1123
|
+
"aria-label": n,
|
|
1124
|
+
readOnly: o,
|
|
1125
|
+
onChange: (a) => {
|
|
1126
|
+
a.target instanceof HTMLInputElement && i?.(a.target.value);
|
|
1127
|
+
}
|
|
1128
|
+
}
|
|
1129
|
+
), Ar = ["MQTT", "NTFY", "GUN"], Or = () => {
|
|
1130
|
+
const { settings: e, updateSettings: t } = ce(), r = (o) => t({ session: { p: o } }), n = (o) => t({ session: { s: o } });
|
|
1131
|
+
return /* @__PURE__ */ d("div", { children: [
|
|
1132
|
+
/* @__PURE__ */ d("div", { className: "flex items-end justify-between p-2", children: [
|
|
1133
|
+
/* @__PURE__ */ s("div", { children: "Signaling" }),
|
|
1134
|
+
/* @__PURE__ */ s(de, { variant: "icon", children: "Something something very cool" })
|
|
1135
|
+
] }),
|
|
1136
|
+
/* @__PURE__ */ d("div", { className: "flex flex-col gap-4 rounded-md bg-[#F4F5F6] p-2", children: [
|
|
1137
|
+
/* @__PURE__ */ d("div", { className: "flex items-center justify-between", children: [
|
|
1138
|
+
/* @__PURE__ */ s("div", { children: "Protocol" }),
|
|
1139
|
+
/* @__PURE__ */ s(
|
|
1140
|
+
pe,
|
|
1141
|
+
{
|
|
1142
|
+
options: Ar.map((o) => [
|
|
1143
|
+
o.toLowerCase(),
|
|
1144
|
+
o
|
|
1145
|
+
]),
|
|
1146
|
+
value: e?.session.p || "",
|
|
1147
|
+
onChange: r
|
|
1148
|
+
}
|
|
1149
|
+
)
|
|
1150
|
+
] }),
|
|
1151
|
+
/* @__PURE__ */ s(
|
|
1152
|
+
Nr,
|
|
1153
|
+
{
|
|
1154
|
+
id: "server",
|
|
1155
|
+
value: e?.session.s || "",
|
|
1156
|
+
onChange: (o) => n(o),
|
|
1157
|
+
placeholder: "Server URL",
|
|
1158
|
+
ariaLabel: "Server URL",
|
|
1159
|
+
readOnly: !1
|
|
1160
|
+
}
|
|
1161
|
+
)
|
|
1162
|
+
] })
|
|
1163
|
+
] });
|
|
1164
|
+
}, jr = ["WebRTC"], Rr = () => {
|
|
1165
|
+
const [e, t] = y("WebRTC");
|
|
1166
|
+
return /* @__PURE__ */ d("div", { children: [
|
|
1167
|
+
/* @__PURE__ */ d("div", { className: "flex items-end justify-between p-2", children: [
|
|
1168
|
+
/* @__PURE__ */ s("div", { children: "Transport" }),
|
|
1169
|
+
/* @__PURE__ */ s(de, { variant: "icon", children: "Something something very cool" })
|
|
1170
|
+
] }),
|
|
1171
|
+
/* @__PURE__ */ s("div", { className: "flex flex-col gap-4 rounded-md bg-[#F4F5F6] p-2", children: /* @__PURE__ */ d("div", { className: "flex items-center justify-between", children: [
|
|
1172
|
+
/* @__PURE__ */ s("div", { children: "Protocol" }),
|
|
1173
|
+
/* @__PURE__ */ s(
|
|
1174
|
+
pe,
|
|
1175
|
+
{
|
|
1176
|
+
options: jr.map((r) => [r, r]),
|
|
1177
|
+
value: e,
|
|
1178
|
+
onChange: (r) => t(r)
|
|
1179
|
+
}
|
|
1180
|
+
)
|
|
1181
|
+
] }) })
|
|
1182
|
+
] });
|
|
1183
|
+
}, Pr = ({ onBack: e }) => /* @__PURE__ */ s("div", { className: "text-left", children: /* @__PURE__ */ d("div", { className: "flex flex-col gap-2 px-2", children: [
|
|
1184
|
+
/* @__PURE__ */ s(Or, {}),
|
|
1185
|
+
/* @__PURE__ */ s(Rr, {}),
|
|
1186
|
+
/* @__PURE__ */ s(_r, {})
|
|
1187
|
+
] }) }), Lr = () => {
|
|
1188
|
+
const [e, t] = y("start"), [r, n] = y(!1);
|
|
1189
|
+
return L(() => {
|
|
1190
|
+
if (!r) return;
|
|
1191
|
+
const o = window.setTimeout(() => n(!1), 2e3);
|
|
1192
|
+
return () => window.clearTimeout(o);
|
|
1193
|
+
}, [r]), {
|
|
1194
|
+
view: e,
|
|
1195
|
+
setView: t,
|
|
1196
|
+
copied: r,
|
|
1197
|
+
setCopied: n
|
|
1198
|
+
};
|
|
1199
|
+
}, Er = (e) => {
|
|
1200
|
+
L(() => {
|
|
1201
|
+
const t = (r) => {
|
|
1202
|
+
r.key === "Escape" && e();
|
|
1203
|
+
};
|
|
1204
|
+
return document.addEventListener("keydown", t), () => document.removeEventListener("keydown", t);
|
|
1205
|
+
}, [e]);
|
|
1206
|
+
}, Fr = ({ onClose: e = () => {
|
|
1207
|
+
}, onCopy: t }) => {
|
|
1208
|
+
const { view: r, setView: n, copied: o, setCopied: i } = Lr(), { uri: a } = G(), { status: l } = E(), c = "Connect Wallet";
|
|
1209
|
+
Er(e);
|
|
1210
|
+
const f = C(async () => {
|
|
1211
|
+
a && await _t(a) && i(!0);
|
|
1212
|
+
}, [a, i]);
|
|
1213
|
+
return D("view", r), /* @__PURE__ */ s(
|
|
1214
|
+
"div",
|
|
1215
|
+
{
|
|
1216
|
+
className: "fixed inset-0 z-[10000] flex animate-[bg-in_0.15s_ease-in-out] items-center justify-center bg-black/30 p-4 font-sans text-slate-800 backdrop-blur-sm",
|
|
1217
|
+
onClick: e,
|
|
1218
|
+
role: "presentation",
|
|
1219
|
+
"data-openlv-modal-root": !0,
|
|
1220
|
+
children: /* @__PURE__ */ d(
|
|
1221
|
+
"div",
|
|
1222
|
+
{
|
|
1223
|
+
className: "relative w-full max-w-[400px] animate-[fade-in_0.15s_ease-in-out] space-y-2 rounded-2xl bg-white p-2 text-center",
|
|
1224
|
+
role: "dialog",
|
|
1225
|
+
"aria-modal": "true",
|
|
1226
|
+
"aria-label": c,
|
|
1227
|
+
onClick: (w) => w.stopPropagation(),
|
|
1228
|
+
children: [
|
|
1229
|
+
/* @__PURE__ */ s(
|
|
1230
|
+
Tt,
|
|
1231
|
+
{
|
|
1232
|
+
setView: n,
|
|
1233
|
+
onToggleSettings: () => n(r === "settings" ? "start" : "settings"),
|
|
1234
|
+
title: c,
|
|
1235
|
+
view: r,
|
|
1236
|
+
onClose: e
|
|
1237
|
+
}
|
|
1238
|
+
),
|
|
1239
|
+
_(l).with(
|
|
1240
|
+
"disconnected",
|
|
1241
|
+
() => _(r).with("start", () => /* @__PURE__ */ s(Rt, {})).with("settings", () => /* @__PURE__ */ s(Pr, { onBack: () => n("start") })).otherwise(() => /* @__PURE__ */ s(K, { state: r }))
|
|
1242
|
+
).with(le.union("connecting", "connected"), () => /* @__PURE__ */ s(jt, { onClose: e, onCopy: t || f })).otherwise(() => /* @__PURE__ */ s(K, { state: "unknown status" })),
|
|
1243
|
+
/* @__PURE__ */ s(
|
|
1244
|
+
"div",
|
|
1245
|
+
{
|
|
1246
|
+
className: Le(
|
|
1247
|
+
"absolute top-5 right-5 rounded-lg bg-blue-500 px-4 py-3 font-medium text-sm text-white transition-all",
|
|
1248
|
+
o ? "translate-x-0 opacity-100" : "translate-x-full opacity-0"
|
|
1249
|
+
),
|
|
1250
|
+
children: "📋 Connection URL copied to clipboard!"
|
|
1251
|
+
}
|
|
1252
|
+
),
|
|
1253
|
+
/* @__PURE__ */ s(Et, {})
|
|
1254
|
+
]
|
|
1255
|
+
}
|
|
1256
|
+
)
|
|
1257
|
+
}
|
|
1258
|
+
);
|
|
1259
|
+
}, Jr = (e = "idle") => {
|
|
1260
|
+
const [t, r] = y({
|
|
1261
|
+
state: e
|
|
1262
|
+
}), n = C(
|
|
1263
|
+
(a, l) => {
|
|
1264
|
+
r((c) => ({
|
|
1265
|
+
...c,
|
|
1266
|
+
state: a,
|
|
1267
|
+
...l
|
|
1268
|
+
}));
|
|
1269
|
+
},
|
|
1270
|
+
[]
|
|
1271
|
+
), o = C((a) => {
|
|
1272
|
+
r(a);
|
|
1273
|
+
}, []), i = C(() => {
|
|
1274
|
+
r({ state: "idle" });
|
|
1275
|
+
}, []);
|
|
1276
|
+
return {
|
|
1277
|
+
connectionInfo: t,
|
|
1278
|
+
updateState: n,
|
|
1279
|
+
updateConnectionInfo: o,
|
|
1280
|
+
reset: i
|
|
1281
|
+
};
|
|
1282
|
+
}, Br = '/*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-space-y-reverse:0;--tw-divide-x-reverse:0;--tw-border-style:solid;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-blue-50:oklch(97% .014 254.604);--color-blue-200:oklch(88.2% .059 254.128);--color-blue-500:oklch(62.3% .214 259.815);--color-blue-600:oklch(54.6% .245 262.881);--color-slate-800:oklch(27.9% .041 260.031);--color-gray-50:oklch(98.5% .002 247.839);--color-gray-100:oklch(96.7% .003 264.542);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-900:oklch(21% .034 264.665);--color-neutral-100:oklch(97% 0 0);--color-neutral-200:oklch(92.2% 0 0);--color-black:#000;--color-white:#fff;--spacing:.25rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--text-4xl:2.25rem;--text-4xl--line-height:calc(2.5/2.25);--font-weight-medium:500;--font-weight-semibold:600;--tracking-wide:.025em;--radius-md:.375rem;--radius-lg:.5rem;--radius-2xl:1rem;--animate-spin:spin 1s linear infinite;--blur-sm:8px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.inset-0{inset:calc(var(--spacing)*0)}.top-5{top:calc(var(--spacing)*5)}.top-full{top:100%}.right-5{right:calc(var(--spacing)*5)}.left-1\\/2{left:50%}.z-10{z-index:10}.z-\\[10000\\]{z-index:10000}.mx-auto{margin-inline:auto}.mt-2{margin-top:calc(var(--spacing)*2)}.mb-2{margin-bottom:calc(var(--spacing)*2)}.mb-4{margin-bottom:calc(var(--spacing)*4)}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.h-8{height:calc(var(--spacing)*8)}.h-11{height:calc(var(--spacing)*11)}.h-\\[200px\\]{height:200px}.w-8{width:calc(var(--spacing)*8)}.w-\\[200px\\]{width:200px}.w-fit{width:fit-content}.w-full{width:100%}.max-w-\\[400px\\]{max-width:400px}.-translate-x-1\\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-x-0{--tw-translate-x:calc(var(--spacing)*0);translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-x-full{--tw-translate-x:100%;translate:var(--tw-translate-x)var(--tw-translate-y)}.animate-\\[bg-in_0\\.15s_ease-in-out\\]{animation:.15s ease-in-out bg-in}.animate-\\[fade-in_0\\.15s_ease-in-out\\]{animation:.15s ease-in-out fade-in}.animate-spin{animation:var(--animate-spin)}.cursor-pointer{cursor:pointer}.flex-col{flex-direction:column}.items-center{align-items:center}.items-end{align-items:flex-end}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-2{gap:calc(var(--spacing)*2)}.gap-4{gap:calc(var(--spacing)*4)}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*2)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*4)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*4)*calc(1 - var(--tw-space-y-reverse)))}:where(.divide-x>:not(:last-child)){--tw-divide-x-reverse:0;border-inline-style:var(--tw-border-style);border-inline-start-width:calc(1px*var(--tw-divide-x-reverse));border-inline-end-width:calc(1px*calc(1 - var(--tw-divide-x-reverse)))}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-4{border-style:var(--tw-border-style);border-width:4px}.border-blue-500{border-color:var(--color-blue-500)}.border-gray-200{border-color:var(--color-gray-200)}.border-gray-300{border-color:var(--color-gray-300)}.border-neutral-200{border-color:var(--color-neutral-200)}.border-t-transparent{border-top-color:#0000}.bg-\\[\\#F4F5F6\\]{background-color:#f4f5f6}.bg-black\\/30{background-color:#0000004d}@supports (color:color-mix(in lab,red,red)){.bg-black\\/30{background-color:color-mix(in oklab,var(--color-black)30%,transparent)}}.bg-blue-50{background-color:var(--color-blue-50)}.bg-blue-500{background-color:var(--color-blue-500)}.bg-gray-50{background-color:var(--color-gray-50)}.bg-gray-100{background-color:var(--color-gray-100)}.bg-gray-200{background-color:var(--color-gray-200)}.bg-neutral-100{background-color:var(--color-neutral-100)}.bg-white{background-color:var(--color-white)}.p-1{padding:calc(var(--spacing)*1)}.p-1\\.5{padding:calc(var(--spacing)*1.5)}.p-2{padding:calc(var(--spacing)*2)}.p-4{padding:calc(var(--spacing)*4)}.p-6{padding:calc(var(--spacing)*6)}.px-1{padding-inline:calc(var(--spacing)*1)}.px-2{padding-inline:calc(var(--spacing)*2)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-6{padding-inline:calc(var(--spacing)*6)}.py-2{padding-block:calc(var(--spacing)*2)}.py-3{padding-block:calc(var(--spacing)*3)}.text-center{text-align:center}.text-left{text-align:left}.font-sans{font-family:var(--font-sans)}.text-4xl{font-size:var(--text-4xl);line-height:var(--tw-leading,var(--text-4xl--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.text-blue-600{color:var(--color-blue-600)}.text-gray-500{color:var(--color-gray-500)}.text-gray-600{color:var(--color-gray-600)}.text-gray-700{color:var(--color-gray-700)}.text-gray-900{color:var(--color-gray-900)}.text-slate-800{color:var(--color-slate-800)}.text-white{color:var(--color-white)}.uppercase{text-transform:uppercase}.opacity-0{opacity:0}.opacity-100{opacity:1}.shadow,.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-300{--tw-duration:.3s;transition-duration:.3s}@media (hover:hover){.group-hover\\:block:is(:where(.group):hover *){display:block}.group-hover\\:opacity-100:is(:where(.group):hover *){opacity:1}}.first\\:rounded-l-md:first-child{border-top-left-radius:var(--radius-md);border-bottom-left-radius:var(--radius-md)}.last\\:rounded-r-md:last-child{border-top-right-radius:var(--radius-md);border-bottom-right-radius:var(--radius-md)}@media (hover:hover){.hover\\:border-gray-400:hover{border-color:var(--color-gray-400)}.hover\\:bg-blue-600:hover{background-color:var(--color-blue-600)}.hover\\:bg-gray-200:hover{background-color:var(--color-gray-200)}.hover\\:bg-gray-300:hover{background-color:var(--color-gray-300)}.hover\\:bg-neutral-200:hover{background-color:var(--color-neutral-200)}}.focus\\:border-blue-500:focus{border-color:var(--color-blue-500)}.focus\\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\\:ring-blue-200:focus{--tw-ring-color:var(--color-blue-200)}.focus\\:outline-none:focus{--tw-outline-style:none;outline-style:none}}@keyframes fade-in{0%{transform:translateY(-2px)scale(.95)}to{transform:translateY(0)scale(1)}}@keyframes bg-in{0%{opacity:0;-webkit-backdrop-filter:blur();backdrop-filter:blur()}to{opacity:1;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px)}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}}', Tr = async (e) => {
|
|
1283
|
+
if (e) {
|
|
1284
|
+
if (e.querySelector("style[data-openlv-modal]"))
|
|
1285
|
+
return;
|
|
1286
|
+
const r = document.createElement("style");
|
|
1287
|
+
r.setAttribute("data-openlv-modal", "true"), r.textContent = Br, e.appendChild(r);
|
|
1288
|
+
}
|
|
1289
|
+
};
|
|
1290
|
+
class Ze extends HTMLElement {
|
|
1291
|
+
constructor(r, n) {
|
|
1292
|
+
super();
|
|
1293
|
+
F(this, "onClose");
|
|
1294
|
+
F(this, "provider");
|
|
1295
|
+
F(this, "storage");
|
|
1296
|
+
F(this, "shadow");
|
|
1297
|
+
F(this, "renderRequested", !1);
|
|
1298
|
+
this.provider = r, this.storage = n, this.shadow = this.attachShadow({ mode: "open" }), Tr(this.shadow);
|
|
1299
|
+
}
|
|
1300
|
+
connectedCallback() {
|
|
1301
|
+
this.requestRender();
|
|
1302
|
+
}
|
|
1303
|
+
disconnectedCallback() {
|
|
1304
|
+
T(null, this.shadow);
|
|
1305
|
+
}
|
|
1306
|
+
showModal() {
|
|
1307
|
+
this.style.display = "block";
|
|
1308
|
+
}
|
|
1309
|
+
hideModal() {
|
|
1310
|
+
this.style.display = "none";
|
|
1311
|
+
}
|
|
1312
|
+
requestRender() {
|
|
1313
|
+
this.renderRequested || (this.renderRequested = !0, queueMicrotask(() => {
|
|
1314
|
+
this.renderRequested = !1, this.performRender();
|
|
1315
|
+
}));
|
|
1316
|
+
}
|
|
1317
|
+
performRender() {
|
|
1318
|
+
const r = {
|
|
1319
|
+
onClose: this.onClose ?? (() => this.remove()),
|
|
1320
|
+
provider: this.provider,
|
|
1321
|
+
storage: this.storage
|
|
1322
|
+
};
|
|
1323
|
+
T(ot(St, r), this.shadow);
|
|
1324
|
+
}
|
|
1325
|
+
}
|
|
1326
|
+
const Dr = (e = "openlv-modal") => {
|
|
1327
|
+
if (typeof window > "u")
|
|
1328
|
+
return e;
|
|
1329
|
+
const t = window.customElements;
|
|
1330
|
+
return t ? (t.get(e) || t.define(
|
|
1331
|
+
e,
|
|
1332
|
+
Ze
|
|
1333
|
+
), e) : (console.warn(
|
|
1334
|
+
"OpenLV modal: custom elements are not supported in this environment."
|
|
1335
|
+
), e);
|
|
1336
|
+
}, Hr = (e, t) => {
|
|
1337
|
+
const r = document.querySelector("openlv-modal");
|
|
1338
|
+
if (r && r.remove(), !r) {
|
|
1339
|
+
Dr();
|
|
1340
|
+
const n = new Ze(e, t);
|
|
1341
|
+
document.body.appendChild(n), n.showModal(), n.onClose = () => {
|
|
1342
|
+
D("modal closed"), n.remove();
|
|
1343
|
+
};
|
|
1344
|
+
}
|
|
1345
|
+
};
|
|
1346
|
+
export {
|
|
1347
|
+
Fr as ModalRoot,
|
|
1348
|
+
Pt as OPENLV_ICON_128,
|
|
1349
|
+
Ze as OpenLVModalElement,
|
|
1350
|
+
Ze as default,
|
|
1351
|
+
Dr as registerOpenLVModal,
|
|
1352
|
+
Hr as triggerOpenModal,
|
|
1353
|
+
Jr as useConnectionState
|
|
1354
|
+
};
|
|
1355
|
+
//# sourceMappingURL=index.js.map
|