{"version":3,"file":"AIStateIndicator.mjs","names":[],"sources":["../../../../../src/plugins/AIComponents/AIStateIndicator/AIStateIndicator.tsx"],"sourcesContent":["import clsx from 'clsx';\nimport { useMemo } from 'react';\nimport { useTranslationContext } from '../../../context/TranslationContext';\nimport { ThemeScopeProvider, useAIThemeScopeClassName } from '../themeScope';\n\nexport const AIStateIndicator = ({ text }: { text?: string }) => {\n  const themeScopeClassName = useAIThemeScopeClassName();\n  const { t } = useTranslationContext();\n  const messages = useMemo(\n    () => [\n      t('aiComponents.stateIndicator.thinkingReallyHard.text', 'Thinking really hard'),\n      t(\n        'aiComponents.stateIndicator.puttingOnMyThinkingCap.text',\n        'Putting on my thinking cap',\n      ),\n      t('aiComponents.stateIndicator.consultingTheAiGods.text', 'Consulting the AI gods'),\n      t('aiComponents.stateIndicator.brewingUpAnAnswer.text', 'Brewing up an answer'),\n      t('aiComponents.stateIndicator.crunchingTheNumbers.text', 'Crunching the numbers'),\n      t(\n        'aiComponents.stateIndicator.readingTheDigitalTeaLeaves.text',\n        'Reading the digital tea leaves',\n      ),\n      t('aiComponents.stateIndicator.firingUpTheNeurons.text', 'Firing up the neurons'),\n      t(\n        'aiComponents.stateIndicator.summoningMyInnerGenius.text',\n        'Summoning my inner genius',\n      ),\n      t('aiComponents.stateIndicator.connectingTheDots.text', 'Connecting the dots'),\n      t('aiComponents.stateIndicator.workingMyMagic.text', 'Working my magic'),\n      t(\n        'aiComponents.stateIndicator.channelingMyInnerEinstein.text',\n        'Channeling my inner Einstein',\n      ),\n      t(\n        'aiComponents.stateIndicator.cookingUpSomethingGood.text',\n        'Cooking up something good',\n      ),\n    ],\n    [t],\n  );\n  const messageIndex = useMemo(\n    () => Math.floor(Math.random() * messages.length),\n    [messages.length],\n  );\n\n  return (\n    <ThemeScopeProvider>\n      <div\n        aria-live='polite'\n        className={clsx(themeScopeClassName, 'str-chat__ai-state-indicator')}\n        role='status'\n      >\n        <div className='str-chat__ai-state-indicator__content'>\n          <div className='str-chat__ai-state-indicator__dots'>\n            <span className='str-chat__ai-state-indicator__dot' />\n            <span className='str-chat__ai-state-indicator__dot' />\n            <span className='str-chat__ai-state-indicator__dot' />\n          </div>\n          <span className='str-chat__ai-state-indicator__text'>\n            {typeof text === 'string' ? text : messages[messageIndex]}\n          </span>\n        </div>\n      </div>\n    </ThemeScopeProvider>\n  );\n};\n"],"mappings":";;;;;;;AAKA,IAAa,oBAAoB,EAAE,WAA8B;CAC/D,MAAM,sBAAsB,yBAAyB;CACrD,MAAM,EAAE,MAAM,sBAAsB;CACpC,MAAM,WAAW,cACT;EACJ,EAAE,uDAAuD,sBAAsB;EAC/E,EACE,2DACA,4BACF;EACA,EAAE,wDAAwD,wBAAwB;EAClF,EAAE,sDAAsD,sBAAsB;EAC9E,EAAE,wDAAwD,uBAAuB;EACjF,EACE,+DACA,gCACF;EACA,EAAE,uDAAuD,uBAAuB;EAChF,EACE,2DACA,2BACF;EACA,EAAE,sDAAsD,qBAAqB;EAC7E,EAAE,mDAAmD,kBAAkB;EACvE,EACE,8DACA,8BACF;EACA,EACE,2DACA,2BACF;CACF,GACA,CAAC,CAAC,CACJ;CACA,MAAM,eAAe,cACb,KAAK,MAAM,KAAK,OAAO,IAAI,SAAS,MAAM,GAChD,CAAC,SAAS,MAAM,CAClB;CAEA,OACE,oBAAC,oBAAD,EAAA,UACE,oBAAC,OAAD;EACE,aAAU;EACV,WAAW,KAAK,qBAAqB,8BAA8B;EACnE,MAAK;YAEL,qBAAC,OAAD;GAAK,WAAU;aAAf,CACE,qBAAC,OAAD;IAAK,WAAU;cAAf;KACE,oBAAC,QAAD,EAAM,WAAU,oCAAqC,CAAA;KACrD,oBAAC,QAAD,EAAM,WAAU,oCAAqC,CAAA;KACrD,oBAAC,QAAD,EAAM,WAAU,oCAAqC,CAAA;IAClD;OACL,oBAAC,QAAD;IAAM,WAAU;cACb,OAAO,SAAS,WAAW,OAAO,SAAS;GACxC,CAAA,CACH;;CACF,CAAA,EACa,CAAA;AAExB"}