{"version":3,"file":"progress-indicators.mjs","names":[],"sources":["../../../../src/components/Loading/progress-indicators.tsx"],"sourcesContent":["import React from 'react';\n\nimport { useTranslationContext } from '../../context/TranslationContext';\n\nexport type ProgressIndicatorProps = {\n  /** Completion from 0 to 100. */\n  percent: number;\n};\n\nconst RING_RADIUS = 12;\nconst RING_CIRCUMFERENCE = 2 * Math.PI * RING_RADIUS;\n\n/** Circular progress ring for a `percent` from 0 to 100. */\nexport const CircularProgressIndicator = ({ percent }: ProgressIndicatorProps) => {\n  const { t } = useTranslationContext();\n  const dashOffset = RING_CIRCUMFERENCE * (1 - percent / 100);\n\n  return (\n    <div className='str-chat__circular-progress-indicator str-chat__progress-indicator'>\n      <svg\n        aria-label={t(\n          'loading.progressIndicators.percentComplete.ariaLabel',\n          '{{percent}} percent complete',\n          { percent },\n        )}\n        aria-valuemax={100}\n        aria-valuemin={0}\n        aria-valuenow={percent}\n        data-testid='circular-progress-ring'\n        height='100%'\n        role='progressbar'\n        viewBox='0 0 32 32'\n        width='100%'\n        xmlns='http://www.w3.org/2000/svg'\n      >\n        <circle\n          cx='16'\n          cy='16'\n          fill='none'\n          r={RING_RADIUS}\n          stroke='currentColor'\n          strokeOpacity={0.35}\n          strokeWidth='2.5'\n        />\n        <circle\n          cx='16'\n          cy='16'\n          fill='none'\n          r={RING_RADIUS}\n          stroke='currentColor'\n          strokeDasharray={RING_CIRCUMFERENCE}\n          strokeDashoffset={dashOffset}\n          strokeLinecap='round'\n          strokeWidth='2.5'\n          transform='rotate(-90 16 16)'\n        />\n      </svg>\n    </div>\n  );\n};\n"],"mappings":";;;;AASA,IAAM,cAAc;AACpB,IAAM,qBAAqB,IAAI,KAAK,KAAK;;AAGzC,IAAa,6BAA6B,EAAE,cAAsC;CAChF,MAAM,EAAE,MAAM,sBAAsB;CACpC,MAAM,aAAa,sBAAsB,IAAI,UAAU;CAEvD,OACE,oBAAC,OAAD;EAAK,WAAU;YACb,qBAAC,OAAD;GACE,cAAY,EACV,wDACA,gCACA,EAAE,QAAQ,CACZ;GACA,iBAAe;GACf,iBAAe;GACf,iBAAe;GACf,eAAY;GACZ,QAAO;GACP,MAAK;GACL,SAAQ;GACR,OAAM;GACN,OAAM;aAdR,CAgBE,oBAAC,UAAD;IACE,IAAG;IACH,IAAG;IACH,MAAK;IACL,GAAG;IACH,QAAO;IACP,eAAe;IACf,aAAY;GACb,CAAA,GACD,oBAAC,UAAD;IACE,IAAG;IACH,IAAG;IACH,MAAK;IACL,GAAG;IACH,QAAO;IACP,iBAAiB;IACjB,kBAAkB;IAClB,eAAc;IACd,aAAY;IACZ,WAAU;GACX,CAAA,CACE;;CACF,CAAA;AAET"}