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CAEA,GAAK0Z,GAAAvqB,EACL,GACA,SAAAopB,+BAAAnF,CAAA,EACA,OAAAA,EAAA,eACA,CACA,IAAAgH,EAAAnD,EACAoD,EAAA7B,EACA8B,EAAAzB","sources":["webpack://_N_E/./node_modules/@radix-ui/themes/dist/esm/components/callout.props.js","webpack://_N_E/./node_modules/@radix-ui/themes/dist/esm/components/callout.js","webpack://_N_E/./node_modules/lodash.debounce/index.js","webpack://_N_E/./node_modules/lodash/throttle.js","webpack://_N_E/?7949","webpack://_N_E/./src/app/components/ChatBox/ChatBoxEditor.tsx","webpack://_N_E/./src/app/components/icons/ArrowLoopUpReverse.tsx","webpack://_N_E/./src/app/components/icons/ArrorRightCenter.tsx","webpack://_N_E/./src/app/components/SimilarThreadsSelector/SimilarThreadCard.tsx","webpack://_N_E/./src/app/components/SimilarThreadsSelector/index.tsx","webpack://_N_E/./src/app/components/icons/AtSignIcon.tsx","webpack://_N_E/./src/app/hooks/useTimedCallout.ts","webpack://_N_E/./src/app/components/icons/NewThreadIcon.tsx","webpack://_N_E/./src/app/components/BulkActionsToolbar/ChatActions.tsx","webpack://_N_E/./src/app/hooks/useThrottle.ts","webpack://_N_E/./src/app/components/ChatBox/ChatBox.tsx","webpack://_N_E/./src/app/services/image.ts","webpack://_N_E/./src/app/hooks/useFiles.ts","webpack://_N_E/./src/app/services/misc.ts","webpack://_N_E/./src/app/[[...id]]/layout.module.scss","webpack://_N_E/./src/app/components/ChatBox/ChatBox.module.scss","webpack://_N_E/./src/app/components/ChatBox/ChatBoxEditor.module.scss","webpack://_N_E/./src/app/components/SimilarThreadsSelector/SimilarThreadsSelector.module.scss","webpack://_N_E/./node_modules/@radix-ui/react-collapsible/dist/index.mjs","webpack://_N_E/"],"sourcesContent":["import { colorProp, highContrastProp } from '../helpers';\nconst sizes = ['1', '2', '3'];\nconst variants = ['soft', 'surface', 'outline'];\nconst calloutRootPropDefs = {\n size: { type: 'enum', values: sizes, default: '2', responsive: true },\n variant: { type: 'enum', values: variants, default: 'soft' },\n color: { ...colorProp, default: undefined },\n highContrast: highContrastProp,\n};\nexport { calloutRootPropDefs };\n//# sourceMappingURL=callout.props.js.map","'use client';\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport { Text } from './text';\nimport { calloutRootPropDefs } from './callout.props';\nimport { extractMarginProps, withMarginProps, withBreakpoints } from '../helpers';\nconst CalloutContext = React.createContext({});\nconst CalloutRoot = React.forwardRef((props, forwardedRef) => {\n const { rest: marginRest, ...marginProps } = extractMarginProps(props);\n const { children, className, size = calloutRootPropDefs.size.default, variant = calloutRootPropDefs.variant.default, color = calloutRootPropDefs.color.default, highContrast = calloutRootPropDefs.highContrast.default, ...rootProps } = marginRest;\n return (React.createElement(\"div\", { \"data-accent-color\": color, ...rootProps, className: classNames('rt-CalloutRoot', className, withBreakpoints(size, 'rt-r-size'), `rt-variant-${variant}`, { 'rt-high-contrast': highContrast }, withMarginProps(marginProps)), ref: forwardedRef },\n React.createElement(CalloutContext.Provider, { value: React.useMemo(() => ({ size, color, highContrast }), [size, color, highContrast]) }, children)));\n});\nCalloutRoot.displayName = 'CalloutRoot';\nconst CalloutIcon = React.forwardRef((props, forwardedRef) => {\n const { color, size, highContrast } = React.useContext(CalloutContext);\n return (React.createElement(Text, { asChild: true, color: color, size: getTextSize(size), highContrast: highContrast },\n React.createElement(\"div\", { ...props, className: classNames('rt-CalloutIcon', props.className), ref: forwardedRef })));\n});\nCalloutIcon.displayName = 'CalloutIcon';\nconst CalloutText = React.forwardRef((props, forwardedRef) => {\n const { color, size, highContrast } = React.useContext(CalloutContext);\n return (React.createElement(Text, { as: \"p\", size: getTextSize(size), color: color, highContrast: highContrast, ...props, ref: forwardedRef, className: classNames('rt-CalloutText', props.className) }));\n});\nCalloutText.displayName = 'CalloutText';\nfunction getTextSize(size) {\n if (size === undefined)\n return undefined;\n if (typeof size === 'string') {\n return getNonResponsiveTextSize(size);\n }\n return Object.fromEntries(Object.entries(size).map(([key, value]) => [key, getNonResponsiveTextSize(value)]));\n}\nfunction getNonResponsiveTextSize(size) {\n return size === '3' ? '3' : '2';\n}\nconst Callout = Object.assign({}, {\n Root: CalloutRoot,\n Icon: CalloutIcon,\n Text: CalloutText,\n});\nexport { Callout, CalloutRoot, CalloutIcon, CalloutText };\n//# sourceMappingURL=callout.js.map","/**\n * lodash (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the `TypeError` message for \"Functions\" methods. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/** Used to match leading and trailing whitespace. */\nvar reTrim = /^\\s+|\\s+$/g;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max,\n nativeMin = Math.min;\n\n/**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\nvar now = function() {\n return root.Date.now();\n};\n\n/**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n * Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n * The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\nfunction debounce(func, wait, options) {\n var lastArgs,\n lastThis,\n maxWait,\n result,\n timerId,\n lastCallTime,\n lastInvokeTime = 0,\n leading = false,\n maxing = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = toNumber(wait) || 0;\n if (isObject(options)) {\n leading = !!options.leading;\n maxing = 'maxWait' in options;\n maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function invokeFunc(time) {\n var args = lastArgs,\n thisArg = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime,\n result = wait - timeSinceLastCall;\n\n return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result;\n }\n\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n }\n\n function timerExpired() {\n var time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n\n function debounced() {\n var time = now(),\n isInvoking = shouldInvoke(time);\n\n lastArgs = arguments;\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && objectToString.call(value) == symbolTag);\n}\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\nfunction toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = value.replace(reTrim, '');\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n}\n\nmodule.exports = debounce;\n","var debounce = require('./debounce'),\n isObject = require('./isObject');\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/**\n * Creates a throttled function that only invokes `func` at most once per\n * every `wait` milliseconds. The throttled function comes with a `cancel`\n * method to cancel delayed `func` invocations and a `flush` method to\n * immediately invoke them. Provide `options` to indicate whether `func`\n * should be invoked on the leading and/or trailing edge of the `wait`\n * timeout. The `func` is invoked with the last arguments provided to the\n * throttled function. Subsequent calls to the throttled function return the\n * result of the last `func` invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the throttled function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.throttle` and `_.debounce`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to throttle.\n * @param {number} [wait=0] The number of milliseconds to throttle invocations to.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=true]\n * Specify invoking on the leading edge of the timeout.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new throttled function.\n * @example\n *\n * // Avoid excessively updating the position while scrolling.\n * jQuery(window).on('scroll', _.throttle(updatePosition, 100));\n *\n * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.\n * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });\n * jQuery(element).on('click', throttled);\n *\n * // Cancel the trailing throttled invocation.\n * jQuery(window).on('popstate', throttled.cancel);\n */\nfunction throttle(func, wait, options) {\n var leading = true,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n if (isObject(options)) {\n leading = 'leading' in options ? !!options.leading : leading;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n return debounce(func, wait, {\n 'leading': leading,\n 'maxWait': wait,\n 'trailing': trailing\n });\n}\n\nmodule.exports = throttle;\n","import(/* webpackMode: \"eager\" */ \"/app/src/app/[[...id]]/layout.module.scss\");\nimport(/* webpackMode: \"eager\" */ \"/app/src/app/components/ChatBox/ChatBox.tsx\")","import { useEffect } from \"react\";\nimport styles from \"@/app/components/ChatBox/ChatBoxEditor.module.scss\";\nimport Document from \"@tiptap/extension-document\";\nimport { HardBreak } from \"@tiptap/extension-hard-break\";\nimport { History } from \"@tiptap/extension-history\";\nimport Mention from \"@tiptap/extension-mention\";\nimport Paragraph from \"@tiptap/extension-paragraph\";\nimport Placeholder from \"@tiptap/extension-placeholder\";\nimport Text from \"@tiptap/extension-text\";\nimport { Editor, EditorContent, ReactRenderer, useEditor } from \"@tiptap/react\";\nimport { MentionList } from \"../MentionList\";\n\nimport { PluginKey } from \"prosemirror-state\";\nimport { EditorCommands } from \"@/app/store/ChatBox.store\";\nimport { useAppStore } from \"@/app/store\";\nimport Link from \"@tiptap/extension-link\";\nimport { getMentions } from \"@/app/services/mentions\";\nimport { StructUser } from \"@/app/types/Thread.type\";\nimport { StructChannel } from \"@/app/types/Channel.type\";\n\ninterface ChatBoxEditorProps {\n onChange: (content: string) => void;\n placeholder?: string;\n onFocus: () => void;\n onBlur: () => void;\n onArrowUpFirstCharacter: () => void;\n onArrowDownLastCharacter: () => void;\n onEnter: (editorOutput: string) => void;\n onOpenEmojiPicker: () => void;\n onImageUpload: (images: File[]) => Promise;\n autofocus?: boolean;\n}\n\nconst extractTextWithNewlines = (state: Editor[\"state\"]) => {\n let textWithNewlines = \"\";\n state.doc.forEach((block) => {\n block.forEach((node) => {\n if (node.type.name === \"text\") {\n const linkMark = node.marks.find((mark) => mark.type.name === \"link\");\n textWithNewlines += linkMark ? `<${linkMark.attrs.href}>` : node.text;\n }\n if (node.type.name === \"hardBreak\") {\n textWithNewlines += \"\\n\";\n }\n if (node.type.name === \"mention\") {\n const mentionId = node.attrs.id;\n textWithNewlines += `\\<@${mentionId}\\>`;\n }\n if (node.type.name === \"tag\") {\n const mentionId = node.attrs.id;\n textWithNewlines += `<#${mentionId}>`;\n }\n });\n });\n\n return textWithNewlines;\n};\n\nconst USERS_SEARCH_RESULT_LIMIT = 5;\nconst CHANNELS_SEARCH_RESULT_LIMIT = 5;\n\nconst ChatBoxEditor = ({\n onChange,\n placeholder,\n onFocus,\n onBlur,\n onArrowUpFirstCharacter,\n onArrowDownLastCharacter,\n onEnter,\n onOpenEmojiPicker,\n onImageUpload,\n autofocus = true,\n}: ChatBoxEditorProps) => {\n const sessionUserId = useAppStore((state) => state.session?.user?.id);\n const tags = useAppStore((state) => state.tags);\n const initialContent = useAppStore((state) => state.initialContent);\n const setChatBoxCommands = useAppStore((state) => state.setChatBoxCommands);\n\n const editor = useEditor(\n {\n content: initialContent,\n editorProps: {\n handlePaste: (view, event) => {\n const { clipboardData } = event;\n\n if (!clipboardData) {\n return false;\n }\n\n const images = Array.from(clipboardData?.files)?.filter((file) =>\n /image/i.test(file.type),\n );\n\n if (images.length > 0) {\n onImageUpload(images);\n return;\n }\n\n const pastedText = clipboardData.getData(\"text/plain\");\n const containsNewLines = pastedText.includes(\"\\n\");\n\n if (containsNewLines) {\n event.preventDefault();\n\n const createTextFragment = (textPart: string) => {\n if (!textPart) {\n return [];\n }\n\n const textNode = view.state.schema.text(textPart);\n const breakNode = view.state.schema.node(\"hardBreak\");\n\n return [textNode, breakNode];\n };\n\n const textFragments = pastedText\n .split(\"\\n\")\n .flatMap(createTextFragment);\n\n const endsWithHardBreak =\n textFragments.length &&\n textFragments[textFragments.length - 1].type.name === \"hardBreak\";\n\n if (endsWithHardBreak) {\n textFragments.pop();\n }\n\n const hasFragmentsToInsert = textFragments.length > 0;\n if (hasFragmentsToInsert) {\n const transaction = view.state.tr.insert(\n view.state.selection.from,\n textFragments,\n );\n view.dispatch(transaction);\n return true;\n }\n }\n\n return false;\n },\n\n attributes: { class: \"editor\" },\n handleKeyDown: (props, event) => {\n if (event.key === \":\") {\n const { from } = props.state.selection;\n if (from <= 0) {\n return;\n }\n\n const prevChar = props.state.doc.textBetween(from - 1, from);\n if (prevChar !== \" \" && from !== 1) {\n return;\n }\n\n event.preventDefault();\n onOpenEmojiPicker();\n return true;\n }\n\n const mentionIsActive = props.state.plugins.some(\n (plugin) =>\n // @ts-ignore\n plugin.key.startsWith(\"mention$\") &&\n plugin.getState(props.state).active,\n );\n\n if (mentionIsActive) {\n return;\n }\n\n if (event.key === \"Enter\") {\n event.preventDefault();\n event.stopPropagation();\n\n if (event.shiftKey) {\n return;\n }\n const editorOutput = extractTextWithNewlines(props.state);\n if (!editorOutput.trim()) {\n return true;\n }\n onEnter(editorOutput);\n return true;\n }\n\n const { from, to } = props.state.selection;\n\n if (event.key === \"ArrowUp\" && from === 1 && to === 1) {\n onArrowUpFirstCharacter();\n return;\n }\n\n const docLength = props.state.doc.content.size;\n\n if (\n event.key === \"ArrowDown\" &&\n from + 1 === docLength &&\n to + 1 === docLength\n ) {\n onArrowDownLastCharacter();\n return;\n }\n },\n },\n autofocus,\n extensions: [\n Link.configure({\n openOnClick: false,\n validate: (href) => /^(https?:\\/\\/|www\\.)/.test(href),\n }),\n Placeholder.configure({\n placeholder,\n includeChildren: true,\n }),\n Document,\n Paragraph.configure({\n HTMLAttributes: { class: \"paragraph\" },\n }),\n Text,\n HardBreak,\n History,\n Mention.extend({\n name: \"mention\",\n }).configure({\n HTMLAttributes: { class: \"mentionNode\" },\n suggestion: {\n char: \"@\",\n pluginKey: new PluginKey(\"mention\"),\n allowSpaces: false,\n allowedPrefixes: [\"-\", \" \"],\n items: ({ query }) => {\n return new Promise(async (resolve) => {\n const authenticatedUserId = sessionUserId;\n if (!authenticatedUserId) return resolve([]);\n\n const mentions = await getMentions(query, true);\n\n const users: StructUser[] =\n mentions?.users?.slice(0, USERS_SEARCH_RESULT_LIMIT) ?? [];\n const channels: StructChannel[] =\n mentions?.channels?.slice(0, CHANNELS_SEARCH_RESULT_LIMIT) ??\n [];\n\n resolve([\n ...channels.map((c) => ({ ...c, type: \"channel\" })),\n ...users.map((u) => ({ ...u, type: \"user\" })),\n ]);\n });\n },\n render: () => {\n let reactRenderer: ReactRenderer | null;\n\n return {\n onStart: (props) => {\n reactRenderer = new ReactRenderer(MentionList, {\n props: { ...props, type: \"mention\", showSearch: true },\n editor: props.editor,\n });\n },\n\n onUpdate(props) {\n reactRenderer?.updateProps(props);\n },\n\n onKeyDown(props) {\n if (props.event.key === \"Escape\") {\n reactRenderer?.destroy();\n return true;\n }\n\n return (reactRenderer?.ref as any)?.onKeyDown(props);\n },\n\n onExit() {\n reactRenderer?.destroy();\n reactRenderer = null;\n },\n };\n },\n },\n }),\n Mention.extend({\n name: \"tag\",\n }).configure({\n HTMLAttributes: { class: \"tagNode\" },\n suggestion: {\n char: \"#\",\n pluginKey: new PluginKey(\"mention\"),\n allowSpaces: false,\n allowedPrefixes: [\"-\", \" \"],\n items: async ({ query }) => {\n const filteredTags = tags\n .filter((tag) =>\n tag.tag.toLowerCase().startsWith(query.toLowerCase()),\n )\n .slice(0, 5);\n\n return filteredTags.map((tag) => ({ ...tag, type: \"tag\" }));\n },\n render: () => {\n let reactRenderer: ReactRenderer | null;\n\n return {\n onStart: (props) => {\n reactRenderer = new ReactRenderer(MentionList, {\n props: { ...props, type: \"tag\" },\n editor: props.editor,\n });\n },\n\n onUpdate(props) {\n reactRenderer?.updateProps(props);\n },\n\n onKeyDown(props) {\n if (props.event.key === \"Escape\") {\n reactRenderer?.destroy();\n reactRenderer = null;\n return true;\n }\n\n return (reactRenderer?.ref as any)?.onKeyDown(props);\n },\n\n onExit() {\n reactRenderer?.destroy();\n reactRenderer = null;\n return true;\n },\n };\n },\n },\n }),\n ],\n },\n [],\n );\n\n useEffect(() => {\n if (!editor) {\n return;\n }\n\n const commands: EditorCommands = {\n insertMention: (mentionData) => {\n editor.commands.insertContent({\n type: \"mention\",\n attrs: {\n id: mentionData.id,\n label: mentionData.label,\n },\n });\n },\n focus: () => {\n if (editor) {\n editor.commands.focus(\"end\");\n }\n },\n blur: () => {\n if (editor) {\n editor.commands.blur();\n }\n },\n insertContent: (content: string) => {\n if (editor) {\n editor.commands.insertContent(content);\n }\n },\n clearContent: () => {\n if (editor) {\n editor.commands.clearContent();\n }\n },\n insertCharacter: (character: string) => {\n const atCharacter = character;\n\n if (editor) {\n const content = editor.getJSON();\n const lastNode = content.content?.slice(-1)[0];\n if (lastNode && lastNode.type === \"paragraph\" && lastNode.content) {\n // @ts-ignore\n const lastChar = lastNode.content[0].text;\n\n if (lastChar === atCharacter) {\n editor.commands.insertContent(atCharacter.slice(1));\n return;\n }\n }\n\n editor.commands.insertContent(atCharacter);\n }\n },\n };\n setChatBoxCommands(commands);\n }, [editor]);\n\n useEffect(() => {\n if (editor !== null && placeholder !== \"\") {\n editor.extensionManager.extensions.filter(\n (extension) => extension.name === \"placeholder\",\n )[0].options[\"placeholder\"] = placeholder;\n\n editor.view.dispatch(editor.state.tr);\n }\n }, [editor, placeholder]);\n\n useEffect(() => {\n if (editor) {\n editor.on(\"update\", () => {\n const newContent = extractTextWithNewlines(editor.state);\n onChange(newContent);\n });\n\n editor.on(\"focus\", onFocus);\n editor.on(\"blur\", onBlur);\n }\n\n return () => {\n if (editor) {\n editor.off(\"update\");\n editor.off(\"focus\");\n editor.off(\"blur\");\n }\n };\n }, [editor, onChange]);\n\n if (!editor) {\n return
;\n }\n\n return ;\n};\n\nexport default ChatBoxEditor;\n\nChatBoxEditor.displayName = \"ChatBoxEditor\";\n","import React from \"react\";\nimport { IconType } from \"@/app/components/icons/icon.type\";\n\nconst ArrowLoopUpReverse = ({ style, className }: IconType) => (\n \n \n \n \n);\n\nexport default ArrowLoopUpReverse;\n","import React from \"react\";\nimport { IconType } from \"@/app/components/icons/icon.type\";\n\nconst ArrowRightCenter = ({ style, className }: IconType) => (\n \n \n \n \n);\n\nexport default ArrowRightCenter;\n","import { Flex, Heading, Text, Badge, Box } from \"@radix-ui/themes\";\nimport React from \"react\";\nimport ArrowLoopUpReverse from \"../icons/ArrowLoopUpReverse\";\nimport ArrowRightCenter from \"../icons/ArrorRightCenter\";\n\nimport FeedItemFooter from \"../FeedItem/FeedItemFooter\";\nimport { StructThread } from \"@/app/types/Thread.type\";\nimport { useAppStore } from \"@/app/store\";\nimport { formatTimeAgo } from \"@/app/utils/timeUtils\";\nimport { DateTime } from \"luxon\";\n\ninterface Props {\n threadId: string;\n title: string;\n summary: string;\n reactions: StructThread[\"reactions\"];\n messageCount: number;\n unreadMessageCount: number;\n createdDate: string;\n lastUpdated: number;\n bits: StructThread[\"bits\"];\n}\n\nconst SimilarThreadCard = ({\n threadId,\n title,\n summary,\n reactions,\n messageCount,\n unreadMessageCount,\n createdDate,\n lastUpdated,\n bits,\n}: Props) => {\n const isResolved = bits?.thread_resolved;\n\n const currentUserId = useAppStore((state) => state.session?.user?.id);\n const typingUsersByThread = useAppStore(\n (state) => state.typingUsersByThreadId?.[threadId],\n );\n const typingUserNamesById = useAppStore((state) => state.typingUserNamesById);\n const typingUsers =\n typingUsersByThread\n ?.filter((id) => id !== currentUserId)\n ?.map((id) => typingUserNamesById?.[id]) ?? [];\n\n return (\n \n \n \n \n \n up\n \n \n \n Back to message\n \n \n \n \n {title}\n \n\n \n {summary}\n \n \n \n \n \n \n \n Go to thread\n \n \n \n \n \n enter\n \n \n \n \n \n );\n};\n\nexport default SimilarThreadCard;\n","import React, { useState, useEffect, forwardRef } from \"react\";\nimport { StructThread, StructThreadResponse } from \"@/app/types/Thread.type\";\nimport styles from \"./SimilarThreadsSelector.module.scss\";\nimport { Card, Flex, Text } from \"@radix-ui/themes\";\nimport { FileTextIcon, ArrowRightIcon } from \"@radix-ui/react-icons\";\nimport SimilarThreadCard from \"./SimilarThreadCard\";\n\ninterface SimilarThreadsSelectorProps {\n similarThreads: StructThread[];\n onThreadOpen: (threadId: StructThreadResponse[\"id\"]) => void;\n onClose: () => void;\n isExpanded: boolean;\n onTextAreaClick?: () => void;\n isFeedView: boolean;\n handleChatBoxFocus: () => void;\n}\n\nconst SimilarThreadsSelector = forwardRef<\n HTMLDivElement,\n SimilarThreadsSelectorProps\n>(\n (\n {\n similarThreads,\n onThreadOpen,\n onClose,\n isExpanded,\n isFeedView,\n handleChatBoxFocus,\n },\n ref,\n ) => {\n const [selectedThreadIndex, setSelectedThreadIndex] = useState<\n null | number\n >(null);\n const [hasMouseMovedSinceOpen, setHasMouseMovedSinceOpen] = useState(false);\n\n const [lastInteractionKeyboard, setLastInteractionKeyboard] =\n useState(false);\n\n const isElementInViewport = (el: HTMLElement, parent: HTMLElement) => {\n const rect = el.getBoundingClientRect();\n const parentRect = parent.getBoundingClientRect();\n return rect.left >= parentRect.left && rect.right <= parentRect.right;\n };\n\n useEffect(() => {\n if (isExpanded && !isFeedView) {\n if (ref && \"current\" in ref && ref.current) {\n ref.current.focus();\n }\n }\n }, [isExpanded, isFeedView, ref]);\n\n const handleKeyDown = (e: React.KeyboardEvent) => {\n setLastInteractionKeyboard(true);\n let newIndex: number | null = selectedThreadIndex;\n\n if (e.key === \"ArrowRight\" || e.key === \"ArrowLeft\") {\n e.preventDefault();\n }\n\n if (e.key === \"ArrowLeft\" && selectedThreadIndex !== null) {\n newIndex = newIndex === 0 ? 0 : newIndex! - 1;\n }\n\n if (e.key === \"ArrowRight\" && selectedThreadIndex !== null) {\n newIndex =\n newIndex === similarThreads.length - 1 ? newIndex : newIndex! + 1;\n }\n\n if (e.key === \"Enter\" && selectedThreadIndex !== null) {\n e.preventDefault();\n onThreadOpen(similarThreads[selectedThreadIndex].id);\n onClose();\n return;\n }\n\n if (e.key === \"ArrowUp\") {\n setSelectedThreadIndex(null);\n\n setTimeout(() => {\n handleChatBoxFocus();\n\n if (!isFeedView) {\n onClose();\n }\n }, 0);\n return;\n }\n\n if (newIndex !== null && ref && \"current\" in ref && ref.current) {\n const container = ref.current;\n const button = container.children[newIndex] as HTMLElement;\n\n if (!isElementInViewport(button, container)) {\n if (\n button.getBoundingClientRect().left <\n container.getBoundingClientRect().left\n ) {\n container.scrollLeft -=\n container.getBoundingClientRect().left -\n button.getBoundingClientRect().left;\n } else {\n container.scrollLeft +=\n button.getBoundingClientRect().right -\n container.getBoundingClientRect().right;\n }\n }\n }\n\n setSelectedThreadIndex(newIndex);\n };\n\n const handleFocus = () => {\n if (selectedThreadIndex === null) {\n setSelectedThreadIndex(0);\n }\n };\n\n const handleBlur = () => {\n setSelectedThreadIndex(null);\n };\n\n const handleThreadClick = (\n event: React.MouseEvent,\n id: StructThread[\"id\"],\n index: number,\n ) => {\n event.stopPropagation();\n setSelectedThreadIndex(index); // set the index here\n onThreadOpen(id);\n };\n\n const handleMouseMove = () => {\n if (!hasMouseMovedSinceOpen) {\n setHasMouseMovedSinceOpen(true);\n }\n setLastInteractionKeyboard(false);\n };\n\n const handleMouseOver = (index: number) => {\n if (hasMouseMovedSinceOpen && !lastInteractionKeyboard) {\n setSelectedThreadIndex(index);\n }\n };\n\n const selectedThread =\n selectedThreadIndex !== null ? similarThreads[selectedThreadIndex] : null;\n\n return (\n \n {\n if (!lastInteractionKeyboard) {\n setSelectedThreadIndex(null);\n }\n }}\n >\n {similarThreads.map((thread, index) => {\n const isSelected = selectedThreadIndex === index;\n\n return (\n handleThreadClick(event, thread.id, index)}\n onMouseOver={() => handleMouseOver(index)}\n >\n \n \n \n {thread.subject}\n \n \n {isSelected && }\n \n );\n })}\n {selectedThread && (\n
\n \n
\n )}\n \n
\n );\n },\n);\n\nexport default SimilarThreadsSelector;\n\nSimilarThreadsSelector.displayName = \"SimilarThreadsSelector\";\n","import React from \"react\";\nimport { IconType } from \"@/app/components/icons/icon.type\";\n\nconst AtSignIcon = ({ style, className }: IconType) => (\n \n \n \n \n);\n\nexport default AtSignIcon;\n","import { useState, useEffect } from \"react\";\n\nconst useTimedCallout = (\n initialVisibility: boolean = false,\n duration: number = 3000,\n) => {\n const [isCalloutVisible, setIsCalloutVisible] = useState(initialVisibility);\n let timerId: NodeJS.Timeout;\n\n useEffect(() => {\n if (isCalloutVisible) {\n timerId = setTimeout(() => {\n setIsCalloutVisible(false);\n }, duration);\n }\n\n return () => {\n clearTimeout(timerId);\n };\n }, [isCalloutVisible, duration]);\n\n const showCallout = () => {\n setIsCalloutVisible(true);\n };\n\n const hideCallout = () => {\n setIsCalloutVisible(false);\n clearTimeout(timerId);\n };\n\n return [isCalloutVisible, showCallout, hideCallout] as const;\n};\n\nexport default useTimedCallout;\n","import { IconType } from \"@/app/components/icons/icon.type\";\n\nconst NewThreadIcon = ({ style, className }: IconType) => (\n \n \n \n \n);\n\nexport default NewThreadIcon;\n","import React, { useState } from \"react\";\nimport { Button, Flex, Separator, Text } from \"@radix-ui/themes\";\nimport { useAppStore } from \"@/app/store\";\nimport useShallowNavigation from \"@/app/hooks/useShallowNavigation\";\nimport NewThreadIcon from \"../icons/NewThreadIcon\";\nimport { TrashIcon, Cross1Icon } from \"@radix-ui/react-icons\";\nimport ConfirmationDialog from \"../ConfirmationDialog\";\nimport useChats from \"@/app/hooks/useChats\";\nimport { useApp } from \"@/app/hooks/useApp\";\n\ntype Confirmation = \"create\" | \"delete\" | null;\nconst CONFIRMATION_DIALOG = {\n create: {\n title: \"Create a new thread from selected chats?\",\n primaryLabel: \"Create\",\n },\n delete: {\n title: \"Permanently delete chats that you have permissions to?\",\n primaryLabel: \"Delete\",\n },\n};\n\nexport default function ChatActions() {\n const { currentPath: threadId, navigateToPath } = useShallowNavigation();\n\n const { featureToggles } = useApp();\n const { canCreateThreadFromChat } = featureToggles;\n const selectedChats = useAppStore(\n (state) => state.selectedChatsByThreadId?.[threadId || \"\"] ?? [],\n );\n const currentThreadChatIds = useAppStore(\n (state) =>\n state.chatsByThreadId?.[threadId || \"\"]?.map((chat) => chat.id) ?? [],\n );\n const clearSelectedChats = useAppStore((state) => state.clearSelectedChats);\n const setSelectedChats = useAppStore((state) => state.setSelectedChats);\n const toggleSelectedChatMessage = useAppStore(\n (state) => state.toggleSelectedChatMessage,\n );\n\n const { deleteChatMessage, forkChats } = useChats();\n\n const [confirmationType, setConfirmationType] = useState(null);\n\n if (selectedChats.length <= 0 || !threadId) {\n return null;\n }\n\n const handleSelectAll = () => {\n setSelectedChats(threadId as string, currentThreadChatIds);\n };\n\n const handleCreate = async () => {\n try {\n const { thread_id: threadId } = await forkChats({\n chatIds: selectedChats,\n });\n navigateToPath(threadId);\n } catch (error) {\n console.error(error);\n } finally {\n clearSelectedChats();\n }\n };\n\n const handleDelete = async () => {\n await Promise.all(\n selectedChats.map((messageId) =>\n deleteChatMessage({ messageId, threadId }).then((response) => {\n // @ts-expect-error\n if (response.ok) {\n toggleSelectedChatMessage(threadId, messageId);\n }\n }),\n ),\n );\n };\n\n const handleConfirm = async () => {\n try {\n switch (confirmationType) {\n case \"create\":\n await handleCreate();\n break;\n case \"delete\":\n await handleDelete();\n break;\n }\n } catch (error) {\n console.error(\"error :\", error);\n }\n setConfirmationType(null);\n };\n\n const handleCancel = (event?: React.MouseEvent) => {\n if (event) {\n event.preventDefault();\n event.stopPropagation();\n }\n setConfirmationType(null);\n };\n\n const handleKeyDown = (event: React.KeyboardEvent) => {\n if (event.key === \"Escape\") {\n event.preventDefault();\n event.stopPropagation();\n event.nativeEvent.stopImmediatePropagation();\n setConfirmationType(null);\n }\n };\n\n return (\n <>\n \n \n Manage Chats\n {/* Show create new thread option only for non-slack organisation */}\n {canCreateThreadFromChat && (\n setConfirmationType(\"create\")}\n >\n \n Create new thread\n \n )}\n setConfirmationType(\"delete\")}\n >\n \n Delete selected\n \n \n \n \n \n \n \n \n {confirmationType && (\n \n )}\n \n );\n}\n","import React, { useRef } from \"react\";\nimport { throttle, ThrottleSettings } from \"lodash\";\n\ninterface Props {\n (func: any): any;\n}\n\nconst useThrottle = (func: Props, time = 1000, options?: ThrottleSettings) => {\n const debouncedFunc = useRef(throttle(func, time, options)).current;\n\n return debouncedFunc;\n};\n\nexport default useThrottle;\n","\"use client\";\n\nimport React, { useEffect, useRef, useState } from \"react\";\nimport ChatBoxEditor from \"@/app/components/ChatBox/ChatBoxEditor\";\nimport SimilarThreadsSelector from \"@/app/components/SimilarThreadsSelector\";\nimport {\n FilePreview,\n SelectedFile,\n} from \"@/app/components/ChatBox/FilePreview\";\nimport {\n Popover,\n PopoverContent,\n PopoverTrigger,\n} from \"@/app/components/Popover\";\nimport TypingIndicator from \"@/app/components/TypingIndicator\";\nimport AtSignIcon from \"@/app/components/icons/AtSignIcon\";\nimport HashtagIcon from \"@/app/components/icons/HashtagIcon\";\nimport { useApp } from \"@/app/hooks/useApp\";\nimport useChats from \"@/app/hooks/useChats\";\nimport useFiles from \"@/app/hooks/useFiles\";\nimport useShallowNavigation from \"@/app/hooks/useShallowNavigation\";\nimport useThreads from \"@/app/hooks/useThreads\";\nimport useTimedCallout from \"@/app/hooks/useTimedCallout\";\nimport { useAppStore } from \"@/app/store\";\nimport { StructThread } from \"@/app/types/Thread.type\";\nimport { extractChannelIdsFromMessage } from \"@/app/utils/stringUtils\";\nimport Picker from \"@emoji-mart/react\";\nimport * as Collapsible from \"@radix-ui/react-collapsible\";\nimport {\n Cross2Icon,\n FaceIcon,\n InfoCircledIcon,\n PaperPlaneIcon,\n LightningBoltIcon,\n UploadIcon,\n} from \"@radix-ui/react-icons\";\nimport {\n Box,\n Button,\n Callout,\n Flex,\n IconButton,\n Link,\n Text,\n} from \"@radix-ui/themes\";\nimport debounce from \"lodash.debounce\";\nimport { useTheme } from \"next-themes\";\nimport styles from \"./ChatBox.module.scss\";\nimport {\n CHAT_VIEW_PLACEHOLDER,\n ENABLE_CHAT_HTTP_RESPONSE_INSERT,\n EntityIDMap,\n FEED_VIEW_PLACEHOLDER,\n SLACK_LEVEL_3_PERMISSIONS,\n} from \"@/app/constants\";\nimport { joinManyThreadsData } from \"@/app/utils/dataUtils\";\nimport ReplyToChatPreview from \"@/app/components/ReplyToChatPreview\";\nimport { useParser } from \"@/app/hooks/useParser\";\nimport { ChatReply } from \"@/app/store/Chats.store\";\nimport ChatActions from \"../BulkActionsToolbar/ChatActions\";\nimport { sendTypingStatusAPI } from \"@/app/services/misc\";\nimport useThrottle from \"@/app/hooks/useThrottle\";\n\nconst ACCEPTED_FILE_TYPES = [\n \"image/*\",\n \"application/pdf\",\n \"application/msword\",\n \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\",\n \"application/vnd.ms-excel\",\n \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\",\n \"application/vnd.ms-powerpoint\",\n \"application/vnd.openxmlformats-officedocument.presentationml.presentation\",\n \"text/csv\",\n \"application/json\",\n \"application/postscript\",\n \"image/x-illustrator\",\n \"application/zip\",\n \"audio/wav\",\n \"audio/x-wav\",\n \"audio/mpeg\",\n].join(\", \");\nconst TYPING_INDICATOR_DELAY = 5000;\n\nconst ChatBox = () => {\n const { currentPath, navigateToPath } = useShallowNavigation();\n const isFeedView = Boolean(!currentPath);\n const { featureToggles } = useApp();\n const { createChatMessage } = useChats();\n const { createThread, fetchSimilarThreads } = useThreads();\n const [isCalloutVisible, showCallout] = useTimedCallout(false, 3000);\n\n const similarThreadsById = useAppStore((state) => state.similarThreadsById);\n const typingUsersByThreadId = useAppStore(\n (state) => state.typingUsersByThreadId,\n );\n const setLastChatInThreadInEditMode = useAppStore(\n (state) => state.setLastChatInThreadInEditMode,\n );\n const getChatBoxCommands = useAppStore((state) => state.getChatBoxCommands);\n const isAuthenticatedWithCorrectOrg = useAppStore(\n (state) => state.isAuthenticatedWithCorrectOrg,\n );\n const sessionUserId = useAppStore((state) => state.session?.user?.id);\n const organisation = useAppStore((state) => state.organisation);\n const clearChatReply = useAppStore((state) => state.clearChatReply);\n const chatsByThreadId = useAppStore((state) => state.chatsByThreadId);\n const chatReply = useAppStore((state) => state.chatReply);\n const getChatReply = useAppStore((state) => state.getChatReply);\n\n const typingUserNamesById = useAppStore((state) => state.typingUserNamesById);\n\n const setChatMessage = useAppStore((state) => state.setChatMessage);\n const insertThreadChatById = useAppStore(\n (state) => state.insertThreadChatById,\n );\n\n const isSlackOrg = useAppStore(\n (state) => state.organisation?.bits?.org_slack,\n );\n const selectedChats = useAppStore(\n (state) => state.selectedChatsByThreadId?.[currentPath || \"\"] ?? [],\n );\n\n const hasSlackAuthPerms = useAppStore(\n (state) => state.session?.user?.bits?.user_slack_auth ?? false,\n );\n\n const shouldShowSimilarThreads = !!currentPath;\n\n const throttledSendTypingStatus = useThrottle(\n sendTypingStatusAPI,\n TYPING_INDICATOR_DELAY,\n { leading: true, trailing: false },\n );\n\n useEffect(() => {\n if (!hasSlackAuthPerms) {\n getChatBoxCommands()?.blur();\n }\n }, [hasSlackAuthPerms]);\n\n const [chatBoxContent, setChatboxContent] = useState(\"\");\n const [hasSimilarThreadsOpen, setHasSimilarThreadsOpen] =\n useState(false);\n const [shouldRefocusInput, setShouldRefocusInput] = useState(false);\n const [isActive, setIsActive] = useState(false);\n const [localSimilarThreads, setLocalSimilarThreads] = useState<\n StructThread[]\n >([]);\n const [isColonEmojiPickerVisible, setIsColonEmojiPickerVisible] =\n useState(false);\n\n const [isEmojiPickerOpen, setIsEmojiPickerOpen] = useState(false);\n const [isDragging, setIsDragging] = useState(false);\n const similarThreadsRef = useRef(null);\n const threadIdRef = useRef(null);\n const dropZoneRef = useRef(null);\n\n const [selectedFiles, setSelectedFiles] = useState>([]);\n\n const uploadedFilesUrlsRef = useRef([]);\n\n const fileInputRef: React.RefObject = React.createRef();\n\n const { uploadFile } = useFiles();\n\n const similarThreads =\n localSimilarThreads.length > 0\n ? localSimilarThreads\n : threadIdRef.current !== null\n ? similarThreadsById[threadIdRef.current]\n : [];\n\n const hasSimilarThreads = similarThreads && similarThreads.length > 0;\n\n const typingUserIds: string[] =\n typingUsersByThreadId[threadIdRef.current || \"\"] || [];\n\n const typingUsers = typingUserIds\n .filter((id) => id !== sessionUserId)\n .map((id) => typingUserNamesById?.[id]);\n\n const { theme } = useTheme();\n\n const isChatBoxDisabled =\n (isSlackOrg && !hasSlackAuthPerms) || selectedChats.length > 0;\n\n const prevThreadIdRef = useRef(null);\n\n const { getCompactComponentsFromChatBlocks } = useParser();\n\n useEffect(() => {\n if (!chatReply?.id) {\n return;\n }\n getChatBoxCommands()?.focus();\n }, [chatReply?.id]);\n\n useEffect(() => {\n if (chatReply) {\n clearChatReply();\n }\n }, [currentPath]);\n\n useEffect(() => {\n\n if (currentPath && !currentPath.startsWith(EntityIDMap.Thread)) {\n return;\n }\n\n if (\n (currentPath && prevThreadIdRef.current === null) ||\n (currentPath === null && prevThreadIdRef.current !== null)\n ) {\n if (isChatBoxDisabled) return;\n getChatBoxCommands()?.focus();\n }\n\n prevThreadIdRef.current = currentPath;\n threadIdRef.current = currentPath;\n\n // Disabling similar threads to be open by default as the new designs are very intrusive if shown without consent.\n setHasSimilarThreadsOpen(false);\n }, [currentPath, isChatBoxDisabled]);\n\n useEffect(() => {\n // hasSimilarThreadsOpen\n if (!hasSimilarThreadsOpen && shouldRefocusInput) {\n getChatBoxCommands()?.focus();\n setShouldRefocusInput(false);\n }\n }, [hasSimilarThreadsOpen, shouldRefocusInput]);\n\n const debouncedFetch = useRef(\n debounce(async (query) => {\n try {\n const { hits } = await fetchSimilarThreads({ query });\n\n if (!hits || hits.length <= 0) {\n setLocalSimilarThreads([]);\n return;\n }\n const searchSimilarThreads = hits;\n setHasSimilarThreadsOpen(true);\n const joinedSimilarThreads = joinManyThreadsData({\n threads: searchSimilarThreads,\n organisation,\n });\n\n setLocalSimilarThreads(joinedSimilarThreads);\n } catch (error) {\n console.log(error);\n }\n }, 1000),\n ).current;\n\n useEffect(() => {\n if (\n isFeedView &&\n chatBoxContent !== (\"\" as string) &&\n chatBoxContent !== (\"@\" as string)\n ) {\n debouncedFetch(chatBoxContent);\n return;\n }\n\n debouncedFetch.cancel();\n setLocalSimilarThreads([]);\n }, [chatBoxContent, isFeedView]);\n\n useEffect(() => {\n const handleGlobalKeyUp = (e: {\n key: string;\n preventDefault: () => void;\n stopPropagation: () => void;\n }) => {\n // When ESC is pressed and emoji is being shown in the chat\n // box, we close the on ESC key press\n if (e.key === \"Escape\") {\n e.preventDefault();\n e.stopPropagation();\n setHasSimilarThreadsOpen(false);\n\n setIsEmojiPickerOpen(false);\n getChatBoxCommands()?.blur();\n handleColonEmojiClose(false);\n }\n };\n\n document.addEventListener(\"keyup\", handleGlobalKeyUp);\n\n return () => {\n document.removeEventListener(\"keyup\", handleGlobalKeyUp);\n };\n }, []);\n\n\n const handleSendMessage = async (message: string) => {\n if (!message) {\n return;\n }\n\n const messageHasMentions =\n message.includes(`@${EntityIDMap.User}`) ||\n message.includes(`@${EntityIDMap.Channel}`);\n setHasSimilarThreadsOpen(false);\n if (!threadIdRef.current && !messageHasMentions) {\n showCallout();\n return;\n }\n\n getChatBoxCommands()?.clearContent();\n setChatboxContent(\"\");\n const hasFiles = uploadedFilesUrlsRef.current.length > 0;\n\n if (!threadIdRef.current) {\n const channelIds = extractChannelIdsFromMessage(message);\n\n const { thread_id: newThreadId } = await createThread({\n message,\n channelIds,\n attachments: hasFiles ? uploadedFilesUrlsRef.current : undefined,\n });\n uploadedFilesUrlsRef.current = [];\n setSelectedFiles([]);\n\n navigateToPath(newThreadId);\n return;\n }\n\n const chatResponse = await createChatMessage({\n message,\n threadId: threadIdRef.current,\n attachments: hasFiles ? uploadedFilesUrlsRef.current : undefined,\n reply_to: getChatReply()?.id,\n });\n\n if (chatResponse.data && ENABLE_CHAT_HTTP_RESPONSE_INSERT) {\n setChatMessage(threadIdRef.current, chatResponse.data);\n insertThreadChatById(threadIdRef.current, chatResponse.data);\n }\n\n clearChatReply();\n\n uploadedFilesUrlsRef.current = [];\n setSelectedFiles([]);\n };\n\n const handleEmojiClick = ({ native }: { native: string }) => {\n setIsEmojiPickerOpen(false);\n handleColonEmojiClose(true);\n getChatBoxCommands()?.insertContent(native);\n getChatBoxCommands()?.focus();\n };\n\n const handleColonEmojiClose = (emojiSelected: boolean) => {\n setIsColonEmojiPickerVisible((prevValue) => {\n if (prevValue) {\n if (!emojiSelected) {\n getChatBoxCommands()?.insertCharacter(\":\");\n }\n getChatBoxCommands()?.focus();\n }\n return false;\n });\n };\n\n const toggleSimilarThreads = () => {\n if (!hasSimilarThreads) {\n return;\n }\n setHasSimilarThreadsOpen(!hasSimilarThreadsOpen);\n };\n\n const handleOpenThread = (id: StructThread[\"id\"]) => {\n navigateToPath(id);\n };\n\n const handleCloseSimilarThreads = () => {\n setHasSimilarThreadsOpen(false);\n setShouldRefocusInput(true);\n };\n\n const handleFocus = () => {\n setIsActive(true);\n };\n\n const handleBlur = () => {\n setIsActive(false);\n };\n\n const handleRichTextChange = (content: string) => {\n setChatboxContent(content);\n\n if (content === \"\") {\n setHasSimilarThreadsOpen(false);\n debouncedFetch.cancel();\n return;\n }\n\n if (!threadIdRef.current) {\n return;\n }\n\n throttledSendTypingStatus(threadIdRef.current);\n };\n\n const handleInsertCharacter = (character: string) => {\n getChatBoxCommands()?.insertCharacter(character);\n getChatBoxCommands()?.focus();\n };\n\n const handleArrowUp = () => {\n setHasSimilarThreadsOpen(false);\n if (!sessionUserId) {\n return;\n }\n\n if (threadIdRef.current) {\n setLastChatInThreadInEditMode(threadIdRef.current, sessionUserId);\n }\n };\n\n const triggerFileSelect = () => {\n if (fileInputRef.current) {\n fileInputRef.current.click();\n }\n };\n\n const handleFileRemove = (index: number) => {\n setSelectedFiles((prevFiles) => prevFiles.filter((_, i) => i !== index));\n\n uploadedFilesUrlsRef.current = uploadedFilesUrlsRef.current.filter(\n (_, i) => i !== index,\n );\n };\n\n const handleDragEnter = (e: React.DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n setIsDragging(true);\n };\n\n const handleDragOver = (e: React.DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n setIsDragging(true);\n };\n\n const handleFiles = async (files: File[]) => {\n const previewImages = files.map((file) => {\n const reader = new FileReader();\n const readerPromise = new Promise<{ file: File; url: string }>(\n (resolve) => {\n reader.readAsDataURL(file);\n reader.onload = () => {\n resolve({ file, url: reader.result as string });\n };\n },\n );\n return readerPromise;\n });\n\n const loadedPreviews = await Promise.all(previewImages);\n\n setSelectedFiles((prevFiles) => [\n ...prevFiles,\n ...loadedPreviews.map((preview) => ({ ...preview, isLoading: true })),\n ]);\n\n const uploadPromises = files.map((file) =>\n uploadFile(file)\n .then((uploadedFile) => uploadedFile?.handle)\n .catch((error) => {\n console.error(\"Error uploading file:\", error);\n return null;\n }),\n );\n\n const fileUrls = (await Promise.all(uploadPromises)).filter(\n Boolean,\n ) as string[];\n\n setSelectedFiles((prevFiles) =>\n prevFiles.map((file) => {\n if (files.includes(file.file)) {\n return { ...file, isLoading: false };\n }\n return file;\n }),\n );\n\n uploadedFilesUrlsRef.current = [\n ...uploadedFilesUrlsRef.current,\n ...fileUrls,\n ];\n };\n\n const handleFileSelect = async (e: React.ChangeEvent) => {\n if (e.target.files && e.target.files.length > 0 && fileInputRef.current) {\n const files = Array.from(e.target.files);\n fileInputRef.current.value = \"\";\n await handleFiles(files);\n }\n };\n\n const handleDrop = async (e: React.DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n setIsDragging(false);\n\n if (e.dataTransfer.items && e.dataTransfer.items.length > 0) {\n const files = Array.from(e.dataTransfer.items)\n .filter((item) => item.kind === \"file\")\n .map((item) => item.getAsFile())\n .filter((file): file is File => file !== null);\n\n await handleFiles(files);\n }\n };\n\n const handleDragLeave = (e: React.DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n\n if (!dropZoneRef.current?.contains(e.relatedTarget as Node | null)) {\n setIsDragging(false);\n }\n };\n \n\n // feature flag for slack and discord orgs\n // isAuthCurrent org is already checked in for isChatEnabled flag\n if (!featureToggles.isChatEnabled) {\n return null;\n }\n\n const getRepliedToChatMessage = ({ id, threadId }: ChatReply) => {\n if (!chatReply || !chatsByThreadId[chatReply.threadId]) {\n return;\n }\n\n return chatsByThreadId[threadId].find((chat) => chat.id === id);\n };\n\n const repliedToChatMessage = chatReply && getRepliedToChatMessage(chatReply);\n\n return (\n \n \n {isChatBoxDisabled && (\n \n \n \n \n \n \n Connect your Slack account to send messages\n \n \n \n \n \n \n )}\n {isDragging && (\n \n Drag and drop files\n \n )}\n {isCalloutVisible && (\n \n \n \n \n \n Remember to @mention a channel or a person in your\n message to create a thread.\n \n \n )}\n\n \n \n
\n
\n \n \n setIsEmojiPickerOpen(!isEmojiPickerOpen)}\n >\n \n \n \n \n setIsEmojiPickerOpen(false)}\n autoFocus\n />\n \n \n handleInsertCharacter(\"@\")}\n >\n \n \n handleInsertCharacter(\"#\")}\n >\n \n \n\n \n \n \n
\n \n {\n handleSendMessage(chatBoxContent);\n }}\n >\n {isFeedView ? \"Create thread\" : \"\"}\n \n \n
\n \n
\n
\n \n {selectedFiles.map((img, index) => (\n \n \n \n \n handleFileRemove(index)}\n >\n \n \n \n ))}\n \n \n {repliedToChatMessage && (\n \n \n {getCompactComponentsFromChatBlocks(\n repliedToChatMessage.blocks,\n )}\n \n \n )}\n {\n similarThreadsRef.current?.focus();\n setHasSimilarThreadsOpen(true);\n }}\n onEnter={(editorOutput) => {\n handleSendMessage(editorOutput);\n }}\n onOpenEmojiPicker={() => setIsColonEmojiPickerVisible(true)}\n onImageUpload={handleFiles}\n />\n
\n\n {isColonEmojiPickerVisible && (\n \n handleColonEmojiClose(false)}\n onEmojiSelect={handleEmojiClick}\n />\n \n )}\n \n \n \n {shouldShowSimilarThreads && (\n \n \n \n \n Similar Threads\n \n \n {hasSimilarThreads && (\n \n \n {\n getChatBoxCommands()?.focus();\n }}\n />\n \n \n )}\n \n )}\n \n );\n};\n\nexport default ChatBox;\n","import { STRUCT_API_VERSION } from \"@/app/constants\";\nimport { structAPIFetchClient } from \"@/app/services/client\";\nimport { StructImage } from \"@/app/types/Image.type\";\n\nconst UPLOAD_ENDPOINT = `/${STRUCT_API_VERSION}/upload`;\n\nexport const uploadImageAPI = async (file: File): Promise => {\n const formData = new FormData();\n formData.append(\"file\", file);\n\n const response = await structAPIFetchClient(UPLOAD_ENDPOINT, {\n method: \"POST\",\n body: formData,\n });\n\n if (!response.ok) {\n throw new Error(\"Network response was not ok\");\n }\n\n const { data } = await response.json();\n return data;\n};\n","import { useCallback } from \"react\";\nimport { uploadImageAPI } from \"@/app/services/image\";\nimport { useAppStore } from \"../store\";\n\nconst useFiles = () => {\n const organisation = useAppStore((state) => state.organisation);\n\n const { id: organisationId } = organisation;\n\n const uploadFile = useCallback(\n (file: File) =>\n uploadImageAPI(file).catch((error) => {\n console.log(error);\n }),\n [organisationId],\n );\n\n return {\n uploadFile,\n };\n};\n\nexport default useFiles;\n","import { structAPIFetchClient } from \"@/app/services/client\";\nimport { STRUCT_API_VERSION } from \"@/app/constants\";\nimport { StructTag } from \"@/app/types/Tag.type\";\n\nexport const sendTypingStatusAPI = (threadId: string) => {\n const ENDPOINT = `/${STRUCT_API_VERSION}/typing`;\n return structAPIFetchClient(ENDPOINT, {\n method: \"PUT\",\n body: JSON.stringify({\n thread_id: threadId,\n }),\n })\n .then((response) => {\n if (!response.ok) {\n throw new Error(\"Network response was not ok\");\n }\n return response.json();\n })\n .then(({ data }) => data as StructTag[]);\n};\n\nexport const sendPresenceAPI = () => {\n const ENDPOINT = `/${STRUCT_API_VERSION}/presence`;\n return structAPIFetchClient(ENDPOINT, {\n method: \"PUT\",\n body: JSON.stringify({}),\n })\n .then((response) => {\n if (!response.ok) {\n throw new Error(\"Network response was not ok\");\n }\n return response.json();\n })\n .then(({ data }) => data as StructTag[]);\n};\n","// extracted by mini-css-extract-plugin\nmodule.exports = {\"mainArea\":\"layout_mainArea__qk0t3\",\"renderArea\":\"layout_renderArea__xKiZT\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"chatBox\":\"ChatBox_chatBox__NyeC0\",\"selectedFilesPreview\":\"ChatBox_selectedFilesPreview__gsach\",\"removeFileButton\":\"ChatBox_removeFileButton__knskA\",\"selectedFileContainer\":\"ChatBox_selectedFileContainer__URgKw\",\"mentionCallout\":\"ChatBox_mentionCallout__IxWV8\",\"textAreaContainer\":\"ChatBox_textAreaContainer__9Z03U\",\"buttonShelf\":\"ChatBox_buttonShelf___mJgd\",\"chatOptions\":\"ChatBox_chatOptions__Izxvv\",\"chatSendAction\":\"ChatBox_chatSendAction__ixVLE\",\"disabled\":\"ChatBox_disabled__gBi_v\",\"collapsibleContent\":\"ChatBox_collapsibleContent__HhuR2\",\"slideDown\":\"ChatBox_slideDown__eCZZL\",\"slideUp\":\"ChatBox_slideUp__lQZlZ\",\"similarThreadsContainer\":\"ChatBox_similarThreadsContainer__5k7Ax\",\"similarThreadsTrigger\":\"ChatBox_similarThreadsTrigger__YA9Ab\",\"icon\":\"ChatBox_icon__7KeY0\",\"hasSimilarThreads\":\"ChatBox_hasSimilarThreads__AWKD2\",\"text\":\"ChatBox_text__F4D66\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"chatBoxEditor\":\"ChatBoxEditor_chatBoxEditor__VWvV7\",\"chatBoxEditorSkeleton\":\"ChatBoxEditor_chatBoxEditorSkeleton__xdHAu\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"similarThreadsSelector\":\"SimilarThreadsSelector_similarThreadsSelector__y_D0T\",\"similarThreadButton\":\"SimilarThreadsSelector_similarThreadButton___1Uya\",\"selected\":\"SimilarThreadsSelector_selected___GV0b\",\"fileTextIcon\":\"SimilarThreadsSelector_fileTextIcon__A_rgX\",\"arrowIcon\":\"SimilarThreadsSelector_arrowIcon__L3L6B\",\"additionalInformation\":\"SimilarThreadsSelector_additionalInformation__qAfX2\",\"similarThreadModal\":\"SimilarThreadsSelector_similarThreadModal__BfC_5\"};","import $73KQ4$babelruntimehelpersesmextends from \"@babel/runtime/helpers/esm/extends\";\nimport {forwardRef as $73KQ4$forwardRef, createElement as $73KQ4$createElement, useCallback as $73KQ4$useCallback, useState as $73KQ4$useState, useRef as $73KQ4$useRef, useEffect as $73KQ4$useEffect} from \"react\";\nimport {composeEventHandlers as $73KQ4$composeEventHandlers} from \"@radix-ui/primitive\";\nimport {createContextScope as $73KQ4$createContextScope} from \"@radix-ui/react-context\";\nimport {useControllableState as $73KQ4$useControllableState} from \"@radix-ui/react-use-controllable-state\";\nimport {useLayoutEffect as $73KQ4$useLayoutEffect} from \"@radix-ui/react-use-layout-effect\";\nimport {useComposedRefs as $73KQ4$useComposedRefs} from \"@radix-ui/react-compose-refs\";\nimport {Primitive as $73KQ4$Primitive} from \"@radix-ui/react-primitive\";\nimport {Presence as $73KQ4$Presence} from \"@radix-ui/react-presence\";\nimport {useId as $73KQ4$useId} from \"@radix-ui/react-id\";\n\n\n\n\n\n\n\n\n\n\n\n/* -------------------------------------------------------------------------------------------------\n * Collapsible\n * -----------------------------------------------------------------------------------------------*/ const $409067139f391064$var$COLLAPSIBLE_NAME = 'Collapsible';\nconst [$409067139f391064$var$createCollapsibleContext, $409067139f391064$export$952b32dcbe73087a] = $73KQ4$createContextScope($409067139f391064$var$COLLAPSIBLE_NAME);\nconst [$409067139f391064$var$CollapsibleProvider, $409067139f391064$var$useCollapsibleContext] = $409067139f391064$var$createCollapsibleContext($409067139f391064$var$COLLAPSIBLE_NAME);\nconst $409067139f391064$export$6eb0f7ddcda6131f = /*#__PURE__*/ $73KQ4$forwardRef((props, forwardedRef)=>{\n const { __scopeCollapsible: __scopeCollapsible , open: openProp , defaultOpen: defaultOpen , disabled: disabled , onOpenChange: onOpenChange , ...collapsibleProps } = props;\n const [open = false, setOpen] = $73KQ4$useControllableState({\n prop: openProp,\n defaultProp: defaultOpen,\n onChange: onOpenChange\n });\n return /*#__PURE__*/ $73KQ4$createElement($409067139f391064$var$CollapsibleProvider, {\n scope: __scopeCollapsible,\n disabled: disabled,\n contentId: $73KQ4$useId(),\n open: open,\n onOpenToggle: $73KQ4$useCallback(()=>setOpen((prevOpen)=>!prevOpen\n )\n , [\n setOpen\n ])\n }, /*#__PURE__*/ $73KQ4$createElement($73KQ4$Primitive.div, $73KQ4$babelruntimehelpersesmextends({\n \"data-state\": $409067139f391064$var$getState(open),\n \"data-disabled\": disabled ? '' : undefined\n }, collapsibleProps, {\n ref: forwardedRef\n })));\n});\n/*#__PURE__*/ Object.assign($409067139f391064$export$6eb0f7ddcda6131f, {\n displayName: $409067139f391064$var$COLLAPSIBLE_NAME\n});\n/* -------------------------------------------------------------------------------------------------\n * CollapsibleTrigger\n * -----------------------------------------------------------------------------------------------*/ const $409067139f391064$var$TRIGGER_NAME = 'CollapsibleTrigger';\nconst $409067139f391064$export$c135dce7b15bbbdc = /*#__PURE__*/ $73KQ4$forwardRef((props, forwardedRef)=>{\n const { __scopeCollapsible: __scopeCollapsible , ...triggerProps } = props;\n const context = $409067139f391064$var$useCollapsibleContext($409067139f391064$var$TRIGGER_NAME, __scopeCollapsible);\n return /*#__PURE__*/ $73KQ4$createElement($73KQ4$Primitive.button, $73KQ4$babelruntimehelpersesmextends({\n type: \"button\",\n \"aria-controls\": context.contentId,\n \"aria-expanded\": context.open || false,\n \"data-state\": $409067139f391064$var$getState(context.open),\n \"data-disabled\": context.disabled ? '' : undefined,\n disabled: context.disabled\n }, triggerProps, {\n ref: forwardedRef,\n onClick: $73KQ4$composeEventHandlers(props.onClick, context.onOpenToggle)\n }));\n});\n/*#__PURE__*/ Object.assign($409067139f391064$export$c135dce7b15bbbdc, {\n displayName: $409067139f391064$var$TRIGGER_NAME\n});\n/* -------------------------------------------------------------------------------------------------\n * CollapsibleContent\n * -----------------------------------------------------------------------------------------------*/ const $409067139f391064$var$CONTENT_NAME = 'CollapsibleContent';\nconst $409067139f391064$export$aadde00976f34151 = /*#__PURE__*/ $73KQ4$forwardRef((props, forwardedRef)=>{\n const { forceMount: forceMount , ...contentProps } = props;\n const context = $409067139f391064$var$useCollapsibleContext($409067139f391064$var$CONTENT_NAME, props.__scopeCollapsible);\n return /*#__PURE__*/ $73KQ4$createElement($73KQ4$Presence, {\n present: forceMount || context.open\n }, ({ present: present })=>/*#__PURE__*/ $73KQ4$createElement($409067139f391064$var$CollapsibleContentImpl, $73KQ4$babelruntimehelpersesmextends({}, contentProps, {\n ref: forwardedRef,\n present: present\n }))\n );\n});\n/*#__PURE__*/ Object.assign($409067139f391064$export$aadde00976f34151, {\n displayName: $409067139f391064$var$CONTENT_NAME\n});\n/* -----------------------------------------------------------------------------------------------*/ const $409067139f391064$var$CollapsibleContentImpl = /*#__PURE__*/ $73KQ4$forwardRef((props, forwardedRef)=>{\n const { __scopeCollapsible: __scopeCollapsible , present: present , children: children , ...contentProps } = props;\n const context = $409067139f391064$var$useCollapsibleContext($409067139f391064$var$CONTENT_NAME, __scopeCollapsible);\n const [isPresent, setIsPresent] = $73KQ4$useState(present);\n const ref = $73KQ4$useRef(null);\n const composedRefs = $73KQ4$useComposedRefs(forwardedRef, ref);\n const heightRef = $73KQ4$useRef(0);\n const height = heightRef.current;\n const widthRef = $73KQ4$useRef(0);\n const width = widthRef.current; // when opening we want it to immediately open to retrieve dimensions\n // when closing we delay `present` to retrieve dimensions before closing\n const isOpen = context.open || isPresent;\n const isMountAnimationPreventedRef = $73KQ4$useRef(isOpen);\n const originalStylesRef = $73KQ4$useRef();\n $73KQ4$useEffect(()=>{\n const rAF = requestAnimationFrame(()=>isMountAnimationPreventedRef.current = false\n );\n return ()=>cancelAnimationFrame(rAF)\n ;\n }, []);\n $73KQ4$useLayoutEffect(()=>{\n const node = ref.current;\n if (node) {\n originalStylesRef.current = originalStylesRef.current || {\n transitionDuration: node.style.transitionDuration,\n animationName: node.style.animationName\n }; // block any animations/transitions so the element renders at its full dimensions\n node.style.transitionDuration = '0s';\n node.style.animationName = 'none'; // get width and height from full dimensions\n const rect = node.getBoundingClientRect();\n heightRef.current = rect.height;\n widthRef.current = rect.width; // kick off any animations/transitions that were originally set up if it isn't the initial mount\n if (!isMountAnimationPreventedRef.current) {\n node.style.transitionDuration = originalStylesRef.current.transitionDuration;\n node.style.animationName = originalStylesRef.current.animationName;\n }\n setIsPresent(present);\n }\n /**\n * depends on `context.open` because it will change to `false`\n * when a close is triggered but `present` will be `false` on\n * animation end (so when close finishes). This allows us to\n * retrieve the dimensions *before* closing.\n */ }, [\n context.open,\n present\n ]);\n return /*#__PURE__*/ $73KQ4$createElement($73KQ4$Primitive.div, $73KQ4$babelruntimehelpersesmextends({\n \"data-state\": $409067139f391064$var$getState(context.open),\n \"data-disabled\": context.disabled ? '' : undefined,\n id: context.contentId,\n hidden: !isOpen\n }, contentProps, {\n ref: composedRefs,\n style: {\n [`--radix-collapsible-content-height`]: height ? `${height}px` : undefined,\n [`--radix-collapsible-content-width`]: width ? `${width}px` : undefined,\n ...props.style\n }\n }), isOpen && children);\n});\n/* -----------------------------------------------------------------------------------------------*/ function $409067139f391064$var$getState(open) {\n return open ? 'open' : 'closed';\n}\nconst $409067139f391064$export$be92b6f5f03c0fe9 = $409067139f391064$export$6eb0f7ddcda6131f;\nconst $409067139f391064$export$41fb9f06171c75f4 = $409067139f391064$export$c135dce7b15bbbdc;\nconst $409067139f391064$export$7c6e2c02157bb7d2 = $409067139f391064$export$aadde00976f34151;\n\n\n\n\nexport {$409067139f391064$export$952b32dcbe73087a as createCollapsibleScope, $409067139f391064$export$6eb0f7ddcda6131f as Collapsible, $409067139f391064$export$c135dce7b15bbbdc as CollapsibleTrigger, $409067139f391064$export$aadde00976f34151 as CollapsibleContent, $409067139f391064$export$be92b6f5f03c0fe9 as Root, $409067139f391064$export$41fb9f06171c75f4 as Trigger, $409067139f391064$export$7c6e2c02157bb7d2 as Content};\n//# sourceMappingURL=index.mjs.map\n"],"names":["calloutRootPropDefs","size","type","values","default","responsive","variant","color","color_prop","m","undefined","highContrast","high_contrast_prop","B","CalloutContext","react","createContext","CalloutRoot","forwardRef","props","forwardedRef","rest","marginRest","marginProps","margin_props","FY","children","className","rootProps","createElement","classnames_default","breakpoints","g","we","ref","Provider","value","useMemo","displayName","CalloutIcon","useContext","components_text","x","asChild","getTextSize","CalloutText","as","getNonResponsiveTextSize","Object","fromEntries","entries","map","key","Callout","assign","Root","Icon","Text","NAN","reTrim","reIsBadHex","reIsBinary","reIsOctal","freeParseInt","parseInt","freeGlobal","__webpack_require__","freeSelf","self","root","Function","objectToString","objectProto","prototype","toString","nativeMax","Math","max","nativeMin","min","now","Date","debounce","func","wait","options","lastArgs","lastThis","maxWait","result","timerId","lastCallTime","lastInvokeTime","leading","maxing","trailing","invokeFunc","time","args","thisArg","apply","leadingEdge","setTimeout","timerExpired","remainingWait","timeSinceLastCall","timeSinceLastInvoke","shouldInvoke","trailingEdge","cancel","clearTimeout","flush","debounced","isInvoking","arguments","toNumber","isObject","isObjectLike","isSymbol","call","other","valueOf","replace","isBinary","test","slice","module","exports","throttle","Promise","resolve","then","t","bind","extractTextWithNewlines","textWithNewlines","state","doc","forEach","block","node","name","linkMark","marks","find","mark","concat","attrs","href","text","mentionId","id","ChatBoxEditor","onChange","placeholder","onFocus","onBlur","onArrowUpFirstCharacter","onArrowDownLastCharacter","onEnter","onOpenEmojiPicker","onImageUpload","autofocus","param","sessionUserId","useAppStore","session","user","tags","initialContent","setChatBoxCommands","editor","useEditor","content","editorProps","handlePaste","view","event","Array","clipboardData","images","from","files","filter","file","length","pastedText","getData","containsNewLines","includes","preventDefault","textFragments","split","flatMap","textPart","textNode","schema","breakNode","endsWithHardBreak","pop","hasFragmentsToInsert","transaction","tr","insert","selection","dispatch","attributes","class","handleKeyDown","prevChar","textBetween","mentionIsActive","plugins","some","plugin","startsWith","getState","active","stopPropagation","shiftKey","editorOutput","trim","to","docLength","extensions","Link","configure","openOnClick","validate","Placeholder","includeChildren","Document","Paragraph","HTMLAttributes","HardBreak","History","Mention","extend","suggestion","char","pluginKey","PluginKey","allowSpaces","allowedPrefixes","items","query","mentions","getMentions","users","USERS_SEARCH_RESULT_LIMIT","channels","CHANNELS_SEARCH_RESULT_LIMIT","c","u","render","reactRenderer","onStart","ReactRenderer","MentionList","showSearch","onUpdate","updateProps","onKeyDown","_this","destroy","onExit","filteredTags","tag","toLowerCase","useEffect","insertMention","commands","insertContent","mentionData","label","focus","blur","clearContent","insertCharacter","getJSON","lastNode","lastChar","character","atCharacter","extensionManager","extension","on","newContent","off","jsx_runtime","jsx","EditorContent","styles","div","icons_ArrowLoopUpReverse","style","jsxs","svg","width","height","viewBox","fill","xmlns","rect","fillOpacity","path","fillRule","clipRule","d","ArrorRightCenter","SimilarThreadsSelector_SimilarThreadCard","typingUsersByThread","threadId","title","summary","reactions","messageCount","unreadMessageCount","createdDate","lastUpdated","bits","isResolved","thread_resolved","currentUserId","typingUsersByThreadId","typingUserNamesById","typingUsers","Flex","gap","direction","align","Badge","ArrowLoopUpReverse","Heading","weight","justify","overflow","FeedItemFooter","num_unread","formatTimeAgo","DateTime","fromSeconds","Box","display","initial","xs","whiteSpace","ArrowRightCenter","SimilarThreadsSelector","similarThreads","onThreadOpen","onClose","isExpanded","isFeedView","handleChatBoxFocus","selectedThreadIndex","setSelectedThreadIndex","useState","hasMouseMovedSinceOpen","setHasMouseMovedSinceOpen","lastInteractionKeyboard","setLastInteractionKeyboard","isElementInViewport","el","parent","getBoundingClientRect","parentRect","left","right","current","handleThreadClick","index","handleMouseOver","selectedThread","tabIndex","newIndex","e","container","button","scrollLeft","onMouseMove","onMouseLeave","thread","isSelected","maxWidth","minWidth","onClick","onMouseOver","grow","FileTextIcon","textAlign","subject","ArrowRightIcon","SimilarThreadCard","summaryText","updated_at","num_chats","icons_AtSignIcon","hooks_useTimedCallout","initialVisibility","duration","isCalloutVisible","setIsCalloutVisible","icons_NewThreadIcon","CONFIRMATION_DIALOG","create","primaryLabel","delete","ChatActions","currentPath","navigateToPath","useShallowNavigation","featureToggles","useApp","canCreateThreadFromChat","selectedChats","selectedChatsByThreadId","currentThreadChatIds","chatsByThreadId","chat","clearSelectedChats","setSelectedChats","toggleSelectedChatMessage","deleteChatMessage","forkChats","useChats","confirmationType","setConfirmationType","handleCreate","thread_id","chatIds","error","console","handleDelete","all","messageId","response","ok","handleConfirm","Fragment","p","borderRadius","border","backdropFilter","background","boxShadow","position","transform","bottom","zIndex","nativeEvent","stopImmediatePropagation","Button","NewThreadIcon","TrashIcon","Separator","orientation","Cross1Icon","ConfirmationDialog","onCancel","onConfirm","hooks_useThrottle","debouncedFunc","useRef","ChatBox_ChatBox","createChatMessage","createThread","fetchSimilarThreads","useThreads","showCallout","useTimedCallout","similarThreadsById","setLastChatInThreadInEditMode","getChatBoxCommands","isAuthenticatedWithCorrectOrg","organisation","clearChatReply","chatReply","getChatReply","setChatMessage","insertThreadChatById","isSlackOrg","org_slack","hasSlackAuthPerms","user_slack_auth","shouldShowSimilarThreads","throttledSendTypingStatus","useThrottle","sendTypingStatusAPI","chatBoxContent","setChatboxContent","hasSimilarThreadsOpen","setHasSimilarThreadsOpen","shouldRefocusInput","setShouldRefocusInput","isActive","setIsActive","localSimilarThreads","setLocalSimilarThreads","isColonEmojiPickerVisible","setIsColonEmojiPickerVisible","isEmojiPickerOpen","setIsEmojiPickerOpen","isDragging","setIsDragging","similarThreadsRef","threadIdRef","dropZoneRef","selectedFiles","setSelectedFiles","uploadedFilesUrlsRef","fileInputRef","React","uploadFile","useFiles","hasSimilarThreads","typingUserIds","theme","useTheme","isChatBoxDisabled","prevThreadIdRef","getCompactComponentsFromChatBlocks","useParser","EntityIDMap","Thread","debouncedFetch","hits","joinedSimilarThreads","joinManyThreadsData","threads","log","handleGlobalKeyUp","handleColonEmojiClose","document","addEventListener","removeEventListener","handleSendMessage","message","messageHasMentions","User","Channel","hasFiles","channelIds","extractChannelIdsFromMessage","newThreadId","attachments","chatResponse","reply_to","data","ENABLE_CHAT_HTTP_RESPONSE_INSERT","handleEmojiClick","native","prevValue","emojiSelected","toggleSimilarThreads","handleInsertCharacter","handleFileRemove","prevFiles","_","i","handleFiles","previewImages","reader","FileReader","readerPromise","readAsDataURL","onload","url","loadedPreviews","preview","isLoading","uploadPromises","uploadedFile","handle","catch","fileUrls","Boolean","handleFileSelect","target","handleDrop","dataTransfer","item","kind","getAsFile","isChatEnabled","repliedToChatMessage","getRepliedToChatMessage","opacity","onDragOver","onDrop","onDragEnter","onDragLeave","contains","relatedTarget","top","InfoCircledIcon","SLACK_LEVEL_3_PERMISSIONS","backgroundColor","justifyContent","alignItems","pointerEvents","join","Popover","open","PopoverTrigger","IconButton","FaceIcon","PopoverContent","Picker","onEmojiSelect","onClickOutside","autoFocus","AtSignIcon","HashtagIcon","click","UploadIcon","PaperPlaneIcon","img","mb","FilePreview","radius","Cross2Icon","input","accept","multiple","ml","ReplyToChatPreview","avatarId","author","avatar_id","display_name","blocks","FEED_VIEW_PLACEHOLDER","CHAT_VIEW_PLACEHOLDER","TypingIndicator","names","cursor","LightningBoltIcon","Collapsible","onOpenChange","UPLOAD_ENDPOINT","STRUCT_API_VERSION","uploadImageAPI","formData","FormData","append","structAPIFetchClient","method","body","json","hooks_useFiles","organisationId","useCallback","ENDPOINT","JSON","stringify","sendPresenceAPI","$409067139f391064$var$COLLAPSIBLE_NAME","$409067139f391064$var$createCollapsibleContext","$409067139f391064$export$952b32dcbe73087a","_radix_ui_react_context__WEBPACK_IMPORTED_MODULE_1__","b","$409067139f391064$var$CollapsibleProvider","$409067139f391064$var$useCollapsibleContext","$409067139f391064$export$6eb0f7ddcda6131f","react__WEBPACK_IMPORTED_MODULE_0__","__scopeCollapsible","openProp","defaultOpen","disabled","collapsibleProps","setOpen","_radix_ui_react_use_controllable_state__WEBPACK_IMPORTED_MODULE_2__","T","prop","defaultProp","scope","contentId","_radix_ui_react_id__WEBPACK_IMPORTED_MODULE_3__","M","onOpenToggle","prevOpen","_radix_ui_react_primitive__WEBPACK_IMPORTED_MODULE_4__","WV","_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_5__","Z","$409067139f391064$var$getState","$409067139f391064$export$c135dce7b15bbbdc","triggerProps","context","_radix_ui_primitive__WEBPACK_IMPORTED_MODULE_6__","$409067139f391064$var$CONTENT_NAME","$409067139f391064$export$aadde00976f34151","forceMount","contentProps","_radix_ui_react_presence__WEBPACK_IMPORTED_MODULE_7__","z","present","$409067139f391064$var$CollapsibleContentImpl","isPresent","setIsPresent","composedRefs","_radix_ui_react_compose_refs__WEBPACK_IMPORTED_MODULE_8__","heightRef","widthRef","isOpen","isMountAnimationPreventedRef","originalStylesRef","rAF","requestAnimationFrame","cancelAnimationFrame","_radix_ui_react_use_layout_effect__WEBPACK_IMPORTED_MODULE_9__","transitionDuration","animationName","hidden","$409067139f391064$export$be92b6f5f03c0fe9","$409067139f391064$export$41fb9f06171c75f4","$409067139f391064$export$7c6e2c02157bb7d2"],"sourceRoot":""}