UNPKG

hello-csv

Version:

A modern CSV importer written in Preact

1,314 lines 419 kB
var qa = Object.defineProperty; var Ka = (e, t, n) => t in e ? qa(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n; var Ee = (e, t, n) => Ka(e, typeof t != "symbol" ? t + "" : t, n); var _n, oe, cl, yt, ti, dl, Nr, fl, mo, kr, Ar, pl, dn = {}, ml = [], Ya = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, Yn = Array.isArray; function ot(e, t) { for (var n in t) e[n] = t[n]; return e; } function go(e) { e && e.parentNode && e.parentNode.removeChild(e); } function F(e, t, n) { var r, o, i, l = {}; for (i in t) i == "key" ? r = t[i] : i == "ref" ? o = t[i] : l[i] = t[i]; if (arguments.length > 2 && (l.children = arguments.length > 3 ? _n.call(arguments, 2) : n), typeof e == "function" && e.defaultProps != null) for (i in e.defaultProps) l[i] === void 0 && (l[i] = e.defaultProps[i]); return on(e, l, r, o, null); } function on(e, t, n, r, o) { var i = { type: e, props: t, key: n, ref: r, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: o ?? ++cl, __i: -1, __u: 0 }; return o == null && oe.vnode != null && oe.vnode(i), i; } function Xn() { return { current: null }; } function pe(e) { return e.children; } function Be(e, t) { this.props = e, this.context = t; } function zt(e, t) { if (t == null) return e.__ ? zt(e.__, e.__i + 1) : null; for (var n; t < e.__k.length; t++) if ((n = e.__k[t]) != null && n.__e != null) return n.__e; return typeof e.type == "function" ? zt(e) : null; } function gl(e) { var t, n; if ((e = e.__) != null && e.__c != null) { for (e.__e = e.__c.base = null, t = 0; t < e.__k.length; t++) if ((n = e.__k[t]) != null && n.__e != null) { e.__e = e.__c.base = n.__e; break; } return gl(e); } } function Dr(e) { (!e.__d && (e.__d = !0) && yt.push(e) && !Hn.__r++ || ti !== oe.debounceRendering) && ((ti = oe.debounceRendering) || dl)(Hn); } function Hn() { var e, t, n, r, o, i, l, s; for (yt.sort(Nr); e = yt.shift(); ) e.__d && (t = yt.length, r = void 0, i = (o = (n = e).__v).__e, l = [], s = [], n.__P && ((r = ot({}, o)).__v = o.__v + 1, oe.vnode && oe.vnode(r), ho(n.__P, r, o, n.__n, n.__P.namespaceURI, 32 & o.__u ? [i] : null, l, i ?? zt(o), !!(32 & o.__u), s), r.__v = o.__v, r.__.__k[r.__i] = r, _l(l, r, s), r.__e != i && gl(r)), yt.length > t && yt.sort(Nr)); Hn.__r = 0; } function hl(e, t, n, r, o, i, l, s, a, u, c) { var d, g, f, m, h, v, y = r && r.__k || ml, x = t.length; for (a = Xa(n, t, y, a, x), d = 0; d < x; d++) (f = n.__k[d]) != null && (g = f.__i === -1 ? dn : y[f.__i] || dn, f.__i = d, v = ho(e, f, g, o, i, l, s, a, u, c), m = f.__e, f.ref && g.ref != f.ref && (g.ref && vo(g.ref, null, f), c.push(f.ref, f.__c || m, f)), h == null && m != null && (h = m), 4 & f.__u || g.__k === f.__k ? a = vl(f, a, e) : typeof f.type == "function" && v !== void 0 ? a = v : m && (a = m.nextSibling), f.__u &= -7); return n.__e = h, a; } function Xa(e, t, n, r, o) { var i, l, s, a, u, c = n.length, d = c, g = 0; for (e.__k = new Array(o), i = 0; i < o; i++) (l = t[i]) != null && typeof l != "boolean" && typeof l != "function" ? (a = i + g, (l = e.__k[i] = typeof l == "string" || typeof l == "number" || typeof l == "bigint" || l.constructor == String ? on(null, l, null, null, null) : Yn(l) ? on(pe, { children: l }, null, null, null) : l.constructor === void 0 && l.__b > 0 ? on(l.type, l.props, l.key, l.ref ? l.ref : null, l.__v) : l).__ = e, l.__b = e.__b + 1, s = null, (u = l.__i = Za(l, n, a, d)) !== -1 && (d--, (s = n[u]) && (s.__u |= 2)), s == null || s.__v === null ? (u == -1 && g--, typeof l.type != "function" && (l.__u |= 4)) : u != a && (u == a - 1 ? g-- : u == a + 1 ? g++ : (u > a ? g-- : g++, l.__u |= 4))) : e.__k[i] = null; if (d) for (i = 0; i < c; i++) (s = n[i]) != null && (2 & s.__u) == 0 && (s.__e == r && (r = zt(s)), wl(s, s)); return r; } function vl(e, t, n) { var r, o; if (typeof e.type == "function") { for (r = e.__k, o = 0; r && o < r.length; o++) r[o] && (r[o].__ = e, t = vl(r[o], t, n)); return t; } e.__e != t && (t && e.type && !n.contains(t) && (t = zt(e)), n.insertBefore(e.__e, t || null), t = e.__e); do t = t && t.nextSibling; while (t != null && t.nodeType == 8); return t; } function it(e, t) { return t = t || [], e == null || typeof e == "boolean" || (Yn(e) ? e.some(function(n) { it(n, t); }) : t.push(e)), t; } function Za(e, t, n, r) { var o, i, l = e.key, s = e.type, a = t[n]; if (a === null || a && l == a.key && s === a.type && (2 & a.__u) == 0) return n; if (r > (a != null && (2 & a.__u) == 0 ? 1 : 0)) for (o = n - 1, i = n + 1; o >= 0 || i < t.length; ) { if (o >= 0) { if ((a = t[o]) && (2 & a.__u) == 0 && l == a.key && s === a.type) return o; o--; } if (i < t.length) { if ((a = t[i]) && (2 & a.__u) == 0 && l == a.key && s === a.type) return i; i++; } } return -1; } function ni(e, t, n) { t[0] == "-" ? e.setProperty(t, n ?? "") : e[t] = n == null ? "" : typeof n != "number" || Ya.test(t) ? n : n + "px"; } function Mn(e, t, n, r, o) { var i; e: if (t == "style") if (typeof n == "string") e.style.cssText = n; else { if (typeof r == "string" && (e.style.cssText = r = ""), r) for (t in r) n && t in n || ni(e.style, t, ""); if (n) for (t in n) r && n[t] === r[t] || ni(e.style, t, n[t]); } else if (t[0] == "o" && t[1] == "n") i = t != (t = t.replace(fl, "$1")), t = t.toLowerCase() in e || t == "onFocusOut" || t == "onFocusIn" ? t.toLowerCase().slice(2) : t.slice(2), e.l || (e.l = {}), e.l[t + i] = n, n ? r ? n.u = r.u : (n.u = mo, e.addEventListener(t, i ? Ar : kr, i)) : e.removeEventListener(t, i ? Ar : kr, i); else { if (o == "http://www.w3.org/2000/svg") t = t.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s"); else if (t != "width" && t != "height" && t != "href" && t != "list" && t != "form" && t != "tabIndex" && t != "download" && t != "rowSpan" && t != "colSpan" && t != "role" && t != "popover" && t in e) try { e[t] = n ?? ""; break e; } catch { } typeof n == "function" || (n == null || n === !1 && t[4] != "-" ? e.removeAttribute(t) : e.setAttribute(t, t == "popover" && n == 1 ? "" : n)); } } function ri(e) { return function(t) { if (this.l) { var n = this.l[t.type + e]; if (t.t == null) t.t = mo++; else if (t.t < n.u) return; return n(oe.event ? oe.event(t) : t); } }; } function ho(e, t, n, r, o, i, l, s, a, u) { var c, d, g, f, m, h, v, y, x, S, C, T, O, I, _, w, b, E = t.type; if (t.constructor !== void 0) return null; 128 & n.__u && (a = !!(32 & n.__u), i = [s = t.__e = n.__e]), (c = oe.__b) && c(t); e: if (typeof E == "function") try { if (y = t.props, x = "prototype" in E && E.prototype.render, S = (c = E.contextType) && r[c.__c], C = c ? S ? S.props.value : c.__ : r, n.__c ? v = (d = t.__c = n.__c).__ = d.__E : (x ? t.__c = d = new E(y, C) : (t.__c = d = new Be(y, C), d.constructor = E, d.render = Qa), S && S.sub(d), d.props = y, d.state || (d.state = {}), d.context = C, d.__n = r, g = d.__d = !0, d.__h = [], d._sb = []), x && d.__s == null && (d.__s = d.state), x && E.getDerivedStateFromProps != null && (d.__s == d.state && (d.__s = ot({}, d.__s)), ot(d.__s, E.getDerivedStateFromProps(y, d.__s))), f = d.props, m = d.state, d.__v = t, g) x && E.getDerivedStateFromProps == null && d.componentWillMount != null && d.componentWillMount(), x && d.componentDidMount != null && d.__h.push(d.componentDidMount); else { if (x && E.getDerivedStateFromProps == null && y !== f && d.componentWillReceiveProps != null && d.componentWillReceiveProps(y, C), !d.__e && (d.shouldComponentUpdate != null && d.shouldComponentUpdate(y, d.__s, C) === !1 || t.__v == n.__v)) { for (t.__v != n.__v && (d.props = y, d.state = d.__s, d.__d = !1), t.__e = n.__e, t.__k = n.__k, t.__k.some(function(R) { R && (R.__ = t); }), T = 0; T < d._sb.length; T++) d.__h.push(d._sb[T]); d._sb = [], d.__h.length && l.push(d); break e; } d.componentWillUpdate != null && d.componentWillUpdate(y, d.__s, C), x && d.componentDidUpdate != null && d.__h.push(function() { d.componentDidUpdate(f, m, h); }); } if (d.context = C, d.props = y, d.__P = e, d.__e = !1, O = oe.__r, I = 0, x) { for (d.state = d.__s, d.__d = !1, O && O(t), c = d.render(d.props, d.state, d.context), _ = 0; _ < d._sb.length; _++) d.__h.push(d._sb[_]); d._sb = []; } else do d.__d = !1, O && O(t), c = d.render(d.props, d.state, d.context), d.state = d.__s; while (d.__d && ++I < 25); d.state = d.__s, d.getChildContext != null && (r = ot(ot({}, r), d.getChildContext())), x && !g && d.getSnapshotBeforeUpdate != null && (h = d.getSnapshotBeforeUpdate(f, m)), s = hl(e, Yn(w = c != null && c.type === pe && c.key == null ? c.props.children : c) ? w : [w], t, n, r, o, i, l, s, a, u), d.base = t.__e, t.__u &= -161, d.__h.length && l.push(d), v && (d.__E = d.__ = null); } catch (R) { if (t.__v = null, a || i != null) if (R.then) { for (t.__u |= a ? 160 : 128; s && s.nodeType == 8 && s.nextSibling; ) s = s.nextSibling; i[i.indexOf(s)] = null, t.__e = s; } else for (b = i.length; b--; ) go(i[b]); else t.__e = n.__e, t.__k = n.__k; oe.__e(R, t, n); } else i == null && t.__v == n.__v ? (t.__k = n.__k, t.__e = n.__e) : s = t.__e = Ja(n.__e, t, n, r, o, i, l, a, u); return (c = oe.diffed) && c(t), 128 & t.__u ? void 0 : s; } function _l(e, t, n) { for (var r = 0; r < n.length; r++) vo(n[r], n[++r], n[++r]); oe.__c && oe.__c(t, e), e.some(function(o) { try { e = o.__h, o.__h = [], e.some(function(i) { i.call(o); }); } catch (i) { oe.__e(i, o.__v); } }); } function Ja(e, t, n, r, o, i, l, s, a) { var u, c, d, g, f, m, h, v = n.props, y = t.props, x = t.type; if (x == "svg" ? o = "http://www.w3.org/2000/svg" : x == "math" ? o = "http://www.w3.org/1998/Math/MathML" : o || (o = "http://www.w3.org/1999/xhtml"), i != null) { for (u = 0; u < i.length; u++) if ((f = i[u]) && "setAttribute" in f == !!x && (x ? f.localName == x : f.nodeType == 3)) { e = f, i[u] = null; break; } } if (e == null) { if (x == null) return document.createTextNode(y); e = document.createElementNS(o, x, y.is && y), s && (oe.__m && oe.__m(t, i), s = !1), i = null; } if (x === null) v === y || s && e.data === y || (e.data = y); else { if (i = i && _n.call(e.childNodes), v = n.props || dn, !s && i != null) for (v = {}, u = 0; u < e.attributes.length; u++) v[(f = e.attributes[u]).name] = f.value; for (u in v) if (f = v[u], u != "children") { if (u == "dangerouslySetInnerHTML") d = f; else if (!(u in y)) { if (u == "value" && "defaultValue" in y || u == "checked" && "defaultChecked" in y) continue; Mn(e, u, null, f, o); } } for (u in y) f = y[u], u == "children" ? g = f : u == "dangerouslySetInnerHTML" ? c = f : u == "value" ? m = f : u == "checked" ? h = f : s && typeof f != "function" || v[u] === f || Mn(e, u, f, v[u], o); if (c) s || d && (c.__html === d.__html || c.__html === e.innerHTML) || (e.innerHTML = c.__html), t.__k = []; else if (d && (e.innerHTML = ""), hl(e, Yn(g) ? g : [g], t, n, r, x == "foreignObject" ? "http://www.w3.org/1999/xhtml" : o, i, l, i ? i[0] : n.__k && zt(n, 0), s, a), i != null) for (u = i.length; u--; ) go(i[u]); s || (u = "value", x == "progress" && m == null ? e.removeAttribute("value") : m !== void 0 && (m !== e[u] || x == "progress" && !m || x == "option" && m !== v[u]) && Mn(e, u, m, v[u], o), u = "checked", h !== void 0 && h !== e[u] && Mn(e, u, h, v[u], o)); } return e; } function vo(e, t, n) { try { if (typeof e == "function") { var r = typeof e.__u == "function"; r && e.__u(), r && t == null || (e.__u = e(t)); } else e.current = t; } catch (o) { oe.__e(o, n); } } function wl(e, t, n) { var r, o; if (oe.unmount && oe.unmount(e), (r = e.ref) && (r.current && r.current !== e.__e || vo(r, null, t)), (r = e.__c) != null) { if (r.componentWillUnmount) try { r.componentWillUnmount(); } catch (i) { oe.__e(i, t); } r.base = r.__P = null; } if (r = e.__k) for (o = 0; o < r.length; o++) r[o] && wl(r[o], t, n || typeof e.type != "function"); n || go(e.__e), e.__c = e.__ = e.__e = void 0; } function Qa(e, t, n) { return this.constructor(e, n); } function fn(e, t, n) { var r, o, i, l; t == document && (t = document.documentElement), oe.__ && oe.__(e, t), o = (r = typeof n == "function") ? null : n && n.__k || t.__k, i = [], l = [], ho(t, e = (!r && n || t).__k = F(pe, null, [e]), o || dn, dn, t.namespaceURI, !r && n ? [n] : o ? null : t.firstChild ? _n.call(t.childNodes) : null, i, !r && n ? n : o ? o.__e : t.firstChild, r, l), _l(i, e, l); } function yl(e, t) { fn(e, t, yl); } function eu(e, t, n) { var r, o, i, l, s = ot({}, e.props); for (i in e.type && e.type.defaultProps && (l = e.type.defaultProps), t) i == "key" ? r = t[i] : i == "ref" ? o = t[i] : s[i] = t[i] === void 0 && l !== void 0 ? l[i] : t[i]; return arguments.length > 2 && (s.children = arguments.length > 3 ? _n.call(arguments, 2) : n), on(e.type, s, r || e.key, o || e.ref, null); } function me(e, t) { var n = { __c: t = "__cC" + pl++, __: e, Consumer: function(r, o) { return r.children(o); }, Provider: function(r) { var o, i; return this.getChildContext || (o = /* @__PURE__ */ new Set(), (i = {})[t] = this, this.getChildContext = function() { return i; }, this.componentWillUnmount = function() { o = null; }, this.shouldComponentUpdate = function(l) { this.props.value !== l.value && o.forEach(function(s) { s.__e = !0, Dr(s); }); }, this.sub = function(l) { o.add(l); var s = l.componentWillUnmount; l.componentWillUnmount = function() { o && o.delete(l), s && s.call(l); }; }), r.children; } }; return n.Provider.__ = n.Consumer.contextType = n; } _n = ml.slice, oe = { __e: function(e, t, n, r) { for (var o, i, l; t = t.__; ) if ((o = t.__c) && !o.__) try { if ((i = o.constructor) && i.getDerivedStateFromError != null && (o.setState(i.getDerivedStateFromError(e)), l = o.__d), o.componentDidCatch != null && (o.componentDidCatch(e, r || {}), l = o.__d), l) return o.__E = o; } catch (s) { e = s; } throw e; } }, cl = 0, Be.prototype.setState = function(e, t) { var n; n = this.__s != null && this.__s !== this.state ? this.__s : this.__s = ot({}, this.state), typeof e == "function" && (e = e(ot({}, n), this.props)), e && ot(n, e), e != null && this.__v && (t && this._sb.push(t), Dr(this)); }, Be.prototype.forceUpdate = function(e) { this.__v && (this.__e = !0, e && this.__h.push(e), Dr(this)); }, Be.prototype.render = pe, yt = [], dl = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, Nr = function(e, t) { return e.__v.__b - t.__v.__b; }, Hn.__r = 0, fl = /(PointerCapture)$|Capture$/i, mo = 0, kr = ri(!1), Ar = ri(!0), pl = 0; var st, fe, gr, oi, Bt = 0, bl = [], _e = oe, ii = _e.__b, li = _e.__r, si = _e.diffed, ai = _e.__c, ui = _e.unmount, ci = _e.__; function Tt(e, t) { _e.__h && _e.__h(fe, e, Bt || t), Bt = 0; var n = fe.__H || (fe.__H = { __: [], __h: [] }); return e >= n.__.length && n.__.push({}), n.__[e]; } function U(e) { return Bt = 1, at(xl, e); } function at(e, t, n) { var r = Tt(st++, 2); if (r.t = e, !r.__c && (r.__ = [n ? n(t) : xl(void 0, t), function(s) { var a = r.__N ? r.__N[0] : r.__[0], u = r.t(a, s); a !== u && (r.__N = [u, r.__[1]], r.__c.setState({})); }], r.__c = fe, !fe.u)) { var o = function(s, a, u) { if (!r.__c.__H) return !0; var c = r.__c.__H.__.filter(function(g) { return !!g.__c; }); if (c.every(function(g) { return !g.__N; })) return !i || i.call(this, s, a, u); var d = r.__c.props !== s; return c.forEach(function(g) { if (g.__N) { var f = g.__[0]; g.__ = g.__N, g.__N = void 0, f !== g.__[0] && (d = !0); } }), i && i.call(this, s, a, u) || d; }; fe.u = !0; var i = fe.shouldComponentUpdate, l = fe.componentWillUpdate; fe.componentWillUpdate = function(s, a, u) { if (this.__e) { var c = i; i = void 0, o(s, a, u), i = c; } l && l.call(this, s, a, u); }, fe.shouldComponentUpdate = o; } return r.__N || r.__; } function re(e, t) { var n = Tt(st++, 3); !_e.__s && yo(n.__H, t) && (n.__ = e, n.i = t, fe.__H.__h.push(n)); } function Je(e, t) { var n = Tt(st++, 4); !_e.__s && yo(n.__H, t) && (n.__ = e, n.i = t, fe.__h.push(n)); } function A(e) { return Bt = 5, W(function() { return { current: e }; }, []); } function _o(e, t, n) { Bt = 6, Je(function() { return typeof e == "function" ? (e(t()), function() { return e(null); }) : e ? (e.current = t(), function() { return e.current = null; }) : void 0; }, n == null ? n : n.concat(e)); } function W(e, t) { var n = Tt(st++, 7); return yo(n.__H, t) && (n.__ = e(), n.__H = t, n.__h = e), n.__; } function ie(e, t) { return Bt = 8, W(function() { return e; }, t); } function ae(e) { var t = fe.context[e.__c], n = Tt(st++, 9); return n.c = e, t ? (n.__ == null && (n.__ = !0, t.sub(fe)), t.props.value) : e.__; } function wo(e, t) { _e.useDebugValue && _e.useDebugValue(t ? t(e) : e); } function tu(e) { var t = Tt(st++, 10), n = U(); return t.__ = e, fe.componentDidCatch || (fe.componentDidCatch = function(r, o) { t.__ && t.__(r, o), n[1](r); }), [n[0], function() { n[1](void 0); }]; } function Oe() { var e = Tt(st++, 11); if (!e.__) { for (var t = fe.__v; t !== null && !t.__m && t.__ !== null; ) t = t.__; var n = t.__m || (t.__m = [0, 0]); e.__ = "P" + n[0] + "-" + n[1]++; } return e.__; } function nu() { for (var e; e = bl.shift(); ) if (e.__P && e.__H) try { e.__H.__h.forEach(An), e.__H.__h.forEach(Lr), e.__H.__h = []; } catch (t) { e.__H.__h = [], _e.__e(t, e.__v); } } _e.__b = function(e) { fe = null, ii && ii(e); }, _e.__ = function(e, t) { e && t.__k && t.__k.__m && (e.__m = t.__k.__m), ci && ci(e, t); }, _e.__r = function(e) { li && li(e), st = 0; var t = (fe = e.__c).__H; t && (gr === fe ? (t.__h = [], fe.__h = [], t.__.forEach(function(n) { n.__N && (n.__ = n.__N), n.i = n.__N = void 0; })) : (t.__h.forEach(An), t.__h.forEach(Lr), t.__h = [], st = 0)), gr = fe; }, _e.diffed = function(e) { si && si(e); var t = e.__c; t && t.__H && (t.__H.__h.length && (bl.push(t) !== 1 && oi === _e.requestAnimationFrame || ((oi = _e.requestAnimationFrame) || ru)(nu)), t.__H.__.forEach(function(n) { n.i && (n.__H = n.i), n.i = void 0; })), gr = fe = null; }, _e.__c = function(e, t) { t.some(function(n) { try { n.__h.forEach(An), n.__h = n.__h.filter(function(r) { return !r.__ || Lr(r); }); } catch (r) { t.some(function(o) { o.__h && (o.__h = []); }), t = [], _e.__e(r, n.__v); } }), ai && ai(e, t); }, _e.unmount = function(e) { ui && ui(e); var t, n = e.__c; n && n.__H && (n.__H.__.forEach(function(r) { try { An(r); } catch (o) { t = o; } }), n.__H = void 0, t && _e.__e(t, n.__v)); }; var di = typeof requestAnimationFrame == "function"; function ru(e) { var t, n = function() { clearTimeout(r), di && cancelAnimationFrame(t), setTimeout(e); }, r = setTimeout(n, 100); di && (t = requestAnimationFrame(n)); } function An(e) { var t = fe, n = e.__c; typeof n == "function" && (e.__c = void 0, n()), fe = t; } function Lr(e) { var t = fe; e.__c = e.__(), fe = t; } function yo(e, t) { return !e || e.length !== t.length || t.some(function(n, r) { return n !== e[r]; }); } function xl(e, t) { return typeof t == "function" ? t(e) : t; } function Sl(e, t) { for (var n in t) e[n] = t[n]; return e; } function Vr(e, t) { for (var n in e) if (n !== "__source" && !(n in t)) return !0; for (var r in t) if (r !== "__source" && e[r] !== t[r]) return !0; return !1; } function Zn(e, t) { var n = t(), r = U({ t: { __: n, u: t } }), o = r[0].t, i = r[1]; return Je(function() { o.__ = n, o.u = t, hr(o) && i({ t: o }); }, [e, n, t]), re(function() { return hr(o) && i({ t: o }), e(function() { hr(o) && i({ t: o }); }); }, [e]), n; } function hr(e) { var t, n, r = e.u, o = e.__; try { var i = r(); return !((t = o) === (n = i) && (t !== 0 || 1 / t == 1 / n) || t != t && n != n); } catch { return !0; } } function bo(e) { e(); } function xo(e) { return e; } function So() { return [!1, bo]; } var Co = Je; function zn(e, t) { this.props = e, this.context = t; } function Cl(e, t) { function n(o) { var i = this.props.ref, l = i == o.ref; return !l && i && (i.call ? i(null) : i.current = null), t ? !t(this.props, o) || !l : Vr(this.props, o); } function r(o) { return this.shouldComponentUpdate = n, F(e, o); } return r.displayName = "Memo(" + (e.displayName || e.name) + ")", r.prototype.isReactComponent = !0, r.__f = !0, r; } (zn.prototype = new Be()).isPureReactComponent = !0, zn.prototype.shouldComponentUpdate = function(e, t) { return Vr(this.props, e) || Vr(this.state, t); }; var fi = oe.__b; oe.__b = function(e) { e.type && e.type.__f && e.ref && (e.props.ref = e.ref, e.ref = null), fi && fi(e); }; var ou = typeof Symbol < "u" && Symbol.for && Symbol.for("react.forward_ref") || 3911; function de(e) { function t(n) { var r = Sl({}, n); return delete r.ref, e(r, n.ref || null); } return t.$$typeof = ou, t.render = t, t.prototype.isReactComponent = t.__f = !0, t.displayName = "ForwardRef(" + (e.displayName || e.name) + ")", t; } var pi = function(e, t) { return e == null ? null : it(it(e).map(t)); }, El = { map: pi, forEach: pi, count: function(e) { return e ? it(e).length : 0; }, only: function(e) { var t = it(e); if (t.length !== 1) throw "Children.only"; return t[0]; }, toArray: it }, iu = oe.__e; oe.__e = function(e, t, n, r) { if (e.then) { for (var o, i = t; i = i.__; ) if ((o = i.__c) && o.__c) return t.__e == null && (t.__e = n.__e, t.__k = n.__k), o.__c(e, t); } iu(e, t, n, r); }; var mi = oe.unmount; function Rl(e, t, n) { return e && (e.__c && e.__c.__H && (e.__c.__H.__.forEach(function(r) { typeof r.__c == "function" && r.__c(); }), e.__c.__H = null), (e = Sl({}, e)).__c != null && (e.__c.__P === n && (e.__c.__P = t), e.__c = null), e.__k = e.__k && e.__k.map(function(r) { return Rl(r, t, n); })), e; } function $l(e, t, n) { return e && n && (e.__v = null, e.__k = e.__k && e.__k.map(function(r) { return $l(r, t, n); }), e.__c && e.__c.__P === t && (e.__e && n.appendChild(e.__e), e.__c.__e = !0, e.__c.__P = n)), e; } function ln() { this.__u = 0, this.o = null, this.__b = null; } function Tl(e) { var t = e.__.__c; return t && t.__a && t.__a(e); } function Il(e) { var t, n, r; function o(i) { if (t || (t = e()).then(function(l) { n = l.default || l; }, function(l) { r = l; }), r) throw r; if (!n) throw t; return F(n, i); } return o.displayName = "Lazy", o.__f = !0, o; } function At() { this.i = null, this.l = null; } oe.unmount = function(e) { var t = e.__c; t && t.__R && t.__R(), t && 32 & e.__u && (e.type = null), mi && mi(e); }, (ln.prototype = new Be()).__c = function(e, t) { var n = t.__c, r = this; r.o == null && (r.o = []), r.o.push(n); var o = Tl(r.__v), i = !1, l = function() { i || (i = !0, n.__R = null, o ? o(s) : s()); }; n.__R = l; var s = function() { if (!--r.__u) { if (r.state.__a) { var a = r.state.__a; r.__v.__k[0] = $l(a, a.__c.__P, a.__c.__O); } var u; for (r.setState({ __a: r.__b = null }); u = r.o.pop(); ) u.forceUpdate(); } }; r.__u++ || 32 & t.__u || r.setState({ __a: r.__b = r.__v.__k[0] }), e.then(l, l); }, ln.prototype.componentWillUnmount = function() { this.o = []; }, ln.prototype.render = function(e, t) { if (this.__b) { if (this.__v.__k) { var n = document.createElement("div"), r = this.__v.__k[0].__c; this.__v.__k[0] = Rl(this.__b, n, r.__O = r.__P); } this.__b = null; } var o = t.__a && F(pe, null, e.fallback); return o && (o.__u &= -33), [F(pe, null, t.__a ? null : e.children), o]; }; var gi = function(e, t, n) { if (++n[1] === n[0] && e.l.delete(t), e.props.revealOrder && (e.props.revealOrder[0] !== "t" || !e.l.size)) for (n = e.i; n; ) { for (; n.length > 3; ) n.pop()(); if (n[1] < n[0]) break; e.i = n = n[2]; } }; function lu(e) { return this.getChildContext = function() { return e.context; }, e.children; } function su(e) { var t = this, n = e.h; t.componentWillUnmount = function() { fn(null, t.v), t.v = null, t.h = null; }, t.h && t.h !== n && t.componentWillUnmount(), t.v || (t.h = n, t.v = { nodeType: 1, parentNode: n, childNodes: [], contains: function() { return !0; }, appendChild: function(r) { this.childNodes.push(r), t.h.appendChild(r); }, insertBefore: function(r, o) { this.childNodes.push(r), t.h.insertBefore(r, o); }, removeChild: function(r) { this.childNodes.splice(this.childNodes.indexOf(r) >>> 1, 1), t.h.removeChild(r); } }), fn(F(lu, { context: t.context }, e.__v), t.v); } function wn(e, t) { var n = F(su, { __v: e, h: t }); return n.containerInfo = t, n; } (At.prototype = new Be()).__a = function(e) { var t = this, n = Tl(t.__v), r = t.l.get(e); return r[0]++, function(o) { var i = function() { t.props.revealOrder ? (r.push(o), gi(t, e, r)) : o(); }; n ? n(i) : i(); }; }, At.prototype.render = function(e) { this.i = null, this.l = /* @__PURE__ */ new Map(); var t = it(e.children); e.revealOrder && e.revealOrder[0] === "b" && t.reverse(); for (var n = t.length; n--; ) this.l.set(t[n], this.i = [1, 0, this.i]); return e.children; }, At.prototype.componentDidUpdate = At.prototype.componentDidMount = function() { var e = this; this.l.forEach(function(t, n) { gi(e, n, t); }); }; var Ml = typeof Symbol < "u" && Symbol.for && Symbol.for("react.element") || 60103, au = /^(?: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]/, uu = /^on(Ani|Tra|Tou|BeforeInp|Compo)/, cu = /[A-Z0-9]/g, du = typeof document < "u", fu = function(e) { return (typeof Symbol < "u" && typeof Symbol() == "symbol" ? /fil|che|rad/ : /fil|che|ra/).test(e); }; function Eo(e, t, n) { return t.__k == null && (t.textContent = ""), fn(e, t), typeof n == "function" && n(), e ? e.__c : null; } function Ol(e, t, n) { return yl(e, t), typeof n == "function" && n(), e ? e.__c : null; } Be.prototype.isReactComponent = {}, ["componentWillMount", "componentWillReceiveProps", "componentWillUpdate"].forEach(function(e) { Object.defineProperty(Be.prototype, e, { configurable: !0, get: function() { return this["UNSAFE_" + e]; }, set: function(t) { Object.defineProperty(this, e, { configurable: !0, writable: !0, value: t }); } }); }); var hi = oe.event; function pu() { } function mu() { return this.cancelBubble; } function gu() { return this.defaultPrevented; } oe.event = function(e) { return hi && (e = hi(e)), e.persist = pu, e.isPropagationStopped = mu, e.isDefaultPrevented = gu, e.nativeEvent = e; }; var Ro, hu = { enumerable: !1, configurable: !0, get: function() { return this.class; } }, vi = oe.vnode; oe.vnode = function(e) { typeof e.type == "string" && function(t) { var n = t.props, r = t.type, o = {}, i = r.indexOf("-") === -1; for (var l in n) { var s = n[l]; if (!(l === "value" && "defaultValue" in n && s == null || du && l === "children" && r === "noscript" || l === "class" || l === "className")) { var a = l.toLowerCase(); l === "defaultValue" && "value" in n && n.value == null ? l = "value" : l === "download" && s === !0 ? s = "" : a === "translate" && s === "no" ? s = !1 : a[0] === "o" && a[1] === "n" ? a === "ondoubleclick" ? l = "ondblclick" : a !== "onchange" || r !== "input" && r !== "textarea" || fu(n.type) ? a === "onfocus" ? l = "onfocusin" : a === "onblur" ? l = "onfocusout" : uu.test(l) && (l = a) : a = l = "oninput" : i && au.test(l) ? l = l.replace(cu, "-$&").toLowerCase() : s === null && (s = void 0), a === "oninput" && o[l = a] && (l = "oninputCapture"), o[l] = s; } } r == "select" && o.multiple && Array.isArray(o.value) && (o.value = it(n.children).forEach(function(u) { u.props.selected = o.value.indexOf(u.props.value) != -1; })), r == "select" && o.defaultValue != null && (o.value = it(n.children).forEach(function(u) { u.props.selected = o.multiple ? o.defaultValue.indexOf(u.props.value) != -1 : o.defaultValue == u.props.value; })), n.class && !n.className ? (o.class = n.class, Object.defineProperty(o, "className", hu)) : (n.className && !n.class || n.class && n.className) && (o.class = o.className = n.className), t.props = o; }(e), e.$$typeof = Ml, vi && vi(e); }; var _i = oe.__r; oe.__r = function(e) { _i && _i(e), Ro = e.__c; }; var wi = oe.diffed; oe.diffed = function(e) { wi && wi(e); var t = e.props, n = e.__e; n != null && e.type === "textarea" && "value" in t && t.value !== n.value && (n.value = t.value == null ? "" : t.value), Ro = null; }; var Fl = { ReactCurrentDispatcher: { current: { readContext: function(e) { return Ro.__n[e.__c].props.value; }, useCallback: ie, useContext: ae, useDebugValue: wo, useDeferredValue: xo, useEffect: re, useId: Oe, useImperativeHandle: _o, useInsertionEffect: Co, useLayoutEffect: Je, useMemo: W, useReducer: at, useRef: A, useState: U, useSyncExternalStore: Zn, useTransition: So } } }, vu = "18.3.1"; function Pl(e) { return F.bind(null, e); } function Gt(e) { return !!e && e.$$typeof === Ml; } function Nl(e) { return Gt(e) && e.type === pe; } function kl(e) { return !!e && !!e.displayName && (typeof e.displayName == "string" || e.displayName instanceof String) && e.displayName.startsWith("Memo("); } function $o(e) { return Gt(e) ? eu.apply(null, arguments) : e; } function To(e) { return !!e.__k && (fn(null, e), !0); } function Al(e) { return e && (e.base || e.nodeType === 1 && e) || null; } var Dl = function(e, t) { return e(t); }, De = function(e, t) { return e(t); }, Ll = pe, Vl = Gt, D = { useState: U, useId: Oe, useReducer: at, useEffect: re, useLayoutEffect: Je, useInsertionEffect: Co, useTransition: So, useDeferredValue: xo, useSyncExternalStore: Zn, startTransition: bo, useRef: A, useImperativeHandle: _o, useMemo: W, useCallback: ie, useContext: ae, useDebugValue: wo, version: "18.3.1", Children: El, render: Eo, hydrate: Ol, unmountComponentAtNode: To, createPortal: wn, createElement: F, createContext: me, createFactory: Pl, cloneElement: $o, createRef: Xn, Fragment: pe, isValidElement: Gt, isElement: Vl, isFragment: Nl, isMemo: kl, findDOMNode: Al, Component: Be, PureComponent: zn, memo: Cl, forwardRef: de, flushSync: De, unstable_batchedUpdates: Dl, StrictMode: Ll, Suspense: ln, SuspenseList: At, lazy: Il, __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: Fl }; const Hr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, Children: El, Component: Be, Fragment: pe, PureComponent: zn, StrictMode: Ll, Suspense: ln, SuspenseList: At, __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: Fl, cloneElement: $o, createContext: me, createElement: F, createFactory: Pl, createPortal: wn, createRef: Xn, default: D, findDOMNode: Al, flushSync: De, forwardRef: de, hydrate: Ol, isElement: Vl, isFragment: Nl, isMemo: kl, isValidElement: Gt, lazy: Il, memo: Cl, render: Eo, startTransition: bo, unmountComponentAtNode: To, unstable_batchedUpdates: Dl, useCallback: ie, useContext: ae, useDebugValue: wo, useDeferredValue: xo, useEffect: re, useErrorBoundary: tu, useId: Oe, useImperativeHandle: _o, useInsertionEffect: Co, useLayoutEffect: Je, useMemo: W, useReducer: at, useRef: A, useState: U, useSyncExternalStore: Zn, useTransition: So, version: vu }, Symbol.toStringTag, { value: "Module" })); function _u(e) { return { // eslint-disable-next-line render: function(t) { Eo(t, e); }, // eslint-disable-next-line unmount: function() { To(e); } }; } var wu = 0; function p(e, t, n, r, o, i) { t || (t = {}); var l, s, a = t; if ("ref" in a) for (s in a = {}, t) s == "ref" ? l = t[s] : a[s] = t[s]; var u = { type: e, props: a, key: n, ref: l, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: --wu, __i: -1, __u: 0, __source: o, __self: i }; if (typeof e == "function" && (l = e.defaultProps)) for (s in l) a[s] === void 0 && (a[s] = l[s]); return oe.vnode && oe.vnode(u), u; } function Hl(e) { var t, n, r = ""; if (typeof e == "string" || typeof e == "number") r += e; else if (typeof e == "object") if (Array.isArray(e)) { var o = e.length; for (t = 0; t < o; t++) e[t] && (n = Hl(e[t])) && (r && (r += " "), r += n); } else for (n in e) e[n] && (r && (r += " "), r += n); return r; } function yu() { for (var e, t, n = 0, r = "", o = arguments.length; n < o; n++) (e = arguments[n]) && (t = Hl(e)) && (r && (r += " "), r += t); return r; } const yi = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, bi = yu, It = (e, t) => (n) => { var r; if ((t == null ? void 0 : t.variants) == null) return bi(e, n == null ? void 0 : n.class, n == null ? void 0 : n.className); const { variants: o, defaultVariants: i } = t, l = Object.keys(o).map((u) => { const c = n == null ? void 0 : n[u], d = i == null ? void 0 : i[u]; if (c === null) return null; const g = yi(c) || yi(d); return o[u][g]; }), s = n && Object.entries(n).reduce((u, c) => { let [d, g] = c; return g === void 0 || (u[d] = g), u; }, {}), a = t == null || (r = t.compoundVariants) === null || r === void 0 ? void 0 : r.reduce((u, c) => { let { class: d, className: g, ...f } = c; return Object.entries(f).every((m) => { let [h, v] = m; return Array.isArray(v) ? v.includes({ ...i, ...s }[h]) : { ...i, ...s }[h] === v; }) ? [ ...u, d, g ] : u; }, []); return bi(e, l, a, n == null ? void 0 : n.class, n == null ? void 0 : n.className); }, bu = It( "text-center inline-block font-semibold px-3 py-2 rounded-md text-sm", { variants: { variant: { primary: "shadow-xs bg-hello-csv-primary text-white", secondary: "bg-white text-hello-csv-primary ring-1 shadow-xs ring-bg-hello-csv-primary ring-inset", tertiary: "bg-white text-gray-900 ring-1 shadow-xs ring-hello-csv-tertiary ring-inset", success: "shadow-xs bg-hello-csv-success text-white", danger: "shadow-xs bg-hello-csv-danger text-white" }, withFullWidth: { true: "w-full", false: "" }, disabled: { true: "opacity-50 cursor-not-allowed pointer-events-none", false: "cursor-pointer" } }, compoundVariants: [ { variant: "primary", disabled: !1, className: "hover:bg-hello-csv-primary-light focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-hello-csv-primary" }, { variant: "secondary", disabled: !1, className: "hover:opacity-80 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-hello-csv-secondary" }, { variant: "tertiary", disabled: !1, className: "hover:bg-hello-csv-tertiary-light" }, { variant: "success", disabled: !1, className: "hover:opacity-80 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-hello-csv-success" }, { variant: "danger", disabled: !1, className: "hover:bg-hello-csv-danger-light focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-hello-csv-danger" } ], defaultVariants: { withFullWidth: !1, variant: "primary", disabled: !1 } } ); function He({ children: e, variant: t, disabled: n, onClick: r, withFullWidth: o }) { const i = bu({ variant: t, disabled: n, withFullWidth: o }); return /* @__PURE__ */ p( "div", { role: "button", tabIndex: 0, className: i, onClick: r, "aria-disabled": n, children: e } ); } const xu = It("overflow-hidden rounded-md border border-gray-200", { variants: { variant: { default: "bg-white", muted: "bg-hello-csv-muted" }, withPadding: { true: "px-4 py-5 sm:p-6", false: "" } }, defaultVariants: { variant: "default", withPadding: !0 } }), zl = de( ({ children: e, className: t, variant: n, withPadding: r = !0 }, o) => { const i = xu({ variant: n, withPadding: r }); return /* @__PURE__ */ p("div", { ref: o, className: `${i} ${t}`, children: e }); } ); function Bl({ checked: e, setChecked: t, label: n }) { const r = Oe(); return /* @__PURE__ */ p("div", { className: "flex gap-3", children: [ /* @__PURE__ */ p("div", { className: "flex h-6 shrink-0 items-center", children: /* @__PURE__ */ p("div", { className: "group grid size-4 grid-cols-1", children: [ /* @__PURE__ */ p( "input", { checked: e, onChange: (o) => t(o.target.checked), id: r, type: "checkbox", className: "checked:border-hello-csv-primary checked:bg-hello-csv-primary indeterminate:border-hello-csv-primary indeterminate:bg-hello-csv-primary focus-visible:outline-hello-csv-hello-csv-primary col-start-1 row-start-1 appearance-none rounded-sm border border-gray-300 bg-white focus-visible:outline-2 focus-visible:outline-offset-2 disabled:border-gray-300 disabled:bg-gray-100 disabled:checked:bg-gray-100 forced-colors:appearance-auto" } ), /* @__PURE__ */ p( "svg", { fill: "none", viewBox: "0 0 14 14", className: "pointer-events-none col-start-1 row-start-1 size-3.5 self-center justify-self-center stroke-white group-has-disabled:stroke-gray-950/25", children: [ /* @__PURE__ */ p( "path", { d: "M3 8L6 11L11 3.5", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", className: "opacity-0 group-has-checked:opacity-100" } ), /* @__PURE__ */ p( "path", { d: "M3 7H11", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", className: "opacity-0 group-has-indeterminate:opacity-100" } ) ] } ) ] }) }), n && /* @__PURE__ */ p("div", { className: "text-sm/6", children: /* @__PURE__ */ p("label", { htmlFor: r, className: "font-medium text-gray-900", children: n }) }) ] }); } let Su = !1; function Io() { return Su; } const jl = typeof document < "u" ? D.useLayoutEffect : () => { }; function Cu(e) { const t = A(null); return jl(() => { t.current = e; }, [ e ]), ie((...n) => { const r = t.current; return r == null ? void 0 : r(...n); }, []); } const vt = (e) => { var t; return (t = e == null ? void 0 : e.ownerDocument) !== null && t !== void 0 ? t : document; }, xt = (e) => e && "window" in e && e.window === e ? e : vt(e).defaultView || window; function Eu(e) { return e !== null && typeof e == "object" && "nodeType" in e && typeof e.nodeType == "number"; } function Ru(e) { return Eu(e) && e.nodeType === Node.DOCUMENT_FRAGMENT_NODE && "host" in e; } function Ul(e, t) { if (!Io()) return t && e ? e.contains(t) : !1; if (!e || !t) return !1; let n = t; for (; n !== null; ) { if (n === e) return !0; n.tagName === "SLOT" && n.assignedSlot ? n = n.assignedSlot.parentNode : Ru(n) ? n = n.host : n = n.parentNode; } return !1; } const zr = (e = document) => { var t; if (!Io()) return e.activeElement; let n = e.activeElement; for (; n && "shadowRoot" in n && (!((t = n.shadowRoot) === null || t === void 0) && t.activeElement); ) n = n.shadowRoot.activeElement; return n; }; function Wl(e) { return Io() && e.target.shadowRoot && e.composedPath ? e.composedPath()[0] : e.target; } function $u(e) { var t; return typeof window > "u" || window.navigator == null ? !1 : ((t = window.navigator.userAgentData) === null || t === void 0 ? void 0 : t.brands.some((n) => e.test(n.brand))) || e.test(window.navigator.userAgent); } function Tu(e) { var t; return typeof window < "u" && window.navigator != null ? e.test(((t = window.navigator.userAgentData) === null || t === void 0 ? void 0 : t.platform) || window.navigator.platform) : !1; } function Gl(e) { let t = null; return () => (t == null && (t = e()), t); } const Iu = Gl(function() { return Tu(/^Mac/i); }), Mu = Gl(function() { return $u(/Android/i); }); function ql() { let e = A(/* @__PURE__ */ new Map()), t = ie((o, i, l, s) => { let a = s != null && s.once ? (...u) => { e.current.delete(l), l(...u); } : l; e.current.set(l, { type: i, eventTarget: o, fn: a, options: s }), o.addEventListener(i, a, s); }, []), n = ie((o, i, l, s) => { var a; let u = ((a = e.current.get(l)) === null || a === void 0 ? void 0 : a.fn) || l; o.removeEventListener(i, u, s), e.current.delete(l); }, []), r = ie(() => { e.current.forEach((o, i) => { n(o.eventTarget, o.type, i, o.options); }); }, [ n ]); return re(() => r, [ r ]), { addGlobalListener: t, removeGlobalListener: n, removeAllGlobalListeners: r }; } function Ou(e) { return e.mozInputSource === 0 && e.isTrusted ? !0 : Mu() && e.pointerType ? e.type === "click" && e.buttons === 1 : e.detail === 0 && !e.pointerType; } function Kl(e) { let t = e; return t.nativeEvent = e, t.isDefaultPrevented = () => t.defaultPrevented, t.isPropagationStopped = () => t.cancelBubble, t.persist = () => { }, t; } function Fu(e, t) { Object.defineProperty(e, "target", { value: t }), Object.defineProperty(e, "currentTarget", { value: t }); } function Yl(e) { let t = A({ isFocused: !1, observer: null }); jl(() => { const r = t.current; return () => { r.observer && (r.observer.disconnect(), r.observer = null); }; }, []); let n = Cu((r) => { e == null || e(r); }); return ie((r) => { if (r.target instanceof HTMLButtonElement || r.target instanceof HTMLInputElement || r.target instanceof HTMLTextAreaElement || r.target instanceof HTMLSelectElement) { t.current.isFocused = !0; let o = r.target, i = (l) => { if (t.current.isFocused = !1, o.disabled) { let s = Kl(l); n(s); } t.current.observer && (t.current.observer.disconnect(), t.current.observer = null); }; o.addEventListener("focusout", i, { once: !0 }), t.current.observer = new MutationObserver(() => { if (t.current.isFocused && o.disabled) { var l; (l = t.current.observer) === null || l === void 0 || l.disconnect(); let s = o === document.activeElement ? null : document.activeElement; o.dispatchEvent(new FocusEvent("blur", { relatedTarget: s })), o.dispatchEvent(new FocusEvent("focusout", { bubbles: !0, relatedTarget: s })); } }), t.current.observer.observe(o, { attributes: !0, attributeFilter: [ "disabled" ] }); } }, [ n ]); } let Pu = !1, yn = null, Br = /* @__PURE__ */ new Set(), sn = /* @__PURE__ */ new Map(), Et = !1, jr = !1; const Nu = { Tab: !0, Escape: !0 }; function Mo(e, t) { for (let n of Br) n(e, t); } function ku(e) { return !(e.metaKey || !Iu() && e.altKey || e.ctrlKey || e.key === "Control" || e.key === "Shift" || e.key === "Meta"); } function Bn(e) { Et = !0, ku(e) && (yn = "keyboard", Mo("keyboard", e)); } function Lt(e) { yn = "pointer", (e.type === "mousedown" || e.type === "pointerdown") && (Et = !0, Mo("pointer", e)); } function Xl(e) { Ou(e) && (Et = !0, yn = "virtual"); } function Zl(e) { e.target === window || e.target === document || Pu || !e.isTrusted || (!Et && !jr && (yn = "virtual", Mo("virtual", e)), Et = !1, jr = !1); } function Jl() { Et = !1, jr = !0; } function Ur(e) { if (typeof window > "u" || sn.get(xt(e))) return; const t = xt(e), n = vt(e); let r = t.HTMLElement.prototype.focus; t.HTMLElement.prototype.focus = function() { Et = !0, r.apply(this, arguments); }, n.addEventListener("keydown", Bn, !0), n.addEventListener("keyup", Bn, !0), n.addEventListener("click", Xl, !0), t.addEventListener("focus", Zl, !0), t.addEventListener("blur", Jl, !1), typeof PointerEvent < "u" && (n.addEventListener("pointerdown", Lt, !0), n.addEventListener("pointermove", Lt, !0), n.addEventListener("pointerup", Lt, !0)), t.addEventListener("beforeunload", () => { Ql(e); }, { once: !0 }), sn.set(t, { focus: r }); } const Ql = (e, t) => { const n = xt(e), r = vt(e); t && r.removeEventListener("DOMContentLoaded", t), sn.has(n) && (n.HTMLElement.prototype.focus = sn.get(n).focus, r.removeEventListener("keydown", Bn, !0), r.removeEventListener("keyup", Bn, !0), r.removeEventListener("click", Xl, !0), n.removeEventListener("focus", Zl, !0), n.removeEventListener("blur", Jl, !1), typeof PointerEvent < "u" && (r.removeEventListener("pointerdown", Lt, !0), r.removeEventListener("pointermove", Lt, !0), r.removeEventListener("pointerup", Lt, !0)), sn.delete(n)); }; function Au(e) { const t = vt(e); let n; return t.readyState !== "loading" ? Ur(e) : (n = () => { Ur(e); }, t.addEventListener("DOMContentLoaded", n)), () => Ql(e, n); } typeof document < "u" && Au(); function es() { return yn !== "pointer"; } const Du = /* @__PURE__ */ new Set([ "checkbox", "radio", "range", "color", "file", "image", "button", "submit", "reset" ]); function Lu(e, t, n) { let r = vt(n == null ? void 0 : n.target); const o = typeof window < "u" ? xt(n == null ? void 0 : n.target).HTMLInputElement : HTMLInputElement, i = typeof window < "u" ? xt(n == null ? void 0 : n.target).HTMLTextAreaElement : HTMLTextAreaElement, l = typeof window < "u" ? xt(n == null ? void 0 : n.target).HTMLElement : HTMLElement, s = typeof window < "u" ? xt(n == null ? void 0 : n.target).KeyboardEvent : KeyboardEvent; return e = e || r.activeElement instanceof o && !Du.has(r.activeElement.type) || r.activeElement instanceof i || r.activeElement instanceof l && r.activeElement.isContentEditable, !(e && t === "keyboard" && n instanceof s && !Nu[n.key]); } function Vu(e, t, n) { Ur(), re(() => { let r = (o, i) => { Lu(!!(n != null && n.isTextInput), o, i) && e(es()); }; return Br.add(r), () => { Br.delete(r); }; }, t); } function Hu(e) { let { isDisabled: t, onFocus: n, onBlur: r, onFocusChange: o } = e; const i = ie((a) => { if (a.target === a.currentTarget) return r && r(a), o && o(!1), !0; }, [ r, o ]), l = Yl(i), s = ie((a) => { const u = vt(a.target), c = u ? zr(u) : zr(); a.target === a.currentTarget && c === Wl(a.nativeEvent) && (n && n(a), o && o(!0), l(a)); }, [ o, n, l ]); return { focusProps: { onFocus: !t && (n || o || r) ? s : void 0, onBlur: !t && (r || o) ? i : void 0 } }; } function zu(e) { let { isDisabled: t, onBlurWithin: n, onFocusWithin: r, onFocusWithinChange: o } = e, i = A({ isFocusWithin: !1 }), { addGlobalListener: l, removeAllGlobalListeners: s } = ql(), a = ie((d) => { d.currentTarget.contains(d.target) && i.current.isFocusWithin && !d.currentTarget.contains(d.relatedTarget) && (i.current.isFocusWithin = !1, s(), n && n(d), o && o(!1)); }, [ n, o, i, s ]), u = Yl(a), c = ie((d) => { if (!d.currentTarget.contains(d.target)) return; const g = vt(d.target), f = zr(g); if (!i.current.isFocusWithin && f === Wl(d.nativeEvent)) { r && r(d), o && o(!0), i.current.isFocusWithin = !0, u(d); let m = d.currentTarget; l(g, "focus", (h) => { if (i.current.isFocusWithin && !Ul(m, h.target)) { let v = new g.defaultView.FocusEvent("blur", { relatedTarget: h.target }); Fu(v, m); let y = Kl(v); a(y); } }, { capture: !0 }); } }, [ r, o, u, l, a ]); return t ? { focusWithinProps: { // These cannot be null, that would conflict in mergeProps onFocus: void 0, onBlur: void 0 } } : { focusWithinProps: { onFocus: c, onBlur: a } }; } let Wr = !1, vr = 0; function Bu() { Wr = !0, setTimeout(() => { Wr = !1; }, 50); } function xi(e) { e.pointerType === "touch" && Bu(); } function ju() { if (!(typeof document > "u")) return typeof PointerEvent < "u" && document.addEventListener("pointerup", xi), vr++, () => { vr--, !(vr > 0) && typeof PointerEvent < "u" && document.