@brainfish-ai/components 0.0.20 → 0.0.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cjs/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";var e=require("react"),t=require("lucide-react"),r=require("framer-motion"),a=require("react/jsx-runtime"),o=require("class-variance-authority"),n=require("clsx"),i=require("tailwind-merge"),s=require("@radix-ui/react-dropdown-menu"),l=require("@radix-ui/react-icons"),c=require("rehype-raw"),d=require("remark-gfm"),m=require("react-syntax-highlighter"),p=require("react-syntax-highlighter/dist/cjs/styles/prism"),u=require("react-markdown"),h=require("@radix-ui/react-tooltip");function g(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var a=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,a.get?a:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var f=g(e),b=g(s),w=g(h);function v(e,t){void 0===t&&(t={});var r=t.insertAt;if(e&&"undefined"!=typeof document){var a=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===r&&a.firstChild?a.insertBefore(o,a.firstChild):a.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}function y(e,t){var r={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(r[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(a=Object.getOwnPropertySymbols(e);o<a.length;o++)t.indexOf(a[o])<0&&Object.prototype.propertyIsEnumerable.call(e,a[o])&&(r[a[o]]=e[a[o]])}return r}function x(e,t,r,a){return new(r||(r=Promise))((function(o,n){function i(e){try{l(a.next(e))}catch(e){n(e)}}function s(e){try{l(a.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,s)}l((a=a.apply(e,t||[])).next())}))}function k(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function E(...e){return t=>{let r=!1;const a=e.map((e=>{const a=k(e,t);return r||"function"!=typeof a||(r=!0),a}));if(r)return()=>{for(let t=0;t<a.length;t++){const r=a[t];"function"==typeof r?r():k(e[t],null)}}}}v('/*! tailwindcss v3.3.5 | MIT License | https://tailwindcss.com*/*,:after,:before{border:0 solid #e5e7eb;box-sizing:border-box}:after,:before{--tw-content:""}html{-webkit-text-size-adjust:100%;font-feature-settings:normal;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{color:#9ca3af;opacity:1}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]{display:none}:root{--background:0 0% 100%;--foreground:0 0% 3.9%;--card:0 0% 100%;--card-foreground:0 0% 3.9%;--popover:0 0% 100%;--popover-foreground:0 0% 3.9%;--primary:0 0% 9%;--primary-foreground:0 0% 98%;--secondary:0 0% 96.1%;--secondary-foreground:0 0% 9%;--muted:0 0% 96.1%;--muted-foreground:0 0% 45.1%;--accent:0 0% 96.1%;--accent-foreground:0 0% 9%;--destructive:0 84.2% 60.2%;--destructive-foreground:0 0% 98%;--border:0 0% 89.8%;--input:0 0% 89.8%;--ring:0 0% 3.9%;--radius:0.5rem}.dark{--background:0 0% 3.9%;--foreground:0 0% 98%;--card:0 0% 3.9%;--card-foreground:0 0% 98%;--popover:0 0% 3.9%;--popover-foreground:0 0% 98%;--primary:0 0% 98%;--primary-foreground:0 0% 9%;--secondary:0 0% 14.9%;--secondary-foreground:0 0% 98%;--muted:0 0% 14.9%;--muted-foreground:0 0% 63.9%;--accent:0 0% 14.9%;--accent-foreground:0 0% 98%;--destructive:0 62.8% 30.6%;--destructive-foreground:0 0% 98%;--border:0 0% 14.9%;--input:0 0% 14.9%;--ring:0 0% 83.1%}*{border-color:hsl(var(--border))}body{background-color:hsl(var(--background));color:hsl(var(--foreground))}*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.\\!container{margin-left:auto!important;margin-right:auto!important;padding-left:2rem!important;padding-right:2rem!important;width:100%!important}.container{margin-left:auto;margin-right:auto;padding-left:2rem;padding-right:2rem;width:100%}@media (min-width:1400px){.\\!container{max-width:1400px!important}.container{max-width:1400px}}.pointer-events-none{pointer-events:none}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.bottom-20{bottom:5rem}.bottom-4{bottom:1rem}.left-0{left:0}.left-12{left:3rem}.left-2{left:.5rem}.left-4{left:1rem}.right-1{right:.25rem}.right-4{right:1rem}.top-0{top:0}.top-1{top:.25rem}.top-1\\/2{top:50%}.top-3{top:.75rem}.z-10{z-index:10}.z-50{z-index:50}.-mx-1{margin-left:-.25rem;margin-right:-.25rem}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-bottom:.25rem;margin-top:.25rem}.my-2{margin-top:.5rem}.mb-2,.my-2{margin-bottom:.5rem}.mb-20{margin-bottom:5rem}.mb-4{margin-bottom:1rem}.ml-2{margin-left:.5rem}.ml-4{margin-left:1rem}.ml-auto{margin-left:auto}.mr-1{margin-right:.25rem}.mr-1\\.5{margin-right:.375rem}.mr-2{margin-right:.5rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.mt-\\[-5px\\]{margin-top:-5px}.block{display:block}.inline-block{display:inline-block}.\\!inline{display:inline!important}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.hidden{display:none}.h-10{height:2.5rem}.h-2{height:.5rem}.h-3{height:.75rem}.h-3\\.5{height:.875rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-\\[44px\\]{height:44px}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.min-h-\\[36px\\]{min-height:36px}.min-h-screen{min-height:100vh}.w-2{width:.5rem}.w-3{width:.75rem}.w-3\\.5{width:.875rem}.w-3\\/4{width:75%}.w-4{width:1rem}.w-48{width:12rem}.w-5{width:1.25rem}.w-8{width:2rem}.w-9{width:2.25rem}.w-full{width:100%}.min-w-\\[8rem\\]{min-width:8rem}.max-w-3xl{max-width:48rem}.max-w-none{max-width:none}.flex-1{flex:1 1 0%}.flex-shrink-0,.shrink-0{flex-shrink:0}.flex-grow{flex-grow:1}.border-collapse{border-collapse:collapse}.-translate-x-1{--tw-translate-x:-0.25rem}.-translate-x-1,.-translate-y-1\\/2{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\\/2{--tw-translate-y:-50%}.rotate-180{--tw-rotate:180deg}.rotate-180,.rotate-45{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-45{--tw-rotate:45deg}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(1turn)}}.animate-spin{animation:spin 1s linear infinite}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize-none{resize:none}.list-outside{list-style-position:outside}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-4{gap:1rem}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(.75rem*var(--tw-space-y-reverse));margin-top:calc(.75rem*(1 - var(--tw-space-y-reverse)))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(1rem*var(--tw-space-y-reverse));margin-top:calc(1rem*(1 - var(--tw-space-y-reverse)))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(1.5rem*var(--tw-space-y-reverse));margin-top:calc(1.5rem*(1 - var(--tw-space-y-reverse)))}.space-y-8>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(2rem*var(--tw-space-y-reverse));margin-top:calc(2rem*(1 - var(--tw-space-y-reverse)))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse:0;border-bottom-width:calc(1px*var(--tw-divide-y-reverse));border-top-width:calc(1px*(1 - var(--tw-divide-y-reverse)))}.divide-gray-200>:not([hidden])~:not([hidden]){--tw-divide-opacity:1;border-color:rgb(229 231 235/var(--tw-divide-opacity))}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.whitespace-normal{white-space:normal}.whitespace-nowrap{white-space:nowrap}.break-words{overflow-wrap:break-word}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:.75rem}.rounded-b-lg{border-bottom-left-radius:var(--radius);border-bottom-right-radius:var(--radius)}.rounded-t-lg{border-top-left-radius:var(--radius);border-top-right-radius:var(--radius)}.border{border-width:1px}.border-2{border-width:2px}.border-t{border-top-width:1px}.border-none{border-style:none}.border-black{--tw-border-opacity:1;border-color:rgb(0 0 0/var(--tw-border-opacity))}.border-gray-200{--tw-border-opacity:1;border-color:rgb(229 231 235/var(--tw-border-opacity))}.border-gray-300{--tw-border-opacity:1;border-color:rgb(209 213 219/var(--tw-border-opacity))}.border-input{border-color:hsl(var(--input))}.border-slate-300{--tw-border-opacity:1;border-color:rgb(203 213 225/var(--tw-border-opacity))}.border-transparent{border-color:transparent}.border-t-transparent{border-top-color:transparent}.bg-\\[\\#86efac\\]{--tw-bg-opacity:1;background-color:rgb(134 239 172/var(--tw-bg-opacity))}.bg-background{background-color:hsl(var(--background))}.bg-black{--tw-bg-opacity:1;background-color:rgb(0 0 0/var(--tw-bg-opacity))}.bg-destructive{background-color:hsl(var(--destructive))}.bg-gray-100{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity))}.bg-gray-500{--tw-bg-opacity:1;background-color:rgb(107 114 128/var(--tw-bg-opacity))}.bg-green-100{--tw-bg-opacity:1;background-color:rgb(220 252 231/var(--tw-bg-opacity))}.bg-muted{background-color:hsl(var(--muted))}.bg-popover{background-color:hsl(var(--popover))}.bg-primary{background-color:hsl(var(--primary))}.bg-red-100{--tw-bg-opacity:1;background-color:rgb(254 226 226/var(--tw-bg-opacity))}.bg-secondary{background-color:hsl(var(--secondary))}.bg-slate-200{--tw-bg-opacity:1;background-color:rgb(226 232 240/var(--tw-bg-opacity))}.bg-transparent{background-color:transparent}.bg-zinc-800\\/80{background-color:rgba(39,39,42,.8)}.bg-opacity-50{--tw-bg-opacity:0.5}.fill-current{fill:currentColor}.object-cover{-o-object-fit:cover;object-fit:cover}.p-0{padding:0}.p-0\\.5{padding:.125rem}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-8{padding-left:2rem;padding-right:2rem}.py-1{padding-bottom:.25rem;padding-top:.25rem}.py-1\\.5{padding-bottom:.375rem;padding-top:.375rem}.py-2{padding-bottom:.5rem;padding-top:.5rem}.py-20{padding-bottom:5rem;padding-top:5rem}.py-3{padding-bottom:.75rem;padding-top:.75rem}.py-4{padding-bottom:1rem;padding-top:1rem}.pb-1{padding-bottom:.25rem}.pl-8{padding-left:2rem}.pr-2{padding-right:.5rem}.text-center{text-align:center}.font-sans{font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-5xl{font-size:3rem;line-height:1}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-light{font-weight:300}.font-medium{font-weight:500}.font-semibold{font-weight:600}.lowercase{text-transform:lowercase}.italic{font-style:italic}.tracking-widest{letter-spacing:.1em}.text-destructive-foreground{color:hsl(var(--destructive-foreground))}.text-gray-400{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity))}.text-gray-500{--tw-text-opacity:1;color:rgb(107 114 128/var(--tw-text-opacity))}.text-gray-700{--tw-text-opacity:1;color:rgb(55 65 81/var(--tw-text-opacity))}.text-gray-900{--tw-text-opacity:1;color:rgb(17 24 39/var(--tw-text-opacity))}.text-green-500{--tw-text-opacity:1;color:rgb(34 197 94/var(--tw-text-opacity))}.text-green-600{--tw-text-opacity:1;color:rgb(22 163 74/var(--tw-text-opacity))}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-red-400{--tw-text-opacity:1;color:rgb(248 113 113/var(--tw-text-opacity))}.text-red-600{--tw-text-opacity:1;color:rgb(220 38 38/var(--tw-text-opacity))}.text-secondary-foreground{color:hsl(var(--secondary-foreground))}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.text-zinc-400{--tw-text-opacity:1;color:rgb(161 161 170/var(--tw-text-opacity))}.underline-offset-4{text-underline-offset:4px}.opacity-0{opacity:0}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color)}.shadow,.shadow-lg{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color)}.shadow-md{--tw-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color)}.shadow-md,.shadow-sm{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-0{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur{--tw-backdrop-blur:blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-colors{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-opacity{transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-transform{transition-duration:.15s;transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}@keyframes enter{0%{opacity:var(--tw-enter-opacity,1);transform:translate3d(var(--tw-enter-translate-x,0),var(--tw-enter-translate-y,0),0) scale3d(var(--tw-enter-scale,1),var(--tw-enter-scale,1),var(--tw-enter-scale,1)) rotate(var(--tw-enter-rotate,0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity,1);transform:translate3d(var(--tw-exit-translate-x,0),var(--tw-exit-translate-y,0),0) scale3d(var(--tw-exit-scale,1),var(--tw-exit-scale,1),var(--tw-exit-scale,1)) rotate(var(--tw-exit-rotate,0))}}.animate-in{--tw-enter-opacity:initial;--tw-enter-scale:initial;--tw-enter-rotate:initial;--tw-enter-translate-x:initial;--tw-enter-translate-y:initial;animation-duration:.15s;animation-name:enter}.fade-in-0{--tw-enter-opacity:0}.zoom-in-95{--tw-enter-scale:.95}.duration-200{animation-duration:.2s}.duration-300{animation-duration:.3s}.ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)}.placeholder\\:text-sm::-moz-placeholder{font-size:.875rem;line-height:1.25rem}.placeholder\\:text-sm::placeholder{font-size:.875rem;line-height:1.25rem}.placeholder\\:text-gray-400::-moz-placeholder{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity))}.placeholder\\:text-gray-400::placeholder{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity))}.hover\\:bg-\\[\\#86efac\\]\\/90:hover{background-color:rgba(134,239,172,.9)}.hover\\:bg-accent:hover{background-color:hsl(var(--accent))}.hover\\:bg-destructive\\/90:hover{background-color:hsl(var(--destructive)/.9)}.hover\\:bg-gray-100:hover{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity))}.hover\\:bg-gray-200:hover{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity))}.hover\\:bg-gray-50:hover{--tw-bg-opacity:1;background-color:rgb(249 250 251/var(--tw-bg-opacity))}.hover\\:bg-primary\\/90:hover{background-color:hsl(var(--primary)/.9)}.hover\\:bg-secondary\\/80:hover{background-color:hsl(var(--secondary)/.8)}.hover\\:bg-zinc-700\\/50:hover{background-color:rgba(63,63,70,.5)}.hover\\:bg-opacity-50:hover{--tw-bg-opacity:0.5}.hover\\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\\:text-zinc-100:hover{--tw-text-opacity:1;color:rgb(244 244 245/var(--tw-text-opacity))}.hover\\:underline:hover{text-decoration-line:underline}.hover\\:opacity-90:hover{opacity:.9}.focus\\:bg-accent:focus{background-color:hsl(var(--accent))}.focus\\:text-accent-foreground:focus{color:hsl(var(--accent-foreground))}.focus-visible\\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\\:ring-1:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus-visible\\:ring-2:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus-visible\\:ring-ring:focus-visible{--tw-ring-color:hsl(var(--ring))}.focus-visible\\:ring-offset-2:focus-visible{--tw-ring-offset-width:2px}.focus-visible\\:ring-offset-background:focus-visible{--tw-ring-offset-color:hsl(var(--background))}.disabled\\:pointer-events-none:disabled{pointer-events:none}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:opacity-50:disabled{opacity:.5}.group:hover .group-hover\\:opacity-100{opacity:1}.data-\\[disabled\\]\\:pointer-events-none[data-disabled]{pointer-events:none}.data-\\[state\\=checked\\]\\:translate-x-4[data-state=checked]{--tw-translate-x:1rem}.data-\\[state\\=checked\\]\\:translate-x-4[data-state=checked],.data-\\[state\\=unchecked\\]\\:translate-x-0[data-state=unchecked]{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[state\\=unchecked\\]\\:translate-x-0[data-state=unchecked]{--tw-translate-x:0px}.data-\\[state\\=checked\\]\\:bg-primary[data-state=checked]{background-color:hsl(var(--primary))}.data-\\[state\\=open\\]\\:bg-accent[data-state=open]{background-color:hsl(var(--accent))}.data-\\[state\\=unchecked\\]\\:bg-input[data-state=unchecked]{background-color:hsl(var(--input))}.data-\\[disabled\\]\\:opacity-50[data-disabled]{opacity:.5}.data-\\[state\\=open\\]\\:animate-in[data-state=open]{--tw-enter-opacity:initial;--tw-enter-scale:initial;--tw-enter-rotate:initial;--tw-enter-translate-x:initial;--tw-enter-translate-y:initial;animation-duration:.15s;animation-name:enter}.data-\\[state\\=closed\\]\\:animate-out[data-state=closed]{--tw-exit-opacity:initial;--tw-exit-scale:initial;--tw-exit-rotate:initial;--tw-exit-translate-x:initial;--tw-exit-translate-y:initial;animation-duration:.15s;animation-name:exit}.data-\\[state\\=closed\\]\\:fade-out-0[data-state=closed]{--tw-exit-opacity:0}.data-\\[state\\=open\\]\\:fade-in-0[data-state=open]{--tw-enter-opacity:0}.data-\\[state\\=closed\\]\\:zoom-out-95[data-state=closed]{--tw-exit-scale:.95}.data-\\[state\\=open\\]\\:zoom-in-95[data-state=open]{--tw-enter-scale:.95}.data-\\[side\\=bottom\\]\\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y:-0.5rem}.data-\\[side\\=left\\]\\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x:0.5rem}.data-\\[side\\=right\\]\\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x:-0.5rem}.data-\\[side\\=top\\]\\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y:0.5rem}:is([data-mode=dark] .dark\\:border-white){--tw-border-opacity:1;border-color:rgb(255 255 255/var(--tw-border-opacity))}@media (min-width:640px){.sm\\:ml-3{margin-left:.75rem}.sm\\:block{display:block}.sm\\:h-5{height:1.25rem}.sm\\:h-9{height:2.25rem}.sm\\:h-\\[52px\\]{height:52px}.sm\\:w-5{width:1.25rem}.sm\\:w-9{width:2.25rem}.sm\\:gap-3{gap:.75rem}.sm\\:text-base{font-size:1rem;line-height:1.5rem}.sm\\:placeholder\\:text-base::-moz-placeholder{font-size:1rem;line-height:1.5rem}.sm\\:placeholder\\:text-base::placeholder{font-size:1rem;line-height:1.5rem}}.\\[\\&\\>svg\\]\\:shrink-0>svg{flex-shrink:0}.\\[\\&_svg\\]\\:pointer-events-none svg{pointer-events:none}.\\[\\&_svg\\]\\:shrink-0 svg{flex-shrink:0}'),"function"==typeof SuppressedError&&SuppressedError;var N=f.forwardRef(((e,t)=>{const{children:r,...o}=e,n=f.Children.toArray(r),i=n.find(z);if(i){const e=i.props.children,r=n.map((t=>t===i?f.Children.count(e)>1?f.Children.only(null):f.isValidElement(e)?e.props.children:null:t));return a.jsx(C,{...o,ref:t,children:f.isValidElement(e)?f.cloneElement(e,void 0,r):null})}return a.jsx(C,{...o,ref:t,children:r})}));N.displayName="Slot";var C=f.forwardRef(((e,t)=>{const{children:r,...a}=e;if(f.isValidElement(r)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;if(r)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r)return e.props.ref;return e.props.ref||e.ref}(r);return f.cloneElement(r,{...S(a,r.props),ref:t?E(t,e):e})}return f.Children.count(r)>1?f.Children.only(null):null}));C.displayName="SlotClone";var j=({children:e})=>a.jsx(a.Fragment,{children:e});function z(e){return f.isValidElement(e)&&e.type===j}function S(e,t){const r={...t};for(const a in t){const o=e[a],n=t[a];/^on[A-Z]/.test(a)?o&&n?r[a]=(...e)=>{n(...e),o(...e)}:o&&(r[a]=o):"style"===a?r[a]={...o,...n}:"className"===a&&(r[a]=[o,n].filter(Boolean).join(" "))}return{...e,...r}}function O(...e){return i.twMerge(n.clsx(e))}const I=o.cva("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),L=f.forwardRef(((e,t)=>{var{className:r,variant:a,size:o,asChild:n=!1}=e,i=y(e,["className","variant","size","asChild"]);const s=n?N:"button";return f.createElement(s,Object.assign({className:O(I({variant:a,size:o,className:r})),ref:t},i))}));L.displayName="Button";const R=b.Root,T=b.Trigger;f.forwardRef(((e,t)=>{var{className:r,inset:a,children:o}=e,n=y(e,["className","inset","children"]);return f.createElement(b.SubTrigger,Object.assign({ref:t,className:O("flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",a&&"pl-8",r)},n),o,f.createElement(l.ChevronRightIcon,{className:"ml-auto"}))})).displayName=b.SubTrigger.displayName;f.forwardRef(((e,t)=>{var{className:r}=e,a=y(e,["className"]);return f.createElement(b.SubContent,Object.assign({ref:t,className:O("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r)},a))})).displayName=b.SubContent.displayName;const A=f.forwardRef(((e,t)=>{var{className:r,sideOffset:a=4}=e,o=y(e,["className","sideOffset"]);return f.createElement(b.Portal,null,f.createElement(b.Content,Object.assign({ref:t,sideOffset:a,className:O("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r)},o)))}));A.displayName=b.Content.displayName;const $=f.forwardRef(((e,t)=>{var{className:r,inset:a}=e,o=y(e,["className","inset"]);return f.createElement(b.Item,Object.assign({ref:t,className:O("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",a&&"pl-8",r)},o))}));$.displayName=b.Item.displayName;f.forwardRef(((e,t)=>{var{className:r,children:a,checked:o}=e,n=y(e,["className","children","checked"]);return f.createElement(b.CheckboxItem,Object.assign({ref:t,className:O("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",r),checked:o},n),f.createElement("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center"},f.createElement(b.ItemIndicator,null,f.createElement(l.CheckIcon,{className:"h-4 w-4"}))),a)})).displayName=b.CheckboxItem.displayName;f.forwardRef(((e,t)=>{var{className:r,children:a}=e,o=y(e,["className","children"]);return f.createElement(b.RadioItem,Object.assign({ref:t,className:O("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",r)},o),f.createElement("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center"},f.createElement(b.ItemIndicator,null,f.createElement(l.DotFilledIcon,{className:"h-2 w-2 fill-current"}))),a)})).displayName=b.RadioItem.displayName;f.forwardRef(((e,t)=>{var{className:r,inset:a}=e,o=y(e,["className","inset"]);return f.createElement(b.Label,Object.assign({ref:t,className:O("px-2 py-1.5 text-sm font-semibold",a&&"pl-8",r)},o))})).displayName=b.Label.displayName;function q({suggestions:t,onQuestionClick:r,borderColor:a,title:o="Suggested questions"}){return t&&0!==t.length?e.createElement("div",{className:"w-full"},e.createElement("h3",{className:"text-base font-medium mb-4 text-gray-900"},o),e.createElement("div",{className:"flex flex-wrap gap-2"},t.map((t=>e.createElement("button",{key:t.id,onClick:()=>r(t),className:"px-4 py-2 rounded-lg border border-gray-300 text-gray-700 hover:bg-gray-50 transition-colors duration-200 text-sm",style:{borderColor:a}},t.question))))):null}f.forwardRef(((e,t)=>{var{className:r}=e,a=y(e,["className"]);return f.createElement(b.Separator,Object.assign({ref:t,className:O("-mx-1 my-1 h-px bg-muted",r)},a))})).displayName=b.Separator.displayName;var F="generating-star-module_animate-spin__AJjwz";v(".generating-star-module_animate-spin__AJjwz{animation:generating-star-module_rotate__ChndJ 2s linear infinite;transform-box:fill-box;transform-origin:center}@keyframes generating-star-module_rotate__ChndJ{to{transform:rotate(1turn)}}");const _=({loading:t,color:r="#000"})=>e.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",className:"mt-[-5px] inline-block"},e.createElement("path",{className:t?F:"",d:"M7.54672 16.0031L2.66234 14.2031C2.51881 14.1498 2.39502 14.0539 2.3076 13.9282C2.22019 13.8025 2.17333 13.6531 2.17333 13.5C2.17333 13.3469 2.22019 13.1975 2.3076 13.0718C2.39502 12.9461 2.51881 12.8501 2.66234 12.7969L7.54672 10.9969C7.64981 10.9589 7.74344 10.899 7.82113 10.8213C7.89882 10.7436 7.95873 10.65 7.99672 10.5469L9.79672 5.66249C9.84999 5.51896 9.94592 5.39517 10.0716 5.30775C10.1973 5.22033 10.3467 5.17348 10.4998 5.17348C10.6529 5.17348 10.8024 5.22033 10.9281 5.30775C11.0538 5.39517 11.1497 5.51896 11.203 5.66249L13.003 10.5469C13.041 10.65 13.1009 10.7436 13.1786 10.8213C13.2562 10.899 13.3499 10.9589 13.453 10.9969L18.3373 12.7969C18.4809 12.8501 18.6047 12.9461 18.6921 13.0718C18.7795 13.1975 18.8264 13.3469 18.8264 13.5C18.8264 13.6531 18.7795 13.8025 18.6921 13.9282C18.6047 14.0539 18.4809 14.1498 18.3373 14.2031L13.453 16.0031C13.3499 16.0411 13.2562 16.101 13.1786 16.1787C13.1009 16.2564 13.041 16.35 13.003 16.4531L11.203 21.3375C11.1497 21.481 11.0538 21.6048 10.9281 21.6922C10.8024 21.7796 10.6529 21.8265 10.4998 21.8265C10.3467 21.8265 10.1973 21.7796 10.0716 21.6922C9.94592 21.6048 9.84999 21.481 9.79672 21.3375L7.99672 16.4531C7.95873 16.35 7.89882 16.2564 7.82113 16.1787C7.74344 16.101 7.64981 16.0411 7.54672 16.0031Z",stroke:r,strokeWidth:"1.5",strokeLinecap:"round",fill:t?r:"none",strokeLinejoin:"round"}),e.createElement("path",{d:"M18.7497 3.75L14.2497 3.75",stroke:r,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e.createElement("path",{d:"M16.4999 6V1.5",stroke:r,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e.createElement("path",{d:"M22.4999 8.25001H19.4999",stroke:r,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e.createElement("path",{d:"M20.9998 9.75002V6.75002",stroke:r,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}));function U({theme:t,loadingText:r="Analyzing..."}){return e.createElement("div",{className:"w-full space-y-6 rounded-xl p-6",style:{backgroundColor:t.cardBackground,borderColor:t.border,borderWidth:"1px",borderStyle:"solid"}},e.createElement("div",{className:"flex items-center gap-2"},e.createElement(_,{loading:!0,color:t.primary}),e.createElement("div",{className:"text-sm",style:{color:t.text}},r)),e.createElement("div",{className:"space-y-4 animate-pulse"},Array.from({length:4}).map(((r,a)=>e.createElement("div",{key:a,className:"h-4 rounded w-full",style:{backgroundColor:`${t.border}40`}}))),e.createElement("div",{className:"h-4 rounded w-3/4",style:{backgroundColor:`${t.border}40`}})),e.createElement("div",{className:"rounded-lg p-4",style:{backgroundColor:`${t.accent}50`}},e.createElement("div",{className:"flex items-center justify-between"},e.createElement("div",{className:"h-4 rounded w-48",style:{backgroundColor:`${t.border}80`}}),e.createElement("div",{className:"flex gap-2"},e.createElement("div",{className:"w-8 h-8 rounded-full",style:{backgroundColor:`${t.border}80`}}),e.createElement("div",{className:"w-8 h-8 rounded-full",style:{backgroundColor:`${t.border}80`}})))))}const P={javascript:".js",python:".py",java:".java",c:".c",cpp:".cpp","c++":".cpp","c#":".cs",ruby:".rb",php:".php",swift:".swift","objective-c":".m",kotlin:".kt",typescript:".ts",go:".go",perl:".pl",rust:".rs",scala:".scala",haskell:".hs",lua:".lua",shell:".sh",sql:".sql",html:".html",css:".css"},B=m.Prism,Q=e.memo((({language:r,value:a})=>{const[o,n]=e.useState(!1);return e.createElement("div",{className:"relative font-sans text-sm mt-1"},e.createElement("div",{className:"relative rounded-t-lg bg-zinc-800/80 font-sans text-sm backdrop-blur"},e.createElement("div",{className:"flex h-8 items-center justify-between px-3"},e.createElement("span",{className:"text-xs font-medium text-zinc-400"},r),e.createElement("div",{className:"flex gap-1"},e.createElement(L,{variant:"ghost",size:"icon",className:"size-5 text-zinc-400 hover:bg-zinc-700/50 hover:text-zinc-100",onClick:()=>{x(void 0,void 0,void 0,(function*(){if(navigator.clipboard&&navigator.clipboard.writeText)try{yield navigator.clipboard.writeText(a),n(!0),setTimeout((()=>{n(!1)}),2e3)}catch(e){console.error("Failed to copy:",e)}}))}},o?e.createElement(t.CheckCircle,{size:18}):e.createElement(t.Clipboard,{size:18})),e.createElement(L,{variant:"ghost",size:"icon",className:"size-5 text-zinc-400 hover:bg-zinc-700/50 hover:text-zinc-100",onClick:()=>{const e=P[r]||".file",t=`file-${((e,t=!1)=>{const r="ABCDEFGHJKLMNPQRSTUVWXY3456789";let a="";for(let t=0;t<e;t+=1)a+=r.charAt(Math.floor(30*Math.random()));return t?a.toLowerCase():a})(3,!0)}${e}`,o=new Blob([a],{type:"text/plain"}),n=URL.createObjectURL(o),i=document.createElement("a");i.download=t,i.href=n,i.style.display="none",document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(n)}},e.createElement(t.Download,{size:18}))))),e.createElement("div",{className:"rounded-b-lg"},e.createElement(B,{language:r,style:p.a11yDark,PreTag:"div",wrapLongLines:!0,customStyle:{margin:0,borderTopLeftRadius:0,borderTopRightRadius:0}},a)))}));Q.displayName="CodeBlock";const M=f.forwardRef((({src:e,border:t,width:r="100%",height:a="400px",title:o},n)=>{const[i,s]=f.useState(!1);return f.useEffect((()=>{let e=!0;return setTimeout((()=>{e&&s(!0)}),0),()=>{e=!1}}),[]),f.createElement("div",{className:"overflow-hidden rounded-lg mt-4 "+(t?"border":""),style:{width:r,height:a}},i&&f.createElement(f.Fragment,null,f.createElement("iframe",{ref:n,src:e,sandbox:"allow-same-origin allow-scripts allow-popups allow-forms allow-downloads",width:r,height:a,frameBorder:"0",title:"embed",loading:"lazy",allowFullScreen:!0,className:"block rounded-lg"}),o&&f.createElement("span",{className:"block text-center text-sm font-medium"},o)))}));function D(e){const t=e.attrs.href.replace("share","embed");return f.createElement(M,Object.assign({},e,{src:t,title:"Loom Embed"}))}function W(e){return f.createElement(M,Object.assign({},e,{src:e.attrs.href,title:"Supademo Embed"}))}function Z(e){return f.createElement(M,Object.assign({},e,{src:e.attrs.href,title:"Typeform Embed"}))}function H(e){const t=e.attrs.href.match(/(http|https)?:\/\/(www\.)?vimeo\.com\/(?:channels\/(?:\w+\/)?|groups\/([^/]*)\/videos\/|)(\d+)(?:\/|\?)?([\d\w]+)?/);if(!t)return null;const r=t[4],a=t[5],o=`https://player.vimeo.com/video/${r}?byline=0${a?`&h=${a}`:""}`;return f.createElement(M,Object.assign({},e,{src:o,title:`Vimeo Embed (${r})`,height:"412px",border:!1}))}function Y(e){const t=(e=>{const t=[/^https?:\/\/([a-zA-Z0-9-_~]+)\.wistia\.com\/medias\/([a-zA-Z0-9-_~]+)\/?$/,/^https?:\/\/fast\.wistia\.com\/embed\/iframe\/([a-zA-Z0-9-_~]+)\/?$/,/^fast\.wistia\.com\/embed\/iframe\/([a-zA-Z0-9-_~]+)\/?$/,/^([a-zA-Z0-9-_~]+)\.wistia\.com\/medias\/([a-zA-Z0-9-_~]+)\/?$/];for(const r of t){const t=e.match(r);if(t)return t}return null})(e.attrs.href);if(!t)return null;const r=t[1],a=t[2]||t[1],o=r?`https://${r}.wistia.com/embed/iframe/${a}?seo=true&videoFoam=false`:`https://fast.wistia.com/embed/iframe/${a}`;return f.createElement(M,Object.assign({},e,{src:o,border:!0,title:`Wistia Embed (${a})`}))}function V(e){const t=(e=>{const t=e.match(/(?:https?:\/\/)?(?:www\.)?youtu\.?be(?:\.com)?\/?.*(?:watch|embed)?(?:.*v=|v\/|\/)([a-zA-Z0-9_-]{11})$/i);return t?t[1]:null})(e.attrs.href);return t?f.createElement(M,Object.assign({},e,{src:`https://www.youtube.com/embed/${t}?modestbranding=1`,title:`YouTube Embed (${t})`})):null}D.isMatch=e=>/^https:\/\/(www\.)?(use)?loom\.com\/(embed|share)\/(.*)$/.test(e),W.isMatch=e=>/^https:\/\/app\.supademo\.com\/embed\/(.*)$/.test(e),Z.isMatch=e=>/^https:\/\/([A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?)\.typeform\.com\/to\/(.*)$/.test(e),H.isMatch=e=>/^(https?):\/\/(www\.)?vimeo\.com\/(?:channels\/(?:\w+\/)?|groups\/([^/]*)\/videos\/|)?(\d+)(\/)?(?:\?.*|#.*)?$/i.test(e),Y.isMatch=e=>[/^https?:\/\/([a-zA-Z0-9-_~]+)\.wistia\.com\/medias\/([a-zA-Z0-9-_~]+)(\/)?(\?.*)?$/i,/^https?:\/\/fast\.wistia\.com\/embed\/iframe\/([a-zA-Z0-9-_~]+)(\/)?(\?.*)?$/i,/^fast\.wistia\.com\/embed\/iframe\/([a-zA-Z0-9-_~]+)(\/)?(\?.*)?$/i,/^([a-zA-Z0-9-_~]+)\.wistia\.com\/medias\/([a-zA-Z0-9-_~]+)(\/)?(\?.*)?$/i].some((t=>t.test(e))),V.isMatch=e=>/^(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/(?:watch\?v=|embed\/|v\/|shorts\/)|youtu\.be\/)([a-zA-Z0-9_-]{11})(?:\/|[?&].*)?$/i.test(e);const X=[D,W,Z,V,Y,H],J=t=>{const{href:r}=t.attrs,[a,o]=e.useState(null);if(e.useEffect((()=>{let e=!0;return(()=>{try{const a=X.find((e=>e.isMatch(r)));a&&e&&o({Component:a,props:t})}catch(e){console.error("Error finding embed match:",e)}})(),()=>{e=!1}}),[r,t]),a){const{Component:e,props:t}=a;return f.createElement(e,Object.assign({},t))}return null},K=e.memo(u,((e,t)=>e.children===t.children)),G=e.memo((({message:t})=>(t.content=t.content.replace(/^\n+|(\n+|\\)+$/g,""),e.createElement(K,{className:"dark:prose-invert prose flex-1",remarkPlugins:[d],rehypePlugins:[c],components:{code(t){var{inline:r,className:a,children:o}=t,n=y(t,["inline","className","children"]);const i=/language-(\w+)/.exec(a||""),s=i&&i[1];return!r&&s?e.createElement(Q,Object.assign({key:Math.random(),language:s,value:String(o).replace(/\n$/,"")},n)):e.createElement("code",Object.assign({className:`text-red-400 bg-slate-200 border-slate-300 border rounded p-0.5 ${a}`.trim()},n),o)},marker:({children:t})=>e.createElement("div",{className:"my-2"},e.createElement("span",{className:"highlight"},t)),table:({children:t})=>e.createElement("table",{className:"border-collapse border border-black px-3 py-1 dark:border-white"},t),th:({children:t})=>e.createElement("th",{className:"break-words border border-black bg-gray-500 px-3 py-1 text-white dark:border-white"},t),td:({children:t})=>e.createElement("td",{className:"break-words border border-black px-3 py-1 dark:border-white"},t),a(t){var{children:r}=t,a=y(t,["children"]);if(a.href){const t=J({attrs:{href:a.href}});if(e.isValidElement(t))return t}return e.createElement("a",Object.assign({className:"link",target:"_blank",rel:"noopener noreferrer"},a),r)},pre:({children:t})=>e.createElement(e.Fragment,null,t),img({src:t,alt:r}){const a=J({attrs:{href:null!=t?t:""}});return e.isValidElement(a)?a:e.createElement("img",{src:t,alt:r,className:"w-full"})},li:t=>{var{children:r}=t,a=y(t,["children"]);return e.createElement("li",Object.assign({className:"py-1"},a),r)},ul:({children:t})=>e.createElement("ul",{className:"ml-4 list-outside list-disc"},t),ol:({children:t})=>e.createElement("ol",{className:"ml-4 list-outside list-decimal"},t),strong:t=>{var{children:r}=t,a=y(t,["children"]);return e.createElement("span",Object.assign({className:"font-semibold"},a),r)},h1:t=>{var{children:r}=t,a=y(t,["children"]);return e.createElement("h1",Object.assign({className:"mb-2 mt-6 text-3xl font-semibold"},a),r)},h2:t=>{var{children:r}=t,a=y(t,["children"]);return e.createElement("h2",Object.assign({className:"mb-2 mt-6 text-2xl font-semibold"},a),r)},h3:t=>{var{children:r}=t,a=y(t,["children"]);return e.createElement("h3",Object.assign({className:"mb-2 mt-6 text-xl font-semibold"},a),r)},h4:t=>{var{children:r}=t,a=y(t,["children"]);return e.createElement("h4",Object.assign({className:"mb-2 mt-6 text-lg font-semibold"},a),r)},h5:t=>{var{children:r}=t,a=y(t,["children"]);return e.createElement("h5",Object.assign({className:"mb-2 mt-6 text-base font-semibold"},a),r)},h6:t=>{var{children:r}=t,a=y(t,["children"]);return e.createElement("h6",Object.assign({className:"mb-2 mt-6 text-sm font-semibold"},a),r)}}},t.content)))),ee=w.Provider,te=w.Root,re=w.Trigger,ae=f.forwardRef(((e,t)=>{var{className:r,sideOffset:a=4}=e,o=y(e,["className","sideOffset"]);return f.createElement(w.Portal,null,f.createElement(w.Content,Object.assign({ref:t,sideOffset:a,className:O("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r)},o)))}));function oe({answer:r,question:a,theme:o,searchResults:n,followUpQuestions:i,onFollowUpClick:s,isStreaming:l=!1,searchQueryId:c,feedback:d,onFeedback:m,disableFeedback:p=!1,textConfig:u={}}){const[h,g]=e.useState(!1),[f,b]=e.useState(!1),w=()=>x(this,void 0,void 0,(function*(){try{yield navigator.clipboard.writeText(r),g(!0),setTimeout((()=>g(!1)),2e3)}catch(e){console.error("Failed to copy text:",e)}})),v=e=>{m&&c&&m(e)};return e.createElement("div",{className:"rounded-lg p-6",style:{backgroundColor:o.cardBackground,borderColor:o.border,borderWidth:"1px",borderStyle:"solid"}},e.createElement("div",{className:"flex items-start justify-between"},e.createElement("div",{className:"flex items-center gap-2 mb-4"},e.createElement(_,{loading:l,color:o.primary}),e.createElement("h2",{className:"text-xl",style:{color:o.text}},a)),e.createElement(ee,null,e.createElement(te,null,e.createElement(re,{asChild:!0},e.createElement("button",{onClick:()=>{w()},className:"flex items-center justify-center w-8 h-8 rounded-md hover:bg-gray-100 transition-colors duration-200"},h?e.createElement(t.Check,{className:"h-4 w-4 text-green-500"}):e.createElement(t.Copy,{className:"h-4 w-4 text-gray-500"}))),e.createElement(ae,null,e.createElement("p",null,h?"Copied!":"Copy"))))),r&&e.createElement("div",{className:"prose prose-sm max-w-none",style:{color:o.text}},e.createElement(G,{message:{content:r}})),r&&!l&&!p&&e.createElement("div",{className:"mt-2 flex justify-end gap-2"},e.createElement(ee,null,e.createElement(te,null,e.createElement(re,{asChild:!0},e.createElement(L,{variant:"ghost",size:"sm",className:"rounded-md h-8 w-8 flex items-center justify-center "+("accept"===d?"bg-green-100 text-green-600":""),onClick:()=>v("accept"),disabled:Boolean(d)},e.createElement(t.ThumbsUp,{className:"h-4 w-4"}))),e.createElement(ae,null,e.createElement("p",null,u.positiveAnswerText||"Helpful")))),e.createElement(ee,null,e.createElement(te,null,e.createElement(re,{asChild:!0},e.createElement(L,{variant:"ghost",size:"sm",className:"rounded-md h-8 w-8 flex items-center justify-center "+("reject"===d?"bg-red-100 text-red-600":""),onClick:()=>v("reject"),disabled:Boolean(d)},e.createElement(t.ThumbsDown,{className:"h-4 w-4"}))),e.createElement(ae,null,e.createElement("p",null,u.negativeAnswerText||"Not helpful"))))),r&&i&&i.length>0&&e.createElement("div",{className:"mt-6 space-y-3"},e.createElement("div",{className:"text-sm font-medium",style:{color:o.text}},"Follow-up Questions"),e.createElement("div",{className:"flex flex-wrap gap-2"},i.map(((t,r)=>e.createElement("button",{key:r,onClick:()=>null==s?void 0:s(t),className:"px-3 py-1.5 rounded-lg text-sm transition-all duration-200 hover:opacity-90",style:{backgroundColor:`${o.accent}30`,color:o.text,border:`1px solid ${o.border}`}},t))))),n&&n.length>0&&e.createElement("div",{className:"mt-6 rounded-lg overflow-hidden",style:{backgroundColor:o.surface,borderWidth:"1px",borderStyle:"solid",borderColor:o.border}},e.createElement("button",{onClick:()=>b(!f),className:"w-full flex items-center justify-between p-3 transition-all duration-200 hover:bg-opacity-50",style:{color:o.text,borderBottom:f?`1px solid ${o.surfaceBorder}`:"none"}},e.createElement("div",{className:"flex items-center gap-2"},e.createElement(t.FileText,{className:"h-4 w-4",style:{color:o.primary}}),e.createElement("span",{className:"font-medium"},"Related Articles (",n.length,")")),e.createElement(t.ChevronDown,{className:"h-4 w-4 transition-transform duration-200 "+(f?"rotate-180":""),style:{color:o.text}})),e.createElement("div",{className:"overflow-hidden transition-all duration-200 ease-in-out",style:{maxHeight:f?48*n.length+"px":"0",opacity:f?1:0,transform:`translateY(${f?"0":"-10px"})`}},e.createElement("div",{className:"divide-y divide-gray-200"},n.map((r=>e.createElement("a",{key:r.id,href:r.url,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 p-3 transition-colors duration-200 hover:bg-gray-50",style:{color:o.text,backgroundColor:o.surface}},e.createElement(t.FileText,{className:"h-4 w-4",style:{color:o.primary}}),e.createElement("span",{className:"flex-grow"},r.title),e.createElement(t.ExternalLink,{className:"h-4 w-4",style:{color:`${o.text}60`}}))))))),!r&&e.createElement("div",{className:"animate-pulse space-y-4"},e.createElement("div",{className:"h-4 rounded w-full",style:{backgroundColor:`${o.border}40`}}),e.createElement("div",{className:"h-4 rounded w-3/4",style:{backgroundColor:`${o.border}40`}})))}function ne({questions:t,currentIndex:a,activeIndex:o,onNavigate:n,theme:i,offset:s}){return e.createElement(r.motion.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{duration:.5},className:"fixed left-4 top-1/2 -translate-y-1/2 z-50 flex flex-col gap-2",style:Object.assign({},s?{left:`${s}px`}:{})},t.map(((t,r)=>e.createElement("div",{key:r,className:"relative group"},e.createElement("button",{onClick:()=>n(r),className:"flex items-center justify-center w-8 h-8 rounded-full transition-all duration-200 "+(r<=a?"hover:opacity-90":""),style:{backgroundColor:r===o?i.primary:"#ccc",color:r===o?i.background:"#333",opacity:r>a?.5:1,cursor:"pointer"}},r+1),e.createElement("div",{className:"absolute left-12 top-0 px-3 py-2 rounded-lg whitespace-normal opacity-0 group-hover:opacity-100 w-48 text-sm transition-opacity duration-200",style:{backgroundColor:i.background,color:i.text,borderColor:i.border,borderWidth:"1px",borderStyle:"solid",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1)"}},t,e.createElement("div",{className:"absolute left-0 top-3 -translate-x-1 w-2 h-2 rotate-45",style:{backgroundColor:i.background,borderLeft:`1px solid ${i.border}`,borderBottom:`1px solid ${i.border}`}}))))))}function ie({onClick:r,theme:a}){return e.createElement(L,{className:"fixed bottom-20 right-4 rounded-full p-2 transition-opacity duration-300",style:{backgroundColor:a.background,borderColor:a.border,borderWidth:"1px",borderStyle:"solid",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1)"},onClick:r},e.createElement(t.ArrowDown,{className:"h-5 w-5",style:{color:a.text}}))}function se({endpoint:e,query:t,collectionId:r,headers:a,conversationId:o}){var n;return x(this,void 0,void 0,(function*(){try{const i=yield fetch(e,{method:"POST",headers:Object.assign({"Content-Type":"application/json"},a),body:JSON.stringify(Object.assign(Object.assign({query:t,limit:5},r&&"all"!==r&&{collectionId:r}),o&&{conversationId:o}))});if(!i.ok)throw new Error("Failed to fetch search results");const s=yield i.json();return{results:null==s?void 0:s.data,searchQueryId:null===(n=null==s?void 0:s.searchQuery)||void 0===n?void 0:n.id}}catch(e){throw console.error("Error searching:",e),e}}))}function le({endpoint:e,searchQueryId:t,headers:r,conversationId:a}){return x(this,void 0,void 0,(function*(){try{const o=yield fetch(e,{method:"POST",headers:Object.assign({"Content-Type":"application/json"},r),body:JSON.stringify(Object.assign({searchQueryId:t},a&&{conversationId:a}))});if(!o.ok)throw new Error("Failed to fetch answer");return o}catch(e){throw console.error("Error fetching answer:",e),e}}))}function ce(){return`bf-conversation-${Date.now()}-${"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(e=>{const t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))}`}function de({endpoint:e,conversationId:t,headers:r}){return x(this,void 0,void 0,(function*(){try{const a=yield fetch(e,{method:"POST",headers:Object.assign({"Content-Type":"application/json"},r),body:JSON.stringify({conversationId:t})});if(!a.ok)throw new Error("Failed to load conversation");const o=yield a.json();return{data:o.data.map((e=>Object.assign(Object.assign({},e),{feedback:e.feedback?"positive"===e.feedback?"accept":"reject":void 0})))}}catch(e){throw console.error("Error loading conversation:",e),e}}))}ae.displayName=w.Content.displayName;const me={primary:"#A3E635",accent:"#f9fafb",background:"white",text:"#171717",border:"#171717",hover:"#171717",surface:"#F9FAFB",surfaceBorder:"#E5E7EB",surfaceHover:"#F3F4F6",cardBackground:"white"},pe={headerText:"How can we help you today?",searchPlaceholder:"Ask a question or type a search term here ...",attachImageText:"Attach image",allDocumentsText:"All documents",loadingSearchText:"Searching for relevant content...",loadingAnswerText:"Crafting a response...",errorText:"Sorry, there was an error generating the answer.",followUpPlaceholder:"Ask follow-up",positiveAnswerText:"Helpful",negativeAnswerText:"Not helpful"},ue=e.forwardRef((({suggestions:a,theme:o={},collections:n=[],selectedCollectionId:i,onCollectionChange:s,searchEndpoint:l,answerEndpoint:c,feedbackEndpoint:d,loadConversationEndpoint:m,disableFollowUpQuestions:p=!1,disableImageAttachment:u=!1,disableFeedback:h=!1,siblingNode:g,offset:f=0,headers:b,textConfig:w={}},v)=>{var y;const k=Object.assign(Object.assign({},me),o),E=Object.assign(Object.assign({},pe),w),[N,C]=e.useState(""),[j,z]=e.useState(""),[S,O]=e.useState(!1),[I,F]=e.useState(!1),[_,P]=e.useState([]),[B,Q]=e.useState(!1),[M,D]=e.useState(0),[W,Z]=e.useState([]),[H,Y]=e.useState(i),[V,X]=e.useState(!0),[J,K]=e.useState(""),[G,ee]=e.useState(!1),[te,re]=e.useState(),ae=e.useRef(null),ue=e.useRef(null),he=e.useRef([]),ge=e.useRef(null),fe=e.useRef(null),be=e.useRef([]);e.useEffect((()=>{const e=new URLSearchParams(window.location.search).get("conversation");if(e&&m)ee(!0),F(!0),de({endpoint:m,conversationId:e,headers:b}).then((t=>{P(t.data),K(e),F(!0)})).catch((e=>{console.error("Error loading conversation:",e),re(E.errorText||"An error occurred"),F(!1),P([]);const t=ce();K(t);const r=new URL(window.location.href);r.searchParams.delete("conversation"),window.history.replaceState({},"",r.toString())})).finally((()=>{ee(!1)}));else{const e=ce();K(e)}}),[m]),e.useEffect((()=>{if(J&&_.length>0){const e=new URL(window.location.href);e.searchParams.set("conversation",J),window.history.replaceState({},"",e.toString())}}),[J,_.length]),e.useEffect((()=>{const e={showResults:I,answers:_,isLoading:G,error:te};be.current.forEach((t=>t(e)))}),[I,_,G,te]),e.useImperativeHandle(v,(()=>({createNewThread:()=>{C(""),z(""),F(!1),P([]),D(0),Z([]);const e=ce();K(e);const t=new URL(window.location.href);t.searchParams.delete("conversation"),window.history.replaceState({},"",t.toString()),ae.current&&(ae.current.style.height="auto")},showFollowUpThread:e=>{X(e)},subscribeToStateChanges:e=>(be.current.push(e),e({showResults:I,answers:_,isLoading:!1,error:void 0}),()=>{be.current=be.current.filter((t=>t!==e))})}))),e.useEffect((()=>{Y(i)}),[i]);const we=e=>{e.style.height="auto",e.style.height=`${e.scrollHeight}px`},ve=()=>{requestAnimationFrame((()=>{const e=he.current[he.current.length-1],t=ge.current;if(e&&t){const r=t.getBoundingClientRect(),a=e.getBoundingClientRect().top-r.top-80;t.scrollBy({top:a,behavior:"smooth"})}}))},ye=e=>x(void 0,void 0,void 0,(function*(){var t;const r=null===(t=e.body)||void 0===t?void 0:t.getReader();if(!r)return;P((e=>{const t=[...e],r=t[t.length-1];return r&&(r.isLoading=!1,r.isStreaming=!0),t}));let a="";try{let e,t;for(;({done:e,value:t}=yield r.read()),!e;){const e=(new TextDecoder).decode(t);a+=e,P((e=>{const t=[...e],r=t[t.length-1];return r&&(r.answer=a),t}))}}finally{P((e=>{const t=[...e],r=t[t.length-1];return r&&(r.isStreaming=!1),t})),r.releaseLock()}})),xe=(e,t,r)=>x(void 0,void 0,void 0,(function*(){if(d)try{yield function({endpoint:e,searchQueryId:t,response:r,headers:a,conversationId:o}){return x(this,void 0,void 0,(function*(){try{if(!(yield fetch(e,{method:"POST",headers:Object.assign({"Content-Type":"application/json"},a),body:JSON.stringify(Object.assign({searchQueryId:t,response:r},o&&{conversationId:o}))})).ok)throw new Error("Failed to send feedback")}catch(e){throw console.error("Error sending feedback:",e),e}}))}({endpoint:d,searchQueryId:t,response:e,headers:b,conversationId:J}),P((t=>{const a=[...t];return a[r]&&(a[r]=Object.assign(Object.assign({},a[r]),{feedback:e})),a}))}catch(e){console.error("Error sending feedback:",e)}})),ke=()=>x(void 0,void 0,void 0,(function*(){if(N.trim()){if(O(!0),F(!0),!J){const e=ce();K(e)}P((e=>{const t=[...e,{question:N,answer:"",isLoading:!0,isSearchLoading:!0}];return D(t.length-1),t})),ve();try{const e=yield se({endpoint:l,query:N,collectionId:H,headers:b,conversationId:J}),t=e.results,r=e.searchQueryId;P((e=>{const a=[...e];return a[a.length-1]=Object.assign(Object.assign({},a[a.length-1]),{searchResults:t,searchQueryId:r,isSearchLoading:!1}),a}));const a=yield le({endpoint:c,searchQueryId:r,headers:b,conversationId:J});yield ye(a)}catch(e){console.error("Error generating answer:",e),P((e=>{const t=[...e];return t[t.length-1]=Object.assign(Object.assign({},t[t.length-1]),{answer:E.errorText||"An error occurred",isLoading:!1,isSearchLoading:!1}),t}))}finally{O(!1)}}})),Ee=()=>x(void 0,void 0,void 0,(function*(){if(j.trim()){const e=j;C(e),z(""),O(!0),P((t=>{const r=[...t,{question:e,answer:"",isLoading:!0,isSearchLoading:!0}];return D(r.length-1),r})),ve();try{const t=yield se({endpoint:l,query:e,collectionId:H,headers:b,conversationId:J}),r=t.results,a=t.searchQueryId;P((e=>{const t=[...e];return t[t.length-1]=Object.assign(Object.assign({},t[t.length-1]),{searchResults:r,searchQueryId:a,isSearchLoading:!1}),t}));const o=yield le({endpoint:c,searchQueryId:a,headers:b,conversationId:J});yield ye(o)}catch(e){console.error("Error generating answer:",e),P((e=>{const t=[...e];return t[t.length-1]=Object.assign(Object.assign({},t[t.length-1]),{answer:E.errorText||"An error occurred",isLoading:!1,isSearchLoading:!1}),t}))}finally{O(!1)}}}));e.useEffect((()=>{const e=ge.current;if(!e)return;const t=()=>{const{scrollTop:t,scrollHeight:r,clientHeight:a}=e;Q(!(r-t-a<100))};return e.addEventListener("scroll",t),()=>e.removeEventListener("scroll",t)}),[]),e.useEffect((()=>()=>{W.forEach((e=>URL.revokeObjectURL(e.preview)))}),[W]);return e.useEffect((()=>{if(I)return document.body.style.overflow="hidden",()=>{document.body.style.overflow="unset"}}),[I]),e.createElement("div",{className:"relative min-h-screen overflow-hidden"},e.createElement("div",{ref:ge,className:"w-full max-w-3xl mx-auto flex flex-col items-center space-y-8 px-4 py-20 h-screen overflow-y-auto relative elegant-scrollbar",style:{height:"100vh",maxHeight:"100vh",overflowY:"auto",WebkitOverflowScrolling:"touch","--surface-border":k.surfaceBorder,"--surface-hover":k.surfaceHover}},e.createElement(r.AnimatePresence,null,G?e.createElement(r.motion.div,{key:"loading",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"w-full flex items-center justify-center py-20"},e.createElement("div",{className:"flex flex-col items-center gap-4"},e.createElement("div",{className:"animate-spin rounded-full h-8 w-8 border-2 border-t-transparent",style:{borderColor:k.primary}}),e.createElement("p",{className:"text-sm",style:{color:k.text}},"Loading conversation..."))):I?e.createElement(r.motion.div,{key:"results",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.5},className:"w-full space-y-8 py-4 mb-20"},_.map(((t,a)=>e.createElement(r.motion.div,{key:a,ref:e=>he.current[a]=e,initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5,delay:.1*a}},t.isLoading?e.createElement(U,{theme:k,loadingText:t.isSearchLoading?E.loadingSearchText:E.loadingAnswerText}):e.createElement(oe,{answer:t.answer,question:t.question,theme:k,searchResults:t.searchResults,followUpQuestions:p?void 0:t.followUpQuestions,onFollowUpClick:p?void 0:e=>{z(e),Ee()},isStreaming:t.isStreaming,searchQueryId:t.searchQueryId,feedback:t.feedback,onFeedback:h||!d?void 0:e=>xe(e,t.searchQueryId,a),disableFeedback:h||!d,textConfig:E}))))):e.createElement(r.motion.div,{key:"search",initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},transition:{duration:.5},className:"w-full space-y-8"},e.createElement("div",{className:"w-full text-center space-y-4"},e.createElement(r.motion.h1,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5,delay:.3},className:"text-5xl font-bold",style:{color:k.text}},E.headerText)),e.createElement(r.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5,delay:.4}},e.createElement("div",{className:"relative w-full rounded-md overflow-hidden",style:{backgroundColor:k.background,borderColor:k.border,borderWidth:"1px",borderStyle:"solid"}},e.createElement("div",{className:"p-3 flex items-center"},e.createElement(t.Search,{className:"h-5 w-5 text-gray-400 mr-2"}),e.createElement("textarea",{ref:ae,placeholder:E.searchPlaceholder,value:N,onChange:e=>{C(e.target.value),we(e.target)},onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),ke())},className:"w-full resize-none outline-none text-lg py-1 font-light min-h-[36px] overflow-hidden placeholder:text-gray-400 border-none bg-transparent",style:{color:k.text,outline:"none",boxShadow:"none",fontSize:"16px"},rows:1})),!u&&W.length>0&&e.createElement("div",{className:"flex gap-2 mt-3 overflow-x-auto pb-1 px-3"},W.map(((r,a)=>e.createElement("div",{key:a,className:"relative group rounded-lg overflow-hidden flex-shrink-0",style:{width:"80px",height:"80px"}},e.createElement("img",{src:r.preview,alt:`Attached ${a+1}`,className:"w-full h-full object-cover"}),e.createElement("button",{onClick:()=>(e=>{Z((t=>(URL.revokeObjectURL(t[e].preview),t.filter(((t,r)=>r!==e)))))})(a),className:"absolute top-1 right-1 bg-black bg-opacity-50 rounded-full p-1 opacity-0 group-hover:opacity-100 transition-opacity duration-200"},e.createElement(t.X,{className:"h-3 w-3 text-white"})))))),e.createElement("div",{className:"flex items-center justify-between px-3 py-2 bg-gray-100 border-t border-gray-200"},e.createElement("div",{className:"flex gap-2"},n.length>0&&e.createElement(R,null,e.createElement(T,{asChild:!0},e.createElement(L,{variant:"ghost",size:"sm",className:"hover:bg-gray-200 transition-all duration-200 rounded-md h-8 flex items-center gap-2 text-gray-700"},H&&"all"!==H?e.createElement(t.CheckCircle2,{className:"h-5 w-5 text-green-500"}):e.createElement(t.Circle,{className:"h-5 w-5 text-gray-400"}),(null===(y=n.find((e=>e.id===H)))||void 0===y?void 0:y.name)||E.allDocumentsText,e.createElement(t.ChevronDown,{className:"h-4 w-4 opacity-50"}))),e.createElement(A,null,n.map((r=>e.createElement($,{key:r.id,onClick:()=>{return e=r.id,Y(e),void(null==s||s(e));var e},className:r.id===H?"bg-gray-100":""},r.id===H?e.createElement(t.CheckCircle2,{className:"h-4 w-4 mr-2 text-green-500"}):e.createElement(t.Circle,{className:"h-4 w-4 mr-2 text-gray-400"}),r.name))))),!u&&e.createElement(e.Fragment,null,e.createElement("input",{type:"file",ref:fe,accept:"image/*",multiple:!0,className:"hidden",onChange:e=>{const t=e.target.files;if(t){const e=Array.from(t).map((e=>({file:e,preview:URL.createObjectURL(e)})));Z((t=>[...t,...e]))}fe.current&&(fe.current.value="")}}),e.createElement(L,{variant:"ghost",size:"sm",className:"hover:bg-gray-200 rounded-md h-8 text-gray-700",onClick:()=>{var e;return null===(e=fe.current)||void 0===e?void 0:e.click()}},e.createElement(t.Image,{className:"h-4 w-4 mr-1.5"}),E.attachImageText))),e.createElement("div",{className:"flex items-center"},e.createElement(L,{size:"sm",disabled:!N||S,className:"rounded-md h-8 w-8 bg-[#86efac] hover:bg-[#86efac]/90 disabled:opacity-50",onClick:()=>{ke()}},S?e.createElement("div",{className:"animate-spin rounded-full h-4 w-4 border-2 border-t-transparent",style:{borderColor:"white"}}):e.createElement(t.ArrowRight,{className:"h-4 w-4 text-gray-700"})))))),e.createElement(q,{suggestions:a||[],onQuestionClick:e=>{if(e.conversationId&&m)return ee(!0),F(!0),void de({endpoint:m,conversationId:e.conversationId,headers:b}).then((t=>{P(t.data),K(e.conversationId),F(!0)})).catch((e=>{console.error("Error loading conversation:",e),re(E.errorText||"An error occurred"),F(!1),P([]);const t=ce();K(t);const r=new URL(window.location.href);r.searchParams.delete("conversation"),window.history.replaceState({},"",r.toString())})).finally((()=>{ee(!1)}));if(F(!0),O(!0),!J){const e=ce();K(e)}P((t=>[...t,{question:e.question,answer:"",isLoading:!0,isSearchLoading:!0}])),x(void 0,void 0,void 0,(function*(){try{const t=yield se({endpoint:l,query:e.question,collectionId:H,headers:b,conversationId:J}),r=t.results;P((e=>{const a=[...e];return a[a.length-1]=Object.assign(Object.assign({},a[a.length-1]),{searchResults:r,searchQueryId:t.searchQueryId,isSearchLoading:!1}),a}));const a=yield le({endpoint:c,searchQueryId:t.searchQueryId,headers:b,conversationId:J});yield ye(a)}catch(e){console.error("Error generating answer:",e),P((e=>{const t=[...e];return t[t.length-1]=Object.assign(Object.assign({},t[t.length-1]),{answer:E.errorText||"An error occurred",isLoading:!1,isSearchLoading:!1}),t}))}finally{O(!1),ve()}}))},borderColor:k.border,title:E.suggestionsTitle}),g)),I&&_.length>1&&e.createElement("div",{className:"hidden sm:block"},e.createElement(ne,{questions:_.map((e=>e.question)),currentIndex:S?_.length-1:M,activeIndex:M,onNavigate:e=>{D(e),(e=>{requestAnimationFrame((()=>{const t=he.current[e],r=ge.current;if(t&&r){const e=r.getBoundingClientRect(),a=t.getBoundingClientRect().top-e.top-80;r.scrollBy({top:a,behavior:"smooth"})}}))})(e)},theme:k,offset:f})),I&&V&&e.createElement(r.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5},className:"fixed bottom-4 left-4 right-4 max-w-3xl mx-auto z-10",style:{left:`${f}px`}},e.createElement("div",{className:"rounded-full h-[44px] sm:h-[52px] flex items-center justify-between",style:{backgroundColor:k.background,borderColor:k.border,borderWidth:"1px",borderStyle:"solid",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1)",padding:"0 14px"}},e.createElement("div",{className:"flex items-center gap-2 sm:gap-3 flex-grow overflow-hidden h-full"},e.createElement(t.Search,{className:"h-4 w-4 sm:h-5 sm:w-5 flex-shrink-0",style:{color:k.primary}}),e.createElement("textarea",{ref:ue,placeholder:E.followUpPlaceholder,value:j,onChange:e=>{z(e.target.value),we(e.target)},onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),Ee())},disabled:S,className:"w-full bg-transparent outline-none text-sm sm:text-base resize-none overflow-hidden disabled:opacity-50 border-none h-full py-3 placeholder:text-sm sm:placeholder:text-base",style:{color:k.text,outline:"none",boxShadow:"none",fontSize:"16px"},rows:1})),e.createElement("div",{className:"flex items-center gap-2 sm:gap-3 ml-2 sm:ml-3 flex-shrink-0"},e.createElement(L,{size:"icon",variant:"ghost",disabled:S||!j.trim(),className:"rounded-full transition-colors duration-200 disabled:opacity-50 h-8 w-8 sm:h-9 sm:w-9 flex items-center justify-center",style:{color:k.text,backgroundColor:"transparent"},onClick:()=>{Ee()}},S?e.createElement("div",{className:"animate-spin rounded-full h-4 w-4 sm:h-5 sm:w-5 border-2",style:{borderColor:`${k.text}40`,borderTopColor:k.text}}):e.createElement(t.ArrowUp,{className:"h-4 w-4 sm:h-5 sm:w-5"}))))),B&&I&&e.createElement(ie,{onClick:ve,theme:k})))}));ue.displayName="ChatSearch",exports.ChatSearch=ue;
1
+ "use strict";var e=require("react"),t=require("lucide-react"),r=require("framer-motion"),a=require("react/jsx-runtime"),o=require("class-variance-authority"),n=require("clsx"),i=require("tailwind-merge"),s=require("@radix-ui/react-dropdown-menu"),l=require("@radix-ui/react-icons"),c=require("@radix-ui/react-tooltip"),d=require("rehype-raw"),m=require("remark-gfm"),p=require("react-syntax-highlighter"),u=require("react-syntax-highlighter/dist/cjs/styles/prism"),h=require("react-markdown");function g(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var a=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,a.get?a:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var f=g(e),b=g(s),w=g(c);function y(e,t){void 0===t&&(t={});var r=t.insertAt;if(e&&"undefined"!=typeof document){var a=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===r&&a.firstChild?a.insertBefore(o,a.firstChild):a.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}function v(e,t){var r={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(r[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(a=Object.getOwnPropertySymbols(e);o<a.length;o++)t.indexOf(a[o])<0&&Object.prototype.propertyIsEnumerable.call(e,a[o])&&(r[a[o]]=e[a[o]])}return r}function x(e,t,r,a){return new(r||(r=Promise))((function(o,n){function i(e){try{l(a.next(e))}catch(e){n(e)}}function s(e){try{l(a.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,s)}l((a=a.apply(e,t||[])).next())}))}function k(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function E(...e){return t=>{let r=!1;const a=e.map((e=>{const a=k(e,t);return r||"function"!=typeof a||(r=!0),a}));if(r)return()=>{for(let t=0;t<a.length;t++){const r=a[t];"function"==typeof r?r():k(e[t],null)}}}}y('/*! tailwindcss v3.3.5 | MIT License | https://tailwindcss.com*/*,:after,:before{border:0 solid #e5e7eb;box-sizing:border-box}:after,:before{--tw-content:""}html{-webkit-text-size-adjust:100%;font-feature-settings:normal;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{color:#9ca3af;opacity:1}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]{display:none}:root{--background:0 0% 100%;--foreground:0 0% 3.9%;--card:0 0% 100%;--card-foreground:0 0% 3.9%;--popover:0 0% 100%;--popover-foreground:0 0% 3.9%;--primary:0 0% 9%;--primary-foreground:0 0% 98%;--secondary:0 0% 96.1%;--secondary-foreground:0 0% 9%;--muted:0 0% 96.1%;--muted-foreground:0 0% 45.1%;--accent:0 0% 96.1%;--accent-foreground:0 0% 9%;--destructive:0 84.2% 60.2%;--destructive-foreground:0 0% 98%;--border:0 0% 89.8%;--input:0 0% 89.8%;--ring:0 0% 3.9%;--radius:0.5rem}.dark{--background:0 0% 3.9%;--foreground:0 0% 98%;--card:0 0% 3.9%;--card-foreground:0 0% 98%;--popover:0 0% 3.9%;--popover-foreground:0 0% 98%;--primary:0 0% 98%;--primary-foreground:0 0% 9%;--secondary:0 0% 14.9%;--secondary-foreground:0 0% 98%;--muted:0 0% 14.9%;--muted-foreground:0 0% 63.9%;--accent:0 0% 14.9%;--accent-foreground:0 0% 98%;--destructive:0 62.8% 30.6%;--destructive-foreground:0 0% 98%;--border:0 0% 14.9%;--input:0 0% 14.9%;--ring:0 0% 83.1%}*{border-color:hsl(var(--border))}body{background-color:hsl(var(--background));color:hsl(var(--foreground))}*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.\\!container{margin-left:auto!important;margin-right:auto!important;padding-left:2rem!important;padding-right:2rem!important;width:100%!important}.container{margin-left:auto;margin-right:auto;padding-left:2rem;padding-right:2rem;width:100%}@media (min-width:1400px){.\\!container{max-width:1400px!important}.container{max-width:1400px}}.pointer-events-none{pointer-events:none}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.bottom-20{bottom:5rem}.bottom-4{bottom:1rem}.left-0{left:0}.left-12{left:3rem}.left-2{left:.5rem}.left-4{left:1rem}.right-1{right:.25rem}.right-4{right:1rem}.top-0{top:0}.top-1{top:.25rem}.top-1\\/2{top:50%}.top-3{top:.75rem}.z-10{z-index:10}.z-50{z-index:50}.-mx-1{margin-left:-.25rem;margin-right:-.25rem}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-bottom:.25rem;margin-top:.25rem}.my-2{margin-top:.5rem}.mb-2,.my-2{margin-bottom:.5rem}.mb-20{margin-bottom:5rem}.mb-4{margin-bottom:1rem}.ml-2{margin-left:.5rem}.ml-4{margin-left:1rem}.ml-auto{margin-left:auto}.mr-1{margin-right:.25rem}.mr-1\\.5{margin-right:.375rem}.mr-2{margin-right:.5rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.mt-\\[-5px\\]{margin-top:-5px}.block{display:block}.inline-block{display:inline-block}.\\!inline{display:inline!important}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.hidden{display:none}.h-10{height:2.5rem}.h-2{height:.5rem}.h-3{height:.75rem}.h-3\\.5{height:.875rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-\\[44px\\]{height:44px}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.min-h-\\[36px\\]{min-height:36px}.min-h-screen{min-height:100vh}.w-2{width:.5rem}.w-3{width:.75rem}.w-3\\.5{width:.875rem}.w-3\\/4{width:75%}.w-4{width:1rem}.w-48{width:12rem}.w-5{width:1.25rem}.w-8{width:2rem}.w-9{width:2.25rem}.w-full{width:100%}.min-w-\\[20px\\]{min-width:20px}.min-w-\\[8rem\\]{min-width:8rem}.max-w-3xl{max-width:48rem}.max-w-none{max-width:none}.flex-1{flex:1 1 0%}.flex-shrink-0,.shrink-0{flex-shrink:0}.flex-grow{flex-grow:1}.border-collapse{border-collapse:collapse}.-translate-x-1{--tw-translate-x:-0.25rem}.-translate-x-1,.-translate-y-1\\/2{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\\/2{--tw-translate-y:-50%}.rotate-180{--tw-rotate:180deg}.rotate-180,.rotate-45{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-45{--tw-rotate:45deg}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(1turn)}}.animate-spin{animation:spin 1s linear infinite}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize-none{resize:none}.list-outside{list-style-position:outside}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-4{gap:1rem}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(.75rem*var(--tw-space-y-reverse));margin-top:calc(.75rem*(1 - var(--tw-space-y-reverse)))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(1rem*var(--tw-space-y-reverse));margin-top:calc(1rem*(1 - var(--tw-space-y-reverse)))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(1.5rem*var(--tw-space-y-reverse));margin-top:calc(1.5rem*(1 - var(--tw-space-y-reverse)))}.space-y-8>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(2rem*var(--tw-space-y-reverse));margin-top:calc(2rem*(1 - var(--tw-space-y-reverse)))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse:0;border-bottom-width:calc(1px*var(--tw-divide-y-reverse));border-top-width:calc(1px*(1 - var(--tw-divide-y-reverse)))}.divide-gray-200>:not([hidden])~:not([hidden]){--tw-divide-opacity:1;border-color:rgb(229 231 235/var(--tw-divide-opacity))}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.whitespace-normal{white-space:normal}.whitespace-nowrap{white-space:nowrap}.break-words{overflow-wrap:break-word}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:.75rem}.rounded-b-lg{border-bottom-left-radius:var(--radius);border-bottom-right-radius:var(--radius)}.rounded-t-lg{border-top-left-radius:var(--radius);border-top-right-radius:var(--radius)}.border{border-width:1px}.border-2{border-width:2px}.border-t{border-top-width:1px}.border-none{border-style:none}.border-black{--tw-border-opacity:1;border-color:rgb(0 0 0/var(--tw-border-opacity))}.border-gray-200{--tw-border-opacity:1;border-color:rgb(229 231 235/var(--tw-border-opacity))}.border-gray-300{--tw-border-opacity:1;border-color:rgb(209 213 219/var(--tw-border-opacity))}.border-input{border-color:hsl(var(--input))}.border-slate-300{--tw-border-opacity:1;border-color:rgb(203 213 225/var(--tw-border-opacity))}.border-transparent{border-color:transparent}.border-t-transparent{border-top-color:transparent}.bg-\\[\\#86efac\\]{--tw-bg-opacity:1;background-color:rgb(134 239 172/var(--tw-bg-opacity))}.bg-background{background-color:hsl(var(--background))}.bg-black{--tw-bg-opacity:1;background-color:rgb(0 0 0/var(--tw-bg-opacity))}.bg-destructive{background-color:hsl(var(--destructive))}.bg-gray-100{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity))}.bg-gray-500{--tw-bg-opacity:1;background-color:rgb(107 114 128/var(--tw-bg-opacity))}.bg-green-100{--tw-bg-opacity:1;background-color:rgb(220 252 231/var(--tw-bg-opacity))}.bg-muted{background-color:hsl(var(--muted))}.bg-popover{background-color:hsl(var(--popover))}.bg-primary{background-color:hsl(var(--primary))}.bg-red-100{--tw-bg-opacity:1;background-color:rgb(254 226 226/var(--tw-bg-opacity))}.bg-secondary{background-color:hsl(var(--secondary))}.bg-slate-200{--tw-bg-opacity:1;background-color:rgb(226 232 240/var(--tw-bg-opacity))}.bg-transparent{background-color:transparent}.bg-zinc-800\\/80{background-color:rgba(39,39,42,.8)}.bg-opacity-50{--tw-bg-opacity:0.5}.fill-current{fill:currentColor}.object-cover{-o-object-fit:cover;object-fit:cover}.p-0{padding:0}.p-0\\.5{padding:.125rem}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0{padding-bottom:0;padding-top:0}.py-0\\.5{padding-bottom:.125rem;padding-top:.125rem}.py-1{padding-bottom:.25rem;padding-top:.25rem}.py-1\\.5{padding-bottom:.375rem;padding-top:.375rem}.py-2{padding-bottom:.5rem;padding-top:.5rem}.py-20{padding-bottom:5rem;padding-top:5rem}.py-3{padding-bottom:.75rem;padding-top:.75rem}.py-4{padding-bottom:1rem;padding-top:1rem}.pb-1{padding-bottom:.25rem}.pl-8{padding-left:2rem}.pr-2{padding-right:.5rem}.text-center{text-align:center}.font-sans{font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-5xl{font-size:3rem;line-height:1}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-light{font-weight:300}.font-medium{font-weight:500}.font-semibold{font-weight:600}.lowercase{text-transform:lowercase}.italic{font-style:italic}.tracking-widest{letter-spacing:.1em}.text-destructive-foreground{color:hsl(var(--destructive-foreground))}.text-gray-400{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity))}.text-gray-500{--tw-text-opacity:1;color:rgb(107 114 128/var(--tw-text-opacity))}.text-gray-600{--tw-text-opacity:1;color:rgb(75 85 99/var(--tw-text-opacity))}.text-gray-700{--tw-text-opacity:1;color:rgb(55 65 81/var(--tw-text-opacity))}.text-gray-900{--tw-text-opacity:1;color:rgb(17 24 39/var(--tw-text-opacity))}.text-green-500{--tw-text-opacity:1;color:rgb(34 197 94/var(--tw-text-opacity))}.text-green-600{--tw-text-opacity:1;color:rgb(22 163 74/var(--tw-text-opacity))}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-red-400{--tw-text-opacity:1;color:rgb(248 113 113/var(--tw-text-opacity))}.text-red-600{--tw-text-opacity:1;color:rgb(220 38 38/var(--tw-text-opacity))}.text-secondary-foreground{color:hsl(var(--secondary-foreground))}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.text-zinc-400{--tw-text-opacity:1;color:rgb(161 161 170/var(--tw-text-opacity))}.underline-offset-4{text-underline-offset:4px}.opacity-0{opacity:0}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color)}.shadow,.shadow-lg{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color)}.shadow-md{--tw-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color)}.shadow-md,.shadow-sm{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-0{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur{--tw-backdrop-blur:blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-colors{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-opacity{transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-transform{transition-duration:.15s;transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}@keyframes enter{0%{opacity:var(--tw-enter-opacity,1);transform:translate3d(var(--tw-enter-translate-x,0),var(--tw-enter-translate-y,0),0) scale3d(var(--tw-enter-scale,1),var(--tw-enter-scale,1),var(--tw-enter-scale,1)) rotate(var(--tw-enter-rotate,0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity,1);transform:translate3d(var(--tw-exit-translate-x,0),var(--tw-exit-translate-y,0),0) scale3d(var(--tw-exit-scale,1),var(--tw-exit-scale,1),var(--tw-exit-scale,1)) rotate(var(--tw-exit-rotate,0))}}.animate-in{--tw-enter-opacity:initial;--tw-enter-scale:initial;--tw-enter-rotate:initial;--tw-enter-translate-x:initial;--tw-enter-translate-y:initial;animation-duration:.15s;animation-name:enter}.fade-in-0{--tw-enter-opacity:0}.zoom-in-95{--tw-enter-scale:.95}.duration-200{animation-duration:.2s}.duration-300{animation-duration:.3s}.ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)}.placeholder\\:text-sm::-moz-placeholder{font-size:.875rem;line-height:1.25rem}.placeholder\\:text-sm::placeholder{font-size:.875rem;line-height:1.25rem}.placeholder\\:text-gray-400::-moz-placeholder{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity))}.placeholder\\:text-gray-400::placeholder{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity))}.hover\\:bg-\\[\\#86efac\\]\\/90:hover{background-color:rgba(134,239,172,.9)}.hover\\:bg-accent:hover{background-color:hsl(var(--accent))}.hover\\:bg-destructive\\/90:hover{background-color:hsl(var(--destructive)/.9)}.hover\\:bg-gray-100:hover{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity))}.hover\\:bg-gray-200:hover{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity))}.hover\\:bg-gray-50:hover{--tw-bg-opacity:1;background-color:rgb(249 250 251/var(--tw-bg-opacity))}.hover\\:bg-primary\\/90:hover{background-color:hsl(var(--primary)/.9)}.hover\\:bg-secondary\\/80:hover{background-color:hsl(var(--secondary)/.8)}.hover\\:bg-zinc-700\\/50:hover{background-color:rgba(63,63,70,.5)}.hover\\:bg-opacity-50:hover{--tw-bg-opacity:0.5}.hover\\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\\:text-zinc-100:hover{--tw-text-opacity:1;color:rgb(244 244 245/var(--tw-text-opacity))}.hover\\:underline:hover{text-decoration-line:underline}.hover\\:opacity-90:hover{opacity:.9}.focus\\:bg-accent:focus{background-color:hsl(var(--accent))}.focus\\:text-accent-foreground:focus{color:hsl(var(--accent-foreground))}.focus-visible\\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\\:ring-1:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus-visible\\:ring-2:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus-visible\\:ring-ring:focus-visible{--tw-ring-color:hsl(var(--ring))}.focus-visible\\:ring-offset-2:focus-visible{--tw-ring-offset-width:2px}.focus-visible\\:ring-offset-background:focus-visible{--tw-ring-offset-color:hsl(var(--background))}.disabled\\:pointer-events-none:disabled{pointer-events:none}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:opacity-50:disabled{opacity:.5}.group:hover .group-hover\\:opacity-100{opacity:1}.data-\\[disabled\\]\\:pointer-events-none[data-disabled]{pointer-events:none}.data-\\[state\\=checked\\]\\:translate-x-4[data-state=checked]{--tw-translate-x:1rem}.data-\\[state\\=checked\\]\\:translate-x-4[data-state=checked],.data-\\[state\\=unchecked\\]\\:translate-x-0[data-state=unchecked]{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[state\\=unchecked\\]\\:translate-x-0[data-state=unchecked]{--tw-translate-x:0px}.data-\\[state\\=checked\\]\\:bg-primary[data-state=checked]{background-color:hsl(var(--primary))}.data-\\[state\\=open\\]\\:bg-accent[data-state=open]{background-color:hsl(var(--accent))}.data-\\[state\\=unchecked\\]\\:bg-input[data-state=unchecked]{background-color:hsl(var(--input))}.data-\\[disabled\\]\\:opacity-50[data-disabled]{opacity:.5}.data-\\[state\\=open\\]\\:animate-in[data-state=open]{--tw-enter-opacity:initial;--tw-enter-scale:initial;--tw-enter-rotate:initial;--tw-enter-translate-x:initial;--tw-enter-translate-y:initial;animation-duration:.15s;animation-name:enter}.data-\\[state\\=closed\\]\\:animate-out[data-state=closed]{--tw-exit-opacity:initial;--tw-exit-scale:initial;--tw-exit-rotate:initial;--tw-exit-translate-x:initial;--tw-exit-translate-y:initial;animation-duration:.15s;animation-name:exit}.data-\\[state\\=closed\\]\\:fade-out-0[data-state=closed]{--tw-exit-opacity:0}.data-\\[state\\=open\\]\\:fade-in-0[data-state=open]{--tw-enter-opacity:0}.data-\\[state\\=closed\\]\\:zoom-out-95[data-state=closed]{--tw-exit-scale:.95}.data-\\[state\\=open\\]\\:zoom-in-95[data-state=open]{--tw-enter-scale:.95}.data-\\[side\\=bottom\\]\\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y:-0.5rem}.data-\\[side\\=left\\]\\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x:0.5rem}.data-\\[side\\=right\\]\\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x:-0.5rem}.data-\\[side\\=top\\]\\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y:0.5rem}:is([data-mode=dark] .dark\\:border-white){--tw-border-opacity:1;border-color:rgb(255 255 255/var(--tw-border-opacity))}@media (min-width:640px){.sm\\:ml-3{margin-left:.75rem}.sm\\:block{display:block}.sm\\:h-5{height:1.25rem}.sm\\:h-9{height:2.25rem}.sm\\:h-\\[52px\\]{height:52px}.sm\\:w-5{width:1.25rem}.sm\\:w-9{width:2.25rem}.sm\\:gap-3{gap:.75rem}.sm\\:text-base{font-size:1rem;line-height:1.5rem}.sm\\:placeholder\\:text-base::-moz-placeholder{font-size:1rem;line-height:1.5rem}.sm\\:placeholder\\:text-base::placeholder{font-size:1rem;line-height:1.5rem}}.\\[\\&\\>svg\\]\\:shrink-0>svg{flex-shrink:0}.\\[\\&_svg\\]\\:pointer-events-none svg{pointer-events:none}.\\[\\&_svg\\]\\:shrink-0 svg{flex-shrink:0}'),"function"==typeof SuppressedError&&SuppressedError;var N=f.forwardRef(((e,t)=>{const{children:r,...o}=e,n=f.Children.toArray(r),i=n.find(z);if(i){const e=i.props.children,r=n.map((t=>t===i?f.Children.count(e)>1?f.Children.only(null):f.isValidElement(e)?e.props.children:null:t));return a.jsx(C,{...o,ref:t,children:f.isValidElement(e)?f.cloneElement(e,void 0,r):null})}return a.jsx(C,{...o,ref:t,children:r})}));N.displayName="Slot";var C=f.forwardRef(((e,t)=>{const{children:r,...a}=e;if(f.isValidElement(r)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;if(r)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r)return e.props.ref;return e.props.ref||e.ref}(r);return f.cloneElement(r,{...S(a,r.props),ref:t?E(t,e):e})}return f.Children.count(r)>1?f.Children.only(null):null}));C.displayName="SlotClone";var j=({children:e})=>a.jsx(a.Fragment,{children:e});function z(e){return f.isValidElement(e)&&e.type===j}function S(e,t){const r={...t};for(const a in t){const o=e[a],n=t[a];/^on[A-Z]/.test(a)?o&&n?r[a]=(...e)=>{n(...e),o(...e)}:o&&(r[a]=o):"style"===a?r[a]={...o,...n}:"className"===a&&(r[a]=[o,n].filter(Boolean).join(" "))}return{...e,...r}}function O(...e){return i.twMerge(n.clsx(e))}const I=o.cva("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),L=f.forwardRef(((e,t)=>{var{className:r,variant:a,size:o,asChild:n=!1}=e,i=v(e,["className","variant","size","asChild"]);const s=n?N:"button";return f.createElement(s,Object.assign({className:O(I({variant:a,size:o,className:r})),ref:t},i))}));L.displayName="Button";const R=b.Root,T=b.Trigger;f.forwardRef(((e,t)=>{var{className:r,inset:a,children:o}=e,n=v(e,["className","inset","children"]);return f.createElement(b.SubTrigger,Object.assign({ref:t,className:O("flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",a&&"pl-8",r)},n),o,f.createElement(l.ChevronRightIcon,{className:"ml-auto"}))})).displayName=b.SubTrigger.displayName;f.forwardRef(((e,t)=>{var{className:r}=e,a=v(e,["className"]);return f.createElement(b.SubContent,Object.assign({ref:t,className:O("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r)},a))})).displayName=b.SubContent.displayName;const A=f.forwardRef(((e,t)=>{var{className:r,sideOffset:a=4}=e,o=v(e,["className","sideOffset"]);return f.createElement(b.Portal,null,f.createElement(b.Content,Object.assign({ref:t,sideOffset:a,className:O("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r)},o)))}));A.displayName=b.Content.displayName;const $=f.forwardRef(((e,t)=>{var{className:r,inset:a}=e,o=v(e,["className","inset"]);return f.createElement(b.Item,Object.assign({ref:t,className:O("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",a&&"pl-8",r)},o))}));$.displayName=b.Item.displayName;f.forwardRef(((e,t)=>{var{className:r,children:a,checked:o}=e,n=v(e,["className","children","checked"]);return f.createElement(b.CheckboxItem,Object.assign({ref:t,className:O("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",r),checked:o},n),f.createElement("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center"},f.createElement(b.ItemIndicator,null,f.createElement(l.CheckIcon,{className:"h-4 w-4"}))),a)})).displayName=b.CheckboxItem.displayName;f.forwardRef(((e,t)=>{var{className:r,children:a}=e,o=v(e,["className","children"]);return f.createElement(b.RadioItem,Object.assign({ref:t,className:O("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",r)},o),f.createElement("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center"},f.createElement(b.ItemIndicator,null,f.createElement(l.DotFilledIcon,{className:"h-2 w-2 fill-current"}))),a)})).displayName=b.RadioItem.displayName;f.forwardRef(((e,t)=>{var{className:r,inset:a}=e,o=v(e,["className","inset"]);return f.createElement(b.Label,Object.assign({ref:t,className:O("px-2 py-1.5 text-sm font-semibold",a&&"pl-8",r)},o))})).displayName=b.Label.displayName;f.forwardRef(((e,t)=>{var{className:r}=e,a=v(e,["className"]);return f.createElement(b.Separator,Object.assign({ref:t,className:O("-mx-1 my-1 h-px bg-muted",r)},a))})).displayName=b.Separator.displayName;const q=w.Provider,F=w.Root,_=w.Trigger,U=f.forwardRef(((e,t)=>{var{className:r,sideOffset:a=4}=e,o=v(e,["className","sideOffset"]);return f.createElement(w.Portal,null,f.createElement(w.Content,Object.assign({ref:t,sideOffset:a,className:O("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r)},o)))}));function P({suggestions:t,onQuestionClick:r,borderColor:a,title:o="Suggested questions"}){return t&&0!==t.length?e.createElement("div",{className:"w-full"},e.createElement("h3",{className:"text-base font-medium mb-4 text-gray-900"},o),e.createElement("div",{className:"flex flex-wrap gap-2"},t.map((t=>e.createElement("button",{key:t.id,onClick:()=>r(t),className:"px-4 py-2 rounded-lg border border-gray-300 text-gray-700 hover:bg-gray-50 transition-colors duration-200 text-sm flex items-center gap-2",style:{borderColor:a}},void 0!==t.messageCount&&e.createElement(q,null,e.createElement(F,null,e.createElement(_,{asChild:!0},e.createElement("span",{className:"bg-gray-100 text-gray-600 px-2 py-0.5 rounded-full text-xs min-w-[20px] border flex items-center justify-center",style:{borderColor:a}},t.messageCount)),e.createElement(U,null,e.createElement("p",null,t.messageCount," messages in this conversation")))),e.createElement("span",null,t.question)))))):null}U.displayName=w.Content.displayName;var B="generating-star-module_animate-spin__AJjwz";y(".generating-star-module_animate-spin__AJjwz{animation:generating-star-module_rotate__ChndJ 2s linear infinite;transform-box:fill-box;transform-origin:center}@keyframes generating-star-module_rotate__ChndJ{to{transform:rotate(1turn)}}");const Q=({loading:t,color:r="#000"})=>e.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",className:"mt-[-5px] inline-block"},e.createElement("path",{className:t?B:"",d:"M7.54672 16.0031L2.66234 14.2031C2.51881 14.1498 2.39502 14.0539 2.3076 13.9282C2.22019 13.8025 2.17333 13.6531 2.17333 13.5C2.17333 13.3469 2.22019 13.1975 2.3076 13.0718C2.39502 12.9461 2.51881 12.8501 2.66234 12.7969L7.54672 10.9969C7.64981 10.9589 7.74344 10.899 7.82113 10.8213C7.89882 10.7436 7.95873 10.65 7.99672 10.5469L9.79672 5.66249C9.84999 5.51896 9.94592 5.39517 10.0716 5.30775C10.1973 5.22033 10.3467 5.17348 10.4998 5.17348C10.6529 5.17348 10.8024 5.22033 10.9281 5.30775C11.0538 5.39517 11.1497 5.51896 11.203 5.66249L13.003 10.5469C13.041 10.65 13.1009 10.7436 13.1786 10.8213C13.2562 10.899 13.3499 10.9589 13.453 10.9969L18.3373 12.7969C18.4809 12.8501 18.6047 12.9461 18.6921 13.0718C18.7795 13.1975 18.8264 13.3469 18.8264 13.5C18.8264 13.6531 18.7795 13.8025 18.6921 13.9282C18.6047 14.0539 18.4809 14.1498 18.3373 14.2031L13.453 16.0031C13.3499 16.0411 13.2562 16.101 13.1786 16.1787C13.1009 16.2564 13.041 16.35 13.003 16.4531L11.203 21.3375C11.1497 21.481 11.0538 21.6048 10.9281 21.6922C10.8024 21.7796 10.6529 21.8265 10.4998 21.8265C10.3467 21.8265 10.1973 21.7796 10.0716 21.6922C9.94592 21.6048 9.84999 21.481 9.79672 21.3375L7.99672 16.4531C7.95873 16.35 7.89882 16.2564 7.82113 16.1787C7.74344 16.101 7.64981 16.0411 7.54672 16.0031Z",stroke:r,strokeWidth:"1.5",strokeLinecap:"round",fill:t?r:"none",strokeLinejoin:"round"}),e.createElement("path",{d:"M18.7497 3.75L14.2497 3.75",stroke:r,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e.createElement("path",{d:"M16.4999 6V1.5",stroke:r,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e.createElement("path",{d:"M22.4999 8.25001H19.4999",stroke:r,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e.createElement("path",{d:"M20.9998 9.75002V6.75002",stroke:r,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}));function M({theme:t,loadingText:r="Analyzing..."}){return e.createElement("div",{className:"w-full space-y-6 rounded-xl p-6",style:{backgroundColor:t.cardBackground,borderColor:t.border,borderWidth:"1px",borderStyle:"solid"}},e.createElement("div",{className:"flex items-center gap-2"},e.createElement(Q,{loading:!0,color:t.primary}),e.createElement("div",{className:"text-sm",style:{color:t.text}},r)),e.createElement("div",{className:"space-y-4 animate-pulse"},Array.from({length:4}).map(((r,a)=>e.createElement("div",{key:a,className:"h-4 rounded w-full",style:{backgroundColor:`${t.border}40`}}))),e.createElement("div",{className:"h-4 rounded w-3/4",style:{backgroundColor:`${t.border}40`}})),e.createElement("div",{className:"rounded-lg p-4",style:{backgroundColor:`${t.accent}50`}},e.createElement("div",{className:"flex items-center justify-between"},e.createElement("div",{className:"h-4 rounded w-48",style:{backgroundColor:`${t.border}80`}}),e.createElement("div",{className:"flex gap-2"},e.createElement("div",{className:"w-8 h-8 rounded-full",style:{backgroundColor:`${t.border}80`}}),e.createElement("div",{className:"w-8 h-8 rounded-full",style:{backgroundColor:`${t.border}80`}})))))}const D={javascript:".js",python:".py",java:".java",c:".c",cpp:".cpp","c++":".cpp","c#":".cs",ruby:".rb",php:".php",swift:".swift","objective-c":".m",kotlin:".kt",typescript:".ts",go:".go",perl:".pl",rust:".rs",scala:".scala",haskell:".hs",lua:".lua",shell:".sh",sql:".sql",html:".html",css:".css"},W=p.Prism,Z=e.memo((({language:r,value:a})=>{const[o,n]=e.useState(!1);return e.createElement("div",{className:"relative font-sans text-sm mt-1"},e.createElement("div",{className:"relative rounded-t-lg bg-zinc-800/80 font-sans text-sm backdrop-blur"},e.createElement("div",{className:"flex h-8 items-center justify-between px-3"},e.createElement("span",{className:"text-xs font-medium text-zinc-400"},r),e.createElement("div",{className:"flex gap-1"},e.createElement(L,{variant:"ghost",size:"icon",className:"size-5 text-zinc-400 hover:bg-zinc-700/50 hover:text-zinc-100",onClick:()=>{x(void 0,void 0,void 0,(function*(){if(navigator.clipboard&&navigator.clipboard.writeText)try{yield navigator.clipboard.writeText(a),n(!0),setTimeout((()=>{n(!1)}),2e3)}catch(e){console.error("Failed to copy:",e)}}))}},o?e.createElement(t.CheckCircle,{size:18}):e.createElement(t.Clipboard,{size:18})),e.createElement(L,{variant:"ghost",size:"icon",className:"size-5 text-zinc-400 hover:bg-zinc-700/50 hover:text-zinc-100",onClick:()=>{const e=D[r]||".file",t=`file-${((e,t=!1)=>{const r="ABCDEFGHJKLMNPQRSTUVWXY3456789";let a="";for(let t=0;t<e;t+=1)a+=r.charAt(Math.floor(30*Math.random()));return t?a.toLowerCase():a})(3,!0)}${e}`,o=new Blob([a],{type:"text/plain"}),n=URL.createObjectURL(o),i=document.createElement("a");i.download=t,i.href=n,i.style.display="none",document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(n)}},e.createElement(t.Download,{size:18}))))),e.createElement("div",{className:"rounded-b-lg"},e.createElement(W,{language:r,style:u.a11yDark,PreTag:"div",wrapLongLines:!0,customStyle:{margin:0,borderTopLeftRadius:0,borderTopRightRadius:0}},a)))}));Z.displayName="CodeBlock";const H=f.forwardRef((({src:e,border:t,width:r="100%",height:a="400px",title:o},n)=>{const[i,s]=f.useState(!1);return f.useEffect((()=>{let e=!0;return setTimeout((()=>{e&&s(!0)}),0),()=>{e=!1}}),[]),f.createElement("div",{className:"overflow-hidden rounded-lg mt-4 "+(t?"border":""),style:{width:r,height:a}},i&&f.createElement(f.Fragment,null,f.createElement("iframe",{ref:n,src:e,sandbox:"allow-same-origin allow-scripts allow-popups allow-forms allow-downloads",width:r,height:a,frameBorder:"0",title:"embed",loading:"lazy",allowFullScreen:!0,className:"block rounded-lg"}),o&&f.createElement("span",{className:"block text-center text-sm font-medium"},o)))}));function Y(e){const t=e.attrs.href.replace("share","embed");return f.createElement(H,Object.assign({},e,{src:t,title:"Loom Embed"}))}function V(e){return f.createElement(H,Object.assign({},e,{src:e.attrs.href,title:"Supademo Embed"}))}function X(e){return f.createElement(H,Object.assign({},e,{src:e.attrs.href,title:"Typeform Embed"}))}function J(e){const t=e.attrs.href.match(/(http|https)?:\/\/(www\.)?vimeo\.com\/(?:channels\/(?:\w+\/)?|groups\/([^/]*)\/videos\/|)(\d+)(?:\/|\?)?([\d\w]+)?/);if(!t)return null;const r=t[4],a=t[5],o=`https://player.vimeo.com/video/${r}?byline=0${a?`&h=${a}`:""}`;return f.createElement(H,Object.assign({},e,{src:o,title:`Vimeo Embed (${r})`,height:"412px",border:!1}))}function K(e){const t=(e=>{const t=[/^https?:\/\/([a-zA-Z0-9-_~]+)\.wistia\.com\/medias\/([a-zA-Z0-9-_~]+)\/?$/,/^https?:\/\/fast\.wistia\.com\/embed\/iframe\/([a-zA-Z0-9-_~]+)\/?$/,/^fast\.wistia\.com\/embed\/iframe\/([a-zA-Z0-9-_~]+)\/?$/,/^([a-zA-Z0-9-_~]+)\.wistia\.com\/medias\/([a-zA-Z0-9-_~]+)\/?$/];for(const r of t){const t=e.match(r);if(t)return t}return null})(e.attrs.href);if(!t)return null;const r=t[1],a=t[2]||t[1],o=r?`https://${r}.wistia.com/embed/iframe/${a}?seo=true&videoFoam=false`:`https://fast.wistia.com/embed/iframe/${a}`;return f.createElement(H,Object.assign({},e,{src:o,border:!0,title:`Wistia Embed (${a})`}))}function G(e){const t=(e=>{const t=e.match(/(?:https?:\/\/)?(?:www\.)?youtu\.?be(?:\.com)?\/?.*(?:watch|embed)?(?:.*v=|v\/|\/)([a-zA-Z0-9_-]{11})$/i);return t?t[1]:null})(e.attrs.href);return t?f.createElement(H,Object.assign({},e,{src:`https://www.youtube.com/embed/${t}?modestbranding=1`,title:`YouTube Embed (${t})`})):null}Y.isMatch=e=>/^https:\/\/(www\.)?(use)?loom\.com\/(embed|share)\/(.*)$/.test(e),V.isMatch=e=>/^https:\/\/app\.supademo\.com\/embed\/(.*)$/.test(e),X.isMatch=e=>/^https:\/\/([A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?)\.typeform\.com\/to\/(.*)$/.test(e),J.isMatch=e=>/^(https?):\/\/(www\.)?vimeo\.com\/(?:channels\/(?:\w+\/)?|groups\/([^/]*)\/videos\/|)?(\d+)(\/)?(?:\?.*|#.*)?$/i.test(e),K.isMatch=e=>[/^https?:\/\/([a-zA-Z0-9-_~]+)\.wistia\.com\/medias\/([a-zA-Z0-9-_~]+)(\/)?(\?.*)?$/i,/^https?:\/\/fast\.wistia\.com\/embed\/iframe\/([a-zA-Z0-9-_~]+)(\/)?(\?.*)?$/i,/^fast\.wistia\.com\/embed\/iframe\/([a-zA-Z0-9-_~]+)(\/)?(\?.*)?$/i,/^([a-zA-Z0-9-_~]+)\.wistia\.com\/medias\/([a-zA-Z0-9-_~]+)(\/)?(\?.*)?$/i].some((t=>t.test(e))),G.isMatch=e=>/^(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/(?:watch\?v=|embed\/|v\/|shorts\/)|youtu\.be\/)([a-zA-Z0-9_-]{11})(?:\/|[?&].*)?$/i.test(e);const ee=[Y,V,X,G,K,J],te=t=>{const{href:r}=t.attrs,[a,o]=e.useState(null);if(e.useEffect((()=>{let e=!0;return(()=>{try{const a=ee.find((e=>e.isMatch(r)));a&&e&&o({Component:a,props:t})}catch(e){console.error("Error finding embed match:",e)}})(),()=>{e=!1}}),[r,t]),a){const{Component:e,props:t}=a;return f.createElement(e,Object.assign({},t))}return null},re=e.memo(h,((e,t)=>e.children===t.children)),ae=e.memo((({message:t})=>(t.content=t.content.replace(/^\n+|(\n+|\\)+$/g,""),e.createElement(re,{className:"dark:prose-invert prose flex-1",remarkPlugins:[m],rehypePlugins:[d],components:{code(t){var{inline:r,className:a,children:o}=t,n=v(t,["inline","className","children"]);const i=/language-(\w+)/.exec(a||""),s=i&&i[1];return!r&&s?e.createElement(Z,Object.assign({key:Math.random(),language:s,value:String(o).replace(/\n$/,"")},n)):e.createElement("code",Object.assign({className:`text-red-400 bg-slate-200 border-slate-300 border rounded p-0.5 ${a}`.trim()},n),o)},marker:({children:t})=>e.createElement("div",{className:"my-2"},e.createElement("span",{className:"highlight"},t)),table:({children:t})=>e.createElement("table",{className:"border-collapse border border-black px-3 py-1 dark:border-white"},t),th:({children:t})=>e.createElement("th",{className:"break-words border border-black bg-gray-500 px-3 py-1 text-white dark:border-white"},t),td:({children:t})=>e.createElement("td",{className:"break-words border border-black px-3 py-1 dark:border-white"},t),a(t){var{children:r}=t,a=v(t,["children"]);if(a.href){const t=te({attrs:{href:a.href}});if(e.isValidElement(t))return t}return e.createElement("a",Object.assign({className:"link",target:"_blank",rel:"noopener noreferrer"},a),r)},pre:({children:t})=>e.createElement(e.Fragment,null,t),img({src:t,alt:r}){const a=te({attrs:{href:null!=t?t:""}});return e.isValidElement(a)?a:e.createElement("img",{src:t,alt:r,className:"w-full"})},li:t=>{var{children:r}=t,a=v(t,["children"]);return e.createElement("li",Object.assign({className:"py-1"},a),r)},ul:({children:t})=>e.createElement("ul",{className:"ml-4 list-outside list-disc"},t),ol:({children:t})=>e.createElement("ol",{className:"ml-4 list-outside list-decimal"},t),strong:t=>{var{children:r}=t,a=v(t,["children"]);return e.createElement("span",Object.assign({className:"font-semibold"},a),r)},h1:t=>{var{children:r}=t,a=v(t,["children"]);return e.createElement("h1",Object.assign({className:"mb-2 mt-6 text-3xl font-semibold"},a),r)},h2:t=>{var{children:r}=t,a=v(t,["children"]);return e.createElement("h2",Object.assign({className:"mb-2 mt-6 text-2xl font-semibold"},a),r)},h3:t=>{var{children:r}=t,a=v(t,["children"]);return e.createElement("h3",Object.assign({className:"mb-2 mt-6 text-xl font-semibold"},a),r)},h4:t=>{var{children:r}=t,a=v(t,["children"]);return e.createElement("h4",Object.assign({className:"mb-2 mt-6 text-lg font-semibold"},a),r)},h5:t=>{var{children:r}=t,a=v(t,["children"]);return e.createElement("h5",Object.assign({className:"mb-2 mt-6 text-base font-semibold"},a),r)},h6:t=>{var{children:r}=t,a=v(t,["children"]);return e.createElement("h6",Object.assign({className:"mb-2 mt-6 text-sm font-semibold"},a),r)}}},t.content))));function oe({answer:r,question:a,theme:o,searchResults:n,followUpQuestions:i,onFollowUpClick:s,isStreaming:l=!1,searchQueryId:c,feedback:d,onFeedback:m,disableFeedback:p=!1,textConfig:u={}}){const[h,g]=e.useState(!1),[f,b]=e.useState(!1),w=()=>x(this,void 0,void 0,(function*(){try{yield navigator.clipboard.writeText(r),g(!0),setTimeout((()=>g(!1)),2e3)}catch(e){console.error("Failed to copy text:",e)}})),y=e=>{m&&c&&m(e)};return e.createElement("div",{className:"rounded-lg p-6",style:{backgroundColor:o.cardBackground,borderColor:o.border,borderWidth:"1px",borderStyle:"solid"}},e.createElement("div",{className:"flex items-start justify-between"},e.createElement("div",{className:"flex items-center gap-2 mb-4"},e.createElement(Q,{loading:l,color:o.primary}),e.createElement("h2",{className:"text-xl",style:{color:o.text}},a)),e.createElement(q,null,e.createElement(F,null,e.createElement(_,{asChild:!0},e.createElement("button",{onClick:()=>{w()},className:"flex items-center justify-center w-8 h-8 rounded-md hover:bg-gray-100 transition-colors duration-200"},h?e.createElement(t.Check,{className:"h-4 w-4 text-green-500"}):e.createElement(t.Copy,{className:"h-4 w-4 text-gray-500"}))),e.createElement(U,null,e.createElement("p",null,h?"Copied!":"Copy"))))),r&&e.createElement("div",{className:"prose prose-sm max-w-none",style:{color:o.text}},e.createElement(ae,{message:{content:r}})),r&&!l&&!p&&e.createElement("div",{className:"mt-2 flex justify-end gap-2"},e.createElement(q,null,e.createElement(F,null,e.createElement(_,{asChild:!0},e.createElement(L,{variant:"ghost",size:"sm",className:"rounded-md h-8 w-8 flex items-center justify-center "+("accept"===d?"bg-green-100 text-green-600":""),onClick:()=>y("accept"),disabled:Boolean(d)},e.createElement(t.ThumbsUp,{className:"h-4 w-4"}))),e.createElement(U,null,e.createElement("p",null,u.positiveAnswerText||"Helpful")))),e.createElement(q,null,e.createElement(F,null,e.createElement(_,{asChild:!0},e.createElement(L,{variant:"ghost",size:"sm",className:"rounded-md h-8 w-8 flex items-center justify-center "+("reject"===d?"bg-red-100 text-red-600":""),onClick:()=>y("reject"),disabled:Boolean(d)},e.createElement(t.ThumbsDown,{className:"h-4 w-4"}))),e.createElement(U,null,e.createElement("p",null,u.negativeAnswerText||"Not helpful"))))),r&&i&&i.length>0&&e.createElement("div",{className:"mt-6 space-y-3"},e.createElement("div",{className:"text-sm font-medium",style:{color:o.text}},"Follow-up Questions"),e.createElement("div",{className:"flex flex-wrap gap-2"},i.map(((t,r)=>e.createElement("button",{key:r,onClick:()=>null==s?void 0:s(t),className:"px-3 py-1.5 rounded-lg text-sm transition-all duration-200 hover:opacity-90",style:{backgroundColor:`${o.accent}30`,color:o.text,border:`1px solid ${o.border}`}},t))))),n&&n.length>0&&e.createElement("div",{className:"mt-6 rounded-lg overflow-hidden",style:{backgroundColor:o.surface,borderWidth:"1px",borderStyle:"solid",borderColor:o.border}},e.createElement("button",{onClick:()=>b(!f),className:"w-full flex items-center justify-between p-3 transition-all duration-200 hover:bg-opacity-50",style:{color:o.text,borderBottom:f?`1px solid ${o.surfaceBorder}`:"none"}},e.createElement("div",{className:"flex items-center gap-2"},e.createElement(t.FileText,{className:"h-4 w-4",style:{color:o.primary}}),e.createElement("span",{className:"font-medium"},"Related Articles (",n.length,")")),e.createElement(t.ChevronDown,{className:"h-4 w-4 transition-transform duration-200 "+(f?"rotate-180":""),style:{color:o.text}})),e.createElement("div",{className:"overflow-hidden transition-all duration-200 ease-in-out",style:{maxHeight:f?48*n.length+"px":"0",opacity:f?1:0,transform:`translateY(${f?"0":"-10px"})`}},e.createElement("div",{className:"divide-y divide-gray-200"},n.map((r=>e.createElement("a",{key:r.id,href:r.url,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 p-3 transition-colors duration-200 hover:bg-gray-50",style:{color:o.text,backgroundColor:o.surface}},e.createElement(t.FileText,{className:"h-4 w-4",style:{color:o.primary}}),e.createElement("span",{className:"flex-grow"},r.title),e.createElement(t.ExternalLink,{className:"h-4 w-4",style:{color:`${o.text}60`}}))))))),!r&&e.createElement("div",{className:"animate-pulse space-y-4"},e.createElement("div",{className:"h-4 rounded w-full",style:{backgroundColor:`${o.border}40`}}),e.createElement("div",{className:"h-4 rounded w-3/4",style:{backgroundColor:`${o.border}40`}})))}function ne({questions:t,currentIndex:a,activeIndex:o,onNavigate:n,theme:i,offset:s}){return e.createElement(r.motion.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{duration:.5},className:"fixed left-4 top-1/2 -translate-y-1/2 z-50 flex flex-col gap-2",style:Object.assign({},s?{left:`${s}px`}:{})},t.map(((t,r)=>e.createElement("div",{key:r,className:"relative group"},e.createElement("button",{onClick:()=>n(r),className:"flex items-center justify-center w-8 h-8 rounded-full transition-all duration-200 "+(r<=a?"hover:opacity-90":""),style:{backgroundColor:r===o?i.primary:"#ccc",color:r===o?i.background:"#333",opacity:r>a?.5:1,cursor:"pointer"}},r+1),e.createElement("div",{className:"absolute left-12 top-0 px-3 py-2 rounded-lg whitespace-normal opacity-0 group-hover:opacity-100 w-48 text-sm transition-opacity duration-200",style:{backgroundColor:i.background,color:i.text,borderColor:i.border,borderWidth:"1px",borderStyle:"solid",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1)"}},t,e.createElement("div",{className:"absolute left-0 top-3 -translate-x-1 w-2 h-2 rotate-45",style:{backgroundColor:i.background,borderLeft:`1px solid ${i.border}`,borderBottom:`1px solid ${i.border}`}}))))))}function ie({onClick:r,theme:a}){return e.createElement(L,{className:"fixed bottom-20 right-4 rounded-full p-2 transition-opacity duration-300",style:{backgroundColor:a.background,borderColor:a.border,borderWidth:"1px",borderStyle:"solid",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1)"},onClick:r},e.createElement(t.ArrowDown,{className:"h-5 w-5",style:{color:a.text}}))}function se({endpoint:e,query:t,collectionId:r,headers:a,conversationId:o}){var n;return x(this,void 0,void 0,(function*(){try{const i=yield fetch(e,{method:"POST",headers:Object.assign({"Content-Type":"application/json"},a),body:JSON.stringify(Object.assign(Object.assign({query:t,limit:5},r&&"all"!==r&&{collectionId:r}),o&&{conversationId:o}))});if(!i.ok)throw new Error("Failed to fetch search results");const s=yield i.json();return{results:null==s?void 0:s.data,searchQueryId:null===(n=null==s?void 0:s.searchQuery)||void 0===n?void 0:n.id}}catch(e){throw console.error("Error searching:",e),e}}))}function le({endpoint:e,searchQueryId:t,headers:r,conversationId:a}){return x(this,void 0,void 0,(function*(){try{const o=yield fetch(e,{method:"POST",headers:Object.assign({"Content-Type":"application/json"},r),body:JSON.stringify(Object.assign({searchQueryId:t},a&&{conversationId:a}))});if(!o.ok)throw new Error("Failed to fetch answer");return o}catch(e){throw console.error("Error fetching answer:",e),e}}))}function ce(){return`bf-conversation-${Date.now()}-${"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(e=>{const t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))}`}function de({endpoint:e,conversationId:t,headers:r}){return x(this,void 0,void 0,(function*(){try{const a=yield fetch(e,{method:"POST",headers:Object.assign({"Content-Type":"application/json"},r),body:JSON.stringify({conversationId:t})});if(!a.ok)throw new Error("Failed to load conversation");const o=yield a.json();return{data:o.data.map((e=>Object.assign(Object.assign({},e),{feedback:e.feedback?"positive"===e.feedback?"accept":"reject":void 0})))}}catch(e){throw console.error("Error loading conversation:",e),e}}))}const me={primary:"#A3E635",accent:"#f9fafb",background:"white",text:"#171717",border:"#171717",hover:"#171717",surface:"#F9FAFB",surfaceBorder:"#E5E7EB",surfaceHover:"#F3F4F6",cardBackground:"white"},pe={headerText:"How can we help you today?",searchPlaceholder:"Ask a question or type a search term here ...",attachImageText:"Attach image",allDocumentsText:"All documents",loadingSearchText:"Searching for relevant content...",loadingAnswerText:"Crafting a response...",errorText:"Sorry, there was an error generating the answer.",followUpPlaceholder:"Ask follow-up",positiveAnswerText:"Helpful",negativeAnswerText:"Not helpful"},ue=e.forwardRef((({suggestions:a,theme:o={},collections:n=[],selectedCollectionId:i,onCollectionChange:s,searchEndpoint:l,answerEndpoint:c,feedbackEndpoint:d,loadConversationEndpoint:m,disableFollowUpQuestions:p=!1,disableImageAttachment:u=!1,disableFeedback:h=!1,siblingNode:g,offset:f=0,headers:b,textConfig:w={}},y)=>{var v;const k=Object.assign(Object.assign({},me),o),E=Object.assign(Object.assign({},pe),w),[N,C]=e.useState(""),[j,z]=e.useState(""),[S,O]=e.useState(!1),[I,q]=e.useState(!1),[F,_]=e.useState([]),[U,B]=e.useState(!1),[Q,D]=e.useState(0),[W,Z]=e.useState([]),[H,Y]=e.useState(i),[V,X]=e.useState(!0),[J,K]=e.useState(""),[G,ee]=e.useState(!1),[te,re]=e.useState(),ae=e.useRef(null),ue=e.useRef(null),he=e.useRef([]),ge=e.useRef(null),fe=e.useRef(null),be=e.useRef([]);e.useEffect((()=>{const e=new URLSearchParams(window.location.search).get("conversation");if(e&&m)ee(!0),q(!0),de({endpoint:m,conversationId:e,headers:b}).then((t=>{_(t.data),K(e),q(!0)})).catch((e=>{console.error("Error loading conversation:",e),re(E.errorText||"An error occurred"),q(!1),_([]);const t=ce();K(t);const r=new URL(window.location.href);r.searchParams.delete("conversation"),window.history.replaceState({},"",r.toString())})).finally((()=>{ee(!1)}));else{const e=ce();K(e)}}),[m]),e.useEffect((()=>{if(J&&F.length>0){const e=new URL(window.location.href);e.searchParams.set("conversation",J),window.history.replaceState({},"",e.toString())}}),[J,F.length]),e.useEffect((()=>{const e={showResults:I,answers:F,isLoading:G,error:te};be.current.forEach((t=>t(e)))}),[I,F,G,te]),e.useImperativeHandle(y,(()=>({createNewThread:()=>{C(""),z(""),q(!1),_([]),D(0),Z([]);const e=ce();K(e);const t=new URL(window.location.href);t.searchParams.delete("conversation"),window.history.replaceState({},"",t.toString()),ae.current&&(ae.current.style.height="auto")},showFollowUpThread:e=>{X(e)},subscribeToStateChanges:e=>(be.current.push(e),e({showResults:I,answers:F,isLoading:!1,error:void 0}),()=>{be.current=be.current.filter((t=>t!==e))})}))),e.useEffect((()=>{Y(i)}),[i]);const we=e=>{e.style.height="auto",e.style.height=`${e.scrollHeight}px`},ye=()=>{requestAnimationFrame((()=>{const e=he.current[he.current.length-1],t=ge.current;if(e&&t){const r=t.getBoundingClientRect(),a=e.getBoundingClientRect().top-r.top-80;t.scrollBy({top:a,behavior:"smooth"})}}))},ve=e=>x(void 0,void 0,void 0,(function*(){var t;const r=null===(t=e.body)||void 0===t?void 0:t.getReader();if(!r)return;_((e=>{const t=[...e],r=t[t.length-1];return r&&(r.isLoading=!1,r.isStreaming=!0),t}));let a="";try{let e,t;for(;({done:e,value:t}=yield r.read()),!e;){const e=(new TextDecoder).decode(t);a+=e,_((e=>{const t=[...e],r=t[t.length-1];return r&&(r.answer=a),t}))}}finally{_((e=>{const t=[...e],r=t[t.length-1];return r&&(r.isStreaming=!1),t})),r.releaseLock()}})),xe=(e,t,r)=>x(void 0,void 0,void 0,(function*(){if(d)try{yield function({endpoint:e,searchQueryId:t,response:r,headers:a,conversationId:o}){return x(this,void 0,void 0,(function*(){try{if(!(yield fetch(e,{method:"POST",headers:Object.assign({"Content-Type":"application/json"},a),body:JSON.stringify(Object.assign({searchQueryId:t,response:r},o&&{conversationId:o}))})).ok)throw new Error("Failed to send feedback")}catch(e){throw console.error("Error sending feedback:",e),e}}))}({endpoint:d,searchQueryId:t,response:e,headers:b,conversationId:J}),_((t=>{const a=[...t];return a[r]&&(a[r]=Object.assign(Object.assign({},a[r]),{feedback:e})),a}))}catch(e){console.error("Error sending feedback:",e)}})),ke=()=>x(void 0,void 0,void 0,(function*(){if(N.trim()){if(O(!0),q(!0),!J){const e=ce();K(e)}_((e=>{const t=[...e,{question:N,answer:"",isLoading:!0,isSearchLoading:!0}];return D(t.length-1),t})),ye();try{const e=yield se({endpoint:l,query:N,collectionId:H,headers:b,conversationId:J}),t=e.results,r=e.searchQueryId;_((e=>{const a=[...e];return a[a.length-1]=Object.assign(Object.assign({},a[a.length-1]),{searchResults:t,searchQueryId:r,isSearchLoading:!1}),a}));const a=yield le({endpoint:c,searchQueryId:r,headers:b,conversationId:J});yield ve(a)}catch(e){console.error("Error generating answer:",e),_((e=>{const t=[...e];return t[t.length-1]=Object.assign(Object.assign({},t[t.length-1]),{answer:E.errorText||"An error occurred",isLoading:!1,isSearchLoading:!1}),t}))}finally{O(!1)}}})),Ee=()=>x(void 0,void 0,void 0,(function*(){if(j.trim()){const e=j;C(e),z(""),O(!0),_((t=>{const r=[...t,{question:e,answer:"",isLoading:!0,isSearchLoading:!0}];return D(r.length-1),r})),ye();try{const t=yield se({endpoint:l,query:e,collectionId:H,headers:b,conversationId:J}),r=t.results,a=t.searchQueryId;_((e=>{const t=[...e];return t[t.length-1]=Object.assign(Object.assign({},t[t.length-1]),{searchResults:r,searchQueryId:a,isSearchLoading:!1}),t}));const o=yield le({endpoint:c,searchQueryId:a,headers:b,conversationId:J});yield ve(o)}catch(e){console.error("Error generating answer:",e),_((e=>{const t=[...e];return t[t.length-1]=Object.assign(Object.assign({},t[t.length-1]),{answer:E.errorText||"An error occurred",isLoading:!1,isSearchLoading:!1}),t}))}finally{O(!1)}}}));e.useEffect((()=>{const e=ge.current;if(!e)return;const t=()=>{const{scrollTop:t,scrollHeight:r,clientHeight:a}=e;B(!(r-t-a<100))};return e.addEventListener("scroll",t),()=>e.removeEventListener("scroll",t)}),[]),e.useEffect((()=>()=>{W.forEach((e=>URL.revokeObjectURL(e.preview)))}),[W]);return e.useEffect((()=>{if(I)return document.body.style.overflow="hidden",()=>{document.body.style.overflow="unset"}}),[I]),e.createElement("div",{className:"relative min-h-screen overflow-hidden"},e.createElement("div",{ref:ge,className:"w-full max-w-3xl mx-auto flex flex-col items-center space-y-8 px-4 py-20 h-screen overflow-y-auto relative elegant-scrollbar",style:{height:"100vh",maxHeight:"100vh",overflowY:"auto",WebkitOverflowScrolling:"touch","--surface-border":k.surfaceBorder,"--surface-hover":k.surfaceHover}},e.createElement(r.AnimatePresence,null,G?e.createElement(r.motion.div,{key:"loading",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"w-full flex items-center justify-center py-20"},e.createElement("div",{className:"flex flex-col items-center gap-4"},e.createElement("div",{className:"animate-spin rounded-full h-8 w-8 border-2 border-t-transparent",style:{borderColor:k.primary}}),e.createElement("p",{className:"text-sm",style:{color:k.text}},"Loading conversation..."))):I?e.createElement(r.motion.div,{key:"results",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.5},className:"w-full space-y-8 py-4 mb-20"},F.map(((t,a)=>e.createElement(r.motion.div,{key:a,ref:e=>he.current[a]=e,initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5,delay:.1*a}},t.isLoading?e.createElement(M,{theme:k,loadingText:t.isSearchLoading?E.loadingSearchText:E.loadingAnswerText}):e.createElement(oe,{answer:t.answer,question:t.question,theme:k,searchResults:t.searchResults,followUpQuestions:p?void 0:t.followUpQuestions,onFollowUpClick:p?void 0:e=>{z(e),Ee()},isStreaming:t.isStreaming,searchQueryId:t.searchQueryId,feedback:t.feedback,onFeedback:h||!d?void 0:e=>xe(e,t.searchQueryId,a),disableFeedback:h||!d,textConfig:E}))))):e.createElement(r.motion.div,{key:"search",initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},transition:{duration:.5},className:"w-full space-y-8"},e.createElement("div",{className:"w-full text-center space-y-4"},e.createElement(r.motion.h1,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5,delay:.3},className:"text-5xl font-bold",style:{color:k.text}},E.headerText)),e.createElement(r.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5,delay:.4}},e.createElement("div",{className:"relative w-full rounded-md overflow-hidden",style:{backgroundColor:k.background,borderColor:k.border,borderWidth:"1px",borderStyle:"solid"}},e.createElement("div",{className:"p-3 flex items-center"},e.createElement(t.Search,{className:"h-5 w-5 text-gray-400 mr-2"}),e.createElement("textarea",{ref:ae,placeholder:E.searchPlaceholder,value:N,onChange:e=>{C(e.target.value),we(e.target)},onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),ke())},className:"w-full resize-none outline-none text-lg py-1 font-light min-h-[36px] overflow-hidden placeholder:text-gray-400 border-none bg-transparent",style:{color:k.text,outline:"none",boxShadow:"none",fontSize:"16px"},rows:1})),!u&&W.length>0&&e.createElement("div",{className:"flex gap-2 mt-3 overflow-x-auto pb-1 px-3"},W.map(((r,a)=>e.createElement("div",{key:a,className:"relative group rounded-lg overflow-hidden flex-shrink-0",style:{width:"80px",height:"80px"}},e.createElement("img",{src:r.preview,alt:`Attached ${a+1}`,className:"w-full h-full object-cover"}),e.createElement("button",{onClick:()=>(e=>{Z((t=>(URL.revokeObjectURL(t[e].preview),t.filter(((t,r)=>r!==e)))))})(a),className:"absolute top-1 right-1 bg-black bg-opacity-50 rounded-full p-1 opacity-0 group-hover:opacity-100 transition-opacity duration-200"},e.createElement(t.X,{className:"h-3 w-3 text-white"})))))),e.createElement("div",{className:"flex items-center justify-between px-3 py-2 bg-gray-100 border-t border-gray-200"},e.createElement("div",{className:"flex gap-2"},n.length>0&&e.createElement(R,null,e.createElement(T,{asChild:!0},e.createElement(L,{variant:"ghost",size:"sm",className:"hover:bg-gray-200 transition-all duration-200 rounded-md h-8 flex items-center gap-2 text-gray-700"},H&&"all"!==H?e.createElement(t.CheckCircle2,{className:"h-5 w-5 text-green-500"}):e.createElement(t.Circle,{className:"h-5 w-5 text-gray-400"}),(null===(v=n.find((e=>e.id===H)))||void 0===v?void 0:v.name)||E.allDocumentsText,e.createElement(t.ChevronDown,{className:"h-4 w-4 opacity-50"}))),e.createElement(A,null,n.map((r=>e.createElement($,{key:r.id,onClick:()=>{return e=r.id,Y(e),void(null==s||s(e));var e},className:r.id===H?"bg-gray-100":""},r.id===H?e.createElement(t.CheckCircle2,{className:"h-4 w-4 mr-2 text-green-500"}):e.createElement(t.Circle,{className:"h-4 w-4 mr-2 text-gray-400"}),r.name))))),!u&&e.createElement(e.Fragment,null,e.createElement("input",{type:"file",ref:fe,accept:"image/*",multiple:!0,className:"hidden",onChange:e=>{const t=e.target.files;if(t){const e=Array.from(t).map((e=>({file:e,preview:URL.createObjectURL(e)})));Z((t=>[...t,...e]))}fe.current&&(fe.current.value="")}}),e.createElement(L,{variant:"ghost",size:"sm",className:"hover:bg-gray-200 rounded-md h-8 text-gray-700",onClick:()=>{var e;return null===(e=fe.current)||void 0===e?void 0:e.click()}},e.createElement(t.Image,{className:"h-4 w-4 mr-1.5"}),E.attachImageText))),e.createElement("div",{className:"flex items-center"},e.createElement(L,{size:"sm",disabled:!N||S,className:"rounded-md h-8 w-8 bg-[#86efac] hover:bg-[#86efac]/90 disabled:opacity-50",onClick:()=>{ke()}},S?e.createElement("div",{className:"animate-spin rounded-full h-4 w-4 border-2 border-t-transparent",style:{borderColor:"white"}}):e.createElement(t.ArrowRight,{className:"h-4 w-4 text-gray-700"})))))),e.createElement(P,{suggestions:a||[],onQuestionClick:e=>{if(e.conversationId&&m)return ee(!0),q(!0),void de({endpoint:m,conversationId:e.conversationId,headers:b}).then((t=>{_(t.data),K(e.conversationId),q(!0)})).catch((e=>{console.error("Error loading conversation:",e),re(E.errorText||"An error occurred"),q(!1),_([]);const t=ce();K(t);const r=new URL(window.location.href);r.searchParams.delete("conversation"),window.history.replaceState({},"",r.toString())})).finally((()=>{ee(!1)}));if(q(!0),O(!0),!J){const e=ce();K(e)}_((t=>[...t,{question:e.question,answer:"",isLoading:!0,isSearchLoading:!0}])),x(void 0,void 0,void 0,(function*(){try{const t=yield se({endpoint:l,query:e.question,collectionId:H,headers:b,conversationId:J}),r=t.results;_((e=>{const a=[...e];return a[a.length-1]=Object.assign(Object.assign({},a[a.length-1]),{searchResults:r,searchQueryId:t.searchQueryId,isSearchLoading:!1}),a}));const a=yield le({endpoint:c,searchQueryId:t.searchQueryId,headers:b,conversationId:J});yield ve(a)}catch(e){console.error("Error generating answer:",e),_((e=>{const t=[...e];return t[t.length-1]=Object.assign(Object.assign({},t[t.length-1]),{answer:E.errorText||"An error occurred",isLoading:!1,isSearchLoading:!1}),t}))}finally{O(!1),ye()}}))},borderColor:k.border,title:E.suggestionsTitle}),g)),I&&F.length>1&&e.createElement("div",{className:"hidden sm:block"},e.createElement(ne,{questions:F.map((e=>e.question)),currentIndex:S?F.length-1:Q,activeIndex:Q,onNavigate:e=>{D(e),(e=>{requestAnimationFrame((()=>{const t=he.current[e],r=ge.current;if(t&&r){const e=r.getBoundingClientRect(),a=t.getBoundingClientRect().top-e.top-80;r.scrollBy({top:a,behavior:"smooth"})}}))})(e)},theme:k,offset:f})),I&&V&&e.createElement(r.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5},className:"fixed bottom-4 left-4 right-4 max-w-3xl mx-auto z-10",style:{left:`${f}px`}},e.createElement("div",{className:"rounded-full h-[44px] sm:h-[52px] flex items-center justify-between",style:{backgroundColor:k.background,borderColor:k.border,borderWidth:"1px",borderStyle:"solid",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1)",padding:"0 14px"}},e.createElement("div",{className:"flex items-center gap-2 sm:gap-3 flex-grow overflow-hidden h-full"},e.createElement(t.Search,{className:"h-4 w-4 sm:h-5 sm:w-5 flex-shrink-0",style:{color:k.primary}}),e.createElement("textarea",{ref:ue,placeholder:E.followUpPlaceholder,value:j,onChange:e=>{z(e.target.value),we(e.target)},onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),Ee())},disabled:S,className:"w-full bg-transparent outline-none text-sm sm:text-base resize-none overflow-hidden disabled:opacity-50 border-none h-full py-3 placeholder:text-sm sm:placeholder:text-base",style:{color:k.text,outline:"none",boxShadow:"none",fontSize:"16px"},rows:1})),e.createElement("div",{className:"flex items-center gap-2 sm:gap-3 ml-2 sm:ml-3 flex-shrink-0"},e.createElement(L,{size:"icon",variant:"ghost",disabled:S||!j.trim(),className:"rounded-full transition-colors duration-200 disabled:opacity-50 h-8 w-8 sm:h-9 sm:w-9 flex items-center justify-center",style:{color:k.text,backgroundColor:"transparent"},onClick:()=>{Ee()}},S?e.createElement("div",{className:"animate-spin rounded-full h-4 w-4 sm:h-5 sm:w-5 border-2",style:{borderColor:`${k.text}40`,borderTopColor:k.text}}):e.createElement(t.ArrowUp,{className:"h-4 w-4 sm:h-5 sm:w-5"}))))),U&&I&&e.createElement(ie,{onClick:ye,theme:k})))}));ue.displayName="ChatSearch",exports.ChatSearch=ue;
package/dist/esm/index.js CHANGED
@@ -1 +1 @@
1
- import*as e from"react";import t,{memo as r,useState as a,useEffect as o,forwardRef as n,useRef as i,useImperativeHandle as s}from"react";import{CheckCircle as l,Clipboard as c,Download as d,Check as m,Copy as p,ThumbsUp as u,ThumbsDown as h,FileText as g,ChevronDown as f,ExternalLink as b,ArrowDown as w,Search as y,X as v,CheckCircle2 as x,Circle as k,Image as E,ArrowRight as N,ArrowUp as C}from"lucide-react";import{motion as j,AnimatePresence as z}from"framer-motion";import{jsx as O,Fragment as S}from"react/jsx-runtime";import{cva as I}from"class-variance-authority";import{clsx as L}from"clsx";import{twMerge as R}from"tailwind-merge";import*as T from"@radix-ui/react-dropdown-menu";import{ChevronRightIcon as A,CheckIcon as $,DotFilledIcon as _}from"@radix-ui/react-icons";import F from"rehype-raw";import U from"remark-gfm";import{Prism as B}from"react-syntax-highlighter";import{a11yDark as Q}from"react-syntax-highlighter/dist/cjs/styles/prism";import P from"react-markdown";import*as q from"@radix-ui/react-tooltip";function M(e,t){void 0===t&&(t={});var r=t.insertAt;if(e&&"undefined"!=typeof document){var a=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===r&&a.firstChild?a.insertBefore(o,a.firstChild):a.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}function W(e,t){var r={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(r[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(a=Object.getOwnPropertySymbols(e);o<a.length;o++)t.indexOf(a[o])<0&&Object.prototype.propertyIsEnumerable.call(e,a[o])&&(r[a[o]]=e[a[o]])}return r}function Z(e,t,r,a){return new(r||(r=Promise))((function(o,n){function i(e){try{l(a.next(e))}catch(e){n(e)}}function s(e){try{l(a.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,s)}l((a=a.apply(e,t||[])).next())}))}function H(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function Y(...e){return t=>{let r=!1;const a=e.map((e=>{const a=H(e,t);return r||"function"!=typeof a||(r=!0),a}));if(r)return()=>{for(let t=0;t<a.length;t++){const r=a[t];"function"==typeof r?r():H(e[t],null)}}}}M('/*! tailwindcss v3.3.5 | MIT License | https://tailwindcss.com*/*,:after,:before{border:0 solid #e5e7eb;box-sizing:border-box}:after,:before{--tw-content:""}html{-webkit-text-size-adjust:100%;font-feature-settings:normal;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{color:#9ca3af;opacity:1}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]{display:none}:root{--background:0 0% 100%;--foreground:0 0% 3.9%;--card:0 0% 100%;--card-foreground:0 0% 3.9%;--popover:0 0% 100%;--popover-foreground:0 0% 3.9%;--primary:0 0% 9%;--primary-foreground:0 0% 98%;--secondary:0 0% 96.1%;--secondary-foreground:0 0% 9%;--muted:0 0% 96.1%;--muted-foreground:0 0% 45.1%;--accent:0 0% 96.1%;--accent-foreground:0 0% 9%;--destructive:0 84.2% 60.2%;--destructive-foreground:0 0% 98%;--border:0 0% 89.8%;--input:0 0% 89.8%;--ring:0 0% 3.9%;--radius:0.5rem}.dark{--background:0 0% 3.9%;--foreground:0 0% 98%;--card:0 0% 3.9%;--card-foreground:0 0% 98%;--popover:0 0% 3.9%;--popover-foreground:0 0% 98%;--primary:0 0% 98%;--primary-foreground:0 0% 9%;--secondary:0 0% 14.9%;--secondary-foreground:0 0% 98%;--muted:0 0% 14.9%;--muted-foreground:0 0% 63.9%;--accent:0 0% 14.9%;--accent-foreground:0 0% 98%;--destructive:0 62.8% 30.6%;--destructive-foreground:0 0% 98%;--border:0 0% 14.9%;--input:0 0% 14.9%;--ring:0 0% 83.1%}*{border-color:hsl(var(--border))}body{background-color:hsl(var(--background));color:hsl(var(--foreground))}*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.\\!container{margin-left:auto!important;margin-right:auto!important;padding-left:2rem!important;padding-right:2rem!important;width:100%!important}.container{margin-left:auto;margin-right:auto;padding-left:2rem;padding-right:2rem;width:100%}@media (min-width:1400px){.\\!container{max-width:1400px!important}.container{max-width:1400px}}.pointer-events-none{pointer-events:none}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.bottom-20{bottom:5rem}.bottom-4{bottom:1rem}.left-0{left:0}.left-12{left:3rem}.left-2{left:.5rem}.left-4{left:1rem}.right-1{right:.25rem}.right-4{right:1rem}.top-0{top:0}.top-1{top:.25rem}.top-1\\/2{top:50%}.top-3{top:.75rem}.z-10{z-index:10}.z-50{z-index:50}.-mx-1{margin-left:-.25rem;margin-right:-.25rem}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-bottom:.25rem;margin-top:.25rem}.my-2{margin-top:.5rem}.mb-2,.my-2{margin-bottom:.5rem}.mb-20{margin-bottom:5rem}.mb-4{margin-bottom:1rem}.ml-2{margin-left:.5rem}.ml-4{margin-left:1rem}.ml-auto{margin-left:auto}.mr-1{margin-right:.25rem}.mr-1\\.5{margin-right:.375rem}.mr-2{margin-right:.5rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.mt-\\[-5px\\]{margin-top:-5px}.block{display:block}.inline-block{display:inline-block}.\\!inline{display:inline!important}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.hidden{display:none}.h-10{height:2.5rem}.h-2{height:.5rem}.h-3{height:.75rem}.h-3\\.5{height:.875rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-\\[44px\\]{height:44px}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.min-h-\\[36px\\]{min-height:36px}.min-h-screen{min-height:100vh}.w-2{width:.5rem}.w-3{width:.75rem}.w-3\\.5{width:.875rem}.w-3\\/4{width:75%}.w-4{width:1rem}.w-48{width:12rem}.w-5{width:1.25rem}.w-8{width:2rem}.w-9{width:2.25rem}.w-full{width:100%}.min-w-\\[8rem\\]{min-width:8rem}.max-w-3xl{max-width:48rem}.max-w-none{max-width:none}.flex-1{flex:1 1 0%}.flex-shrink-0,.shrink-0{flex-shrink:0}.flex-grow{flex-grow:1}.border-collapse{border-collapse:collapse}.-translate-x-1{--tw-translate-x:-0.25rem}.-translate-x-1,.-translate-y-1\\/2{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\\/2{--tw-translate-y:-50%}.rotate-180{--tw-rotate:180deg}.rotate-180,.rotate-45{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-45{--tw-rotate:45deg}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(1turn)}}.animate-spin{animation:spin 1s linear infinite}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize-none{resize:none}.list-outside{list-style-position:outside}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-4{gap:1rem}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(.75rem*var(--tw-space-y-reverse));margin-top:calc(.75rem*(1 - var(--tw-space-y-reverse)))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(1rem*var(--tw-space-y-reverse));margin-top:calc(1rem*(1 - var(--tw-space-y-reverse)))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(1.5rem*var(--tw-space-y-reverse));margin-top:calc(1.5rem*(1 - var(--tw-space-y-reverse)))}.space-y-8>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(2rem*var(--tw-space-y-reverse));margin-top:calc(2rem*(1 - var(--tw-space-y-reverse)))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse:0;border-bottom-width:calc(1px*var(--tw-divide-y-reverse));border-top-width:calc(1px*(1 - var(--tw-divide-y-reverse)))}.divide-gray-200>:not([hidden])~:not([hidden]){--tw-divide-opacity:1;border-color:rgb(229 231 235/var(--tw-divide-opacity))}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.whitespace-normal{white-space:normal}.whitespace-nowrap{white-space:nowrap}.break-words{overflow-wrap:break-word}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:.75rem}.rounded-b-lg{border-bottom-left-radius:var(--radius);border-bottom-right-radius:var(--radius)}.rounded-t-lg{border-top-left-radius:var(--radius);border-top-right-radius:var(--radius)}.border{border-width:1px}.border-2{border-width:2px}.border-t{border-top-width:1px}.border-none{border-style:none}.border-black{--tw-border-opacity:1;border-color:rgb(0 0 0/var(--tw-border-opacity))}.border-gray-200{--tw-border-opacity:1;border-color:rgb(229 231 235/var(--tw-border-opacity))}.border-gray-300{--tw-border-opacity:1;border-color:rgb(209 213 219/var(--tw-border-opacity))}.border-input{border-color:hsl(var(--input))}.border-slate-300{--tw-border-opacity:1;border-color:rgb(203 213 225/var(--tw-border-opacity))}.border-transparent{border-color:transparent}.border-t-transparent{border-top-color:transparent}.bg-\\[\\#86efac\\]{--tw-bg-opacity:1;background-color:rgb(134 239 172/var(--tw-bg-opacity))}.bg-background{background-color:hsl(var(--background))}.bg-black{--tw-bg-opacity:1;background-color:rgb(0 0 0/var(--tw-bg-opacity))}.bg-destructive{background-color:hsl(var(--destructive))}.bg-gray-100{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity))}.bg-gray-500{--tw-bg-opacity:1;background-color:rgb(107 114 128/var(--tw-bg-opacity))}.bg-green-100{--tw-bg-opacity:1;background-color:rgb(220 252 231/var(--tw-bg-opacity))}.bg-muted{background-color:hsl(var(--muted))}.bg-popover{background-color:hsl(var(--popover))}.bg-primary{background-color:hsl(var(--primary))}.bg-red-100{--tw-bg-opacity:1;background-color:rgb(254 226 226/var(--tw-bg-opacity))}.bg-secondary{background-color:hsl(var(--secondary))}.bg-slate-200{--tw-bg-opacity:1;background-color:rgb(226 232 240/var(--tw-bg-opacity))}.bg-transparent{background-color:transparent}.bg-zinc-800\\/80{background-color:rgba(39,39,42,.8)}.bg-opacity-50{--tw-bg-opacity:0.5}.fill-current{fill:currentColor}.object-cover{-o-object-fit:cover;object-fit:cover}.p-0{padding:0}.p-0\\.5{padding:.125rem}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-8{padding-left:2rem;padding-right:2rem}.py-1{padding-bottom:.25rem;padding-top:.25rem}.py-1\\.5{padding-bottom:.375rem;padding-top:.375rem}.py-2{padding-bottom:.5rem;padding-top:.5rem}.py-20{padding-bottom:5rem;padding-top:5rem}.py-3{padding-bottom:.75rem;padding-top:.75rem}.py-4{padding-bottom:1rem;padding-top:1rem}.pb-1{padding-bottom:.25rem}.pl-8{padding-left:2rem}.pr-2{padding-right:.5rem}.text-center{text-align:center}.font-sans{font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-5xl{font-size:3rem;line-height:1}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-light{font-weight:300}.font-medium{font-weight:500}.font-semibold{font-weight:600}.lowercase{text-transform:lowercase}.italic{font-style:italic}.tracking-widest{letter-spacing:.1em}.text-destructive-foreground{color:hsl(var(--destructive-foreground))}.text-gray-400{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity))}.text-gray-500{--tw-text-opacity:1;color:rgb(107 114 128/var(--tw-text-opacity))}.text-gray-700{--tw-text-opacity:1;color:rgb(55 65 81/var(--tw-text-opacity))}.text-gray-900{--tw-text-opacity:1;color:rgb(17 24 39/var(--tw-text-opacity))}.text-green-500{--tw-text-opacity:1;color:rgb(34 197 94/var(--tw-text-opacity))}.text-green-600{--tw-text-opacity:1;color:rgb(22 163 74/var(--tw-text-opacity))}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-red-400{--tw-text-opacity:1;color:rgb(248 113 113/var(--tw-text-opacity))}.text-red-600{--tw-text-opacity:1;color:rgb(220 38 38/var(--tw-text-opacity))}.text-secondary-foreground{color:hsl(var(--secondary-foreground))}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.text-zinc-400{--tw-text-opacity:1;color:rgb(161 161 170/var(--tw-text-opacity))}.underline-offset-4{text-underline-offset:4px}.opacity-0{opacity:0}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color)}.shadow,.shadow-lg{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color)}.shadow-md{--tw-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color)}.shadow-md,.shadow-sm{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-0{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur{--tw-backdrop-blur:blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-colors{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-opacity{transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-transform{transition-duration:.15s;transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}@keyframes enter{0%{opacity:var(--tw-enter-opacity,1);transform:translate3d(var(--tw-enter-translate-x,0),var(--tw-enter-translate-y,0),0) scale3d(var(--tw-enter-scale,1),var(--tw-enter-scale,1),var(--tw-enter-scale,1)) rotate(var(--tw-enter-rotate,0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity,1);transform:translate3d(var(--tw-exit-translate-x,0),var(--tw-exit-translate-y,0),0) scale3d(var(--tw-exit-scale,1),var(--tw-exit-scale,1),var(--tw-exit-scale,1)) rotate(var(--tw-exit-rotate,0))}}.animate-in{--tw-enter-opacity:initial;--tw-enter-scale:initial;--tw-enter-rotate:initial;--tw-enter-translate-x:initial;--tw-enter-translate-y:initial;animation-duration:.15s;animation-name:enter}.fade-in-0{--tw-enter-opacity:0}.zoom-in-95{--tw-enter-scale:.95}.duration-200{animation-duration:.2s}.duration-300{animation-duration:.3s}.ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)}.placeholder\\:text-sm::-moz-placeholder{font-size:.875rem;line-height:1.25rem}.placeholder\\:text-sm::placeholder{font-size:.875rem;line-height:1.25rem}.placeholder\\:text-gray-400::-moz-placeholder{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity))}.placeholder\\:text-gray-400::placeholder{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity))}.hover\\:bg-\\[\\#86efac\\]\\/90:hover{background-color:rgba(134,239,172,.9)}.hover\\:bg-accent:hover{background-color:hsl(var(--accent))}.hover\\:bg-destructive\\/90:hover{background-color:hsl(var(--destructive)/.9)}.hover\\:bg-gray-100:hover{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity))}.hover\\:bg-gray-200:hover{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity))}.hover\\:bg-gray-50:hover{--tw-bg-opacity:1;background-color:rgb(249 250 251/var(--tw-bg-opacity))}.hover\\:bg-primary\\/90:hover{background-color:hsl(var(--primary)/.9)}.hover\\:bg-secondary\\/80:hover{background-color:hsl(var(--secondary)/.8)}.hover\\:bg-zinc-700\\/50:hover{background-color:rgba(63,63,70,.5)}.hover\\:bg-opacity-50:hover{--tw-bg-opacity:0.5}.hover\\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\\:text-zinc-100:hover{--tw-text-opacity:1;color:rgb(244 244 245/var(--tw-text-opacity))}.hover\\:underline:hover{text-decoration-line:underline}.hover\\:opacity-90:hover{opacity:.9}.focus\\:bg-accent:focus{background-color:hsl(var(--accent))}.focus\\:text-accent-foreground:focus{color:hsl(var(--accent-foreground))}.focus-visible\\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\\:ring-1:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus-visible\\:ring-2:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus-visible\\:ring-ring:focus-visible{--tw-ring-color:hsl(var(--ring))}.focus-visible\\:ring-offset-2:focus-visible{--tw-ring-offset-width:2px}.focus-visible\\:ring-offset-background:focus-visible{--tw-ring-offset-color:hsl(var(--background))}.disabled\\:pointer-events-none:disabled{pointer-events:none}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:opacity-50:disabled{opacity:.5}.group:hover .group-hover\\:opacity-100{opacity:1}.data-\\[disabled\\]\\:pointer-events-none[data-disabled]{pointer-events:none}.data-\\[state\\=checked\\]\\:translate-x-4[data-state=checked]{--tw-translate-x:1rem}.data-\\[state\\=checked\\]\\:translate-x-4[data-state=checked],.data-\\[state\\=unchecked\\]\\:translate-x-0[data-state=unchecked]{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[state\\=unchecked\\]\\:translate-x-0[data-state=unchecked]{--tw-translate-x:0px}.data-\\[state\\=checked\\]\\:bg-primary[data-state=checked]{background-color:hsl(var(--primary))}.data-\\[state\\=open\\]\\:bg-accent[data-state=open]{background-color:hsl(var(--accent))}.data-\\[state\\=unchecked\\]\\:bg-input[data-state=unchecked]{background-color:hsl(var(--input))}.data-\\[disabled\\]\\:opacity-50[data-disabled]{opacity:.5}.data-\\[state\\=open\\]\\:animate-in[data-state=open]{--tw-enter-opacity:initial;--tw-enter-scale:initial;--tw-enter-rotate:initial;--tw-enter-translate-x:initial;--tw-enter-translate-y:initial;animation-duration:.15s;animation-name:enter}.data-\\[state\\=closed\\]\\:animate-out[data-state=closed]{--tw-exit-opacity:initial;--tw-exit-scale:initial;--tw-exit-rotate:initial;--tw-exit-translate-x:initial;--tw-exit-translate-y:initial;animation-duration:.15s;animation-name:exit}.data-\\[state\\=closed\\]\\:fade-out-0[data-state=closed]{--tw-exit-opacity:0}.data-\\[state\\=open\\]\\:fade-in-0[data-state=open]{--tw-enter-opacity:0}.data-\\[state\\=closed\\]\\:zoom-out-95[data-state=closed]{--tw-exit-scale:.95}.data-\\[state\\=open\\]\\:zoom-in-95[data-state=open]{--tw-enter-scale:.95}.data-\\[side\\=bottom\\]\\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y:-0.5rem}.data-\\[side\\=left\\]\\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x:0.5rem}.data-\\[side\\=right\\]\\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x:-0.5rem}.data-\\[side\\=top\\]\\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y:0.5rem}:is([data-mode=dark] .dark\\:border-white){--tw-border-opacity:1;border-color:rgb(255 255 255/var(--tw-border-opacity))}@media (min-width:640px){.sm\\:ml-3{margin-left:.75rem}.sm\\:block{display:block}.sm\\:h-5{height:1.25rem}.sm\\:h-9{height:2.25rem}.sm\\:h-\\[52px\\]{height:52px}.sm\\:w-5{width:1.25rem}.sm\\:w-9{width:2.25rem}.sm\\:gap-3{gap:.75rem}.sm\\:text-base{font-size:1rem;line-height:1.5rem}.sm\\:placeholder\\:text-base::-moz-placeholder{font-size:1rem;line-height:1.5rem}.sm\\:placeholder\\:text-base::placeholder{font-size:1rem;line-height:1.5rem}}.\\[\\&\\>svg\\]\\:shrink-0>svg{flex-shrink:0}.\\[\\&_svg\\]\\:pointer-events-none svg{pointer-events:none}.\\[\\&_svg\\]\\:shrink-0 svg{flex-shrink:0}'),"function"==typeof SuppressedError&&SuppressedError;var D=e.forwardRef(((t,r)=>{const{children:a,...o}=t,n=e.Children.toArray(a),i=n.find(X);if(i){const t=i.props.children,a=n.map((r=>r===i?e.Children.count(t)>1?e.Children.only(null):e.isValidElement(t)?t.props.children:null:r));return O(V,{...o,ref:r,children:e.isValidElement(t)?e.cloneElement(t,void 0,a):null})}return O(V,{...o,ref:r,children:a})}));D.displayName="Slot";var V=e.forwardRef(((t,r)=>{const{children:a,...o}=t;if(e.isValidElement(a)){const t=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;if(r)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r)return e.props.ref;return e.props.ref||e.ref}(a);return e.cloneElement(a,{...K(o,a.props),ref:r?Y(r,t):t})}return e.Children.count(a)>1?e.Children.only(null):null}));V.displayName="SlotClone";var J=({children:e})=>O(S,{children:e});function X(t){return e.isValidElement(t)&&t.type===J}function K(e,t){const r={...t};for(const a in t){const o=e[a],n=t[a];/^on[A-Z]/.test(a)?o&&n?r[a]=(...e)=>{n(...e),o(...e)}:o&&(r[a]=o):"style"===a?r[a]={...o,...n}:"className"===a&&(r[a]=[o,n].filter(Boolean).join(" "))}return{...e,...r}}function G(...e){return R(L(e))}const ee=I("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),te=e.forwardRef(((t,r)=>{var{className:a,variant:o,size:n,asChild:i=!1}=t,s=W(t,["className","variant","size","asChild"]);const l=i?D:"button";return e.createElement(l,Object.assign({className:G(ee({variant:o,size:n,className:a})),ref:r},s))}));te.displayName="Button";const re=T.Root,ae=T.Trigger;e.forwardRef(((t,r)=>{var{className:a,inset:o,children:n}=t,i=W(t,["className","inset","children"]);return e.createElement(T.SubTrigger,Object.assign({ref:r,className:G("flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",o&&"pl-8",a)},i),n,e.createElement(A,{className:"ml-auto"}))})).displayName=T.SubTrigger.displayName;e.forwardRef(((t,r)=>{var{className:a}=t,o=W(t,["className"]);return e.createElement(T.SubContent,Object.assign({ref:r,className:G("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",a)},o))})).displayName=T.SubContent.displayName;const oe=e.forwardRef(((t,r)=>{var{className:a,sideOffset:o=4}=t,n=W(t,["className","sideOffset"]);return e.createElement(T.Portal,null,e.createElement(T.Content,Object.assign({ref:r,sideOffset:o,className:G("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",a)},n)))}));oe.displayName=T.Content.displayName;const ne=e.forwardRef(((t,r)=>{var{className:a,inset:o}=t,n=W(t,["className","inset"]);return e.createElement(T.Item,Object.assign({ref:r,className:G("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",o&&"pl-8",a)},n))}));ne.displayName=T.Item.displayName;e.forwardRef(((t,r)=>{var{className:a,children:o,checked:n}=t,i=W(t,["className","children","checked"]);return e.createElement(T.CheckboxItem,Object.assign({ref:r,className:G("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a),checked:n},i),e.createElement("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center"},e.createElement(T.ItemIndicator,null,e.createElement($,{className:"h-4 w-4"}))),o)})).displayName=T.CheckboxItem.displayName;e.forwardRef(((t,r)=>{var{className:a,children:o}=t,n=W(t,["className","children"]);return e.createElement(T.RadioItem,Object.assign({ref:r,className:G("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a)},n),e.createElement("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center"},e.createElement(T.ItemIndicator,null,e.createElement(_,{className:"h-2 w-2 fill-current"}))),o)})).displayName=T.RadioItem.displayName;e.forwardRef(((t,r)=>{var{className:a,inset:o}=t,n=W(t,["className","inset"]);return e.createElement(T.Label,Object.assign({ref:r,className:G("px-2 py-1.5 text-sm font-semibold",o&&"pl-8",a)},n))})).displayName=T.Label.displayName;function ie({suggestions:e,onQuestionClick:r,borderColor:a,title:o="Suggested questions"}){return e&&0!==e.length?t.createElement("div",{className:"w-full"},t.createElement("h3",{className:"text-base font-medium mb-4 text-gray-900"},o),t.createElement("div",{className:"flex flex-wrap gap-2"},e.map((e=>t.createElement("button",{key:e.id,onClick:()=>r(e),className:"px-4 py-2 rounded-lg border border-gray-300 text-gray-700 hover:bg-gray-50 transition-colors duration-200 text-sm",style:{borderColor:a}},e.question))))):null}e.forwardRef(((t,r)=>{var{className:a}=t,o=W(t,["className"]);return e.createElement(T.Separator,Object.assign({ref:r,className:G("-mx-1 my-1 h-px bg-muted",a)},o))})).displayName=T.Separator.displayName;var se="generating-star-module_animate-spin__AJjwz";M(".generating-star-module_animate-spin__AJjwz{animation:generating-star-module_rotate__ChndJ 2s linear infinite;transform-box:fill-box;transform-origin:center}@keyframes generating-star-module_rotate__ChndJ{to{transform:rotate(1turn)}}");const le=({loading:e,color:r="#000"})=>t.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",className:"mt-[-5px] inline-block"},t.createElement("path",{className:e?se:"",d:"M7.54672 16.0031L2.66234 14.2031C2.51881 14.1498 2.39502 14.0539 2.3076 13.9282C2.22019 13.8025 2.17333 13.6531 2.17333 13.5C2.17333 13.3469 2.22019 13.1975 2.3076 13.0718C2.39502 12.9461 2.51881 12.8501 2.66234 12.7969L7.54672 10.9969C7.64981 10.9589 7.74344 10.899 7.82113 10.8213C7.89882 10.7436 7.95873 10.65 7.99672 10.5469L9.79672 5.66249C9.84999 5.51896 9.94592 5.39517 10.0716 5.30775C10.1973 5.22033 10.3467 5.17348 10.4998 5.17348C10.6529 5.17348 10.8024 5.22033 10.9281 5.30775C11.0538 5.39517 11.1497 5.51896 11.203 5.66249L13.003 10.5469C13.041 10.65 13.1009 10.7436 13.1786 10.8213C13.2562 10.899 13.3499 10.9589 13.453 10.9969L18.3373 12.7969C18.4809 12.8501 18.6047 12.9461 18.6921 13.0718C18.7795 13.1975 18.8264 13.3469 18.8264 13.5C18.8264 13.6531 18.7795 13.8025 18.6921 13.9282C18.6047 14.0539 18.4809 14.1498 18.3373 14.2031L13.453 16.0031C13.3499 16.0411 13.2562 16.101 13.1786 16.1787C13.1009 16.2564 13.041 16.35 13.003 16.4531L11.203 21.3375C11.1497 21.481 11.0538 21.6048 10.9281 21.6922C10.8024 21.7796 10.6529 21.8265 10.4998 21.8265C10.3467 21.8265 10.1973 21.7796 10.0716 21.6922C9.94592 21.6048 9.84999 21.481 9.79672 21.3375L7.99672 16.4531C7.95873 16.35 7.89882 16.2564 7.82113 16.1787C7.74344 16.101 7.64981 16.0411 7.54672 16.0031Z",stroke:r,strokeWidth:"1.5",strokeLinecap:"round",fill:e?r:"none",strokeLinejoin:"round"}),t.createElement("path",{d:"M18.7497 3.75L14.2497 3.75",stroke:r,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),t.createElement("path",{d:"M16.4999 6V1.5",stroke:r,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),t.createElement("path",{d:"M22.4999 8.25001H19.4999",stroke:r,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),t.createElement("path",{d:"M20.9998 9.75002V6.75002",stroke:r,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}));function ce({theme:e,loadingText:r="Analyzing..."}){return t.createElement("div",{className:"w-full space-y-6 rounded-xl p-6",style:{backgroundColor:e.cardBackground,borderColor:e.border,borderWidth:"1px",borderStyle:"solid"}},t.createElement("div",{className:"flex items-center gap-2"},t.createElement(le,{loading:!0,color:e.primary}),t.createElement("div",{className:"text-sm",style:{color:e.text}},r)),t.createElement("div",{className:"space-y-4 animate-pulse"},Array.from({length:4}).map(((r,a)=>t.createElement("div",{key:a,className:"h-4 rounded w-full",style:{backgroundColor:`${e.border}40`}}))),t.createElement("div",{className:"h-4 rounded w-3/4",style:{backgroundColor:`${e.border}40`}})),t.createElement("div",{className:"rounded-lg p-4",style:{backgroundColor:`${e.accent}50`}},t.createElement("div",{className:"flex items-center justify-between"},t.createElement("div",{className:"h-4 rounded w-48",style:{backgroundColor:`${e.border}80`}}),t.createElement("div",{className:"flex gap-2"},t.createElement("div",{className:"w-8 h-8 rounded-full",style:{backgroundColor:`${e.border}80`}}),t.createElement("div",{className:"w-8 h-8 rounded-full",style:{backgroundColor:`${e.border}80`}})))))}const de={javascript:".js",python:".py",java:".java",c:".c",cpp:".cpp","c++":".cpp","c#":".cs",ruby:".rb",php:".php",swift:".swift","objective-c":".m",kotlin:".kt",typescript:".ts",go:".go",perl:".pl",rust:".rs",scala:".scala",haskell:".hs",lua:".lua",shell:".sh",sql:".sql",html:".html",css:".css"},me=B,pe=r((({language:e,value:r})=>{const[o,n]=a(!1);return t.createElement("div",{className:"relative font-sans text-sm mt-1"},t.createElement("div",{className:"relative rounded-t-lg bg-zinc-800/80 font-sans text-sm backdrop-blur"},t.createElement("div",{className:"flex h-8 items-center justify-between px-3"},t.createElement("span",{className:"text-xs font-medium text-zinc-400"},e),t.createElement("div",{className:"flex gap-1"},t.createElement(te,{variant:"ghost",size:"icon",className:"size-5 text-zinc-400 hover:bg-zinc-700/50 hover:text-zinc-100",onClick:()=>{Z(void 0,void 0,void 0,(function*(){if(navigator.clipboard&&navigator.clipboard.writeText)try{yield navigator.clipboard.writeText(r),n(!0),setTimeout((()=>{n(!1)}),2e3)}catch(e){console.error("Failed to copy:",e)}}))}},o?t.createElement(l,{size:18}):t.createElement(c,{size:18})),t.createElement(te,{variant:"ghost",size:"icon",className:"size-5 text-zinc-400 hover:bg-zinc-700/50 hover:text-zinc-100",onClick:()=>{const t=de[e]||".file",a=`file-${((e,t=!1)=>{const r="ABCDEFGHJKLMNPQRSTUVWXY3456789";let a="";for(let t=0;t<e;t+=1)a+=r.charAt(Math.floor(30*Math.random()));return t?a.toLowerCase():a})(3,!0)}${t}`,o=new Blob([r],{type:"text/plain"}),n=URL.createObjectURL(o),i=document.createElement("a");i.download=a,i.href=n,i.style.display="none",document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(n)}},t.createElement(d,{size:18}))))),t.createElement("div",{className:"rounded-b-lg"},t.createElement(me,{language:e,style:Q,PreTag:"div",wrapLongLines:!0,customStyle:{margin:0,borderTopLeftRadius:0,borderTopRightRadius:0}},r)))}));pe.displayName="CodeBlock";const ue=e.forwardRef((({src:t,border:r,width:a="100%",height:o="400px",title:n},i)=>{const[s,l]=e.useState(!1);return e.useEffect((()=>{let e=!0;return setTimeout((()=>{e&&l(!0)}),0),()=>{e=!1}}),[]),e.createElement("div",{className:"overflow-hidden rounded-lg mt-4 "+(r?"border":""),style:{width:a,height:o}},s&&e.createElement(e.Fragment,null,e.createElement("iframe",{ref:i,src:t,sandbox:"allow-same-origin allow-scripts allow-popups allow-forms allow-downloads",width:a,height:o,frameBorder:"0",title:"embed",loading:"lazy",allowFullScreen:!0,className:"block rounded-lg"}),n&&e.createElement("span",{className:"block text-center text-sm font-medium"},n)))}));function he(t){const r=t.attrs.href.replace("share","embed");return e.createElement(ue,Object.assign({},t,{src:r,title:"Loom Embed"}))}function ge(t){return e.createElement(ue,Object.assign({},t,{src:t.attrs.href,title:"Supademo Embed"}))}function fe(t){return e.createElement(ue,Object.assign({},t,{src:t.attrs.href,title:"Typeform Embed"}))}function be(t){const r=t.attrs.href.match(/(http|https)?:\/\/(www\.)?vimeo\.com\/(?:channels\/(?:\w+\/)?|groups\/([^/]*)\/videos\/|)(\d+)(?:\/|\?)?([\d\w]+)?/);if(!r)return null;const a=r[4],o=r[5],n=`https://player.vimeo.com/video/${a}?byline=0${o?`&h=${o}`:""}`;return e.createElement(ue,Object.assign({},t,{src:n,title:`Vimeo Embed (${a})`,height:"412px",border:!1}))}function we(t){const r=(e=>{const t=[/^https?:\/\/([a-zA-Z0-9-_~]+)\.wistia\.com\/medias\/([a-zA-Z0-9-_~]+)\/?$/,/^https?:\/\/fast\.wistia\.com\/embed\/iframe\/([a-zA-Z0-9-_~]+)\/?$/,/^fast\.wistia\.com\/embed\/iframe\/([a-zA-Z0-9-_~]+)\/?$/,/^([a-zA-Z0-9-_~]+)\.wistia\.com\/medias\/([a-zA-Z0-9-_~]+)\/?$/];for(const r of t){const t=e.match(r);if(t)return t}return null})(t.attrs.href);if(!r)return null;const a=r[1],o=r[2]||r[1],n=a?`https://${a}.wistia.com/embed/iframe/${o}?seo=true&videoFoam=false`:`https://fast.wistia.com/embed/iframe/${o}`;return e.createElement(ue,Object.assign({},t,{src:n,border:!0,title:`Wistia Embed (${o})`}))}function ye(t){const r=(e=>{const t=e.match(/(?:https?:\/\/)?(?:www\.)?youtu\.?be(?:\.com)?\/?.*(?:watch|embed)?(?:.*v=|v\/|\/)([a-zA-Z0-9_-]{11})$/i);return t?t[1]:null})(t.attrs.href);return r?e.createElement(ue,Object.assign({},t,{src:`https://www.youtube.com/embed/${r}?modestbranding=1`,title:`YouTube Embed (${r})`})):null}he.isMatch=e=>/^https:\/\/(www\.)?(use)?loom\.com\/(embed|share)\/(.*)$/.test(e),ge.isMatch=e=>/^https:\/\/app\.supademo\.com\/embed\/(.*)$/.test(e),fe.isMatch=e=>/^https:\/\/([A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?)\.typeform\.com\/to\/(.*)$/.test(e),be.isMatch=e=>/^(https?):\/\/(www\.)?vimeo\.com\/(?:channels\/(?:\w+\/)?|groups\/([^/]*)\/videos\/|)?(\d+)(\/)?(?:\?.*|#.*)?$/i.test(e),we.isMatch=e=>[/^https?:\/\/([a-zA-Z0-9-_~]+)\.wistia\.com\/medias\/([a-zA-Z0-9-_~]+)(\/)?(\?.*)?$/i,/^https?:\/\/fast\.wistia\.com\/embed\/iframe\/([a-zA-Z0-9-_~]+)(\/)?(\?.*)?$/i,/^fast\.wistia\.com\/embed\/iframe\/([a-zA-Z0-9-_~]+)(\/)?(\?.*)?$/i,/^([a-zA-Z0-9-_~]+)\.wistia\.com\/medias\/([a-zA-Z0-9-_~]+)(\/)?(\?.*)?$/i].some((t=>t.test(e))),ye.isMatch=e=>/^(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/(?:watch\?v=|embed\/|v\/|shorts\/)|youtu\.be\/)([a-zA-Z0-9_-]{11})(?:\/|[?&].*)?$/i.test(e);const ve=[he,ge,fe,ye,we,be],xe=t=>{const{href:r}=t.attrs,[n,i]=a(null);if(o((()=>{let e=!0;return(()=>{try{const a=ve.find((e=>e.isMatch(r)));a&&e&&i({Component:a,props:t})}catch(e){console.error("Error finding embed match:",e)}})(),()=>{e=!1}}),[r,t]),n){const{Component:t,props:r}=n;return e.createElement(t,Object.assign({},r))}return null},ke=r(P,((e,t)=>e.children===t.children)),Ee=r((({message:e})=>(e.content=e.content.replace(/^\n+|(\n+|\\)+$/g,""),t.createElement(ke,{className:"dark:prose-invert prose flex-1",remarkPlugins:[U],rehypePlugins:[F],components:{code(e){var{inline:r,className:a,children:o}=e,n=W(e,["inline","className","children"]);const i=/language-(\w+)/.exec(a||""),s=i&&i[1];return!r&&s?t.createElement(pe,Object.assign({key:Math.random(),language:s,value:String(o).replace(/\n$/,"")},n)):t.createElement("code",Object.assign({className:`text-red-400 bg-slate-200 border-slate-300 border rounded p-0.5 ${a}`.trim()},n),o)},marker:({children:e})=>t.createElement("div",{className:"my-2"},t.createElement("span",{className:"highlight"},e)),table:({children:e})=>t.createElement("table",{className:"border-collapse border border-black px-3 py-1 dark:border-white"},e),th:({children:e})=>t.createElement("th",{className:"break-words border border-black bg-gray-500 px-3 py-1 text-white dark:border-white"},e),td:({children:e})=>t.createElement("td",{className:"break-words border border-black px-3 py-1 dark:border-white"},e),a(e){var{children:r}=e,a=W(e,["children"]);if(a.href){const e=xe({attrs:{href:a.href}});if(t.isValidElement(e))return e}return t.createElement("a",Object.assign({className:"link",target:"_blank",rel:"noopener noreferrer"},a),r)},pre:({children:e})=>t.createElement(t.Fragment,null,e),img({src:e,alt:r}){const a=xe({attrs:{href:null!=e?e:""}});return t.isValidElement(a)?a:t.createElement("img",{src:e,alt:r,className:"w-full"})},li:e=>{var{children:r}=e,a=W(e,["children"]);return t.createElement("li",Object.assign({className:"py-1"},a),r)},ul:({children:e})=>t.createElement("ul",{className:"ml-4 list-outside list-disc"},e),ol:({children:e})=>t.createElement("ol",{className:"ml-4 list-outside list-decimal"},e),strong:e=>{var{children:r}=e,a=W(e,["children"]);return t.createElement("span",Object.assign({className:"font-semibold"},a),r)},h1:e=>{var{children:r}=e,a=W(e,["children"]);return t.createElement("h1",Object.assign({className:"mb-2 mt-6 text-3xl font-semibold"},a),r)},h2:e=>{var{children:r}=e,a=W(e,["children"]);return t.createElement("h2",Object.assign({className:"mb-2 mt-6 text-2xl font-semibold"},a),r)},h3:e=>{var{children:r}=e,a=W(e,["children"]);return t.createElement("h3",Object.assign({className:"mb-2 mt-6 text-xl font-semibold"},a),r)},h4:e=>{var{children:r}=e,a=W(e,["children"]);return t.createElement("h4",Object.assign({className:"mb-2 mt-6 text-lg font-semibold"},a),r)},h5:e=>{var{children:r}=e,a=W(e,["children"]);return t.createElement("h5",Object.assign({className:"mb-2 mt-6 text-base font-semibold"},a),r)},h6:e=>{var{children:r}=e,a=W(e,["children"]);return t.createElement("h6",Object.assign({className:"mb-2 mt-6 text-sm font-semibold"},a),r)}}},e.content)))),Ne=q.Provider,Ce=q.Root,je=q.Trigger,ze=e.forwardRef(((t,r)=>{var{className:a,sideOffset:o=4}=t,n=W(t,["className","sideOffset"]);return e.createElement(q.Portal,null,e.createElement(q.Content,Object.assign({ref:r,sideOffset:o,className:G("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",a)},n)))}));function Oe({answer:e,question:r,theme:o,searchResults:n,followUpQuestions:i,onFollowUpClick:s,isStreaming:l=!1,searchQueryId:c,feedback:d,onFeedback:w,disableFeedback:y=!1,textConfig:v={}}){const[x,k]=a(!1),[E,N]=a(!1),C=()=>Z(this,void 0,void 0,(function*(){try{yield navigator.clipboard.writeText(e),k(!0),setTimeout((()=>k(!1)),2e3)}catch(e){console.error("Failed to copy text:",e)}})),j=e=>{w&&c&&w(e)};return t.createElement("div",{className:"rounded-lg p-6",style:{backgroundColor:o.cardBackground,borderColor:o.border,borderWidth:"1px",borderStyle:"solid"}},t.createElement("div",{className:"flex items-start justify-between"},t.createElement("div",{className:"flex items-center gap-2 mb-4"},t.createElement(le,{loading:l,color:o.primary}),t.createElement("h2",{className:"text-xl",style:{color:o.text}},r)),t.createElement(Ne,null,t.createElement(Ce,null,t.createElement(je,{asChild:!0},t.createElement("button",{onClick:()=>{C()},className:"flex items-center justify-center w-8 h-8 rounded-md hover:bg-gray-100 transition-colors duration-200"},x?t.createElement(m,{className:"h-4 w-4 text-green-500"}):t.createElement(p,{className:"h-4 w-4 text-gray-500"}))),t.createElement(ze,null,t.createElement("p",null,x?"Copied!":"Copy"))))),e&&t.createElement("div",{className:"prose prose-sm max-w-none",style:{color:o.text}},t.createElement(Ee,{message:{content:e}})),e&&!l&&!y&&t.createElement("div",{className:"mt-2 flex justify-end gap-2"},t.createElement(Ne,null,t.createElement(Ce,null,t.createElement(je,{asChild:!0},t.createElement(te,{variant:"ghost",size:"sm",className:"rounded-md h-8 w-8 flex items-center justify-center "+("accept"===d?"bg-green-100 text-green-600":""),onClick:()=>j("accept"),disabled:Boolean(d)},t.createElement(u,{className:"h-4 w-4"}))),t.createElement(ze,null,t.createElement("p",null,v.positiveAnswerText||"Helpful")))),t.createElement(Ne,null,t.createElement(Ce,null,t.createElement(je,{asChild:!0},t.createElement(te,{variant:"ghost",size:"sm",className:"rounded-md h-8 w-8 flex items-center justify-center "+("reject"===d?"bg-red-100 text-red-600":""),onClick:()=>j("reject"),disabled:Boolean(d)},t.createElement(h,{className:"h-4 w-4"}))),t.createElement(ze,null,t.createElement("p",null,v.negativeAnswerText||"Not helpful"))))),e&&i&&i.length>0&&t.createElement("div",{className:"mt-6 space-y-3"},t.createElement("div",{className:"text-sm font-medium",style:{color:o.text}},"Follow-up Questions"),t.createElement("div",{className:"flex flex-wrap gap-2"},i.map(((e,r)=>t.createElement("button",{key:r,onClick:()=>null==s?void 0:s(e),className:"px-3 py-1.5 rounded-lg text-sm transition-all duration-200 hover:opacity-90",style:{backgroundColor:`${o.accent}30`,color:o.text,border:`1px solid ${o.border}`}},e))))),n&&n.length>0&&t.createElement("div",{className:"mt-6 rounded-lg overflow-hidden",style:{backgroundColor:o.surface,borderWidth:"1px",borderStyle:"solid",borderColor:o.border}},t.createElement("button",{onClick:()=>N(!E),className:"w-full flex items-center justify-between p-3 transition-all duration-200 hover:bg-opacity-50",style:{color:o.text,borderBottom:E?`1px solid ${o.surfaceBorder}`:"none"}},t.createElement("div",{className:"flex items-center gap-2"},t.createElement(g,{className:"h-4 w-4",style:{color:o.primary}}),t.createElement("span",{className:"font-medium"},"Related Articles (",n.length,")")),t.createElement(f,{className:"h-4 w-4 transition-transform duration-200 "+(E?"rotate-180":""),style:{color:o.text}})),t.createElement("div",{className:"overflow-hidden transition-all duration-200 ease-in-out",style:{maxHeight:E?48*n.length+"px":"0",opacity:E?1:0,transform:`translateY(${E?"0":"-10px"})`}},t.createElement("div",{className:"divide-y divide-gray-200"},n.map((e=>t.createElement("a",{key:e.id,href:e.url,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 p-3 transition-colors duration-200 hover:bg-gray-50",style:{color:o.text,backgroundColor:o.surface}},t.createElement(g,{className:"h-4 w-4",style:{color:o.primary}}),t.createElement("span",{className:"flex-grow"},e.title),t.createElement(b,{className:"h-4 w-4",style:{color:`${o.text}60`}}))))))),!e&&t.createElement("div",{className:"animate-pulse space-y-4"},t.createElement("div",{className:"h-4 rounded w-full",style:{backgroundColor:`${o.border}40`}}),t.createElement("div",{className:"h-4 rounded w-3/4",style:{backgroundColor:`${o.border}40`}})))}function Se({questions:e,currentIndex:r,activeIndex:a,onNavigate:o,theme:n,offset:i}){return t.createElement(j.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{duration:.5},className:"fixed left-4 top-1/2 -translate-y-1/2 z-50 flex flex-col gap-2",style:Object.assign({},i?{left:`${i}px`}:{})},e.map(((e,i)=>t.createElement("div",{key:i,className:"relative group"},t.createElement("button",{onClick:()=>o(i),className:"flex items-center justify-center w-8 h-8 rounded-full transition-all duration-200 "+(i<=r?"hover:opacity-90":""),style:{backgroundColor:i===a?n.primary:"#ccc",color:i===a?n.background:"#333",opacity:i>r?.5:1,cursor:"pointer"}},i+1),t.createElement("div",{className:"absolute left-12 top-0 px-3 py-2 rounded-lg whitespace-normal opacity-0 group-hover:opacity-100 w-48 text-sm transition-opacity duration-200",style:{backgroundColor:n.background,color:n.text,borderColor:n.border,borderWidth:"1px",borderStyle:"solid",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1)"}},e,t.createElement("div",{className:"absolute left-0 top-3 -translate-x-1 w-2 h-2 rotate-45",style:{backgroundColor:n.background,borderLeft:`1px solid ${n.border}`,borderBottom:`1px solid ${n.border}`}}))))))}function Ie({onClick:e,theme:r}){return t.createElement(te,{className:"fixed bottom-20 right-4 rounded-full p-2 transition-opacity duration-300",style:{backgroundColor:r.background,borderColor:r.border,borderWidth:"1px",borderStyle:"solid",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1)"},onClick:e},t.createElement(w,{className:"h-5 w-5",style:{color:r.text}}))}function Le({endpoint:e,query:t,collectionId:r,headers:a,conversationId:o}){var n;return Z(this,void 0,void 0,(function*(){try{const i=yield fetch(e,{method:"POST",headers:Object.assign({"Content-Type":"application/json"},a),body:JSON.stringify(Object.assign(Object.assign({query:t,limit:5},r&&"all"!==r&&{collectionId:r}),o&&{conversationId:o}))});if(!i.ok)throw new Error("Failed to fetch search results");const s=yield i.json();return{results:null==s?void 0:s.data,searchQueryId:null===(n=null==s?void 0:s.searchQuery)||void 0===n?void 0:n.id}}catch(e){throw console.error("Error searching:",e),e}}))}function Re({endpoint:e,searchQueryId:t,headers:r,conversationId:a}){return Z(this,void 0,void 0,(function*(){try{const o=yield fetch(e,{method:"POST",headers:Object.assign({"Content-Type":"application/json"},r),body:JSON.stringify(Object.assign({searchQueryId:t},a&&{conversationId:a}))});if(!o.ok)throw new Error("Failed to fetch answer");return o}catch(e){throw console.error("Error fetching answer:",e),e}}))}function Te(){return`bf-conversation-${Date.now()}-${"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(e=>{const t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))}`}function Ae({endpoint:e,conversationId:t,headers:r}){return Z(this,void 0,void 0,(function*(){try{const a=yield fetch(e,{method:"POST",headers:Object.assign({"Content-Type":"application/json"},r),body:JSON.stringify({conversationId:t})});if(!a.ok)throw new Error("Failed to load conversation");const o=yield a.json();return{data:o.data.map((e=>Object.assign(Object.assign({},e),{feedback:e.feedback?"positive"===e.feedback?"accept":"reject":void 0})))}}catch(e){throw console.error("Error loading conversation:",e),e}}))}ze.displayName=q.Content.displayName;const $e={primary:"#A3E635",accent:"#f9fafb",background:"white",text:"#171717",border:"#171717",hover:"#171717",surface:"#F9FAFB",surfaceBorder:"#E5E7EB",surfaceHover:"#F3F4F6",cardBackground:"white"},_e={headerText:"How can we help you today?",searchPlaceholder:"Ask a question or type a search term here ...",attachImageText:"Attach image",allDocumentsText:"All documents",loadingSearchText:"Searching for relevant content...",loadingAnswerText:"Crafting a response...",errorText:"Sorry, there was an error generating the answer.",followUpPlaceholder:"Ask follow-up",positiveAnswerText:"Helpful",negativeAnswerText:"Not helpful"},Fe=n((({suggestions:e,theme:r={},collections:n=[],selectedCollectionId:l,onCollectionChange:c,searchEndpoint:d,answerEndpoint:m,feedbackEndpoint:p,loadConversationEndpoint:u,disableFollowUpQuestions:h=!1,disableImageAttachment:g=!1,disableFeedback:b=!1,siblingNode:w,offset:O=0,headers:S,textConfig:I={}},L)=>{var R;const T=Object.assign(Object.assign({},$e),r),A=Object.assign(Object.assign({},_e),I),[$,_]=a(""),[F,U]=a(""),[B,Q]=a(!1),[P,q]=a(!1),[M,W]=a([]),[H,Y]=a(!1),[D,V]=a(0),[J,X]=a([]),[K,G]=a(l),[ee,se]=a(!0),[le,de]=a(""),[me,pe]=a(!1),[ue,he]=a(),ge=i(null),fe=i(null),be=i([]),we=i(null),ye=i(null),ve=i([]);o((()=>{const e=new URLSearchParams(window.location.search).get("conversation");if(e&&u)pe(!0),q(!0),Ae({endpoint:u,conversationId:e,headers:S}).then((t=>{W(t.data),de(e),q(!0)})).catch((e=>{console.error("Error loading conversation:",e),he(A.errorText||"An error occurred"),q(!1),W([]);const t=Te();de(t);const r=new URL(window.location.href);r.searchParams.delete("conversation"),window.history.replaceState({},"",r.toString())})).finally((()=>{pe(!1)}));else{const e=Te();de(e)}}),[u]),o((()=>{if(le&&M.length>0){const e=new URL(window.location.href);e.searchParams.set("conversation",le),window.history.replaceState({},"",e.toString())}}),[le,M.length]),o((()=>{const e={showResults:P,answers:M,isLoading:me,error:ue};ve.current.forEach((t=>t(e)))}),[P,M,me,ue]),s(L,(()=>({createNewThread:()=>{_(""),U(""),q(!1),W([]),V(0),X([]);const e=Te();de(e);const t=new URL(window.location.href);t.searchParams.delete("conversation"),window.history.replaceState({},"",t.toString()),ge.current&&(ge.current.style.height="auto")},showFollowUpThread:e=>{se(e)},subscribeToStateChanges:e=>(ve.current.push(e),e({showResults:P,answers:M,isLoading:!1,error:void 0}),()=>{ve.current=ve.current.filter((t=>t!==e))})}))),o((()=>{G(l)}),[l]);const xe=e=>{e.style.height="auto",e.style.height=`${e.scrollHeight}px`},ke=()=>{requestAnimationFrame((()=>{const e=be.current[be.current.length-1],t=we.current;if(e&&t){const r=t.getBoundingClientRect(),a=e.getBoundingClientRect().top-r.top-80;t.scrollBy({top:a,behavior:"smooth"})}}))},Ee=e=>Z(void 0,void 0,void 0,(function*(){var t;const r=null===(t=e.body)||void 0===t?void 0:t.getReader();if(!r)return;W((e=>{const t=[...e],r=t[t.length-1];return r&&(r.isLoading=!1,r.isStreaming=!0),t}));let a="";try{let e,t;for(;({done:e,value:t}=yield r.read()),!e;){const e=(new TextDecoder).decode(t);a+=e,W((e=>{const t=[...e],r=t[t.length-1];return r&&(r.answer=a),t}))}}finally{W((e=>{const t=[...e],r=t[t.length-1];return r&&(r.isStreaming=!1),t})),r.releaseLock()}})),Ne=(e,t,r)=>Z(void 0,void 0,void 0,(function*(){if(p)try{yield function({endpoint:e,searchQueryId:t,response:r,headers:a,conversationId:o}){return Z(this,void 0,void 0,(function*(){try{if(!(yield fetch(e,{method:"POST",headers:Object.assign({"Content-Type":"application/json"},a),body:JSON.stringify(Object.assign({searchQueryId:t,response:r},o&&{conversationId:o}))})).ok)throw new Error("Failed to send feedback")}catch(e){throw console.error("Error sending feedback:",e),e}}))}({endpoint:p,searchQueryId:t,response:e,headers:S,conversationId:le}),W((t=>{const a=[...t];return a[r]&&(a[r]=Object.assign(Object.assign({},a[r]),{feedback:e})),a}))}catch(e){console.error("Error sending feedback:",e)}})),Ce=()=>Z(void 0,void 0,void 0,(function*(){if($.trim()){if(Q(!0),q(!0),!le){const e=Te();de(e)}W((e=>{const t=[...e,{question:$,answer:"",isLoading:!0,isSearchLoading:!0}];return V(t.length-1),t})),ke();try{const e=yield Le({endpoint:d,query:$,collectionId:K,headers:S,conversationId:le}),t=e.results,r=e.searchQueryId;W((e=>{const a=[...e];return a[a.length-1]=Object.assign(Object.assign({},a[a.length-1]),{searchResults:t,searchQueryId:r,isSearchLoading:!1}),a}));const a=yield Re({endpoint:m,searchQueryId:r,headers:S,conversationId:le});yield Ee(a)}catch(e){console.error("Error generating answer:",e),W((e=>{const t=[...e];return t[t.length-1]=Object.assign(Object.assign({},t[t.length-1]),{answer:A.errorText||"An error occurred",isLoading:!1,isSearchLoading:!1}),t}))}finally{Q(!1)}}})),je=()=>Z(void 0,void 0,void 0,(function*(){if(F.trim()){const e=F;_(e),U(""),Q(!0),W((t=>{const r=[...t,{question:e,answer:"",isLoading:!0,isSearchLoading:!0}];return V(r.length-1),r})),ke();try{const t=yield Le({endpoint:d,query:e,collectionId:K,headers:S,conversationId:le}),r=t.results,a=t.searchQueryId;W((e=>{const t=[...e];return t[t.length-1]=Object.assign(Object.assign({},t[t.length-1]),{searchResults:r,searchQueryId:a,isSearchLoading:!1}),t}));const o=yield Re({endpoint:m,searchQueryId:a,headers:S,conversationId:le});yield Ee(o)}catch(e){console.error("Error generating answer:",e),W((e=>{const t=[...e];return t[t.length-1]=Object.assign(Object.assign({},t[t.length-1]),{answer:A.errorText||"An error occurred",isLoading:!1,isSearchLoading:!1}),t}))}finally{Q(!1)}}}));o((()=>{const e=we.current;if(!e)return;const t=()=>{const{scrollTop:t,scrollHeight:r,clientHeight:a}=e;Y(!(r-t-a<100))};return e.addEventListener("scroll",t),()=>e.removeEventListener("scroll",t)}),[]),o((()=>()=>{J.forEach((e=>URL.revokeObjectURL(e.preview)))}),[J]);return o((()=>{if(P)return document.body.style.overflow="hidden",()=>{document.body.style.overflow="unset"}}),[P]),t.createElement("div",{className:"relative min-h-screen overflow-hidden"},t.createElement("div",{ref:we,className:"w-full max-w-3xl mx-auto flex flex-col items-center space-y-8 px-4 py-20 h-screen overflow-y-auto relative elegant-scrollbar",style:{height:"100vh",maxHeight:"100vh",overflowY:"auto",WebkitOverflowScrolling:"touch","--surface-border":T.surfaceBorder,"--surface-hover":T.surfaceHover}},t.createElement(z,null,me?t.createElement(j.div,{key:"loading",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"w-full flex items-center justify-center py-20"},t.createElement("div",{className:"flex flex-col items-center gap-4"},t.createElement("div",{className:"animate-spin rounded-full h-8 w-8 border-2 border-t-transparent",style:{borderColor:T.primary}}),t.createElement("p",{className:"text-sm",style:{color:T.text}},"Loading conversation..."))):P?t.createElement(j.div,{key:"results",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.5},className:"w-full space-y-8 py-4 mb-20"},M.map(((e,r)=>t.createElement(j.div,{key:r,ref:e=>be.current[r]=e,initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5,delay:.1*r}},e.isLoading?t.createElement(ce,{theme:T,loadingText:e.isSearchLoading?A.loadingSearchText:A.loadingAnswerText}):t.createElement(Oe,{answer:e.answer,question:e.question,theme:T,searchResults:e.searchResults,followUpQuestions:h?void 0:e.followUpQuestions,onFollowUpClick:h?void 0:e=>{U(e),je()},isStreaming:e.isStreaming,searchQueryId:e.searchQueryId,feedback:e.feedback,onFeedback:b||!p?void 0:t=>Ne(t,e.searchQueryId,r),disableFeedback:b||!p,textConfig:A}))))):t.createElement(j.div,{key:"search",initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},transition:{duration:.5},className:"w-full space-y-8"},t.createElement("div",{className:"w-full text-center space-y-4"},t.createElement(j.h1,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5,delay:.3},className:"text-5xl font-bold",style:{color:T.text}},A.headerText)),t.createElement(j.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5,delay:.4}},t.createElement("div",{className:"relative w-full rounded-md overflow-hidden",style:{backgroundColor:T.background,borderColor:T.border,borderWidth:"1px",borderStyle:"solid"}},t.createElement("div",{className:"p-3 flex items-center"},t.createElement(y,{className:"h-5 w-5 text-gray-400 mr-2"}),t.createElement("textarea",{ref:ge,placeholder:A.searchPlaceholder,value:$,onChange:e=>{_(e.target.value),xe(e.target)},onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),Ce())},className:"w-full resize-none outline-none text-lg py-1 font-light min-h-[36px] overflow-hidden placeholder:text-gray-400 border-none bg-transparent",style:{color:T.text,outline:"none",boxShadow:"none",fontSize:"16px"},rows:1})),!g&&J.length>0&&t.createElement("div",{className:"flex gap-2 mt-3 overflow-x-auto pb-1 px-3"},J.map(((e,r)=>t.createElement("div",{key:r,className:"relative group rounded-lg overflow-hidden flex-shrink-0",style:{width:"80px",height:"80px"}},t.createElement("img",{src:e.preview,alt:`Attached ${r+1}`,className:"w-full h-full object-cover"}),t.createElement("button",{onClick:()=>(e=>{X((t=>(URL.revokeObjectURL(t[e].preview),t.filter(((t,r)=>r!==e)))))})(r),className:"absolute top-1 right-1 bg-black bg-opacity-50 rounded-full p-1 opacity-0 group-hover:opacity-100 transition-opacity duration-200"},t.createElement(v,{className:"h-3 w-3 text-white"})))))),t.createElement("div",{className:"flex items-center justify-between px-3 py-2 bg-gray-100 border-t border-gray-200"},t.createElement("div",{className:"flex gap-2"},n.length>0&&t.createElement(re,null,t.createElement(ae,{asChild:!0},t.createElement(te,{variant:"ghost",size:"sm",className:"hover:bg-gray-200 transition-all duration-200 rounded-md h-8 flex items-center gap-2 text-gray-700"},K&&"all"!==K?t.createElement(x,{className:"h-5 w-5 text-green-500"}):t.createElement(k,{className:"h-5 w-5 text-gray-400"}),(null===(R=n.find((e=>e.id===K)))||void 0===R?void 0:R.name)||A.allDocumentsText,t.createElement(f,{className:"h-4 w-4 opacity-50"}))),t.createElement(oe,null,n.map((e=>t.createElement(ne,{key:e.id,onClick:()=>{return t=e.id,G(t),void(null==c||c(t));var t},className:e.id===K?"bg-gray-100":""},e.id===K?t.createElement(x,{className:"h-4 w-4 mr-2 text-green-500"}):t.createElement(k,{className:"h-4 w-4 mr-2 text-gray-400"}),e.name))))),!g&&t.createElement(t.Fragment,null,t.createElement("input",{type:"file",ref:ye,accept:"image/*",multiple:!0,className:"hidden",onChange:e=>{const t=e.target.files;if(t){const e=Array.from(t).map((e=>({file:e,preview:URL.createObjectURL(e)})));X((t=>[...t,...e]))}ye.current&&(ye.current.value="")}}),t.createElement(te,{variant:"ghost",size:"sm",className:"hover:bg-gray-200 rounded-md h-8 text-gray-700",onClick:()=>{var e;return null===(e=ye.current)||void 0===e?void 0:e.click()}},t.createElement(E,{className:"h-4 w-4 mr-1.5"}),A.attachImageText))),t.createElement("div",{className:"flex items-center"},t.createElement(te,{size:"sm",disabled:!$||B,className:"rounded-md h-8 w-8 bg-[#86efac] hover:bg-[#86efac]/90 disabled:opacity-50",onClick:()=>{Ce()}},B?t.createElement("div",{className:"animate-spin rounded-full h-4 w-4 border-2 border-t-transparent",style:{borderColor:"white"}}):t.createElement(N,{className:"h-4 w-4 text-gray-700"})))))),t.createElement(ie,{suggestions:e||[],onQuestionClick:e=>{if(e.conversationId&&u)return pe(!0),q(!0),void Ae({endpoint:u,conversationId:e.conversationId,headers:S}).then((t=>{W(t.data),de(e.conversationId),q(!0)})).catch((e=>{console.error("Error loading conversation:",e),he(A.errorText||"An error occurred"),q(!1),W([]);const t=Te();de(t);const r=new URL(window.location.href);r.searchParams.delete("conversation"),window.history.replaceState({},"",r.toString())})).finally((()=>{pe(!1)}));if(q(!0),Q(!0),!le){const e=Te();de(e)}W((t=>[...t,{question:e.question,answer:"",isLoading:!0,isSearchLoading:!0}])),Z(void 0,void 0,void 0,(function*(){try{const t=yield Le({endpoint:d,query:e.question,collectionId:K,headers:S,conversationId:le}),r=t.results;W((e=>{const a=[...e];return a[a.length-1]=Object.assign(Object.assign({},a[a.length-1]),{searchResults:r,searchQueryId:t.searchQueryId,isSearchLoading:!1}),a}));const a=yield Re({endpoint:m,searchQueryId:t.searchQueryId,headers:S,conversationId:le});yield Ee(a)}catch(e){console.error("Error generating answer:",e),W((e=>{const t=[...e];return t[t.length-1]=Object.assign(Object.assign({},t[t.length-1]),{answer:A.errorText||"An error occurred",isLoading:!1,isSearchLoading:!1}),t}))}finally{Q(!1),ke()}}))},borderColor:T.border,title:A.suggestionsTitle}),w)),P&&M.length>1&&t.createElement("div",{className:"hidden sm:block"},t.createElement(Se,{questions:M.map((e=>e.question)),currentIndex:B?M.length-1:D,activeIndex:D,onNavigate:e=>{V(e),(e=>{requestAnimationFrame((()=>{const t=be.current[e],r=we.current;if(t&&r){const e=r.getBoundingClientRect(),a=t.getBoundingClientRect().top-e.top-80;r.scrollBy({top:a,behavior:"smooth"})}}))})(e)},theme:T,offset:O})),P&&ee&&t.createElement(j.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5},className:"fixed bottom-4 left-4 right-4 max-w-3xl mx-auto z-10",style:{left:`${O}px`}},t.createElement("div",{className:"rounded-full h-[44px] sm:h-[52px] flex items-center justify-between",style:{backgroundColor:T.background,borderColor:T.border,borderWidth:"1px",borderStyle:"solid",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1)",padding:"0 14px"}},t.createElement("div",{className:"flex items-center gap-2 sm:gap-3 flex-grow overflow-hidden h-full"},t.createElement(y,{className:"h-4 w-4 sm:h-5 sm:w-5 flex-shrink-0",style:{color:T.primary}}),t.createElement("textarea",{ref:fe,placeholder:A.followUpPlaceholder,value:F,onChange:e=>{U(e.target.value),xe(e.target)},onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),je())},disabled:B,className:"w-full bg-transparent outline-none text-sm sm:text-base resize-none overflow-hidden disabled:opacity-50 border-none h-full py-3 placeholder:text-sm sm:placeholder:text-base",style:{color:T.text,outline:"none",boxShadow:"none",fontSize:"16px"},rows:1})),t.createElement("div",{className:"flex items-center gap-2 sm:gap-3 ml-2 sm:ml-3 flex-shrink-0"},t.createElement(te,{size:"icon",variant:"ghost",disabled:B||!F.trim(),className:"rounded-full transition-colors duration-200 disabled:opacity-50 h-8 w-8 sm:h-9 sm:w-9 flex items-center justify-center",style:{color:T.text,backgroundColor:"transparent"},onClick:()=>{je()}},B?t.createElement("div",{className:"animate-spin rounded-full h-4 w-4 sm:h-5 sm:w-5 border-2",style:{borderColor:`${T.text}40`,borderTopColor:T.text}}):t.createElement(C,{className:"h-4 w-4 sm:h-5 sm:w-5"}))))),H&&P&&t.createElement(Ie,{onClick:ke,theme:T})))}));Fe.displayName="ChatSearch";export{Fe as ChatSearch};
1
+ import*as e from"react";import t,{memo as r,useState as a,useEffect as o,forwardRef as n,useRef as i,useImperativeHandle as s}from"react";import{CheckCircle as l,Clipboard as c,Download as d,Check as m,Copy as p,ThumbsUp as u,ThumbsDown as g,FileText as h,ChevronDown as b,ExternalLink as f,ArrowDown as w,Search as y,X as v,CheckCircle2 as x,Circle as k,Image as E,ArrowRight as N,ArrowUp as C}from"lucide-react";import{motion as j,AnimatePresence as z}from"framer-motion";import{jsx as O,Fragment as S}from"react/jsx-runtime";import{cva as I}from"class-variance-authority";import{clsx as L}from"clsx";import{twMerge as R}from"tailwind-merge";import*as T from"@radix-ui/react-dropdown-menu";import{ChevronRightIcon as A,CheckIcon as $,DotFilledIcon as _}from"@radix-ui/react-icons";import*as F from"@radix-ui/react-tooltip";import U from"rehype-raw";import B from"remark-gfm";import{Prism as Q}from"react-syntax-highlighter";import{a11yDark as P}from"react-syntax-highlighter/dist/cjs/styles/prism";import q from"react-markdown";function M(e,t){void 0===t&&(t={});var r=t.insertAt;if(e&&"undefined"!=typeof document){var a=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===r&&a.firstChild?a.insertBefore(o,a.firstChild):a.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}function W(e,t){var r={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(r[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(a=Object.getOwnPropertySymbols(e);o<a.length;o++)t.indexOf(a[o])<0&&Object.prototype.propertyIsEnumerable.call(e,a[o])&&(r[a[o]]=e[a[o]])}return r}function Z(e,t,r,a){return new(r||(r=Promise))((function(o,n){function i(e){try{l(a.next(e))}catch(e){n(e)}}function s(e){try{l(a.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,s)}l((a=a.apply(e,t||[])).next())}))}function H(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function Y(...e){return t=>{let r=!1;const a=e.map((e=>{const a=H(e,t);return r||"function"!=typeof a||(r=!0),a}));if(r)return()=>{for(let t=0;t<a.length;t++){const r=a[t];"function"==typeof r?r():H(e[t],null)}}}}M('/*! tailwindcss v3.3.5 | MIT License | https://tailwindcss.com*/*,:after,:before{border:0 solid #e5e7eb;box-sizing:border-box}:after,:before{--tw-content:""}html{-webkit-text-size-adjust:100%;font-feature-settings:normal;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{color:#9ca3af;opacity:1}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]{display:none}:root{--background:0 0% 100%;--foreground:0 0% 3.9%;--card:0 0% 100%;--card-foreground:0 0% 3.9%;--popover:0 0% 100%;--popover-foreground:0 0% 3.9%;--primary:0 0% 9%;--primary-foreground:0 0% 98%;--secondary:0 0% 96.1%;--secondary-foreground:0 0% 9%;--muted:0 0% 96.1%;--muted-foreground:0 0% 45.1%;--accent:0 0% 96.1%;--accent-foreground:0 0% 9%;--destructive:0 84.2% 60.2%;--destructive-foreground:0 0% 98%;--border:0 0% 89.8%;--input:0 0% 89.8%;--ring:0 0% 3.9%;--radius:0.5rem}.dark{--background:0 0% 3.9%;--foreground:0 0% 98%;--card:0 0% 3.9%;--card-foreground:0 0% 98%;--popover:0 0% 3.9%;--popover-foreground:0 0% 98%;--primary:0 0% 98%;--primary-foreground:0 0% 9%;--secondary:0 0% 14.9%;--secondary-foreground:0 0% 98%;--muted:0 0% 14.9%;--muted-foreground:0 0% 63.9%;--accent:0 0% 14.9%;--accent-foreground:0 0% 98%;--destructive:0 62.8% 30.6%;--destructive-foreground:0 0% 98%;--border:0 0% 14.9%;--input:0 0% 14.9%;--ring:0 0% 83.1%}*{border-color:hsl(var(--border))}body{background-color:hsl(var(--background));color:hsl(var(--foreground))}*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.\\!container{margin-left:auto!important;margin-right:auto!important;padding-left:2rem!important;padding-right:2rem!important;width:100%!important}.container{margin-left:auto;margin-right:auto;padding-left:2rem;padding-right:2rem;width:100%}@media (min-width:1400px){.\\!container{max-width:1400px!important}.container{max-width:1400px}}.pointer-events-none{pointer-events:none}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.bottom-20{bottom:5rem}.bottom-4{bottom:1rem}.left-0{left:0}.left-12{left:3rem}.left-2{left:.5rem}.left-4{left:1rem}.right-1{right:.25rem}.right-4{right:1rem}.top-0{top:0}.top-1{top:.25rem}.top-1\\/2{top:50%}.top-3{top:.75rem}.z-10{z-index:10}.z-50{z-index:50}.-mx-1{margin-left:-.25rem;margin-right:-.25rem}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-bottom:.25rem;margin-top:.25rem}.my-2{margin-top:.5rem}.mb-2,.my-2{margin-bottom:.5rem}.mb-20{margin-bottom:5rem}.mb-4{margin-bottom:1rem}.ml-2{margin-left:.5rem}.ml-4{margin-left:1rem}.ml-auto{margin-left:auto}.mr-1{margin-right:.25rem}.mr-1\\.5{margin-right:.375rem}.mr-2{margin-right:.5rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.mt-\\[-5px\\]{margin-top:-5px}.block{display:block}.inline-block{display:inline-block}.\\!inline{display:inline!important}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.hidden{display:none}.h-10{height:2.5rem}.h-2{height:.5rem}.h-3{height:.75rem}.h-3\\.5{height:.875rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-\\[44px\\]{height:44px}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.min-h-\\[36px\\]{min-height:36px}.min-h-screen{min-height:100vh}.w-2{width:.5rem}.w-3{width:.75rem}.w-3\\.5{width:.875rem}.w-3\\/4{width:75%}.w-4{width:1rem}.w-48{width:12rem}.w-5{width:1.25rem}.w-8{width:2rem}.w-9{width:2.25rem}.w-full{width:100%}.min-w-\\[20px\\]{min-width:20px}.min-w-\\[8rem\\]{min-width:8rem}.max-w-3xl{max-width:48rem}.max-w-none{max-width:none}.flex-1{flex:1 1 0%}.flex-shrink-0,.shrink-0{flex-shrink:0}.flex-grow{flex-grow:1}.border-collapse{border-collapse:collapse}.-translate-x-1{--tw-translate-x:-0.25rem}.-translate-x-1,.-translate-y-1\\/2{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\\/2{--tw-translate-y:-50%}.rotate-180{--tw-rotate:180deg}.rotate-180,.rotate-45{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-45{--tw-rotate:45deg}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(1turn)}}.animate-spin{animation:spin 1s linear infinite}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize-none{resize:none}.list-outside{list-style-position:outside}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-4{gap:1rem}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(.75rem*var(--tw-space-y-reverse));margin-top:calc(.75rem*(1 - var(--tw-space-y-reverse)))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(1rem*var(--tw-space-y-reverse));margin-top:calc(1rem*(1 - var(--tw-space-y-reverse)))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(1.5rem*var(--tw-space-y-reverse));margin-top:calc(1.5rem*(1 - var(--tw-space-y-reverse)))}.space-y-8>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(2rem*var(--tw-space-y-reverse));margin-top:calc(2rem*(1 - var(--tw-space-y-reverse)))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse:0;border-bottom-width:calc(1px*var(--tw-divide-y-reverse));border-top-width:calc(1px*(1 - var(--tw-divide-y-reverse)))}.divide-gray-200>:not([hidden])~:not([hidden]){--tw-divide-opacity:1;border-color:rgb(229 231 235/var(--tw-divide-opacity))}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.whitespace-normal{white-space:normal}.whitespace-nowrap{white-space:nowrap}.break-words{overflow-wrap:break-word}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:.75rem}.rounded-b-lg{border-bottom-left-radius:var(--radius);border-bottom-right-radius:var(--radius)}.rounded-t-lg{border-top-left-radius:var(--radius);border-top-right-radius:var(--radius)}.border{border-width:1px}.border-2{border-width:2px}.border-t{border-top-width:1px}.border-none{border-style:none}.border-black{--tw-border-opacity:1;border-color:rgb(0 0 0/var(--tw-border-opacity))}.border-gray-200{--tw-border-opacity:1;border-color:rgb(229 231 235/var(--tw-border-opacity))}.border-gray-300{--tw-border-opacity:1;border-color:rgb(209 213 219/var(--tw-border-opacity))}.border-input{border-color:hsl(var(--input))}.border-slate-300{--tw-border-opacity:1;border-color:rgb(203 213 225/var(--tw-border-opacity))}.border-transparent{border-color:transparent}.border-t-transparent{border-top-color:transparent}.bg-\\[\\#86efac\\]{--tw-bg-opacity:1;background-color:rgb(134 239 172/var(--tw-bg-opacity))}.bg-background{background-color:hsl(var(--background))}.bg-black{--tw-bg-opacity:1;background-color:rgb(0 0 0/var(--tw-bg-opacity))}.bg-destructive{background-color:hsl(var(--destructive))}.bg-gray-100{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity))}.bg-gray-500{--tw-bg-opacity:1;background-color:rgb(107 114 128/var(--tw-bg-opacity))}.bg-green-100{--tw-bg-opacity:1;background-color:rgb(220 252 231/var(--tw-bg-opacity))}.bg-muted{background-color:hsl(var(--muted))}.bg-popover{background-color:hsl(var(--popover))}.bg-primary{background-color:hsl(var(--primary))}.bg-red-100{--tw-bg-opacity:1;background-color:rgb(254 226 226/var(--tw-bg-opacity))}.bg-secondary{background-color:hsl(var(--secondary))}.bg-slate-200{--tw-bg-opacity:1;background-color:rgb(226 232 240/var(--tw-bg-opacity))}.bg-transparent{background-color:transparent}.bg-zinc-800\\/80{background-color:rgba(39,39,42,.8)}.bg-opacity-50{--tw-bg-opacity:0.5}.fill-current{fill:currentColor}.object-cover{-o-object-fit:cover;object-fit:cover}.p-0{padding:0}.p-0\\.5{padding:.125rem}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0{padding-bottom:0;padding-top:0}.py-0\\.5{padding-bottom:.125rem;padding-top:.125rem}.py-1{padding-bottom:.25rem;padding-top:.25rem}.py-1\\.5{padding-bottom:.375rem;padding-top:.375rem}.py-2{padding-bottom:.5rem;padding-top:.5rem}.py-20{padding-bottom:5rem;padding-top:5rem}.py-3{padding-bottom:.75rem;padding-top:.75rem}.py-4{padding-bottom:1rem;padding-top:1rem}.pb-1{padding-bottom:.25rem}.pl-8{padding-left:2rem}.pr-2{padding-right:.5rem}.text-center{text-align:center}.font-sans{font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-5xl{font-size:3rem;line-height:1}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-light{font-weight:300}.font-medium{font-weight:500}.font-semibold{font-weight:600}.lowercase{text-transform:lowercase}.italic{font-style:italic}.tracking-widest{letter-spacing:.1em}.text-destructive-foreground{color:hsl(var(--destructive-foreground))}.text-gray-400{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity))}.text-gray-500{--tw-text-opacity:1;color:rgb(107 114 128/var(--tw-text-opacity))}.text-gray-600{--tw-text-opacity:1;color:rgb(75 85 99/var(--tw-text-opacity))}.text-gray-700{--tw-text-opacity:1;color:rgb(55 65 81/var(--tw-text-opacity))}.text-gray-900{--tw-text-opacity:1;color:rgb(17 24 39/var(--tw-text-opacity))}.text-green-500{--tw-text-opacity:1;color:rgb(34 197 94/var(--tw-text-opacity))}.text-green-600{--tw-text-opacity:1;color:rgb(22 163 74/var(--tw-text-opacity))}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-red-400{--tw-text-opacity:1;color:rgb(248 113 113/var(--tw-text-opacity))}.text-red-600{--tw-text-opacity:1;color:rgb(220 38 38/var(--tw-text-opacity))}.text-secondary-foreground{color:hsl(var(--secondary-foreground))}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.text-zinc-400{--tw-text-opacity:1;color:rgb(161 161 170/var(--tw-text-opacity))}.underline-offset-4{text-underline-offset:4px}.opacity-0{opacity:0}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color)}.shadow,.shadow-lg{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color)}.shadow-md{--tw-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color)}.shadow-md,.shadow-sm{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-0{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur{--tw-backdrop-blur:blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-colors{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-opacity{transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-transform{transition-duration:.15s;transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}@keyframes enter{0%{opacity:var(--tw-enter-opacity,1);transform:translate3d(var(--tw-enter-translate-x,0),var(--tw-enter-translate-y,0),0) scale3d(var(--tw-enter-scale,1),var(--tw-enter-scale,1),var(--tw-enter-scale,1)) rotate(var(--tw-enter-rotate,0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity,1);transform:translate3d(var(--tw-exit-translate-x,0),var(--tw-exit-translate-y,0),0) scale3d(var(--tw-exit-scale,1),var(--tw-exit-scale,1),var(--tw-exit-scale,1)) rotate(var(--tw-exit-rotate,0))}}.animate-in{--tw-enter-opacity:initial;--tw-enter-scale:initial;--tw-enter-rotate:initial;--tw-enter-translate-x:initial;--tw-enter-translate-y:initial;animation-duration:.15s;animation-name:enter}.fade-in-0{--tw-enter-opacity:0}.zoom-in-95{--tw-enter-scale:.95}.duration-200{animation-duration:.2s}.duration-300{animation-duration:.3s}.ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)}.placeholder\\:text-sm::-moz-placeholder{font-size:.875rem;line-height:1.25rem}.placeholder\\:text-sm::placeholder{font-size:.875rem;line-height:1.25rem}.placeholder\\:text-gray-400::-moz-placeholder{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity))}.placeholder\\:text-gray-400::placeholder{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity))}.hover\\:bg-\\[\\#86efac\\]\\/90:hover{background-color:rgba(134,239,172,.9)}.hover\\:bg-accent:hover{background-color:hsl(var(--accent))}.hover\\:bg-destructive\\/90:hover{background-color:hsl(var(--destructive)/.9)}.hover\\:bg-gray-100:hover{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity))}.hover\\:bg-gray-200:hover{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity))}.hover\\:bg-gray-50:hover{--tw-bg-opacity:1;background-color:rgb(249 250 251/var(--tw-bg-opacity))}.hover\\:bg-primary\\/90:hover{background-color:hsl(var(--primary)/.9)}.hover\\:bg-secondary\\/80:hover{background-color:hsl(var(--secondary)/.8)}.hover\\:bg-zinc-700\\/50:hover{background-color:rgba(63,63,70,.5)}.hover\\:bg-opacity-50:hover{--tw-bg-opacity:0.5}.hover\\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\\:text-zinc-100:hover{--tw-text-opacity:1;color:rgb(244 244 245/var(--tw-text-opacity))}.hover\\:underline:hover{text-decoration-line:underline}.hover\\:opacity-90:hover{opacity:.9}.focus\\:bg-accent:focus{background-color:hsl(var(--accent))}.focus\\:text-accent-foreground:focus{color:hsl(var(--accent-foreground))}.focus-visible\\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\\:ring-1:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus-visible\\:ring-2:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus-visible\\:ring-ring:focus-visible{--tw-ring-color:hsl(var(--ring))}.focus-visible\\:ring-offset-2:focus-visible{--tw-ring-offset-width:2px}.focus-visible\\:ring-offset-background:focus-visible{--tw-ring-offset-color:hsl(var(--background))}.disabled\\:pointer-events-none:disabled{pointer-events:none}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:opacity-50:disabled{opacity:.5}.group:hover .group-hover\\:opacity-100{opacity:1}.data-\\[disabled\\]\\:pointer-events-none[data-disabled]{pointer-events:none}.data-\\[state\\=checked\\]\\:translate-x-4[data-state=checked]{--tw-translate-x:1rem}.data-\\[state\\=checked\\]\\:translate-x-4[data-state=checked],.data-\\[state\\=unchecked\\]\\:translate-x-0[data-state=unchecked]{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[state\\=unchecked\\]\\:translate-x-0[data-state=unchecked]{--tw-translate-x:0px}.data-\\[state\\=checked\\]\\:bg-primary[data-state=checked]{background-color:hsl(var(--primary))}.data-\\[state\\=open\\]\\:bg-accent[data-state=open]{background-color:hsl(var(--accent))}.data-\\[state\\=unchecked\\]\\:bg-input[data-state=unchecked]{background-color:hsl(var(--input))}.data-\\[disabled\\]\\:opacity-50[data-disabled]{opacity:.5}.data-\\[state\\=open\\]\\:animate-in[data-state=open]{--tw-enter-opacity:initial;--tw-enter-scale:initial;--tw-enter-rotate:initial;--tw-enter-translate-x:initial;--tw-enter-translate-y:initial;animation-duration:.15s;animation-name:enter}.data-\\[state\\=closed\\]\\:animate-out[data-state=closed]{--tw-exit-opacity:initial;--tw-exit-scale:initial;--tw-exit-rotate:initial;--tw-exit-translate-x:initial;--tw-exit-translate-y:initial;animation-duration:.15s;animation-name:exit}.data-\\[state\\=closed\\]\\:fade-out-0[data-state=closed]{--tw-exit-opacity:0}.data-\\[state\\=open\\]\\:fade-in-0[data-state=open]{--tw-enter-opacity:0}.data-\\[state\\=closed\\]\\:zoom-out-95[data-state=closed]{--tw-exit-scale:.95}.data-\\[state\\=open\\]\\:zoom-in-95[data-state=open]{--tw-enter-scale:.95}.data-\\[side\\=bottom\\]\\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y:-0.5rem}.data-\\[side\\=left\\]\\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x:0.5rem}.data-\\[side\\=right\\]\\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x:-0.5rem}.data-\\[side\\=top\\]\\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y:0.5rem}:is([data-mode=dark] .dark\\:border-white){--tw-border-opacity:1;border-color:rgb(255 255 255/var(--tw-border-opacity))}@media (min-width:640px){.sm\\:ml-3{margin-left:.75rem}.sm\\:block{display:block}.sm\\:h-5{height:1.25rem}.sm\\:h-9{height:2.25rem}.sm\\:h-\\[52px\\]{height:52px}.sm\\:w-5{width:1.25rem}.sm\\:w-9{width:2.25rem}.sm\\:gap-3{gap:.75rem}.sm\\:text-base{font-size:1rem;line-height:1.5rem}.sm\\:placeholder\\:text-base::-moz-placeholder{font-size:1rem;line-height:1.5rem}.sm\\:placeholder\\:text-base::placeholder{font-size:1rem;line-height:1.5rem}}.\\[\\&\\>svg\\]\\:shrink-0>svg{flex-shrink:0}.\\[\\&_svg\\]\\:pointer-events-none svg{pointer-events:none}.\\[\\&_svg\\]\\:shrink-0 svg{flex-shrink:0}'),"function"==typeof SuppressedError&&SuppressedError;var D=e.forwardRef(((t,r)=>{const{children:a,...o}=t,n=e.Children.toArray(a),i=n.find(X);if(i){const t=i.props.children,a=n.map((r=>r===i?e.Children.count(t)>1?e.Children.only(null):e.isValidElement(t)?t.props.children:null:r));return O(V,{...o,ref:r,children:e.isValidElement(t)?e.cloneElement(t,void 0,a):null})}return O(V,{...o,ref:r,children:a})}));D.displayName="Slot";var V=e.forwardRef(((t,r)=>{const{children:a,...o}=t;if(e.isValidElement(a)){const t=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;if(r)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r)return e.props.ref;return e.props.ref||e.ref}(a);return e.cloneElement(a,{...K(o,a.props),ref:r?Y(r,t):t})}return e.Children.count(a)>1?e.Children.only(null):null}));V.displayName="SlotClone";var J=({children:e})=>O(S,{children:e});function X(t){return e.isValidElement(t)&&t.type===J}function K(e,t){const r={...t};for(const a in t){const o=e[a],n=t[a];/^on[A-Z]/.test(a)?o&&n?r[a]=(...e)=>{n(...e),o(...e)}:o&&(r[a]=o):"style"===a?r[a]={...o,...n}:"className"===a&&(r[a]=[o,n].filter(Boolean).join(" "))}return{...e,...r}}function G(...e){return R(L(e))}const ee=I("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),te=e.forwardRef(((t,r)=>{var{className:a,variant:o,size:n,asChild:i=!1}=t,s=W(t,["className","variant","size","asChild"]);const l=i?D:"button";return e.createElement(l,Object.assign({className:G(ee({variant:o,size:n,className:a})),ref:r},s))}));te.displayName="Button";const re=T.Root,ae=T.Trigger;e.forwardRef(((t,r)=>{var{className:a,inset:o,children:n}=t,i=W(t,["className","inset","children"]);return e.createElement(T.SubTrigger,Object.assign({ref:r,className:G("flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",o&&"pl-8",a)},i),n,e.createElement(A,{className:"ml-auto"}))})).displayName=T.SubTrigger.displayName;e.forwardRef(((t,r)=>{var{className:a}=t,o=W(t,["className"]);return e.createElement(T.SubContent,Object.assign({ref:r,className:G("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",a)},o))})).displayName=T.SubContent.displayName;const oe=e.forwardRef(((t,r)=>{var{className:a,sideOffset:o=4}=t,n=W(t,["className","sideOffset"]);return e.createElement(T.Portal,null,e.createElement(T.Content,Object.assign({ref:r,sideOffset:o,className:G("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",a)},n)))}));oe.displayName=T.Content.displayName;const ne=e.forwardRef(((t,r)=>{var{className:a,inset:o}=t,n=W(t,["className","inset"]);return e.createElement(T.Item,Object.assign({ref:r,className:G("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",o&&"pl-8",a)},n))}));ne.displayName=T.Item.displayName;e.forwardRef(((t,r)=>{var{className:a,children:o,checked:n}=t,i=W(t,["className","children","checked"]);return e.createElement(T.CheckboxItem,Object.assign({ref:r,className:G("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a),checked:n},i),e.createElement("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center"},e.createElement(T.ItemIndicator,null,e.createElement($,{className:"h-4 w-4"}))),o)})).displayName=T.CheckboxItem.displayName;e.forwardRef(((t,r)=>{var{className:a,children:o}=t,n=W(t,["className","children"]);return e.createElement(T.RadioItem,Object.assign({ref:r,className:G("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a)},n),e.createElement("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center"},e.createElement(T.ItemIndicator,null,e.createElement(_,{className:"h-2 w-2 fill-current"}))),o)})).displayName=T.RadioItem.displayName;e.forwardRef(((t,r)=>{var{className:a,inset:o}=t,n=W(t,["className","inset"]);return e.createElement(T.Label,Object.assign({ref:r,className:G("px-2 py-1.5 text-sm font-semibold",o&&"pl-8",a)},n))})).displayName=T.Label.displayName;e.forwardRef(((t,r)=>{var{className:a}=t,o=W(t,["className"]);return e.createElement(T.Separator,Object.assign({ref:r,className:G("-mx-1 my-1 h-px bg-muted",a)},o))})).displayName=T.Separator.displayName;const ie=F.Provider,se=F.Root,le=F.Trigger,ce=e.forwardRef(((t,r)=>{var{className:a,sideOffset:o=4}=t,n=W(t,["className","sideOffset"]);return e.createElement(F.Portal,null,e.createElement(F.Content,Object.assign({ref:r,sideOffset:o,className:G("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",a)},n)))}));function de({suggestions:e,onQuestionClick:r,borderColor:a,title:o="Suggested questions"}){return e&&0!==e.length?t.createElement("div",{className:"w-full"},t.createElement("h3",{className:"text-base font-medium mb-4 text-gray-900"},o),t.createElement("div",{className:"flex flex-wrap gap-2"},e.map((e=>t.createElement("button",{key:e.id,onClick:()=>r(e),className:"px-4 py-2 rounded-lg border border-gray-300 text-gray-700 hover:bg-gray-50 transition-colors duration-200 text-sm flex items-center gap-2",style:{borderColor:a}},void 0!==e.messageCount&&t.createElement(ie,null,t.createElement(se,null,t.createElement(le,{asChild:!0},t.createElement("span",{className:"bg-gray-100 text-gray-600 px-2 py-0.5 rounded-full text-xs min-w-[20px] border flex items-center justify-center",style:{borderColor:a}},e.messageCount)),t.createElement(ce,null,t.createElement("p",null,e.messageCount," messages in this conversation")))),t.createElement("span",null,e.question)))))):null}ce.displayName=F.Content.displayName;var me="generating-star-module_animate-spin__AJjwz";M(".generating-star-module_animate-spin__AJjwz{animation:generating-star-module_rotate__ChndJ 2s linear infinite;transform-box:fill-box;transform-origin:center}@keyframes generating-star-module_rotate__ChndJ{to{transform:rotate(1turn)}}");const pe=({loading:e,color:r="#000"})=>t.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",className:"mt-[-5px] inline-block"},t.createElement("path",{className:e?me:"",d:"M7.54672 16.0031L2.66234 14.2031C2.51881 14.1498 2.39502 14.0539 2.3076 13.9282C2.22019 13.8025 2.17333 13.6531 2.17333 13.5C2.17333 13.3469 2.22019 13.1975 2.3076 13.0718C2.39502 12.9461 2.51881 12.8501 2.66234 12.7969L7.54672 10.9969C7.64981 10.9589 7.74344 10.899 7.82113 10.8213C7.89882 10.7436 7.95873 10.65 7.99672 10.5469L9.79672 5.66249C9.84999 5.51896 9.94592 5.39517 10.0716 5.30775C10.1973 5.22033 10.3467 5.17348 10.4998 5.17348C10.6529 5.17348 10.8024 5.22033 10.9281 5.30775C11.0538 5.39517 11.1497 5.51896 11.203 5.66249L13.003 10.5469C13.041 10.65 13.1009 10.7436 13.1786 10.8213C13.2562 10.899 13.3499 10.9589 13.453 10.9969L18.3373 12.7969C18.4809 12.8501 18.6047 12.9461 18.6921 13.0718C18.7795 13.1975 18.8264 13.3469 18.8264 13.5C18.8264 13.6531 18.7795 13.8025 18.6921 13.9282C18.6047 14.0539 18.4809 14.1498 18.3373 14.2031L13.453 16.0031C13.3499 16.0411 13.2562 16.101 13.1786 16.1787C13.1009 16.2564 13.041 16.35 13.003 16.4531L11.203 21.3375C11.1497 21.481 11.0538 21.6048 10.9281 21.6922C10.8024 21.7796 10.6529 21.8265 10.4998 21.8265C10.3467 21.8265 10.1973 21.7796 10.0716 21.6922C9.94592 21.6048 9.84999 21.481 9.79672 21.3375L7.99672 16.4531C7.95873 16.35 7.89882 16.2564 7.82113 16.1787C7.74344 16.101 7.64981 16.0411 7.54672 16.0031Z",stroke:r,strokeWidth:"1.5",strokeLinecap:"round",fill:e?r:"none",strokeLinejoin:"round"}),t.createElement("path",{d:"M18.7497 3.75L14.2497 3.75",stroke:r,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),t.createElement("path",{d:"M16.4999 6V1.5",stroke:r,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),t.createElement("path",{d:"M22.4999 8.25001H19.4999",stroke:r,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),t.createElement("path",{d:"M20.9998 9.75002V6.75002",stroke:r,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}));function ue({theme:e,loadingText:r="Analyzing..."}){return t.createElement("div",{className:"w-full space-y-6 rounded-xl p-6",style:{backgroundColor:e.cardBackground,borderColor:e.border,borderWidth:"1px",borderStyle:"solid"}},t.createElement("div",{className:"flex items-center gap-2"},t.createElement(pe,{loading:!0,color:e.primary}),t.createElement("div",{className:"text-sm",style:{color:e.text}},r)),t.createElement("div",{className:"space-y-4 animate-pulse"},Array.from({length:4}).map(((r,a)=>t.createElement("div",{key:a,className:"h-4 rounded w-full",style:{backgroundColor:`${e.border}40`}}))),t.createElement("div",{className:"h-4 rounded w-3/4",style:{backgroundColor:`${e.border}40`}})),t.createElement("div",{className:"rounded-lg p-4",style:{backgroundColor:`${e.accent}50`}},t.createElement("div",{className:"flex items-center justify-between"},t.createElement("div",{className:"h-4 rounded w-48",style:{backgroundColor:`${e.border}80`}}),t.createElement("div",{className:"flex gap-2"},t.createElement("div",{className:"w-8 h-8 rounded-full",style:{backgroundColor:`${e.border}80`}}),t.createElement("div",{className:"w-8 h-8 rounded-full",style:{backgroundColor:`${e.border}80`}})))))}const ge={javascript:".js",python:".py",java:".java",c:".c",cpp:".cpp","c++":".cpp","c#":".cs",ruby:".rb",php:".php",swift:".swift","objective-c":".m",kotlin:".kt",typescript:".ts",go:".go",perl:".pl",rust:".rs",scala:".scala",haskell:".hs",lua:".lua",shell:".sh",sql:".sql",html:".html",css:".css"},he=Q,be=r((({language:e,value:r})=>{const[o,n]=a(!1);return t.createElement("div",{className:"relative font-sans text-sm mt-1"},t.createElement("div",{className:"relative rounded-t-lg bg-zinc-800/80 font-sans text-sm backdrop-blur"},t.createElement("div",{className:"flex h-8 items-center justify-between px-3"},t.createElement("span",{className:"text-xs font-medium text-zinc-400"},e),t.createElement("div",{className:"flex gap-1"},t.createElement(te,{variant:"ghost",size:"icon",className:"size-5 text-zinc-400 hover:bg-zinc-700/50 hover:text-zinc-100",onClick:()=>{Z(void 0,void 0,void 0,(function*(){if(navigator.clipboard&&navigator.clipboard.writeText)try{yield navigator.clipboard.writeText(r),n(!0),setTimeout((()=>{n(!1)}),2e3)}catch(e){console.error("Failed to copy:",e)}}))}},o?t.createElement(l,{size:18}):t.createElement(c,{size:18})),t.createElement(te,{variant:"ghost",size:"icon",className:"size-5 text-zinc-400 hover:bg-zinc-700/50 hover:text-zinc-100",onClick:()=>{const t=ge[e]||".file",a=`file-${((e,t=!1)=>{const r="ABCDEFGHJKLMNPQRSTUVWXY3456789";let a="";for(let t=0;t<e;t+=1)a+=r.charAt(Math.floor(30*Math.random()));return t?a.toLowerCase():a})(3,!0)}${t}`,o=new Blob([r],{type:"text/plain"}),n=URL.createObjectURL(o),i=document.createElement("a");i.download=a,i.href=n,i.style.display="none",document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(n)}},t.createElement(d,{size:18}))))),t.createElement("div",{className:"rounded-b-lg"},t.createElement(he,{language:e,style:P,PreTag:"div",wrapLongLines:!0,customStyle:{margin:0,borderTopLeftRadius:0,borderTopRightRadius:0}},r)))}));be.displayName="CodeBlock";const fe=e.forwardRef((({src:t,border:r,width:a="100%",height:o="400px",title:n},i)=>{const[s,l]=e.useState(!1);return e.useEffect((()=>{let e=!0;return setTimeout((()=>{e&&l(!0)}),0),()=>{e=!1}}),[]),e.createElement("div",{className:"overflow-hidden rounded-lg mt-4 "+(r?"border":""),style:{width:a,height:o}},s&&e.createElement(e.Fragment,null,e.createElement("iframe",{ref:i,src:t,sandbox:"allow-same-origin allow-scripts allow-popups allow-forms allow-downloads",width:a,height:o,frameBorder:"0",title:"embed",loading:"lazy",allowFullScreen:!0,className:"block rounded-lg"}),n&&e.createElement("span",{className:"block text-center text-sm font-medium"},n)))}));function we(t){const r=t.attrs.href.replace("share","embed");return e.createElement(fe,Object.assign({},t,{src:r,title:"Loom Embed"}))}function ye(t){return e.createElement(fe,Object.assign({},t,{src:t.attrs.href,title:"Supademo Embed"}))}function ve(t){return e.createElement(fe,Object.assign({},t,{src:t.attrs.href,title:"Typeform Embed"}))}function xe(t){const r=t.attrs.href.match(/(http|https)?:\/\/(www\.)?vimeo\.com\/(?:channels\/(?:\w+\/)?|groups\/([^/]*)\/videos\/|)(\d+)(?:\/|\?)?([\d\w]+)?/);if(!r)return null;const a=r[4],o=r[5],n=`https://player.vimeo.com/video/${a}?byline=0${o?`&h=${o}`:""}`;return e.createElement(fe,Object.assign({},t,{src:n,title:`Vimeo Embed (${a})`,height:"412px",border:!1}))}function ke(t){const r=(e=>{const t=[/^https?:\/\/([a-zA-Z0-9-_~]+)\.wistia\.com\/medias\/([a-zA-Z0-9-_~]+)\/?$/,/^https?:\/\/fast\.wistia\.com\/embed\/iframe\/([a-zA-Z0-9-_~]+)\/?$/,/^fast\.wistia\.com\/embed\/iframe\/([a-zA-Z0-9-_~]+)\/?$/,/^([a-zA-Z0-9-_~]+)\.wistia\.com\/medias\/([a-zA-Z0-9-_~]+)\/?$/];for(const r of t){const t=e.match(r);if(t)return t}return null})(t.attrs.href);if(!r)return null;const a=r[1],o=r[2]||r[1],n=a?`https://${a}.wistia.com/embed/iframe/${o}?seo=true&videoFoam=false`:`https://fast.wistia.com/embed/iframe/${o}`;return e.createElement(fe,Object.assign({},t,{src:n,border:!0,title:`Wistia Embed (${o})`}))}function Ee(t){const r=(e=>{const t=e.match(/(?:https?:\/\/)?(?:www\.)?youtu\.?be(?:\.com)?\/?.*(?:watch|embed)?(?:.*v=|v\/|\/)([a-zA-Z0-9_-]{11})$/i);return t?t[1]:null})(t.attrs.href);return r?e.createElement(fe,Object.assign({},t,{src:`https://www.youtube.com/embed/${r}?modestbranding=1`,title:`YouTube Embed (${r})`})):null}we.isMatch=e=>/^https:\/\/(www\.)?(use)?loom\.com\/(embed|share)\/(.*)$/.test(e),ye.isMatch=e=>/^https:\/\/app\.supademo\.com\/embed\/(.*)$/.test(e),ve.isMatch=e=>/^https:\/\/([A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?)\.typeform\.com\/to\/(.*)$/.test(e),xe.isMatch=e=>/^(https?):\/\/(www\.)?vimeo\.com\/(?:channels\/(?:\w+\/)?|groups\/([^/]*)\/videos\/|)?(\d+)(\/)?(?:\?.*|#.*)?$/i.test(e),ke.isMatch=e=>[/^https?:\/\/([a-zA-Z0-9-_~]+)\.wistia\.com\/medias\/([a-zA-Z0-9-_~]+)(\/)?(\?.*)?$/i,/^https?:\/\/fast\.wistia\.com\/embed\/iframe\/([a-zA-Z0-9-_~]+)(\/)?(\?.*)?$/i,/^fast\.wistia\.com\/embed\/iframe\/([a-zA-Z0-9-_~]+)(\/)?(\?.*)?$/i,/^([a-zA-Z0-9-_~]+)\.wistia\.com\/medias\/([a-zA-Z0-9-_~]+)(\/)?(\?.*)?$/i].some((t=>t.test(e))),Ee.isMatch=e=>/^(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/(?:watch\?v=|embed\/|v\/|shorts\/)|youtu\.be\/)([a-zA-Z0-9_-]{11})(?:\/|[?&].*)?$/i.test(e);const Ne=[we,ye,ve,Ee,ke,xe],Ce=t=>{const{href:r}=t.attrs,[n,i]=a(null);if(o((()=>{let e=!0;return(()=>{try{const a=Ne.find((e=>e.isMatch(r)));a&&e&&i({Component:a,props:t})}catch(e){console.error("Error finding embed match:",e)}})(),()=>{e=!1}}),[r,t]),n){const{Component:t,props:r}=n;return e.createElement(t,Object.assign({},r))}return null},je=r(q,((e,t)=>e.children===t.children)),ze=r((({message:e})=>(e.content=e.content.replace(/^\n+|(\n+|\\)+$/g,""),t.createElement(je,{className:"dark:prose-invert prose flex-1",remarkPlugins:[B],rehypePlugins:[U],components:{code(e){var{inline:r,className:a,children:o}=e,n=W(e,["inline","className","children"]);const i=/language-(\w+)/.exec(a||""),s=i&&i[1];return!r&&s?t.createElement(be,Object.assign({key:Math.random(),language:s,value:String(o).replace(/\n$/,"")},n)):t.createElement("code",Object.assign({className:`text-red-400 bg-slate-200 border-slate-300 border rounded p-0.5 ${a}`.trim()},n),o)},marker:({children:e})=>t.createElement("div",{className:"my-2"},t.createElement("span",{className:"highlight"},e)),table:({children:e})=>t.createElement("table",{className:"border-collapse border border-black px-3 py-1 dark:border-white"},e),th:({children:e})=>t.createElement("th",{className:"break-words border border-black bg-gray-500 px-3 py-1 text-white dark:border-white"},e),td:({children:e})=>t.createElement("td",{className:"break-words border border-black px-3 py-1 dark:border-white"},e),a(e){var{children:r}=e,a=W(e,["children"]);if(a.href){const e=Ce({attrs:{href:a.href}});if(t.isValidElement(e))return e}return t.createElement("a",Object.assign({className:"link",target:"_blank",rel:"noopener noreferrer"},a),r)},pre:({children:e})=>t.createElement(t.Fragment,null,e),img({src:e,alt:r}){const a=Ce({attrs:{href:null!=e?e:""}});return t.isValidElement(a)?a:t.createElement("img",{src:e,alt:r,className:"w-full"})},li:e=>{var{children:r}=e,a=W(e,["children"]);return t.createElement("li",Object.assign({className:"py-1"},a),r)},ul:({children:e})=>t.createElement("ul",{className:"ml-4 list-outside list-disc"},e),ol:({children:e})=>t.createElement("ol",{className:"ml-4 list-outside list-decimal"},e),strong:e=>{var{children:r}=e,a=W(e,["children"]);return t.createElement("span",Object.assign({className:"font-semibold"},a),r)},h1:e=>{var{children:r}=e,a=W(e,["children"]);return t.createElement("h1",Object.assign({className:"mb-2 mt-6 text-3xl font-semibold"},a),r)},h2:e=>{var{children:r}=e,a=W(e,["children"]);return t.createElement("h2",Object.assign({className:"mb-2 mt-6 text-2xl font-semibold"},a),r)},h3:e=>{var{children:r}=e,a=W(e,["children"]);return t.createElement("h3",Object.assign({className:"mb-2 mt-6 text-xl font-semibold"},a),r)},h4:e=>{var{children:r}=e,a=W(e,["children"]);return t.createElement("h4",Object.assign({className:"mb-2 mt-6 text-lg font-semibold"},a),r)},h5:e=>{var{children:r}=e,a=W(e,["children"]);return t.createElement("h5",Object.assign({className:"mb-2 mt-6 text-base font-semibold"},a),r)},h6:e=>{var{children:r}=e,a=W(e,["children"]);return t.createElement("h6",Object.assign({className:"mb-2 mt-6 text-sm font-semibold"},a),r)}}},e.content))));function Oe({answer:e,question:r,theme:o,searchResults:n,followUpQuestions:i,onFollowUpClick:s,isStreaming:l=!1,searchQueryId:c,feedback:d,onFeedback:w,disableFeedback:y=!1,textConfig:v={}}){const[x,k]=a(!1),[E,N]=a(!1),C=()=>Z(this,void 0,void 0,(function*(){try{yield navigator.clipboard.writeText(e),k(!0),setTimeout((()=>k(!1)),2e3)}catch(e){console.error("Failed to copy text:",e)}})),j=e=>{w&&c&&w(e)};return t.createElement("div",{className:"rounded-lg p-6",style:{backgroundColor:o.cardBackground,borderColor:o.border,borderWidth:"1px",borderStyle:"solid"}},t.createElement("div",{className:"flex items-start justify-between"},t.createElement("div",{className:"flex items-center gap-2 mb-4"},t.createElement(pe,{loading:l,color:o.primary}),t.createElement("h2",{className:"text-xl",style:{color:o.text}},r)),t.createElement(ie,null,t.createElement(se,null,t.createElement(le,{asChild:!0},t.createElement("button",{onClick:()=>{C()},className:"flex items-center justify-center w-8 h-8 rounded-md hover:bg-gray-100 transition-colors duration-200"},x?t.createElement(m,{className:"h-4 w-4 text-green-500"}):t.createElement(p,{className:"h-4 w-4 text-gray-500"}))),t.createElement(ce,null,t.createElement("p",null,x?"Copied!":"Copy"))))),e&&t.createElement("div",{className:"prose prose-sm max-w-none",style:{color:o.text}},t.createElement(ze,{message:{content:e}})),e&&!l&&!y&&t.createElement("div",{className:"mt-2 flex justify-end gap-2"},t.createElement(ie,null,t.createElement(se,null,t.createElement(le,{asChild:!0},t.createElement(te,{variant:"ghost",size:"sm",className:"rounded-md h-8 w-8 flex items-center justify-center "+("accept"===d?"bg-green-100 text-green-600":""),onClick:()=>j("accept"),disabled:Boolean(d)},t.createElement(u,{className:"h-4 w-4"}))),t.createElement(ce,null,t.createElement("p",null,v.positiveAnswerText||"Helpful")))),t.createElement(ie,null,t.createElement(se,null,t.createElement(le,{asChild:!0},t.createElement(te,{variant:"ghost",size:"sm",className:"rounded-md h-8 w-8 flex items-center justify-center "+("reject"===d?"bg-red-100 text-red-600":""),onClick:()=>j("reject"),disabled:Boolean(d)},t.createElement(g,{className:"h-4 w-4"}))),t.createElement(ce,null,t.createElement("p",null,v.negativeAnswerText||"Not helpful"))))),e&&i&&i.length>0&&t.createElement("div",{className:"mt-6 space-y-3"},t.createElement("div",{className:"text-sm font-medium",style:{color:o.text}},"Follow-up Questions"),t.createElement("div",{className:"flex flex-wrap gap-2"},i.map(((e,r)=>t.createElement("button",{key:r,onClick:()=>null==s?void 0:s(e),className:"px-3 py-1.5 rounded-lg text-sm transition-all duration-200 hover:opacity-90",style:{backgroundColor:`${o.accent}30`,color:o.text,border:`1px solid ${o.border}`}},e))))),n&&n.length>0&&t.createElement("div",{className:"mt-6 rounded-lg overflow-hidden",style:{backgroundColor:o.surface,borderWidth:"1px",borderStyle:"solid",borderColor:o.border}},t.createElement("button",{onClick:()=>N(!E),className:"w-full flex items-center justify-between p-3 transition-all duration-200 hover:bg-opacity-50",style:{color:o.text,borderBottom:E?`1px solid ${o.surfaceBorder}`:"none"}},t.createElement("div",{className:"flex items-center gap-2"},t.createElement(h,{className:"h-4 w-4",style:{color:o.primary}}),t.createElement("span",{className:"font-medium"},"Related Articles (",n.length,")")),t.createElement(b,{className:"h-4 w-4 transition-transform duration-200 "+(E?"rotate-180":""),style:{color:o.text}})),t.createElement("div",{className:"overflow-hidden transition-all duration-200 ease-in-out",style:{maxHeight:E?48*n.length+"px":"0",opacity:E?1:0,transform:`translateY(${E?"0":"-10px"})`}},t.createElement("div",{className:"divide-y divide-gray-200"},n.map((e=>t.createElement("a",{key:e.id,href:e.url,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 p-3 transition-colors duration-200 hover:bg-gray-50",style:{color:o.text,backgroundColor:o.surface}},t.createElement(h,{className:"h-4 w-4",style:{color:o.primary}}),t.createElement("span",{className:"flex-grow"},e.title),t.createElement(f,{className:"h-4 w-4",style:{color:`${o.text}60`}}))))))),!e&&t.createElement("div",{className:"animate-pulse space-y-4"},t.createElement("div",{className:"h-4 rounded w-full",style:{backgroundColor:`${o.border}40`}}),t.createElement("div",{className:"h-4 rounded w-3/4",style:{backgroundColor:`${o.border}40`}})))}function Se({questions:e,currentIndex:r,activeIndex:a,onNavigate:o,theme:n,offset:i}){return t.createElement(j.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{duration:.5},className:"fixed left-4 top-1/2 -translate-y-1/2 z-50 flex flex-col gap-2",style:Object.assign({},i?{left:`${i}px`}:{})},e.map(((e,i)=>t.createElement("div",{key:i,className:"relative group"},t.createElement("button",{onClick:()=>o(i),className:"flex items-center justify-center w-8 h-8 rounded-full transition-all duration-200 "+(i<=r?"hover:opacity-90":""),style:{backgroundColor:i===a?n.primary:"#ccc",color:i===a?n.background:"#333",opacity:i>r?.5:1,cursor:"pointer"}},i+1),t.createElement("div",{className:"absolute left-12 top-0 px-3 py-2 rounded-lg whitespace-normal opacity-0 group-hover:opacity-100 w-48 text-sm transition-opacity duration-200",style:{backgroundColor:n.background,color:n.text,borderColor:n.border,borderWidth:"1px",borderStyle:"solid",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1)"}},e,t.createElement("div",{className:"absolute left-0 top-3 -translate-x-1 w-2 h-2 rotate-45",style:{backgroundColor:n.background,borderLeft:`1px solid ${n.border}`,borderBottom:`1px solid ${n.border}`}}))))))}function Ie({onClick:e,theme:r}){return t.createElement(te,{className:"fixed bottom-20 right-4 rounded-full p-2 transition-opacity duration-300",style:{backgroundColor:r.background,borderColor:r.border,borderWidth:"1px",borderStyle:"solid",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1)"},onClick:e},t.createElement(w,{className:"h-5 w-5",style:{color:r.text}}))}function Le({endpoint:e,query:t,collectionId:r,headers:a,conversationId:o}){var n;return Z(this,void 0,void 0,(function*(){try{const i=yield fetch(e,{method:"POST",headers:Object.assign({"Content-Type":"application/json"},a),body:JSON.stringify(Object.assign(Object.assign({query:t,limit:5},r&&"all"!==r&&{collectionId:r}),o&&{conversationId:o}))});if(!i.ok)throw new Error("Failed to fetch search results");const s=yield i.json();return{results:null==s?void 0:s.data,searchQueryId:null===(n=null==s?void 0:s.searchQuery)||void 0===n?void 0:n.id}}catch(e){throw console.error("Error searching:",e),e}}))}function Re({endpoint:e,searchQueryId:t,headers:r,conversationId:a}){return Z(this,void 0,void 0,(function*(){try{const o=yield fetch(e,{method:"POST",headers:Object.assign({"Content-Type":"application/json"},r),body:JSON.stringify(Object.assign({searchQueryId:t},a&&{conversationId:a}))});if(!o.ok)throw new Error("Failed to fetch answer");return o}catch(e){throw console.error("Error fetching answer:",e),e}}))}function Te(){return`bf-conversation-${Date.now()}-${"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(e=>{const t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))}`}function Ae({endpoint:e,conversationId:t,headers:r}){return Z(this,void 0,void 0,(function*(){try{const a=yield fetch(e,{method:"POST",headers:Object.assign({"Content-Type":"application/json"},r),body:JSON.stringify({conversationId:t})});if(!a.ok)throw new Error("Failed to load conversation");const o=yield a.json();return{data:o.data.map((e=>Object.assign(Object.assign({},e),{feedback:e.feedback?"positive"===e.feedback?"accept":"reject":void 0})))}}catch(e){throw console.error("Error loading conversation:",e),e}}))}const $e={primary:"#A3E635",accent:"#f9fafb",background:"white",text:"#171717",border:"#171717",hover:"#171717",surface:"#F9FAFB",surfaceBorder:"#E5E7EB",surfaceHover:"#F3F4F6",cardBackground:"white"},_e={headerText:"How can we help you today?",searchPlaceholder:"Ask a question or type a search term here ...",attachImageText:"Attach image",allDocumentsText:"All documents",loadingSearchText:"Searching for relevant content...",loadingAnswerText:"Crafting a response...",errorText:"Sorry, there was an error generating the answer.",followUpPlaceholder:"Ask follow-up",positiveAnswerText:"Helpful",negativeAnswerText:"Not helpful"},Fe=n((({suggestions:e,theme:r={},collections:n=[],selectedCollectionId:l,onCollectionChange:c,searchEndpoint:d,answerEndpoint:m,feedbackEndpoint:p,loadConversationEndpoint:u,disableFollowUpQuestions:g=!1,disableImageAttachment:h=!1,disableFeedback:f=!1,siblingNode:w,offset:O=0,headers:S,textConfig:I={}},L)=>{var R;const T=Object.assign(Object.assign({},$e),r),A=Object.assign(Object.assign({},_e),I),[$,_]=a(""),[F,U]=a(""),[B,Q]=a(!1),[P,q]=a(!1),[M,W]=a([]),[H,Y]=a(!1),[D,V]=a(0),[J,X]=a([]),[K,G]=a(l),[ee,ie]=a(!0),[se,le]=a(""),[ce,me]=a(!1),[pe,ge]=a(),he=i(null),be=i(null),fe=i([]),we=i(null),ye=i(null),ve=i([]);o((()=>{const e=new URLSearchParams(window.location.search).get("conversation");if(e&&u)me(!0),q(!0),Ae({endpoint:u,conversationId:e,headers:S}).then((t=>{W(t.data),le(e),q(!0)})).catch((e=>{console.error("Error loading conversation:",e),ge(A.errorText||"An error occurred"),q(!1),W([]);const t=Te();le(t);const r=new URL(window.location.href);r.searchParams.delete("conversation"),window.history.replaceState({},"",r.toString())})).finally((()=>{me(!1)}));else{const e=Te();le(e)}}),[u]),o((()=>{if(se&&M.length>0){const e=new URL(window.location.href);e.searchParams.set("conversation",se),window.history.replaceState({},"",e.toString())}}),[se,M.length]),o((()=>{const e={showResults:P,answers:M,isLoading:ce,error:pe};ve.current.forEach((t=>t(e)))}),[P,M,ce,pe]),s(L,(()=>({createNewThread:()=>{_(""),U(""),q(!1),W([]),V(0),X([]);const e=Te();le(e);const t=new URL(window.location.href);t.searchParams.delete("conversation"),window.history.replaceState({},"",t.toString()),he.current&&(he.current.style.height="auto")},showFollowUpThread:e=>{ie(e)},subscribeToStateChanges:e=>(ve.current.push(e),e({showResults:P,answers:M,isLoading:!1,error:void 0}),()=>{ve.current=ve.current.filter((t=>t!==e))})}))),o((()=>{G(l)}),[l]);const xe=e=>{e.style.height="auto",e.style.height=`${e.scrollHeight}px`},ke=()=>{requestAnimationFrame((()=>{const e=fe.current[fe.current.length-1],t=we.current;if(e&&t){const r=t.getBoundingClientRect(),a=e.getBoundingClientRect().top-r.top-80;t.scrollBy({top:a,behavior:"smooth"})}}))},Ee=e=>Z(void 0,void 0,void 0,(function*(){var t;const r=null===(t=e.body)||void 0===t?void 0:t.getReader();if(!r)return;W((e=>{const t=[...e],r=t[t.length-1];return r&&(r.isLoading=!1,r.isStreaming=!0),t}));let a="";try{let e,t;for(;({done:e,value:t}=yield r.read()),!e;){const e=(new TextDecoder).decode(t);a+=e,W((e=>{const t=[...e],r=t[t.length-1];return r&&(r.answer=a),t}))}}finally{W((e=>{const t=[...e],r=t[t.length-1];return r&&(r.isStreaming=!1),t})),r.releaseLock()}})),Ne=(e,t,r)=>Z(void 0,void 0,void 0,(function*(){if(p)try{yield function({endpoint:e,searchQueryId:t,response:r,headers:a,conversationId:o}){return Z(this,void 0,void 0,(function*(){try{if(!(yield fetch(e,{method:"POST",headers:Object.assign({"Content-Type":"application/json"},a),body:JSON.stringify(Object.assign({searchQueryId:t,response:r},o&&{conversationId:o}))})).ok)throw new Error("Failed to send feedback")}catch(e){throw console.error("Error sending feedback:",e),e}}))}({endpoint:p,searchQueryId:t,response:e,headers:S,conversationId:se}),W((t=>{const a=[...t];return a[r]&&(a[r]=Object.assign(Object.assign({},a[r]),{feedback:e})),a}))}catch(e){console.error("Error sending feedback:",e)}})),Ce=()=>Z(void 0,void 0,void 0,(function*(){if($.trim()){if(Q(!0),q(!0),!se){const e=Te();le(e)}W((e=>{const t=[...e,{question:$,answer:"",isLoading:!0,isSearchLoading:!0}];return V(t.length-1),t})),ke();try{const e=yield Le({endpoint:d,query:$,collectionId:K,headers:S,conversationId:se}),t=e.results,r=e.searchQueryId;W((e=>{const a=[...e];return a[a.length-1]=Object.assign(Object.assign({},a[a.length-1]),{searchResults:t,searchQueryId:r,isSearchLoading:!1}),a}));const a=yield Re({endpoint:m,searchQueryId:r,headers:S,conversationId:se});yield Ee(a)}catch(e){console.error("Error generating answer:",e),W((e=>{const t=[...e];return t[t.length-1]=Object.assign(Object.assign({},t[t.length-1]),{answer:A.errorText||"An error occurred",isLoading:!1,isSearchLoading:!1}),t}))}finally{Q(!1)}}})),je=()=>Z(void 0,void 0,void 0,(function*(){if(F.trim()){const e=F;_(e),U(""),Q(!0),W((t=>{const r=[...t,{question:e,answer:"",isLoading:!0,isSearchLoading:!0}];return V(r.length-1),r})),ke();try{const t=yield Le({endpoint:d,query:e,collectionId:K,headers:S,conversationId:se}),r=t.results,a=t.searchQueryId;W((e=>{const t=[...e];return t[t.length-1]=Object.assign(Object.assign({},t[t.length-1]),{searchResults:r,searchQueryId:a,isSearchLoading:!1}),t}));const o=yield Re({endpoint:m,searchQueryId:a,headers:S,conversationId:se});yield Ee(o)}catch(e){console.error("Error generating answer:",e),W((e=>{const t=[...e];return t[t.length-1]=Object.assign(Object.assign({},t[t.length-1]),{answer:A.errorText||"An error occurred",isLoading:!1,isSearchLoading:!1}),t}))}finally{Q(!1)}}}));o((()=>{const e=we.current;if(!e)return;const t=()=>{const{scrollTop:t,scrollHeight:r,clientHeight:a}=e;Y(!(r-t-a<100))};return e.addEventListener("scroll",t),()=>e.removeEventListener("scroll",t)}),[]),o((()=>()=>{J.forEach((e=>URL.revokeObjectURL(e.preview)))}),[J]);return o((()=>{if(P)return document.body.style.overflow="hidden",()=>{document.body.style.overflow="unset"}}),[P]),t.createElement("div",{className:"relative min-h-screen overflow-hidden"},t.createElement("div",{ref:we,className:"w-full max-w-3xl mx-auto flex flex-col items-center space-y-8 px-4 py-20 h-screen overflow-y-auto relative elegant-scrollbar",style:{height:"100vh",maxHeight:"100vh",overflowY:"auto",WebkitOverflowScrolling:"touch","--surface-border":T.surfaceBorder,"--surface-hover":T.surfaceHover}},t.createElement(z,null,ce?t.createElement(j.div,{key:"loading",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"w-full flex items-center justify-center py-20"},t.createElement("div",{className:"flex flex-col items-center gap-4"},t.createElement("div",{className:"animate-spin rounded-full h-8 w-8 border-2 border-t-transparent",style:{borderColor:T.primary}}),t.createElement("p",{className:"text-sm",style:{color:T.text}},"Loading conversation..."))):P?t.createElement(j.div,{key:"results",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.5},className:"w-full space-y-8 py-4 mb-20"},M.map(((e,r)=>t.createElement(j.div,{key:r,ref:e=>fe.current[r]=e,initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5,delay:.1*r}},e.isLoading?t.createElement(ue,{theme:T,loadingText:e.isSearchLoading?A.loadingSearchText:A.loadingAnswerText}):t.createElement(Oe,{answer:e.answer,question:e.question,theme:T,searchResults:e.searchResults,followUpQuestions:g?void 0:e.followUpQuestions,onFollowUpClick:g?void 0:e=>{U(e),je()},isStreaming:e.isStreaming,searchQueryId:e.searchQueryId,feedback:e.feedback,onFeedback:f||!p?void 0:t=>Ne(t,e.searchQueryId,r),disableFeedback:f||!p,textConfig:A}))))):t.createElement(j.div,{key:"search",initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},transition:{duration:.5},className:"w-full space-y-8"},t.createElement("div",{className:"w-full text-center space-y-4"},t.createElement(j.h1,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5,delay:.3},className:"text-5xl font-bold",style:{color:T.text}},A.headerText)),t.createElement(j.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5,delay:.4}},t.createElement("div",{className:"relative w-full rounded-md overflow-hidden",style:{backgroundColor:T.background,borderColor:T.border,borderWidth:"1px",borderStyle:"solid"}},t.createElement("div",{className:"p-3 flex items-center"},t.createElement(y,{className:"h-5 w-5 text-gray-400 mr-2"}),t.createElement("textarea",{ref:he,placeholder:A.searchPlaceholder,value:$,onChange:e=>{_(e.target.value),xe(e.target)},onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),Ce())},className:"w-full resize-none outline-none text-lg py-1 font-light min-h-[36px] overflow-hidden placeholder:text-gray-400 border-none bg-transparent",style:{color:T.text,outline:"none",boxShadow:"none",fontSize:"16px"},rows:1})),!h&&J.length>0&&t.createElement("div",{className:"flex gap-2 mt-3 overflow-x-auto pb-1 px-3"},J.map(((e,r)=>t.createElement("div",{key:r,className:"relative group rounded-lg overflow-hidden flex-shrink-0",style:{width:"80px",height:"80px"}},t.createElement("img",{src:e.preview,alt:`Attached ${r+1}`,className:"w-full h-full object-cover"}),t.createElement("button",{onClick:()=>(e=>{X((t=>(URL.revokeObjectURL(t[e].preview),t.filter(((t,r)=>r!==e)))))})(r),className:"absolute top-1 right-1 bg-black bg-opacity-50 rounded-full p-1 opacity-0 group-hover:opacity-100 transition-opacity duration-200"},t.createElement(v,{className:"h-3 w-3 text-white"})))))),t.createElement("div",{className:"flex items-center justify-between px-3 py-2 bg-gray-100 border-t border-gray-200"},t.createElement("div",{className:"flex gap-2"},n.length>0&&t.createElement(re,null,t.createElement(ae,{asChild:!0},t.createElement(te,{variant:"ghost",size:"sm",className:"hover:bg-gray-200 transition-all duration-200 rounded-md h-8 flex items-center gap-2 text-gray-700"},K&&"all"!==K?t.createElement(x,{className:"h-5 w-5 text-green-500"}):t.createElement(k,{className:"h-5 w-5 text-gray-400"}),(null===(R=n.find((e=>e.id===K)))||void 0===R?void 0:R.name)||A.allDocumentsText,t.createElement(b,{className:"h-4 w-4 opacity-50"}))),t.createElement(oe,null,n.map((e=>t.createElement(ne,{key:e.id,onClick:()=>{return t=e.id,G(t),void(null==c||c(t));var t},className:e.id===K?"bg-gray-100":""},e.id===K?t.createElement(x,{className:"h-4 w-4 mr-2 text-green-500"}):t.createElement(k,{className:"h-4 w-4 mr-2 text-gray-400"}),e.name))))),!h&&t.createElement(t.Fragment,null,t.createElement("input",{type:"file",ref:ye,accept:"image/*",multiple:!0,className:"hidden",onChange:e=>{const t=e.target.files;if(t){const e=Array.from(t).map((e=>({file:e,preview:URL.createObjectURL(e)})));X((t=>[...t,...e]))}ye.current&&(ye.current.value="")}}),t.createElement(te,{variant:"ghost",size:"sm",className:"hover:bg-gray-200 rounded-md h-8 text-gray-700",onClick:()=>{var e;return null===(e=ye.current)||void 0===e?void 0:e.click()}},t.createElement(E,{className:"h-4 w-4 mr-1.5"}),A.attachImageText))),t.createElement("div",{className:"flex items-center"},t.createElement(te,{size:"sm",disabled:!$||B,className:"rounded-md h-8 w-8 bg-[#86efac] hover:bg-[#86efac]/90 disabled:opacity-50",onClick:()=>{Ce()}},B?t.createElement("div",{className:"animate-spin rounded-full h-4 w-4 border-2 border-t-transparent",style:{borderColor:"white"}}):t.createElement(N,{className:"h-4 w-4 text-gray-700"})))))),t.createElement(de,{suggestions:e||[],onQuestionClick:e=>{if(e.conversationId&&u)return me(!0),q(!0),void Ae({endpoint:u,conversationId:e.conversationId,headers:S}).then((t=>{W(t.data),le(e.conversationId),q(!0)})).catch((e=>{console.error("Error loading conversation:",e),ge(A.errorText||"An error occurred"),q(!1),W([]);const t=Te();le(t);const r=new URL(window.location.href);r.searchParams.delete("conversation"),window.history.replaceState({},"",r.toString())})).finally((()=>{me(!1)}));if(q(!0),Q(!0),!se){const e=Te();le(e)}W((t=>[...t,{question:e.question,answer:"",isLoading:!0,isSearchLoading:!0}])),Z(void 0,void 0,void 0,(function*(){try{const t=yield Le({endpoint:d,query:e.question,collectionId:K,headers:S,conversationId:se}),r=t.results;W((e=>{const a=[...e];return a[a.length-1]=Object.assign(Object.assign({},a[a.length-1]),{searchResults:r,searchQueryId:t.searchQueryId,isSearchLoading:!1}),a}));const a=yield Re({endpoint:m,searchQueryId:t.searchQueryId,headers:S,conversationId:se});yield Ee(a)}catch(e){console.error("Error generating answer:",e),W((e=>{const t=[...e];return t[t.length-1]=Object.assign(Object.assign({},t[t.length-1]),{answer:A.errorText||"An error occurred",isLoading:!1,isSearchLoading:!1}),t}))}finally{Q(!1),ke()}}))},borderColor:T.border,title:A.suggestionsTitle}),w)),P&&M.length>1&&t.createElement("div",{className:"hidden sm:block"},t.createElement(Se,{questions:M.map((e=>e.question)),currentIndex:B?M.length-1:D,activeIndex:D,onNavigate:e=>{V(e),(e=>{requestAnimationFrame((()=>{const t=fe.current[e],r=we.current;if(t&&r){const e=r.getBoundingClientRect(),a=t.getBoundingClientRect().top-e.top-80;r.scrollBy({top:a,behavior:"smooth"})}}))})(e)},theme:T,offset:O})),P&&ee&&t.createElement(j.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5},className:"fixed bottom-4 left-4 right-4 max-w-3xl mx-auto z-10",style:{left:`${O}px`}},t.createElement("div",{className:"rounded-full h-[44px] sm:h-[52px] flex items-center justify-between",style:{backgroundColor:T.background,borderColor:T.border,borderWidth:"1px",borderStyle:"solid",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1)",padding:"0 14px"}},t.createElement("div",{className:"flex items-center gap-2 sm:gap-3 flex-grow overflow-hidden h-full"},t.createElement(y,{className:"h-4 w-4 sm:h-5 sm:w-5 flex-shrink-0",style:{color:T.primary}}),t.createElement("textarea",{ref:be,placeholder:A.followUpPlaceholder,value:F,onChange:e=>{U(e.target.value),xe(e.target)},onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),je())},disabled:B,className:"w-full bg-transparent outline-none text-sm sm:text-base resize-none overflow-hidden disabled:opacity-50 border-none h-full py-3 placeholder:text-sm sm:placeholder:text-base",style:{color:T.text,outline:"none",boxShadow:"none",fontSize:"16px"},rows:1})),t.createElement("div",{className:"flex items-center gap-2 sm:gap-3 ml-2 sm:ml-3 flex-shrink-0"},t.createElement(te,{size:"icon",variant:"ghost",disabled:B||!F.trim(),className:"rounded-full transition-colors duration-200 disabled:opacity-50 h-8 w-8 sm:h-9 sm:w-9 flex items-center justify-center",style:{color:T.text,backgroundColor:"transparent"},onClick:()=>{je()}},B?t.createElement("div",{className:"animate-spin rounded-full h-4 w-4 sm:h-5 sm:w-5 border-2",style:{borderColor:`${T.text}40`,borderTopColor:T.text}}):t.createElement(C,{className:"h-4 w-4 sm:h-5 sm:w-5"}))))),H&&P&&t.createElement(Ie,{onClick:ke,theme:T})))}));Fe.displayName="ChatSearch";export{Fe as ChatSearch};
package/dist/index.d.ts CHANGED
@@ -51,6 +51,7 @@ interface Suggestion {
51
51
  id: string;
52
52
  question: string;
53
53
  conversationId?: string;
54
+ messageCount?: number;
54
55
  }
55
56
  interface ChatSearchProps {
56
57
  suggestions?: Suggestion[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brainfish-ai/components",
3
- "version": "0.0.20",
3
+ "version": "0.0.21",
4
4
  "description": "Brainfish Components",
5
5
  "license": "MIT",
6
6
  "main": "dist/cjs/index.js",