Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

simple-search-dropdown

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

simple-search-dropdown - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

dist/components/SearchSelect.d.ts

3

dist/index.d.ts

@@ -1,1 +0,2 @@

export { }
import { default as SearchSelect } from './components/SearchSelect';
export { SearchSelect };

@@ -1,663 +0,35 @@

import * as v from "react";
import _e, { useState as J, useRef as Ge, useEffect as Ke } from "react";
var we = { exports: {} }, ee = {};
/**
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var qe;
function Br() {
if (qe) return ee;
qe = 1;
var r = _e, t = Symbol.for("react.element"), o = Symbol.for("react.fragment"), a = Object.prototype.hasOwnProperty, c = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, f = { key: !0, ref: !0, __self: !0, __source: !0 };
function d(l, y, C) {
var g, R = {}, P = null, O = null;
C !== void 0 && (P = "" + C), y.key !== void 0 && (P = "" + y.key), y.ref !== void 0 && (O = y.ref);
for (g in y) a.call(y, g) && !f.hasOwnProperty(g) && (R[g] = y[g]);
if (l && l.defaultProps) for (g in y = l.defaultProps, y) R[g] === void 0 && (R[g] = y[g]);
return { $$typeof: t, type: l, key: P, ref: O, props: R, _owner: c.current };
}
return ee.Fragment = o, ee.jsx = d, ee.jsxs = d, ee;
}
var re = {};
/**
* @license React
* react-jsx-runtime.development.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var Ze;
function Vr() {
return Ze || (Ze = 1, process.env.NODE_ENV !== "production" && function() {
var r = _e, t = Symbol.for("react.element"), o = Symbol.for("react.portal"), a = Symbol.for("react.fragment"), c = Symbol.for("react.strict_mode"), f = Symbol.for("react.profiler"), d = Symbol.for("react.provider"), l = Symbol.for("react.context"), y = Symbol.for("react.forward_ref"), C = Symbol.for("react.suspense"), g = Symbol.for("react.suspense_list"), R = Symbol.for("react.memo"), P = Symbol.for("react.lazy"), O = Symbol.for("react.offscreen"), A = Symbol.iterator, u = "@@iterator";
function m(e) {
if (e === null || typeof e != "object")
return null;
var n = A && e[A] || e[u];
return typeof n == "function" ? n : null;
import { jsxs as ne, jsx as B } from "react/jsx-runtime";
import * as l from "react";
import ae, { useState as x, useRef as H, useEffect as z } from "react";
var C = function() {
return C = Object.assign || function(t) {
for (var n, r = 1, o = arguments.length; r < o; r++) {
n = arguments[r];
for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (t[i] = n[i]);
}
var T = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
function E(e) {
{
for (var n = arguments.length, i = new Array(n > 1 ? n - 1 : 0), s = 1; s < n; s++)
i[s - 1] = arguments[s];
D("error", e, i);
}
}
function D(e, n, i) {
{
var s = T.ReactDebugCurrentFrame, b = s.getStackAddendum();
b !== "" && (n += "%s", i = i.concat([b]));
var S = i.map(function(p) {
return String(p);
});
S.unshift("Warning: " + n), Function.prototype.apply.call(console[e], console, S);
}
}
var F = !1, k = !1, M = !1, N = !1, V = !1, K;
K = Symbol.for("react.module.reference");
function dr(e) {
return !!(typeof e == "string" || typeof e == "function" || e === a || e === f || V || e === c || e === C || e === g || N || e === O || F || k || M || typeof e == "object" && e !== null && (e.$$typeof === P || e.$$typeof === R || e.$$typeof === d || e.$$typeof === l || e.$$typeof === y || // This needs to include all possible module reference object
// types supported by any Flight configuration anywhere since
// we don't know which Flight build this will end up being used
// with.
e.$$typeof === K || e.getModuleId !== void 0));
}
function vr(e, n, i) {
var s = e.displayName;
if (s)
return s;
var b = n.displayName || n.name || "";
return b !== "" ? i + "(" + b + ")" : i;
}
function Te(e) {
return e.displayName || "Context";
}
function L(e) {
if (e == null)
return null;
if (typeof e.tag == "number" && E("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
return e.displayName || e.name || null;
if (typeof e == "string")
return e;
switch (e) {
case a:
return "Fragment";
case o:
return "Portal";
case f:
return "Profiler";
case c:
return "StrictMode";
case C:
return "Suspense";
case g:
return "SuspenseList";
}
if (typeof e == "object")
switch (e.$$typeof) {
case l:
var n = e;
return Te(n) + ".Consumer";
case d:
var i = e;
return Te(i._context) + ".Provider";
case y:
return vr(e, e.render, "ForwardRef");
case R:
var s = e.displayName || null;
return s !== null ? s : L(e.type) || "Memo";
case P: {
var b = e, S = b._payload, p = b._init;
try {
return L(p(S));
} catch {
return null;
}
}
}
return null;
}
var Y = Object.assign, q = 0, Pe, ke, Oe, xe, je, Ae, De;
function Ie() {
}
Ie.__reactDisabledLog = !0;
function hr() {
{
if (q === 0) {
Pe = console.log, ke = console.info, Oe = console.warn, xe = console.error, je = console.group, Ae = console.groupCollapsed, De = console.groupEnd;
var e = {
configurable: !0,
enumerable: !0,
value: Ie,
writable: !0
};
Object.defineProperties(console, {
info: e,
log: e,
warn: e,
error: e,
group: e,
groupCollapsed: e,
groupEnd: e
});
}
q++;
}
}
function gr() {
{
if (q--, q === 0) {
var e = {
configurable: !0,
enumerable: !0,
writable: !0
};
Object.defineProperties(console, {
log: Y({}, e, {
value: Pe
}),
info: Y({}, e, {
value: ke
}),
warn: Y({}, e, {
value: Oe
}),
error: Y({}, e, {
value: xe
}),
group: Y({}, e, {
value: je
}),
groupCollapsed: Y({}, e, {
value: Ae
}),
groupEnd: Y({}, e, {
value: De
})
});
}
q < 0 && E("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
}
}
var fe = T.ReactCurrentDispatcher, de;
function te(e, n, i) {
{
if (de === void 0)
try {
throw Error();
} catch (b) {
var s = b.stack.trim().match(/\n( *(at )?)/);
de = s && s[1] || "";
}
return `
` + de + e;
}
}
var ve = !1, ne;
{
var mr = typeof WeakMap == "function" ? WeakMap : Map;
ne = new mr();
}
function Fe(e, n) {
if (!e || ve)
return "";
{
var i = ne.get(e);
if (i !== void 0)
return i;
}
var s;
ve = !0;
var b = Error.prepareStackTrace;
Error.prepareStackTrace = void 0;
var S;
S = fe.current, fe.current = null, hr();
try {
if (n) {
var p = function() {
throw Error();
};
if (Object.defineProperty(p.prototype, "props", {
set: function() {
throw Error();
}
}), typeof Reflect == "object" && Reflect.construct) {
try {
Reflect.construct(p, []);
} catch (j) {
s = j;
}
Reflect.construct(e, [], p);
} else {
try {
p.call();
} catch (j) {
s = j;
}
e.call(p.prototype);
}
} else {
try {
throw Error();
} catch (j) {
s = j;
}
e();
}
} catch (j) {
if (j && s && typeof j.stack == "string") {
for (var h = j.stack.split(`
`), x = s.stack.split(`
`), w = h.length - 1, _ = x.length - 1; w >= 1 && _ >= 0 && h[w] !== x[_]; )
_--;
for (; w >= 1 && _ >= 0; w--, _--)
if (h[w] !== x[_]) {
if (w !== 1 || _ !== 1)
do
if (w--, _--, _ < 0 || h[w] !== x[_]) {
var I = `
` + h[w].replace(" at new ", " at ");
return e.displayName && I.includes("<anonymous>") && (I = I.replace("<anonymous>", e.displayName)), typeof e == "function" && ne.set(e, I), I;
}
while (w >= 1 && _ >= 0);
break;
}
}
} finally {
ve = !1, fe.current = S, gr(), Error.prepareStackTrace = b;
}
var U = e ? e.displayName || e.name : "", B = U ? te(U) : "";
return typeof e == "function" && ne.set(e, B), B;
}
function pr(e, n, i) {
return Fe(e, !1);
}
function yr(e) {
var n = e.prototype;
return !!(n && n.isReactComponent);
}
function ae(e, n, i) {
if (e == null)
return "";
if (typeof e == "function")
return Fe(e, yr(e));
if (typeof e == "string")
return te(e);
switch (e) {
case C:
return te("Suspense");
case g:
return te("SuspenseList");
}
if (typeof e == "object")
switch (e.$$typeof) {
case y:
return pr(e.render);
case R:
return ae(e.type, n, i);
case P: {
var s = e, b = s._payload, S = s._init;
try {
return ae(S(b), n, i);
} catch {
}
}
}
return "";
}
var Z = Object.prototype.hasOwnProperty, Le = {}, We = T.ReactDebugCurrentFrame;
function oe(e) {
if (e) {
var n = e._owner, i = ae(e.type, e._source, n ? n.type : null);
We.setExtraStackFrame(i);
} else
We.setExtraStackFrame(null);
}
function br(e, n, i, s, b) {
{
var S = Function.call.bind(Z);
for (var p in e)
if (S(e, p)) {
var h = void 0;
try {
if (typeof e[p] != "function") {
var x = Error((s || "React class") + ": " + i + " type `" + p + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[p] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
throw x.name = "Invariant Violation", x;
}
h = e[p](n, p, s, i, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
} catch (w) {
h = w;
}
h && !(h instanceof Error) && (oe(b), E("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", s || "React class", i, p, typeof h), oe(null)), h instanceof Error && !(h.message in Le) && (Le[h.message] = !0, oe(b), E("Failed %s type: %s", i, h.message), oe(null));
}
}
}
var Er = Array.isArray;
function he(e) {
return Er(e);
}
function Sr(e) {
{
var n = typeof Symbol == "function" && Symbol.toStringTag, i = n && e[Symbol.toStringTag] || e.constructor.name || "Object";
return i;
}
}
function Rr(e) {
try {
return Me(e), !1;
} catch {
return !0;
}
}
function Me(e) {
return "" + e;
}
function Ne(e) {
if (Rr(e))
return E("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Sr(e)), Me(e);
}
var Q = T.ReactCurrentOwner, wr = {
key: !0,
ref: !0,
__self: !0,
__source: !0
}, Ye, Be, ge;
ge = {};
function Cr(e) {
if (Z.call(e, "ref")) {
var n = Object.getOwnPropertyDescriptor(e, "ref").get;
if (n && n.isReactWarning)
return !1;
}
return e.ref !== void 0;
}
function _r(e) {
if (Z.call(e, "key")) {
var n = Object.getOwnPropertyDescriptor(e, "key").get;
if (n && n.isReactWarning)
return !1;
}
return e.key !== void 0;
}
function Tr(e, n) {
if (typeof e.ref == "string" && Q.current && n && Q.current.stateNode !== n) {
var i = L(Q.current.type);
ge[i] || (E('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', L(Q.current.type), e.ref), ge[i] = !0);
}
}
function Pr(e, n) {
{
var i = function() {
Ye || (Ye = !0, E("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", n));
};
i.isReactWarning = !0, Object.defineProperty(e, "key", {
get: i,
configurable: !0
});
}
}
function kr(e, n) {
{
var i = function() {
Be || (Be = !0, E("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", n));
};
i.isReactWarning = !0, Object.defineProperty(e, "ref", {
get: i,
configurable: !0
});
}
}
var Or = function(e, n, i, s, b, S, p) {
var h = {
// This tag allows us to uniquely identify this as a React Element
$$typeof: t,
// Built-in properties that belong on the element
type: e,
key: n,
ref: i,
props: p,
// Record the component responsible for creating this element.
_owner: S
};
return h._store = {}, Object.defineProperty(h._store, "validated", {
configurable: !1,
enumerable: !1,
writable: !0,
value: !1
}), Object.defineProperty(h, "_self", {
configurable: !1,
enumerable: !1,
writable: !1,
value: s
}), Object.defineProperty(h, "_source", {
configurable: !1,
enumerable: !1,
writable: !1,
value: b
}), Object.freeze && (Object.freeze(h.props), Object.freeze(h)), h;
};
function xr(e, n, i, s, b) {
{
var S, p = {}, h = null, x = null;
i !== void 0 && (Ne(i), h = "" + i), _r(n) && (Ne(n.key), h = "" + n.key), Cr(n) && (x = n.ref, Tr(n, b));
for (S in n)
Z.call(n, S) && !wr.hasOwnProperty(S) && (p[S] = n[S]);
if (e && e.defaultProps) {
var w = e.defaultProps;
for (S in w)
p[S] === void 0 && (p[S] = w[S]);
}
if (h || x) {
var _ = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
h && Pr(p, _), x && kr(p, _);
}
return Or(e, h, x, b, s, Q.current, p);
}
}
var me = T.ReactCurrentOwner, Ve = T.ReactDebugCurrentFrame;
function $(e) {
if (e) {
var n = e._owner, i = ae(e.type, e._source, n ? n.type : null);
Ve.setExtraStackFrame(i);
} else
Ve.setExtraStackFrame(null);
}
var pe;
pe = !1;
function ye(e) {
return typeof e == "object" && e !== null && e.$$typeof === t;
}
function $e() {
{
if (me.current) {
var e = L(me.current.type);
if (e)
return `
Check the render method of \`` + e + "`.";
}
return "";
}
}
function jr(e) {
return "";
}
var Ue = {};
function Ar(e) {
{
var n = $e();
if (!n) {
var i = typeof e == "string" ? e : e.displayName || e.name;
i && (n = `
Check the top-level render call using <` + i + ">.");
}
return n;
}
}
function Xe(e, n) {
{
if (!e._store || e._store.validated || e.key != null)
return;
e._store.validated = !0;
var i = Ar(n);
if (Ue[i])
return;
Ue[i] = !0;
var s = "";
e && e._owner && e._owner !== me.current && (s = " It was passed a child from " + L(e._owner.type) + "."), $(e), E('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', i, s), $(null);
}
}
function ze(e, n) {
{
if (typeof e != "object")
return;
if (he(e))
for (var i = 0; i < e.length; i++) {
var s = e[i];
ye(s) && Xe(s, n);
}
else if (ye(e))
e._store && (e._store.validated = !0);
else if (e) {
var b = m(e);
if (typeof b == "function" && b !== e.entries)
for (var S = b.call(e), p; !(p = S.next()).done; )
ye(p.value) && Xe(p.value, n);
}
}
}
function Dr(e) {
{
var n = e.type;
if (n == null || typeof n == "string")
return;
var i;
if (typeof n == "function")
i = n.propTypes;
else if (typeof n == "object" && (n.$$typeof === y || // Note: Memo only checks outer props here.
// Inner props are checked in the reconciler.
n.$$typeof === R))
i = n.propTypes;
else
return;
if (i) {
var s = L(n);
br(i, e.props, "prop", s, e);
} else if (n.PropTypes !== void 0 && !pe) {
pe = !0;
var b = L(n);
E("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", b || "Unknown");
}
typeof n.getDefaultProps == "function" && !n.getDefaultProps.isReactClassApproved && E("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
}
}
function Ir(e) {
{
for (var n = Object.keys(e.props), i = 0; i < n.length; i++) {
var s = n[i];
if (s !== "children" && s !== "key") {
$(e), E("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", s), $(null);
break;
}
}
e.ref !== null && ($(e), E("Invalid attribute `ref` supplied to `React.Fragment`."), $(null));
}
}
var He = {};
function Je(e, n, i, s, b, S) {
{
var p = dr(e);
if (!p) {
var h = "";
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (h += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
var x = jr();
x ? h += x : h += $e();
var w;
e === null ? w = "null" : he(e) ? w = "array" : e !== void 0 && e.$$typeof === t ? (w = "<" + (L(e.type) || "Unknown") + " />", h = " Did you accidentally export a JSX literal instead of a component?") : w = typeof e, E("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", w, h);
}
var _ = xr(e, n, i, b, S);
if (_ == null)
return _;
if (p) {
var I = n.children;
if (I !== void 0)
if (s)
if (he(I)) {
for (var U = 0; U < I.length; U++)
ze(I[U], e);
Object.freeze && Object.freeze(I);
} else
E("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
else
ze(I, e);
}
if (Z.call(n, "key")) {
var B = L(e), j = Object.keys(n).filter(function(Yr) {
return Yr !== "key";
}), be = j.length > 0 ? "{key: someKey, " + j.join(": ..., ") + ": ...}" : "{key: someKey}";
if (!He[B + be]) {
var Nr = j.length > 0 ? "{" + j.join(": ..., ") + ": ...}" : "{}";
E(`A props object containing a "key" prop is being spread into JSX:
let props = %s;
<%s {...props} />
React keys must be passed directly to JSX without using spread:
let props = %s;
<%s key={someKey} {...props} />`, be, B, Nr, B), He[B + be] = !0;
}
}
return e === a ? Ir(_) : Dr(_), _;
}
}
function Fr(e, n, i) {
return Je(e, n, i, !0);
}
function Lr(e, n, i) {
return Je(e, n, i, !1);
}
var Wr = Lr, Mr = Fr;
re.Fragment = a, re.jsx = Wr, re.jsxs = Mr;
}()), re;
}
process.env.NODE_ENV === "production" ? we.exports = Br() : we.exports = Vr();
var X = we.exports, W = function() {
return W = Object.assign || function(t) {
for (var o, a = 1, c = arguments.length; a < c; a++) {
o = arguments[a];
for (var f in o) Object.prototype.hasOwnProperty.call(o, f) && (t[f] = o[f]);
}
return t;
}, W.apply(this, arguments);
}, C.apply(this, arguments);
};
function ar(r, t) {
var o = {};
for (var a in r) Object.prototype.hasOwnProperty.call(r, a) && t.indexOf(a) < 0 && (o[a] = r[a]);
if (r != null && typeof Object.getOwnPropertySymbols == "function")
for (var c = 0, a = Object.getOwnPropertySymbols(r); c < a.length; c++)
t.indexOf(a[c]) < 0 && Object.prototype.propertyIsEnumerable.call(r, a[c]) && (o[a[c]] = r[a[c]]);
return o;
function U(e, t) {
var n = {};
for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
if (e != null && typeof Object.getOwnPropertySymbols == "function")
for (var o = 0, r = Object.getOwnPropertySymbols(e); o < r.length; o++)
t.indexOf(r[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[o]) && (n[r[o]] = e[r[o]]);
return n;
}
function $r(r, t, o) {
if (o || arguments.length === 2) for (var a = 0, c = t.length, f; a < c; a++)
(f || !(a in t)) && (f || (f = Array.prototype.slice.call(t, 0, a)), f[a] = t[a]);
return r.concat(f || Array.prototype.slice.call(t));
function oe(e, t, n) {
if (n || arguments.length === 2) for (var r = 0, o = t.length, i; r < o; r++)
(i || !(r in t)) && (i || (i = Array.prototype.slice.call(t, 0, r)), i[r] = t[r]);
return e.concat(i || Array.prototype.slice.call(t));
}
var ce = "right-scroll-bar-position", le = "width-before-scroll-bar", Ur = "with-scroll-bars-hidden", Xr = "--removed-body-scroll-bar-size";
function Ee(r, t) {
return typeof r == "function" ? r(t) : r && (r.current = t), r;
var I = "right-scroll-bar-position", A = "width-before-scroll-bar", ce = "with-scroll-bars-hidden", ie = "--removed-body-scroll-bar-size";
function j(e, t) {
return typeof e == "function" ? e(t) : e && (e.current = t), e;
}
function zr(r, t) {
var o = J(function() {
function le(e, t) {
var n = x(function() {
return {
// value
value: r,
value: e,
// last callback

@@ -668,7 +40,7 @@ callback: t,

get current() {
return o.value;
return n.value;
},
set current(a) {
var c = o.value;
c !== a && (o.value = a, o.callback(a, c));
set current(r) {
var o = n.value;
o !== r && (n.value = r, n.callback(r, o));
}

@@ -678,76 +50,76 @@ }

})[0];
return o.callback = t, o.facade;
return n.callback = t, n.facade;
}
var Hr = typeof window < "u" ? v.useLayoutEffect : v.useEffect, Qe = /* @__PURE__ */ new WeakMap();
function Jr(r, t) {
var o = zr(null, function(a) {
return r.forEach(function(c) {
return Ee(c, a);
var ue = typeof window < "u" ? l.useLayoutEffect : l.useEffect, F = /* @__PURE__ */ new WeakMap();
function se(e, t) {
var n = le(null, function(r) {
return e.forEach(function(o) {
return j(o, r);
});
});
return Hr(function() {
var a = Qe.get(o);
if (a) {
var c = new Set(a), f = new Set(r), d = o.current;
c.forEach(function(l) {
f.has(l) || Ee(l, null);
}), f.forEach(function(l) {
c.has(l) || Ee(l, d);
return ue(function() {
var r = F.get(n);
if (r) {
var o = new Set(r), i = new Set(e), u = n.current;
o.forEach(function(c) {
i.has(c) || j(c, null);
}), i.forEach(function(c) {
o.has(c) || j(c, u);
});
}
Qe.set(o, r);
}, [r]), o;
F.set(n, e);
}, [e]), n;
}
function Gr(r) {
return r;
function fe(e) {
return e;
}
function Kr(r, t) {
t === void 0 && (t = Gr);
var o = [], a = !1, c = {
function de(e, t) {
t === void 0 && (t = fe);
var n = [], r = !1, o = {
read: function() {
if (a)
if (r)
throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");
return o.length ? o[o.length - 1] : r;
return n.length ? n[n.length - 1] : e;
},
useMedium: function(f) {
var d = t(f, a);
return o.push(d), function() {
o = o.filter(function(l) {
return l !== d;
useMedium: function(i) {
var u = t(i, r);
return n.push(u), function() {
n = n.filter(function(c) {
return c !== u;
});
};
},
assignSyncMedium: function(f) {
for (a = !0; o.length; ) {
var d = o;
o = [], d.forEach(f);
assignSyncMedium: function(i) {
for (r = !0; n.length; ) {
var u = n;
n = [], u.forEach(i);
}
o = {
push: function(l) {
return f(l);
n = {
push: function(c) {
return i(c);
},
filter: function() {
return o;
return n;
}
};
},
assignMedium: function(f) {
a = !0;
var d = [];
if (o.length) {
var l = o;
o = [], l.forEach(f), d = o;
assignMedium: function(i) {
r = !0;
var u = [];
if (n.length) {
var c = n;
n = [], c.forEach(i), u = n;
}
var y = function() {
var g = d;
d = [], g.forEach(f);
}, C = function() {
return Promise.resolve().then(y);
var d = function() {
var f = u;
u = [], f.forEach(i);
}, h = function() {
return Promise.resolve().then(d);
};
C(), o = {
push: function(g) {
d.push(g), C();
h(), n = {
push: function(f) {
u.push(f), h();
},
filter: function(g) {
return d = d.filter(g), o;
filter: function(f) {
return u = u.filter(f), n;
}

@@ -757,37 +129,37 @@ };

};
return c;
return o;
}
function qr(r) {
r === void 0 && (r = {});
var t = Kr(null);
return t.options = W({ async: !0, ssr: !1 }, r), t;
function ve(e) {
e === void 0 && (e = {});
var t = de(null);
return t.options = C({ async: !0, ssr: !1 }, e), t;
}
var or = function(r) {
var t = r.sideCar, o = ar(r, ["sideCar"]);
var $ = function(e) {
var t = e.sideCar, n = U(e, ["sideCar"]);
if (!t)
throw new Error("Sidecar: please provide `sideCar` property to import the right car");
var a = t.read();
if (!a)
var r = t.read();
if (!r)
throw new Error("Sidecar medium not found");
return v.createElement(a, W({}, o));
return l.createElement(r, C({}, n));
};
or.isSideCarExport = !0;
function Zr(r, t) {
return r.useMedium(t), or;
$.isSideCarExport = !0;
function he(e, t) {
return e.useMedium(t), $;
}
var ir = qr(), Se = function() {
}, se = v.forwardRef(function(r, t) {
var o = v.useRef(null), a = v.useState({
onScrollCapture: Se,
onWheelCapture: Se,
onTouchMoveCapture: Se
}), c = a[0], f = a[1], d = r.forwardProps, l = r.children, y = r.className, C = r.removeScrollBar, g = r.enabled, R = r.shards, P = r.sideCar, O = r.noIsolation, A = r.inert, u = r.allowPinchZoom, m = r.as, T = m === void 0 ? "div" : m, E = r.gapMode, D = ar(r, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]), F = P, k = Jr([o, t]), M = W(W({}, D), c);
return v.createElement(
v.Fragment,
var q = ve(), X = function() {
}, W = l.forwardRef(function(e, t) {
var n = l.useRef(null), r = l.useState({
onScrollCapture: X,
onWheelCapture: X,
onTouchMoveCapture: X
}), o = r[0], i = r[1], u = e.forwardProps, c = e.children, d = e.className, h = e.removeScrollBar, f = e.enabled, m = e.shards, S = e.sideCar, y = e.noIsolation, w = e.inert, a = e.allowPinchZoom, s = e.as, g = s === void 0 ? "div" : s, p = e.gapMode, b = U(e, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]), E = S, v = se([n, t]), R = C(C({}, b), o);
return l.createElement(
l.Fragment,
null,
g && v.createElement(F, { sideCar: ir, removeScrollBar: C, shards: R, noIsolation: O, inert: A, setCallbacks: f, allowPinchZoom: !!u, lockRef: o, gapMode: E }),
d ? v.cloneElement(v.Children.only(l), W(W({}, M), { ref: k })) : v.createElement(T, W({}, M, { className: y, ref: k }), l)
f && l.createElement(E, { sideCar: q, removeScrollBar: h, shards: m, noIsolation: y, inert: w, setCallbacks: i, allowPinchZoom: !!a, lockRef: n, gapMode: p }),
u ? l.cloneElement(l.Children.only(c), C(C({}, R), { ref: v })) : l.createElement(g, C({}, R, { className: d, ref: v }), c)
);
});
se.defaultProps = {
W.defaultProps = {
enabled: !0,

@@ -797,51 +169,51 @@ removeScrollBar: !0,

};
se.classNames = {
fullWidth: le,
zeroRight: ce
W.classNames = {
fullWidth: A,
zeroRight: I
};
var Qr = function() {
var me = function() {
if (typeof __webpack_nonce__ < "u")
return __webpack_nonce__;
};
function et() {
function ge() {
if (!document)
return null;
var r = document.createElement("style");
r.type = "text/css";
var t = Qr();
return t && r.setAttribute("nonce", t), r;
var e = document.createElement("style");
e.type = "text/css";
var t = me();
return t && e.setAttribute("nonce", t), e;
}
function rt(r, t) {
r.styleSheet ? r.styleSheet.cssText = t : r.appendChild(document.createTextNode(t));
function ye(e, t) {
e.styleSheet ? e.styleSheet.cssText = t : e.appendChild(document.createTextNode(t));
}
function tt(r) {
function be(e) {
var t = document.head || document.getElementsByTagName("head")[0];
t.appendChild(r);
t.appendChild(e);
}
var nt = function() {
var r = 0, t = null;
var Se = function() {
var e = 0, t = null;
return {
add: function(o) {
r == 0 && (t = et()) && (rt(t, o), tt(t)), r++;
add: function(n) {
e == 0 && (t = ge()) && (ye(t, n), be(t)), e++;
},
remove: function() {
r--, !r && t && (t.parentNode && t.parentNode.removeChild(t), t = null);
e--, !e && t && (t.parentNode && t.parentNode.removeChild(t), t = null);
}
};
}, at = function() {
var r = nt();
return function(t, o) {
v.useEffect(function() {
return r.add(t), function() {
r.remove();
}, we = function() {
var e = Se();
return function(t, n) {
l.useEffect(function() {
return e.add(t), function() {
e.remove();
};
}, [t && o]);
}, [t && n]);
};
}, ur = function() {
var r = at(), t = function(o) {
var a = o.styles, c = o.dynamic;
return r(a, c), null;
}, J = function() {
var e = we(), t = function(n) {
var r = n.styles, o = n.dynamic;
return e(r, o), null;
};
return t;
}, ot = {
}, pe = {
left: 0,

@@ -851,11 +223,11 @@ top: 0,

gap: 0
}, Re = function(r) {
return parseInt(r || "", 10) || 0;
}, it = function(r) {
var t = window.getComputedStyle(document.body), o = t[r === "padding" ? "paddingLeft" : "marginLeft"], a = t[r === "padding" ? "paddingTop" : "marginTop"], c = t[r === "padding" ? "paddingRight" : "marginRight"];
return [Re(o), Re(a), Re(c)];
}, ut = function(r) {
if (r === void 0 && (r = "margin"), typeof window > "u")
return ot;
var t = it(r), o = document.documentElement.clientWidth, a = window.innerWidth;
}, Y = function(e) {
return parseInt(e || "", 10) || 0;
}, Ce = function(e) {
var t = window.getComputedStyle(document.body), n = t[e === "padding" ? "paddingLeft" : "marginLeft"], r = t[e === "padding" ? "paddingTop" : "marginTop"], o = t[e === "padding" ? "paddingRight" : "marginRight"];
return [Y(n), Y(r), Y(o)];
}, Ee = function(e) {
if (e === void 0 && (e = "margin"), typeof window > "u")
return pe;
var t = Ce(e), n = document.documentElement.clientWidth, r = window.innerWidth;
return {

@@ -865,291 +237,290 @@ left: t[0],

right: t[2],
gap: Math.max(0, a - o + t[2] - t[0])
gap: Math.max(0, r - n + t[2] - t[0])
};
}, ct = ur(), G = "data-scroll-locked", lt = function(r, t, o, a) {
var c = r.left, f = r.top, d = r.right, l = r.gap;
return o === void 0 && (o = "margin"), `
.`.concat(Ur, ` {
overflow: hidden `).concat(a, `;
padding-right: `).concat(l, "px ").concat(a, `;
}, Re = J(), L = "data-scroll-locked", ke = function(e, t, n, r) {
var o = e.left, i = e.top, u = e.right, c = e.gap;
return n === void 0 && (n = "margin"), `
.`.concat(ce, ` {
overflow: hidden `).concat(r, `;
padding-right: `).concat(c, "px ").concat(r, `;
}
body[`).concat(G, `] {
overflow: hidden `).concat(a, `;
body[`).concat(L, `] {
overflow: hidden `).concat(r, `;
overscroll-behavior: contain;
`).concat([
t && "position: relative ".concat(a, ";"),
o === "margin" && `
padding-left: `.concat(c, `px;
padding-top: `).concat(f, `px;
padding-right: `).concat(d, `px;
t && "position: relative ".concat(r, ";"),
n === "margin" && `
padding-left: `.concat(o, `px;
padding-top: `).concat(i, `px;
padding-right: `).concat(u, `px;
margin-left:0;
margin-top:0;
margin-right: `).concat(l, "px ").concat(a, `;
margin-right: `).concat(c, "px ").concat(r, `;
`),
o === "padding" && "padding-right: ".concat(l, "px ").concat(a, ";")
n === "padding" && "padding-right: ".concat(c, "px ").concat(r, ";")
].filter(Boolean).join(""), `
}
.`).concat(ce, ` {
right: `).concat(l, "px ").concat(a, `;
.`).concat(I, ` {
right: `).concat(c, "px ").concat(r, `;
}
.`).concat(le, ` {
margin-right: `).concat(l, "px ").concat(a, `;
.`).concat(A, ` {
margin-right: `).concat(c, "px ").concat(r, `;
}
.`).concat(ce, " .").concat(ce, ` {
right: 0 `).concat(a, `;
.`).concat(I, " .").concat(I, ` {
right: 0 `).concat(r, `;
}
.`).concat(le, " .").concat(le, ` {
margin-right: 0 `).concat(a, `;
.`).concat(A, " .").concat(A, ` {
margin-right: 0 `).concat(r, `;
}
body[`).concat(G, `] {
`).concat(Xr, ": ").concat(l, `px;
body[`).concat(L, `] {
`).concat(ie, ": ").concat(c, `px;
}
`);
}, er = function() {
var r = parseInt(document.body.getAttribute(G) || "0", 10);
return isFinite(r) ? r : 0;
}, st = function() {
v.useEffect(function() {
return document.body.setAttribute(G, (er() + 1).toString()), function() {
var r = er() - 1;
r <= 0 ? document.body.removeAttribute(G) : document.body.setAttribute(G, r.toString());
}, _ = function() {
var e = parseInt(document.body.getAttribute(L) || "0", 10);
return isFinite(e) ? e : 0;
}, Pe = function() {
l.useEffect(function() {
return document.body.setAttribute(L, (_() + 1).toString()), function() {
var e = _() - 1;
e <= 0 ? document.body.removeAttribute(L) : document.body.setAttribute(L, e.toString());
};
}, []);
}, ft = function(r) {
var t = r.noRelative, o = r.noImportant, a = r.gapMode, c = a === void 0 ? "margin" : a;
st();
var f = v.useMemo(function() {
return ut(c);
}, [c]);
return v.createElement(ct, { styles: lt(f, !t, c, o ? "" : "!important") });
}, Ce = !1;
}, xe = function(e) {
var t = e.noRelative, n = e.noImportant, r = e.gapMode, o = r === void 0 ? "margin" : r;
Pe();
var i = l.useMemo(function() {
return Ee(o);
}, [o]);
return l.createElement(Re, { styles: ke(i, !t, o, n ? "" : "!important") });
}, D = !1;
if (typeof window < "u")
try {
var ie = Object.defineProperty({}, "passive", {
var T = Object.defineProperty({}, "passive", {
get: function() {
return Ce = !0, !0;
return D = !0, !0;
}
});
window.addEventListener("test", ie, ie), window.removeEventListener("test", ie, ie);
window.addEventListener("test", T, T), window.removeEventListener("test", T, T);
} catch {
Ce = !1;
D = !1;
}
var z = Ce ? { passive: !1 } : !1, dt = function(r) {
return r.tagName === "TEXTAREA";
}, cr = function(r, t) {
if (!(r instanceof Element))
var k = D ? { passive: !1 } : !1, Le = function(e) {
return e.tagName === "TEXTAREA";
}, K = function(e, t) {
if (!(e instanceof Element))
return !1;
var o = window.getComputedStyle(r);
var n = window.getComputedStyle(e);
return (
// not-not-scrollable
o[t] !== "hidden" && // contains scroll inside self
!(o.overflowY === o.overflowX && !dt(r) && o[t] === "visible")
n[t] !== "hidden" && // contains scroll inside self
!(n.overflowY === n.overflowX && !Le(e) && n[t] === "visible")
);
}, vt = function(r) {
return cr(r, "overflowY");
}, ht = function(r) {
return cr(r, "overflowX");
}, rr = function(r, t) {
var o = t.ownerDocument, a = t;
}, Ne = function(e) {
return K(e, "overflowY");
}, Be = function(e) {
return K(e, "overflowX");
}, Z = function(e, t) {
var n = t.ownerDocument, r = t;
do {
typeof ShadowRoot < "u" && a instanceof ShadowRoot && (a = a.host);
var c = lr(r, a);
if (c) {
var f = sr(r, a), d = f[1], l = f[2];
if (d > l)
typeof ShadowRoot < "u" && r instanceof ShadowRoot && (r = r.host);
var o = ee(e, r);
if (o) {
var i = te(e, r), u = i[1], c = i[2];
if (u > c)
return !0;
}
a = a.parentNode;
} while (a && a !== o.body);
r = r.parentNode;
} while (r && r !== n.body);
return !1;
}, gt = function(r) {
var t = r.scrollTop, o = r.scrollHeight, a = r.clientHeight;
}, Me = function(e) {
var t = e.scrollTop, n = e.scrollHeight, r = e.clientHeight;
return [
t,
o,
a
n,
r
];
}, mt = function(r) {
var t = r.scrollLeft, o = r.scrollWidth, a = r.clientWidth;
}, Te = function(e) {
var t = e.scrollLeft, n = e.scrollWidth, r = e.clientWidth;
return [
t,
o,
a
n,
r
];
}, lr = function(r, t) {
return r === "v" ? vt(t) : ht(t);
}, sr = function(r, t) {
return r === "v" ? gt(t) : mt(t);
}, pt = function(r, t) {
return r === "h" && t === "rtl" ? -1 : 1;
}, yt = function(r, t, o, a, c) {
var f = pt(r, window.getComputedStyle(t).direction), d = f * a, l = o.target, y = t.contains(l), C = !1, g = d > 0, R = 0, P = 0;
}, ee = function(e, t) {
return e === "v" ? Ne(t) : Be(t);
}, te = function(e, t) {
return e === "v" ? Me(t) : Te(t);
}, Oe = function(e, t) {
return e === "h" && t === "rtl" ? -1 : 1;
}, Ie = function(e, t, n, r, o) {
var i = Oe(e, window.getComputedStyle(t).direction), u = i * r, c = n.target, d = t.contains(c), h = !1, f = u > 0, m = 0, S = 0;
do {
var O = sr(r, l), A = O[0], u = O[1], m = O[2], T = u - m - f * A;
(A || T) && lr(r, l) && (R += T, P += A), l instanceof ShadowRoot ? l = l.host : l = l.parentNode;
var y = te(e, c), w = y[0], a = y[1], s = y[2], g = a - s - i * w;
(w || g) && ee(e, c) && (m += g, S += w), c instanceof ShadowRoot ? c = c.host : c = c.parentNode;
} while (
// portaled content
!y && l !== document.body || // self content
y && (t.contains(l) || t === l)
!d && c !== document.body || // self content
d && (t.contains(c) || t === c)
);
return (g && (Math.abs(R) < 1 || !c) || !g && (Math.abs(P) < 1 || !c)) && (C = !0), C;
}, ue = function(r) {
return "changedTouches" in r ? [r.changedTouches[0].clientX, r.changedTouches[0].clientY] : [0, 0];
}, tr = function(r) {
return [r.deltaX, r.deltaY];
}, nr = function(r) {
return r && "current" in r ? r.current : r;
}, bt = function(r, t) {
return r[0] === t[0] && r[1] === t[1];
}, Et = function(r) {
return (f && (Math.abs(m) < 1 || !o) || !f && (Math.abs(S) < 1 || !o)) && (h = !0), h;
}, O = function(e) {
return "changedTouches" in e ? [e.changedTouches[0].clientX, e.changedTouches[0].clientY] : [0, 0];
}, Q = function(e) {
return [e.deltaX, e.deltaY];
}, G = function(e) {
return e && "current" in e ? e.current : e;
}, Ae = function(e, t) {
return e[0] === t[0] && e[1] === t[1];
}, We = function(e) {
return `
.block-interactivity-`.concat(r, ` {pointer-events: none;}
.allow-interactivity-`).concat(r, ` {pointer-events: all;}
.block-interactivity-`.concat(e, ` {pointer-events: none;}
.allow-interactivity-`).concat(e, ` {pointer-events: all;}
`);
}, St = 0, H = [];
function Rt(r) {
var t = v.useRef([]), o = v.useRef([0, 0]), a = v.useRef(), c = v.useState(St++)[0], f = v.useState(ur)[0], d = v.useRef(r);
v.useEffect(function() {
d.current = r;
}, [r]), v.useEffect(function() {
if (r.inert) {
document.body.classList.add("block-interactivity-".concat(c));
var u = $r([r.lockRef.current], (r.shards || []).map(nr), !0).filter(Boolean);
return u.forEach(function(m) {
return m.classList.add("allow-interactivity-".concat(c));
}, je = 0, P = [];
function Xe(e) {
var t = l.useRef([]), n = l.useRef([0, 0]), r = l.useRef(), o = l.useState(je++)[0], i = l.useState(J)[0], u = l.useRef(e);
l.useEffect(function() {
u.current = e;
}, [e]), l.useEffect(function() {
if (e.inert) {
document.body.classList.add("block-interactivity-".concat(o));
var a = oe([e.lockRef.current], (e.shards || []).map(G), !0).filter(Boolean);
return a.forEach(function(s) {
return s.classList.add("allow-interactivity-".concat(o));
}), function() {
document.body.classList.remove("block-interactivity-".concat(c)), u.forEach(function(m) {
return m.classList.remove("allow-interactivity-".concat(c));
document.body.classList.remove("block-interactivity-".concat(o)), a.forEach(function(s) {
return s.classList.remove("allow-interactivity-".concat(o));
});
};
}
}, [r.inert, r.lockRef.current, r.shards]);
var l = v.useCallback(function(u, m) {
if ("touches" in u && u.touches.length === 2)
return !d.current.allowPinchZoom;
var T = ue(u), E = o.current, D = "deltaX" in u ? u.deltaX : E[0] - T[0], F = "deltaY" in u ? u.deltaY : E[1] - T[1], k, M = u.target, N = Math.abs(D) > Math.abs(F) ? "h" : "v";
if ("touches" in u && N === "h" && M.type === "range")
}, [e.inert, e.lockRef.current, e.shards]);
var c = l.useCallback(function(a, s) {
if ("touches" in a && a.touches.length === 2)
return !u.current.allowPinchZoom;
var g = O(a), p = n.current, b = "deltaX" in a ? a.deltaX : p[0] - g[0], E = "deltaY" in a ? a.deltaY : p[1] - g[1], v, R = a.target, N = Math.abs(b) > Math.abs(E) ? "h" : "v";
if ("touches" in a && N === "h" && R.type === "range")
return !1;
var V = rr(N, M);
if (!V)
var M = Z(N, R);
if (!M)
return !0;
if (V ? k = N : (k = N === "v" ? "h" : "v", V = rr(N, M)), !V)
if (M ? v = N : (v = N === "v" ? "h" : "v", M = Z(N, R)), !M)
return !1;
if (!a.current && "changedTouches" in u && (D || F) && (a.current = k), !k)
if (!r.current && "changedTouches" in a && (b || E) && (r.current = v), !v)
return !0;
var K = a.current || k;
return yt(K, m, u, K === "h" ? D : F, !0);
}, []), y = v.useCallback(function(u) {
var m = u;
if (!(!H.length || H[H.length - 1] !== f)) {
var T = "deltaY" in m ? tr(m) : ue(m), E = t.current.filter(function(k) {
return k.name === m.type && (k.target === m.target || m.target === k.shadowParent) && bt(k.delta, T);
var V = r.current || v;
return Ie(V, s, a, V === "h" ? b : E, !0);
}, []), d = l.useCallback(function(a) {
var s = a;
if (!(!P.length || P[P.length - 1] !== i)) {
var g = "deltaY" in s ? Q(s) : O(s), p = t.current.filter(function(v) {
return v.name === s.type && (v.target === s.target || s.target === v.shadowParent) && Ae(v.delta, g);
})[0];
if (E && E.should) {
m.cancelable && m.preventDefault();
if (p && p.should) {
s.cancelable && s.preventDefault();
return;
}
if (!E) {
var D = (d.current.shards || []).map(nr).filter(Boolean).filter(function(k) {
return k.contains(m.target);
}), F = D.length > 0 ? l(m, D[0]) : !d.current.noIsolation;
F && m.cancelable && m.preventDefault();
if (!p) {
var b = (u.current.shards || []).map(G).filter(Boolean).filter(function(v) {
return v.contains(s.target);
}), E = b.length > 0 ? c(s, b[0]) : !u.current.noIsolation;
E && s.cancelable && s.preventDefault();
}
}
}, []), C = v.useCallback(function(u, m, T, E) {
var D = { name: u, delta: m, target: T, should: E, shadowParent: wt(T) };
t.current.push(D), setTimeout(function() {
t.current = t.current.filter(function(F) {
return F !== D;
}, []), h = l.useCallback(function(a, s, g, p) {
var b = { name: a, delta: s, target: g, should: p, shadowParent: Ye(g) };
t.current.push(b), setTimeout(function() {
t.current = t.current.filter(function(E) {
return E !== b;
});
}, 1);
}, []), g = v.useCallback(function(u) {
o.current = ue(u), a.current = void 0;
}, []), R = v.useCallback(function(u) {
C(u.type, tr(u), u.target, l(u, r.lockRef.current));
}, []), P = v.useCallback(function(u) {
C(u.type, ue(u), u.target, l(u, r.lockRef.current));
}, []), f = l.useCallback(function(a) {
n.current = O(a), r.current = void 0;
}, []), m = l.useCallback(function(a) {
h(a.type, Q(a), a.target, c(a, e.lockRef.current));
}, []), S = l.useCallback(function(a) {
h(a.type, O(a), a.target, c(a, e.lockRef.current));
}, []);
v.useEffect(function() {
return H.push(f), r.setCallbacks({
onScrollCapture: R,
onWheelCapture: R,
onTouchMoveCapture: P
}), document.addEventListener("wheel", y, z), document.addEventListener("touchmove", y, z), document.addEventListener("touchstart", g, z), function() {
H = H.filter(function(u) {
return u !== f;
}), document.removeEventListener("wheel", y, z), document.removeEventListener("touchmove", y, z), document.removeEventListener("touchstart", g, z);
l.useEffect(function() {
return P.push(i), e.setCallbacks({
onScrollCapture: m,
onWheelCapture: m,
onTouchMoveCapture: S
}), document.addEventListener("wheel", d, k), document.addEventListener("touchmove", d, k), document.addEventListener("touchstart", f, k), function() {
P = P.filter(function(a) {
return a !== i;
}), document.removeEventListener("wheel", d, k), document.removeEventListener("touchmove", d, k), document.removeEventListener("touchstart", f, k);
};
}, []);
var O = r.removeScrollBar, A = r.inert;
return v.createElement(
v.Fragment,
var y = e.removeScrollBar, w = e.inert;
return l.createElement(
l.Fragment,
null,
A ? v.createElement(f, { styles: Et(c) }) : null,
O ? v.createElement(ft, { gapMode: r.gapMode }) : null
w ? l.createElement(i, { styles: We(o) }) : null,
y ? l.createElement(xe, { gapMode: e.gapMode }) : null
);
}
function wt(r) {
for (var t = null; r !== null; )
r instanceof ShadowRoot && (t = r.host, r = r.host), r = r.parentNode;
function Ye(e) {
for (var t = null; e !== null; )
e instanceof ShadowRoot && (t = e.host, e = e.host), e = e.parentNode;
return t;
}
const Ct = Zr(ir, Rt);
var fr = v.forwardRef(function(r, t) {
return v.createElement(se, W({}, r, { ref: t, sideCar: Ct }));
const De = he(q, Xe);
var re = l.forwardRef(function(e, t) {
return l.createElement(W, C({}, e, { ref: t, sideCar: De }));
});
fr.classNames = se.classNames;
const Tt = _e.forwardRef((r, t) => {
const [o, a] = J(!1), [c, f] = J(!1), [d, l] = J(), [y, C] = J(), [g, R] = J(), P = Ge(null), O = Ge(null);
Ke(() => {
if (c) {
f(!1);
re.classNames = W.classNames;
const ze = ae.forwardRef((e, t) => {
const [n, r] = x(!1), [o, i] = x(!1), [u, c] = x(), [d, h] = x(), [f, m] = x(), S = H(null), y = H(null);
z(() => {
if (o) {
i(!1);
return;
}
if (g != null && g.length && y && R(void 0), r.data && typeof r.data == "function") {
const u = r.data(y);
if (u instanceof Promise) {
u.then((m) => {
R(m);
if (f != null && f.length && d && m(void 0), e.data && typeof e.data == "function") {
const a = e.data(d);
if (a instanceof Promise) {
a.then((s) => {
m(s);
});
return;
}
R(u);
} else r.data && R(r.data);
}, [c]);
const A = (u) => {
const m = u.target;
P.current && !P.current.contains(m) && O.current && !O.current.contains(m) && a(!1);
m(a);
} else e.data && m(e.data);
}, [o]);
const w = (a) => {
const s = a.target;
S.current && !S.current.contains(s) && y.current && !y.current.contains(s) && r(!1);
};
return Ke(() => (document.addEventListener("mousedown", A), () => {
document.removeEventListener("mousedown", A);
}), []), /* @__PURE__ */ X.jsxs("div", { children: [
/* @__PURE__ */ X.jsx(
return z(() => (document.addEventListener("mousedown", w), () => {
document.removeEventListener("mousedown", w);
}), []), /* @__PURE__ */ ne("div", { children: [
/* @__PURE__ */ B(
"input",
{
ref: P,
onFocus: () => a(!0),
ref: S,
onFocus: () => r(!0),
className: "p-2 bg-gray-200 cursor-pointer focus:cursor-text",
type: "text",
placeholder: r.placeholder,
onBlur: r.onBlur,
value: (d == null ? void 0 : d.label) || y,
onChange: (u) => {
C(u.target.value.toLowerCase()), f(!0), r.onChange && r.onChange(u);
placeholder: e.placeholder,
onBlur: e.onBlur,
value: (u == null ? void 0 : u.label) || d,
onChange: (a) => {
h(a.target.value.toLowerCase()), i(!0), e.onChange && e.onChange(a);
}
}
),
/* @__PURE__ */ X.jsx("input", { ref: t, name: r.name, disabled: !0, className: "hidden", type: "text", value: d == null ? void 0 : d.value }),
o && g && g.length > 0 && /* @__PURE__ */ X.jsx(fr, { children: /* @__PURE__ */ X.jsx("div", { ref: O, className: "absolute z-10 w-full bg-white border border-gray-300 rounded mt-1", children: g.filter((u) => String(u.label).toLowerCase().indexOf(y ?? "") > -1).map((u, m) => /* @__PURE__ */ X.jsx("div", { className: "p-2 cursor-pointer hover:bg-gray-100", onClick: () => {
l(u), a(!1);
}, children: u.label }, m)) }) })
/* @__PURE__ */ B("input", { ref: t, name: e.name, disabled: !0, className: "hidden", type: "text", value: u == null ? void 0 : u.value }),
n && f && f.length > 0 && /* @__PURE__ */ B(re, { children: /* @__PURE__ */ B("div", { ref: y, className: "absolute z-10 w-full bg-white border border-gray-300 rounded mt-1", children: f.filter((a) => String(a.label).toLowerCase().indexOf(d ?? "") > -1).map((a, s) => /* @__PURE__ */ B("div", { className: "p-2 cursor-pointer hover:bg-gray-100", onClick: () => {
c(a), r(!1);
}, children: a.label }, s)) }) })
] });
});
export {
Tt as SearchSelect
ze as SearchSelect
};
//# sourceMappingURL=index.es.js.map

@@ -1,71 +0,41 @@

(function(Y,P){typeof exports=="object"&&typeof module<"u"?P(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],P):(Y=typeof globalThis<"u"?globalThis:Y||self,P(Y["react-beautiful-timeline"]={},Y.React))})(this,function(Y,P){"use strict";function sr(r){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const o in r)if(o!=="default"){const n=Object.getOwnPropertyDescriptor(r,o);Object.defineProperty(t,o,n.get?n:{enumerable:!0,get:()=>r[o]})}}return t.default=r,Object.freeze(t)}const v=sr(P);var de={exports:{}},K={};/**
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Te;function fr(){if(Te)return K;Te=1;var r=P,t=Symbol.for("react.element"),o=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,c=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,f={key:!0,ref:!0,__self:!0,__source:!0};function d(l,y,C){var g,w={},O=null,x=null;C!==void 0&&(O=""+C),y.key!==void 0&&(O=""+y.key),y.ref!==void 0&&(x=y.ref);for(g in y)n.call(y,g)&&!f.hasOwnProperty(g)&&(w[g]=y[g]);if(l&&l.defaultProps)for(g in y=l.defaultProps,y)w[g]===void 0&&(w[g]=y[g]);return{$$typeof:t,type:l,key:O,ref:x,props:w,_owner:c.current}}return K.Fragment=o,K.jsx=d,K.jsxs=d,K}var Z={};/**
* @license React
* react-jsx-runtime.development.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Pe;function dr(){return Pe||(Pe=1,process.env.NODE_ENV!=="production"&&function(){var r=P,t=Symbol.for("react.element"),o=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),d=Symbol.for("react.provider"),l=Symbol.for("react.context"),y=Symbol.for("react.forward_ref"),C=Symbol.for("react.suspense"),g=Symbol.for("react.suspense_list"),w=Symbol.for("react.memo"),O=Symbol.for("react.lazy"),x=Symbol.for("react.offscreen"),D=Symbol.iterator,u="@@iterator";function m(e){if(e===null||typeof e!="object")return null;var a=D&&e[D]||e[u];return typeof a=="function"?a:null}var T=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function E(e){{for(var a=arguments.length,i=new Array(a>1?a-1:0),s=1;s<a;s++)i[s-1]=arguments[s];I("error",e,i)}}function I(e,a,i){{var s=T.ReactDebugCurrentFrame,b=s.getStackAddendum();b!==""&&(a+="%s",i=i.concat([b]));var S=i.map(function(p){return String(p)});S.unshift("Warning: "+a),Function.prototype.apply.call(console[e],console,S)}}var L=!1,k=!1,N=!1,B=!1,J=!1,Q;Q=Symbol.for("react.module.reference");function Gr(e){return!!(typeof e=="string"||typeof e=="function"||e===n||e===f||J||e===c||e===C||e===g||B||e===x||L||k||N||typeof e=="object"&&e!==null&&(e.$$typeof===O||e.$$typeof===w||e.$$typeof===d||e.$$typeof===l||e.$$typeof===y||e.$$typeof===Q||e.getModuleId!==void 0))}function Kr(e,a,i){var s=e.displayName;if(s)return s;var b=a.displayName||a.name||"";return b!==""?i+"("+b+")":i}function Be(e){return e.displayName||"Context"}function M(e){if(e==null)return null;if(typeof e.tag=="number"&&E("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case n:return"Fragment";case o:return"Portal";case f:return"Profiler";case c:return"StrictMode";case C:return"Suspense";case g:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case l:var a=e;return Be(a)+".Consumer";case d:var i=e;return Be(i._context)+".Provider";case y:return Kr(e,e.render,"ForwardRef");case w:var s=e.displayName||null;return s!==null?s:M(e.type)||"Memo";case O:{var b=e,S=b._payload,p=b._init;try{return M(p(S))}catch{return null}}}return null}var V=Object.assign,ee=0,Ve,$e,Ue,Xe,ze,He,Je;function qe(){}qe.__reactDisabledLog=!0;function Zr(){{if(ee===0){Ve=console.log,$e=console.info,Ue=console.warn,Xe=console.error,ze=console.group,He=console.groupCollapsed,Je=console.groupEnd;var e={configurable:!0,enumerable:!0,value:qe,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}ee++}}function Qr(){{if(ee--,ee===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:V({},e,{value:Ve}),info:V({},e,{value:$e}),warn:V({},e,{value:Ue}),error:V({},e,{value:Xe}),group:V({},e,{value:ze}),groupCollapsed:V({},e,{value:He}),groupEnd:V({},e,{value:Je})})}ee<0&&E("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var pe=T.ReactCurrentDispatcher,ye;function ce(e,a,i){{if(ye===void 0)try{throw Error()}catch(b){var s=b.stack.trim().match(/\n( *(at )?)/);ye=s&&s[1]||""}return`
`+ye+e}}var be=!1,le;{var et=typeof WeakMap=="function"?WeakMap:Map;le=new et}function Ge(e,a){if(!e||be)return"";{var i=le.get(e);if(i!==void 0)return i}var s;be=!0;var b=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var S;S=pe.current,pe.current=null,Zr();try{if(a){var p=function(){throw Error()};if(Object.defineProperty(p.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(p,[])}catch(A){s=A}Reflect.construct(e,[],p)}else{try{p.call()}catch(A){s=A}e.call(p.prototype)}}else{try{throw Error()}catch(A){s=A}e()}}catch(A){if(A&&s&&typeof A.stack=="string"){for(var h=A.stack.split(`
`),j=s.stack.split(`
`),R=h.length-1,_=j.length-1;R>=1&&_>=0&&h[R]!==j[_];)_--;for(;R>=1&&_>=0;R--,_--)if(h[R]!==j[_]){if(R!==1||_!==1)do if(R--,_--,_<0||h[R]!==j[_]){var F=`
`+h[R].replace(" at new "," at ");return e.displayName&&F.includes("<anonymous>")&&(F=F.replace("<anonymous>",e.displayName)),typeof e=="function"&&le.set(e,F),F}while(R>=1&&_>=0);break}}}finally{be=!1,pe.current=S,Qr(),Error.prepareStackTrace=b}var G=e?e.displayName||e.name:"",$=G?ce(G):"";return typeof e=="function"&&le.set(e,$),$}function rt(e,a,i){return Ge(e,!1)}function tt(e){var a=e.prototype;return!!(a&&a.isReactComponent)}function se(e,a,i){if(e==null)return"";if(typeof e=="function")return Ge(e,tt(e));if(typeof e=="string")return ce(e);switch(e){case C:return ce("Suspense");case g:return ce("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case y:return rt(e.render);case w:return se(e.type,a,i);case O:{var s=e,b=s._payload,S=s._init;try{return se(S(b),a,i)}catch{}}}return""}var re=Object.prototype.hasOwnProperty,Ke={},Ze=T.ReactDebugCurrentFrame;function fe(e){if(e){var a=e._owner,i=se(e.type,e._source,a?a.type:null);Ze.setExtraStackFrame(i)}else Ze.setExtraStackFrame(null)}function nt(e,a,i,s,b){{var S=Function.call.bind(re);for(var p in e)if(S(e,p)){var h=void 0;try{if(typeof e[p]!="function"){var j=Error((s||"React class")+": "+i+" type `"+p+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[p]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw j.name="Invariant Violation",j}h=e[p](a,p,s,i,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(R){h=R}h&&!(h instanceof Error)&&(fe(b),E("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",s||"React class",i,p,typeof h),fe(null)),h instanceof Error&&!(h.message in Ke)&&(Ke[h.message]=!0,fe(b),E("Failed %s type: %s",i,h.message),fe(null))}}}var at=Array.isArray;function Ee(e){return at(e)}function ot(e){{var a=typeof Symbol=="function"&&Symbol.toStringTag,i=a&&e[Symbol.toStringTag]||e.constructor.name||"Object";return i}}function it(e){try{return Qe(e),!1}catch{return!0}}function Qe(e){return""+e}function er(e){if(it(e))return E("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",ot(e)),Qe(e)}var te=T.ReactCurrentOwner,ut={key:!0,ref:!0,__self:!0,__source:!0},rr,tr,Se;Se={};function ct(e){if(re.call(e,"ref")){var a=Object.getOwnPropertyDescriptor(e,"ref").get;if(a&&a.isReactWarning)return!1}return e.ref!==void 0}function lt(e){if(re.call(e,"key")){var a=Object.getOwnPropertyDescriptor(e,"key").get;if(a&&a.isReactWarning)return!1}return e.key!==void 0}function st(e,a){if(typeof e.ref=="string"&&te.current&&a&&te.current.stateNode!==a){var i=M(te.current.type);Se[i]||(E('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',M(te.current.type),e.ref),Se[i]=!0)}}function ft(e,a){{var i=function(){rr||(rr=!0,E("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",a))};i.isReactWarning=!0,Object.defineProperty(e,"key",{get:i,configurable:!0})}}function dt(e,a){{var i=function(){tr||(tr=!0,E("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",a))};i.isReactWarning=!0,Object.defineProperty(e,"ref",{get:i,configurable:!0})}}var vt=function(e,a,i,s,b,S,p){var h={$$typeof:t,type:e,key:a,ref:i,props:p,_owner:S};return h._store={},Object.defineProperty(h._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(h,"_self",{configurable:!1,enumerable:!1,writable:!1,value:s}),Object.defineProperty(h,"_source",{configurable:!1,enumerable:!1,writable:!1,value:b}),Object.freeze&&(Object.freeze(h.props),Object.freeze(h)),h};function ht(e,a,i,s,b){{var S,p={},h=null,j=null;i!==void 0&&(er(i),h=""+i),lt(a)&&(er(a.key),h=""+a.key),ct(a)&&(j=a.ref,st(a,b));for(S in a)re.call(a,S)&&!ut.hasOwnProperty(S)&&(p[S]=a[S]);if(e&&e.defaultProps){var R=e.defaultProps;for(S in R)p[S]===void 0&&(p[S]=R[S])}if(h||j){var _=typeof e=="function"?e.displayName||e.name||"Unknown":e;h&&ft(p,_),j&&dt(p,_)}return vt(e,h,j,b,s,te.current,p)}}var we=T.ReactCurrentOwner,nr=T.ReactDebugCurrentFrame;function q(e){if(e){var a=e._owner,i=se(e.type,e._source,a?a.type:null);nr.setExtraStackFrame(i)}else nr.setExtraStackFrame(null)}var Re;Re=!1;function Ce(e){return typeof e=="object"&&e!==null&&e.$$typeof===t}function ar(){{if(we.current){var e=M(we.current.type);if(e)return`
Check the render method of \``+e+"`."}return""}}function gt(e){return""}var or={};function mt(e){{var a=ar();if(!a){var i=typeof e=="string"?e:e.displayName||e.name;i&&(a=`
Check the top-level render call using <`+i+">.")}return a}}function ir(e,a){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var i=mt(a);if(or[i])return;or[i]=!0;var s="";e&&e._owner&&e._owner!==we.current&&(s=" It was passed a child from "+M(e._owner.type)+"."),q(e),E('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',i,s),q(null)}}function ur(e,a){{if(typeof e!="object")return;if(Ee(e))for(var i=0;i<e.length;i++){var s=e[i];Ce(s)&&ir(s,a)}else if(Ce(e))e._store&&(e._store.validated=!0);else if(e){var b=m(e);if(typeof b=="function"&&b!==e.entries)for(var S=b.call(e),p;!(p=S.next()).done;)Ce(p.value)&&ir(p.value,a)}}}function pt(e){{var a=e.type;if(a==null||typeof a=="string")return;var i;if(typeof a=="function")i=a.propTypes;else if(typeof a=="object"&&(a.$$typeof===y||a.$$typeof===w))i=a.propTypes;else return;if(i){var s=M(a);nt(i,e.props,"prop",s,e)}else if(a.PropTypes!==void 0&&!Re){Re=!0;var b=M(a);E("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",b||"Unknown")}typeof a.getDefaultProps=="function"&&!a.getDefaultProps.isReactClassApproved&&E("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function yt(e){{for(var a=Object.keys(e.props),i=0;i<a.length;i++){var s=a[i];if(s!=="children"&&s!=="key"){q(e),E("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",s),q(null);break}}e.ref!==null&&(q(e),E("Invalid attribute `ref` supplied to `React.Fragment`."),q(null))}}var cr={};function lr(e,a,i,s,b,S){{var p=Gr(e);if(!p){var h="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(h+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var j=gt();j?h+=j:h+=ar();var R;e===null?R="null":Ee(e)?R="array":e!==void 0&&e.$$typeof===t?(R="<"+(M(e.type)||"Unknown")+" />",h=" Did you accidentally export a JSX literal instead of a component?"):R=typeof e,E("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",R,h)}var _=ht(e,a,i,b,S);if(_==null)return _;if(p){var F=a.children;if(F!==void 0)if(s)if(Ee(F)){for(var G=0;G<F.length;G++)ur(F[G],e);Object.freeze&&Object.freeze(F)}else E("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else ur(F,e)}if(re.call(a,"key")){var $=M(e),A=Object.keys(a).filter(function(Ct){return Ct!=="key"}),_e=A.length>0?"{key: someKey, "+A.join(": ..., ")+": ...}":"{key: someKey}";if(!cr[$+_e]){var Rt=A.length>0?"{"+A.join(": ..., ")+": ...}":"{}";E(`A props object containing a "key" prop is being spread into JSX:
let props = %s;
<%s {...props} />
React keys must be passed directly to JSX without using spread:
let props = %s;
<%s key={someKey} {...props} />`,_e,$,Rt,$),cr[$+_e]=!0}}return e===n?yt(_):pt(_),_}}function bt(e,a,i){return lr(e,a,i,!0)}function Et(e,a,i){return lr(e,a,i,!1)}var St=Et,wt=bt;Z.Fragment=n,Z.jsx=St,Z.jsxs=wt}()),Z}process.env.NODE_ENV==="production"?de.exports=fr():de.exports=dr();var U=de.exports,W=function(){return W=Object.assign||function(t){for(var o,n=1,c=arguments.length;n<c;n++){o=arguments[n];for(var f in o)Object.prototype.hasOwnProperty.call(o,f)&&(t[f]=o[f])}return t},W.apply(this,arguments)};function Oe(r,t){var o={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&t.indexOf(n)<0&&(o[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var c=0,n=Object.getOwnPropertySymbols(r);c<n.length;c++)t.indexOf(n[c])<0&&Object.prototype.propertyIsEnumerable.call(r,n[c])&&(o[n[c]]=r[n[c]]);return o}function vr(r,t,o){if(o||arguments.length===2)for(var n=0,c=t.length,f;n<c;n++)(f||!(n in t))&&(f||(f=Array.prototype.slice.call(t,0,n)),f[n]=t[n]);return r.concat(f||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var ne="right-scroll-bar-position",ae="width-before-scroll-bar",hr="with-scroll-bars-hidden",gr="--removed-body-scroll-bar-size";function ve(r,t){return typeof r=="function"?r(t):r&&(r.current=t),r}function mr(r,t){var o=P.useState(function(){return{value:r,callback:t,facade:{get current(){return o.value},set current(n){var c=o.value;c!==n&&(o.value=n,o.callback(n,c))}}}})[0];return o.callback=t,o.facade}var pr=typeof window<"u"?v.useLayoutEffect:v.useEffect,ke=new WeakMap;function yr(r,t){var o=mr(null,function(n){return r.forEach(function(c){return ve(c,n)})});return pr(function(){var n=ke.get(o);if(n){var c=new Set(n),f=new Set(r),d=o.current;c.forEach(function(l){f.has(l)||ve(l,null)}),f.forEach(function(l){c.has(l)||ve(l,d)})}ke.set(o,r)},[r]),o}function br(r){return r}function Er(r,t){t===void 0&&(t=br);var o=[],n=!1,c={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return o.length?o[o.length-1]:r},useMedium:function(f){var d=t(f,n);return o.push(d),function(){o=o.filter(function(l){return l!==d})}},assignSyncMedium:function(f){for(n=!0;o.length;){var d=o;o=[],d.forEach(f)}o={push:function(l){return f(l)},filter:function(){return o}}},assignMedium:function(f){n=!0;var d=[];if(o.length){var l=o;o=[],l.forEach(f),d=o}var y=function(){var g=d;d=[],g.forEach(f)},C=function(){return Promise.resolve().then(y)};C(),o={push:function(g){d.push(g),C()},filter:function(g){return d=d.filter(g),o}}}};return c}function Sr(r){r===void 0&&(r={});var t=Er(null);return t.options=W({async:!0,ssr:!1},r),t}var xe=function(r){var t=r.sideCar,o=Oe(r,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return v.createElement(n,W({},o))};xe.isSideCarExport=!0;function wr(r,t){return r.useMedium(t),xe}var je=Sr(),he=function(){},oe=v.forwardRef(function(r,t){var o=v.useRef(null),n=v.useState({onScrollCapture:he,onWheelCapture:he,onTouchMoveCapture:he}),c=n[0],f=n[1],d=r.forwardProps,l=r.children,y=r.className,C=r.removeScrollBar,g=r.enabled,w=r.shards,O=r.sideCar,x=r.noIsolation,D=r.inert,u=r.allowPinchZoom,m=r.as,T=m===void 0?"div":m,E=r.gapMode,I=Oe(r,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),L=O,k=yr([o,t]),N=W(W({},I),c);return v.createElement(v.Fragment,null,g&&v.createElement(L,{sideCar:je,removeScrollBar:C,shards:w,noIsolation:x,inert:D,setCallbacks:f,allowPinchZoom:!!u,lockRef:o,gapMode:E}),d?v.cloneElement(v.Children.only(l),W(W({},N),{ref:k})):v.createElement(T,W({},N,{className:y,ref:k}),l))});oe.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},oe.classNames={fullWidth:ae,zeroRight:ne};var Rr=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Cr(){if(!document)return null;var r=document.createElement("style");r.type="text/css";var t=Rr();return t&&r.setAttribute("nonce",t),r}function _r(r,t){r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}function Tr(r){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(r)}var Pr=function(){var r=0,t=null;return{add:function(o){r==0&&(t=Cr())&&(_r(t,o),Tr(t)),r++},remove:function(){r--,!r&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Or=function(){var r=Pr();return function(t,o){v.useEffect(function(){return r.add(t),function(){r.remove()}},[t&&o])}},Ae=function(){var r=Or(),t=function(o){var n=o.styles,c=o.dynamic;return r(n,c),null};return t},kr={left:0,top:0,right:0,gap:0},ge=function(r){return parseInt(r||"",10)||0},xr=function(r){var t=window.getComputedStyle(document.body),o=t[r==="padding"?"paddingLeft":"marginLeft"],n=t[r==="padding"?"paddingTop":"marginTop"],c=t[r==="padding"?"paddingRight":"marginRight"];return[ge(o),ge(n),ge(c)]},jr=function(r){if(r===void 0&&(r="margin"),typeof window>"u")return kr;var t=xr(r),o=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-o+t[2]-t[0])}},Ar=Ae(),X="data-scroll-locked",Dr=function(r,t,o,n){var c=r.left,f=r.top,d=r.right,l=r.gap;return o===void 0&&(o="margin"),`
.`.concat(hr,` {
overflow: hidden `).concat(n,`;
padding-right: `).concat(l,"px ").concat(n,`;
(function(x,p){typeof exports=="object"&&typeof module<"u"?p(exports,require("react/jsx-runtime"),require("react")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react"],p):(x=typeof globalThis<"u"?globalThis:x||self,p(x["simple-search-dropdown"]={},x["react/jsx-runtime"],x.React))})(this,function(x,p,g){"use strict";function re(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const u=re(g);var w=function(){return w=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},w.apply(this,arguments)};function z(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function ne(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,i;r<o;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var M="right-scroll-bar-position",B="width-before-scroll-bar",ae="with-scroll-bars-hidden",oe="--removed-body-scroll-bar-size";function D(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function ce(e,t){var n=g.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var ie=typeof window<"u"?u.useLayoutEffect:u.useEffect,H=new WeakMap;function ue(e,t){var n=ce(null,function(r){return e.forEach(function(o){return D(o,r)})});return ie(function(){var r=H.get(n);if(r){var o=new Set(r),i=new Set(e),l=n.current;o.forEach(function(c){i.has(c)||D(c,null)}),i.forEach(function(c){o.has(c)||D(c,l)})}H.set(n,e)},[e]),n}function le(e){return e}function se(e,t){t===void 0&&(t=le);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var l=t(i,r);return n.push(l),function(){n=n.filter(function(c){return c!==l})}},assignSyncMedium:function(i){for(r=!0;n.length;){var l=n;n=[],l.forEach(i)}n={push:function(c){return i(c)},filter:function(){return n}}},assignMedium:function(i){r=!0;var l=[];if(n.length){var c=n;n=[],c.forEach(i),l=n}var d=function(){var f=l;l=[],f.forEach(i)},h=function(){return Promise.resolve().then(d)};h(),n={push:function(f){l.push(f),h()},filter:function(f){return l=l.filter(f),n}}}};return o}function fe(e){e===void 0&&(e={});var t=se(null);return t.options=w({async:!0,ssr:!1},e),t}var _=function(e){var t=e.sideCar,n=z(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return u.createElement(r,w({},n))};_.isSideCarExport=!0;function de(e,t){return e.useMedium(t),_}var F=fe(),X=function(){},j=u.forwardRef(function(e,t){var n=u.useRef(null),r=u.useState({onScrollCapture:X,onWheelCapture:X,onTouchMoveCapture:X}),o=r[0],i=r[1],l=e.forwardProps,c=e.children,d=e.className,h=e.removeScrollBar,f=e.enabled,m=e.shards,C=e.sideCar,S=e.noIsolation,E=e.inert,a=e.allowPinchZoom,s=e.as,y=s===void 0?"div":s,k=e.gapMode,b=z(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),P=C,v=ue([n,t]),N=w(w({},b),o);return u.createElement(u.Fragment,null,f&&u.createElement(P,{sideCar:F,removeScrollBar:h,shards:m,noIsolation:S,inert:E,setCallbacks:i,allowPinchZoom:!!a,lockRef:n,gapMode:k}),l?u.cloneElement(u.Children.only(c),w(w({},N),{ref:v})):u.createElement(y,w({},N,{className:d,ref:v}),c))});j.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},j.classNames={fullWidth:B,zeroRight:M};var ve=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function he(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=ve();return t&&e.setAttribute("nonce",t),e}function ge(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function me(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var ye=function(){var e=0,t=null;return{add:function(n){e==0&&(t=he())&&(ge(t,n),me(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Se=function(){var e=ye();return function(t,n){u.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Z=function(){var e=Se(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},be={left:0,top:0,right:0,gap:0},Y=function(e){return parseInt(e||"",10)||0},pe=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Y(n),Y(r),Y(o)]},we=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return be;var t=pe(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Ce=Z(),L="data-scroll-locked",Ee=function(e,t,n,r){var o=e.left,i=e.top,l=e.right,c=e.gap;return n===void 0&&(n="margin"),`
.`.concat(ae,` {
overflow: hidden `).concat(r,`;
padding-right: `).concat(c,"px ").concat(r,`;
}
body[`).concat(X,`] {
overflow: hidden `).concat(n,`;
body[`).concat(L,`] {
overflow: hidden `).concat(r,`;
overscroll-behavior: contain;
`).concat([t&&"position: relative ".concat(n,";"),o==="margin"&&`
padding-left: `.concat(c,`px;
padding-top: `).concat(f,`px;
padding-right: `).concat(d,`px;
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
padding-left: `.concat(o,`px;
padding-top: `).concat(i,`px;
padding-right: `).concat(l,`px;
margin-left:0;
margin-top:0;
margin-right: `).concat(l,"px ").concat(n,`;
`),o==="padding"&&"padding-right: ".concat(l,"px ").concat(n,";")].filter(Boolean).join(""),`
margin-right: `).concat(c,"px ").concat(r,`;
`),n==="padding"&&"padding-right: ".concat(c,"px ").concat(r,";")].filter(Boolean).join(""),`
}
.`).concat(ne,` {
right: `).concat(l,"px ").concat(n,`;
.`).concat(M,` {
right: `).concat(c,"px ").concat(r,`;
}
.`).concat(ae,` {
margin-right: `).concat(l,"px ").concat(n,`;
.`).concat(B,` {
margin-right: `).concat(c,"px ").concat(r,`;
}
.`).concat(ne," .").concat(ne,` {
right: 0 `).concat(n,`;
.`).concat(M," .").concat(M,` {
right: 0 `).concat(r,`;
}
.`).concat(ae," .").concat(ae,` {
margin-right: 0 `).concat(n,`;
.`).concat(B," .").concat(B,` {
margin-right: 0 `).concat(r,`;
}
body[`).concat(X,`] {
`).concat(gr,": ").concat(l,`px;
body[`).concat(L,`] {
`).concat(oe,": ").concat(c,`px;
}
`)},De=function(){var r=parseInt(document.body.getAttribute(X)||"0",10);return isFinite(r)?r:0},Ir=function(){v.useEffect(function(){return document.body.setAttribute(X,(De()+1).toString()),function(){var r=De()-1;r<=0?document.body.removeAttribute(X):document.body.setAttribute(X,r.toString())}},[])},Fr=function(r){var t=r.noRelative,o=r.noImportant,n=r.gapMode,c=n===void 0?"margin":n;Ir();var f=v.useMemo(function(){return jr(c)},[c]);return v.createElement(Ar,{styles:Dr(f,!t,c,o?"":"!important")})},me=!1;if(typeof window<"u")try{var ie=Object.defineProperty({},"passive",{get:function(){return me=!0,!0}});window.addEventListener("test",ie,ie),window.removeEventListener("test",ie,ie)}catch{me=!1}var z=me?{passive:!1}:!1,Lr=function(r){return r.tagName==="TEXTAREA"},Ie=function(r,t){if(!(r instanceof Element))return!1;var o=window.getComputedStyle(r);return o[t]!=="hidden"&&!(o.overflowY===o.overflowX&&!Lr(r)&&o[t]==="visible")},Wr=function(r){return Ie(r,"overflowY")},Mr=function(r){return Ie(r,"overflowX")},Fe=function(r,t){var o=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var c=Le(r,n);if(c){var f=We(r,n),d=f[1],l=f[2];if(d>l)return!0}n=n.parentNode}while(n&&n!==o.body);return!1},Nr=function(r){var t=r.scrollTop,o=r.scrollHeight,n=r.clientHeight;return[t,o,n]},Yr=function(r){var t=r.scrollLeft,o=r.scrollWidth,n=r.clientWidth;return[t,o,n]},Le=function(r,t){return r==="v"?Wr(t):Mr(t)},We=function(r,t){return r==="v"?Nr(t):Yr(t)},Br=function(r,t){return r==="h"&&t==="rtl"?-1:1},Vr=function(r,t,o,n,c){var f=Br(r,window.getComputedStyle(t).direction),d=f*n,l=o.target,y=t.contains(l),C=!1,g=d>0,w=0,O=0;do{var x=We(r,l),D=x[0],u=x[1],m=x[2],T=u-m-f*D;(D||T)&&Le(r,l)&&(w+=T,O+=D),l instanceof ShadowRoot?l=l.host:l=l.parentNode}while(!y&&l!==document.body||y&&(t.contains(l)||t===l));return(g&&(Math.abs(w)<1||!c)||!g&&(Math.abs(O)<1||!c))&&(C=!0),C},ue=function(r){return"changedTouches"in r?[r.changedTouches[0].clientX,r.changedTouches[0].clientY]:[0,0]},Me=function(r){return[r.deltaX,r.deltaY]},Ne=function(r){return r&&"current"in r?r.current:r},$r=function(r,t){return r[0]===t[0]&&r[1]===t[1]},Ur=function(r){return`
.block-interactivity-`.concat(r,` {pointer-events: none;}
.allow-interactivity-`).concat(r,` {pointer-events: all;}
`)},Xr=0,H=[];function zr(r){var t=v.useRef([]),o=v.useRef([0,0]),n=v.useRef(),c=v.useState(Xr++)[0],f=v.useState(Ae)[0],d=v.useRef(r);v.useEffect(function(){d.current=r},[r]),v.useEffect(function(){if(r.inert){document.body.classList.add("block-interactivity-".concat(c));var u=vr([r.lockRef.current],(r.shards||[]).map(Ne),!0).filter(Boolean);return u.forEach(function(m){return m.classList.add("allow-interactivity-".concat(c))}),function(){document.body.classList.remove("block-interactivity-".concat(c)),u.forEach(function(m){return m.classList.remove("allow-interactivity-".concat(c))})}}},[r.inert,r.lockRef.current,r.shards]);var l=v.useCallback(function(u,m){if("touches"in u&&u.touches.length===2)return!d.current.allowPinchZoom;var T=ue(u),E=o.current,I="deltaX"in u?u.deltaX:E[0]-T[0],L="deltaY"in u?u.deltaY:E[1]-T[1],k,N=u.target,B=Math.abs(I)>Math.abs(L)?"h":"v";if("touches"in u&&B==="h"&&N.type==="range")return!1;var J=Fe(B,N);if(!J)return!0;if(J?k=B:(k=B==="v"?"h":"v",J=Fe(B,N)),!J)return!1;if(!n.current&&"changedTouches"in u&&(I||L)&&(n.current=k),!k)return!0;var Q=n.current||k;return Vr(Q,m,u,Q==="h"?I:L,!0)},[]),y=v.useCallback(function(u){var m=u;if(!(!H.length||H[H.length-1]!==f)){var T="deltaY"in m?Me(m):ue(m),E=t.current.filter(function(k){return k.name===m.type&&(k.target===m.target||m.target===k.shadowParent)&&$r(k.delta,T)})[0];if(E&&E.should){m.cancelable&&m.preventDefault();return}if(!E){var I=(d.current.shards||[]).map(Ne).filter(Boolean).filter(function(k){return k.contains(m.target)}),L=I.length>0?l(m,I[0]):!d.current.noIsolation;L&&m.cancelable&&m.preventDefault()}}},[]),C=v.useCallback(function(u,m,T,E){var I={name:u,delta:m,target:T,should:E,shadowParent:Hr(T)};t.current.push(I),setTimeout(function(){t.current=t.current.filter(function(L){return L!==I})},1)},[]),g=v.useCallback(function(u){o.current=ue(u),n.current=void 0},[]),w=v.useCallback(function(u){C(u.type,Me(u),u.target,l(u,r.lockRef.current))},[]),O=v.useCallback(function(u){C(u.type,ue(u),u.target,l(u,r.lockRef.current))},[]);v.useEffect(function(){return H.push(f),r.setCallbacks({onScrollCapture:w,onWheelCapture:w,onTouchMoveCapture:O}),document.addEventListener("wheel",y,z),document.addEventListener("touchmove",y,z),document.addEventListener("touchstart",g,z),function(){H=H.filter(function(u){return u!==f}),document.removeEventListener("wheel",y,z),document.removeEventListener("touchmove",y,z),document.removeEventListener("touchstart",g,z)}},[]);var x=r.removeScrollBar,D=r.inert;return v.createElement(v.Fragment,null,D?v.createElement(f,{styles:Ur(c)}):null,x?v.createElement(Fr,{gapMode:r.gapMode}):null)}function Hr(r){for(var t=null;r!==null;)r instanceof ShadowRoot&&(t=r.host,r=r.host),r=r.parentNode;return t}const Jr=wr(je,zr);var Ye=v.forwardRef(function(r,t){return v.createElement(oe,W({},r,{ref:t,sideCar:Jr}))});Ye.classNames=oe.classNames;const qr=P.forwardRef((r,t)=>{const[o,n]=P.useState(!1),[c,f]=P.useState(!1),[d,l]=P.useState(),[y,C]=P.useState(),[g,w]=P.useState(),O=P.useRef(null),x=P.useRef(null);P.useEffect(()=>{if(c){f(!1);return}if(g!=null&&g.length&&y&&w(void 0),r.data&&typeof r.data=="function"){const u=r.data(y);if(u instanceof Promise){u.then(m=>{w(m)});return}w(u)}else r.data&&w(r.data)},[c]);const D=u=>{const m=u.target;O.current&&!O.current.contains(m)&&x.current&&!x.current.contains(m)&&n(!1)};return P.useEffect(()=>(document.addEventListener("mousedown",D),()=>{document.removeEventListener("mousedown",D)}),[]),U.jsxs("div",{children:[U.jsx("input",{ref:O,onFocus:()=>n(!0),className:"p-2 bg-gray-200 cursor-pointer focus:cursor-text",type:"text",placeholder:r.placeholder,onBlur:r.onBlur,value:(d==null?void 0:d.label)||y,onChange:u=>{C(u.target.value.toLowerCase()),f(!0),r.onChange&&r.onChange(u)}}),U.jsx("input",{ref:t,name:r.name,disabled:!0,className:"hidden",type:"text",value:d==null?void 0:d.value}),o&&g&&g.length>0&&U.jsx(Ye,{children:U.jsx("div",{ref:x,className:"absolute z-10 w-full bg-white border border-gray-300 rounded mt-1",children:g.filter(u=>String(u.label).toLowerCase().indexOf(y??"")>-1).map((u,m)=>U.jsx("div",{className:"p-2 cursor-pointer hover:bg-gray-100",onClick:()=>{l(u),n(!1)},children:u.label},m))})})]})});Y.SearchSelect=qr,Object.defineProperty(Y,Symbol.toStringTag,{value:"Module"})});
//# sourceMappingURL=index.umd.js.map
`)},Q=function(){var e=parseInt(document.body.getAttribute(L)||"0",10);return isFinite(e)?e:0},ke=function(){u.useEffect(function(){return document.body.setAttribute(L,(Q()+1).toString()),function(){var e=Q()-1;e<=0?document.body.removeAttribute(L):document.body.setAttribute(L,e.toString())}},[])},Pe=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;ke();var i=u.useMemo(function(){return we(o)},[o]);return u.createElement(Ce,{styles:Ee(i,!t,o,n?"":"!important")})},V=!1;if(typeof window<"u")try{var I=Object.defineProperty({},"passive",{get:function(){return V=!0,!0}});window.addEventListener("test",I,I),window.removeEventListener("test",I,I)}catch{V=!1}var R=V?{passive:!1}:!1,xe=function(e){return e.tagName==="TEXTAREA"},q=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!xe(e)&&n[t]==="visible")},Le=function(e){return q(e,"overflowY")},Re=function(e){return q(e,"overflowX")},G=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=U(e,r);if(o){var i=$(e,r),l=i[1],c=i[2];if(l>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Te=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Ne=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},U=function(e,t){return e==="v"?Le(t):Re(t)},$=function(e,t){return e==="v"?Te(t):Ne(t)},Oe=function(e,t){return e==="h"&&t==="rtl"?-1:1},Me=function(e,t,n,r,o){var i=Oe(e,window.getComputedStyle(t).direction),l=i*r,c=n.target,d=t.contains(c),h=!1,f=l>0,m=0,C=0;do{var S=$(e,c),E=S[0],a=S[1],s=S[2],y=a-s-i*E;(E||y)&&U(e,c)&&(m+=y,C+=E),c instanceof ShadowRoot?c=c.host:c=c.parentNode}while(!d&&c!==document.body||d&&(t.contains(c)||t===c));return(f&&(Math.abs(m)<1||!o)||!f&&(Math.abs(C)<1||!o))&&(h=!0),h},A=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},J=function(e){return[e.deltaX,e.deltaY]},K=function(e){return e&&"current"in e?e.current:e},Be=function(e,t){return e[0]===t[0]&&e[1]===t[1]},je=function(e){return`
.block-interactivity-`.concat(e,` {pointer-events: none;}
.allow-interactivity-`).concat(e,` {pointer-events: all;}
`)},Ie=0,T=[];function Ae(e){var t=u.useRef([]),n=u.useRef([0,0]),r=u.useRef(),o=u.useState(Ie++)[0],i=u.useState(Z)[0],l=u.useRef(e);u.useEffect(function(){l.current=e},[e]),u.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var a=ne([e.lockRef.current],(e.shards||[]).map(K),!0).filter(Boolean);return a.forEach(function(s){return s.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),a.forEach(function(s){return s.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var c=u.useCallback(function(a,s){if("touches"in a&&a.touches.length===2)return!l.current.allowPinchZoom;var y=A(a),k=n.current,b="deltaX"in a?a.deltaX:k[0]-y[0],P="deltaY"in a?a.deltaY:k[1]-y[1],v,N=a.target,O=Math.abs(b)>Math.abs(P)?"h":"v";if("touches"in a&&O==="h"&&N.type==="range")return!1;var W=G(O,N);if(!W)return!0;if(W?v=O:(v=O==="v"?"h":"v",W=G(O,N)),!W)return!1;if(!r.current&&"changedTouches"in a&&(b||P)&&(r.current=v),!v)return!0;var te=r.current||v;return Me(te,s,a,te==="h"?b:P,!0)},[]),d=u.useCallback(function(a){var s=a;if(!(!T.length||T[T.length-1]!==i)){var y="deltaY"in s?J(s):A(s),k=t.current.filter(function(v){return v.name===s.type&&(v.target===s.target||s.target===v.shadowParent)&&Be(v.delta,y)})[0];if(k&&k.should){s.cancelable&&s.preventDefault();return}if(!k){var b=(l.current.shards||[]).map(K).filter(Boolean).filter(function(v){return v.contains(s.target)}),P=b.length>0?c(s,b[0]):!l.current.noIsolation;P&&s.cancelable&&s.preventDefault()}}},[]),h=u.useCallback(function(a,s,y,k){var b={name:a,delta:s,target:y,should:k,shadowParent:We(y)};t.current.push(b),setTimeout(function(){t.current=t.current.filter(function(P){return P!==b})},1)},[]),f=u.useCallback(function(a){n.current=A(a),r.current=void 0},[]),m=u.useCallback(function(a){h(a.type,J(a),a.target,c(a,e.lockRef.current))},[]),C=u.useCallback(function(a){h(a.type,A(a),a.target,c(a,e.lockRef.current))},[]);u.useEffect(function(){return T.push(i),e.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:C}),document.addEventListener("wheel",d,R),document.addEventListener("touchmove",d,R),document.addEventListener("touchstart",f,R),function(){T=T.filter(function(a){return a!==i}),document.removeEventListener("wheel",d,R),document.removeEventListener("touchmove",d,R),document.removeEventListener("touchstart",f,R)}},[]);var S=e.removeScrollBar,E=e.inert;return u.createElement(u.Fragment,null,E?u.createElement(i,{styles:je(o)}):null,S?u.createElement(Pe,{gapMode:e.gapMode}):null)}function We(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const De=de(F,Ae);var ee=u.forwardRef(function(e,t){return u.createElement(j,w({},e,{ref:t,sideCar:De}))});ee.classNames=j.classNames;const Xe=g.forwardRef((e,t)=>{const[n,r]=g.useState(!1),[o,i]=g.useState(!1),[l,c]=g.useState(),[d,h]=g.useState(),[f,m]=g.useState(),C=g.useRef(null),S=g.useRef(null);g.useEffect(()=>{if(o){i(!1);return}if(f!=null&&f.length&&d&&m(void 0),e.data&&typeof e.data=="function"){const a=e.data(d);if(a instanceof Promise){a.then(s=>{m(s)});return}m(a)}else e.data&&m(e.data)},[o]);const E=a=>{const s=a.target;C.current&&!C.current.contains(s)&&S.current&&!S.current.contains(s)&&r(!1)};return g.useEffect(()=>(document.addEventListener("mousedown",E),()=>{document.removeEventListener("mousedown",E)}),[]),p.jsxs("div",{children:[p.jsx("input",{ref:C,onFocus:()=>r(!0),className:"p-2 bg-gray-200 cursor-pointer focus:cursor-text",type:"text",placeholder:e.placeholder,onBlur:e.onBlur,value:(l==null?void 0:l.label)||d,onChange:a=>{h(a.target.value.toLowerCase()),i(!0),e.onChange&&e.onChange(a)}}),p.jsx("input",{ref:t,name:e.name,disabled:!0,className:"hidden",type:"text",value:l==null?void 0:l.value}),n&&f&&f.length>0&&p.jsx(ee,{children:p.jsx("div",{ref:S,className:"absolute z-10 w-full bg-white border border-gray-300 rounded mt-1",children:f.filter(a=>String(a.label).toLowerCase().indexOf(d??"")>-1).map((a,s)=>p.jsx("div",{className:"p-2 cursor-pointer hover:bg-gray-100",onClick:()=>{c(a),r(!1)},children:a.label},s))})})]})});x.SearchSelect=Xe,Object.defineProperty(x,Symbol.toStringTag,{value:"Module"})});
{
"name": "simple-search-dropdown",
"private": false,
"version": "0.0.2",
"version": "0.0.3",
"main": "./dist/index.umd.js",

@@ -20,7 +20,4 @@ "module": "./dist/index.es.js",

},
"scripts": {
"dev": "vite",
"build": "tsc -b && vite build",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview"
"publishConfig": {
"access": "public"
},

@@ -49,4 +46,11 @@ "dependencies": {

"vite": "^5.4.0",
"vite-plugin-dts": "^4.0.3"
"vite-plugin-dts": "^4.0.3",
"vitest": "^2.0.5"
},
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview"
}
}
}

@@ -1,50 +0,15 @@

# React + TypeScript + Vite
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
# Search Dropdown
Currently, two official plugins are available:
Componente com sistema de pesquisa e dropdown imbutidos em um só. É possível listar todos os itens duma lista e filtrar por aquilo que você está buscando, sendo compativel até mesmo com requisições de APIs.
## Funcionalidades
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
- Tipo primitivo para customização pessoal.
- Componente já predefinido para utilidade rápida e fácil.
## Expanding the ESLint configuration
If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:
## Autores
- Configure the top-level `parserOptions` property like this:
```js
export default tseslint.config({
languageOptions: {
// other options...
parserOptions: {
project: ['./tsconfig.node.json', './tsconfig.app.json'],
tsconfigRootDir: import.meta.dirname,
},
},
})
```
- Replace `tseslint.configs.recommended` to `tseslint.configs.recommendedTypeChecked` or `tseslint.configs.strictTypeChecked`
- Optionally add `...tseslint.configs.stylisticTypeChecked`
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and update the config:
```js
// eslint.config.js
import react from 'eslint-plugin-react'
export default tseslint.config({
// Set the react version
settings: { react: { version: '18.3' } },
plugins: {
// Add the react plugin
react,
},
rules: {
// other rules...
// Enable its recommended rules
...react.configs.recommended.rules,
...react.configs['jsx-runtime'].rules,
},
})
```
- [@Aaron King](https://github.com/KingTimer12)
- [@Mateus Bessa](https://github.com/Mateusinbessa)
- [@Henrique Mota](https://github.com/henriquemota)
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc