@mushi-mushi/web 1.38.0 → 1.39.1
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/README.md +12 -4
- package/dist/index.cjs +89 -55
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +14 -6
- package/dist/index.d.ts +14 -6
- package/dist/index.js +89 -55
- package/dist/index.js.map +1 -1
- package/dist/mushi.loader.global.js +23 -23
- package/dist/test-utils.cjs.map +1 -1
- package/dist/test-utils.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.cts
CHANGED
|
@@ -108,6 +108,8 @@ interface WidgetCallbacks {
|
|
|
108
108
|
onBeforeSubmit?(): boolean | Promise<boolean>;
|
|
109
109
|
onOpen(): void;
|
|
110
110
|
onClose(): void;
|
|
111
|
+
/** A setup problem the widget worked around (e.g. unreadable accent text); logged with `debug: true`. */
|
|
112
|
+
onWarning?(message: string): void;
|
|
111
113
|
/** "Bug reports by Mushi Mushi" mark: impression once per widget instance, click per activation → loop_* events. */
|
|
112
114
|
onBrandFooterImpression?(): void;
|
|
113
115
|
onBrandFooterClick?(): void;
|
|
@@ -177,9 +179,13 @@ declare class MushiWidget {
|
|
|
177
179
|
private rc;
|
|
178
180
|
private lang;
|
|
179
181
|
private isOpen;
|
|
182
|
+
/** Bumped on every open, so work started in one panel never finishes in the next. */
|
|
183
|
+
private openCount;
|
|
180
184
|
private step;
|
|
181
185
|
private readonly styleEl;
|
|
182
186
|
private styleKey;
|
|
187
|
+
/** Theme fixes the widget made, for `diagnose()`. */
|
|
188
|
+
private themeWarnings;
|
|
183
189
|
private readonly panel;
|
|
184
190
|
private readonly scroller;
|
|
185
191
|
private readonly regionEls;
|
|
@@ -423,6 +429,7 @@ declare class MushiWidget {
|
|
|
423
429
|
} | null;
|
|
424
430
|
widgetSuppressed: boolean;
|
|
425
431
|
bannerRendered: boolean;
|
|
432
|
+
warnings: string[];
|
|
426
433
|
};
|
|
427
434
|
private syncAttachedLaunchers;
|
|
428
435
|
private syncSmartHide;
|
|
@@ -451,14 +458,15 @@ declare class MushiWidget {
|
|
|
451
458
|
private detectEnvironment;
|
|
452
459
|
private isRouteHidden;
|
|
453
460
|
private getTheme;
|
|
454
|
-
/**
|
|
461
|
+
/** Any CSS colour → [r, g, b] (null if unparseable); oklch/lab read back via color-mix. */
|
|
455
462
|
private probeRgb;
|
|
463
|
+
/** A host `--mushi-*` colour (inherited from :root too), or ''. */
|
|
464
|
+
private hostColorVar;
|
|
456
465
|
/**
|
|
457
|
-
* Accent
|
|
458
|
-
*
|
|
459
|
-
*
|
|
460
|
-
*
|
|
461
|
-
* Send button could vanish into a page-coloured accent.
|
|
466
|
+
* Accent (Plan 018 §1.4, first wins): host `--mushi-accent` → `widget.accent`
|
|
467
|
+
* → <html> `accent-color` → theme-color meta (these two need 3:1 on the
|
|
468
|
+
* panel) → ink. The accent is never changed; text on it under 3:1 becomes
|
|
469
|
+
* black/white (`lockFg` beats `--mushi-accent-fg`) with a warning.
|
|
462
470
|
*/
|
|
463
471
|
private resolveAccent;
|
|
464
472
|
/** Style + banner + trigger. Each rebuilds only when its inputs changed. */
|
package/dist/index.d.ts
CHANGED
|
@@ -130,6 +130,8 @@ interface WidgetCallbacks {
|
|
|
130
130
|
onBeforeSubmit?(): boolean | Promise<boolean>;
|
|
131
131
|
onOpen(): void;
|
|
132
132
|
onClose(): void;
|
|
133
|
+
/** A setup problem the widget worked around (e.g. unreadable accent text); logged with `debug: true`. */
|
|
134
|
+
onWarning?(message: string): void;
|
|
133
135
|
/** "Bug reports by Mushi Mushi" mark: impression once per widget instance, click per activation → loop_* events. */
|
|
134
136
|
onBrandFooterImpression?(): void;
|
|
135
137
|
onBrandFooterClick?(): void;
|
|
@@ -199,9 +201,13 @@ declare class MushiWidget {
|
|
|
199
201
|
private rc;
|
|
200
202
|
private lang;
|
|
201
203
|
private isOpen;
|
|
204
|
+
/** Bumped on every open, so work started in one panel never finishes in the next. */
|
|
205
|
+
private openCount;
|
|
202
206
|
private step;
|
|
203
207
|
private readonly styleEl;
|
|
204
208
|
private styleKey;
|
|
209
|
+
/** Theme fixes the widget made, for `diagnose()`. */
|
|
210
|
+
private themeWarnings;
|
|
205
211
|
private readonly panel;
|
|
206
212
|
private readonly scroller;
|
|
207
213
|
private readonly regionEls;
|
|
@@ -445,6 +451,7 @@ declare class MushiWidget {
|
|
|
445
451
|
} | null;
|
|
446
452
|
widgetSuppressed: boolean;
|
|
447
453
|
bannerRendered: boolean;
|
|
454
|
+
warnings: string[];
|
|
448
455
|
};
|
|
449
456
|
private syncAttachedLaunchers;
|
|
450
457
|
private syncSmartHide;
|
|
@@ -473,14 +480,15 @@ declare class MushiWidget {
|
|
|
473
480
|
private detectEnvironment;
|
|
474
481
|
private isRouteHidden;
|
|
475
482
|
private getTheme;
|
|
476
|
-
/**
|
|
483
|
+
/** Any CSS colour → [r, g, b] (null if unparseable); oklch/lab read back via color-mix. */
|
|
477
484
|
private probeRgb;
|
|
485
|
+
/** A host `--mushi-*` colour (inherited from :root too), or ''. */
|
|
486
|
+
private hostColorVar;
|
|
478
487
|
/**
|
|
479
|
-
* Accent
|
|
480
|
-
*
|
|
481
|
-
*
|
|
482
|
-
*
|
|
483
|
-
* Send button could vanish into a page-coloured accent.
|
|
488
|
+
* Accent (Plan 018 §1.4, first wins): host `--mushi-accent` → `widget.accent`
|
|
489
|
+
* → <html> `accent-color` → theme-color meta (these two need 3:1 on the
|
|
490
|
+
* panel) → ink. The accent is never changed; text on it under 3:1 becomes
|
|
491
|
+
* black/white (`lockFg` beats `--mushi-accent-fg`) with a warning.
|
|
484
492
|
*/
|
|
485
493
|
private resolveAccent;
|
|
486
494
|
/** Style + banner + trigger. Each rebuilds only when its inputs changed. */
|
package/dist/index.js
CHANGED
|
@@ -182,6 +182,11 @@ function escapeHtml(value) {
|
|
|
182
182
|
function isNotSentOutcome(outcome) {
|
|
183
183
|
return outcome?.failureKind === "blocked" || outcome?.failureKind === "throttled";
|
|
184
184
|
}
|
|
185
|
+
function routeMatches(pathname, entry) {
|
|
186
|
+
if (!entry.includes("*")) return pathname.includes(entry);
|
|
187
|
+
const re = entry.replace(/\/\*\*$|\*\*|\*|[.+?^${}()|[\]\\]/g, (t) => t === "/**" ? "(/.*)?" : t === "**" ? ".*" : t === "*" ? "[^/]*" : `\\${t}`);
|
|
188
|
+
return new RegExp(`^${re}$`).test(pathname.length > 1 ? pathname.replace(/\/$/, "") : pathname);
|
|
189
|
+
}
|
|
185
190
|
function renderAppIconHtml(opts) {
|
|
186
191
|
const domain = opts.appDomain ?? resolveProjectDomain({
|
|
187
192
|
project_id: opts.projectId,
|
|
@@ -1236,7 +1241,7 @@ function getWidgetPreviewTokens(theme) {
|
|
|
1236
1241
|
brandBannerBorder: v.brandBannerBorder
|
|
1237
1242
|
};
|
|
1238
1243
|
}
|
|
1239
|
-
function getWidgetStyles(theme, accent = "", accentText = "") {
|
|
1244
|
+
function getWidgetStyles(theme, accent = "", accentText = "", lockFg = false) {
|
|
1240
1245
|
const v = getWidgetThemeVars(theme);
|
|
1241
1246
|
const panelAccent = safeCssColor(accent);
|
|
1242
1247
|
const panelAccentFg = safeCssColor(accentText);
|
|
@@ -1269,7 +1274,7 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
|
|
|
1269
1274
|
const touchTarget = 44;
|
|
1270
1275
|
const panelLauncherGap = fabSize + MUSHI_SPACING.comfy;
|
|
1271
1276
|
const controlRadius = MUSHI_RADIUS.control;
|
|
1272
|
-
return ` :host{all:initial;color-scheme:${isDark ? "dark" : "light"};font-family:var(--mushi-font,inherit);font-size:var(--mushi-font-size,14px);line-height:1.45;--_bg:var(--mushi-bg,Canvas);--_fg:var(--mushi-fg,CanvasText);--_muted:var(--mushi-muted,color-mix(in oklab,var(--_fg) 64%,transparent));--_surface:var(--mushi-surface,color-mix(in oklab,var(--_bg) 94%,var(--_fg)));--_border:var(--mushi-border,color-mix(in oklab,var(--_fg) 16%,transparent));--_accent:var(--mushi-accent,${panelAccent || "var(--_fg)"});--_accent-fg:var(--mushi-accent-fg,${panelAccent ? panelAccentFg || "white" : "var(--_bg)"});--_ok:var(--mushi-success,${ok});--_err:var(--mushi-error,${danger});--_radius:var(--mushi-radius,12px);--_shadow:var(--mushi-shadow,0 12px 40px rgb(0 0 0 / .18));color:var(--_fg);-webkit-font-smoothing:antialiased;pointer-events:none;}.mushi-trigger,.mushi-banner,.mushi-panel,.mushi-toast{pointer-events:auto;}*,*::before,*::after{box-sizing:border-box;margin:0;padding:0;}button{font-family:inherit;}.mushi-trigger{position:fixed;width:${fabSize}px;height:${fabSize}px;min-width:44px;min-height:44px;border:1px solid var(--_border);border-radius:${controlRadius}px;background:var(--_bg);color:var(--_fg);cursor:pointer;display:flex;align-items:center;justify-content:center;font-size:22px;line-height:1;box-shadow:0 1px 0 var(--_border),0 6px 14px -8px rgba(${shadowInk},0.35),inset 0 -3px 0 var(--_accent);transition:transform ${durationFast}ms ${easeStamp},opacity ${durationFast}ms ${easeStamp};overflow:visible;isolation:isolate;}.mushi-trigger::after{content:'';position:absolute;top:6px;right:6px;width:6px;height:6px;border-radius:50%;background:var(--_accent);box-shadow:0 0 0 0 var(--_accent);animation:mushi-pulse 2.4s ${easeStamp} infinite;}.mushi-trigger:hover{transform:translateY(-2px) rotate(-1.5deg);box-shadow:0 1px 0 var(--_border),0 14px 24px -10px rgba(${shadowInk},0.45),0 0 20px -6px color-mix(in oklab,var(--_accent) 22%,transparent),inset 0 -3px 0 var(--_accent);}.mushi-trigger:active{transform:translateY(0) rotate(0);box-shadow:0 1px 0 var(--_border),0 2px 4px -2px rgba(${shadowInk},0.35),inset 0 -2px 0 var(--_accent);}.mushi-trigger:focus-visible{outline:2px solid var(--_accent);outline-offset:3px;}@keyframes mushi-trigger-pulse{0%{box-shadow:0 0 0 0 color-mix(in oklab,var(--_accent) 55%,transparent),0 1px 0 var(--_border),0 10px 24px -14px rgba(${shadowInk},0.45);}70%{box-shadow:0 0 0 16px color-mix(in oklab,var(--_accent) 0%,transparent),0 1px 0 var(--_border),0 10px 24px -14px rgba(${shadowInk},0.45);}100%{box-shadow:0 0 0 0 color-mix(in oklab,var(--_accent) 0%,transparent),0 1px 0 var(--_border),0 10px 24px -14px rgba(${shadowInk},0.45);}}.mushi-trigger-pulse{animation:mushi-trigger-pulse 800ms ${easeStamp} 3;}@media (prefers-reduced-motion:reduce){.mushi-trigger-pulse{animation:none;}}.mushi-trigger.bottom-right{bottom:var(--mushi-bottom,calc(${gutter}px + env(safe-area-inset-bottom,0px)));right:var(--mushi-right,calc(${gutter}px + env(safe-area-inset-right,0px)));}.mushi-trigger.bottom-left{bottom:var(--mushi-bottom,calc(${gutter}px + env(safe-area-inset-bottom,0px)));left:var(--mushi-left,calc(${gutter}px + env(safe-area-inset-left,0px)));}.mushi-trigger.top-right{top:var(--mushi-top,calc(${gutter}px + env(safe-area-inset-top,0px)));right:var(--mushi-right,calc(${gutter}px + env(safe-area-inset-right,0px)));}.mushi-trigger.top-left{top:var(--mushi-top,calc(${gutter}px + env(safe-area-inset-top,0px)));left:var(--mushi-left,calc(${gutter}px + env(safe-area-inset-left,0px)));}.mushi-trigger.edge-tab{width:${touchTarget}px;height:${edgeTabHeight}px;background:transparent;border:0;border-radius:0;box-shadow:none;font-size:14px;justify-content:flex-end;}.mushi-trigger.edge-tab::after{display:none;}.mushi-trigger.edge-tab:hover,.mushi-trigger.edge-tab:active,.mushi-trigger.edge-tab.dragging{transform:none;box-shadow:none;}.mushi-trigger-face{display:flex;align-items:center;justify-content:center;width:${edgeTabWidth}px;height:100%;background:var(--_bg);border:1px solid var(--_border);border-right:0;border-radius:${controlRadius}px 0 0 ${controlRadius}px;box-shadow:0 4px 12px -6px rgba(${shadowInk},0.4),inset -2px 0 0 var(--_accent);transition:width ${durationFast}ms ${easeStamp},transform ${durationFast}ms ${easeStamp},opacity ${durationFast}ms ${easeStamp};}.mushi-trigger.edge-tab.text{height:auto;min-height:${edgeTabHeight}px;}.mushi-trigger.edge-tab.text .mushi-trigger-face{height:auto;min-height:${edgeTabHeight}px;padding:10px 0;writing-mode:vertical-rl;font-size:12px;white-space:nowrap;}.mushi-trigger.edge-tab:hover .mushi-trigger-face,.mushi-trigger.edge-tab:focus-visible .mushi-trigger-face{width:${edgeTabWidth + 6}px;}.mushi-trigger.edge-tab:focus-visible{outline:none;}.mushi-trigger.edge-tab:focus-visible .mushi-trigger-face{outline:2px solid var(--_accent);outline-offset:2px;}.mushi-trigger.edge-tab.bottom-right,.mushi-trigger.edge-tab.top-right{right:calc(var(--mushi-safe-area,1) * env(safe-area-inset-right,0px));}.mushi-trigger.edge-tab.bottom-left,.mushi-trigger.edge-tab.top-left{left:calc(var(--mushi-safe-area,1) * env(safe-area-inset-left,0px));justify-content:flex-start;}.mushi-trigger.edge-tab.bottom-left .mushi-trigger-face,.mushi-trigger.edge-tab.top-left .mushi-trigger-face{border-right:1px solid var(--_border);border-left:0;border-radius:0 ${controlRadius}px ${controlRadius}px 0;box-shadow:0 4px 12px -6px rgba(${shadowInk},0.4),inset 2px 0 0 var(--_accent);}.mushi-trigger.tucked{opacity:0.3;}.mushi-trigger.edge-tab.tucked{opacity:1;}.mushi-trigger.edge-tab.tucked .mushi-trigger-face{opacity:0.55;transform:translateX(${edgeTabWidth - 6}px);}.mushi-trigger.edge-tab.bottom-left.tucked .mushi-trigger-face,.mushi-trigger.edge-tab.top-left.tucked .mushi-trigger-face{transform:translateX(-${edgeTabWidth - 6}px);}.mushi-trigger.tucked:focus-visible,.mushi-trigger.tucked:focus-visible .mushi-trigger-face{opacity:1;transform:none;}.mushi-trigger.shrunk{width:${bannerHeight}px;height:${bannerHeight}px;opacity:0.82;transform:scale(0.92);}.mushi-trigger{touch-action:none;translate:calc(var(--mushi-drag-active,0) * var(--mushi-drag-x,0px)) calc(var(--mushi-drag-active,0) * var(--mushi-drag-y,0px));}.mushi-trigger.dragging{cursor:grabbing !important;z-index:calc(var(--z,${MUSHI_Z.base}) + 2);transition:none !important;box-shadow:0 1px 0 var(--_border),0 20px 40px -12px rgba(${shadowInk},0.55),inset 0 -3px 0 var(--_accent);opacity:0.92;}@media (prefers-reduced-motion:reduce){.mushi-trigger,.mushi-trigger-face{transition:none !important;}.mushi-trigger::after{animation:none;}.mushi-trigger.edge-tab.tucked .mushi-trigger-face{transform:none !important;}}@keyframes mushi-pulse{0%{box-shadow:0 0 0 0 var(--_accent);opacity:1;}70%{box-shadow:0 0 0 8px transparent;opacity:0.5;}100%{box-shadow:0 0 0 0 transparent;opacity:1;}}.mushi-panel{position:fixed;width:calc(${panelWidth}px + 40px);max-width:calc(100vw - 32px);max-height:min(calc(${panelMaxHeight}px + 160px),calc(100dvh - 96px - var(--mushi-keyboard-inset,0px)));background:var(--_bg);color:var(--_fg);border:1px solid var(--_border);border-radius:var(--_radius);box-shadow:var(--_shadow);overflow:hidden;display:flex;flex-direction:column;transform-origin:var(--mushi-origin,bottom right);}.mushi-panel.open{animation:mushi-open 180ms cubic-bezier(.2,.8,.2,1) both;}.mushi-panel.closed{display:none;}.mushi-panel.mushi-swap .mushi-scroll,.mushi-panel.mushi-swap .mushi-footer{animation:mushi-fade 120ms ease-out both;}@keyframes mushi-open{from{opacity:0;transform:translateY(8px);}}@keyframes mushi-fade{from{opacity:0;}}.mushi-panel.bottom-right{bottom:var(--mushi-panel-bottom,calc(var(--mushi-bottom,${gutter}px) + ${panelLauncherGap}px));right:var(--mushi-right,calc(${gutter}px + env(safe-area-inset-right,0px)));--mushi-origin:bottom right;}.mushi-panel.bottom-left{bottom:var(--mushi-panel-bottom,calc(var(--mushi-bottom,${gutter}px) + ${panelLauncherGap}px));left:var(--mushi-left,calc(${gutter}px + env(safe-area-inset-left,0px)));--mushi-origin:bottom left;}.mushi-panel.top-right{top:var(--mushi-panel-top,calc(var(--mushi-top,${gutter}px) + ${panelLauncherGap}px));right:var(--mushi-right,calc(${gutter}px + env(safe-area-inset-right,0px)));--mushi-origin:top right;}.mushi-panel.top-left{top:var(--mushi-panel-top,calc(var(--mushi-top,${gutter}px) + ${panelLauncherGap}px));left:var(--mushi-left,calc(${gutter}px + env(safe-area-inset-left,0px)));--mushi-origin:top left;}.mushi-panel.keyboard-open{bottom:calc(var(--mushi-keyboard-inset,0px) + 8px) !important;}@media (max-width:${panelSheetBreakpoint}px){.mushi-panel{left:0 !important;right:0 !important;top:auto !important;width:100% !important;max-width:100% !important;max-height:calc(100dvh - 24px - var(--mushi-keyboard-inset,0px));border-radius:var(--_radius) var(--_radius) 0 0;bottom:var(--mushi-keyboard-inset,0px) !important;padding-bottom:env(safe-area-inset-bottom,0px);}}.mushi-panel :focus-visible{outline:2px solid var(--_accent);outline-offset:2px;}.mushi-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;}.mushi-notice:empty,.mushi-lead:empty,.mushi-footer:empty,.mushi-brand:empty{display:none;}.mushi-outdated{margin:8px 12px 0;padding:8px 10px;border-radius:8px;background:var(--_surface);font-size:12px;}.mushi-header{display:flex;align-items:center;gap:8px;min-height:56px;padding:6px 6px 6px 16px;border-bottom:1px solid var(--_border);}.mushi-title{flex:1;min-width:0;margin:0;font-size:16px;font-weight:600;line-height:1.25;overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow-wrap:anywhere;}.mushi-title:focus{outline:none;}.mushi-header-host-icon{width:20px;height:20px;margin-right:8px;border-radius:4px;object-fit:contain;}.mushi-header .mushi-icon-btn:first-child{margin-left:-10px;}.mushi-header .mushi-icon-btn:last-child{margin-right:-4px;}.mushi-beta-receipt{display:flex;flex-direction:column;gap:2px;align-items:center;}.mushi-icon-btn{display:inline-flex;align-items:center;justify-content:center;flex:none;min-width:44px;min-height:44px;border:0;border-radius:10px;background:none;color:var(--_muted);font:inherit;font-size:17px;cursor:pointer;}.mushi-icon-btn:hover{background:var(--_surface);color:var(--_fg);}.mushi-pill-btn{display:inline-flex;align-items:center;gap:6px;flex:none;min-height:44px;padding:0 12px;border:1px solid var(--_border);border-radius:999px;background:none;color:var(--_fg);font:inherit;font-size:13px;white-space:nowrap;cursor:pointer;}.mushi-pill-btn:hover{background:var(--_surface);}.mushi-badge{padding:1px 7px;border-radius:999px;background:var(--_fg);color:var(--_bg);font-size:11px;font-weight:600;}.mushi-menu-wrap{position:relative;}.mushi-menu{position:absolute;right:0;top:calc(100% + 4px);z-index:2;display:flex;flex-direction:column;min-width:210px;padding:4px;background:var(--_bg);border:1px solid var(--_border);border-radius:10px;box-shadow:var(--_shadow);}.mushi-menu-item{min-height:44px;padding:0 12px;border:0;border-radius:8px;background:none;color:var(--_fg);font:inherit;text-align:left;cursor:pointer;}.mushi-menu-item:hover{background:var(--_surface);}.mushi-scroll{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;display:flex;flex-direction:column;gap:12px;padding:12px 16px 16px;scrollbar-width:thin;}.mushi-body{display:flex;flex-direction:column;gap:12px;min-width:0;}.mushi-footer{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px;padding:10px 12px 12px 16px;border-top:1px solid var(--_border);}.mushi-footer-hint{flex:1;min-width:0;font-size:12px;color:var(--_muted);}.mushi-brand-footer{padding:6px 12px 8px;text-align:center;font-size:11px;color:var(--_muted);}.mushi-brand-link{color:inherit;text-decoration:none;}.mushi-brand-link:hover{text-decoration:underline;}.mushi-textarea,.mushi-input{width:100%;border:1px solid var(--_border);border-radius:10px;background:var(--_bg);color:var(--_fg);font:inherit;}.mushi-textarea{display:block;min-height:88px;max-height:40vh;padding:12px;font-size:15px;line-height:1.45;resize:vertical;}.mushi-input{flex:1;min-width:0;min-height:44px;padding:10px 12px;resize:none;}.mushi-textarea:focus,.mushi-input:focus{outline:2px solid var(--_accent);outline-offset:1px;border-color:transparent;}.mushi-textarea::placeholder,.mushi-input::placeholder{color:var(--_muted);opacity:1;}.mushi-chips{display:flex;flex-wrap:wrap;gap:6px;}.mushi-chip-group{display:contents;}.mushi-chip{min-height:44px;padding:0 14px;border:1px solid var(--_border);border-radius:999px;background:none;color:var(--_fg);font:inherit;font-size:13px;cursor:pointer;}.mushi-chip:hover{background:var(--_surface);}.mushi-chip[aria-checked="true"]{background:var(--_fg);border-color:var(--_fg);color:var(--_bg);}.mushi-chip-more{border-style:dashed;color:var(--_muted);}.mushi-chip-sm{padding:0 12px;font-size:12px;}.mushi-attachments{display:flex;flex-wrap:wrap;align-items:flex-start;gap:8px;}.mushi-attach-btn{display:inline-flex;align-items:center;gap:6px;min-height:44px;padding:0 12px;border:1px solid var(--_border);border-radius:10px;background:var(--_surface);color:var(--_fg);font:inherit;font-size:13px;cursor:pointer;}.mushi-attach-btn:hover{border-color:var(--_muted);}.mushi-attach-btn.active{border-color:var(--_ok);}.mushi-attach-btn.error{border-color:var(--_err);color:var(--_err);}.mushi-attach-btn[disabled]{cursor:progress;opacity:.75;}.mushi-screenshot-preview{display:flex;align-items:flex-start;gap:10px;width:100%;margin:0;}.mushi-screenshot-preview.open{flex-direction:column;}.mushi-thumb{flex:none;padding:0;border:1px solid var(--_border);border-radius:8px;background:var(--_surface);line-height:0;overflow:hidden;cursor:zoom-in;}.mushi-thumb img{display:block;width:72px;height:54px;object-fit:cover;}.mushi-screenshot-preview.open .mushi-thumb{cursor:zoom-out;}.mushi-screenshot-preview.open .mushi-thumb img{width:100%;height:auto;max-height:40vh;object-fit:contain;}.mushi-screenshot-preview figcaption{display:flex;flex-direction:column;gap:2px;min-width:0;font-size:13px;}.mushi-screenshot-hint{font-size:12px;color:var(--_muted);}.mushi-attach-actions{display:flex;gap:14px;}.mushi-annotate-host{width:100%;}.mushi-annotate-host:empty{display:none;}.mushi-note{margin:0;font-size:12px;line-height:1.45;color:var(--_muted);}.mushi-error-inline,.mushi-warn{color:var(--_err);}.mushi-screenshot-review{color:var(--_fg);font-weight:600;}.mushi-empty{margin:0;padding:24px 8px;text-align:center;color:var(--_muted);}.mushi-link-btn{min-height:24px;padding:0;border:0;background:none;color:inherit;font:inherit;text-decoration:underline;text-underline-offset:2px;cursor:pointer;}.mushi-btn,.mushi-submit{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:44px;padding:0 16px;border-radius:10px;font:inherit;font-size:14px;font-weight:500;cursor:pointer;}.mushi-btn{border:1px solid var(--_border);background:none;color:var(--_fg);}.mushi-btn:hover{background:var(--_surface);}.mushi-submit{min-width:88px;padding:0 20px;border:0;background:var(--_accent);color:var(--_accent-fg);font-weight:600;}.mushi-submit:hover{filter:brightness(1.08);}.mushi-submit[aria-disabled="true"]{opacity:.45;cursor:not-allowed;}.mushi-submit[aria-busy="true"],.mushi-btn[aria-busy="true"]{cursor:progress;opacity:.75;}.mushi-check{display:flex;align-items:center;gap:10px;min-height:44px;font-size:14px;cursor:pointer;}.mushi-check input{width:18px;height:18px;margin:0;accent-color:var(--_fg);}.mushi-inline-form{display:flex;gap:8px;width:100%;}.mushi-optins{display:flex;flex-direction:column;align-items:flex-start;gap:8px;width:100%;margin-top:4px;text-align:left;}.mushi-beta-strip{display:flex;flex-direction:column;gap:4px;padding:10px 12px;border-radius:10px;background:var(--_surface);font-size:13px;}.mushi-beta-strip p{margin:0;}.mushi-beta-tag{padding:0 6px;border-radius:4px;background:var(--_fg);color:var(--_bg);font-size:10px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;}.mushi-beta-perks,.mushi-changelog ul{margin:0;padding-left:18px;font-size:12px;}.mushi-changelog summary{font-size:12px;color:var(--_muted);cursor:pointer;}.mushi-spinner{display:inline-block;width:12px;height:12px;border:2px solid currentColor;border-top-color:transparent;border-radius:50%;vertical-align:-2px;animation:mushi-spin .8s linear infinite;}@keyframes mushi-spin{to{transform:rotate(360deg);}}.mushi-success{display:flex;flex-direction:column;align-items:center;gap:8px;padding:12px 0 4px;text-align:center;}.mushi-success-stamp{position:relative;display:inline-flex;align-items:center;justify-content:center;width:72px;height:72px;color:var(--_accent);}.mushi-success-stamp svg{position:absolute;inset:0;width:100%;height:100%;}.mushi-success-stamp circle{fill:none;stroke:currentColor;stroke-width:3;stroke-dasharray:280;stroke-dashoffset:280;transform:rotate(-90deg);transform-origin:center;animation:mushi-ring 600ms ease-out 60ms forwards;}.mushi-success-stamp-label{font-size:24px;font-weight:600;opacity:0;transform:rotate(-6deg);animation:mushi-press 300ms ease-out 450ms forwards;}@keyframes mushi-ring{to{stroke-dashoffset:0;}}@keyframes mushi-press{from{opacity:0;transform:rotate(-6deg) scale(1.3);}to{opacity:1;transform:rotate(-6deg) scale(1);}}.mushi-success-meta{font-size:12px;color:var(--_muted);}.mushi-success-receipt{display:flex;flex-direction:column;align-items:center;gap:6px;}.mushi-success-sla{margin:0;font-size:15px;}.mushi-success-receipt-id{min-height:24px;padding:2px 6px;border:1px dashed var(--_border);border-radius:6px;background:none;color:inherit;font-family:ui-monospace,monospace;font-size:12px;cursor:pointer;}.mushi-success-rewards{width:100%;}.mushi-success-pts-award{font-size:20px;font-weight:700;}.mushi-tier-bar-track{height:4px;margin:6px 0;border-radius:2px;background:var(--_surface);overflow:hidden;}.mushi-tier-bar-fill{height:100%;background:var(--_fg);transform-origin:left;transform:scaleX(var(--mushi-tier-pct,0));}.mushi-report-list,.mushi-thread,.mushi-assistant-log{display:flex;flex-direction:column;gap:8px;}.mushi-report-row{display:flex;flex-direction:column;gap:4px;width:100%;min-height:56px;padding:10px 12px;border:1px solid var(--_border);border-radius:10px;background:none;color:var(--_fg);font:inherit;text-align:left;}button.mushi-report-row{cursor:pointer;}button.mushi-report-row:hover{background:var(--_surface);}.mushi-report-row.unread{box-shadow:inset 3px 0 0 var(--_fg);}.mushi-row-top{display:flex;align-items:center;gap:8px;min-width:0;}.mushi-row-title{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px;}.mushi-row-when,.mushi-row-meta,.mushi-event time,.mushi-bubble time{font-size:12px;color:var(--_muted);}.mushi-row-when{flex:none;}.mushi-row-meta{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.mushi-row-news{font-size:13px;}.unread .mushi-row-title,.unread .mushi-row-news{font-weight:600;}.mushi-roadmap-row .mushi-btn{align-self:flex-start;}.mushi-pill{flex:none;display:inline-block;padding:2px 8px;border-radius:999px;font-size:12px;font-weight:500;line-height:1.5;white-space:nowrap;}.mushi-tone-neutral,.mushi-tone-muted{background:var(--_surface);color:var(--_muted);}.mushi-tone-info{background:${statusSent.bg};color:color-mix(in oklab,${statusSent.fg} 85%,var(--_fg));}.mushi-tone-attention{background:${statusReview.bg};color:color-mix(in oklab,${statusReview.fg} 85%,var(--_fg));}.mushi-tone-progress{background:${statusFixing.bg};color:color-mix(in oklab,${statusFixing.fg} 85%,var(--_fg));}.mushi-tone-success,.mushi-tone-success-muted{background:${statusFixed.bg};color:color-mix(in oklab,${statusFixed.fg} 85%,var(--_fg));}.mushi-skeleton{display:flex;flex-direction:column;gap:8px;}.mushi-skeleton span{height:14px;border-radius:6px;background:var(--_surface);animation:mushi-shimmer 1.2s ease-in-out infinite alternate;}.mushi-skeleton span:nth-child(2){width:82%;}.mushi-skeleton span:nth-child(3){width:58%;}@keyframes mushi-shimmer{to{opacity:.45;}}.mushi-thread-summary{display:flex;flex-direction:column;gap:6px;padding:12px;border-radius:10px;background:var(--_surface);}.mushi-card-status,.mushi-summary-text{margin:0;}.mushi-summary-text{font-size:14px;white-space:pre-wrap;word-break:break-word;}.mushi-card-thumb{align-self:flex-start;max-width:100%;max-height:160px;border-radius:8px;object-fit:contain;}.mushi-timeline{display:flex;flex-direction:column;gap:10px;margin:0;padding:0;list-style:none;}.mushi-event{display:flex;justify-content:space-between;gap:8px;padding-left:10px;border-left:2px solid var(--_border);font-size:12px;color:var(--_muted);}.mushi-event time,.mushi-bubble time{flex:none;}.mushi-bubble,.mushi-assistant-msg{display:flex;flex-direction:column;gap:2px;max-width:88%;padding:8px 12px;border-radius:12px;background:var(--_surface);white-space:pre-wrap;word-break:break-word;}.mushi-bubble.dev,.mushi-assistant-msg.dev{align-self:flex-start;border:1px solid var(--_border);border-bottom-left-radius:4px;background:none;}.mushi-bubble.mine,.mushi-assistant-msg.mine{align-self:flex-end;border-bottom-right-radius:4px;background:color-mix(in oklab,var(--_fg) 9%,var(--_bg));}.mushi-bubble strong{font-size:12px;}.mushi-bubble p{margin:0;font-size:14px;}.mushi-bubble-state{font-size:11px;color:var(--_muted);}.mushi-verify{display:flex;gap:8px;width:100%;}.mushi-verify .mushi-btn{flex:1;}.mushi-thread-composer{display:flex;align-items:flex-end;gap:8px;width:100%;}.mushi-reply{max-height:104px;overflow-y:auto;}.mushi-send{min-width:44px;padding:0;font-size:18px;}.mushi-thread-action-error{width:100%;margin:0;font-size:12px;}.mushi-assistant-greeting{margin:0;color:var(--_muted);}.mushi-lb{margin:0;padding:0;list-style:none;}.mushi-lb-row{display:flex;align-items:center;gap:10px;min-height:40px;border-bottom:1px solid var(--_border);font-size:13px;}.mushi-lb-row.me{font-weight:600;}.mushi-xapp-group{display:flex;flex-direction:column;gap:6px;}.mushi-xapp-app-name{display:flex;align-items:center;gap:8px;margin:0;font-size:12px;font-weight:600;color:var(--_muted);}.mushi-app-icon{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:22px;height:22px;border:1px solid var(--_border);border-radius:6px;background:var(--_surface);overflow:hidden;}.mushi-app-icon-img{display:block;width:16px;height:16px;object-fit:contain;}.mushi-app-icon-initials{font-size:9px;font-weight:700;line-height:1;color:var(--_muted);}.mushi-toast{position:fixed;display:flex;align-items:center;gap:6px;max-width:min(380px,calc(100vw - 32px));padding:6px 6px 6px 14px;background:var(--_bg);color:var(--_fg);border:1px solid var(--_border);border-radius:12px;box-shadow:var(--_shadow);font-size:14px;animation:mushi-open 180ms ease-out both;}.mushi-toast span{display:flex;flex-direction:column;flex:1;min-width:0;}.mushi-toast strong{font-weight:600;}.mushi-toast small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;color:var(--_muted);}.mushi-toast .mushi-btn{padding:0 12px;}.mushi-toast.bottom-right,.mushi-toast.bottom-left{bottom:calc(var(--mushi-bottom,${gutter}px) + ${panelLauncherGap}px);}.mushi-toast.top-right,.mushi-toast.top-left{top:calc(var(--mushi-top,${gutter}px) + ${panelLauncherGap}px);}.mushi-toast.bottom-right,.mushi-toast.top-right,.mushi-toast.banner-top,.mushi-toast.banner-bottom{right:var(--mushi-right,${gutter}px);}.mushi-toast.bottom-left,.mushi-toast.top-left{left:var(--mushi-left,${gutter}px);}.mushi-toast.banner-top{top:calc(var(--mushi-banner-offset,${bannerHeight}px) + 12px);}.mushi-toast.banner-bottom{bottom:calc(var(--mushi-banner-offset,${bannerHeight}px) + 12px);}.mushi-banner{position:fixed;left:0;right:0;box-sizing:border-box;min-height:${bannerHeight}px;display:flex;align-items:center;justify-content:center;gap:10px;padding:0 calc(16px + env(safe-area-inset-right,0px)) 0 calc(16px + env(safe-area-inset-left,0px));font-family:${fontMono};font-size:12px;letter-spacing:0.04em;white-space:nowrap;overflow:hidden;z-index:var(--mushi-banner-z,${zBanner});animation:mushi-banner-slide-in ${durPanel}ms ${easeStamp} both;}.mushi-banner.top{top:0;padding-top:env(safe-area-inset-top,0px);}.mushi-banner.bottom{bottom:0;padding-bottom:env(safe-area-inset-bottom,0px);}.mushi-banner.neon{background:${neonBannerBg};color:${neonBannerFg};border-bottom:1.5px solid ${neonBannerBorder};}.mushi-banner.neon.bottom{border-top:1.5px solid ${neonBannerBorder};border-bottom:none;}.mushi-banner.neon .mushi-banner-btn{background:rgba(0,0,0,0.14);color:${neonBannerFg};border:1px solid rgba(0,0,0,0.22);}.mushi-banner.neon .mushi-banner-btn:hover{background:rgba(0,0,0,0.22);}.mushi-banner.brand{background:${widgetAccent};color:${inverse};border-bottom:1.5px solid ${brandBannerBorder};}.mushi-banner.brand.bottom{border-top:1.5px solid ${brandBannerBorder};border-bottom:none;}.mushi-banner.brand .mushi-banner-btn{background:rgba(255,255,255,0.18);color:${inverse};border:1px solid rgba(255,255,255,0.32);}.mushi-banner.brand .mushi-banner-btn:hover{background:rgba(255,255,255,0.28);}.mushi-banner.subtle{background:${isDark ? "rgba(15,14,12,0.88)" : "rgba(248,244,237,0.92)"};backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);color:${ink};border-bottom:1px solid ${ruleStrong};}.mushi-banner.subtle.bottom{border-top:1px solid ${ruleStrong};border-bottom:none;}.mushi-banner.subtle .mushi-banner-btn{background:${isDark ? "rgba(242,235,221,0.10)" : "rgba(14,13,11,0.08)"};color:${ink};border:1px solid ${ruleStrong};}.mushi-banner.subtle .mushi-banner-btn:hover{background:${isDark ? "rgba(242,235,221,0.18)" : "rgba(14,13,11,0.14)"};}.mushi-banner-label{flex:1;text-align:center;overflow:hidden;text-overflow:ellipsis;}.mushi-banner--rich{justify-content:space-between;gap:12px;min-height:${bannerHeight}px;height:auto;padding:4px 12px 4px 16px;white-space:normal;}.mushi-banner-body{display:flex;align-items:center;gap:8px;flex:1;min-width:0;overflow:hidden;}.mushi-banner-pill{display:inline-flex;flex-shrink:0;align-items:center;padding:1px 6px;border-radius:3px;border:1px solid currentColor;font-size:10px;font-weight:700;letter-spacing:0.18em;text-transform:uppercase;opacity:0.92;}.mushi-banner.neon .mushi-banner-pill{border-color:rgba(10,26,10,0.45);background:rgba(10,26,10,0.12);}.mushi-banner.brand .mushi-banner-pill{border-color:rgba(255,255,255,0.45);background:rgba(255,255,255,0.14);}.mushi-banner.subtle .mushi-banner-pill{border-color:${ruleStrong};background:${isDark ? "rgba(242,235,221,0.08)" : "rgba(14,13,11,0.06)"};}.mushi-banner-message{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;font-weight:500;line-height:1.3;opacity:0.9;}.mushi-banner-actions{display:inline-flex;align-items:center;gap:0;flex-shrink:1;min-width:0;overflow-x:auto;scrollbar-width:none;font-size:11px;}.mushi-banner-actions::-webkit-scrollbar{display:none;}@media (max-width:${panelSheetBreakpoint}px){.mushi-banner-actions .mushi-banner-extra{display:none;}}.mushi-banner-link{display:inline-flex;align-items:center;padding:2px 8px;border:none;background:transparent;color:inherit;cursor:pointer;font:inherit;letter-spacing:inherit;text-decoration:none;opacity:0.88;transition:opacity ${durInstant}ms ${easeStamp};flex-shrink:0;}.mushi-banner-link:hover{opacity:1;}.mushi-banner-link:focus-visible{outline:2px solid ${widgetAccent};outline-offset:2px;border-radius:2px;}.mushi-banner-divider{opacity:0.28;padding:0 1px;user-select:none;flex-shrink:0;}.mushi-banner--rich .mushi-banner-dismiss{margin-left:4px;}.mushi-banner-btn{display:inline-flex;align-items:center;gap:4px;padding:3px 10px;border-radius:3px;cursor:pointer;font:inherit;letter-spacing:inherit;transition:opacity ${durInstant}ms ${easeStamp};flex-shrink:0;height:24px;line-height:1;}.mushi-banner-btn:focus-visible{outline:2px solid ${widgetAccent};outline-offset:2px;}.mushi-banner-dismiss{background:transparent !important;border:none !important;opacity:0.65;cursor:pointer;font-size:14px;line-height:1;padding:4px 8px;margin-left:auto;flex-shrink:0;color:inherit;border-radius:3px;transition:opacity ${durInstant}ms ${easeStamp};}.mushi-banner-dismiss:hover{opacity:1;background:rgba(0,0,0,0.12) !important;}.mushi-banner.neon .mushi-banner-dismiss:hover{background:rgba(0,0,0,0.18) !important;}.mushi-banner-my-reports{background:transparent;border:none;cursor:pointer;font-size:11px;font-family:${fontMono};opacity:0.75;color:inherit;padding:2px 6px;border-radius:3px;white-space:nowrap;flex-shrink:0;transition:opacity ${durInstant}ms ${easeStamp};margin-left:4px;}.mushi-banner-my-reports:hover{opacity:1;background:rgba(0,0,0,0.10);}.mushi-banner.neon .mushi-banner-my-reports:hover{background:rgba(0,0,0,0.18);}@keyframes mushi-banner-slide-in{from{transform:translateY(calc(-1 * 100%));opacity:0.5;}to{transform:translateY(0);opacity:1;}}.mushi-banner.bottom{animation-name:mushi-banner-slide-in-bottom;}@keyframes mushi-banner-slide-in-bottom{from{transform:translateY(100%);opacity:0.5;}to{transform:translateY(0);opacity:1;}}@media (prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:0.001ms !important;animation-iteration-count:1 !important;transition-duration:0.001ms !important;}.mushi-success-stamp circle{stroke-dashoffset:0;}.mushi-success-stamp-label{opacity:1;}}`;
|
|
1277
|
+
return ` :host{all:initial;color-scheme:${isDark ? "dark" : "light"};font-family:var(--mushi-font,inherit);font-size:var(--mushi-font-size,14px);line-height:1.45;--_bg:var(--mushi-bg,Canvas);--_fg:var(--mushi-fg,CanvasText);--_muted:var(--mushi-muted,color-mix(in oklab,var(--_fg) 64%,transparent));--_surface:var(--mushi-surface,color-mix(in oklab,var(--_bg) 94%,var(--_fg)));--_border:var(--mushi-border,color-mix(in oklab,var(--_fg) 16%,transparent));--_accent:var(--mushi-accent,${panelAccent || "var(--_fg)"});--_accent-fg:${lockFg && panelAccentFg ? panelAccentFg : `var(--mushi-accent-fg,${panelAccent ? panelAccentFg || "white" : "var(--_bg)"})`};--_ok:var(--mushi-success,${ok});--_err:var(--mushi-error,${danger});--_radius:var(--mushi-radius,12px);--_shadow:var(--mushi-shadow,0 12px 40px rgb(0 0 0 / .18));color:var(--_fg);-webkit-font-smoothing:antialiased;pointer-events:none;}.mushi-trigger,.mushi-banner,.mushi-panel,.mushi-toast{pointer-events:auto;}*,*::before,*::after{box-sizing:border-box;margin:0;padding:0;}button{font-family:inherit;}.mushi-trigger{position:fixed;width:${fabSize}px;height:${fabSize}px;min-width:44px;min-height:44px;border:1px solid var(--_border);border-radius:${controlRadius}px;background:var(--_bg);color:var(--_fg);cursor:pointer;display:flex;align-items:center;justify-content:center;font-size:22px;line-height:1;box-shadow:0 1px 0 var(--_border),0 6px 14px -8px rgba(${shadowInk},0.35),inset 0 -3px 0 var(--_accent);transition:transform ${durationFast}ms ${easeStamp},opacity ${durationFast}ms ${easeStamp};overflow:visible;isolation:isolate;}.mushi-trigger::after{content:'';position:absolute;top:6px;right:6px;width:6px;height:6px;border-radius:50%;background:var(--_accent);box-shadow:0 0 0 0 var(--_accent);animation:mushi-pulse 2.4s ${easeStamp} infinite;}.mushi-trigger:hover{transform:translateY(-2px) rotate(-1.5deg);box-shadow:0 1px 0 var(--_border),0 14px 24px -10px rgba(${shadowInk},0.45),0 0 20px -6px color-mix(in oklab,var(--_accent) 22%,transparent),inset 0 -3px 0 var(--_accent);}.mushi-trigger:active{transform:translateY(0) rotate(0);box-shadow:0 1px 0 var(--_border),0 2px 4px -2px rgba(${shadowInk},0.35),inset 0 -2px 0 var(--_accent);}.mushi-trigger:focus-visible{outline:2px solid var(--_accent);outline-offset:3px;}@keyframes mushi-trigger-pulse{0%{box-shadow:0 0 0 0 color-mix(in oklab,var(--_accent) 55%,transparent),0 1px 0 var(--_border),0 10px 24px -14px rgba(${shadowInk},0.45);}70%{box-shadow:0 0 0 16px color-mix(in oklab,var(--_accent) 0%,transparent),0 1px 0 var(--_border),0 10px 24px -14px rgba(${shadowInk},0.45);}100%{box-shadow:0 0 0 0 color-mix(in oklab,var(--_accent) 0%,transparent),0 1px 0 var(--_border),0 10px 24px -14px rgba(${shadowInk},0.45);}}.mushi-trigger-pulse{animation:mushi-trigger-pulse 800ms ${easeStamp} 3;}@media (prefers-reduced-motion:reduce){.mushi-trigger-pulse{animation:none;}}.mushi-trigger.bottom-right{bottom:var(--mushi-bottom,calc(${gutter}px + env(safe-area-inset-bottom,0px)));right:var(--mushi-right,calc(${gutter}px + env(safe-area-inset-right,0px)));}.mushi-trigger.bottom-left{bottom:var(--mushi-bottom,calc(${gutter}px + env(safe-area-inset-bottom,0px)));left:var(--mushi-left,calc(${gutter}px + env(safe-area-inset-left,0px)));}.mushi-trigger.top-right{top:var(--mushi-top,calc(${gutter}px + env(safe-area-inset-top,0px)));right:var(--mushi-right,calc(${gutter}px + env(safe-area-inset-right,0px)));}.mushi-trigger.top-left{top:var(--mushi-top,calc(${gutter}px + env(safe-area-inset-top,0px)));left:var(--mushi-left,calc(${gutter}px + env(safe-area-inset-left,0px)));}.mushi-trigger.edge-tab{width:${touchTarget}px;height:${edgeTabHeight}px;background:transparent;border:0;border-radius:0;box-shadow:none;font-size:14px;justify-content:flex-end;}.mushi-trigger.edge-tab::after{display:none;}.mushi-trigger.edge-tab:hover,.mushi-trigger.edge-tab:active,.mushi-trigger.edge-tab.dragging{transform:none;box-shadow:none;}.mushi-trigger-face{display:flex;align-items:center;justify-content:center;width:${edgeTabWidth}px;height:100%;background:var(--_bg);border:1px solid var(--_border);border-right:0;border-radius:${controlRadius}px 0 0 ${controlRadius}px;box-shadow:0 4px 12px -6px rgba(${shadowInk},0.4),inset -2px 0 0 var(--_accent);transition:width ${durationFast}ms ${easeStamp},transform ${durationFast}ms ${easeStamp},opacity ${durationFast}ms ${easeStamp};}.mushi-trigger.edge-tab.text{height:auto;min-height:${edgeTabHeight}px;}.mushi-trigger.edge-tab.text .mushi-trigger-face{height:auto;min-height:${edgeTabHeight}px;padding:10px 0;writing-mode:vertical-rl;font-size:12px;white-space:nowrap;}.mushi-trigger.edge-tab:hover .mushi-trigger-face,.mushi-trigger.edge-tab:focus-visible .mushi-trigger-face{width:${edgeTabWidth + 6}px;}.mushi-trigger.edge-tab:focus-visible{outline:none;}.mushi-trigger.edge-tab:focus-visible .mushi-trigger-face{outline:2px solid var(--_accent);outline-offset:2px;}.mushi-trigger.edge-tab.bottom-right,.mushi-trigger.edge-tab.top-right{right:calc(var(--mushi-safe-area,1) * env(safe-area-inset-right,0px));}.mushi-trigger.edge-tab.bottom-left,.mushi-trigger.edge-tab.top-left{left:calc(var(--mushi-safe-area,1) * env(safe-area-inset-left,0px));justify-content:flex-start;}.mushi-trigger.edge-tab.bottom-left .mushi-trigger-face,.mushi-trigger.edge-tab.top-left .mushi-trigger-face{border-right:1px solid var(--_border);border-left:0;border-radius:0 ${controlRadius}px ${controlRadius}px 0;box-shadow:0 4px 12px -6px rgba(${shadowInk},0.4),inset 2px 0 0 var(--_accent);}.mushi-trigger.tucked{opacity:0.3;}.mushi-trigger.edge-tab.tucked{opacity:1;}.mushi-trigger.edge-tab.tucked .mushi-trigger-face{opacity:0.55;transform:translateX(${edgeTabWidth - 6}px);}.mushi-trigger.edge-tab.bottom-left.tucked .mushi-trigger-face,.mushi-trigger.edge-tab.top-left.tucked .mushi-trigger-face{transform:translateX(-${edgeTabWidth - 6}px);}.mushi-trigger.tucked:focus-visible,.mushi-trigger.tucked:focus-visible .mushi-trigger-face{opacity:1;transform:none;}.mushi-trigger.shrunk{width:${bannerHeight}px;height:${bannerHeight}px;opacity:0.82;transform:scale(0.92);}.mushi-trigger{touch-action:none;translate:calc(var(--mushi-drag-active,0) * var(--mushi-drag-x,0px)) calc(var(--mushi-drag-active,0) * var(--mushi-drag-y,0px));}.mushi-trigger.dragging{cursor:grabbing !important;z-index:calc(var(--z,${MUSHI_Z.base}) + 2);transition:none !important;box-shadow:0 1px 0 var(--_border),0 20px 40px -12px rgba(${shadowInk},0.55),inset 0 -3px 0 var(--_accent);opacity:0.92;}@media (prefers-reduced-motion:reduce){.mushi-trigger,.mushi-trigger-face{transition:none !important;}.mushi-trigger::after{animation:none;}.mushi-trigger.edge-tab.tucked .mushi-trigger-face{transform:none !important;}}@keyframes mushi-pulse{0%{box-shadow:0 0 0 0 var(--_accent);opacity:1;}70%{box-shadow:0 0 0 8px transparent;opacity:0.5;}100%{box-shadow:0 0 0 0 transparent;opacity:1;}}.mushi-panel{position:fixed;width:calc(${panelWidth}px + 40px);max-width:calc(100vw - 32px);max-height:min(calc(${panelMaxHeight}px + 160px),calc(100dvh - 96px - var(--mushi-keyboard-inset,0px)));background:var(--_bg);color:var(--_fg);border:1px solid var(--_border);border-radius:var(--_radius);box-shadow:var(--_shadow);overflow:hidden;display:flex;flex-direction:column;transform-origin:var(--mushi-origin,bottom right);}.mushi-panel.open{animation:mushi-open 180ms cubic-bezier(.2,.8,.2,1) both;}.mushi-panel.closed{display:none;}.mushi-panel.mushi-swap .mushi-scroll,.mushi-panel.mushi-swap .mushi-footer{animation:mushi-fade 120ms ease-out both;}@keyframes mushi-open{from{opacity:0;transform:translateY(8px);}}@keyframes mushi-fade{from{opacity:0;}}.mushi-panel.bottom-right{bottom:var(--mushi-panel-bottom,calc(var(--mushi-bottom,${gutter}px) + ${panelLauncherGap}px));right:var(--mushi-right,calc(${gutter}px + env(safe-area-inset-right,0px)));--mushi-origin:bottom right;}.mushi-panel.bottom-left{bottom:var(--mushi-panel-bottom,calc(var(--mushi-bottom,${gutter}px) + ${panelLauncherGap}px));left:var(--mushi-left,calc(${gutter}px + env(safe-area-inset-left,0px)));--mushi-origin:bottom left;}.mushi-panel.top-right{top:var(--mushi-panel-top,calc(var(--mushi-top,${gutter}px) + ${panelLauncherGap}px));right:var(--mushi-right,calc(${gutter}px + env(safe-area-inset-right,0px)));--mushi-origin:top right;}.mushi-panel.top-left{top:var(--mushi-panel-top,calc(var(--mushi-top,${gutter}px) + ${panelLauncherGap}px));left:var(--mushi-left,calc(${gutter}px + env(safe-area-inset-left,0px)));--mushi-origin:top left;}.mushi-panel.keyboard-open{bottom:calc(var(--mushi-keyboard-inset,0px) + 8px) !important;}@media (max-width:${panelSheetBreakpoint}px){.mushi-panel{left:0 !important;right:0 !important;top:auto !important;width:100% !important;max-width:100% !important;max-height:calc(100dvh - 24px - var(--mushi-keyboard-inset,0px));border-radius:var(--_radius) var(--_radius) 0 0;bottom:var(--mushi-keyboard-inset,0px) !important;padding-bottom:env(safe-area-inset-bottom,0px);}}.mushi-panel :focus-visible{outline:2px solid var(--_accent);outline-offset:2px;}.mushi-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;}.mushi-notice:empty,.mushi-lead:empty,.mushi-footer:empty,.mushi-brand:empty{display:none;}.mushi-outdated{margin:8px 12px 0;padding:8px 10px;border-radius:8px;background:var(--_surface);font-size:12px;}.mushi-header{display:flex;align-items:center;gap:8px;min-height:56px;padding:6px 6px 6px 16px;border-bottom:1px solid var(--_border);}.mushi-title{flex:1;min-width:0;margin:0;font-size:16px;font-weight:600;line-height:1.25;overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow-wrap:anywhere;}.mushi-title:focus{outline:none;}.mushi-header-host-icon{width:20px;height:20px;margin-right:8px;border-radius:4px;object-fit:contain;}.mushi-header .mushi-icon-btn:first-child{margin-left:-10px;}.mushi-header .mushi-icon-btn:last-child{margin-right:-4px;}.mushi-beta-receipt{display:flex;flex-direction:column;gap:2px;align-items:center;}.mushi-icon-btn{display:inline-flex;align-items:center;justify-content:center;flex:none;min-width:44px;min-height:44px;border:0;border-radius:10px;background:none;color:var(--_muted);font:inherit;font-size:17px;cursor:pointer;}.mushi-icon-btn:hover{background:var(--_surface);color:var(--_fg);}.mushi-pill-btn{display:inline-flex;align-items:center;gap:6px;flex:none;min-height:44px;padding:0 12px;border:1px solid var(--_border);border-radius:999px;background:none;color:var(--_fg);font:inherit;font-size:13px;white-space:nowrap;cursor:pointer;}.mushi-pill-btn:hover{background:var(--_surface);}.mushi-badge{padding:1px 7px;border-radius:999px;background:var(--_fg);color:var(--_bg);font-size:11px;font-weight:600;}.mushi-menu-wrap{position:relative;}.mushi-menu{position:absolute;right:0;top:calc(100% + 4px);z-index:2;display:flex;flex-direction:column;min-width:210px;padding:4px;background:var(--_bg);border:1px solid var(--_border);border-radius:10px;box-shadow:var(--_shadow);}.mushi-menu-item{min-height:44px;padding:0 12px;border:0;border-radius:8px;background:none;color:var(--_fg);font:inherit;text-align:left;cursor:pointer;}.mushi-menu-item:hover{background:var(--_surface);}.mushi-scroll{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;display:flex;flex-direction:column;gap:12px;padding:12px 16px 16px;scrollbar-width:thin;}.mushi-body{display:flex;flex-direction:column;gap:12px;min-width:0;}.mushi-footer{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px;padding:10px 12px 12px 16px;border-top:1px solid var(--_border);}.mushi-footer-hint{flex:1;min-width:0;font-size:12px;color:var(--_muted);}.mushi-brand-footer{padding:6px 12px 8px;text-align:center;font-size:11px;color:var(--_muted);}.mushi-brand-link{color:inherit;text-decoration:none;}.mushi-brand-link:hover{text-decoration:underline;}.mushi-textarea,.mushi-input{width:100%;border:1px solid var(--_border);border-radius:10px;background:var(--_bg);color:var(--_fg);font:inherit;}.mushi-textarea{display:block;min-height:88px;max-height:40vh;padding:12px;font-size:15px;line-height:1.45;resize:vertical;}.mushi-input{flex:1;min-width:0;min-height:44px;padding:10px 12px;resize:none;}.mushi-textarea:focus,.mushi-input:focus{outline:2px solid var(--_accent);outline-offset:1px;border-color:transparent;}.mushi-textarea::placeholder,.mushi-input::placeholder{color:var(--_muted);opacity:1;}.mushi-chips{display:flex;flex-wrap:wrap;gap:6px;}.mushi-chip-group{display:contents;}.mushi-chip{min-height:44px;padding:0 14px;border:1px solid var(--_border);border-radius:999px;background:none;color:var(--_fg);font:inherit;font-size:13px;cursor:pointer;}.mushi-chip:hover{background:var(--_surface);}.mushi-chip[aria-checked="true"]{background:var(--_fg);border-color:var(--_fg);color:var(--_bg);}.mushi-chip-more{border-style:dashed;color:var(--_muted);}.mushi-chip-sm{padding:0 12px;font-size:12px;}.mushi-attachments{display:flex;flex-wrap:wrap;align-items:flex-start;gap:8px;}.mushi-attach-btn{display:inline-flex;align-items:center;gap:6px;min-height:44px;padding:0 12px;border:1px solid var(--_border);border-radius:10px;background:var(--_surface);color:var(--_fg);font:inherit;font-size:13px;cursor:pointer;}.mushi-attach-btn:hover{border-color:var(--_muted);}.mushi-attach-btn.active{border-color:var(--_ok);}.mushi-attach-btn.error{border-color:var(--_err);color:var(--_err);}.mushi-attach-btn[disabled]{cursor:progress;opacity:.75;}.mushi-screenshot-preview{display:flex;align-items:flex-start;gap:10px;width:100%;margin:0;}.mushi-screenshot-preview.open{flex-direction:column;}.mushi-thumb{flex:none;padding:0;border:1px solid var(--_border);border-radius:8px;background:var(--_surface);line-height:0;overflow:hidden;cursor:zoom-in;}.mushi-thumb img{display:block;width:72px;height:54px;object-fit:cover;}.mushi-screenshot-preview.open .mushi-thumb{cursor:zoom-out;}.mushi-screenshot-preview.open .mushi-thumb img{width:100%;height:auto;max-height:40vh;object-fit:contain;}.mushi-screenshot-preview figcaption{display:flex;flex-direction:column;gap:2px;min-width:0;font-size:13px;}.mushi-screenshot-hint{font-size:12px;color:var(--_muted);}.mushi-attach-actions{display:flex;gap:14px;}.mushi-annotate-host{width:100%;}.mushi-annotate-host:empty{display:none;}.mushi-note{margin:0;font-size:12px;line-height:1.45;color:var(--_muted);}.mushi-error-inline,.mushi-warn{color:var(--_err);}.mushi-screenshot-review{color:var(--_fg);font-weight:600;}.mushi-empty{margin:0;padding:24px 8px;text-align:center;color:var(--_muted);}.mushi-link-btn{min-height:24px;padding:0;border:0;background:none;color:inherit;font:inherit;text-decoration:underline;text-underline-offset:2px;cursor:pointer;}.mushi-btn,.mushi-submit{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:44px;padding:0 16px;border-radius:10px;font:inherit;font-size:14px;font-weight:500;cursor:pointer;}.mushi-btn{border:1px solid var(--_border);background:none;color:var(--_fg);}.mushi-btn:hover{background:var(--_surface);}.mushi-submit{min-width:88px;padding:0 20px;border:0;background:var(--_accent);color:var(--_accent-fg);font-weight:600;}.mushi-submit:hover{filter:brightness(1.08);}.mushi-submit[aria-disabled="true"]{opacity:.45;cursor:not-allowed;}.mushi-submit[aria-busy="true"],.mushi-btn[aria-busy="true"]{cursor:progress;opacity:.75;}.mushi-check{display:flex;align-items:center;gap:10px;min-height:44px;font-size:14px;cursor:pointer;}.mushi-check input{width:18px;height:18px;margin:0;accent-color:var(--_fg);}.mushi-inline-form{display:flex;gap:8px;width:100%;}.mushi-optins{display:flex;flex-direction:column;align-items:flex-start;gap:8px;width:100%;margin-top:4px;text-align:left;}.mushi-beta-strip{display:flex;flex-direction:column;gap:4px;padding:10px 12px;border-radius:10px;background:var(--_surface);font-size:13px;}.mushi-beta-strip p{margin:0;}.mushi-beta-tag{padding:0 6px;border-radius:4px;background:var(--_fg);color:var(--_bg);font-size:10px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;}.mushi-beta-perks,.mushi-changelog ul{margin:0;padding-left:18px;font-size:12px;}.mushi-changelog summary{font-size:12px;color:var(--_muted);cursor:pointer;}.mushi-spinner{display:inline-block;width:12px;height:12px;border:2px solid currentColor;border-top-color:transparent;border-radius:50%;vertical-align:-2px;animation:mushi-spin .8s linear infinite;}@keyframes mushi-spin{to{transform:rotate(360deg);}}.mushi-success{display:flex;flex-direction:column;align-items:center;gap:8px;padding:12px 0 4px;text-align:center;}.mushi-success-stamp{position:relative;display:inline-flex;align-items:center;justify-content:center;width:72px;height:72px;color:var(--_accent);}.mushi-success-stamp svg{position:absolute;inset:0;width:100%;height:100%;}.mushi-success-stamp circle{fill:none;stroke:currentColor;stroke-width:3;stroke-dasharray:280;stroke-dashoffset:280;transform:rotate(-90deg);transform-origin:center;animation:mushi-ring 600ms ease-out 60ms forwards;}.mushi-success-stamp-label{font-size:24px;font-weight:600;opacity:0;transform:rotate(-6deg);animation:mushi-press 300ms ease-out 450ms forwards;}@keyframes mushi-ring{to{stroke-dashoffset:0;}}@keyframes mushi-press{from{opacity:0;transform:rotate(-6deg) scale(1.3);}to{opacity:1;transform:rotate(-6deg) scale(1);}}.mushi-success-meta{font-size:12px;color:var(--_muted);}.mushi-success-receipt{display:flex;flex-direction:column;align-items:center;gap:6px;}.mushi-success-sla{margin:0;font-size:15px;}.mushi-success-receipt-id{min-height:24px;padding:2px 6px;border:1px dashed var(--_border);border-radius:6px;background:none;color:inherit;font-family:ui-monospace,monospace;font-size:12px;cursor:pointer;}.mushi-success-rewards{width:100%;}.mushi-success-pts-award{font-size:20px;font-weight:700;}.mushi-tier-bar-track{height:4px;margin:6px 0;border-radius:2px;background:var(--_surface);overflow:hidden;}.mushi-tier-bar-fill{height:100%;background:var(--_fg);transform-origin:left;transform:scaleX(var(--mushi-tier-pct,0));}.mushi-report-list,.mushi-thread,.mushi-assistant-log{display:flex;flex-direction:column;gap:8px;}.mushi-report-row{display:flex;flex-direction:column;gap:4px;width:100%;min-height:56px;padding:10px 12px;border:1px solid var(--_border);border-radius:10px;background:none;color:var(--_fg);font:inherit;text-align:left;}button.mushi-report-row{cursor:pointer;}button.mushi-report-row:hover{background:var(--_surface);}.mushi-report-row.unread{box-shadow:inset 3px 0 0 var(--_fg);}.mushi-row-top{display:flex;align-items:center;gap:8px;min-width:0;}.mushi-row-title{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px;}.mushi-row-when,.mushi-row-meta,.mushi-event time,.mushi-bubble time{font-size:12px;color:var(--_muted);}.mushi-row-when{flex:none;}.mushi-row-meta{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.mushi-row-news{font-size:13px;}.unread .mushi-row-title,.unread .mushi-row-news{font-weight:600;}.mushi-roadmap-row .mushi-btn{align-self:flex-start;}.mushi-pill{flex:none;display:inline-block;padding:2px 8px;border-radius:999px;font-size:12px;font-weight:500;line-height:1.5;white-space:nowrap;}.mushi-tone-neutral,.mushi-tone-muted{background:var(--_surface);color:var(--_muted);}.mushi-tone-info{background:${statusSent.bg};color:color-mix(in oklab,${statusSent.fg} 85%,var(--_fg));}.mushi-tone-attention{background:${statusReview.bg};color:color-mix(in oklab,${statusReview.fg} 85%,var(--_fg));}.mushi-tone-progress{background:${statusFixing.bg};color:color-mix(in oklab,${statusFixing.fg} 85%,var(--_fg));}.mushi-tone-success,.mushi-tone-success-muted{background:${statusFixed.bg};color:color-mix(in oklab,${statusFixed.fg} 85%,var(--_fg));}.mushi-skeleton{display:flex;flex-direction:column;gap:8px;}.mushi-skeleton span{height:14px;border-radius:6px;background:var(--_surface);animation:mushi-shimmer 1.2s ease-in-out infinite alternate;}.mushi-skeleton span:nth-child(2){width:82%;}.mushi-skeleton span:nth-child(3){width:58%;}@keyframes mushi-shimmer{to{opacity:.45;}}.mushi-thread-summary{display:flex;flex-direction:column;gap:6px;padding:12px;border-radius:10px;background:var(--_surface);}.mushi-card-status,.mushi-summary-text{margin:0;}.mushi-summary-text{font-size:14px;white-space:pre-wrap;word-break:break-word;}.mushi-card-thumb{align-self:flex-start;max-width:100%;max-height:160px;border-radius:8px;object-fit:contain;}.mushi-timeline{display:flex;flex-direction:column;gap:10px;margin:0;padding:0;list-style:none;}.mushi-event{display:flex;justify-content:space-between;gap:8px;padding-left:10px;border-left:2px solid var(--_border);font-size:12px;color:var(--_muted);}.mushi-event time,.mushi-bubble time{flex:none;}.mushi-bubble,.mushi-assistant-msg{display:flex;flex-direction:column;gap:2px;max-width:88%;padding:8px 12px;border-radius:12px;background:var(--_surface);white-space:pre-wrap;word-break:break-word;}.mushi-bubble.dev,.mushi-assistant-msg.dev{align-self:flex-start;border:1px solid var(--_border);border-bottom-left-radius:4px;background:none;}.mushi-bubble.mine,.mushi-assistant-msg.mine{align-self:flex-end;border-bottom-right-radius:4px;background:color-mix(in oklab,var(--_fg) 9%,var(--_bg));}.mushi-bubble strong{font-size:12px;}.mushi-bubble p{margin:0;font-size:14px;}.mushi-bubble-state{font-size:11px;color:var(--_muted);}.mushi-verify{display:flex;gap:8px;width:100%;}.mushi-verify .mushi-btn{flex:1;}.mushi-thread-composer{display:flex;align-items:flex-end;gap:8px;width:100%;}.mushi-reply{max-height:104px;overflow-y:auto;}.mushi-send{min-width:44px;padding:0;font-size:18px;}.mushi-thread-action-error{width:100%;margin:0;font-size:12px;}.mushi-assistant-greeting{margin:0;color:var(--_muted);}.mushi-lb{margin:0;padding:0;list-style:none;}.mushi-lb-row{display:flex;align-items:center;gap:10px;min-height:40px;border-bottom:1px solid var(--_border);font-size:13px;}.mushi-lb-row.me{font-weight:600;}.mushi-xapp-group{display:flex;flex-direction:column;gap:6px;}.mushi-xapp-app-name{display:flex;align-items:center;gap:8px;margin:0;font-size:12px;font-weight:600;color:var(--_muted);}.mushi-app-icon{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:22px;height:22px;border:1px solid var(--_border);border-radius:6px;background:var(--_surface);overflow:hidden;}.mushi-app-icon-img{display:block;width:16px;height:16px;object-fit:contain;}.mushi-app-icon-initials{font-size:9px;font-weight:700;line-height:1;color:var(--_muted);}.mushi-toast{position:fixed;display:flex;align-items:center;gap:6px;max-width:min(380px,calc(100vw - 32px));padding:6px 6px 6px 14px;background:var(--_bg);color:var(--_fg);border:1px solid var(--_border);border-radius:12px;box-shadow:var(--_shadow);font-size:14px;animation:mushi-open 180ms ease-out both;}.mushi-toast span{display:flex;flex-direction:column;flex:1;min-width:0;}.mushi-toast strong{font-weight:600;}.mushi-toast small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;color:var(--_muted);}.mushi-toast .mushi-btn{padding:0 12px;}.mushi-toast.bottom-right,.mushi-toast.bottom-left{bottom:calc(var(--mushi-bottom,${gutter}px) + ${panelLauncherGap}px);}.mushi-toast.top-right,.mushi-toast.top-left{top:calc(var(--mushi-top,${gutter}px) + ${panelLauncherGap}px);}.mushi-toast.bottom-right,.mushi-toast.top-right,.mushi-toast.banner-top,.mushi-toast.banner-bottom{right:var(--mushi-right,${gutter}px);}.mushi-toast.bottom-left,.mushi-toast.top-left{left:var(--mushi-left,${gutter}px);}.mushi-toast.banner-top{top:calc(var(--mushi-banner-offset,${bannerHeight}px) + 12px);}.mushi-toast.banner-bottom{bottom:calc(var(--mushi-banner-offset,${bannerHeight}px) + 12px);}.mushi-banner{position:fixed;left:0;right:0;box-sizing:border-box;min-height:${bannerHeight}px;display:flex;align-items:center;justify-content:center;gap:10px;padding:0 calc(16px + env(safe-area-inset-right,0px)) 0 calc(16px + env(safe-area-inset-left,0px));font-family:${fontMono};font-size:12px;letter-spacing:0.04em;white-space:nowrap;overflow:hidden;z-index:var(--mushi-banner-z,${zBanner});animation:mushi-banner-slide-in ${durPanel}ms ${easeStamp} both;}.mushi-banner.top{top:0;padding-top:env(safe-area-inset-top,0px);}.mushi-banner.bottom{bottom:0;padding-bottom:env(safe-area-inset-bottom,0px);}.mushi-banner.neon{background:${neonBannerBg};color:${neonBannerFg};border-bottom:1.5px solid ${neonBannerBorder};}.mushi-banner.neon.bottom{border-top:1.5px solid ${neonBannerBorder};border-bottom:none;}.mushi-banner.neon .mushi-banner-btn{background:rgba(0,0,0,0.14);color:${neonBannerFg};border:1px solid rgba(0,0,0,0.22);}.mushi-banner.neon .mushi-banner-btn:hover{background:rgba(0,0,0,0.22);}.mushi-banner.brand{background:${widgetAccent};color:${inverse};border-bottom:1.5px solid ${brandBannerBorder};}.mushi-banner.brand.bottom{border-top:1.5px solid ${brandBannerBorder};border-bottom:none;}.mushi-banner.brand .mushi-banner-btn{background:rgba(255,255,255,0.18);color:${inverse};border:1px solid rgba(255,255,255,0.32);}.mushi-banner.brand .mushi-banner-btn:hover{background:rgba(255,255,255,0.28);}.mushi-banner.subtle{background:${isDark ? "rgba(15,14,12,0.88)" : "rgba(248,244,237,0.92)"};backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);color:${ink};border-bottom:1px solid ${ruleStrong};}.mushi-banner.subtle.bottom{border-top:1px solid ${ruleStrong};border-bottom:none;}.mushi-banner.subtle .mushi-banner-btn{background:${isDark ? "rgba(242,235,221,0.10)" : "rgba(14,13,11,0.08)"};color:${ink};border:1px solid ${ruleStrong};}.mushi-banner.subtle .mushi-banner-btn:hover{background:${isDark ? "rgba(242,235,221,0.18)" : "rgba(14,13,11,0.14)"};}.mushi-banner-label{flex:1;text-align:center;overflow:hidden;text-overflow:ellipsis;}.mushi-banner--rich{justify-content:space-between;gap:12px;min-height:${bannerHeight}px;height:auto;padding:4px 12px 4px 16px;white-space:normal;}.mushi-banner-body{display:flex;align-items:center;gap:8px;flex:1;min-width:0;overflow:hidden;}.mushi-banner-pill{display:inline-flex;flex-shrink:0;align-items:center;padding:1px 6px;border-radius:3px;border:1px solid currentColor;font-size:10px;font-weight:700;letter-spacing:0.18em;text-transform:uppercase;opacity:0.92;}.mushi-banner.neon .mushi-banner-pill{border-color:rgba(10,26,10,0.45);background:rgba(10,26,10,0.12);}.mushi-banner.brand .mushi-banner-pill{border-color:rgba(255,255,255,0.45);background:rgba(255,255,255,0.14);}.mushi-banner.subtle .mushi-banner-pill{border-color:${ruleStrong};background:${isDark ? "rgba(242,235,221,0.08)" : "rgba(14,13,11,0.06)"};}.mushi-banner-message{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;font-weight:500;line-height:1.3;opacity:0.9;}.mushi-banner-actions{display:inline-flex;align-items:center;gap:0;flex-shrink:1;min-width:0;overflow-x:auto;scrollbar-width:none;font-size:11px;}.mushi-banner-actions::-webkit-scrollbar{display:none;}@media (max-width:${panelSheetBreakpoint}px){.mushi-banner-actions .mushi-banner-extra{display:none;}}.mushi-banner-link{display:inline-flex;align-items:center;padding:2px 8px;border:none;background:transparent;color:inherit;cursor:pointer;font:inherit;letter-spacing:inherit;text-decoration:none;opacity:0.88;transition:opacity ${durInstant}ms ${easeStamp};flex-shrink:0;}.mushi-banner-link:hover{opacity:1;}.mushi-banner-link:focus-visible{outline:2px solid ${widgetAccent};outline-offset:2px;border-radius:2px;}.mushi-banner-divider{opacity:0.28;padding:0 1px;user-select:none;flex-shrink:0;}.mushi-banner--rich .mushi-banner-dismiss{margin-left:4px;}.mushi-banner-btn{display:inline-flex;align-items:center;gap:4px;padding:3px 10px;border-radius:3px;cursor:pointer;font:inherit;letter-spacing:inherit;transition:opacity ${durInstant}ms ${easeStamp};flex-shrink:0;height:24px;line-height:1;}.mushi-banner-btn:focus-visible{outline:2px solid ${widgetAccent};outline-offset:2px;}.mushi-banner-dismiss{background:transparent !important;border:none !important;opacity:0.65;cursor:pointer;font-size:14px;line-height:1;padding:4px 8px;margin-left:auto;flex-shrink:0;color:inherit;border-radius:3px;transition:opacity ${durInstant}ms ${easeStamp};}.mushi-banner-dismiss:hover{opacity:1;background:rgba(0,0,0,0.12) !important;}.mushi-banner.neon .mushi-banner-dismiss:hover{background:rgba(0,0,0,0.18) !important;}.mushi-banner-my-reports{background:transparent;border:none;cursor:pointer;font-size:11px;font-family:${fontMono};opacity:0.75;color:inherit;padding:2px 6px;border-radius:3px;white-space:nowrap;flex-shrink:0;transition:opacity ${durInstant}ms ${easeStamp};margin-left:4px;}.mushi-banner-my-reports:hover{opacity:1;background:rgba(0,0,0,0.10);}.mushi-banner.neon .mushi-banner-my-reports:hover{background:rgba(0,0,0,0.18);}@keyframes mushi-banner-slide-in{from{transform:translateY(calc(-1 * 100%));opacity:0.5;}to{transform:translateY(0);opacity:1;}}.mushi-banner.bottom{animation-name:mushi-banner-slide-in-bottom;}@keyframes mushi-banner-slide-in-bottom{from{transform:translateY(100%);opacity:0.5;}to{transform:translateY(0);opacity:1;}}@media (prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:0.001ms !important;animation-iteration-count:1 !important;transition-duration:0.001ms !important;}.mushi-success-stamp circle{stroke-dashoffset:0;}.mushi-success-stamp-label{opacity:1;}}`;
|
|
1273
1278
|
}
|
|
1274
1279
|
var esc = escapeHtml;
|
|
1275
1280
|
var BUILTIN_CHIPS = ["bug", "slow", "visual", "confusing"];
|
|
@@ -1527,10 +1532,14 @@ var MushiWidget = class _MushiWidget {
|
|
|
1527
1532
|
rc;
|
|
1528
1533
|
lang = "en";
|
|
1529
1534
|
isOpen = false;
|
|
1535
|
+
/** Bumped on every open, so work started in one panel never finishes in the next. */
|
|
1536
|
+
openCount = 0;
|
|
1530
1537
|
step = "report";
|
|
1531
1538
|
// ─── Persistent DOM (built once; regions are patched, never rebuilt) ───
|
|
1532
1539
|
styleEl;
|
|
1533
1540
|
styleKey = "";
|
|
1541
|
+
/** Theme fixes the widget made, for `diagnose()`. */
|
|
1542
|
+
themeWarnings = [];
|
|
1534
1543
|
panel;
|
|
1535
1544
|
scroller;
|
|
1536
1545
|
regionEls = {};
|
|
@@ -1817,6 +1826,7 @@ var MushiWidget = class _MushiWidget {
|
|
|
1817
1826
|
if (this.isOpen) return;
|
|
1818
1827
|
this.rememberOpener();
|
|
1819
1828
|
this.isOpen = true;
|
|
1829
|
+
this.openCount++;
|
|
1820
1830
|
this.screenshotAttached = false;
|
|
1821
1831
|
this.screenshotCapturing = false;
|
|
1822
1832
|
this.screenshotError = false;
|
|
@@ -1874,6 +1884,7 @@ var MushiWidget = class _MushiWidget {
|
|
|
1874
1884
|
if (this.isOpen) return;
|
|
1875
1885
|
this.rememberOpener();
|
|
1876
1886
|
this.isOpen = true;
|
|
1887
|
+
this.openCount++;
|
|
1877
1888
|
this.callbacks.onOpen();
|
|
1878
1889
|
}
|
|
1879
1890
|
/** Send one assistant turn and re-render as the reply arrives. */
|
|
@@ -2219,7 +2230,7 @@ var MushiWidget = class _MushiWidget {
|
|
|
2219
2230
|
const widgetHostBounds = this.host.isConnected ? { width: this.host.offsetWidth, height: this.host.offsetHeight } : null;
|
|
2220
2231
|
const widgetSuppressed = this.isSuppressedByHost() || this.isRouteHidden() || !this.triggerVisible || this.launcherDismissed;
|
|
2221
2232
|
const bannerRendered = this.config.trigger === "banner" && !this.bannerDismissed && !this.isSuppressedByHost() && !this.isRouteHidden() && this.triggerVisible;
|
|
2222
|
-
return { widgetHostPointerSafe, widgetHostBounds, widgetSuppressed, bannerRendered };
|
|
2233
|
+
return { widgetHostPointerSafe, widgetHostBounds, widgetSuppressed, bannerRendered, warnings: [...this.themeWarnings] };
|
|
2223
2234
|
}
|
|
2224
2235
|
syncAttachedLaunchers() {
|
|
2225
2236
|
this.attachedLaunchers.forEach((cleanup) => cleanup());
|
|
@@ -2537,7 +2548,7 @@ var MushiWidget = class _MushiWidget {
|
|
|
2537
2548
|
}
|
|
2538
2549
|
isRouteHidden() {
|
|
2539
2550
|
if (!this.config.hideOnRoutes.length || typeof location === "undefined") return false;
|
|
2540
|
-
return this.config.hideOnRoutes.some((route) => location.pathname
|
|
2551
|
+
return this.config.hideOnRoutes.some((route) => routeMatches(location.pathname, route));
|
|
2541
2552
|
}
|
|
2542
2553
|
getTheme() {
|
|
2543
2554
|
const t = this.config.theme;
|
|
@@ -2564,37 +2575,47 @@ var MushiWidget = class _MushiWidget {
|
|
|
2564
2575
|
}
|
|
2565
2576
|
return "light";
|
|
2566
2577
|
}
|
|
2567
|
-
/**
|
|
2578
|
+
/** Any CSS colour → [r, g, b] (null if unparseable); oklch/lab read back via color-mix. */
|
|
2568
2579
|
probeRgb(color) {
|
|
2569
2580
|
const s = this.host.style;
|
|
2570
2581
|
const prev = s.color;
|
|
2571
|
-
|
|
2572
|
-
const
|
|
2582
|
+
let rgb = null;
|
|
2583
|
+
for (const c of [color, `color-mix(in srgb,${color},${color})`]) {
|
|
2584
|
+
s.color = "";
|
|
2585
|
+
s.color = c;
|
|
2586
|
+
const m = s.color && (this.host.isConnected ? getComputedStyle(this.host).color : s.color).match(/(rgba?\(|srgb )([\d.]+)[ ,]+([\d.]+)[ ,]+([\d.]+)/);
|
|
2587
|
+
if (m) {
|
|
2588
|
+
const k = m[1] === "srgb " ? 255 : 1;
|
|
2589
|
+
rgb = [+m[2] * k, +m[3] * k, +m[4] * k];
|
|
2590
|
+
break;
|
|
2591
|
+
}
|
|
2592
|
+
}
|
|
2573
2593
|
s.color = prev;
|
|
2574
|
-
return
|
|
2594
|
+
return rgb;
|
|
2595
|
+
}
|
|
2596
|
+
/** A host `--mushi-*` colour (inherited from :root too), or ''. */
|
|
2597
|
+
hostColorVar(name) {
|
|
2598
|
+
return safeCssColor(this.hostCssVar(name));
|
|
2575
2599
|
}
|
|
2576
2600
|
/**
|
|
2577
|
-
* Accent
|
|
2578
|
-
*
|
|
2579
|
-
*
|
|
2580
|
-
*
|
|
2581
|
-
* Send button could vanish into a page-coloured accent.
|
|
2601
|
+
* Accent (Plan 018 §1.4, first wins): host `--mushi-accent` → `widget.accent`
|
|
2602
|
+
* → <html> `accent-color` → theme-color meta (these two need 3:1 on the
|
|
2603
|
+
* panel) → ink. The accent is never changed; text on it under 3:1 becomes
|
|
2604
|
+
* black/white (`lockFg` beats `--mushi-accent-fg`) with a warning.
|
|
2582
2605
|
*/
|
|
2583
2606
|
resolveAccent(dark) {
|
|
2584
|
-
|
|
2607
|
+
this.themeWarnings = [];
|
|
2608
|
+
let accent = this.hostColorVar("--mushi-accent") || safeCssColor(this.config.accent ?? "");
|
|
2585
2609
|
const candidates = [];
|
|
2586
|
-
if (!
|
|
2610
|
+
if (!accent && typeof document !== "undefined") {
|
|
2587
2611
|
try {
|
|
2588
|
-
const
|
|
2589
|
-
candidates.push(rootStyle.getPropertyValue("--mushi-accent").trim());
|
|
2590
|
-
const ac = rootStyle.getPropertyValue("accent-color").trim();
|
|
2612
|
+
const ac = getComputedStyle(document.documentElement).getPropertyValue("accent-color").trim();
|
|
2591
2613
|
if (ac && ac !== "auto") candidates.push(ac);
|
|
2592
2614
|
} catch {
|
|
2593
2615
|
}
|
|
2594
2616
|
candidates.push(document.querySelector('meta[name="theme-color"]')?.getAttribute("content")?.trim() ?? "");
|
|
2595
2617
|
}
|
|
2596
2618
|
const bg = dark ? [18, 18, 18] : [255, 255, 255];
|
|
2597
|
-
let accent = config;
|
|
2598
2619
|
for (const c of candidates) {
|
|
2599
2620
|
if (accent) break;
|
|
2600
2621
|
const safe = safeCssColor(c);
|
|
@@ -2603,16 +2624,23 @@ var MushiWidget = class _MushiWidget {
|
|
|
2603
2624
|
}
|
|
2604
2625
|
if (!accent) return { accent: "", accentFg: "" };
|
|
2605
2626
|
const rgb = this.probeRgb(accent);
|
|
2606
|
-
|
|
2627
|
+
const wanted = this.hostColorVar("--mushi-accent-fg") || safeCssColor(this.config.accentText ?? "");
|
|
2628
|
+
const auto = rgb ? contrastingInk(rgb).ink : "";
|
|
2629
|
+
const fgRgb = rgb && wanted ? this.probeRgb(wanted) : null;
|
|
2630
|
+
const ratio = fgRgb ? contrastingInk(rgb, fgRgb).ratio : 3;
|
|
2631
|
+
if (ratio >= 3) return { accent, accentFg: wanted || auto };
|
|
2632
|
+
this.themeWarnings.push(`Accent text ${wanted} is ${ratio.toFixed(1)}:1 on ${accent} (under 3:1); using ${auto}.`);
|
|
2633
|
+
return { accent, accentFg: auto, lockFg: true };
|
|
2607
2634
|
}
|
|
2608
2635
|
/** Style + banner + trigger. Each rebuilds only when its inputs changed. */
|
|
2609
2636
|
syncChrome() {
|
|
2610
2637
|
const theme = this.getTheme();
|
|
2611
|
-
const { accent, accentFg } = this.resolveAccent(theme === "dark");
|
|
2612
|
-
const styleKey = `${theme}|${accent}|${accentFg}`;
|
|
2638
|
+
const { accent, accentFg, lockFg } = this.resolveAccent(theme === "dark");
|
|
2639
|
+
const styleKey = `${theme}|${accent}|${accentFg}|${lockFg}`;
|
|
2613
2640
|
if (styleKey !== this.styleKey) {
|
|
2614
2641
|
this.styleKey = styleKey;
|
|
2615
|
-
this.styleEl.textContent = getWidgetStyles(theme, accent, accentFg);
|
|
2642
|
+
this.styleEl.textContent = getWidgetStyles(theme, accent, accentFg, lockFg);
|
|
2643
|
+
this.themeWarnings.forEach((w) => this.callbacks.onWarning?.(w));
|
|
2616
2644
|
}
|
|
2617
2645
|
this.syncBanner();
|
|
2618
2646
|
this.syncTrigger();
|
|
@@ -3430,12 +3458,14 @@ var MushiWidget = class _MushiWidget {
|
|
|
3430
3458
|
if (this.callbacks.onBeforeSubmit) {
|
|
3431
3459
|
this.submitting = true;
|
|
3432
3460
|
this.render();
|
|
3461
|
+
const opened = this.openCount;
|
|
3433
3462
|
let review = false;
|
|
3434
3463
|
try {
|
|
3435
3464
|
review = await this.callbacks.onBeforeSubmit();
|
|
3436
3465
|
} catch {
|
|
3437
3466
|
review = false;
|
|
3438
3467
|
}
|
|
3468
|
+
if (opened !== this.openCount) return;
|
|
3439
3469
|
this.submitting = false;
|
|
3440
3470
|
if (!this.isOpen || this.step !== "report") return;
|
|
3441
3471
|
if (review && this.screenshotAttached && this.screenshotPreview) {
|
|
@@ -3990,8 +4020,11 @@ function mergeRuntimeCapture(host, runtime) {
|
|
|
3990
4020
|
}
|
|
3991
4021
|
return merged;
|
|
3992
4022
|
}
|
|
3993
|
-
|
|
4023
|
+
function hostSet(host, key) {
|
|
4024
|
+
return host.widget?.[key] !== void 0;
|
|
4025
|
+
}
|
|
3994
4026
|
var HOST_OWNED_TRIGGERS = ["manual", "attach"];
|
|
4027
|
+
var BANNER_FIELDS = ["variant", "position", "message", "label", "bugCta", "featureCta"];
|
|
3995
4028
|
function mergeRuntimeConfig(config, runtime, host = config) {
|
|
3996
4029
|
const nativeTrigger = runtime.native?.triggerMode;
|
|
3997
4030
|
const runtimeLauncher = runtime.widget?.launcher;
|
|
@@ -4003,33 +4036,24 @@ function mergeRuntimeConfig(config, runtime, host = config) {
|
|
|
4003
4036
|
const widgetTrigger = hostOwnsLauncher ? void 0 : runtimeTrigger ?? (nativeTrigger === "none" || nativeTrigger === "shake" ? "manual" : void 0);
|
|
4004
4037
|
const explicitHidden = runtimeLauncher === "hidden" || runtime.widget?.trigger === "hidden";
|
|
4005
4038
|
const safeWidgetTrigger = widgetTrigger === "hidden" && !explicitHidden && hostTrigger && hostTrigger !== "hidden" ? hostTrigger : widgetTrigger;
|
|
4006
|
-
const runtimeWidget = runtime.widget;
|
|
4007
|
-
const
|
|
4008
|
-
const
|
|
4009
|
-
const
|
|
4010
|
-
|
|
4011
|
-
|
|
4012
|
-
|
|
4013
|
-
const derivedBannerConfig = runtimeBannerVariant || runtimeBannerPosition || runtimeBannerMessage != null || runtimeBannerLabel != null || runtimeBannerBugCta != null || runtimeBannerFeatureCta != null ? {
|
|
4014
|
-
...config.widget?.bannerConfig ?? {},
|
|
4015
|
-
...runtimeBannerVariant ? { variant: runtimeBannerVariant } : {},
|
|
4016
|
-
...runtimeBannerPosition ? { position: runtimeBannerPosition } : {},
|
|
4017
|
-
...runtimeBannerMessage != null ? { message: runtimeBannerMessage } : {},
|
|
4018
|
-
...runtimeBannerLabel != null ? { label: runtimeBannerLabel === "" ? false : runtimeBannerLabel } : {},
|
|
4019
|
-
...runtimeBannerBugCta != null ? { bugCta: runtimeBannerBugCta ?? void 0 } : {},
|
|
4020
|
-
...runtimeBannerFeatureCta != null ? { featureCta: runtimeBannerFeatureCta } : {}
|
|
4021
|
-
} : void 0;
|
|
4022
|
-
const definedRuntimeWidget = {};
|
|
4023
|
-
if (runtime.widget) {
|
|
4024
|
-
for (const [key, value] of Object.entries(runtime.widget)) {
|
|
4025
|
-
if (key === "trigger" || key === "launcher") continue;
|
|
4026
|
-
if (value === void 0 || value === null) continue;
|
|
4027
|
-
if (HOST_WINS_WIDGET_KEYS.includes(key) && host.widget?.[key] !== void 0) {
|
|
4028
|
-
continue;
|
|
4029
|
-
}
|
|
4030
|
-
definedRuntimeWidget[key] = value;
|
|
4039
|
+
const runtimeWidget = runtime.widget ?? {};
|
|
4040
|
+
const hostBanner = host.widget?.bannerConfig ?? {};
|
|
4041
|
+
const bannerPatch = {};
|
|
4042
|
+
for (const field of BANNER_FIELDS) {
|
|
4043
|
+
const value = runtimeWidget["banner" + field[0].toUpperCase() + field.slice(1)];
|
|
4044
|
+
if (value != null && value !== "" || field === "label" && value === "") {
|
|
4045
|
+
if (hostBanner[field] === void 0) bannerPatch[field] = value === "" ? false : value;
|
|
4031
4046
|
}
|
|
4032
4047
|
}
|
|
4048
|
+
const derivedBannerConfig = Object.keys(bannerPatch).length ? { ...config.widget?.bannerConfig, ...bannerPatch } : void 0;
|
|
4049
|
+
const definedRuntimeWidget = {};
|
|
4050
|
+
for (const [key, value] of Object.entries(runtimeWidget)) {
|
|
4051
|
+
if (key === "trigger" || key === "launcher" || key === "accentText" || value == null || hostSet(host, key)) continue;
|
|
4052
|
+
definedRuntimeWidget[key] = value;
|
|
4053
|
+
}
|
|
4054
|
+
if (definedRuntimeWidget.accent !== void 0 && runtimeWidget.accentText != null) {
|
|
4055
|
+
definedRuntimeWidget.accentText = runtimeWidget.accentText;
|
|
4056
|
+
}
|
|
4033
4057
|
return {
|
|
4034
4058
|
...config,
|
|
4035
4059
|
widget: {
|
|
@@ -6166,7 +6190,7 @@ function createProactiveManager(config = {}) {
|
|
|
6166
6190
|
|
|
6167
6191
|
// src/version.ts
|
|
6168
6192
|
var MUSHI_SDK_PACKAGE = "@mushi-mushi/web";
|
|
6169
|
-
var MUSHI_SDK_VERSION = "1.
|
|
6193
|
+
var MUSHI_SDK_VERSION = "1.39.1" ;
|
|
6170
6194
|
function resolveReportAppVersion(config, environment) {
|
|
6171
6195
|
if (config.appVersion) return config.appVersion;
|
|
6172
6196
|
const vercelId = config.integrations?.vercel?.analyticsId;
|
|
@@ -6702,8 +6726,9 @@ function createInstance(config) {
|
|
|
6702
6726
|
}
|
|
6703
6727
|
if (!automaticScreenshotWanted()) return false;
|
|
6704
6728
|
log.debug("Capturing screenshot for review before send", { mode: activeConfig.capture?.screenshot });
|
|
6729
|
+
const session = panelSession;
|
|
6705
6730
|
const shot = await takeScreenshotWithoutChrome().catch(() => null);
|
|
6706
|
-
if (!shot) return false;
|
|
6731
|
+
if (!shot || session !== panelSession) return false;
|
|
6707
6732
|
pendingScreenshot = shot;
|
|
6708
6733
|
widget.setScreenshotAttached(true);
|
|
6709
6734
|
widget.setScreenshotPreview(shot);
|
|
@@ -6711,6 +6736,7 @@ function createInstance(config) {
|
|
|
6711
6736
|
}
|
|
6712
6737
|
const brandRefReady = sha256Hex(projectId).then((hex) => hex.slice(0, 12)).catch(() => null);
|
|
6713
6738
|
widget = new MushiWidget(bootstrapConfig.widget, {
|
|
6739
|
+
onWarning: (message) => log.warn(message),
|
|
6714
6740
|
onSubmit: async ({ category, userCategory, description, intent }) => {
|
|
6715
6741
|
log.info("Report submitted", { category, userCategory, intent });
|
|
6716
6742
|
if (pendingProactiveTrigger) proactiveManager?.recordSubmission();
|
|
@@ -6722,6 +6748,7 @@ function createInstance(config) {
|
|
|
6722
6748
|
onOpen: () => {
|
|
6723
6749
|
log.debug("Widget opened");
|
|
6724
6750
|
panelSession++;
|
|
6751
|
+
pendingScreenshot = null;
|
|
6725
6752
|
screenshotDeclined = false;
|
|
6726
6753
|
captureOnOpen();
|
|
6727
6754
|
replayCap?.start();
|
|
@@ -6762,14 +6789,17 @@ function createInstance(config) {
|
|
|
6762
6789
|
if (screenshotCaptureInFlight) return;
|
|
6763
6790
|
log.debug("Taking screenshot");
|
|
6764
6791
|
widget.setScreenshotCapturing(true);
|
|
6792
|
+
const session = panelSession;
|
|
6793
|
+
let shot = null;
|
|
6765
6794
|
try {
|
|
6766
|
-
|
|
6795
|
+
shot = await takeScreenshotWithoutChrome();
|
|
6767
6796
|
} catch (err) {
|
|
6768
6797
|
log.warn("Screenshot capture threw", {
|
|
6769
6798
|
error: err instanceof Error ? err.message : String(err)
|
|
6770
6799
|
});
|
|
6771
|
-
pendingScreenshot = null;
|
|
6772
6800
|
}
|
|
6801
|
+
if (session !== panelSession) return;
|
|
6802
|
+
pendingScreenshot = shot;
|
|
6773
6803
|
widget.setScreenshotAttached(pendingScreenshot !== null);
|
|
6774
6804
|
widget.setScreenshotPreview(pendingScreenshot);
|
|
6775
6805
|
if (pendingScreenshot === null) widget.setScreenshotError(true, screenshotProviderDenied ? "permission" : void 0);
|
|
@@ -6786,6 +6816,7 @@ function createInstance(config) {
|
|
|
6786
6816
|
widget.setScreenshotCapturing(true);
|
|
6787
6817
|
const host = document.getElementById("mushi-mushi-widget");
|
|
6788
6818
|
if (host) host.style.visibility = "hidden";
|
|
6819
|
+
const session = panelSession;
|
|
6789
6820
|
const p = activeConfig.privacy;
|
|
6790
6821
|
import('./chunks/display-capture-5ZJSTBUK.js').then(
|
|
6791
6822
|
(m) => m.grabMaskedTabFrame(stream, [
|
|
@@ -6801,6 +6832,7 @@ function createInstance(config) {
|
|
|
6801
6832
|
throw err;
|
|
6802
6833
|
}
|
|
6803
6834
|
).then((dataUrl) => {
|
|
6835
|
+
if (session !== panelSession) return;
|
|
6804
6836
|
pendingScreenshot = dataUrl;
|
|
6805
6837
|
widget.setScreenshotAttached(true);
|
|
6806
6838
|
widget.setScreenshotPreview(dataUrl);
|
|
@@ -6820,6 +6852,7 @@ function createInstance(config) {
|
|
|
6820
6852
|
onScreenshotAnnotateRequest: async (container) => {
|
|
6821
6853
|
if (!pendingScreenshot) return;
|
|
6822
6854
|
if (container.childElementCount > 0) return;
|
|
6855
|
+
const openSession = panelSession;
|
|
6823
6856
|
let session;
|
|
6824
6857
|
try {
|
|
6825
6858
|
const { createScreenshotAnnotation } = await import('./chunks/screenshot-annotation-5R6MVBEY.js');
|
|
@@ -6833,7 +6866,7 @@ function createInstance(config) {
|
|
|
6833
6866
|
const toolbar = document.createElement("div");
|
|
6834
6867
|
toolbar.className = "mushi-annotate-toolbar";
|
|
6835
6868
|
const finish = (commit) => {
|
|
6836
|
-
{
|
|
6869
|
+
if (openSession === panelSession) {
|
|
6837
6870
|
pendingScreenshot = session.getDataUrl();
|
|
6838
6871
|
widget.setScreenshotAttached(true);
|
|
6839
6872
|
widget.setScreenshotPreview(pendingScreenshot);
|
|
@@ -7922,7 +7955,8 @@ async function runDiagnostics(options) {
|
|
|
7922
7955
|
widgetHostPointerSafe: options.widgetDiagnostics?.widgetHostPointerSafe ?? false,
|
|
7923
7956
|
widgetHostBounds: options.widgetDiagnostics?.widgetHostBounds ?? null,
|
|
7924
7957
|
widgetSuppressed: options.widgetDiagnostics?.widgetSuppressed ?? false,
|
|
7925
|
-
bannerRendered: options.widgetDiagnostics?.bannerRendered ?? false
|
|
7958
|
+
bannerRendered: options.widgetDiagnostics?.bannerRendered ?? false,
|
|
7959
|
+
warnings: options.widgetDiagnostics?.warnings ?? []
|
|
7926
7960
|
};
|
|
7927
7961
|
}
|
|
7928
7962
|
async function diagnoseWithoutInstance() {
|