UNPKG

@open-chat/chat-bubble

Version:

Chat bubble component.

1,294 lines 1.19 MB
import * as React$1 from "react"; import React__default, { forwardRef, useState, useCallback, createContext, useContext, useEffect, useRef, createElement, useLayoutEffect, useMemo, Children, isValidElement, cloneElement, Fragment, useReducer } from "react"; import * as ReactDOM from "react-dom"; import ReactDOM__default, { flushSync } from "react-dom"; import data from "@emoji-mart/data"; const index$2 = ""; var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {}; function getDefaultExportFromCjs(x2) { return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2; } var jsxRuntime = { exports: {} }; var reactJsxRuntime_production_min = {}; /** * @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 hasRequiredReactJsxRuntime_production_min; function requireReactJsxRuntime_production_min() { if (hasRequiredReactJsxRuntime_production_min) return reactJsxRuntime_production_min; hasRequiredReactJsxRuntime_production_min = 1; var f = React__default, k2 = Symbol.for("react.element"), l = Symbol.for("react.fragment"), m2 = Object.prototype.hasOwnProperty, n = f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, p = { key: true, ref: true, __self: true, __source: true }; function q2(c, a, g2) { var b2, d = {}, e = null, h = null; void 0 !== g2 && (e = "" + g2); void 0 !== a.key && (e = "" + a.key); void 0 !== a.ref && (h = a.ref); for (b2 in a) m2.call(a, b2) && !p.hasOwnProperty(b2) && (d[b2] = a[b2]); if (c && c.defaultProps) for (b2 in a = c.defaultProps, a) void 0 === d[b2] && (d[b2] = a[b2]); return { $$typeof: k2, type: c, key: e, ref: h, props: d, _owner: n.current }; } reactJsxRuntime_production_min.Fragment = l; reactJsxRuntime_production_min.jsx = q2; reactJsxRuntime_production_min.jsxs = q2; return reactJsxRuntime_production_min; } var reactJsxRuntime_development = {}; /** * @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 hasRequiredReactJsxRuntime_development; function requireReactJsxRuntime_development() { if (hasRequiredReactJsxRuntime_development) return reactJsxRuntime_development; hasRequiredReactJsxRuntime_development = 1; if (process.env.NODE_ENV !== "production") { (function() { var React2 = React__default; var REACT_ELEMENT_TYPE = Symbol.for("react.element"); var REACT_PORTAL_TYPE = Symbol.for("react.portal"); var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"); var REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"); var REACT_PROFILER_TYPE = Symbol.for("react.profiler"); var REACT_PROVIDER_TYPE = Symbol.for("react.provider"); var REACT_CONTEXT_TYPE = Symbol.for("react.context"); var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"); var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"); var REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"); var REACT_MEMO_TYPE = Symbol.for("react.memo"); var REACT_LAZY_TYPE = Symbol.for("react.lazy"); var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"); var MAYBE_ITERATOR_SYMBOL = Symbol.iterator; var FAUX_ITERATOR_SYMBOL = "@@iterator"; function getIteratorFn(maybeIterable) { if (maybeIterable === null || typeof maybeIterable !== "object") { return null; } var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]; if (typeof maybeIterator === "function") { return maybeIterator; } return null; } var ReactSharedInternals = React2.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; function error(format3) { { { for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { args[_key2 - 1] = arguments[_key2]; } printWarning("error", format3, args); } } } function printWarning(level, format3, args) { { var ReactDebugCurrentFrame2 = ReactSharedInternals.ReactDebugCurrentFrame; var stack = ReactDebugCurrentFrame2.getStackAddendum(); if (stack !== "") { format3 += "%s"; args = args.concat([stack]); } var argsWithFormat = args.map(function(item) { return String(item); }); argsWithFormat.unshift("Warning: " + format3); Function.prototype.apply.call(console[level], console, argsWithFormat); } } var enableScopeAPI = false; var enableCacheElement = false; var enableTransitionTracing = false; var enableLegacyHidden = false; var enableDebugTracing = false; var REACT_MODULE_REFERENCE; { REACT_MODULE_REFERENCE = Symbol.for("react.module.reference"); } function isValidElementType(type) { if (typeof type === "string" || typeof type === "function") { return true; } if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing) { return true; } if (typeof type === "object" && type !== null) { if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // 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. type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== void 0) { return true; } } return false; } function getWrappedName(outerType, innerType, wrapperName) { var displayName = outerType.displayName; if (displayName) { return displayName; } var functionName = innerType.displayName || innerType.name || ""; return functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName; } function getContextName(type) { return type.displayName || "Context"; } function getComponentNameFromType(type) { if (type == null) { return null; } { if (typeof type.tag === "number") { error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."); } } if (typeof type === "function") { return type.displayName || type.name || null; } if (typeof type === "string") { return type; } switch (type) { case REACT_FRAGMENT_TYPE: return "Fragment"; case REACT_PORTAL_TYPE: return "Portal"; case REACT_PROFILER_TYPE: return "Profiler"; case REACT_STRICT_MODE_TYPE: return "StrictMode"; case REACT_SUSPENSE_TYPE: return "Suspense"; case REACT_SUSPENSE_LIST_TYPE: return "SuspenseList"; } if (typeof type === "object") { switch (type.$$typeof) { case REACT_CONTEXT_TYPE: var context = type; return getContextName(context) + ".Consumer"; case REACT_PROVIDER_TYPE: var provider = type; return getContextName(provider._context) + ".Provider"; case REACT_FORWARD_REF_TYPE: return getWrappedName(type, type.render, "ForwardRef"); case REACT_MEMO_TYPE: var outerName = type.displayName || null; if (outerName !== null) { return outerName; } return getComponentNameFromType(type.type) || "Memo"; case REACT_LAZY_TYPE: { var lazyComponent = type; var payload = lazyComponent._payload; var init = lazyComponent._init; try { return getComponentNameFromType(init(payload)); } catch (x2) { return null; } } } } return null; } var assign = Object.assign; var disabledDepth = 0; var prevLog; var prevInfo; var prevWarn; var prevError; var prevGroup; var prevGroupCollapsed; var prevGroupEnd; function disabledLog() { } disabledLog.__reactDisabledLog = true; function disableLogs() { { if (disabledDepth === 0) { prevLog = console.log; prevInfo = console.info; prevWarn = console.warn; prevError = console.error; prevGroup = console.group; prevGroupCollapsed = console.groupCollapsed; prevGroupEnd = console.groupEnd; var props = { configurable: true, enumerable: true, value: disabledLog, writable: true }; Object.defineProperties(console, { info: props, log: props, warn: props, error: props, group: props, groupCollapsed: props, groupEnd: props }); } disabledDepth++; } } function reenableLogs() { { disabledDepth--; if (disabledDepth === 0) { var props = { configurable: true, enumerable: true, writable: true }; Object.defineProperties(console, { log: assign({}, props, { value: prevLog }), info: assign({}, props, { value: prevInfo }), warn: assign({}, props, { value: prevWarn }), error: assign({}, props, { value: prevError }), group: assign({}, props, { value: prevGroup }), groupCollapsed: assign({}, props, { value: prevGroupCollapsed }), groupEnd: assign({}, props, { value: prevGroupEnd }) }); } if (disabledDepth < 0) { error("disabledDepth fell below zero. This is a bug in React. Please file an issue."); } } } var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher; var prefix; function describeBuiltInComponentFrame(name, source, ownerFn) { { if (prefix === void 0) { try { throw Error(); } catch (x2) { var match = x2.stack.trim().match(/\n( *(at )?)/); prefix = match && match[1] || ""; } } return "\n" + prefix + name; } } var reentry = false; var componentFrameCache; { var PossiblyWeakMap = typeof WeakMap === "function" ? WeakMap : Map; componentFrameCache = new PossiblyWeakMap(); } function describeNativeComponentFrame(fn, construct) { if (!fn || reentry) { return ""; } { var frame = componentFrameCache.get(fn); if (frame !== void 0) { return frame; } } var control; reentry = true; var previousPrepareStackTrace = Error.prepareStackTrace; Error.prepareStackTrace = void 0; var previousDispatcher; { previousDispatcher = ReactCurrentDispatcher.current; ReactCurrentDispatcher.current = null; disableLogs(); } try { if (construct) { var Fake = function() { throw Error(); }; Object.defineProperty(Fake.prototype, "props", { set: function() { throw Error(); } }); if (typeof Reflect === "object" && Reflect.construct) { try { Reflect.construct(Fake, []); } catch (x2) { control = x2; } Reflect.construct(fn, [], Fake); } else { try { Fake.call(); } catch (x2) { control = x2; } fn.call(Fake.prototype); } } else { try { throw Error(); } catch (x2) { control = x2; } fn(); } } catch (sample) { if (sample && control && typeof sample.stack === "string") { var sampleLines = sample.stack.split("\n"); var controlLines = control.stack.split("\n"); var s = sampleLines.length - 1; var c = controlLines.length - 1; while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) { c--; } for (; s >= 1 && c >= 0; s--, c--) { if (sampleLines[s] !== controlLines[c]) { if (s !== 1 || c !== 1) { do { s--; c--; if (c < 0 || sampleLines[s] !== controlLines[c]) { var _frame = "\n" + sampleLines[s].replace(" at new ", " at "); if (fn.displayName && _frame.includes("<anonymous>")) { _frame = _frame.replace("<anonymous>", fn.displayName); } { if (typeof fn === "function") { componentFrameCache.set(fn, _frame); } } return _frame; } } while (s >= 1 && c >= 0); } break; } } } } finally { reentry = false; { ReactCurrentDispatcher.current = previousDispatcher; reenableLogs(); } Error.prepareStackTrace = previousPrepareStackTrace; } var name = fn ? fn.displayName || fn.name : ""; var syntheticFrame = name ? describeBuiltInComponentFrame(name) : ""; { if (typeof fn === "function") { componentFrameCache.set(fn, syntheticFrame); } } return syntheticFrame; } function describeFunctionComponentFrame(fn, source, ownerFn) { { return describeNativeComponentFrame(fn, false); } } function shouldConstruct(Component) { var prototype2 = Component.prototype; return !!(prototype2 && prototype2.isReactComponent); } function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) { if (type == null) { return ""; } if (typeof type === "function") { { return describeNativeComponentFrame(type, shouldConstruct(type)); } } if (typeof type === "string") { return describeBuiltInComponentFrame(type); } switch (type) { case REACT_SUSPENSE_TYPE: return describeBuiltInComponentFrame("Suspense"); case REACT_SUSPENSE_LIST_TYPE: return describeBuiltInComponentFrame("SuspenseList"); } if (typeof type === "object") { switch (type.$$typeof) { case REACT_FORWARD_REF_TYPE: return describeFunctionComponentFrame(type.render); case REACT_MEMO_TYPE: return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn); case REACT_LAZY_TYPE: { var lazyComponent = type; var payload = lazyComponent._payload; var init = lazyComponent._init; try { return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn); } catch (x2) { } } } } return ""; } var hasOwnProperty2 = Object.prototype.hasOwnProperty; var loggedTypeFailures = {}; var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; function setCurrentlyValidatingElement(element2) { { if (element2) { var owner = element2._owner; var stack = describeUnknownElementTypeFrameInDEV(element2.type, element2._source, owner ? owner.type : null); ReactDebugCurrentFrame.setExtraStackFrame(stack); } else { ReactDebugCurrentFrame.setExtraStackFrame(null); } } } function checkPropTypes(typeSpecs, values, location, componentName, element2) { { var has2 = Function.call.bind(hasOwnProperty2); for (var typeSpecName in typeSpecs) { if (has2(typeSpecs, typeSpecName)) { var error$1 = void 0; try { if (typeof typeSpecs[typeSpecName] !== "function") { var err = Error((componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."); err.name = "Invariant Violation"; throw err; } error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"); } catch (ex) { error$1 = ex; } if (error$1 && !(error$1 instanceof Error)) { setCurrentlyValidatingElement(element2); error("%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).", componentName || "React class", location, typeSpecName, typeof error$1); setCurrentlyValidatingElement(null); } if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) { loggedTypeFailures[error$1.message] = true; setCurrentlyValidatingElement(element2); error("Failed %s type: %s", location, error$1.message); setCurrentlyValidatingElement(null); } } } } } var isArrayImpl = Array.isArray; function isArray3(a) { return isArrayImpl(a); } function typeName(value) { { var hasToStringTag = typeof Symbol === "function" && Symbol.toStringTag; var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object"; return type; } } function willCoercionThrow(value) { { try { testStringCoercion(value); return false; } catch (e) { return true; } } } function testStringCoercion(value) { return "" + value; } function checkKeyStringCoercion(value) { { if (willCoercionThrow(value)) { error("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", typeName(value)); return testStringCoercion(value); } } } var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner; var RESERVED_PROPS = { key: true, ref: true, __self: true, __source: true }; var specialPropKeyWarningShown; var specialPropRefWarningShown; var didWarnAboutStringRefs; { didWarnAboutStringRefs = {}; } function hasValidRef(config) { { if (hasOwnProperty2.call(config, "ref")) { var getter = Object.getOwnPropertyDescriptor(config, "ref").get; if (getter && getter.isReactWarning) { return false; } } } return config.ref !== void 0; } function hasValidKey(config) { { if (hasOwnProperty2.call(config, "key")) { var getter = Object.getOwnPropertyDescriptor(config, "key").get; if (getter && getter.isReactWarning) { return false; } } } return config.key !== void 0; } function warnIfStringRefCannotBeAutoConverted(config, self2) { { if (typeof config.ref === "string" && ReactCurrentOwner.current && self2 && ReactCurrentOwner.current.stateNode !== self2) { var componentName = getComponentNameFromType(ReactCurrentOwner.current.type); if (!didWarnAboutStringRefs[componentName]) { error('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', getComponentNameFromType(ReactCurrentOwner.current.type), config.ref); didWarnAboutStringRefs[componentName] = true; } } } } function defineKeyPropWarningGetter(props, displayName) { { var warnAboutAccessingKey = function() { if (!specialPropKeyWarningShown) { specialPropKeyWarningShown = true; error("%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)", displayName); } }; warnAboutAccessingKey.isReactWarning = true; Object.defineProperty(props, "key", { get: warnAboutAccessingKey, configurable: true }); } } function defineRefPropWarningGetter(props, displayName) { { var warnAboutAccessingRef = function() { if (!specialPropRefWarningShown) { specialPropRefWarningShown = true; error("%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)", displayName); } }; warnAboutAccessingRef.isReactWarning = true; Object.defineProperty(props, "ref", { get: warnAboutAccessingRef, configurable: true }); } } var ReactElement = function(type, key, ref, self2, source, owner, props) { var element2 = { // This tag allows us to uniquely identify this as a React Element $$typeof: REACT_ELEMENT_TYPE, // Built-in properties that belong on the element type, key, ref, props, // Record the component responsible for creating this element. _owner: owner }; { element2._store = {}; Object.defineProperty(element2._store, "validated", { configurable: false, enumerable: false, writable: true, value: false }); Object.defineProperty(element2, "_self", { configurable: false, enumerable: false, writable: false, value: self2 }); Object.defineProperty(element2, "_source", { configurable: false, enumerable: false, writable: false, value: source }); if (Object.freeze) { Object.freeze(element2.props); Object.freeze(element2); } } return element2; }; function jsxDEV(type, config, maybeKey, source, self2) { { var propName; var props = {}; var key = null; var ref = null; if (maybeKey !== void 0) { { checkKeyStringCoercion(maybeKey); } key = "" + maybeKey; } if (hasValidKey(config)) { { checkKeyStringCoercion(config.key); } key = "" + config.key; } if (hasValidRef(config)) { ref = config.ref; warnIfStringRefCannotBeAutoConverted(config, self2); } for (propName in config) { if (hasOwnProperty2.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) { props[propName] = config[propName]; } } if (type && type.defaultProps) { var defaultProps = type.defaultProps; for (propName in defaultProps) { if (props[propName] === void 0) { props[propName] = defaultProps[propName]; } } } if (key || ref) { var displayName = typeof type === "function" ? type.displayName || type.name || "Unknown" : type; if (key) { defineKeyPropWarningGetter(props, displayName); } if (ref) { defineRefPropWarningGetter(props, displayName); } } return ReactElement(type, key, ref, self2, source, ReactCurrentOwner.current, props); } } var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner; var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame; function setCurrentlyValidatingElement$1(element2) { { if (element2) { var owner = element2._owner; var stack = describeUnknownElementTypeFrameInDEV(element2.type, element2._source, owner ? owner.type : null); ReactDebugCurrentFrame$1.setExtraStackFrame(stack); } else { ReactDebugCurrentFrame$1.setExtraStackFrame(null); } } } var propTypesMisspellWarningShown; { propTypesMisspellWarningShown = false; } function isValidElement2(object) { { return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; } } function getDeclarationErrorAddendum() { { if (ReactCurrentOwner$1.current) { var name = getComponentNameFromType(ReactCurrentOwner$1.current.type); if (name) { return "\n\nCheck the render method of `" + name + "`."; } } return ""; } } function getSourceInfoErrorAddendum(source) { { if (source !== void 0) { var fileName = source.fileName.replace(/^.*[\\\/]/, ""); var lineNumber = source.lineNumber; return "\n\nCheck your code at " + fileName + ":" + lineNumber + "."; } return ""; } } var ownerHasKeyUseWarning = {}; function getCurrentComponentErrorInfo(parentType) { { var info = getDeclarationErrorAddendum(); if (!info) { var parentName = typeof parentType === "string" ? parentType : parentType.displayName || parentType.name; if (parentName) { info = "\n\nCheck the top-level render call using <" + parentName + ">."; } } return info; } } function validateExplicitKey(element2, parentType) { { if (!element2._store || element2._store.validated || element2.key != null) { return; } element2._store.validated = true; var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType); if (ownerHasKeyUseWarning[currentComponentErrorInfo]) { return; } ownerHasKeyUseWarning[currentComponentErrorInfo] = true; var childOwner = ""; if (element2 && element2._owner && element2._owner !== ReactCurrentOwner$1.current) { childOwner = " It was passed a child from " + getComponentNameFromType(element2._owner.type) + "."; } setCurrentlyValidatingElement$1(element2); error('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner); setCurrentlyValidatingElement$1(null); } } function validateChildKeys(node2, parentType) { { if (typeof node2 !== "object") { return; } if (isArray3(node2)) { for (var i = 0; i < node2.length; i++) { var child = node2[i]; if (isValidElement2(child)) { validateExplicitKey(child, parentType); } } } else if (isValidElement2(node2)) { if (node2._store) { node2._store.validated = true; } } else if (node2) { var iteratorFn = getIteratorFn(node2); if (typeof iteratorFn === "function") { if (iteratorFn !== node2.entries) { var iterator = iteratorFn.call(node2); var step2; while (!(step2 = iterator.next()).done) { if (isValidElement2(step2.value)) { validateExplicitKey(step2.value, parentType); } } } } } } } function validatePropTypes(element2) { { var type = element2.type; if (type === null || type === void 0 || typeof type === "string") { return; } var propTypes2; if (typeof type === "function") { propTypes2 = type.propTypes; } else if (typeof type === "object" && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here. // Inner props are checked in the reconciler. type.$$typeof === REACT_MEMO_TYPE)) { propTypes2 = type.propTypes; } else { return; } if (propTypes2) { var name = getComponentNameFromType(type); checkPropTypes(propTypes2, element2.props, "prop", name, element2); } else if (type.PropTypes !== void 0 && !propTypesMisspellWarningShown) { propTypesMisspellWarningShown = true; var _name = getComponentNameFromType(type); error("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", _name || "Unknown"); } if (typeof type.getDefaultProps === "function" && !type.getDefaultProps.isReactClassApproved) { error("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead."); } } } function validateFragmentProps(fragment) { { var keys2 = Object.keys(fragment.props); for (var i = 0; i < keys2.length; i++) { var key = keys2[i]; if (key !== "children" && key !== "key") { setCurrentlyValidatingElement$1(fragment); error("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", key); setCurrentlyValidatingElement$1(null); break; } } if (fragment.ref !== null) { setCurrentlyValidatingElement$1(fragment); error("Invalid attribute `ref` supplied to `React.Fragment`."); setCurrentlyValidatingElement$1(null); } } } function jsxWithValidation(type, props, key, isStaticChildren, source, self2) { { var validType = isValidElementType(type); if (!validType) { var info = ""; if (type === void 0 || typeof type === "object" && type !== null && Object.keys(type).length === 0) { info += " 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 sourceInfo = getSourceInfoErrorAddendum(source); if (sourceInfo) { info += sourceInfo; } else { info += getDeclarationErrorAddendum(); } var typeString; if (type === null) { typeString = "null"; } else if (isArray3(type)) { typeString = "array"; } else if (type !== void 0 && type.$$typeof === REACT_ELEMENT_TYPE) { typeString = "<" + (getComponentNameFromType(type.type) || "Unknown") + " />"; info = " Did you accidentally export a JSX literal instead of a component?"; } else { typeString = typeof type; } error("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", typeString, info); } var element2 = jsxDEV(type, props, key, source, self2); if (element2 == null) { return element2; } if (validType) { var children = props.children; if (children !== void 0) { if (isStaticChildren) { if (isArray3(children)) { for (var i = 0; i < children.length; i++) { validateChildKeys(children[i], type); } if (Object.freeze) { Object.freeze(children); } } else { error("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 { validateChildKeys(children, type); } } } if (type === REACT_FRAGMENT_TYPE) { validateFragmentProps(element2); } else { validatePropTypes(element2); } return element2; } } function jsxWithValidationStatic(type, props, key) { { return jsxWithValidation(type, props, key, true); } } function jsxWithValidationDynamic(type, props, key) { { return jsxWithValidation(type, props, key, false); } } var jsx = jsxWithValidationDynamic; var jsxs = jsxWithValidationStatic; reactJsxRuntime_development.Fragment = REACT_FRAGMENT_TYPE; reactJsxRuntime_development.jsx = jsx; reactJsxRuntime_development.jsxs = jsxs; })(); } return reactJsxRuntime_development; } if (process.env.NODE_ENV === "production") { jsxRuntime.exports = requireReactJsxRuntime_production_min(); } else { jsxRuntime.exports = requireReactJsxRuntime_development(); } var jsxRuntimeExports = jsxRuntime.exports; var DefaultContext = { color: void 0, size: void 0, className: void 0, style: void 0, attr: void 0 }; var IconContext = React__default.createContext && React__default.createContext(DefaultContext); var __assign$y = globalThis && globalThis.__assign || function() { __assign$y = Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign$y.apply(this, arguments); }; var __rest$2 = globalThis && globalThis.__rest || function(s, e) { var t = {}; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p]; if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]]; } return t; }; function Tree2Element(tree) { return tree && tree.map(function(node2, i) { return React__default.createElement(node2.tag, __assign$y({ key: i }, node2.attr), Tree2Element(node2.child)); }); } function GenIcon(data2) { return function(props) { return React__default.createElement(IconBase, __assign$y({ attr: __assign$y({}, data2.attr) }, props), Tree2Element(data2.child)); }; } function IconBase(props) { var elem = function(conf) { var attr = props.attr, size2 = props.size, title = props.title, svgProps = __rest$2(props, ["attr", "size", "title"]); var computedSize = size2 || conf.size || "1em"; var className; if (conf.className) className = conf.className; if (props.className) className = (className ? className + " " : "") + props.className; return React__default.createElement("svg", __assign$y({ stroke: "currentColor", fill: "currentColor", strokeWidth: "0" }, conf.attr, attr, svgProps, { className, style: __assign$y(__assign$y({ color: props.color || conf.color }, conf.style), props.style), height: computedSize, width: computedSize, xmlns: "http://www.w3.org/2000/svg" }), title && React__default.createElement("title", null, title), props.children); }; return IconContext !== void 0 ? React__default.createElement(IconContext.Consumer, null, function(conf) { return elem(conf); }) : elem(DefaultContext); } function HiSearch(props) { return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 20 20", "fill": "currentColor", "aria-hidden": "true" }, "child": [{ "tag": "path", "attr": { "fillRule": "evenodd", "d": "M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z", "clipRule": "evenodd" } }] })(props); } function HiOutlineChevronDown(props) { return GenIcon({ "tag": "svg", "attr": { "fill": "none", "viewBox": "0 0 24 24", "strokeWidth": "2", "stroke": "currentColor", "aria-hidden": "true" }, "child": [{ "tag": "path", "attr": { "strokeLinecap": "round", "strokeLinejoin": "round", "d": "M19 9l-7 7-7-7" } }] })(props); } function RiChatSmileFill(props) { return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "d": "M6.45455 19L2 22.5V4C2 3.44772 2.44772 3 3 3H21C21.5523 3 22 3.44772 22 4V18C22 18.5523 21.5523 19 21 19H6.45455ZM7 10C7 12.7614 9.23858 15 12 15C14.7614 15 17 12.7614 17 10H15C15 11.6569 13.6569 13 12 13C10.3431 13 9 11.6569 9 10H7Z" } }] })(props); } function RiMessageFill(props) { return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "d": "M6.45455 19L2 22.5V4C2 3.44772 2.44772 3 3 3H21C21.5523 3 22 3.44772 22 4V18C22 18.5523 21.5523 19 21 19H6.45455ZM8 10V12H16V10H8Z" } }] })(props); } function twJoin() { var index2 = 0; var argument; var resolvedValue; var string2 = ""; while (index2 < arguments.length) { if (argument = arguments[index2++]) { if (resolvedValue = toValue(argument)) { string2 && (string2 += " "); string2 += resolvedValue; } } } return string2; } function toValue(mix) { if (typeof mix === "string") { return mix; } var resolvedValue; var string2 = ""; for (var k2 = 0; k2 < mix.length; k2++) { if (mix[k2]) { if (resolvedValue = toValue(mix[k2])) { string2 && (string2 += " "); string2 += resolvedValue; } } } return string2; } var CLASS_PART_SEPARATOR = "-"; function createClassUtils(config) { var classMap = createClassMap(config); var conflictingClassGroups = config.conflictingClassGroups, _config$conflictingCl = config.conflictingClassGroupModifiers, conflictingClassGroupModifiers = _config$conflictingCl === void 0 ? {} : _config$conflictingCl; function getClassGroupId(className) { var classParts = className.split(CLASS_PART_SEPARATOR); if (classParts[0] === "" && classParts.length !== 1) { classParts.shift(); } return getGroupRecursive(classParts, classMap) || getGroupIdForArbitraryProperty(className); } function getConflictingClassGroupIds(classGroupId, hasPostfixModifier) { var conflicts = conflictingClassGroups[classGroupId] || []; if (hasPostfixModifier && conflictingClassGroupModifiers[classGroupId]) { return [].concat(conflicts, conflictingClassGroupModifiers[classGroupId]); } return conflicts; } return { getClassGroupId, getConflictingClassGroupIds }; } function getGroupRecursive(classParts, classPartObject) { var _a; if (classParts.length === 0) { return classPartObject.classGroupId; } var currentClassPart = classParts[0]; var nextClassPartObject = classPartObject.nextPart.get(currentClassPart); var classGroupFromNextClassPart = nextClassPartObject ? getGroupRecursive(classParts.slice(1), nextClassPartObject) : void 0; if (classGroupFromNextClassPart) { return classGroupFromNextClassPart; } if (classPartObject.validators.length === 0) { return void 0; } var classRest = classParts.join(CLASS_PART_SEPARATOR); return (_a = classPartObject.validators.find(function(_ref) { var validator2 = _ref.validator; return validator2(classRest); })) == null ? void 0 : _a.classGroupId; } var arbitraryPropertyRegex = /^\[(.+)\]$/; function getGroupIdForArbitraryProperty(className) { if (arbitraryPropertyRegex.test(className)) { var arbitraryPropertyClassName = arbitraryPropertyRegex.exec(className)[1]; var property = arbitraryPropertyClassName == null ? void 0 : arbitraryPropertyClassName.substring(0, arbitraryPropertyClassName.indexOf(":")); if (property) { return "arbitrary.." + property; } } } function createClassMap(config) { var theme = config.theme, prefix = config.prefix; var classMap = { nextPart: /* @__PURE__ */ new Map(), validators: [] }; var prefixedClassGroupEntries = getPrefixedClassGroupEntries(Object.entries(config.classGroups), prefix); prefixedClassGroupEntries.forEach(function(_ref2) { var classGroupId = _ref2[0], classGroup = _ref2[1]; processClassesRecursively(classGroup, classMap, classGroupId, theme); }); return classMap; } function processClassesRecursively(classGroup, classPartObject, classGroupId, theme) { classGroup.forEach(function(classDefinition) { if (typeof classDefinition === "string") { var classPartObjectToEdit = classDefinition === "" ? classPartObject : getPart(classPartObject, classDefinition); classPartObjectToEdit.classGroupId = classGroupId; return; } if (typeof classDefinition === "function") { if (isThemeGetter(classDefinition)) { processClassesRecursively(classDefinition(theme), classPartObject, classGroupId, theme); return; } classPartObject.validators.push({ validator: classDefinition, classGroupId }); return; } Object.entries(classDefinition).forEach(function(_ref3) { var key = _ref3[0], classGroup2 = _ref3[1]; processClassesRecursively(classGroup2, getPart(classPartObject, key), classGroupId, theme); }); }); } function getPart(classPartObject, path2) { var currentClassPartObject = classPartObject; path2.split(CLASS_PART_SEPARATOR).forEach(function(pathPart) { if (!currentClassPartObject.nextPart.has(pathPart)) { currentClassPartObject.nextPart.set(pathPart, { nextPart: /* @__PURE__ */ new Map(), validators: [] }); } currentClassPartObject = currentClassPartObject.nextPart.get(pathPart); }); return currentClassPartObject; } function isThemeGetter(func2) { return func2.isThemeGetter; } function getPrefixedClassGroupEntries(classGroupEntries, prefix) { if (!prefix) { return classGroupEntries; } return classGroupEntries.map(function(_ref4) { var classGroupId = _ref4[0], classGroup = _ref4[1]; var prefixedClassGroup = classGroup.map(function(classDefinition) { if (typeof classDefinition === "string") { return prefix + classDefinition; } if (typeof classDefinition === "object") { return Object.fromEntries(Object.entries(classDefinition).map(function(_ref5) { var key = _ref5[0], value = _ref5[1]; return [prefix + key, value]; })); } return classDefinition; }); return [classGroupId, prefixedClassGroup]; }); } function createLruCache(maxCacheSize) { if (maxCacheSize < 1) { return { get: function get() { return void 0; }, set: function set() { } }; } var cacheSize = 0; var cache2 = /* @__PURE__ */ new Map(); var previousCache = /* @__PURE__ */ new Map(); function update(key, value) { cache2.set(key, value); cacheSize++; if (cacheSize > maxCacheSize) { cacheSize = 0; previousCache = cache2; cache2 = /* @__PURE__ */ new Map(); } } return { get: function get(key) { var value = cache2.get(key); if (value !== void 0) { return value; } if ((value = previousCache.get(key)) !== void 0) { update(key, value); return value; } }, set: function set(key, value) { if (cache2.has(key)) { cache2.set(key, value); } else { update(key, value); } } }; } var IMPORTANT_MODIFIER = "!"; function createSplitModifiers(config) { var separator = config.separator || ":"; var isSeparatorSingleCharacter = separator.length === 1; var firstSeparatorCharacter = separator[0]; var separatorLength = separator.length; return function splitModifiers(className) { var modifiers = []; var bracketDepth = 0; var modifierStart = 0; var postfixModifierPosition; for (var index2 = 0; index2 < className.length; index2++) { var currentCharacter = className[index2]; if (bracketDepth === 0) { if (currentCharacter === firstSeparatorCharacter && (isSeparatorSingleCharacter || className.slice(index2, index2 + separatorLength) === separator)) { modifiers.push(className.slice(modifierStart, index2)); modifierStart = index2 + separatorLength; continue; } if (currentCharacter === "/") { postfixModifierPosition = index2; continue; } } if (currentCharacter === "[") { bracketDepth++; } else if (currentCharacter === "]") { bracketDepth--; } } var baseClassNameWithImportantModifier = modifiers.length === 0 ? className : className.substring(modifierStart); var hasImportantModifier = baseClassNameWithImportantModifier.startsWith(IMPORTANT_MODIFIER); var baseClassName = hasImportantModifier ? baseClassNameWithImportantModifier.substring(1) : baseClassNameWithImportantModifier; var maybePostfixModifierPosition = postfixModifierPosition && postfixModifierPosition > modifierStart ? postfixModifierPosition - modifierStart : void 0; return { modifiers, hasImportantModifier, baseClassName, maybePostfixModifierPosition }; }; } function sortModifiers(modifiers) { if (modifiers.length <= 1) { return modifiers; } var sortedModifiers = []; var unsortedModifiers = []; modifiers.forEach(function(modifier) { var isArbitraryVariant = modifier[0] === "["; if (isArbitraryVariant) { sortedModifiers.push.apply(sortedModifiers, unsortedModifiers.sort().concat([modifier])); unsortedModifiers = []; } else { unsortedModifiers.push(modifier); } }); sortedModifiers.push.apply(sortedModifiers, unsortedModifiers.sort()); return sortedModifiers; } function createConfigUtils(config) { return { cache: createLruCache(config.cacheSize), splitModifiers: createSplitModifiers(config), ...createClassUtils(config) }; } var SPLIT_CLASSES_REGEX = /\s+/; function mergeClassList(classList, configUtils) { var splitModifiers = configUtils.splitModifiers, getClassGroupId = configUtils.getClassGroupId, getConflictingClassGroupIds = configUtils.getConflictingClassGroupIds; var classGroupsInConflict = /* @__PURE__ */ new Set(); return classList.trim().split(SPLIT_CLA