@mushi-mushi/web 1.19.2 → 1.21.0

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/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { readPageFaviconHref, resolveEnvConfig, createLogger, noopLogger, createApiClient, createPreFilter, createOfflineQueue, createRateLimiter, createPiiScrubber, createBreadcrumbBuffer, getReporterToken, getDeviceFingerprintHash, MAX_SCREENSHOT_DATA_URL_BYTES, getSessionId, captureEnvironment, newUuid, DEFAULT_API_ENDPOINT, isLikelyGenericFavicon, MUSHI_INTERNAL_INIT_MARKER, MUSHI_INTERNAL_HEADER, parseIdentityToken, normaliseThrown, resolveProjectDomain, projectInitials, projectFaviconUrlCandidates } from '@mushi-mushi/core';
1
+ import { mushiPalette, resolveWidgetAccent, MUSHI_REPORTER_STATUS, MUSHI_GEOMETRY, MUSHI_Z, MUSHI_MOTION, MUSHI_TYPE, MUSHI_BANNER_BRAND_BORDER, MUSHI_BANNER_NEON, MUSHI_INVERSE, MUSHI_ON_ACCENT, MUSHI_ACCENT_SHADOW, MUSHI_TIER_COLORS, readPageFaviconHref, resolveEnvConfig, createLogger, noopLogger, createApiClient, createPreFilter, createOfflineQueue, createRateLimiter, createPiiScrubber, createBreadcrumbBuffer, getReporterToken, getDeviceFingerprintHash, MAX_SCREENSHOT_DATA_URL_BYTES, captureEnvironment, getSessionId, newUuid, DEFAULT_API_ENDPOINT, MUSHI_RADIUS, MUSHI_SPACING, isLikelyGenericFavicon, MUSHI_INTERNAL_INIT_MARKER, MUSHI_INTERNAL_HEADER, parseIdentityToken, normaliseThrown, MUSHI_COLORS_LIGHT, resolveProjectDomain, projectInitials, projectFaviconUrlCandidates, sha256Hex } from '@mushi-mushi/core';
2
2
 
3
3
  // src/capture/compress-screenshot.ts
