(t0)
| 50 | onOpenRateLimitOptions?: () => void; |
| 51 | }; |
| 52 | export function RateLimitMessage(t0) { |
| 53 | const $ = _c(16); |
| 54 | const { |
| 55 | text, |
| 56 | onOpenRateLimitOptions |
| 57 | } = t0; |
| 58 | let t1; |
| 59 | if ($[0] === Symbol.for("react.memo_cache_sentinel")) { |
| 60 | t1 = getCurrentRateLimitUiSessionState(); |
| 61 | $[0] = t1; |
| 62 | } else { |
| 63 | t1 = $[0]; |
| 64 | } |
| 65 | const rateLimitSession = t1; |
| 66 | const isTeamOrEnterprise = rateLimitSession.isTeamOrEnterprise; |
| 67 | const rateLimitTier = rateLimitSession.rateLimitTier; |
| 68 | const isMax20x = rateLimitTier === "default_claude_max_20x"; |
| 69 | let t3; |
| 70 | if ($[1] !== rateLimitSession.isOauthBackedFirstPartySession) { |
| 71 | t3 = shouldProcessMockLimits() || rateLimitSession.isOauthBackedFirstPartySession; |
| 72 | $[1] = rateLimitSession.isOauthBackedFirstPartySession; |
| 73 | $[2] = t3; |
| 74 | } else { |
| 75 | t3 = $[2]; |
| 76 | } |
| 77 | const shouldShowUpsell = t3; |
| 78 | const canSeeRateLimitOptionsUpsell = shouldShowUpsell && !isMax20x; |
| 79 | const [hasOpenedInteractiveMenu, setHasOpenedInteractiveMenu] = useState(false); |
| 80 | const claudeAiLimits = useClaudeAiLimits(); |
| 81 | const isCurrentlyRateLimited = claudeAiLimits.status === "rejected" && claudeAiLimits.resetsAt !== undefined && !claudeAiLimits.isUsingOverage; |
| 82 | const shouldAutoOpenRateLimitOptionsMenu = canSeeRateLimitOptionsUpsell && !hasOpenedInteractiveMenu && isCurrentlyRateLimited && onOpenRateLimitOptions; |
| 83 | let t4; |
| 84 | let t5; |
| 85 | if ($[3] !== onOpenRateLimitOptions || $[4] !== shouldAutoOpenRateLimitOptionsMenu) { |
| 86 | t4 = () => { |
| 87 | if (shouldAutoOpenRateLimitOptionsMenu) { |
| 88 | setHasOpenedInteractiveMenu(true); |
| 89 | onOpenRateLimitOptions(); |
| 90 | } |
| 91 | }; |
| 92 | t5 = [shouldAutoOpenRateLimitOptionsMenu, onOpenRateLimitOptions]; |
| 93 | $[3] = onOpenRateLimitOptions; |
| 94 | $[4] = shouldAutoOpenRateLimitOptionsMenu; |
| 95 | $[5] = t4; |
| 96 | $[6] = t5; |
| 97 | } else { |
| 98 | t4 = $[5]; |
| 99 | t5 = $[6]; |
| 100 | } |
| 101 | useEffect(t4, t5); |
| 102 | let t6; |
| 103 | bb0: { |
| 104 | let t7; |
| 105 | if ($[7] !== shouldAutoOpenRateLimitOptionsMenu) { |
| 106 | t7 = getUpsellMessage({ |
| 107 | shouldShowUpsell, |
| 108 | isMax20x, |
| 109 | isExtraUsageCommandEnabled: extraUsage.isEnabled(), |
nothing calls this directly
no test coverage detected