4
4
  async function compressScreenshotDataUrl(dataUrl, maxBytes = MAX_SCREENSHOT_DATA_URL_BYTES) {
@@ -46,10 +46,22 @@ var en = {
46
46
  submit: "Submit",
47
47
  submitting: "Submitting\u2026",
48
48
  submitted: "Thank you! Your report has been submitted.",
49
- error: "Something went wrong. Please try again."
49
+ error: "Could not send your report. Check your connection and try again."
50
50
  },
51
51
  step1: {
52
52
  heading: "What kind of issue?",
53
+ reportSectionLabel: "Report an issue",
54
+ moreNavLabel: "More",
55
+ moreNav: {
56
+ yourReports: "Your reports",
57
+ yourReportsDesc: "See status, developer replies, and respond",
58
+ unreadNew: "new",
59
+ communityIdeas: "Community ideas",
60
+ communityIdeasDesc: "Vote on features and see what shipped",
61
+ leaderboard: "Leaderboard",
62
+ joinCommunity: "Join community \xB7 Track reports across apps",
63
+ myAccount: "My account"
64
+ },
53
65
  categories: {
54
66
  bug: "Bug",
55
67
  slow: "Slow / Laggy",
@@ -95,6 +107,100 @@ var en = {
95
107
  "Page froze for 10 seconds",
96
108
  "Layout looks broken here"
97
109
  ]
110
+ },
111
+ assistant: {
112
+ defaultLabel: "Ask",
113
+ defaultGreeting: "Ask about this page \u2014 I only use what you see here.",
114
+ inputPlaceholder: "Type your question\u2026",
115
+ sendAriaLabel: "Send",
116
+ hubDescription: "Get help using this app",
117
+ thinking: "Thinking\u2026",
118
+ errors: {
119
+ noResponse: "No response \u2014 check your connection and try again.",
120
+ generic: "Could not reach the assistant. Try again in a moment."
121
+ }
122
+ },
123
+ flows: {
124
+ eyebrows: {
125
+ inbox: "Mushi \xB7 Inbox",
126
+ roadmap: "Mushi \xB7 Roadmap",
127
+ community: "Mushi \xB7 Community",
128
+ identity: "Mushi \xB7 Identity",
129
+ signIn: "Mushi \xB7 Sign in",
130
+ allApps: "Mushi \xB7 All apps",
131
+ receipt: "Mushi \xB7 Receipt",
132
+ thread: "Mushi \xB7 Inbox"
133
+ },
134
+ reports: {
135
+ title: "Your reports",
136
+ loading: "Loading reports\u2026",
137
+ empty: "No reports from this browser yet.",
138
+ leaderboardLink: "Leaderboard"
139
+ },
140
+ roadmap: {
141
+ title: "Community ideas",
142
+ loading: "Loading ideas\u2026",
143
+ empty: "No community ideas yet. Be the first to suggest one.",
144
+ shipped: "Shipped",
145
+ vote: "Vote",
146
+ voted: "Voted",
147
+ voteCount: "{n} votes",
148
+ untitled: "Untitled idea"
149
+ },
150
+ leaderboard: {
151
+ title: "Global leaderboard",
152
+ loading: "Loading leaderboard\u2026",
153
+ empty: "No contributors yet \u2014 be the first!",
154
+ signInPrompt: "Sign in to see your rank \u2192",
155
+ myRank: "You are ranked #{rank} this month",
156
+ footer: "Global contributors this month \xB7 Points refresh monthly",
157
+ anon: "Anon"
158
+ },
159
+ account: {
160
+ title: "Mushi account",
161
+ checkEmailTitle: "Check your email",
162
+ joinTitle: "Join the community",
163
+ emailLabel: "Email address",
164
+ emailPlaceholder: "Email",
165
+ signInPrompt: "Sign in to see your reports across all apps and climb the global leaderboard. No password needed.",
166
+ magicLinkSent: "We sent a sign-in link to {email}. Click it to connect your reports across apps.",
167
+ resendEmail: "Resend email",
168
+ sendLink: "Send sign-in link",
169
+ sending: "Sending\u2026",
170
+ crossAppReports: "My reports across all apps \u2192",
171
+ viewLeaderboard: "View global leaderboard \u2192",
172
+ signOut: "Sign out",
173
+ rankSummary: "Rank #{rank} \xB7 {points} pts this month"
174
+ },
175
+ crossApp: {
176
+ title: "My reports",
177
+ loading: "Loading your reports\u2026",
178
+ empty: "No reports filed yet.",
179
+ unknownApp: "Unknown app"
180
+ },
181
+ thread: {
182
+ title: "Report thread",
183
+ loading: "Loading thread\u2026",
184
+ empty: "No developer replies yet.",
185
+ confirmFixed: "Yes, fixed for me",
186
+ notFixed: "Not fixed yet",
187
+ replyPlaceholder: "Reply to the developer\u2026",
188
+ send: "Send"
189
+ },
190
+ success: {
191
+ trackReport: "Track this report \u203A",
192
+ receipt: "Receipt",
193
+ delivering: "Delivering to the team\u2026",
194
+ queuedOffline: "Queued offline",
195
+ queuedHint: "We'll send it the moment you're back online.",
196
+ trackOnMushi: "Track on Mushi",
197
+ slaDefault: "We will review your report."
198
+ },
199
+ featureRequest: {
200
+ label: "Feature request",
201
+ description: "Suggest a change"
202
+ },
203
+ poweredBy: "Powered by Mushi v{version}"
98
204
  }
99
205
  };
100
206
 
@@ -112,6 +218,18 @@ var ja = {
112
218
  },
113
219
  step1: {
114
220
  heading: "\u3069\u306E\u3088\u3046\u306A\u554F\u984C\u3067\u3059\u304B\uFF1F",
221
+ reportSectionLabel: "\u554F\u984C\u3092\u5831\u544A",
222
+ moreNavLabel: "\u305D\u306E\u4ED6",
223
+ moreNav: {
224
+ yourReports: "\u3042\u306A\u305F\u306E\u30EC\u30DD\u30FC\u30C8",
225
+ yourReportsDesc: "\u30B9\u30C6\u30FC\u30BF\u30B9\u3001\u958B\u767A\u8005\u304B\u3089\u306E\u8FD4\u4FE1\u3001\u8FD4\u7B54",
226
+ unreadNew: "\u4EF6\u306E\u65B0\u7740",
227
+ communityIdeas: "\u30B3\u30DF\u30E5\u30CB\u30C6\u30A3\u306E\u30A2\u30A4\u30C7\u30A2",
228
+ communityIdeasDesc: "\u6A5F\u80FD\u306B\u6295\u7968\u3057\u3066\u30EA\u30EA\u30FC\u30B9\u72B6\u6CC1\u3092\u78BA\u8A8D",
229
+ leaderboard: "\u30EA\u30FC\u30C0\u30FC\u30DC\u30FC\u30C9",
230
+ joinCommunity: "\u30B3\u30DF\u30E5\u30CB\u30C6\u30A3\u306B\u53C2\u52A0 \xB7 \u30A2\u30D7\u30EA\u6A2A\u65AD\u3067\u30EC\u30DD\u30FC\u30C8\u3092\u8FFD\u8DE1",
231
+ myAccount: "\u30DE\u30A4\u30A2\u30AB\u30A6\u30F3\u30C8"
232
+ },
115
233
  categories: {
116
234
  bug: "\u30D0\u30B0",
117
235
  slow: "\u9045\u3044\u30FB\u91CD\u3044",
@@ -157,6 +275,100 @@ var ja = {
157
275
  "\u30DA\u30FC\u30B8\u304C10\u79D2\u56FA\u307E\u3063\u305F",
158
276
  "\u30EC\u30A4\u30A2\u30A6\u30C8\u304C\u5D29\u308C\u3066\u3044\u308B"
159
277
  ]
278
+ },
279
+ assistant: {
280
+ defaultLabel: "\u8CEA\u554F",
281
+ defaultGreeting: "\u3053\u306E\u30DA\u30FC\u30B8\u306B\u3064\u3044\u3066\u8CEA\u554F\u3057\u3066\u304F\u3060\u3055\u3044 \u2014 \u8868\u793A\u3055\u308C\u3066\u3044\u308B\u5185\u5BB9\u3060\u3051\u3092\u4F7F\u3044\u307E\u3059\u3002",
282
+ inputPlaceholder: "\u8CEA\u554F\u3092\u5165\u529B\u2026",
283
+ sendAriaLabel: "\u9001\u4FE1",
284
+ hubDescription: "\u3053\u306E\u30A2\u30D7\u30EA\u306E\u4F7F\u3044\u65B9\u3092\u805E\u304F",
285
+ thinking: "\u8003\u3048\u4E2D\u2026",
286
+ errors: {
287
+ noResponse: "\u5FDC\u7B54\u304C\u3042\u308A\u307E\u305B\u3093 \u2014 \u63A5\u7D9A\u3092\u78BA\u8A8D\u3057\u3066\u518D\u8A66\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002",
288
+ generic: "\u30A2\u30B7\u30B9\u30BF\u30F3\u30C8\u306B\u63A5\u7D9A\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u3057\u3070\u3089\u304F\u3057\u3066\u304B\u3089\u518D\u8A66\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002"
289
+ }
290
+ },
291
+ flows: {
292
+ eyebrows: {
293
+ inbox: "Mushi \xB7 \u53D7\u4FE1\u7BB1",
294
+ roadmap: "Mushi \xB7 \u30A2\u30A4\u30C7\u30A2",
295
+ community: "Mushi \xB7 \u30B3\u30DF\u30E5\u30CB\u30C6\u30A3",
296
+ identity: "Mushi \xB7 \u30A2\u30AB\u30A6\u30F3\u30C8",
297
+ signIn: "Mushi \xB7 \u30B5\u30A4\u30F3\u30A4\u30F3",
298
+ allApps: "Mushi \xB7 \u5168\u30A2\u30D7\u30EA",
299
+ receipt: "Mushi \xB7 \u53D7\u4ED8",
300
+ thread: "Mushi \xB7 \u53D7\u4FE1\u7BB1"
301
+ },
302
+ reports: {
303
+ title: "\u3042\u306A\u305F\u306E\u30EC\u30DD\u30FC\u30C8",
304
+ loading: "\u30EC\u30DD\u30FC\u30C8\u3092\u8AAD\u307F\u8FBC\u307F\u4E2D\u2026",
305
+ empty: "\u3053\u306E\u30D6\u30E9\u30A6\u30B6\u304B\u3089\u306E\u30EC\u30DD\u30FC\u30C8\u306F\u307E\u3060\u3042\u308A\u307E\u305B\u3093\u3002",
306
+ leaderboardLink: "\u30E9\u30F3\u30AD\u30F3\u30B0"
307
+ },
308
+ roadmap: {
309
+ title: "\u30B3\u30DF\u30E5\u30CB\u30C6\u30A3\u306E\u30A2\u30A4\u30C7\u30A2",
310
+ loading: "\u30A2\u30A4\u30C7\u30A2\u3092\u8AAD\u307F\u8FBC\u307F\u4E2D\u2026",
311
+ empty: "\u307E\u3060\u30A2\u30A4\u30C7\u30A2\u304C\u3042\u308A\u307E\u305B\u3093\u3002\u6700\u521D\u306E\u63D0\u6848\u3092\u3069\u3046\u305E\u3002",
312
+ shipped: "\u30EA\u30EA\u30FC\u30B9\u6E08\u307F",
313
+ vote: "\u6295\u7968",
314
+ voted: "\u6295\u7968\u6E08\u307F",
315
+ voteCount: "{n} \u7968",
316
+ untitled: "\u7121\u984C\u306E\u30A2\u30A4\u30C7\u30A2"
317
+ },
318
+ leaderboard: {
319
+ title: "\u30B0\u30ED\u30FC\u30D0\u30EB\u30E9\u30F3\u30AD\u30F3\u30B0",
320
+ loading: "\u30E9\u30F3\u30AD\u30F3\u30B0\u3092\u8AAD\u307F\u8FBC\u307F\u4E2D\u2026",
321
+ empty: "\u307E\u3060\u53C2\u52A0\u8005\u304C\u3044\u307E\u305B\u3093 \u2014 \u6700\u521D\u306E\u4E00\u4EBA\u306B\u306A\u308D\u3046\u3002",
322
+ signInPrompt: "\u30B5\u30A4\u30F3\u30A4\u30F3\u3057\u3066\u9806\u4F4D\u3092\u898B\u308B \u2192",
323
+ myRank: "\u4ECA\u6708\u306E\u9806\u4F4D\u306F #{rank}",
324
+ footer: "\u4ECA\u6708\u306E\u30B0\u30ED\u30FC\u30D0\u30EB\u8CA2\u732E\u8005 \xB7 \u30DD\u30A4\u30F3\u30C8\u306F\u6BCE\u6708\u30EA\u30BB\u30C3\u30C8",
325
+ anon: "\u533F\u540D"
326
+ },
327
+ account: {
328
+ title: "Mushi \u30A2\u30AB\u30A6\u30F3\u30C8",
329
+ checkEmailTitle: "\u30E1\u30FC\u30EB\u3092\u78BA\u8A8D",
330
+ joinTitle: "\u30B3\u30DF\u30E5\u30CB\u30C6\u30A3\u306B\u53C2\u52A0",
331
+ emailLabel: "\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",
332
+ emailPlaceholder: "\u30E1\u30FC\u30EB",
333
+ signInPrompt: "\u30B5\u30A4\u30F3\u30A4\u30F3\u3059\u308B\u3068\u5168\u30A2\u30D7\u30EA\u306E\u30EC\u30DD\u30FC\u30C8\u3068\u30E9\u30F3\u30AD\u30F3\u30B0\u304C\u898B\u3089\u308C\u307E\u3059\u3002\u30D1\u30B9\u30EF\u30FC\u30C9\u4E0D\u8981\u3002",
334
+ magicLinkSent: "{email} \u306B\u30B5\u30A4\u30F3\u30A4\u30F3\u30EA\u30F3\u30AF\u3092\u9001\u308A\u307E\u3057\u305F\u3002\u30EA\u30F3\u30AF\u3092\u958B\u3044\u3066\u30EC\u30DD\u30FC\u30C8\u3092\u63A5\u7D9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002",
335
+ resendEmail: "\u30E1\u30FC\u30EB\u3092\u518D\u9001",
336
+ sendLink: "\u30B5\u30A4\u30F3\u30A4\u30F3\u30EA\u30F3\u30AF\u3092\u9001\u308B",
337
+ sending: "\u9001\u4FE1\u4E2D\u2026",
338
+ crossAppReports: "\u5168\u30A2\u30D7\u30EA\u306E\u30EC\u30DD\u30FC\u30C8 \u2192",
339
+ viewLeaderboard: "\u30B0\u30ED\u30FC\u30D0\u30EB\u30E9\u30F3\u30AD\u30F3\u30B0 \u2192",
340
+ signOut: "\u30B5\u30A4\u30F3\u30A2\u30A6\u30C8",
341
+ rankSummary: "\u9806\u4F4D #{rank} \xB7 \u4ECA\u6708 {points} pts"
342
+ },
343
+ crossApp: {
344
+ title: "\u30DE\u30A4\u30EC\u30DD\u30FC\u30C8",
345
+ loading: "\u30EC\u30DD\u30FC\u30C8\u3092\u8AAD\u307F\u8FBC\u307F\u4E2D\u2026",
346
+ empty: "\u307E\u3060\u30EC\u30DD\u30FC\u30C8\u304C\u3042\u308A\u307E\u305B\u3093\u3002",
347
+ unknownApp: "\u4E0D\u660E\u306A\u30A2\u30D7\u30EA"
348
+ },
349
+ thread: {
350
+ title: "\u30EC\u30DD\u30FC\u30C8\u30B9\u30EC\u30C3\u30C9",
351
+ loading: "\u30B9\u30EC\u30C3\u30C9\u3092\u8AAD\u307F\u8FBC\u307F\u4E2D\u2026",
352
+ empty: "\u958B\u767A\u8005\u304B\u3089\u306E\u8FD4\u4FE1\u306F\u307E\u3060\u3042\u308A\u307E\u305B\u3093\u3002",
353
+ confirmFixed: "\u306F\u3044\u3001\u76F4\u308A\u307E\u3057\u305F",
354
+ notFixed: "\u307E\u3060\u76F4\u3063\u3066\u3044\u307E\u305B\u3093",
355
+ replyPlaceholder: "\u958B\u767A\u8005\u306B\u8FD4\u4FE1\u2026",
356
+ send: "\u9001\u4FE1"
357
+ },
358
+ success: {
359
+ trackReport: "\u3053\u306E\u30EC\u30DD\u30FC\u30C8\u3092\u8FFD\u8DE1 \u203A",
360
+ receipt: "\u53D7\u4ED8",
361
+ delivering: "\u30C1\u30FC\u30E0\u306B\u9001\u4FE1\u4E2D\u2026",
362
+ queuedOffline: "\u30AA\u30D5\u30E9\u30A4\u30F3\u5F85\u6A5F\u4E2D",
363
+ queuedHint: "\u30AA\u30F3\u30E9\u30A4\u30F3\u306B\u623B\u308A\u6B21\u7B2C\u9001\u4FE1\u3057\u307E\u3059\u3002",
364
+ trackOnMushi: "Mushi\u3067\u8FFD\u8DE1",
365
+ slaDefault: "\u30EC\u30DD\u30FC\u30C8\u3092\u78BA\u8A8D\u3057\u307E\u3059\u3002"
366
+ },
367
+ featureRequest: {
368
+ label: "\u6A5F\u80FD\u30EA\u30AF\u30A8\u30B9\u30C8",
369
+ description: "\u5909\u66F4\u3092\u63D0\u6848"
370
+ },
371
+ poweredBy: "Mushi v{version}"
160
372
  }
161
373
  };
162
374
 
@@ -174,6 +386,18 @@ var th = {
174
386
  },
175
387
  step1: {
176
388
  heading: "\u0E1B\u0E31\u0E0D\u0E2B\u0E32\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E44\u0E2B\u0E19?",
389
+ reportSectionLabel: "\u0E23\u0E32\u0E22\u0E07\u0E32\u0E19\u0E1B\u0E31\u0E0D\u0E2B\u0E32",
390
+ moreNavLabel: "\u0E40\u0E1E\u0E34\u0E48\u0E21\u0E40\u0E15\u0E34\u0E21",
391
+ moreNav: {
392
+ yourReports: "\u0E23\u0E32\u0E22\u0E07\u0E32\u0E19\u0E02\u0E2D\u0E07\u0E04\u0E38\u0E13",
393
+ yourReportsDesc: "\u0E14\u0E39\u0E2A\u0E16\u0E32\u0E19\u0E30 \u0E04\u0E33\u0E15\u0E2D\u0E1A\u0E08\u0E32\u0E01\u0E19\u0E31\u0E01\u0E1E\u0E31\u0E12\u0E19\u0E32 \u0E41\u0E25\u0E30\u0E15\u0E2D\u0E1A\u0E01\u0E25\u0E31\u0E1A",
394
+ unreadNew: "\u0E43\u0E2B\u0E21\u0E48",
395
+ communityIdeas: "\u0E44\u0E2D\u0E40\u0E14\u0E35\u0E22\u0E08\u0E32\u0E01\u0E0A\u0E38\u0E21\u0E0A\u0E19",
396
+ communityIdeasDesc: "\u0E42\u0E2B\u0E27\u0E15\u0E1F\u0E35\u0E40\u0E08\u0E2D\u0E23\u0E4C\u0E41\u0E25\u0E30\u0E14\u0E39\u0E2A\u0E34\u0E48\u0E07\u0E17\u0E35\u0E48\u0E1B\u0E25\u0E48\u0E2D\u0E22\u0E41\u0E25\u0E49\u0E27",
397
+ leaderboard: "\u0E01\u0E23\u0E30\u0E14\u0E32\u0E19\u0E1C\u0E39\u0E49\u0E19\u0E33",
398
+ joinCommunity: "\u0E40\u0E02\u0E49\u0E32\u0E23\u0E48\u0E27\u0E21\u0E0A\u0E38\u0E21\u0E0A\u0E19 \xB7 \u0E15\u0E34\u0E14\u0E15\u0E32\u0E21\u0E23\u0E32\u0E22\u0E07\u0E32\u0E19\u0E02\u0E49\u0E32\u0E21\u0E41\u0E2D\u0E1B",
399
+ myAccount: "\u0E1A\u0E31\u0E0D\u0E0A\u0E35\u0E02\u0E2D\u0E07\u0E09\u0E31\u0E19"
400
+ },
177
401
  categories: {
178
402
  bug: "\u0E1A\u0E31\u0E01",
179
403
  slow: "\u0E0A\u0E49\u0E32 / \u0E41\u0E25\u0E04",
@@ -219,6 +443,100 @@ var th = {
219
443
  "\u0E2B\u0E19\u0E49\u0E32\u0E04\u0E49\u0E32\u0E07\u0E19\u0E32\u0E19 10 \u0E27\u0E34\u0E19\u0E32\u0E17\u0E35",
220
444
  "\u0E40\u0E25\u0E22\u0E4C\u0E40\u0E2D\u0E32\u0E15\u0E4C\u0E1E\u0E31\u0E07"
221
445
  ]
446
+ },
447
+ assistant: {
448
+ defaultLabel: "\u0E16\u0E32\u0E21",
449
+ defaultGreeting: "\u0E16\u0E32\u0E21\u0E40\u0E01\u0E35\u0E48\u0E22\u0E27\u0E01\u0E31\u0E1A\u0E2B\u0E19\u0E49\u0E32\u0E19\u0E35\u0E49 \u2014 \u0E43\u0E0A\u0E49\u0E40\u0E09\u0E1E\u0E32\u0E30\u0E2A\u0E34\u0E48\u0E07\u0E17\u0E35\u0E48\u0E04\u0E38\u0E13\u0E40\u0E2B\u0E47\u0E19\u0E1A\u0E19\u0E2B\u0E19\u0E49\u0E32\u0E08\u0E2D",
450
+ inputPlaceholder: "\u0E1E\u0E34\u0E21\u0E1E\u0E4C\u0E04\u0E33\u0E16\u0E32\u0E21\u0E02\u0E2D\u0E07\u0E04\u0E38\u0E13\u2026",
451
+ sendAriaLabel: "\u0E2A\u0E48\u0E07",
452
+ hubDescription: "\u0E02\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E0A\u0E48\u0E27\u0E22\u0E40\u0E2B\u0E25\u0E37\u0E2D\u0E43\u0E19\u0E01\u0E32\u0E23\u0E43\u0E0A\u0E49\u0E41\u0E2D\u0E1B",
453
+ thinking: "\u0E01\u0E33\u0E25\u0E31\u0E07\u0E04\u0E34\u0E14\u2026",
454
+ errors: {
455
+ noResponse: "\u0E44\u0E21\u0E48\u0E21\u0E35\u0E01\u0E32\u0E23\u0E15\u0E2D\u0E1A\u0E01\u0E25\u0E31\u0E1A \u2014 \u0E15\u0E23\u0E27\u0E08\u0E2A\u0E2D\u0E1A\u0E01\u0E32\u0E23\u0E40\u0E0A\u0E37\u0E48\u0E2D\u0E21\u0E15\u0E48\u0E2D\u0E41\u0E25\u0E49\u0E27\u0E25\u0E2D\u0E07\u0E2D\u0E35\u0E01\u0E04\u0E23\u0E31\u0E49\u0E07",
456
+ generic: "\u0E40\u0E0A\u0E37\u0E48\u0E2D\u0E21\u0E15\u0E48\u0E2D\u0E1C\u0E39\u0E49\u0E0A\u0E48\u0E27\u0E22\u0E44\u0E21\u0E48\u0E44\u0E14\u0E49 \u0E25\u0E2D\u0E07\u0E2D\u0E35\u0E01\u0E04\u0E23\u0E31\u0E49\u0E07\u0E43\u0E19\u0E2D\u0E35\u0E01\u0E2A\u0E31\u0E01\u0E04\u0E23\u0E39\u0E48"
457
+ }
458
+ },
459
+ flows: {
460
+ eyebrows: {
461
+ inbox: "Mushi \xB7 \u0E01\u0E25\u0E48\u0E2D\u0E07\u0E02\u0E32\u0E40\u0E02\u0E49\u0E32",
462
+ roadmap: "Mushi \xB7 \u0E44\u0E2D\u0E40\u0E14\u0E35\u0E22",
463
+ community: "Mushi \xB7 \u0E0A\u0E38\u0E21\u0E0A\u0E19",
464
+ identity: "Mushi \xB7 \u0E1A\u0E31\u0E0D\u0E0A\u0E35",
465
+ signIn: "Mushi \xB7 \u0E40\u0E02\u0E49\u0E32\u0E2A\u0E39\u0E48\u0E23\u0E30\u0E1A\u0E1A",
466
+ allApps: "Mushi \xB7 \u0E17\u0E38\u0E01\u0E41\u0E2D\u0E1B",
467
+ receipt: "Mushi \xB7 \u0E43\u0E1A\u0E23\u0E31\u0E1A",
468
+ thread: "Mushi \xB7 \u0E01\u0E25\u0E48\u0E2D\u0E07\u0E02\u0E32\u0E40\u0E02\u0E49\u0E32"
469
+ },
470
+ reports: {
471
+ title: "\u0E23\u0E32\u0E22\u0E07\u0E32\u0E19\u0E02\u0E2D\u0E07\u0E04\u0E38\u0E13",
472
+ loading: "\u0E01\u0E33\u0E25\u0E31\u0E07\u0E42\u0E2B\u0E25\u0E14\u0E23\u0E32\u0E22\u0E07\u0E32\u0E19\u2026",
473
+ empty: "\u0E22\u0E31\u0E07\u0E44\u0E21\u0E48\u0E21\u0E35\u0E23\u0E32\u0E22\u0E07\u0E32\u0E19\u0E08\u0E32\u0E01\u0E40\u0E1A\u0E23\u0E32\u0E27\u0E4C\u0E40\u0E0B\u0E2D\u0E23\u0E4C\u0E19\u0E35\u0E49",
474
+ leaderboardLink: "\u0E01\u0E23\u0E30\u0E14\u0E32\u0E19\u0E1C\u0E39\u0E49\u0E19\u0E33"
475
+ },
476
+ roadmap: {
477
+ title: "\u0E44\u0E2D\u0E40\u0E14\u0E35\u0E22\u0E08\u0E32\u0E01\u0E0A\u0E38\u0E21\u0E0A\u0E19",
478
+ loading: "\u0E01\u0E33\u0E25\u0E31\u0E07\u0E42\u0E2B\u0E25\u0E14\u0E44\u0E2D\u0E40\u0E14\u0E35\u0E22\u2026",
479
+ empty: "\u0E22\u0E31\u0E07\u0E44\u0E21\u0E48\u0E21\u0E35\u0E44\u0E2D\u0E40\u0E14\u0E35\u0E22 \u0E40\u0E1B\u0E47\u0E19\u0E04\u0E19\u0E41\u0E23\u0E01\u0E17\u0E35\u0E48\u0E40\u0E2A\u0E19\u0E2D\u0E44\u0E14\u0E49",
480
+ shipped: "\u0E1B\u0E25\u0E48\u0E2D\u0E22\u0E41\u0E25\u0E49\u0E27",
481
+ vote: "\u0E42\u0E2B\u0E27\u0E15",
482
+ voted: "\u0E42\u0E2B\u0E27\u0E15\u0E41\u0E25\u0E49\u0E27",
483
+ voteCount: "{n} \u0E42\u0E2B\u0E27\u0E15",
484
+ untitled: "\u0E44\u0E2D\u0E40\u0E14\u0E35\u0E22\u0E44\u0E21\u0E48\u0E21\u0E35\u0E0A\u0E37\u0E48\u0E2D"
485
+ },
486
+ leaderboard: {
487
+ title: "\u0E01\u0E23\u0E30\u0E14\u0E32\u0E19\u0E1C\u0E39\u0E49\u0E19\u0E33\u0E17\u0E31\u0E48\u0E27\u0E42\u0E25\u0E01",
488
+ loading: "\u0E01\u0E33\u0E25\u0E31\u0E07\u0E42\u0E2B\u0E25\u0E14\u0E01\u0E23\u0E30\u0E14\u0E32\u0E19\u0E1C\u0E39\u0E49\u0E19\u0E33\u2026",
489
+ empty: "\u0E22\u0E31\u0E07\u0E44\u0E21\u0E48\u0E21\u0E35\u0E1C\u0E39\u0E49\u0E23\u0E48\u0E27\u0E21\u0E2A\u0E19\u0E31\u0E1A\u0E2A\u0E19\u0E38\u0E19 \u2014 \u0E21\u0E32\u0E40\u0E1B\u0E47\u0E19\u0E04\u0E19\u0E41\u0E23\u0E01",
490
+ signInPrompt: "\u0E40\u0E02\u0E49\u0E32\u0E2A\u0E39\u0E48\u0E23\u0E30\u0E1A\u0E1A\u0E40\u0E1E\u0E37\u0E48\u0E2D\u0E14\u0E39\u0E2D\u0E31\u0E19\u0E14\u0E31\u0E1A\u0E02\u0E2D\u0E07\u0E04\u0E38\u0E13 \u2192",
491
+ myRank: "\u0E2D\u0E31\u0E19\u0E14\u0E31\u0E1A\u0E02\u0E2D\u0E07\u0E04\u0E38\u0E13\u0E04\u0E37\u0E2D #{rank} \u0E40\u0E14\u0E37\u0E2D\u0E19\u0E19\u0E35\u0E49",
492
+ footer: "\u0E1C\u0E39\u0E49\u0E23\u0E48\u0E27\u0E21\u0E2A\u0E19\u0E31\u0E1A\u0E2A\u0E19\u0E38\u0E19\u0E17\u0E31\u0E48\u0E27\u0E42\u0E25\u0E01\u0E40\u0E14\u0E37\u0E2D\u0E19\u0E19\u0E35\u0E49 \xB7 \u0E04\u0E30\u0E41\u0E19\u0E19\u0E23\u0E35\u0E40\u0E0B\u0E47\u0E15\u0E17\u0E38\u0E01\u0E40\u0E14\u0E37\u0E2D\u0E19",
493
+ anon: "\u0E44\u0E21\u0E48\u0E23\u0E30\u0E1A\u0E38\u0E0A\u0E37\u0E48\u0E2D"
494
+ },
495
+ account: {
496
+ title: "\u0E1A\u0E31\u0E0D\u0E0A\u0E35 Mushi",
497
+ checkEmailTitle: "\u0E15\u0E23\u0E27\u0E08\u0E2A\u0E2D\u0E1A\u0E2D\u0E35\u0E40\u0E21\u0E25",
498
+ joinTitle: "\u0E40\u0E02\u0E49\u0E32\u0E23\u0E48\u0E27\u0E21\u0E0A\u0E38\u0E21\u0E0A\u0E19",
499
+ emailLabel: "\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",
500
+ emailPlaceholder: "\u0E2D\u0E35\u0E40\u0E21\u0E25",
501
+ signInPrompt: "\u0E40\u0E02\u0E49\u0E32\u0E2A\u0E39\u0E48\u0E23\u0E30\u0E1A\u0E1A\u0E40\u0E1E\u0E37\u0E48\u0E2D\u0E14\u0E39\u0E23\u0E32\u0E22\u0E07\u0E32\u0E19\u0E17\u0E38\u0E01\u0E41\u0E2D\u0E1B\u0E41\u0E25\u0E30\u0E44\u0E15\u0E48\u0E2D\u0E31\u0E19\u0E14\u0E31\u0E1A \u0E44\u0E21\u0E48\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E0A\u0E49\u0E23\u0E2B\u0E31\u0E2A\u0E1C\u0E48\u0E32\u0E19",
502
+ magicLinkSent: "\u0E40\u0E23\u0E32\u0E2A\u0E48\u0E07\u0E25\u0E34\u0E07\u0E01\u0E4C\u0E40\u0E02\u0E49\u0E32\u0E2A\u0E39\u0E48\u0E23\u0E30\u0E1A\u0E1A\u0E44\u0E1B\u0E17\u0E35\u0E48 {email} \u0E41\u0E25\u0E49\u0E27 \u0E04\u0E25\u0E34\u0E01\u0E40\u0E1E\u0E37\u0E48\u0E2D\u0E40\u0E0A\u0E37\u0E48\u0E2D\u0E21\u0E23\u0E32\u0E22\u0E07\u0E32\u0E19\u0E02\u0E2D\u0E07\u0E04\u0E38\u0E13",
503
+ resendEmail: "\u0E2A\u0E48\u0E07\u0E2D\u0E35\u0E40\u0E21\u0E25\u0E2D\u0E35\u0E01\u0E04\u0E23\u0E31\u0E49\u0E07",
504
+ sendLink: "\u0E2A\u0E48\u0E07\u0E25\u0E34\u0E07\u0E01\u0E4C\u0E40\u0E02\u0E49\u0E32\u0E2A\u0E39\u0E48\u0E23\u0E30\u0E1A\u0E1A",
505
+ sending: "\u0E01\u0E33\u0E25\u0E31\u0E07\u0E2A\u0E48\u0E07\u2026",
506
+ crossAppReports: "\u0E23\u0E32\u0E22\u0E07\u0E32\u0E19\u0E02\u0E2D\u0E07\u0E09\u0E31\u0E19\u0E17\u0E38\u0E01\u0E41\u0E2D\u0E1B \u2192",
507
+ viewLeaderboard: "\u0E14\u0E39\u0E01\u0E23\u0E30\u0E14\u0E32\u0E19\u0E1C\u0E39\u0E49\u0E19\u0E33\u0E17\u0E31\u0E48\u0E27\u0E42\u0E25\u0E01 \u2192",
508
+ signOut: "\u0E2D\u0E2D\u0E01\u0E08\u0E32\u0E01\u0E23\u0E30\u0E1A\u0E1A",
509
+ rankSummary: "\u0E2D\u0E31\u0E19\u0E14\u0E31\u0E1A #{rank} \xB7 {points} pts \u0E40\u0E14\u0E37\u0E2D\u0E19\u0E19\u0E35\u0E49"
510
+ },
511
+ crossApp: {
512
+ title: "\u0E23\u0E32\u0E22\u0E07\u0E32\u0E19\u0E02\u0E2D\u0E07\u0E09\u0E31\u0E19",
513
+ loading: "\u0E01\u0E33\u0E25\u0E31\u0E07\u0E42\u0E2B\u0E25\u0E14\u0E23\u0E32\u0E22\u0E07\u0E32\u0E19\u2026",
514
+ empty: "\u0E22\u0E31\u0E07\u0E44\u0E21\u0E48\u0E21\u0E35\u0E23\u0E32\u0E22\u0E07\u0E32\u0E19",
515
+ unknownApp: "\u0E41\u0E2D\u0E1B\u0E44\u0E21\u0E48\u0E17\u0E23\u0E32\u0E1A\u0E0A\u0E37\u0E48\u0E2D"
516
+ },
517
+ thread: {
518
+ title: "\u0E40\u0E18\u0E23\u0E14\u0E23\u0E32\u0E22\u0E07\u0E32\u0E19",
519
+ loading: "\u0E01\u0E33\u0E25\u0E31\u0E07\u0E42\u0E2B\u0E25\u0E14\u0E40\u0E18\u0E23\u0E14\u2026",
520
+ empty: "\u0E22\u0E31\u0E07\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E33\u0E15\u0E2D\u0E1A\u0E08\u0E32\u0E01\u0E17\u0E35\u0E21\u0E1E\u0E31\u0E12\u0E19\u0E32",
521
+ confirmFixed: "\u0E43\u0E0A\u0E48 \u0E41\u0E01\u0E49\u0E41\u0E25\u0E49\u0E27",
522
+ notFixed: "\u0E22\u0E31\u0E07\u0E44\u0E21\u0E48\u0E41\u0E01\u0E49",
523
+ replyPlaceholder: "\u0E15\u0E2D\u0E1A\u0E19\u0E31\u0E01\u0E1E\u0E31\u0E12\u0E19\u0E32\u2026",
524
+ send: "\u0E2A\u0E48\u0E07"
525
+ },
526
+ success: {
527
+ trackReport: "\u0E15\u0E34\u0E14\u0E15\u0E32\u0E21\u0E23\u0E32\u0E22\u0E07\u0E32\u0E19\u0E19\u0E35\u0E49 \u203A",
528
+ receipt: "\u0E43\u0E1A\u0E23\u0E31\u0E1A",
529
+ delivering: "\u0E01\u0E33\u0E25\u0E31\u0E07\u0E2A\u0E48\u0E07\u0E44\u0E1B\u0E22\u0E31\u0E07\u0E17\u0E35\u0E21\u2026",
530
+ queuedOffline: "\u0E04\u0E34\u0E27\u0E2D\u0E2D\u0E1F\u0E44\u0E25\u0E19\u0E4C",
531
+ queuedHint: "\u0E08\u0E30\u0E2A\u0E48\u0E07\u0E17\u0E31\u0E19\u0E17\u0E35\u0E17\u0E35\u0E48\u0E04\u0E38\u0E13\u0E01\u0E25\u0E31\u0E1A\u0E21\u0E32\u0E2D\u0E2D\u0E19\u0E44\u0E25\u0E19\u0E4C",
532
+ trackOnMushi: "\u0E15\u0E34\u0E14\u0E15\u0E32\u0E21\u0E1A\u0E19 Mushi",
533
+ slaDefault: "\u0E40\u0E23\u0E32\u0E08\u0E30\u0E15\u0E23\u0E27\u0E08\u0E2A\u0E2D\u0E1A\u0E23\u0E32\u0E22\u0E07\u0E32\u0E19\u0E02\u0E2D\u0E07\u0E04\u0E38\u0E13"
534
+ },
535
+ featureRequest: {
536
+ label: "\u0E02\u0E2D\u0E1F\u0E35\u0E40\u0E08\u0E2D\u0E23\u0E4C",
537
+ description: "\u0E40\u0E2A\u0E19\u0E2D\u0E01\u0E32\u0E23\u0E40\u0E1B\u0E25\u0E35\u0E48\u0E22\u0E19\u0E41\u0E1B\u0E25\u0E07"
538
+ },
539
+ poweredBy: "Powered by Mushi v{version}"
222
540
  }
223
541
  };
224
542
 
@@ -232,10 +550,22 @@ var es = {
232
550
  submit: "Enviar",
233
551
  submitting: "Enviando\u2026",
234
552
  submitted: "\xA1Gracias! Tu reporte ha sido enviado.",
235
- error: "Algo sali\xF3 mal. Por favor, int\xE9ntalo de nuevo."
553
+ error: "No se pudo enviar tu reporte. Revisa tu conexi\xF3n e int\xE9ntalo de nuevo."
236
554
  },
237
555
  step1: {
238
556
  heading: "\xBFQu\xE9 tipo de problema?",
557
+ reportSectionLabel: "Reportar un problema",
558
+ moreNavLabel: "M\xE1s",
559
+ moreNav: {
560
+ yourReports: "Tus reportes",
561
+ yourReportsDesc: "Ver estado, respuestas del desarrollador y responder",
562
+ unreadNew: "nuevos",
563
+ communityIdeas: "Ideas de la comunidad",
564
+ communityIdeasDesc: "Vota funciones y mira qu\xE9 se lanz\xF3",
565
+ leaderboard: "Clasificaci\xF3n",
566
+ joinCommunity: "Unirse a la comunidad \xB7 Rastrea reportes entre apps",
567
+ myAccount: "Mi cuenta"
568
+ },
239
569
  categories: {
240
570
  bug: "Error",
241
571
  slow: "Lento",
@@ -254,7 +584,7 @@ var es = {
254
584
  step2: {
255
585
  heading: "\xBFQu\xE9 pas\xF3?",
256
586
  intents: {
257
- bug: ["Crash", "Sin respuesta", "P\xE9rdida de datos", "Resultado incorrecto", "Otro"],
587
+ bug: ["Cierre inesperado", "Sin respuesta", "P\xE9rdida de datos", "Resultado incorrecto", "Otro"],
258
588
  slow: ["Carga de p\xE1gina", "Interacci\xF3n", "Llamada API", "Animaci\xF3n", "Otro"],
259
589
  visual: ["Layout roto", "Superposici\xF3n", "Elemento faltante", "Color/fuente incorrecta", "Otro"],
260
590
  confusing: ["Etiqueta confusa", "Sin ayuda", "Flujo inesperado", "Navegaci\xF3n perdida", "Otro"],
@@ -281,6 +611,100 @@ var es = {
281
611
  "La p\xE1gina se congel\xF3 10 segundos",
282
612
  "El dise\xF1o se ve roto aqu\xED"
283
613
  ]
614
+ },
615
+ assistant: {
616
+ defaultLabel: "Preguntar",
617
+ defaultGreeting: "Pregunta sobre esta p\xE1gina \u2014 solo uso lo que ves aqu\xED.",
618
+ inputPlaceholder: "Escribe tu pregunta\u2026",
619
+ sendAriaLabel: "Enviar",
620
+ hubDescription: "Obt\xE9n ayuda para usar esta app",
621
+ thinking: "Pensando\u2026",
622
+ errors: {
623
+ noResponse: "Sin respuesta \u2014 revisa tu conexi\xF3n e int\xE9ntalo de nuevo.",
624
+ generic: "No se pudo contactar al asistente. Int\xE9ntalo en un momento."
625
+ }
626
+ },
627
+ flows: {
628
+ eyebrows: {
629
+ inbox: "Mushi \xB7 Bandeja",
630
+ roadmap: "Mushi \xB7 Ideas",
631
+ community: "Mushi \xB7 Comunidad",
632
+ identity: "Mushi \xB7 Cuenta",
633
+ signIn: "Mushi \xB7 Acceso",
634
+ allApps: "Mushi \xB7 Todas las apps",
635
+ receipt: "Mushi \xB7 Recibo",
636
+ thread: "Mushi \xB7 Bandeja"
637
+ },
638
+ reports: {
639
+ title: "Tus reportes",
640
+ loading: "Cargando reportes\u2026",
641
+ empty: "A\xFAn no hay reportes en este navegador.",
642
+ leaderboardLink: "Clasificaci\xF3n"
643
+ },
644
+ roadmap: {
645
+ title: "Ideas de la comunidad",
646
+ loading: "Cargando ideas\u2026",
647
+ empty: "A\xFAn no hay ideas. S\xE9 el primero en sugerir una.",
648
+ shipped: "Publicado",
649
+ vote: "Votar",
650
+ voted: "Votado",
651
+ voteCount: "{n} votos",
652
+ untitled: "Idea sin t\xEDtulo"
653
+ },
654
+ leaderboard: {
655
+ title: "Clasificaci\xF3n global",
656
+ loading: "Cargando clasificaci\xF3n\u2026",
657
+ empty: "A\xFAn no hay colaboradores \u2014 s\xE9 el primero.",
658
+ signInPrompt: "Inicia sesi\xF3n para ver tu puesto \u2192",
659
+ myRank: "Est\xE1s en el puesto #{rank} este mes",
660
+ footer: "Colaboradores globales este mes \xB7 Los puntos se reinician mensualmente",
661
+ anon: "An\xF3nimo"
662
+ },
663
+ account: {
664
+ title: "Cuenta Mushi",
665
+ checkEmailTitle: "Revisa tu correo",
666
+ joinTitle: "\xDAnete a la comunidad",
667
+ emailLabel: "Correo electr\xF3nico",
668
+ emailPlaceholder: "Correo",
669
+ signInPrompt: "Inicia sesi\xF3n para ver tus reportes en todas las apps y subir en la clasificaci\xF3n. Sin contrase\xF1a.",
670
+ magicLinkSent: "Enviamos un enlace de acceso a {email}. \xC1brelo para conectar tus reportes.",
671
+ resendEmail: "Reenviar correo",
672
+ sendLink: "Enviar enlace de acceso",
673
+ sending: "Enviando\u2026",
674
+ crossAppReports: "Mis reportes en todas las apps \u2192",
675
+ viewLeaderboard: "Ver clasificaci\xF3n global \u2192",
676
+ signOut: "Cerrar sesi\xF3n",
677
+ rankSummary: "Puesto #{rank} \xB7 {points} pts este mes"
678
+ },
679
+ crossApp: {
680
+ title: "Mis reportes",
681
+ loading: "Cargando tus reportes\u2026",
682
+ empty: "A\xFAn no has enviado reportes.",
683
+ unknownApp: "App desconocida"
684
+ },
685
+ thread: {
686
+ title: "Hilo del reporte",
687
+ loading: "Cargando hilo\u2026",
688
+ empty: "A\xFAn no hay respuestas del equipo.",
689
+ confirmFixed: "S\xED, qued\xF3 resuelto",
690
+ notFixed: "A\xFAn no est\xE1 resuelto",
691
+ replyPlaceholder: "Responder al desarrollador\u2026",
692
+ send: "Enviar"
693
+ },
694
+ success: {
695
+ trackReport: "Seguir este reporte \u203A",
696
+ receipt: "Recibo",
697
+ delivering: "Enviando al equipo\u2026",
698
+ queuedOffline: "En cola sin conexi\xF3n",
699
+ queuedHint: "Lo enviaremos en cuanto vuelvas a estar en l\xEDnea.",
700
+ trackOnMushi: "Seguir en Mushi",
701
+ slaDefault: "Revisaremos tu reporte."
702
+ },
703
+ featureRequest: {
704
+ label: "Solicitud de funci\xF3n",
705
+ description: "Sugerir un cambio"
706
+ },
707
+ poweredBy: "Con tecnolog\xEDa de Mushi v{version}"
284
708
  }
285
709
  };
286
710
 
@@ -295,38 +719,122 @@ function getLocale(code) {
295
719
  function getAvailableLocales() {
296
720
  return Object.keys(locales);
297
721
  }
298
-
299
- // src/styles.ts
300
- function getWidgetStyles(theme, accent = "", accentText = "") {
722
+ function getWidgetThemeVars(theme, accent = "", accentText = "") {
301
723
  const isDark = theme === "dark";
302
- const safeHex = (v) => /^#[0-9a-fA-F]{3,8}$/.test(v) ? v : "";
303
- const safeAccent = safeHex(accent);
304
- const safeAccentText = safeHex(accentText);
305
- const paper = isDark ? "#0F0E0C" : "#F8F4ED";
306
- const ink = isDark ? "#F2EBDD" : "#0E0D0B";
307
- const inkMuted = isDark ? "#928B7E" : "#5C5852";
308
- const inkFaint = isDark ? "#5A5650" : "#9A9489";
309
- const inkDim = isDark ? "#7A7268" : "#6E6760";
310
- const rule = isDark ? "rgba(242,235,221,0.10)" : "rgba(14,13,11,0.10)";
311
- const ruleStrong = isDark ? "rgba(242,235,221,0.18)" : "rgba(14,13,11,0.16)";
312
- const widgetAccent = safeAccent || (isDark ? "#FF5A47" : "#E03C2C");
313
- const widgetAccentWash = isDark ? `${widgetAccent}1F` : `${widgetAccent}14`;
314
- const widgetAccentInk = safeAccentText || (isDark ? "#FFE5E0" : "#7A1F15");
315
- const fontDisplay = `'Iowan Old Style', 'Palatino Linotype', 'Palatino', 'Book Antiqua', 'Cambria', Georgia, 'Times New Roman', serif`;
316
- const fontBody = `system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI Variable Display', 'Segoe UI', sans-serif`;
317
- const fontMono = `ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, Consolas, 'Liberation Mono', monospace`;
318
- const easeStamp = "cubic-bezier(0.22, 1, 0.36, 1)";
724
+ const mode = isDark ? "dark" : "light";
725
+ const pal = mushiPalette(mode);
726
+ const accentResolved = resolveWidgetAccent(mode, accent, accentText);
727
+ const status = MUSHI_REPORTER_STATUS[mode];
728
+ return {
729
+ isDark,
730
+ paper: pal.paper,
731
+ paperRaised: pal.paperRaised,
732
+ ink: pal.ink,
733
+ inkMuted: pal.inkMuted,
734
+ inkFaint: pal.inkFaint,
735
+ inkDim: pal.inkDim,
736
+ rule: pal.rule,
737
+ ruleStrong: pal.ruleStrong,
738
+ widgetAccent: accentResolved.accent,
739
+ widgetAccentWash: accentResolved.accentWash,
740
+ widgetAccentInk: accentResolved.accentInk,
741
+ widgetAccentShadow: isDark ? MUSHI_ACCENT_SHADOW.dark : MUSHI_ACCENT_SHADOW.light,
742
+ ok: pal.ok,
743
+ danger: pal.danger,
744
+ onAccent: MUSHI_ON_ACCENT,
745
+ inverse: MUSHI_INVERSE,
746
+ neonBannerBg: MUSHI_BANNER_NEON.bg,
747
+ neonBannerFg: MUSHI_BANNER_NEON.fg,
748
+ neonBannerBorder: MUSHI_BANNER_NEON.border,
749
+ brandBannerBorder: isDark ? MUSHI_BANNER_BRAND_BORDER.dark : MUSHI_BANNER_BRAND_BORDER.light,
750
+ statusSent: status.sent,
751
+ statusReview: status.review,
752
+ statusFixing: status.fixing,
753
+ statusFixed: status.fixed,
754
+ statusClosedBg: isDark ? "rgba(242,235,221,0.06)" : "rgba(14,13,11,0.05)",
755
+ fontDisplay: MUSHI_TYPE.fontDisplay,
756
+ fontBody: MUSHI_TYPE.fontBody,
757
+ fontMono: MUSHI_TYPE.fontMono,
758
+ easeStamp: MUSHI_MOTION.easeStamp,
759
+ zBanner: MUSHI_Z.banner,
760
+ zPanel: MUSHI_Z.panel,
761
+ zOverlay: MUSHI_Z.overlay,
762
+ fabSize: MUSHI_GEOMETRY.fabSize,
763
+ panelWidth: MUSHI_GEOMETRY.panelWidth,
764
+ panelSheetBreakpoint: MUSHI_GEOMETRY.panelSheetBreakpoint
765
+ };
766
+ }
767
+ function getWidgetPreviewTokens(theme) {
768
+ const v = getWidgetThemeVars(theme);
769
+ return {
770
+ paper: v.paper,
771
+ paperRaised: v.paperRaised,
772
+ ink: v.ink,
773
+ inkMuted: v.inkMuted,
774
+ rule: v.ruleStrong,
775
+ vermillion: v.widgetAccent,
776
+ vermillionShadow: v.widgetAccentShadow,
777
+ accentWash: v.widgetAccentWash,
778
+ onAccent: v.onAccent,
779
+ neonBannerBg: v.neonBannerBg,
780
+ neonBannerFg: v.neonBannerFg,
781
+ neonBannerBorder: v.neonBannerBorder,
782
+ brandBannerBorder: v.brandBannerBorder
783
+ };
784
+ }
785
+ function getWidgetStyles(theme, accent = "", accentText = "") {
786
+ const v = getWidgetThemeVars(theme, accent, accentText);
787
+ const {
788
+ isDark,
789
+ paper,
790
+ paperRaised,
791
+ ink,
792
+ inkMuted,
793
+ inkFaint,
794
+ inkDim,
795
+ rule,
796
+ ruleStrong,
797
+ widgetAccent,
798
+ widgetAccentWash,
799
+ widgetAccentInk,
800
+ widgetAccentShadow,
801
+ ok,
802
+ danger,
803
+ onAccent,
804
+ inverse,
805
+ neonBannerBg,
806
+ neonBannerFg,
807
+ neonBannerBorder,
808
+ brandBannerBorder,
809
+ statusSent,
810
+ statusReview,
811
+ statusFixing,
812
+ statusFixed,
813
+ statusClosedBg,
814
+ fontDisplay,
815
+ fontBody,
816
+ fontMono,
817
+ easeStamp,
818
+ zBanner,
819
+ fabSize
820
+ } = v;
821
+ const { sizeBody, lineBody } = MUSHI_TYPE;
822
+ const { durationFast } = MUSHI_MOTION;
823
+ const { bannerHeight, gutter, panelWidth, panelMaxHeight, panelSheetBreakpoint, edgeTabWidth } = MUSHI_GEOMETRY;
824
+ const panelLauncherGap = fabSize + 12;
825
+ const { base: zBase } = MUSHI_Z;
826
+ const controlRadius = MUSHI_RADIUS.control;
319
827
  return `
320
828
  :host {
321
829
  all: initial;
322
830
  font-family: ${fontBody};
323
- font-size: 14px;
324
- line-height: 1.55;
831
+ font-size: ${sizeBody}px;
832
+ line-height: ${lineBody};
325
833
  color: ${ink};
326
834
  -webkit-font-smoothing: antialiased;
327
835
  -moz-osx-font-smoothing: grayscale;
328
836
  font-feature-settings: 'ss01', 'cv11'; /* nicer system-ui glyphs where supported */
329
- --mushi-ok: ${isDark ? "#4ade80" : "#16a34a"};
837
+ --mushi-ok: ${ok};
330
838
  /* SDK contract: the host element is always pass-through. Only the
331
839
  interactive surfaces (.mushi-trigger, .mushi-banner, .mushi-panel)
332
840
  opt back into pointer events so the widget never creates an
@@ -344,10 +852,10 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
344
852
 
345
853
  .mushi-trigger {
346
854
  position: fixed;
347
- width: 52px;
348
- height: 52px;
855
+ width: ${fabSize}px;
856
+ height: ${fabSize}px;
349
857
  border: 1px solid ${ruleStrong};
350
- border-radius: 4px;
858
+ border-radius: ${controlRadius}px;
351
859
  background: ${paper};
352
860
  color: ${ink};
353
861
  cursor: pointer;
@@ -361,7 +869,7 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
361
869
  0 1px 0 ${rule},
362
870
  0 6px 14px -8px rgba(14,13,11,0.35),
363
871
  inset 0 -3px 0 ${widgetAccent};
364
- transition: transform 200ms ${easeStamp}, box-shadow 200ms ${easeStamp};
872
+ transition: transform ${durationFast}ms ${easeStamp}, box-shadow ${durationFast}ms ${easeStamp};
365
873
  overflow: visible;
366
874
  isolation: isolate;
367
875
  }
@@ -411,23 +919,23 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
411
919
  .mushi-trigger-pulse { animation: none; }
412
920
  }
413
921
  .mushi-trigger.bottom-right {
414
- bottom: var(--mushi-bottom, calc(24px + env(safe-area-inset-bottom, 0px)));
415
- right: var(--mushi-right, calc(24px + env(safe-area-inset-right, 0px)));
922
+ bottom: var(--mushi-bottom, calc(${gutter}px + env(safe-area-inset-bottom, 0px)));
923
+ right: var(--mushi-right, calc(${gutter}px + env(safe-area-inset-right, 0px)));
416
924
  }
417
925
  .mushi-trigger.bottom-left {
418
- bottom: var(--mushi-bottom, calc(24px + env(safe-area-inset-bottom, 0px)));
419
- left: var(--mushi-left, calc(24px + env(safe-area-inset-left, 0px)));
926
+ bottom: var(--mushi-bottom, calc(${gutter}px + env(safe-area-inset-bottom, 0px)));
927
+ left: var(--mushi-left, calc(${gutter}px + env(safe-area-inset-left, 0px)));
420
928
  }
421
929
  .mushi-trigger.top-right {
422
- top: var(--mushi-top, calc(24px + env(safe-area-inset-top, 0px)));
423
- right: var(--mushi-right, calc(24px + env(safe-area-inset-right, 0px)));
930
+ top: var(--mushi-top, calc(${gutter}px + env(safe-area-inset-top, 0px)));
931
+ right: var(--mushi-right, calc(${gutter}px + env(safe-area-inset-right, 0px)));
424
932
  }
425
933
  .mushi-trigger.top-left {
426
- top: var(--mushi-top, calc(24px + env(safe-area-inset-top, 0px)));
427
- left: var(--mushi-left, calc(24px + env(safe-area-inset-left, 0px)));
934
+ top: var(--mushi-top, calc(${gutter}px + env(safe-area-inset-top, 0px)));
935
+ left: var(--mushi-left, calc(${gutter}px + env(safe-area-inset-left, 0px)));
428
936
  }
429
937
  .mushi-trigger.edge-tab {
430
- width: 32px;
938
+ width: ${edgeTabWidth}px;
431
939
  height: 88px;
432
940
  border-radius: 4px 0 0 4px;
433
941
  writing-mode: vertical-rl;
@@ -452,8 +960,8 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
452
960
  inset 3px 0 0 ${widgetAccent};
453
961
  }
454
962
  .mushi-trigger.shrunk {
455
- width: 36px;
456
- height: 36px;
963
+ width: ${bannerHeight}px;
964
+ height: ${bannerHeight}px;
457
965
  opacity: 0.82;
458
966
  transform: scale(0.92);
459
967
  }
@@ -473,7 +981,7 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
473
981
  }
474
982
  .mushi-trigger.dragging {
475
983
  cursor: grabbing !important;
476
- z-index: calc(var(--z, 99999) + 2);
984
+ z-index: calc(var(--z, ${zBase}) + 2);
477
985
  transition: none !important;
478
986
  box-shadow:
479
987
  0 1px 0 ${rule},
@@ -493,9 +1001,9 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
493
1001
 
494
1002
  .mushi-panel {
495
1003
  position: fixed;
496
- width: 360px;
497
- max-width: calc(100vw - 32px);
498
- max-height: min(480px, calc(100dvh - 120px - var(--mushi-keyboard-inset, 0px)));
1004
+ width: ${panelWidth}px;
1005
+ max-width: calc(100vw - ${MUSHI_SPACING.wide}px);
1006
+ max-height: min(${panelMaxHeight}px, calc(100dvh - 120px - var(--mushi-keyboard-inset, 0px)));
499
1007
  background: ${paper};
500
1008
  border: 1px solid ${ruleStrong};
501
1009
  border-radius: 6px;
@@ -514,7 +1022,7 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
514
1022
  bottom: calc(var(--mushi-keyboard-inset, 0px) + 8px) !important;
515
1023
  }
516
1024
  /* On narrow mobile, fill the width as a bottom sheet */
517
- @media (max-width: 480px) {
1025
+ @media (max-width: ${panelSheetBreakpoint}px) {
518
1026
  .mushi-panel {
519
1027
  left: 0 !important;
520
1028
  right: 0 !important;
@@ -531,23 +1039,23 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
531
1039
  .mushi-panel.open { animation: mushi-stamp-in 320ms ${easeStamp} both; }
532
1040
  .mushi-panel.closed { display: none; }
533
1041
  .mushi-panel.bottom-right {
534
- bottom: var(--mushi-panel-bottom, calc(var(--mushi-bottom, 24px) + 64px));
535
- right: var(--mushi-right, calc(24px + env(safe-area-inset-right, 0px)));
1042
+ bottom: var(--mushi-panel-bottom, calc(var(--mushi-bottom, ${gutter}px) + ${panelLauncherGap}px));
1043
+ right: var(--mushi-right, calc(${gutter}px + env(safe-area-inset-right, 0px)));
536
1044
  --mushi-origin: bottom right;
537
1045
  }
538
1046
  .mushi-panel.bottom-left {
539
- bottom: var(--mushi-panel-bottom, calc(var(--mushi-bottom, 24px) + 64px));
540
- left: var(--mushi-left, calc(24px + env(safe-area-inset-left, 0px)));
1047
+ bottom: var(--mushi-panel-bottom, calc(var(--mushi-bottom, ${gutter}px) + ${panelLauncherGap}px));
1048
+ left: var(--mushi-left, calc(${gutter}px + env(safe-area-inset-left, 0px)));
541
1049
  --mushi-origin: bottom left;
542
1050
  }
543
1051
  .mushi-panel.top-right {
544
- top: var(--mushi-panel-top, calc(var(--mushi-top, 24px) + 64px));
545
- right: var(--mushi-right, calc(24px + env(safe-area-inset-right, 0px)));
1052
+ top: var(--mushi-panel-top, calc(var(--mushi-top, ${gutter}px) + ${panelLauncherGap}px));
1053
+ right: var(--mushi-right, calc(${gutter}px + env(safe-area-inset-right, 0px)));
546
1054
  --mushi-origin: top right;
547
1055
  }
548
1056
  .mushi-panel.top-left {
549
- top: var(--mushi-panel-top, calc(var(--mushi-top, 24px) + 64px));
550
- left: var(--mushi-left, calc(24px + env(safe-area-inset-left, 0px)));
1057
+ top: var(--mushi-panel-top, calc(var(--mushi-top, ${gutter}px) + ${panelLauncherGap}px));
1058
+ left: var(--mushi-left, calc(${gutter}px + env(safe-area-inset-left, 0px)));
551
1059
  --mushi-origin: top left;
552
1060
  }
553
1061
  .mushi-outdated {
@@ -596,7 +1104,7 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
596
1104
  height: 22px;
597
1105
  border-radius: 3px;
598
1106
  background: ${widgetAccent};
599
- color: #FAF7F0;
1107
+ color: ${onAccent};
600
1108
  font-family: ${fontDisplay};
601
1109
  font-size: 14px;
602
1110
  font-weight: 600;
@@ -827,29 +1335,29 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
827
1335
  border: 1px solid transparent;
828
1336
  }
829
1337
  .mushi-status-sent {
830
- color: ${isDark ? "#A8C4FF" : "#1E4A8C"};
831
- background: ${isDark ? "rgba(120,160,255,0.12)" : "rgba(30,74,140,0.08)"};
832
- border-color: ${isDark ? "rgba(120,160,255,0.22)" : "rgba(30,74,140,0.16)"};
1338
+ color: ${statusSent.fg};
1339
+ background: ${statusSent.bg};
1340
+ border-color: ${statusSent.border};
833
1341
  }
834
1342
  .mushi-status-review {
835
- color: ${isDark ? "#FFD27A" : "#8A5A00"};
836
- background: ${isDark ? "rgba(255,190,90,0.12)" : "rgba(180,120,0,0.10)"};
837
- border-color: ${isDark ? "rgba(255,190,90,0.22)" : "rgba(180,120,0,0.18)"};
1343
+ color: ${statusReview.fg};
1344
+ background: ${statusReview.bg};
1345
+ border-color: ${statusReview.border};
838
1346
  }
839
1347
  .mushi-status-fixing {
840
- color: ${isDark ? "#FFB899" : "#9A3D12"};
841
- background: ${isDark ? "rgba(255,120,60,0.12)" : "rgba(224,60,44,0.10)"};
842
- border-color: ${isDark ? "rgba(255,120,60,0.24)" : "rgba(224,60,44,0.18)"};
1348
+ color: ${statusFixing.fg};
1349
+ background: ${statusFixing.bg};
1350
+ border-color: ${statusFixing.border};
843
1351
  }
844
1352
  .mushi-status-fixed {
845
- color: ${isDark ? "#8FE3B0" : "#1F6B3A"};
846
- background: ${isDark ? "rgba(80,200,130,0.12)" : "rgba(31,107,58,0.10)"};
847
- border-color: ${isDark ? "rgba(80,200,130,0.22)" : "rgba(31,107,58,0.18)"};
1353
+ color: ${statusFixed.fg};
1354
+ background: ${statusFixed.bg};
1355
+ border-color: ${statusFixed.border};
848
1356
  }
849
1357
  .mushi-status-closed,
850
1358
  .mushi-status-unknown {
851
1359
  color: ${inkMuted};
852
- background: ${isDark ? "rgba(242,235,221,0.06)" : "rgba(14,13,11,0.05)"};
1360
+ background: ${statusClosedBg};
853
1361
  border-color: ${ruleStrong};
854
1362
  }
855
1363
  .mushi-report-when {
@@ -914,8 +1422,7 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
914
1422
  display: block;
915
1423
  font-family: ${fontMono};
916
1424
  font-size: 10px;
917
- letter-spacing: 0.08em;
918
- text-transform: uppercase;
1425
+ letter-spacing: 0.04em;
919
1426
  margin-bottom: 3px;
920
1427
  }
921
1428
  .mushi-thread-comment p,
@@ -935,10 +1442,8 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
935
1442
  border-left: 2px solid ${widgetAccent};
936
1443
  background: ${widgetAccentWash};
937
1444
  color: ${widgetAccentInk};
938
- font-family: ${fontMono};
939
- font-size: 11px;
940
- letter-spacing: 0.12em;
941
- text-transform: uppercase;
1445
+ font-family: ${fontDisplay};
1446
+ font-size: 13px;
942
1447
  margin: 4px 0 14px;
943
1448
  border-radius: 0 3px 3px 0;
944
1449
  }
@@ -948,38 +1453,8 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
948
1453
  flex-direction: column;
949
1454
  gap: 2px;
950
1455
  }
951
- .mushi-intent-btn {
952
- display: flex;
953
- align-items: center;
954
- justify-content: space-between;
955
- gap: 12px;
956
- padding: 12px 0;
957
- border: none;
958
- border-bottom: 1px solid ${rule};
959
- background: transparent;
960
- cursor: pointer;
961
- color: inherit;
962
- text-align: left;
963
- font-family: ${fontDisplay};
964
- font-size: 15px;
965
- transition: padding 220ms ${easeStamp}, color 220ms ${easeStamp};
966
- }
967
- .mushi-intent-btn::after {
968
- content: '\u2192';
969
- font-family: ${fontMono};
970
- font-size: 13px;
971
- color: ${inkFaint};
972
- opacity: 0;
973
- transform: translateX(-4px);
974
- transition: opacity 220ms ${easeStamp}, transform 220ms ${easeStamp};
975
- }
976
- .mushi-intent-btn:last-child { border-bottom: none; }
977
- .mushi-intent-btn:hover { padding-left: 6px; color: ${widgetAccent}; }
978
- .mushi-intent-btn:hover::after { opacity: 1; transform: translateX(0); color: ${widgetAccent}; }
979
- .mushi-intent-btn:focus-visible {
980
- outline: none;
981
- padding-left: 6px;
982
- box-shadow: inset 2px 0 0 ${widgetAccent};
1456
+ .mushi-intents .mushi-option-btn {
1457
+ grid-template-columns: 1fr auto;
983
1458
  }
984
1459
 
985
1460
  /* Example starter chips \u2014 reduce first-report activation energy */
@@ -1132,6 +1607,16 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
1132
1607
  line-height: 1.4;
1133
1608
  letter-spacing: 0.02em;
1134
1609
  }
1610
+ .mushi-identified-user {
1611
+ margin: 8px 0 0;
1612
+ font-size: 11.5px;
1613
+ color: ${inkMuted};
1614
+ line-height: 1.4;
1615
+ }
1616
+ .mushi-identified-user strong {
1617
+ color: ${ink};
1618
+ font-weight: 600;
1619
+ }
1135
1620
  .mushi-annotate-toolbar {
1136
1621
  display: flex;
1137
1622
  flex-wrap: wrap;
@@ -1179,7 +1664,7 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
1179
1664
  border: 1px solid ${widgetAccent};
1180
1665
  border-radius: 3px;
1181
1666
  background: ${widgetAccent};
1182
- color: #FAF7F0;
1667
+ color: ${onAccent};
1183
1668
  font-family: ${fontMono};
1184
1669
  font-size: 11px;
1185
1670
  letter-spacing: 0.16em;
@@ -1187,7 +1672,7 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
1187
1672
  cursor: pointer;
1188
1673
  overflow: hidden;
1189
1674
  transition: transform 180ms ${easeStamp}, box-shadow 180ms ${easeStamp};
1190
- box-shadow: 0 2px 0 ${isDark ? "#7A1F15" : "#9A2A1E"};
1675
+ box-shadow: 0 2px 0 ${widgetAccentShadow};
1191
1676
  }
1192
1677
  .mushi-submit::after {
1193
1678
  content: '';
@@ -1201,10 +1686,10 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
1201
1686
  }
1202
1687
  .mushi-submit:hover {
1203
1688
  transform: translateY(-1px);
1204
- box-shadow: 0 3px 0 ${isDark ? "#7A1F15" : "#9A2A1E"};
1689
+ box-shadow: 0 3px 0 ${widgetAccentShadow};
1205
1690
  }
1206
1691
  .mushi-submit:hover::after { opacity: 1; transform: scale(1.4); }
1207
- .mushi-submit:active { transform: translateY(1px); box-shadow: 0 1px 0 ${isDark ? "#7A1F15" : "#9A2A1E"}; }
1692
+ .mushi-submit:active { transform: translateY(1px); box-shadow: 0 1px 0 ${widgetAccentShadow}; }
1208
1693
  .mushi-submit:disabled {
1209
1694
  cursor: wait;
1210
1695
  opacity: 0.7;
@@ -1314,7 +1799,7 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
1314
1799
  /* \u2500\u2500 Two-way receipt (success step) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
1315
1800
  /* The receipt block sits below the stamp/meta. Three states: */
1316
1801
  /* 1. delivering... (spinner pill, while host onSubmit awaits) */
1317
- /* 2. confirmed (Receipt #abc12345 + Track on Mushi link) */
1802
+ /* 2. confirmed (Receipt id + Track on Mushi link) */
1318
1803
  /* 3. queued offline (warn pill \u2014 degrade gracefully) */
1319
1804
  .mushi-success-receipt {
1320
1805
  margin-top: 14px;
@@ -1374,7 +1859,7 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
1374
1859
  padding: 6px 10px;
1375
1860
  border-radius: 4px;
1376
1861
  background: ${widgetAccent};
1377
- color: #fff;
1862
+ color: ${inverse};
1378
1863
  font-family: ${fontMono};
1379
1864
  font-size: 11px;
1380
1865
  letter-spacing: 0.10em;
@@ -1537,7 +2022,7 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
1537
2022
 
1538
2023
  /* \u2500\u2500\u2500 Beta mode strip (category step) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
1539
2024
  /* Brand palette: widgetAccent (vermillion) + washi ink for the strip.
1540
- The previous indigo (#6366f1) is the single most recognisable AI-template
2025
+ The previous generic indigo purple is the single most recognisable AI-template
1541
2026
  colour; replaced with the widget's own vermillion wash so the beta panel
1542
2027
  reads as a Mushi-native surface rather than a generic SaaS plug-in. */
1543
2028
 
@@ -1564,7 +2049,7 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
1564
2049
  padding: 1px 6px;
1565
2050
  border-radius: 3px;
1566
2051
  background: ${widgetAccent};
1567
- color: #FAF7F0;
2052
+ color: ${onAccent};
1568
2053
  font-family: ${fontMono};
1569
2054
  font-size: 9px;
1570
2055
  font-weight: 700;
@@ -1683,7 +2168,7 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
1683
2168
  fix \u2014 Workstream C). Horizontal padding also clears the left/right
1684
2169
  insets for landscape notches. */
1685
2170
  box-sizing: border-box;
1686
- min-height: 36px;
2171
+ min-height: ${bannerHeight}px;
1687
2172
  display: flex;
1688
2173
  align-items: center;
1689
2174
  justify-content: center;
@@ -1694,7 +2179,7 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
1694
2179
  letter-spacing: 0.04em;
1695
2180
  white-space: nowrap;
1696
2181
  overflow: hidden;
1697
- z-index: var(--mushi-banner-z, 99998);
2182
+ z-index: var(--mushi-banner-z, ${zBanner});
1698
2183
  animation: mushi-banner-slide-in 0.3s ${easeStamp} both;
1699
2184
  }
1700
2185
 
@@ -1703,17 +2188,17 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
1703
2188
 
1704
2189
  /* --- neon variant (electric lime \u2014 dev / beta tool aesthetic) --- */
1705
2190
  .mushi-banner.neon {
1706
- background: #0FFF50;
1707
- color: #0a1a0a;
1708
- border-bottom: 1.5px solid #00C43A;
2191
+ background: ${neonBannerBg};
2192
+ color: ${neonBannerFg};
2193
+ border-bottom: 1.5px solid ${neonBannerBorder};
1709
2194
  }
1710
2195
  .mushi-banner.neon.bottom {
1711
- border-top: 1.5px solid #00C43A;
2196
+ border-top: 1.5px solid ${neonBannerBorder};
1712
2197
  border-bottom: none;
1713
2198
  }
1714
2199
  .mushi-banner.neon .mushi-banner-btn {
1715
2200
  background: rgba(0,0,0,0.14);
1716
- color: #0a1a0a;
2201
+ color: ${neonBannerFg};
1717
2202
  border: 1px solid rgba(0,0,0,0.22);
1718
2203
  }
1719
2204
  .mushi-banner.neon .mushi-banner-btn:hover {
@@ -1723,16 +2208,16 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
1723
2208
  /* --- brand variant (widgetAccent \u2014 editorial, app-quality) --- */
1724
2209
  .mushi-banner.brand {
1725
2210
  background: ${widgetAccent};
1726
- color: #fff;
1727
- border-bottom: 1.5px solid ${isDark ? "#C4321E" : "#B52F1F"};
2211
+ color: ${inverse};
2212
+ border-bottom: 1.5px solid ${brandBannerBorder};
1728
2213
  }
1729
2214
  .mushi-banner.brand.bottom {
1730
- border-top: 1.5px solid ${isDark ? "#C4321E" : "#B52F1F"};
2215
+ border-top: 1.5px solid ${brandBannerBorder};
1731
2216
  border-bottom: none;
1732
2217
  }
1733
2218
  .mushi-banner.brand .mushi-banner-btn {
1734
2219
  background: rgba(255,255,255,0.18);
1735
- color: #fff;
2220
+ color: ${inverse};
1736
2221
  border: 1px solid rgba(255,255,255,0.32);
1737
2222
  }
1738
2223
  .mushi-banner.brand .mushi-banner-btn:hover {
@@ -1775,7 +2260,7 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
1775
2260
  .mushi-banner--rich {
1776
2261
  justify-content: space-between;
1777
2262
  gap: 12px;
1778
- min-height: 36px;
2263
+ min-height: ${bannerHeight}px;
1779
2264
  height: auto;
1780
2265
  padding: 4px 12px 4px 16px;
1781
2266
  white-space: normal;
@@ -1836,7 +2321,7 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
1836
2321
  font-size: 11px;
1837
2322
  }
1838
2323
  .mushi-banner-actions::-webkit-scrollbar { display: none; }
1839
- @media (max-width: 480px) {
2324
+ @media (max-width: ${panelSheetBreakpoint}px) {
1840
2325
  /* Phones: keep only the primary bug CTA (+ dismiss outside the nav). */
1841
2326
  .mushi-banner-actions .mushi-banner-extra { display: none; }
1842
2327
  }
@@ -1959,6 +2444,17 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
1959
2444
 
1960
2445
  .mushi-community-footer{display:flex;align-items:center;gap:8px;padding:10px 0 2px;border-top:1px solid ${isDark ? "rgba(255,255,255,0.07)" : "rgba(0,0,0,0.07)"};margin-top:8px;flex-wrap:wrap}
1961
2446
  .mushi-community-btn{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
2447
+ .mushi-section-label{
2448
+ margin:0 0 6px;
2449
+ font-family:${fontMono};
2450
+ font-size:11px;
2451
+ letter-spacing:0.06em;
2452
+ text-transform:uppercase;
2453
+ color:${inkFaint};
2454
+ }
2455
+ .mushi-more-nav{margin-top:4px}
2456
+ .mushi-more-nav-panel{display:flex;flex-direction:column;gap:0;border-top:1px dashed ${rule};padding-top:2px}
2457
+ .mushi-more-nav-link{align-self:flex-start;margin:6px 0 2px;padding:0}
1962
2458
  /* \u2500\u2500 "More issue types \u2192" toggle (progressive disclosure) \u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
1963
2459
  .mushi-more-toggle {
1964
2460
  display: flex;
@@ -2022,7 +2518,7 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
2022
2518
  .mushi-account-rank{display:block}
2023
2519
  .mushi-xapp-app-head{display:flex;align-items:center;gap:8px;margin:0 0 6px}
2024
2520
  .mushi-xapp-app-name{font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.06em;margin:0}
2025
- .mushi-app-icon{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;border-radius:6px;border:1px solid ${isDark ? "rgba(255,255,255,0.12)" : "rgba(0,0,0,0.1)"};background:#fff;overflow:hidden;flex-shrink:0}
2521
+ .mushi-app-icon{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;border-radius:6px;border:1px solid ${isDark ? "rgba(255,255,255,0.12)" : "rgba(0,0,0,0.1)"};background:${paperRaised};overflow:hidden;flex-shrink:0}
2026
2522
  .mushi-app-icon-img{display:block;width:16px;height:16px;object-fit:contain}
2027
2523
  .mushi-app-icon-initials{font-size:9px;font-weight:700;color:${inkDim};line-height:1}
2028
2524
  .mushi-app-icon-initials-only{background:${isDark ? "rgba(255,255,255,0.06)" : "rgba(0,0,0,0.04)"}}
@@ -2039,14 +2535,14 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
2039
2535
  .mushi-assistant-chip:hover{background:${isDark ? "rgba(255,90,71,0.22)" : "rgba(224,60,44,0.14)"}}
2040
2536
  .mushi-assistant-chip:focus-visible{outline:2px solid ${widgetAccent};outline-offset:2px}
2041
2537
  .mushi-assistant-msg{max-width:85%;padding:8px 12px;border-radius:12px;font:400 14px/1.45 ${fontBody};white-space:pre-wrap;word-break:break-word}
2042
- .mushi-assistant-msg-user{align-self:flex-end;background:${widgetAccent};color:#fff;border-bottom-right-radius:4px}
2538
+ .mushi-assistant-msg-user{align-self:flex-end;background:${widgetAccent};color:${inverse};border-bottom-right-radius:4px}
2043
2539
  .mushi-assistant-msg-bot{align-self:flex-start;background:${isDark ? "rgba(255,255,255,0.06)" : "rgba(0,0,0,0.05)"};color:${ink};border-bottom-left-radius:4px}
2044
2540
  .mushi-assistant-thinking{opacity:0.6;font-size:18px;letter-spacing:2px}
2045
- .mushi-assistant-error{align-self:flex-start;color:${isDark ? "#F87171" : "#DC2626"};font-size:12px;padding:4px 2px}
2541
+ .mushi-assistant-error{align-self:flex-start;color:${danger};font-size:12px;padding:4px 2px}
2046
2542
  .mushi-assistant-form{display:flex;align-items:flex-end;gap:8px;border-top:1px solid ${rule};padding-top:8px}
2047
2543
  .mushi-assistant-input{flex:1;resize:none;max-height:120px;border:1px solid ${ruleStrong};border-radius:10px;padding:8px 12px;font:400 14px/1.4 ${fontBody};background:${paper};color:${ink}}
2048
2544
  .mushi-assistant-input:focus-visible{outline:2px solid ${widgetAccent};outline-offset:1px}
2049
- .mushi-assistant-submit{flex-shrink:0;width:36px;height:36px;border:none;border-radius:50%;background:${widgetAccent};color:#fff;font-size:18px;line-height:1;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:transform .15s,opacity .15s}
2545
+ .mushi-assistant-submit{flex-shrink:0;width:36px;height:36px;border:none;border-radius:50%;background:${widgetAccent};color:${inverse};font-size:18px;line-height:1;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:transform .15s,opacity .15s}
2050
2546
  .mushi-assistant-submit:hover{transform:translateY(-1px)}
2051
2547
  .mushi-assistant-submit:disabled{opacity:0.5;cursor:default;transform:none}
2052
2548
  .mushi-assistant-submit:focus-visible{outline:2px solid ${widgetAccent};outline-offset:2px}
@@ -2055,7 +2551,7 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
2055
2551
 
2056
2552
  // src/version.ts
2057
2553
  var MUSHI_SDK_PACKAGE = "@mushi-mushi/web";
2058
- var MUSHI_SDK_VERSION = "1.19.2" ;
2554
+ var MUSHI_SDK_VERSION = "1.21.0" ;
2059
2555
  var CATEGORY_ICONS = {
2060
2556
  bug: "\u26A0\uFE0F",
2061
2557
  slow: "\u{1F40C}",
@@ -2254,8 +2750,9 @@ function renderStep(ctx) {
2254
2750
  }
2255
2751
  }
2256
2752
  function renderAssistantStep(ctx) {
2257
- const label = ctx.callbacks.assistantLabel || "Ask";
2258
- const greeting = ctx.callbacks.assistantGreeting || "Ask me anything about this app.";
2753
+ const t = ctx.locale;
2754
+ const label = ctx.callbacks.assistantLabel || t.assistant.defaultLabel;
2755
+ const greeting = ctx.callbacks.assistantGreeting || t.assistant.defaultGreeting;
2259
2756
  const suggestions = ctx.callbacks.assistantSuggestions ?? [];
2260
2757
  const empty = ctx.assistantTurns.length === 0;
2261
2758
  const transcript = empty ? `<div class="mushi-assistant-greeting">${escapeHtml(greeting)}</div>
@@ -2264,7 +2761,7 @@ function renderAssistantStep(ctx) {
2264
2761
  const opts = turn.options && turn.options.length ? `<div class="mushi-assistant-suggestions">${turn.options.map((o) => `<button type="button" class="mushi-assistant-chip" data-action="assistant-suggest" data-value="${escapeHtml(o)}">${escapeHtml(o)}</button>`).join("")}</div>` : "";
2265
2762
  return `<div class="mushi-assistant-msg ${cls}">${escapeHtml(turn.text)}</div>${opts}`;
2266
2763
  }).join("");
2267
- const thinking = ctx.assistantSending ? `<div class="mushi-assistant-msg mushi-assistant-msg-bot mushi-assistant-thinking">\u2026</div>` : "";
2764
+ const thinking = ctx.assistantSending ? `<div class="mushi-assistant-msg mushi-assistant-msg-bot mushi-assistant-thinking" role="status" aria-live="polite">${escapeHtml(t.assistant.thinking)}</div>` : "";
2268
2765
  const error = ctx.assistantError ? `<div class="mushi-assistant-error" role="alert">${escapeHtml(ctx.assistantError)}</div>` : "";
2269
2766
  return `
2270
2767
  ${renderHeader(ctx, { title: label, showBack: true })}
@@ -2278,10 +2775,10 @@ function renderAssistantStep(ctx) {
2278
2775
  <textarea
2279
2776
  class="mushi-assistant-input"
2280
2777
  rows="1"
2281
- placeholder="Type your question\u2026"
2778
+ placeholder="${escapeHtml(t.assistant.inputPlaceholder)}"
2282
2779
  ${ctx.assistantSending ? "disabled" : ""}
2283
2780
  ></textarea>
2284
- <button type="submit" class="mushi-assistant-submit" ${ctx.assistantSending ? "disabled" : ""} aria-label="Send">\u2191</button>
2781
+ <button type="submit" class="mushi-assistant-submit" ${ctx.assistantSending ? "disabled" : ""} aria-label="${escapeHtml(t.assistant.sendAriaLabel)}">\u2191</button>
2285
2782
  </form>
2286
2783
  </div>
2287
2784
  `;
@@ -2301,7 +2798,7 @@ function renderOutdatedBanner(ctx) {
2301
2798
  }
2302
2799
  function renderBrandFooter(ctx) {
2303
2800
  if (ctx.config.brandFooter === false) return "";
2304
- return `<div class="mushi-brand-footer">Powered by Mushi v${escapeHtml(ctx.sdkVersion)}</div>`;
2801
+ return `<div class="mushi-brand-footer">${escapeHtml(ctx.locale.flows.poweredBy.replace("{version}", ctx.sdkVersion))}</div>`;
2305
2802
  }
2306
2803
  function renderHeader(ctx, opts) {
2307
2804
  const t = ctx.locale;
@@ -2322,14 +2819,76 @@ function renderHeader(ctx, opts) {
2322
2819
  </div>
2323
2820
  `;
2324
2821
  }
2325
- function renderStepIndicator(_ctx, currentStep) {
2326
- const segments = [];
2327
- for (let i = 1; i <= TOTAL_STEPS; i++) {
2328
- const cls = i < currentStep ? "mushi-step-num done" : i === currentStep ? "mushi-step-num active" : "mushi-step-num";
2329
- segments.push(`<span class="${cls}">${pad2(i)}</span>`);
2330
- if (i < TOTAL_STEPS) segments.push('<span class="mushi-step-sep" aria-hidden="true"></span>');
2822
+ function countMoreNavItems(ctx) {
2823
+ let n = 1;
2824
+ if (ctx.callbacks.onFeatureBoardRequest) n += 1;
2825
+ if (ctx.callbacks.assistantEnabled) n += 1;
2826
+ if (ctx.rewardsState) n += 1;
2827
+ n += 1;
2828
+ return n;
2829
+ }
2830
+ function renderMoreNavSection(ctx) {
2831
+ const t = ctx.locale;
2832
+ const mn = t.step1.moreNav;
2833
+ const count = countMoreNavItems(ctx);
2834
+ const toggleLabel = `${t.step1.moreNavLabel} (${count})`;
2835
+ const unread = ctx.unreadCount();
2836
+ const reportsLabel = unread ? `${mn.yourReports} (${unread} ${mn.unreadNew})` : mn.yourReports;
2837
+ const panelItems = [
2838
+ `<button type="button" class="mushi-option-btn mushi-reports-entry" data-action="reports">
2839
+ <span class="mushi-option-icon" aria-hidden="true">\u{1F4EC}</span>
2840
+ <div class="mushi-option-text">
2841
+ <span class="mushi-option-label">${escapeHtml(reportsLabel)}</span>
2842
+ <span class="mushi-option-desc">${escapeHtml(mn.yourReportsDesc)}</span>
2843
+ </div>
2844
+ <span class="mushi-option-arrow" aria-hidden="true">\u2192</span>
2845
+ </button>`
2846
+ ];
2847
+ if (ctx.callbacks.onFeatureBoardRequest) {
2848
+ panelItems.push(`
2849
+ <button type="button" class="mushi-option-btn" data-action="roadmap">
2850
+ <span class="mushi-option-icon" aria-hidden="true">\u{1F5F3}\uFE0F</span>
2851
+ <div class="mushi-option-text">
2852
+ <span class="mushi-option-label">${escapeHtml(mn.communityIdeas)}</span>
2853
+ <span class="mushi-option-desc">${escapeHtml(mn.communityIdeasDesc)}</span>
2854
+ </div>
2855
+ <span class="mushi-option-arrow" aria-hidden="true">\u2192</span>
2856
+ </button>`);
2857
+ }
2858
+ if (ctx.callbacks.assistantEnabled) {
2859
+ panelItems.push(`
2860
+ <button type="button" class="mushi-option-btn" data-action="assistant">
2861
+ <span class="mushi-option-icon" aria-hidden="true">\u{1F4AC}</span>
2862
+ <div class="mushi-option-text">
2863
+ <span class="mushi-option-label">${escapeHtml(ctx.callbacks.assistantLabel || t.assistant.defaultLabel)}</span>
2864
+ <span class="mushi-option-desc">${escapeHtml(t.assistant.hubDescription)}</span>
2865
+ </div>
2866
+ <span class="mushi-option-arrow" aria-hidden="true">\u2192</span>
2867
+ </button>`);
2868
+ }
2869
+ if (ctx.rewardsState) {
2870
+ panelItems.push(`
2871
+ <button type="button" class="mushi-link-btn mushi-more-nav-link" data-action="open-leaderboard">\u{1F3C6} ${escapeHtml(mn.leaderboard)}</button>`);
2331
2872
  }
2332
- return `<div class="mushi-step-indicator" aria-hidden="true">${segments.join("")}</div>`;
2873
+ panelItems.push(`
2874
+ <button type="button" class="mushi-link-btn mushi-more-nav-link" data-action="open-account">
2875
+ ${ctx.testerInfo ? `\u{1F464} ${escapeHtml(ctx.testerInfo.public_handle ?? ctx.testerInfo.display_name ?? mn.myAccount)}` : `\u{1F310} ${escapeHtml(mn.joinCommunity)}`}
2876
+ </button>`);
2877
+ const panelHtml = ctx.showMoreNav ? `<div class="mushi-more-nav-panel">${panelItems.join("")}</div>` : "";
2878
+ return `
2879
+ <div class="mushi-more-nav">
2880
+ <button
2881
+ type="button"
2882
+ class="mushi-more-toggle mushi-more-nav-toggle"
2883
+ data-action="toggle-more-nav"
2884
+ aria-expanded="${ctx.showMoreNav ? "true" : "false"}"
2885
+ >
2886
+ <span class="mushi-more-toggle-text">${escapeHtml(toggleLabel)}</span>
2887
+ <span class="mushi-more-toggle-arrow" aria-hidden="true">${ctx.showMoreNav ? "\u25BE" : "\u25B8"}</span>
2888
+ </button>
2889
+ ${panelHtml}
2890
+ </div>
2891
+ `;
2333
2892
  }
2334
2893
  function renderCategoryStep(ctx) {
2335
2894
  const t = ctx.locale;
@@ -2370,42 +2929,21 @@ function renderCategoryStep(ctx) {
2370
2929
  ${renderHeader(ctx, { title: t.step1.heading, step: STEP_NUMBER.category })}
2371
2930
  ${ctx.config.betaMode?.enabled ? renderBetaStrip(ctx) : ""}
2372
2931
  <div class="mushi-body" role="radiogroup" aria-label="${escapeHtml(t.step1.heading)}">
2373
- <button type="button" class="mushi-option-btn mushi-reports-entry" data-action="reports">
2374
- <span class="mushi-option-icon" aria-hidden="true">\u{1F4EC}</span>
2375
- <div class="mushi-option-text">
2376
- <span class="mushi-option-label">Your reports${ctx.unreadCount() ? ` (${ctx.unreadCount()} new)` : ""}</span>
2377
- <span class="mushi-option-desc">See status, developer replies, and respond</span>
2378
- </div>
2379
- <span class="mushi-option-arrow" aria-hidden="true">\u2192</span>
2380
- </button>
2932
+ <p class="mushi-section-label">${escapeHtml(t.step1.reportSectionLabel)}</p>
2381
2933
  ${renderFeatureRequestEntry(ctx)}
2382
- ${ctx.callbacks.onFeatureBoardRequest ? `
2383
- <button type="button" class="mushi-option-btn" data-action="roadmap">
2384
- <span class="mushi-option-icon" aria-hidden="true">\u{1F5F3}\uFE0F</span>
2385
- <div class="mushi-option-text">
2386
- <span class="mushi-option-label">Community ideas</span>
2387
- <span class="mushi-option-desc">Vote on features and see what shipped</span>
2388
- </div>
2389
- <span class="mushi-option-arrow" aria-hidden="true">\u2192</span>
2390
- </button>` : ""}
2391
2934
  ${primaryCategories}
2392
2935
  ${secondaryHtml}
2393
2936
  ${ctx.rewardsState ? renderRewardsNudge(ctx) : ""}
2394
- <div class="mushi-community-footer">
2395
- <button type="button" class="mushi-link-btn mushi-community-btn" data-action="open-account">
2396
- ${ctx.testerInfo ? `\u{1F464} ${escapeHtml(ctx.testerInfo.public_handle ?? ctx.testerInfo.display_name ?? "My account")}` : "\u{1F310} Join community \xB7 Track reports across apps"}
2397
- </button>
2398
- ${ctx.rewardsState ? `<button type="button" class="mushi-link-btn" data-action="open-leaderboard">\u{1F3C6} Leaderboard</button>` : ""}
2399
- </div>
2937
+ ${renderMoreNavSection(ctx)}
2400
2938
  </div>
2401
- ${renderStepIndicator(ctx, STEP_NUMBER.category)}
2402
2939
  `;
2403
2940
  }
2404
2941
  function renderFeatureRequestEntry(ctx) {
2405
2942
  const enabled = ctx.config.featureRequestCard !== false;
2406
2943
  if (!enabled) return "";
2407
- const label = ctx.config.featureRequestLabel || "Feature request";
2408
- const desc = ctx.config.featureRequestDescription || "Suggest something new \u2014 even rough ideas help us prioritise";
2944
+ const f = ctx.locale.flows.featureRequest;
2945
+ const label = ctx.config.featureRequestLabel || f.label;
2946
+ const desc = ctx.config.featureRequestDescription || f.description;
2409
2947
  return `
2410
2948
  <button
2411
2949
  type="button"
@@ -2438,7 +2976,7 @@ function renderBetaChangelog(ctx) {
2438
2976
  function renderBetaStrip(ctx) {
2439
2977
  const beta = ctx.config.betaMode;
2440
2978
  const appName = escapeHtml(beta.appName ?? "This app");
2441
- const message = beta.message ? escapeHtml(beta.message) : `${appName} is in early development \u2014 updates ship weekly`;
2979
+ const message = beta.message ? escapeHtml(beta.message) : `${appName} is in early development`;
2442
2980
  const email = beta.contactEmail ? escapeHtml(beta.contactEmail) : null;
2443
2981
  const perks = beta.perks ?? [];
2444
2982
  return `
@@ -2458,6 +2996,7 @@ function renderBetaStrip(ctx) {
2458
2996
  `;
2459
2997
  }
2460
2998
  function renderReportsStep(ctx) {
2999
+ const f = ctx.locale.flows;
2461
3000
  const reports = ctx.reporterReports.map((report) => {
2462
3001
  const title = report.summary ?? report.description ?? `Report ${report.id.slice(0, 8)}`;
2463
3002
  const tone = reporterStatusTone(report.status);
@@ -2476,50 +3015,53 @@ function renderReportsStep(ctx) {
2476
3015
  <span class="mushi-report-chevron" aria-hidden="true">\u203A</span>
2477
3016
  </button>`;
2478
3017
  }).join("");
2479
- const leaderboardBtn = ctx.rewardsState ? `<button type="button" class="mushi-leaderboard-link" data-action="open-leaderboard">\u{1F3C6} Leaderboard</button>` : "";
3018
+ const leaderboardBtn = ctx.rewardsState ? `<button type="button" class="mushi-leaderboard-link" data-action="open-leaderboard">\u{1F3C6} ${escapeHtml(f.reports.leaderboardLink)}</button>` : "";
2480
3019
  return `
2481
- ${renderHeader(ctx, { title: "Your reports", showBack: true, eyebrow: "Mushi \xB7 Inbox" })}
3020
+ ${renderHeader(ctx, { title: f.reports.title, showBack: true, eyebrow: f.eyebrows.inbox })}
2482
3021
  <div class="mushi-body">
2483
- ${ctx.reporterLoading ? '<p class="mushi-muted">Loading reports\u2026</p>' : ""}
3022
+ ${ctx.reporterLoading ? `<p class="mushi-muted">${escapeHtml(f.reports.loading)}</p>` : ""}
2484
3023
  ${ctx.reporterError ? `<p class="mushi-error-inline">${escapeHtml(ctx.reporterError)}</p>` : ""}
2485
- ${reports || (!ctx.reporterLoading ? '<p class="mushi-muted">No reports from this browser yet.</p>' : "")}
3024
+ ${reports || (!ctx.reporterLoading ? `<p class="mushi-muted">${escapeHtml(f.reports.empty)}</p>` : "")}
2486
3025
  ${leaderboardBtn}
2487
3026
  </div>
2488
3027
  `;
2489
3028
  }
2490
3029
  function renderRoadmapStep(ctx) {
3030
+ const f = ctx.locale.flows;
2491
3031
  const rows = ctx.featureBoard.map((ticket) => {
2492
3032
  const id = String(ticket.id ?? "");
2493
- const subject = escapeHtml(String(ticket.subject ?? "Untitled idea"));
3033
+ const subject = escapeHtml(String(ticket.subject ?? f.roadmap.untitled));
2494
3034
  const votes = Number(ticket.vote_count ?? 0);
2495
3035
  const shipped = Boolean(ticket.shipped_at);
2496
3036
  const voted = Boolean(ticket.my_vote);
2497
- const status = shipped ? "Shipped" : String(ticket.status_label ?? ticket.status ?? "open");
3037
+ const status = shipped ? f.roadmap.shipped : String(ticket.status_label ?? ticket.status ?? "open");
3038
+ const voteLabel = f.roadmap.voteCount.replace("{n}", String(votes));
2498
3039
  return `
2499
3040
  <div class="mushi-report-row mushi-roadmap-row">
2500
3041
  <div class="mushi-report-main">
2501
3042
  <span class="mushi-report-title">${subject}</span>
2502
3043
  <span class="mushi-report-meta">
2503
3044
  <span class="mushi-report-status">${escapeHtml(status)}</span>
2504
- <span class="mushi-report-when">${votes} vote${votes === 1 ? "" : "s"}</span>
3045
+ <span class="mushi-report-when">${escapeHtml(voteLabel)}</span>
2505
3046
  </span>
2506
3047
  </div>
2507
3048
  ${ctx.callbacks.onFeatureBoardVote ? `
2508
3049
  <button type="button" class="mushi-vote-btn" data-vote-id="${escapeHtml(id)}" aria-pressed="${voted}">
2509
- ${voted ? "Voted" : "Vote"}
3050
+ ${voted ? escapeHtml(f.roadmap.voted) : escapeHtml(f.roadmap.vote)}
2510
3051
  </button>` : ""}
2511
3052
  </div>`;
2512
3053
  }).join("");
2513
3054
  return `
2514
- ${renderHeader(ctx, { title: "Community ideas", showBack: true, eyebrow: "Mushi \xB7 Roadmap" })}
3055
+ ${renderHeader(ctx, { title: f.roadmap.title, showBack: true, eyebrow: f.eyebrows.roadmap })}
2515
3056
  <div class="mushi-body">
2516
- ${ctx.reporterLoading ? '<p class="mushi-muted">Loading ideas\u2026</p>' : ""}
3057
+ ${ctx.reporterLoading ? `<p class="mushi-muted">${escapeHtml(f.roadmap.loading)}</p>` : ""}
2517
3058
  ${ctx.reporterError ? `<p class="mushi-error-inline">${escapeHtml(ctx.reporterError)}</p>` : ""}
2518
- ${rows || (!ctx.reporterLoading ? '<p class="mushi-muted">No community ideas yet. Be the first to suggest one.</p>' : "")}
3059
+ ${rows || (!ctx.reporterLoading ? `<p class="mushi-muted">${escapeHtml(f.roadmap.empty)}</p>` : "")}
2519
3060
  </div>
2520
3061
  `;
2521
3062
  }
2522
3063
  function renderLeaderboardStep(ctx) {
3064
+ const f = ctx.locale.flows;
2523
3065
  const isGlobal = ctx.globalLeaderboard !== null || ctx.globalLeaderboardLoading;
2524
3066
  const entries = isGlobal ? ctx.globalLeaderboard ?? [] : (ctx.leaderboardEntries ?? []).map((e) => ({
2525
3067
  tester_id: "",
@@ -2537,88 +3079,91 @@ function renderLeaderboardStep(ctx) {
2537
3079
  return `
2538
3080
  <div class="mushi-lb-row ${rank === 1 ? "mushi-lb-top" : ""}${isMe ? " mushi-lb-me" : ""}">
2539
3081
  <span class="mushi-lb-rank">#${rank}</span>
2540
- <span class="mushi-lb-name">${escapeHtml(e.public_handle ?? e.display_name ?? "Anon")}</span>
3082
+ <span class="mushi-lb-name">${escapeHtml(e.public_handle ?? e.display_name ?? f.leaderboard.anon)}</span>
2541
3083
  <span class="mushi-lb-pts">${(e.points_30d ?? e.total_points).toLocaleString()} pts</span>
2542
3084
  </div>
2543
3085
  `;
2544
3086
  }).join("");
2545
- const myRankBadge = myRank ? `<div class="mushi-lb-myrank">You are ranked <strong>#${myRank}</strong> this month</div>` : !ctx.testerJwt ? `<button type="button" class="mushi-link-btn" data-action="open-account">Sign in to see your rank \u2192</button>` : "";
3087
+ const myRankBadge = myRank ? `<div class="mushi-lb-myrank">${escapeHtml(f.leaderboard.myRank.replace("{rank}", String(myRank)))}</div>` : !ctx.testerJwt ? `<button type="button" class="mushi-link-btn" data-action="open-account">${escapeHtml(f.leaderboard.signInPrompt)}</button>` : "";
2546
3088
  return `
2547
- ${renderHeader(ctx, { title: "\u{1F3C6} Global Leaderboard", showBack: true, eyebrow: "Mushi \xB7 Community" })}
3089
+ ${renderHeader(ctx, { title: f.leaderboard.title, showBack: true, eyebrow: f.eyebrows.community })}
2548
3090
  <div class="mushi-body">
2549
- ${loading ? '<p class="mushi-muted">Loading leaderboard\u2026</p>' : ""}
2550
- ${!loading && !entries.length ? '<p class="mushi-muted">No contributors yet \u2014 be the first!</p>' : ""}
3091
+ ${loading ? `<p class="mushi-muted">${escapeHtml(f.leaderboard.loading)}</p>` : ""}
3092
+ ${!loading && !entries.length ? `<p class="mushi-muted">${escapeHtml(f.leaderboard.empty)}</p>` : ""}
2551
3093
  <div class="mushi-lb-list">${rows}</div>
2552
3094
  ${myRankBadge}
2553
- <p class="mushi-lb-note">Global contributors this month \xB7 Points refresh monthly</p>
3095
+ <p class="mushi-lb-note">${escapeHtml(f.leaderboard.footer)}</p>
2554
3096
  </div>
2555
3097
  `;
2556
3098
  }
2557
3099
  function renderAccountStep(ctx) {
3100
+ const f = ctx.locale.flows;
2558
3101
  const tester = ctx.testerInfo;
2559
3102
  if (tester) {
2560
- const handle = tester.public_handle ?? tester.display_name ?? "Tester";
3103
+ const handle = tester.public_handle ?? tester.display_name ?? f.leaderboard.anon;
2561
3104
  const rep = ctx.testerReputation;
3105
+ const rankLine = rep ? f.account.rankSummary.replace("{rank}", String(rep.rank ?? "\u2014")).replace("{points}", (rep.points_30d ?? 0).toLocaleString()) : "";
2562
3106
  return `
2563
- ${renderHeader(ctx, { title: "\u866B Mushi Account", showBack: true, eyebrow: "Mushi \xB7 Identity" })}
3107
+ ${renderHeader(ctx, { title: f.account.title, showBack: true, eyebrow: f.eyebrows.identity })}
2564
3108
  <div class="mushi-body">
2565
3109
  <div class="mushi-account-card">
2566
3110
  <div class="mushi-account-avatar">${escapeHtml(handle.charAt(0).toUpperCase())}</div>
2567
3111
  <div class="mushi-account-info">
2568
3112
  <strong>${escapeHtml(handle)}</strong>
2569
- ${rep ? `<span class="mushi-account-rank">Rank #${rep.rank ?? "\u2014"} \xB7 ${(rep.points_30d ?? 0).toLocaleString()} pts this month</span>` : ""}
3113
+ ${rep ? `<span class="mushi-account-rank">${escapeHtml(rankLine)}</span>` : ""}
2570
3114
  </div>
2571
3115
  </div>
2572
3116
  <button type="button" class="mushi-nav-item" data-action="open-cross-app-reports">
2573
- My reports across all apps \u2192
3117
+ ${escapeHtml(f.account.crossAppReports)}
2574
3118
  </button>
2575
3119
  <button type="button" class="mushi-nav-item" data-action="open-global-leaderboard">
2576
- View global leaderboard \u2192
3120
+ ${escapeHtml(f.account.viewLeaderboard)}
2577
3121
  </button>
2578
- <button type="button" class="mushi-link-btn" data-action="sign-out-tester">Sign out</button>
3122
+ <button type="button" class="mushi-link-btn" data-action="sign-out-tester">${escapeHtml(f.account.signOut)}</button>
2579
3123
  </div>
2580
3124
  `;
2581
3125
  }
2582
3126
  if (ctx.magicLinkSent) {
2583
3127
  return `
2584
- ${renderHeader(ctx, { title: "\u866B Check your email", showBack: true, eyebrow: "Mushi \xB7 Sign in" })}
3128
+ ${renderHeader(ctx, { title: f.account.checkEmailTitle, showBack: true, eyebrow: f.eyebrows.signIn })}
2585
3129
  <div class="mushi-body">
2586
- <p class="mushi-muted">We sent a sign-in link to <strong>${escapeHtml(ctx.magicLinkEmail)}</strong>. Click it to connect your reports across apps and join the community.</p>
2587
- <button type="button" class="mushi-link-btn" data-action="resend-magic-link">Resend email</button>
3130
+ <p class="mushi-muted">${escapeHtml(f.account.magicLinkSent.replace("{email}", ctx.magicLinkEmail))}</p>
3131
+ <button type="button" class="mushi-link-btn" data-action="resend-magic-link">${escapeHtml(f.account.resendEmail)}</button>
2588
3132
  ${ctx.magicLinkError ? `<p class="mushi-error">${escapeHtml(ctx.magicLinkError)}</p>` : ""}
2589
3133
  </div>
2590
3134
  `;
2591
3135
  }
2592
3136
  return `
2593
- ${renderHeader(ctx, { title: "\u866B Join the community", showBack: true, eyebrow: "Mushi \xB7 Sign in" })}
3137
+ ${renderHeader(ctx, { title: f.account.joinTitle, showBack: true, eyebrow: f.eyebrows.signIn })}
2594
3138
  <div class="mushi-body">
2595
- <p class="mushi-muted">Sign in to see your reports across all apps and climb the global leaderboard. No password needed.</p>
2596
- <label class="mushi-label" for="mushi-email-input">Email address</label>
3139
+ <p class="mushi-muted">${escapeHtml(f.account.signInPrompt)}</p>
3140
+ <label class="mushi-label" for="mushi-email-input">${escapeHtml(f.account.emailLabel)}</label>
2597
3141
  <input
2598
3142
  id="mushi-email-input"
2599
3143
  type="email"
2600
3144
  class="mushi-textarea"
2601
3145
  data-role="magic-link-email"
2602
- placeholder="you@example.com"
3146
+ placeholder="${escapeHtml(f.account.emailPlaceholder)}"
2603
3147
  autocomplete="email"
2604
3148
  value="${escapeHtml(ctx.magicLinkEmail)}"
2605
3149
  style="padding: 10px 12px; height: auto; resize: none;"
2606
3150
  />
2607
3151
  ${ctx.magicLinkError ? `<p class="mushi-error">${escapeHtml(ctx.magicLinkError)}</p>` : ""}
2608
3152
  <button type="button" class="mushi-submit" data-action="send-magic-link"${ctx.magicLinkSending ? ' disabled aria-disabled="true"' : ""}>
2609
- <span>${ctx.magicLinkSending ? "Sending\u2026" : "Send sign-in link"}</span><span class="mushi-submit-arrow" aria-hidden="true">\u2192</span>
3153
+ <span>${ctx.magicLinkSending ? escapeHtml(f.account.sending) : escapeHtml(f.account.sendLink)}</span><span class="mushi-submit-arrow" aria-hidden="true">\u2192</span>
2610
3154
  </button>
2611
3155
  </div>
2612
3156
  `;
2613
3157
  }
2614
3158
  function renderCrossAppReportsStep(ctx) {
3159
+ const f = ctx.locale.flows;
2615
3160
  const reports = ctx.crossAppReports ?? [];
2616
3161
  const grouped = /* @__PURE__ */ new Map();
2617
3162
  for (const r of reports) {
2618
3163
  const key = r.project_id ?? "unknown";
2619
3164
  if (!grouped.has(key)) {
2620
3165
  grouped.set(key, {
2621
- name: r.app_name ?? "Unknown App",
3166
+ name: r.app_name ?? f.crossApp.unknownApp,
2622
3167
  slug: r.app_slug ?? null,
2623
3168
  domain: r.app_domain ?? null,
2624
3169
  reports: []
@@ -2653,15 +3198,16 @@ function renderCrossAppReportsStep(ctx) {
2653
3198
  `;
2654
3199
  }).join("");
2655
3200
  return `
2656
- ${renderHeader(ctx, { title: "My reports", showBack: true, eyebrow: "Mushi \xB7 All apps" })}
3201
+ ${renderHeader(ctx, { title: f.crossApp.title, showBack: true, eyebrow: f.eyebrows.allApps })}
2657
3202
  <div class="mushi-body">
2658
- ${ctx.crossAppLoading ? '<p class="mushi-muted">Loading your reports\u2026</p>' : ""}
2659
- ${!ctx.crossAppLoading && !reports.length ? '<p class="mushi-muted">No reports filed yet.</p>' : ""}
3203
+ ${ctx.crossAppLoading ? `<p class="mushi-muted">${escapeHtml(f.crossApp.loading)}</p>` : ""}
3204
+ ${!ctx.crossAppLoading && !reports.length ? `<p class="mushi-muted">${escapeHtml(f.crossApp.empty)}</p>` : ""}
2660
3205
  ${rows}
2661
3206
  </div>
2662
3207
  `;
2663
3208
  }
2664
3209
  function renderReportDetailStep(ctx) {
3210
+ const f = ctx.locale.flows;
2665
3211
  const report = ctx.reporterReports.find((r) => r.id === ctx.selectedReportId);
2666
3212
  const status = report?.status ?? "unknown";
2667
3213
  const tone = reporterStatusTone(status);
@@ -2673,7 +3219,7 @@ function renderReportDetailStep(ctx) {
2673
3219
  </div>
2674
3220
  `).join("");
2675
3221
  return `
2676
- ${renderHeader(ctx, { title: "Report thread", showBack: true, eyebrow: "Mushi \xB7 Inbox" })}
3222
+ ${renderHeader(ctx, { title: f.thread.title, showBack: true, eyebrow: f.eyebrows.thread })}
2677
3223
  <div class="mushi-body">
2678
3224
  <div class="mushi-thread-summary">
2679
3225
  <div class="mushi-thread-summary-meta">
@@ -2683,12 +3229,12 @@ function renderReportDetailStep(ctx) {
2683
3229
  <p>${escapeHtml(report?.summary ?? report?.description ?? "Report details")}</p>
2684
3230
  </div>
2685
3231
  <div class="mushi-thread">
2686
- ${ctx.reporterLoading ? '<p class="mushi-muted">Loading thread\u2026</p>' : comments || '<p class="mushi-muted">No developer replies yet.</p>'}
3232
+ ${ctx.reporterLoading ? `<p class="mushi-muted">${escapeHtml(f.thread.loading)}</p>` : comments || `<p class="mushi-muted">${escapeHtml(f.thread.empty)}</p>`}
2687
3233
  </div>
2688
3234
  ${["fixed", "resolved", "verified"].includes(status) ? `
2689
3235
  <div class="mushi-verify-actions" role="group" aria-label="Fix verification">
2690
- <button type="button" class="mushi-intent-btn" data-action="reporter-confirms">Yes, fixed for me</button>
2691
- <button type="button" class="mushi-intent-btn" data-action="reporter-not-fixed">Not fixed yet</button>
3236
+ <button type="button" class="mushi-option-btn" data-action="reporter-confirms">${escapeHtml(f.thread.confirmFixed)}</button>
3237
+ <button type="button" class="mushi-option-btn" data-action="reporter-not-fixed">${escapeHtml(f.thread.notFixed)}</button>
2692
3238
  </div>
2693
3239
  ` : ""}
2694
3240
  <textarea class="mushi-textarea" data-role="reporter-reply" rows="3" placeholder="Reply to the developer\u2026"></textarea>
@@ -2704,8 +3250,9 @@ function renderIntentStep(ctx) {
2704
3250
  const customEntry = ctx.resolveCustomCategory(catId);
2705
3251
  const intents = customEntry?.intents ?? (t.step2.intents[catId] || []);
2706
3252
  const options = intents.map((intent) => `
2707
- <button type="button" class="mushi-intent-btn" data-intent="${escapeHtml(intent)}">
2708
- ${escapeHtml(intent)}
3253
+ <button type="button" class="mushi-option-btn" data-intent="${escapeHtml(intent)}">
3254
+ <span class="mushi-option-text"><span class="mushi-option-label">${escapeHtml(intent)}</span></span>
3255
+ <span class="mushi-option-arrow" aria-hidden="true">\u2192</span>
2709
3256
  </button>
2710
3257
  `).join("");
2711
3258
  const icon = ctx.categoryIcon(catId);
@@ -2721,7 +3268,6 @@ function renderIntentStep(ctx) {
2721
3268
  ${options}
2722
3269
  </div>
2723
3270
  </div>
2724
- ${renderStepIndicator(ctx, STEP_NUMBER.intent)}
2725
3271
  `;
2726
3272
  }
2727
3273
  function renderDetailsStep(ctx) {
@@ -2782,6 +3328,7 @@ function renderDetailsStep(ctx) {
2782
3328
  ${ctx.screenshotHint ? `<figcaption class="mushi-screenshot-hint">\u26A0 ${escapeHtml(ctx.screenshotHint)}</figcaption>` : ""}
2783
3329
  </figure>` : ""}
2784
3330
  <div class="mushi-error" style="display:none" role="alert"></div>
3331
+ ${ctx.identifiedUser ? `<p class="mushi-identified-user" aria-label="Reporting as ${escapeHtml(ctx.identifiedUser.name ?? ctx.identifiedUser.email ?? "")}">\u{1F464} Reporting as <strong>${escapeHtml(ctx.identifiedUser.name ?? ctx.identifiedUser.email ?? "you")}</strong></p>` : ""}
2785
3332
  </div>
2786
3333
  <div class="mushi-footer">
2787
3334
  <span class="mushi-footer-hint" aria-hidden="true">\u2318 + ENTER \u2192 send</span>
@@ -2790,7 +3337,6 @@ function renderDetailsStep(ctx) {
2790
3337
  <span class="mushi-submit-arrow" aria-hidden="true">\u2192</span>
2791
3338
  </button>
2792
3339
  </div>
2793
- ${renderStepIndicator(ctx, STEP_NUMBER.details)}
2794
3340
  `;
2795
3341
  }
2796
3342
  function renderSuccessStep(ctx) {
@@ -2811,19 +3357,20 @@ function renderSuccessStep(ctx) {
2811
3357
  ${ctx.rewardsState ? renderSuccessRewards(ctx) : ""}
2812
3358
  ${ctx.config.betaMode?.enabled ? renderBetaSuccessFooter(ctx) : ""}
2813
3359
  <button type="button" class="mushi-link-btn mushi-success-my-reports" data-action="view-my-reports">
2814
- \u{1F4EC} Track this report &rsaquo;
3360
+ ${escapeHtml(ctx.locale.flows.success.trackReport)}
2815
3361
  </button>
2816
3362
  </div>
2817
3363
  </div>
2818
3364
  `;
2819
3365
  }
2820
3366
  function renderSuccessReceipt(ctx) {
3367
+ const s = ctx.locale.flows.success;
2821
3368
  if (ctx.lastSubmitQueuedOffline) {
2822
3369
  return `
2823
3370
  <div class="mushi-success-receipt" role="status">
2824
3371
  <div class="mushi-success-receipt-row mushi-success-receipt-warn">
2825
- <span class="mushi-success-receipt-label">Queued offline</span>
2826
- <span class="mushi-success-receipt-hint">We&rsquo;ll send it the moment you&rsquo;re back online.</span>
3372
+ <span class="mushi-success-receipt-label">${escapeHtml(s.queuedOffline)}</span>
3373
+ <span class="mushi-success-receipt-hint">${escapeHtml(s.queuedHint)}</span>
2827
3374
  </div>
2828
3375
  </div>
2829
3376
  `;
@@ -2833,7 +3380,7 @@ function renderSuccessReceipt(ctx) {
2833
3380
  <div class="mushi-success-receipt" role="status">
2834
3381
  <div class="mushi-success-receipt-row">
2835
3382
  <span class="mushi-success-receipt-spinner" aria-hidden="true"></span>
2836
- <span class="mushi-success-receipt-hint">Delivering to the team\u2026</span>
3383
+ <span class="mushi-success-receipt-hint">${escapeHtml(s.delivering)}</span>
2837
3384
  </div>
2838
3385
  ${renderSlaLine(ctx)}
2839
3386
  </div>
@@ -2845,7 +3392,7 @@ function renderSuccessReceipt(ctx) {
2845
3392
  return `
2846
3393
  <div class="mushi-success-receipt" role="status">
2847
3394
  <div class="mushi-success-receipt-row">
2848
- <span class="mushi-success-receipt-label">Receipt</span>
3395
+ <span class="mushi-success-receipt-label">${escapeHtml(s.receipt)}</span>
2849
3396
  <button
2850
3397
  type="button"
2851
3398
  class="mushi-success-receipt-id"
@@ -2861,7 +3408,7 @@ function renderSuccessReceipt(ctx) {
2861
3408
  href="${escapeHtml(trackHref)}"
2862
3409
  target="_blank"
2863
3410
  rel="noopener noreferrer"
2864
- >Track on Mushi <span aria-hidden="true">\u2197</span></a>
3411
+ >${escapeHtml(s.trackOnMushi)} <span aria-hidden="true">\u2197</span></a>
2865
3412
  ` : ""}
2866
3413
  ${renderSlaLine(ctx)}
2867
3414
  </div>
@@ -2872,7 +3419,7 @@ function renderSlaLine(ctx) {
2872
3419
  if (sla) {
2873
3420
  return `<div class="mushi-success-sla">${escapeHtml(sla)}</div>`;
2874
3421
  }
2875
- return `<div class="mushi-success-sla mushi-success-sla-default">A human will look at this within a working day.</div>`;
3422
+ return `<div class="mushi-success-sla mushi-success-sla-default">${escapeHtml(ctx.locale.flows.success.slaDefault)}</div>`;
2876
3423
  }
2877
3424
  function renderBetaSuccessFooter(ctx) {
2878
3425
  const beta = ctx.config.betaMode;
@@ -2881,7 +3428,6 @@ function renderBetaSuccessFooter(ctx) {
2881
3428
  return `
2882
3429
  <div class="mushi-beta-success-footer" role="note" aria-label="Beta feedback acknowledgement">
2883
3430
  ${email ? `<div class="mushi-beta-success-line">\u{1F4EC} Sent to ${email}</div>` : `<div class="mushi-beta-success-line">\u{1F4EC} Sent to ${appName}</div>`}
2884
- <div class="mushi-beta-success-line mushi-beta-success-dim">We aim to review within 48h \xB7 thank you for helping build this</div>
2885
3431
  </div>
2886
3432
  `;
2887
3433
  }
@@ -2971,7 +3517,7 @@ var MushiWidget = class _MushiWidget {
2971
3517
  environments: config.environments ?? {},
2972
3518
  smartHide: config.smartHide ?? false,
2973
3519
  draggable: config.draggable ?? false,
2974
- brandFooter: config.brandFooter ?? true,
3520
+ brandFooter: config.brandFooter ?? false,
2975
3521
  outdatedBanner: config.outdatedBanner ?? "auto",
2976
3522
  screenshotSensitiveHint: config.screenshotSensitiveHint ?? true,
2977
3523
  betaMode: config.betaMode ?? {},
@@ -2990,7 +3536,7 @@ var MushiWidget = class _MushiWidget {
2990
3536
  this.locale = getLocale(this.config.locale === "auto" ? void 0 : this.config.locale);
2991
3537
  this.host = document.createElement("div");
2992
3538
  this.host.id = "mushi-mushi-widget";
2993
- this.shadow = this.host.attachShadow({ mode: "closed" });
3539
+ this.shadow = this.host.attachShadow({ mode: "open" });
2994
3540
  }
2995
3541
  sdkVersion;
2996
3542
  host;
@@ -3016,6 +3562,8 @@ var MushiWidget = class _MushiWidget {
3016
3562
  viaFeatureRequest = false;
3017
3563
  /** Whether the category list is fully expanded (progressive disclosure). */
3018
3564
  showAllCategories = false;
3565
+ /** Secondary hub nav (inbox, assistant, community) collapsed under "More". */
3566
+ showMoreNav = false;
3019
3567
  screenshotAttached = false;
3020
3568
  screenshotCapturing = false;
3021
3569
  screenshotError = false;
@@ -3076,6 +3624,13 @@ var MushiWidget = class _MushiWidget {
3076
3624
  fabPos = null;
3077
3625
  /** Cleanup fn for visualViewport keyboard listener. */
3078
3626
  vvCleanup = null;
3627
+ /**
3628
+ * Host-app user identity forwarded via `Mushi.identify()` or
3629
+ * `Mushi.identifyWithToken()`. Used to show "Reporting as <name>"
3630
+ * in the details step so logged-in users know their report is linked.
3631
+ * Independent of the Mushi tester magic-link session below.
3632
+ */
3633
+ identifiedUser = null;
3079
3634
  /** Mushi tester session JWT — set after in-widget sign-in or by mushi.ts. */
3080
3635
  testerJwt = null;
3081
3636
  /** Tester identity (public_handle, display_name). */
@@ -3228,6 +3783,7 @@ var MushiWidget = class _MushiWidget {
3228
3783
  if (!this.isOpen) return;
3229
3784
  this.isOpen = false;
3230
3785
  this.showAllCategories = false;
3786
+ this.showMoreNav = false;
3231
3787
  this.render();
3232
3788
  this.callbacks.onClose();
3233
3789
  }
@@ -3270,10 +3826,10 @@ var MushiWidget = class _MushiWidget {
3270
3826
  this.assistantTurns.push({ role: "assistant", text: reply.text ?? "\u2026" });
3271
3827
  }
3272
3828
  } else {
3273
- this.assistantError = "No response \u2014 please try again.";
3829
+ this.assistantError = this.locale.assistant.errors.noResponse;
3274
3830
  }
3275
3831
  } catch {
3276
- this.assistantError = "Something went wrong. Please try again.";
3832
+ this.assistantError = this.locale.assistant.errors.generic;
3277
3833
  } finally {
3278
3834
  this.assistantSending = false;
3279
3835
  this.render();
@@ -3476,6 +4032,10 @@ var MushiWidget = class _MushiWidget {
3476
4032
  if (this.isOpen && this.step === "leaderboard") this.render();
3477
4033
  }
3478
4034
  // ── Community public setters (called by mushi.ts after API calls) ──────────
4035
+ setIdentifiedUser(user) {
4036
+ this.identifiedUser = user;
4037
+ if (this.isOpen) this.render();
4038
+ }
3479
4039
  setTesterSession(jwt, info) {
3480
4040
  this.testerJwt = jwt;
3481
4041
  this.testerInfo = info;
@@ -4192,13 +4752,8 @@ var MushiWidget = class _MushiWidget {
4192
4752
  }
4193
4753
  /** Tier accent colour for the rewards UI. */
4194
4754
  tierColor(slug) {
4195
- const colors = {
4196
- free: "#6b7280",
4197
- explorer: "#3b82f6",
4198
- contributor: "#8b5cf6",
4199
- champion: "#f59e0b"
4200
- };
4201
- return colors[slug] ?? "#6c47ff";
4755
+ const colors = MUSHI_TIER_COLORS;
4756
+ return colors[slug] ?? MUSHI_TIER_COLORS.default;
4202
4757
  }
4203
4758
  /**
4204
4759
  * Build the read-only snapshot + bound helper closures the stateless view
@@ -4212,6 +4767,7 @@ var MushiWidget = class _MushiWidget {
4212
4767
  lastReportId: this.lastReportId,
4213
4768
  reporterLoading: this.reporterLoading,
4214
4769
  locale: this.locale,
4770
+ identifiedUser: this.identifiedUser,
4215
4771
  testerReputation: this.testerReputation,
4216
4772
  testerInfo: this.testerInfo,
4217
4773
  screenshotCapturing: this.screenshotCapturing,
@@ -4256,6 +4812,7 @@ var MushiWidget = class _MushiWidget {
4256
4812
  assistantSending: this.assistantSending,
4257
4813
  assistantError: this.assistantError,
4258
4814
  showAllCategories: this.showAllCategories,
4815
+ showMoreNav: this.showMoreNav,
4259
4816
  pageFaviconHref: readPageFaviconHref()
4260
4817
  };
4261
4818
  }
@@ -4298,13 +4855,20 @@ var MushiWidget = class _MushiWidget {
4298
4855
  this.selectedIntent = null;
4299
4856
  this.viaFeatureRequest = false;
4300
4857
  }
4301
- if (this.step === "category") this.showAllCategories = false;
4858
+ if (this.step === "category") {
4859
+ this.showAllCategories = false;
4860
+ this.showMoreNav = false;
4861
+ }
4302
4862
  this.render();
4303
4863
  });
4304
4864
  panel.querySelector('[data-action="show-all-categories"]')?.addEventListener("click", () => {
4305
4865
  this.showAllCategories = true;
4306
4866
  this.render();
4307
4867
  });
4868
+ panel.querySelector('[data-action="toggle-more-nav"]')?.addEventListener("click", () => {
4869
+ this.showMoreNav = !this.showMoreNav;
4870
+ this.render();
4871
+ });
4308
4872
  panel.querySelector('[data-action="assistant"]')?.addEventListener("click", () => {
4309
4873
  this.openAssistantTab();
4310
4874
  });
@@ -4635,6 +5199,14 @@ var MushiWidget = class _MushiWidget {
4635
5199
  this.render();
4636
5200
  }
4637
5201
  }
5202
+ /** Refresh My Reports data for unread badges without opening the inbox panel. */
5203
+ async refreshReporterInboxQuiet() {
5204
+ try {
5205
+ this.reporterReports = await this.callbacks.onReporterReportsRequest?.() ?? [];
5206
+ if (this.isOpen) this.render();
5207
+ } catch {
5208
+ }
5209
+ }
4638
5210
  async loadReporterReports() {
4639
5211
  this.step = "reports";
4640
5212
  this.reporterLoading = true;
@@ -4726,6 +5298,14 @@ var MushiWidget = class _MushiWidget {
4726
5298
  getRecorderStep() {
4727
5299
  return this.step;
4728
5300
  }
5301
+ /** QA / Playwright: category-step IA without piercing closed shadow from page JS. */
5302
+ getRecorderCategoryStepIA() {
5303
+ return {
5304
+ sectionLabel: this.shadow.querySelector(".mushi-section-label")?.textContent?.trim() ?? "",
5305
+ moreToggle: !!this.shadow.querySelector('[data-action="toggle-more-nav"]'),
5306
+ footerStepIndicators: this.shadow.querySelectorAll(".mushi-step-indicator").length
5307
+ };
5308
+ }
4729
5309
  getRecorderTrigger() {
4730
5310
  return this.shadow.querySelector(".mushi-trigger");
4731
5311
  }
@@ -4800,6 +5380,7 @@ function exposeMarketingRecorder(widget) {
4800
5380
  const api = {
4801
5381
  ready: () => widget.getIsMounted(),
4802
5382
  getStep: () => widget.getRecorderStep(),
5383
+ getCategoryStepIA: () => widget.getRecorderCategoryStepIA(),
4803
5384
  getTriggerCenter: () => centerOf(widget.getRecorderTrigger()),
4804
5385
  getCategoryCenter: (category) => centerOf(widget.getRecorderCategoryButton(category)),
4805
5386
  getIntentCenter: (label) => centerOf(widget.getRecorderIntentButton(label)),
@@ -4813,8 +5394,6 @@ function exposeMarketingRecorder(widget) {
4813
5394
  };
4814
5395
  globalThis.__mushiRecorder = api;
4815
5396
  }
4816
-
4817
- // src/rewards.ts
4818
5397
  var MIN_FLUSH_INTERVAL = 3e4;
4819
5398
  var DEFAULT_FLUSH_INTERVAL = 3e5;
4820
5399
  var DWELL_SAMPLE_INTERVAL = 6e4;
@@ -4825,7 +5404,7 @@ var flushTimer = null;
4825
5404
  var dwellTimer = null;
4826
5405
  var currentUserId = null;
4827
5406
  var currentUserTraits = null;
4828
- var reporterTokenHash = null;
5407
+ var reporterTokenRaw = null;
4829
5408
  var apiClient = null;
4830
5409
  var optedIn = false;
4831
5410
  var tierCache = null;
@@ -4888,7 +5467,7 @@ function initRewards(ctx) {
4888
5467
  apiClient = ctx.client;
4889
5468
  currentUserId = ctx.userId;
4890
5469
  currentUserTraits = ctx.traits ?? null;
4891
- reporterTokenHash = ctx.reporterToken ?? null;
5470
+ reporterTokenRaw = ctx.reporterToken ?? null;
4892
5471
  const { projectId } = ctx;
4893
5472
  const flushMs = Math.max(
4894
5473
  MIN_FLUSH_INTERVAL,
@@ -4923,12 +5502,6 @@ function initRewards(ctx) {
4923
5502
  renderConsentBanner(projectId, ctx.config);
4924
5503
  }
4925
5504
  }
4926
- function updateRewardsUser(userId, traits) {
4927
- currentUserId = userId;
4928
- currentUserTraits = traits ?? null;
4929
- tierCache = null;
4930
- tierCacheTime = 0;
4931
- }
4932
5505
  function enqueue(event) {
4933
5506
  if (!optedIn || !currentUserId) return;
4934
5507
  pendingEvents.push({ ...event, queuedAt: Date.now() });
@@ -4945,9 +5518,10 @@ async function flush(ctx) {
4945
5518
  if (isRewardsApiBackedOff()) return;
4946
5519
  const batch = pendingEvents.splice(0, 100);
4947
5520
  try {
5521
+ const reporterTokenHash = reporterTokenRaw ? await sha256Hex(reporterTokenRaw) : void 0;
4948
5522
  const result = await ctx.client.submitActivity(currentUserId, batch, {
4949
5523
  userTraits: currentUserTraits ?? void 0,
4950
- reporterTokenHash: reporterTokenHash ?? void 0,
5524
+ reporterTokenHash,
4951
5525
  optedIn: true,
4952
5526
  hostJwt: hostJwt ?? void 0
4953
5527
  });
@@ -5067,7 +5641,7 @@ function renderTierBadge(tier, config) {
5067
5641
  width: 6px;
5068
5642
  height: 6px;
5069
5643
  border-radius: 50%;
5070
- background: #6c47ff;
5644
+ background: ${MUSHI_COLORS_LIGHT.accent};
5071
5645
  flex-shrink: 0;
5072
5646
  }
5073
5647
  </style>
@@ -5096,16 +5670,16 @@ function renderConsentBanner(projectId, config) {
5096
5670
  <style>
5097
5671
  :host { display: block; }
5098
5672
  .banner {
5099
- background: #fff;
5100
- border: 1px solid #e5e7eb;
5673
+ background: ${MUSHI_COLORS_LIGHT.paperRaised};
5674
+ border: 1px solid ${MUSHI_COLORS_LIGHT.ruleStrong};
5101
5675
  border-radius: 12px;
5102
5676
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
5103
5677
  padding: 14px 16px;
5104
5678
  font-size: 13px;
5105
5679
  line-height: 1.5;
5106
- color: #374151;
5680
+ color: ${MUSHI_COLORS_LIGHT.inkMuted};
5107
5681
  }
5108
- .title { font-weight: 700; margin-bottom: 6px; color: #111827; }
5682
+ .title { font-weight: 700; margin-bottom: 6px; color: ${MUSHI_COLORS_LIGHT.ink}; }
5109
5683
  .actions { display: flex; gap: 8px; margin-top: 10px; }
5110
5684
  button {
5111
5685
  flex: 1;
@@ -5116,8 +5690,8 @@ function renderConsentBanner(projectId, config) {
5116
5690
  font-size: 12px;
5117
5691
  font-weight: 600;
5118
5692
  }
5119
- .accept { background: #6c47ff; color: #fff; }
5120
- .decline { background: #f3f4f6; color: #374151; }
5693
+ .accept { background: ${MUSHI_COLORS_LIGHT.accent}; color: ${MUSHI_COLORS_LIGHT.paperRaised}; }
5694
+ .decline { background: ${MUSHI_COLORS_LIGHT.paper}; color: ${MUSHI_COLORS_LIGHT.inkMuted}; }
5121
5695
  </style>
5122
5696
  <div class="banner">
5123
5697
  <div class="title">\u{1F3AF} Earn rewards</div>
@@ -5666,8 +6240,6 @@ function createPerformanceCapture() {
5666
6240
  }
5667
6241
  };
5668
6242
  }
5669
-
5670
- // src/capture/element-selector.ts
5671
6243
  function createElementSelector() {
5672
6244
  let active = false;
5673
6245
  let overlay = null;
@@ -5727,8 +6299,8 @@ function createElementSelector() {
5727
6299
  position: fixed;
5728
6300
  pointer-events: none;
5729
6301
  z-index: 2147483647;
5730
- border: 2px solid #6366f1;
5731
- background: rgba(99, 102, 241, 0.1);
6302
+ border: 2px solid ${MUSHI_COLORS_LIGHT.accent};
6303
+ background: ${MUSHI_COLORS_LIGHT.accentWash};
5732
6304
  border-radius: 4px;
5733
6305
  transition: all 0.1s ease;
5734
6306
  display: none;
@@ -6822,6 +7394,12 @@ function createProactiveManager(config = {}) {
6822
7394
  }
6823
7395
 
6824
7396
  // src/mushi.ts
7397
+ function resolveReportAppVersion(config, environment) {
7398
+ if (config.appVersion) return config.appVersion;
7399
+ const vercelId = config.integrations?.vercel?.analyticsId;
7400
+ if (vercelId) return vercelId;
7401
+ return environment?.buildId;
7402
+ }
6825
7403
  var instance = null;
6826
7404
  var Mushi = class {
6827
7405
  constructor() {
@@ -6857,6 +7435,8 @@ var Mushi = class {
6857
7435
  };
6858
7436
  function createInstance(config) {
6859
7437
  const bootstrapConfig = applyPresetConfig(config);
7438
+ const projectId = bootstrapConfig.projectId;
7439
+ const reporterTokenForProject = () => getReporterToken(projectId);
6860
7440
  let activeConfig = bootstrapConfig;
6861
7441
  const log = config.debug ?? false ? createLogger({ scope: "mushi", level: "debug", format: "pretty" }) : noopLogger;
6862
7442
  let userToken = null;
@@ -6974,7 +7554,9 @@ function createInstance(config) {
6974
7554
  }
6975
7555
  if (activeConfig.capture?.screenshot !== "off") {
6976
7556
  const screenshotOptions = { privacy: activeConfig.privacy };
6977
- if (screenshotCap) {
7557
+ if (activeConfig.capture?.screenshotProvider) {
7558
+ screenshotCap = null;
7559
+ } else if (screenshotCap) {
6978
7560
  screenshotCap.updateOptions(screenshotOptions);
6979
7561
  } else {
6980
7562
  screenshotCap = createScreenshotCapture(screenshotOptions);
@@ -6982,7 +7564,7 @@ function createInstance(config) {
6982
7564
  } else {
6983
7565
  screenshotCap = null;
6984
7566
  }
6985
- if (!screenshotCap) pendingScreenshot = null;
7567
+ if (!screenshotCap && !activeConfig.capture?.screenshotProvider) pendingScreenshot = null;
6986
7568
  widget.setAllowScreenshotRemove(activeConfig.privacy?.allowUserRemoveScreenshot !== false);
6987
7569
  if (activeConfig.capture?.elementSelector !== false) {
6988
7570
  elementSelector ??= createElementSelector();
@@ -7053,6 +7635,9 @@ function createInstance(config) {
7053
7635
  let pendingElement = null;
7054
7636
  let pendingProactiveTrigger = null;
7055
7637
  let runtimeConfigLoaded = false;
7638
+ let reporterNotificationsEnabled = true;
7639
+ let reporterPollTimer = null;
7640
+ let reporterPollVisibleHandler = null;
7056
7641
  let userInfo = null;
7057
7642
  const customMetadata = {};
7058
7643
  const stickyTags = {};
@@ -7066,8 +7651,76 @@ function createInstance(config) {
7066
7651
  let detachAutoBreadcrumbs = null;
7067
7652
  detachAutoBreadcrumbs = installAutoBreadcrumbs(breadcrumbs);
7068
7653
  let screenshotCaptureInFlight = false;
7654
+ function syncReporterInboxQuiet() {
7655
+ void widget.refreshReporterInboxQuiet();
7656
+ }
7657
+ function stopReporterInboxPolling() {
7658
+ if (reporterPollTimer) clearInterval(reporterPollTimer);
7659
+ reporterPollTimer = null;
7660
+ if (reporterPollVisibleHandler && typeof document !== "undefined") {
7661
+ document.removeEventListener("visibilitychange", reporterPollVisibleHandler);
7662
+ }
7663
+ reporterPollVisibleHandler = null;
7664
+ }
7665
+ function startReporterInboxPolling() {
7666
+ stopReporterInboxPolling();
7667
+ if (!reporterNotificationsEnabled) return;
7668
+ const POLL_MS = 6e4;
7669
+ const tick = () => {
7670
+ if (typeof document !== "undefined" && document.visibilityState === "hidden") return;
7671
+ syncReporterInboxQuiet();
7672
+ };
7673
+ reporterPollTimer = setInterval(tick, POLL_MS);
7674
+ if (typeof document !== "undefined") {
7675
+ reporterPollVisibleHandler = () => {
7676
+ if (document.visibilityState === "visible") syncReporterInboxQuiet();
7677
+ };
7678
+ document.addEventListener("visibilitychange", reporterPollVisibleHandler);
7679
+ }
7680
+ syncReporterInboxQuiet();
7681
+ }
7682
+ function wireRewardsForIdentifiedUser(userId, traits) {
7683
+ if (!activeConfig.rewards?.enabled) return;
7684
+ const rewardsCtx = {
7685
+ client: apiClient2,
7686
+ config: activeConfig.rewards,
7687
+ projectId,
7688
+ userId,
7689
+ traits,
7690
+ reporterToken: reporterTokenForProject()
7691
+ };
7692
+ initRewards(rewardsCtx);
7693
+ if (activeConfig.rewards.showInWidget !== false) {
7694
+ void apiClient2.getMyPoints(userId).then((res) => {
7695
+ if (!res.ok) return;
7696
+ const d = res.data;
7697
+ widget.setRewardsState({
7698
+ tier: d.tier ? { slug: d.tier.slug ?? "free", displayName: d.tier.display_name ?? "Free", pointsThreshold: d.tier.points_threshold ?? 0 } : null,
7699
+ nextTier: d.next_tier ? { displayName: d.next_tier.display_name ?? "", pointsThreshold: d.next_tier.points_threshold ?? 0 } : null,
7700
+ totalPoints: d.total_points ?? 0,
7701
+ pointsForReport: d.report_submit_pts ?? 50
7702
+ });
7703
+ }).catch(() => {
7704
+ });
7705
+ }
7706
+ }
7069
7707
  async function takeScreenshotWithoutChrome() {
7070
- if (!screenshotCap || screenshotCaptureInFlight) return null;
7708
+ if (screenshotCaptureInFlight) return null;
7709
+ const provider = activeConfig.capture?.screenshotProvider;
7710
+ if (provider) {
7711
+ screenshotCaptureInFlight = true;
7712
+ try {
7713
+ const result = await provider();
7714
+ return result ?? null;
7715
+ } catch (err) {
7716
+ log.warn("screenshotProvider threw, falling back to built-in capturer", {
7717
+ error: err instanceof Error ? err.message : String(err)
7718
+ });
7719
+ } finally {
7720
+ screenshotCaptureInFlight = false;
7721
+ }
7722
+ }
7723
+ if (!screenshotCap) return null;
7071
7724
  screenshotCaptureInFlight = true;
7072
7725
  const panelWasVisible = widget.getIsOpen();
7073
7726
  if (panelWasVisible) widget.hidePanel();
@@ -7087,7 +7740,8 @@ function createInstance(config) {
7087
7740
  }
7088
7741
  async function autoCaptureScreenshot(when) {
7089
7742
  const mode = activeConfig.capture?.screenshot;
7090
- if (!screenshotCap || mode === "off" || pendingScreenshot) return;
7743
+ const hasCapture = !!screenshotCap || !!activeConfig.capture?.screenshotProvider;
7744
+ if (!hasCapture || mode === "off" || pendingScreenshot) return;
7091
7745
  if (when === "open" && mode !== "auto") return;
7092
7746
  if (when === "submit" && mode !== "on-report" && mode !== "auto") return;
7093
7747
  log.debug("Auto-capturing screenshot", { when, mode });
@@ -7121,7 +7775,8 @@ function createInstance(config) {
7121
7775
  emit("widget:closed");
7122
7776
  },
7123
7777
  onScreenshotRequest: async () => {
7124
- if (!screenshotCap || activeConfig.capture?.screenshot === "off") return;
7778
+ const hasCapture = !!screenshotCap || !!activeConfig.capture?.screenshotProvider;
7779
+ if (!hasCapture || activeConfig.capture?.screenshot === "off") return;
7125
7780
  log.debug("Taking screenshot");
7126
7781
  pendingScreenshot = await takeScreenshotWithoutChrome();
7127
7782
  widget.setScreenshotAttached(pendingScreenshot !== null);
@@ -7201,36 +7856,36 @@ function createInstance(config) {
7201
7856
  }
7202
7857
  },
7203
7858
  async onReporterReportsRequest() {
7204
- const result = await apiClient2.listReporterReports(getReporterToken());
7859
+ const result = await apiClient2.listReporterReports(getReporterToken(projectId));
7205
7860
  if (!result.ok) throw new Error(result.error?.message ?? "Could not load reports");
7206
7861
  return result.data?.reports ?? [];
7207
7862
  },
7208
7863
  async onReporterCommentsRequest(reportId) {
7209
- const result = await apiClient2.listReporterComments(reportId, getReporterToken());
7864
+ const result = await apiClient2.listReporterComments(reportId, getReporterToken(projectId));
7210
7865
  if (!result.ok) throw new Error(result.error?.message ?? "Could not load thread");
7211
7866
  return result.data?.comments ?? [];
7212
7867
  },
7213
7868
  async onReporterReply(reportId, body) {
7214
- const result = await apiClient2.replyToReporterReport(reportId, getReporterToken(), body);
7869
+ const result = await apiClient2.replyToReporterReport(reportId, getReporterToken(projectId), body);
7215
7870
  if (!result.ok) throw new Error(result.error?.message ?? "Could not send reply");
7216
7871
  },
7217
7872
  async onReporterFeedback(reportId, signal, note) {
7218
- const result = await apiClient2.replyToReporterReport(reportId, getReporterToken(), note ?? "", signal);
7873
+ const result = await apiClient2.replyToReporterReport(reportId, getReporterToken(projectId), note ?? "", signal);
7219
7874
  if (!result.ok) throw new Error(result.error?.message ?? "Could not send feedback");
7220
7875
  return result.data?.feedback ?? null;
7221
7876
  },
7222
7877
  async onReporterReopen(reportId, note) {
7223
- const result = await apiClient2.reopenReporterReport(reportId, getReporterToken(), note);
7878
+ const result = await apiClient2.reopenReporterReport(reportId, getReporterToken(projectId), note);
7224
7879
  if (!result.ok) throw new Error(result.error?.message ?? "Could not reopen report");
7225
7880
  return result.data?.outcome ?? null;
7226
7881
  },
7227
7882
  async onFeatureBoardRequest() {
7228
- const result = await apiClient2.listReporterFeatureBoard(getReporterToken());
7883
+ const result = await apiClient2.listReporterFeatureBoard(getReporterToken(projectId));
7229
7884
  if (!result.ok) throw new Error(result.error?.message ?? "Could not load community ideas");
7230
7885
  return result.data?.tickets ?? [];
7231
7886
  },
7232
7887
  async onFeatureBoardVote(requestId) {
7233
- const result = await apiClient2.voteReporterFeatureBoard(requestId, getReporterToken());
7888
+ const result = await apiClient2.voteReporterFeatureBoard(requestId, getReporterToken(projectId));
7234
7889
  if (!result.ok) throw new Error(result.error?.message ?? "Could not vote");
7235
7890
  return result.data ?? { voted: true, action: "added" };
7236
7891
  },
@@ -7365,17 +8020,21 @@ function createInstance(config) {
7365
8020
  });
7366
8021
  function applyRuntimeConfig(runtime) {
7367
8022
  runtimeConfigLoaded = true;
8023
+ reporterNotificationsEnabled = runtime.reporterNotificationsEnabled !== false;
7368
8024
  if (runtime.enabled === false) {
7369
8025
  activeConfig = bootstrapConfig;
7370
8026
  clearCachedRuntimeConfig(config.projectId);
7371
8027
  syncCaptureModules();
7372
8028
  widget.updateConfig(activeConfig.widget);
8029
+ stopReporterInboxPolling();
7373
8030
  log.debug("Runtime SDK config disabled; using bootstrap config", { version: runtime.version });
7374
8031
  return;
7375
8032
  }
7376
8033
  activeConfig = mergeRuntimeConfig(activeConfig, runtime);
7377
8034
  syncCaptureModules();
7378
8035
  if (runtime.widget) widget.updateConfig(activeConfig.widget);
8036
+ if (reporterNotificationsEnabled) startReporterInboxPolling();
8037
+ else stopReporterInboxPolling();
7379
8038
  log.debug("Applied runtime SDK config", { version: runtime.version });
7380
8039
  }
7381
8040
  if (shouldUseRuntimeConfig(config)) {
@@ -7395,6 +8054,7 @@ function createInstance(config) {
7395
8054
  log.debug("Runtime SDK config disabled via runtimeConfig:false; using static bootstrap config");
7396
8055
  }
7397
8056
  void checkSdkFreshness();
8057
+ startReporterInboxPolling();
7398
8058
  log.info("Initialized", { projectId: config.projectId });
7399
8059
  async function checkSdkFreshness() {
7400
8060
  if (activeConfig.widget?.outdatedBanner === "off") return;
@@ -7482,6 +8142,7 @@ function createInstance(config) {
7482
8142
  if (pendingScreenshot && !screenshotForWire) {
7483
8143
  log.warn("Screenshot dropped \u2014 could not compress under wire budget");
7484
8144
  }
8145
+ const capturedEnvironment = captureEnvironment();
7485
8146
  const report = {
7486
8147
  id: newUuid(),
7487
8148
  projectId: config.projectId,
@@ -7489,7 +8150,7 @@ function createInstance(config) {
7489
8150
  ...userCategory ? { userCategory } : {},
7490
8151
  description: scrubbedDescription,
7491
8152
  userIntent: intent,
7492
- environment: captureEnvironment(),
8153
+ environment: capturedEnvironment,
7493
8154
  consoleLogs,
7494
8155
  networkLogs,
7495
8156
  performanceMetrics: activeConfig.capture?.performance === false ? void 0 : perfCap?.getMetrics(),
@@ -7503,9 +8164,9 @@ function createInstance(config) {
7503
8164
  ...sentryCtx?.release ? { sentryRelease: sentryCtx.release } : {}
7504
8165
  },
7505
8166
  sessionId: getSessionId(),
7506
- reporterToken: getReporterToken(),
8167
+ reporterToken: getReporterToken(projectId),
7507
8168
  ...fingerprintHash ? { fingerprintHash } : {},
7508
- appVersion: config.integrations?.vercel?.analyticsId,
8169
+ appVersion: resolveReportAppVersion(activeConfig, capturedEnvironment),
7509
8170
  sdkPackage: MUSHI_SDK_PACKAGE,
7510
8171
  sdkVersion: MUSHI_SDK_VERSION,
7511
8172
  proactiveTrigger: pendingProactiveTrigger ?? void 0,
@@ -7590,6 +8251,7 @@ function createInstance(config) {
7590
8251
  if (result.ok) {
7591
8252
  log.info("Report sent", { reportId: result.data?.reportId });
7592
8253
  emit("report:sent", { reportId: result.data?.reportId });
8254
+ syncReporterInboxQuiet();
7593
8255
  if (result.data?.cursorAgentId) {
7594
8256
  const d = result.data;
7595
8257
  emit("report:dispatched", { reportId: d.reportId, agentId: d.cursorAgentId, fixId: d.fixId });
@@ -7711,6 +8373,7 @@ function createInstance(config) {
7711
8373
  replayCap?.destroy();
7712
8374
  replayCap = null;
7713
8375
  offlineQueue.stopAutoSync();
8376
+ stopReporterInboxPolling();
7714
8377
  detachAutoBreadcrumbs?.();
7715
8378
  detachAutoBreadcrumbs = null;
7716
8379
  breadcrumbs.clear();
@@ -7738,12 +8401,13 @@ function createInstance(config) {
7738
8401
  ...sentryCtx.breadcrumbs ? { breadcrumbs: scrubBreadcrumbsForWire(sentryCtx.breadcrumbs) } : {},
7739
8402
  ...sentryCtx.tags ? { tags: scrubTagsForWire(sentryCtx.tags) } : {}
7740
8403
  } : void 0;
8404
+ const capturedEnvironment = captureEnvironment();
7741
8405
  const report = {
7742
8406
  id: newUuid(),
7743
8407
  projectId: config.projectId,
7744
8408
  category,
7745
8409
  description,
7746
- environment: captureEnvironment(),
8410
+ environment: capturedEnvironment,
7747
8411
  timeline: timelineCap.getEntries(),
7748
8412
  metadata: {
7749
8413
  ...input.metadata ?? {},
@@ -7757,20 +8421,39 @@ function createInstance(config) {
7757
8421
  ...mergedTags && Object.keys(mergedTags).length > 0 ? { tags: mergedTags } : {},
7758
8422
  ...sentryCtxScrubbed ? { sentryContext: sentryCtxScrubbed } : {},
7759
8423
  sessionId: getSessionId(),
7760
- reporterToken: getReporterToken(),
8424
+ reporterToken: getReporterToken(projectId),
8425
+ appVersion: resolveReportAppVersion(activeConfig, capturedEnvironment),
7761
8426
  sdkPackage: MUSHI_SDK_PACKAGE,
7762
8427
  sdkVersion: MUSHI_SDK_VERSION,
7763
8428
  sentryEventId: sentryCtx?.eventId,
7764
8429
  sentryReplayId: sentryCtx?.replayId,
7765
8430
  createdAt: (/* @__PURE__ */ new Date()).toISOString()
7766
8431
  };
7767
- emit("report:submitted", { reportId: report.id });
8432
+ let finalReport = report;
8433
+ if (activeConfig.beforeSendFeedback) {
8434
+ try {
8435
+ const hookResult = await Promise.race([
8436
+ Promise.resolve(activeConfig.beforeSendFeedback(report)),
8437
+ new Promise((resolve) => setTimeout(() => resolve(report), 2e3))
8438
+ ]);
8439
+ if (hookResult === null) {
8440
+ log.info("captureEvent dropped by beforeSendFeedback hook", { reportId: report.id });
8441
+ return null;
8442
+ }
8443
+ finalReport = hookResult;
8444
+ } catch (err) {
8445
+ log.warn("captureEvent beforeSendFeedback threw \u2014 sending unmodified report", {
8446
+ error: err instanceof Error ? err.message : String(err)
8447
+ });
8448
+ }
8449
+ }
8450
+ emit("report:submitted", { reportId: finalReport.id });
7768
8451
  if (typeof navigator !== "undefined" && !navigator.onLine) {
7769
- await offlineQueue.enqueue(report);
7770
- emit("report:queued", { reportId: report.id });
8452
+ await offlineQueue.enqueue(finalReport);
8453
+ emit("report:queued", { reportId: finalReport.id });
7771
8454
  return null;
7772
8455
  }
7773
- const res = await apiClient2.submitReport(report);
8456
+ const res = await apiClient2.submitReport(finalReport);
7774
8457
  if (res.ok) {
7775
8458
  emit("report:sent", { reportId: res.data?.reportId });
7776
8459
  try {
@@ -7779,8 +8462,8 @@ function createInstance(config) {
7779
8462
  }
7780
8463
  return res.data?.reportId ?? null;
7781
8464
  }
7782
- await offlineQueue.enqueue(report);
7783
- emit("report:failed", { reportId: report.id, error: res.error });
8465
+ await offlineQueue.enqueue(finalReport);
8466
+ emit("report:failed", { reportId: finalReport.id, error: res.error });
7784
8467
  return null;
7785
8468
  },
7786
8469
  async captureException(error, options) {
@@ -7812,6 +8495,9 @@ function createInstance(config) {
7812
8495
  },
7813
8496
  identify(userId, traits) {
7814
8497
  userInfo = { id: userId, ...traits?.email ? { email: traits.email } : {}, ...traits?.name ? { name: traits.name } : {} };
8498
+ widget.setIdentifiedUser(
8499
+ userInfo.name || userInfo.email ? { name: userInfo.name, email: userInfo.email } : null
8500
+ );
7815
8501
  if (traits) {
7816
8502
  for (const [k, v] of Object.entries(traits)) {
7817
8503
  if (k !== "email" && k !== "name") customMetadata[`user.${k}`] = v;
@@ -7822,33 +8508,14 @@ function createInstance(config) {
7822
8508
  level: "info",
7823
8509
  message: `Mushi.identify(${userId})`
7824
8510
  });
7825
- if (activeConfig.rewards?.enabled) {
7826
- const rewardsCtx = {
7827
- client: apiClient2,
7828
- config: activeConfig.rewards,
7829
- projectId: bootstrapConfig.projectId,
7830
- userId,
7831
- traits: traits ? { email: traits.email, name: traits.name, provider: traits.provider } : void 0
7832
- };
7833
- if (userInfo.id === userId) {
7834
- initRewards(rewardsCtx);
7835
- } else {
7836
- updateRewardsUser(userId, rewardsCtx.traits);
7837
- }
7838
- if (activeConfig.rewards.showInWidget !== false) {
7839
- void apiClient2.getMyPoints(userId).then((res) => {
7840
- if (!res.ok) return;
7841
- const d = res.data;
7842
- widget.setRewardsState({
7843
- tier: d.tier ? { slug: d.tier.slug ?? "free", displayName: d.tier.display_name ?? "Free", pointsThreshold: d.tier.points_threshold ?? 0 } : null,
7844
- nextTier: d.next_tier ? { displayName: d.next_tier.display_name ?? "", pointsThreshold: d.next_tier.points_threshold ?? 0 } : null,
7845
- totalPoints: d.total_points ?? 0,
7846
- pointsForReport: d.report_submit_pts ?? 50
7847
- });
7848
- }).catch(() => {
7849
- });
7850
- }
7851
- }
8511
+ wireRewardsForIdentifiedUser(
8512
+ userId,
8513
+ traits ? {
8514
+ email: traits.email,
8515
+ name: traits.name,
8516
+ provider: traits.provider
8517
+ } : void 0
8518
+ );
7852
8519
  },
7853
8520
  identifyWithToken(token) {
7854
8521
  userToken = token && typeof token === "string" ? token : null;
@@ -7860,9 +8527,18 @@ function createInstance(config) {
7860
8527
  ...claims.email ? { email: claims.email } : {},
7861
8528
  ...claims.name ? { name: claims.name } : {}
7862
8529
  };
8530
+ widget.setIdentifiedUser(
8531
+ userInfo.name || userInfo.email ? { name: userInfo.name, email: userInfo.email } : null
8532
+ );
8533
+ wireRewardsForIdentifiedUser(userInfo.id, {
8534
+ email: userInfo.email,
8535
+ name: userInfo.name
8536
+ });
7863
8537
  }
7864
8538
  breadcrumbs.add({ category: "lifecycle", level: "info", message: "Mushi.identifyWithToken()" });
7865
8539
  } else {
8540
+ userInfo = null;
8541
+ widget.setIdentifiedUser(null);
7866
8542
  breadcrumbs.add({ category: "lifecycle", level: "info", message: "Mushi.identifyWithToken(null)" });
7867
8543
  }
7868
8544
  },
@@ -7923,27 +8599,27 @@ function createInstance(config) {
7923
8599
  },
7924
8600
  // ─── Reporter API (cross-platform) ────────────────────────────────
7925
8601
  async listMyReports() {
7926
- const result = await apiClient2.listReporterReports(getReporterToken());
8602
+ const result = await apiClient2.listReporterReports(getReporterToken(projectId));
7927
8603
  if (!result.ok) return [];
7928
8604
  return result.data?.reports ?? [];
7929
8605
  },
7930
8606
  async listMyComments(reportId) {
7931
- const result = await apiClient2.listReporterComments(reportId, getReporterToken());
8607
+ const result = await apiClient2.listReporterComments(reportId, getReporterToken(projectId));
7932
8608
  if (!result.ok) return [];
7933
8609
  return result.data?.comments ?? [];
7934
8610
  },
7935
8611
  async replyToReport(reportId, body) {
7936
- const result = await apiClient2.replyToReporterReport(reportId, getReporterToken(), body);
8612
+ const result = await apiClient2.replyToReporterReport(reportId, getReporterToken(projectId), body);
7937
8613
  if (!result.ok) return null;
7938
8614
  return result.data?.comment ?? null;
7939
8615
  },
7940
8616
  async submitFeedbackSignal(reportId, signal, note) {
7941
- const result = await apiClient2.replyToReporterReport(reportId, getReporterToken(), note ?? "", signal);
8617
+ const result = await apiClient2.replyToReporterReport(reportId, getReporterToken(projectId), note ?? "", signal);
7942
8618
  if (!result.ok) return null;
7943
8619
  return result.data?.feedback ?? null;
7944
8620
  },
7945
8621
  async reopenReport(reportId, note) {
7946
- const result = await apiClient2.reopenReporterReport(reportId, getReporterToken(), note);
8622
+ const result = await apiClient2.reopenReporterReport(reportId, getReporterToken(projectId), note);
7947
8623
  if (!result.ok) return null;
7948
8624
  return result.data?.outcome ?? null;
7949
8625
  },
@@ -8417,6 +9093,6 @@ function stringifyConsoleArg(arg) {
8417
9093
  }
8418
9094
  }
8419
9095
 
8420
- export { Mushi, MushiWidget, createConsoleCapture, createElementSelector, createNetworkCapture, createPerformanceCapture, createProactiveManager, createScreenshotCapture, createTimelineCapture, getAvailableLocales, getLocale, setupProactiveTriggers };
9096
+ export { Mushi, MushiWidget, createConsoleCapture, createElementSelector, createNetworkCapture, createPerformanceCapture, createProactiveManager, createScreenshotCapture, createTimelineCapture, getAvailableLocales, getLocale, getWidgetPreviewTokens, getWidgetThemeVars, setupProactiveTriggers };
8421
9097
  //# sourceMappingURL=index.js.map
8422
9098
  //# sourceMappingURL=index.js.map