@mushi-mushi/web 1.32.2 → 1.33.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/chunks/{screenshot-annotation-IG7C5B6Z.js → screenshot-annotation-5R6MVBEY.js} +2 -2
- package/dist/chunks/screenshot-annotation-5R6MVBEY.js.map +1 -0
- package/dist/headless.cjs +49 -31
- package/dist/headless.cjs.map +1 -1
- package/dist/headless.js +49 -31
- package/dist/headless.js.map +1 -1
- package/dist/i18n/index.cjs +10 -5
- package/dist/i18n/index.cjs.map +1 -1
- package/dist/i18n/index.d.cts +2 -0
- package/dist/i18n/index.d.ts +2 -0
- package/dist/i18n/index.js +10 -5
- package/dist/i18n/index.js.map +1 -1
- package/dist/index.cjs +371 -104
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +52 -10
- package/dist/index.d.ts +54 -10
- package/dist/index.js +373 -106
- package/dist/index.js.map +1 -1
- package/dist/mushi.loader.global.js +12 -12
- package/dist/test-utils.cjs.map +1 -1
- package/dist/test-utils.js.map +1 -1
- package/package.json +3 -3
- package/dist/chunks/screenshot-annotation-IG7C5B6Z.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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, scrubUrl, resolveEnvConfig, diagnoseEnvConfig, validateConfig, expandPreset, createLogger, noopLogger, createApiClient, initSessionTracker, getReporterToken, trackPageView, createPreFilter, createOfflineQueue, createRateLimiter, createPiiScrubber, initEventTracker, getSessionId, createBreadcrumbBuffer, sha256Hex, trackEvent, flushEvents, getDeviceFingerprintHash, MAX_SCREENSHOT_DATA_URL_BYTES, captureEnvironment, newUuid, getEventAnonymousId, setEventConsent, parseIdentityToken, updateSessionIdentity, updateEventIdentity, normaliseThrown, shouldDropCapturedError, destroyEventTracker, destroySessionTracker, markPageUnloading, flushLastOutboundOnUnload, DEFAULT_API_ENDPOINT, MUSHI_INTERNAL_INIT_MARKER, MUSHI_DURATION, MUSHI_SPACING, MUSHI_RADIUS, isLikelyGenericFavicon, MUSHI_INTERNAL_HEADER, MUSHI_COLORS_LIGHT, 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_COPY, MUSHI_TIER_COLORS, readPageFaviconHref, scrubUrl, resolveEnvConfig, diagnoseEnvConfig, validateConfig, expandPreset, createLogger, noopLogger, createApiClient, initSessionTracker, getReporterToken, trackPageView, createPreFilter, createOfflineQueue, createRateLimiter, createPiiScrubber, initEventTracker, getSessionId, createBreadcrumbBuffer, sha256Hex, trackEvent, flushEvents, getDeviceFingerprintHash, MAX_SCREENSHOT_DATA_URL_BYTES, captureEnvironment, newUuid, getEventAnonymousId, setEventConsent, parseIdentityToken, updateSessionIdentity, updateEventIdentity, normaliseThrown, shouldDropCapturedError, destroyEventTracker, destroySessionTracker, markPageUnloading, flushLastOutboundOnUnload, DEFAULT_API_ENDPOINT, MUSHI_INTERNAL_INIT_MARKER, MUSHI_DURATION, MUSHI_SPACING, MUSHI_RADIUS, isLikelyGenericFavicon, MUSHI_INTERNAL_HEADER, MUSHI_COLORS_LIGHT, resolveProjectDomain, projectInitials, projectFaviconUrlCandidates } from '@mushi-mushi/core';
|
|
2
2
|
import { isPlausibleReporterEmail, reporterToastMessage, reporterCopy } from '@mushi-mushi/core/reporter-ui';
|
|
3
3
|
import { reporterChannels, subscribeBrowserPush } from '@mushi-mushi/core/reporter-channels';
|
|
4
4
|
|
|
@@ -37,6 +37,20 @@ function estimateDataUrlBytes(dataUrl) {
|
|
|
37
37
|
const b64 = dataUrl.slice(comma + 1);
|
|
38
38
|
return Math.ceil(b64.length * 3 / 4);
|
|
39
39
|
}
|
|
40
|
+
var LAUNCHER_DISMISSED_STORAGE_KEY = "mushi-launcher-hidden";
|
|
41
|
+
function readLauncherDismissed() {
|
|
42
|
+
try {
|
|
43
|
+
return typeof sessionStorage !== "undefined" && sessionStorage.getItem(LAUNCHER_DISMISSED_STORAGE_KEY) === "1";
|
|
44
|
+
} catch {
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
function writeLauncherDismissed() {
|
|
49
|
+
try {
|
|
50
|
+
if (typeof sessionStorage !== "undefined") sessionStorage.setItem(LAUNCHER_DISMISSED_STORAGE_KEY, "1");
|
|
51
|
+
} catch {
|
|
52
|
+
}
|
|
53
|
+
}
|
|
40
54
|
var ASSISTANT_SESSION_STORAGE_KEY = "mushi-assistant-session-v1";
|
|
41
55
|
function loadAssistantSession() {
|
|
42
56
|
try {
|
|
@@ -224,7 +238,8 @@ var en = {
|
|
|
224
238
|
submit: "Submit",
|
|
225
239
|
submitting: "Sending\u2026",
|
|
226
240
|
submitted: "Thank you! Your report has been submitted.",
|
|
227
|
-
error: "Could not send your report. Check your connection and try again."
|
|
241
|
+
error: "Could not send your report. Check your connection and try again.",
|
|
242
|
+
hideLauncher: "Hide the bug button for this visit"
|
|
228
243
|
},
|
|
229
244
|
step1: {
|
|
230
245
|
moreNav: {
|
|
@@ -400,7 +415,8 @@ var ja = {
|
|
|
400
415
|
submit: "\u9001\u4FE1",
|
|
401
416
|
submitting: "\u9001\u4FE1\u4E2D\u2026",
|
|
402
417
|
submitted: "\u3042\u308A\u304C\u3068\u3046\u3054\u3056\u3044\u307E\u3059\uFF01\u30EC\u30DD\u30FC\u30C8\u304C\u9001\u4FE1\u3055\u308C\u307E\u3057\u305F\u3002",
|
|
403
|
-
error: "\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F\u3002\u3082\u3046\u4E00\u5EA6\u304A\u8A66\u3057\u304F\u3060\u3055\u3044\u3002"
|
|
418
|
+
error: "\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F\u3002\u3082\u3046\u4E00\u5EA6\u304A\u8A66\u3057\u304F\u3060\u3055\u3044\u3002",
|
|
419
|
+
hideLauncher: "\u3053\u306E\u30A2\u30AF\u30BB\u30B9\u4E2D\u306F\u30D0\u30B0\u30DC\u30BF\u30F3\u3092\u96A0\u3059"
|
|
404
420
|
},
|
|
405
421
|
step1: {
|
|
406
422
|
moreNav: {
|
|
@@ -576,7 +592,8 @@ var th = {
|
|
|
576
592
|
submit: "\u0E2A\u0E48\u0E07",
|
|
577
593
|
submitting: "\u0E01\u0E33\u0E25\u0E31\u0E07\u0E2A\u0E48\u0E07\u2026",
|
|
578
594
|
submitted: "\u0E02\u0E2D\u0E1A\u0E04\u0E38\u0E13\u0E04\u0E23\u0E31\u0E1A/\u0E04\u0E48\u0E30! \u0E23\u0E32\u0E22\u0E07\u0E32\u0E19\u0E02\u0E2D\u0E07\u0E04\u0E38\u0E13\u0E16\u0E39\u0E01\u0E2A\u0E48\u0E07\u0E41\u0E25\u0E49\u0E27",
|
|
579
|
-
error: "\u0E40\u0E01\u0E34\u0E14\u0E02\u0E49\u0E2D\u0E1C\u0E34\u0E14\u0E1E\u0E25\u0E32\u0E14 \u0E01\u0E23\u0E38\u0E13\u0E32\u0E25\u0E2D\u0E07\u0E43\u0E2B\u0E21\u0E48\u0E2D\u0E35\u0E01\u0E04\u0E23\u0E31\u0E49\u0E07"
|
|
595
|
+
error: "\u0E40\u0E01\u0E34\u0E14\u0E02\u0E49\u0E2D\u0E1C\u0E34\u0E14\u0E1E\u0E25\u0E32\u0E14 \u0E01\u0E23\u0E38\u0E13\u0E32\u0E25\u0E2D\u0E07\u0E43\u0E2B\u0E21\u0E48\u0E2D\u0E35\u0E01\u0E04\u0E23\u0E31\u0E49\u0E07",
|
|
596
|
+
hideLauncher: "\u0E0B\u0E48\u0E2D\u0E19\u0E1B\u0E38\u0E48\u0E21\u0E41\u0E08\u0E49\u0E07\u0E1A\u0E31\u0E4A\u0E01\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E01\u0E32\u0E23\u0E40\u0E02\u0E49\u0E32\u0E0A\u0E21\u0E04\u0E23\u0E31\u0E49\u0E07\u0E19\u0E35\u0E49"
|
|
580
597
|
},
|
|
581
598
|
step1: {
|
|
582
599
|
moreNav: {
|
|
@@ -752,7 +769,8 @@ var es = {
|
|
|
752
769
|
submit: "Enviar",
|
|
753
770
|
submitting: "Enviando\u2026",
|
|
754
771
|
submitted: "\xA1Gracias! Tu reporte ha sido enviado.",
|
|
755
|
-
error: "No se pudo enviar tu reporte. Revisa tu conexi\xF3n e int\xE9ntalo de nuevo."
|
|
772
|
+
error: "No se pudo enviar tu reporte. Revisa tu conexi\xF3n e int\xE9ntalo de nuevo.",
|
|
773
|
+
hideLauncher: "Ocultar el bot\xF3n de errores durante esta visita"
|
|
756
774
|
},
|
|
757
775
|
step1: {
|
|
758
776
|
moreNav: {
|
|
@@ -928,7 +946,8 @@ var zh = {
|
|
|
928
946
|
submit: "\u63D0\u4EA4",
|
|
929
947
|
submitting: "\u63D0\u4EA4\u4E2D\u2026",
|
|
930
948
|
submitted: "\u8C22\u8C22\uFF01\u4F60\u7684\u53CD\u9988\u5DF2\u63D0\u4EA4\u3002",
|
|
931
|
-
error: "\u51FA\u9519\u4E86\uFF0C\u8BF7\u518D\u8BD5\u4E00\u6B21\u3002"
|
|
949
|
+
error: "\u51FA\u9519\u4E86\uFF0C\u8BF7\u518D\u8BD5\u4E00\u6B21\u3002",
|
|
950
|
+
hideLauncher: "\u672C\u6B21\u8BBF\u95EE\u671F\u95F4\u9690\u85CF\u53CD\u9988\u6309\u94AE"
|
|
932
951
|
},
|
|
933
952
|
step1: {
|
|
934
953
|
moreNav: {
|
|
@@ -1226,12 +1245,15 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
|
|
|
1226
1245
|
const { durationFast } = MUSHI_MOTION;
|
|
1227
1246
|
const { instant: durInstant, panel: durPanel } = MUSHI_DURATION;
|
|
1228
1247
|
const { bannerHeight, gutter, panelWidth, panelMaxHeight, panelSheetBreakpoint, edgeTabWidth } = MUSHI_GEOMETRY;
|
|
1248
|
+
const edgeTabHeight = 48;
|
|
1249
|
+
const touchTarget = 44;
|
|
1229
1250
|
const panelLauncherGap = fabSize + MUSHI_SPACING.comfy;
|
|
1230
1251
|
const controlRadius = MUSHI_RADIUS.control;
|
|
1231
|
-
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:${edgeTabWidth}px;height:88px;border-radius:${controlRadius}px 0 0 ${controlRadius}px;writing-mode:vertical-rl;text-orientation:upright;font-size:16px;box-shadow:0 1px 0 var(--_border),0 10px 24px -14px rgba(${shadowInk},0.45),inset -3px 0 0 var(--_accent);}.mushi-trigger.edge-tab.bottom-right,.mushi-trigger.edge-tab.top-right{right:var(--mushi-right,0);}.mushi-trigger.edge-tab.bottom-left,.mushi-trigger.edge-tab.top-left{left:var(--mushi-left,0);border-radius:0 ${controlRadius}px ${controlRadius}px 0;box-shadow:0 1px 0 var(--_border),0 10px 24px -14px rgba(${shadowInk},0.45),inset 3px 0 0 var(--_accent);}.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{transition: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-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;}}`;
|
|
1252
|
+
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-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;}}`;
|
|
1232
1253
|
}
|
|
1233
1254
|
var esc = escapeHtml;
|
|
1234
1255
|
var BUILTIN_CHIPS = ["bug", "slow", "visual", "confusing"];
|
|
1256
|
+
var HIDE_LAUNCHER_FALLBACK = "Hide the bug button for this visit";
|
|
1235
1257
|
function btn(action, label, cls = "", extra = "") {
|
|
1236
1258
|
return `<button type="button" class="${cls}" data-action="${action}"${extra}>${label}</button>`;
|
|
1237
1259
|
}
|
|
@@ -1323,16 +1345,26 @@ function intentOptions(ctx) {
|
|
|
1323
1345
|
const list = ctx.locale.step2.intents[id] ?? [];
|
|
1324
1346
|
return list.slice(0, -1).slice(0, 4);
|
|
1325
1347
|
}
|
|
1348
|
+
function reportTypeIds(config) {
|
|
1349
|
+
const primary = [...BUILTIN_CHIPS];
|
|
1350
|
+
if (config.featureRequestCard !== false) primary.push("idea");
|
|
1351
|
+
const seen = new Set(primary);
|
|
1352
|
+
const more = [];
|
|
1353
|
+
for (const { id } of config.categories ?? []) {
|
|
1354
|
+
if (seen.has(id)) continue;
|
|
1355
|
+
seen.add(id);
|
|
1356
|
+
more.push(id);
|
|
1357
|
+
}
|
|
1358
|
+
return { primary, more };
|
|
1359
|
+
}
|
|
1326
1360
|
function reportView(ctx) {
|
|
1327
1361
|
const t = ctx.locale;
|
|
1328
1362
|
const p = t.panel;
|
|
1329
1363
|
const s3 = t.step3;
|
|
1330
|
-
const
|
|
1331
|
-
|
|
1332
|
-
const custom = ctx.config.categories ?? [];
|
|
1333
|
-
if (ctx.showAllCategories) ids.push(...custom.map((c) => c.id));
|
|
1364
|
+
const { primary, more: extra } = reportTypeIds(ctx.config);
|
|
1365
|
+
const ids = ctx.showAllCategories ? [...primary, ...extra] : primary;
|
|
1334
1366
|
const chips = ids.map((id, i) => chip(ctx, id, i, ids.includes(ctx.chip ?? "") ? ctx.chip : null)).join("");
|
|
1335
|
-
const more =
|
|
1367
|
+
const more = extra.length && !ctx.showAllCategories ? btn("show-all-categories", esc(p.more), "mushi-chip mushi-chip-more") : "";
|
|
1336
1368
|
const intents = intentOptions(ctx);
|
|
1337
1369
|
const intentRow = intents.length ? `<div class="mushi-chips mushi-intents" role="radiogroup" aria-label="${esc(chipLabel(ctx, ctx.chip))}">${intents.map((it, i) => `<button type="button" class="mushi-chip mushi-chip-sm" role="radio" aria-checked="${ctx.intent === it}" tabindex="${ctx.intent === it || !ctx.intent && i === 0 ? "0" : "-1"}" data-action="intent" data-intent="${esc(it)}">${esc(it)}</button>`).join("")}</div>` : "";
|
|
1338
1370
|
const shotLabel = ctx.screenshotCapturing ? s3.screenshotCapturing : ctx.screenshotError ? s3.screenshotRetry : s3.screenshotButton;
|
|
@@ -1347,7 +1379,7 @@ function reportView(ctx) {
|
|
|
1347
1379
|
return {
|
|
1348
1380
|
header: renderHeader(ctx, ctx.config.expandedTitle || p.title),
|
|
1349
1381
|
lead: `<textarea class="mushi-textarea" data-role="description" rows="3" maxlength="${DESCRIPTION_MAX_LENGTH}" placeholder="${esc(feature ? s3.featurePlaceholder : s3.descriptionPlaceholder)}" aria-label="${esc(p.title)}" aria-describedby="mushi-hint"></textarea>`,
|
|
1350
|
-
body: `${ctx.config.betaMode?.enabled ? renderBetaStrip(ctx) : ""}<div class="mushi-chips"><div class="mushi-chip-group" role="radiogroup" aria-label="${esc(p.title)}">${chips}</div>${more}</div>${intentRow}<div class="mushi-attachments">${shot}${element}</div>${reason}<p class="mushi-note">\u{1F512} ${esc(p.privacy)}</p>${who ? `<p class="mushi-note">\u{1F464} ${esc(who)}</p>` : ""}${ctx.draftLength > DESCRIPTION_MAX_LENGTH - 400 ? `<p class="mushi-note" aria-live="polite">${ctx.draftLength}/${DESCRIPTION_MAX_LENGTH}</p>` : ""}`,
|
|
1382
|
+
body: `${ctx.config.betaMode?.enabled ? renderBetaStrip(ctx) : ""}<div class="mushi-chips"><div class="mushi-chip-group" role="radiogroup" aria-label="${esc(p.title)}">${chips}</div>${more}</div>${intentRow}<div class="mushi-attachments">${shot}${element}</div>${reason}<p class="mushi-note">\u{1F512} ${esc(p.privacy)}</p>${who ? `<p class="mushi-note">\u{1F464} ${esc(who)}</p>` : ""}${ctx.draftLength > DESCRIPTION_MAX_LENGTH - 400 ? `<p class="mushi-note" aria-live="polite">${ctx.draftLength}/${DESCRIPTION_MAX_LENGTH}</p>` : ""}${ctx.launcherDismissible ? `<p class="mushi-note">${btn("hide-launcher", esc(t.widget.hideLauncher ?? HIDE_LAUNCHER_FALLBACK), "mushi-link-btn")}</p>` : ""}`,
|
|
1351
1383
|
footer: `<span class="mushi-footer-hint" id="mushi-hint" data-role="hint">${hint}</span><button type="button" class="mushi-submit" data-action="submit" aria-disabled="${!ctx.canSend || ctx.submitting}"${ctx.submitting ? ' aria-busy="true"' : ""}>${esc(ctx.submitting ? t.widget.submitting : p.send)}</button>`
|
|
1352
1384
|
};
|
|
1353
1385
|
}
|
|
@@ -1582,6 +1614,25 @@ var MushiWidget = class _MushiWidget {
|
|
|
1582
1614
|
bannerResizeObserver = null;
|
|
1583
1615
|
/** Persisted FAB position when draggable is enabled. */
|
|
1584
1616
|
fabPos = null;
|
|
1617
|
+
/** Storage key `fabPos` was loaded for. */
|
|
1618
|
+
fabPosKey = "";
|
|
1619
|
+
draggableSet = false;
|
|
1620
|
+
/** px from the viewport bottom that clears fixed host bars. */
|
|
1621
|
+
barClearance = 0;
|
|
1622
|
+
clampedForClearance = 0;
|
|
1623
|
+
tuckCleanup = null;
|
|
1624
|
+
tuckTimer = null;
|
|
1625
|
+
resizeFrame = null;
|
|
1626
|
+
lateMeasureTimer = null;
|
|
1627
|
+
onViewportResize = () => {
|
|
1628
|
+
if (this.resizeFrame !== null) return;
|
|
1629
|
+
this.resizeFrame = requestAnimationFrame(() => {
|
|
1630
|
+
this.resizeFrame = null;
|
|
1631
|
+
this.barClearance = this.measureFixedBars();
|
|
1632
|
+
this.render();
|
|
1633
|
+
});
|
|
1634
|
+
};
|
|
1635
|
+
launcherDismissed = readLauncherDismissed();
|
|
1585
1636
|
/** Cleanup fn for visualViewport keyboard listener. */
|
|
1586
1637
|
vvCleanup = null;
|
|
1587
1638
|
/** Host-app user identity from `identify()` — shown as "Reporting as <name>". */
|
|
@@ -1625,6 +1676,10 @@ var MushiWidget = class _MushiWidget {
|
|
|
1625
1676
|
environments: config.environments ?? {},
|
|
1626
1677
|
smartHide: config.smartHide ?? false,
|
|
1627
1678
|
draggable: config.draggable ?? false,
|
|
1679
|
+
mobileTrigger: config.mobileTrigger ?? (placesLauncher(config) ? "auto" : "edge-tab"),
|
|
1680
|
+
avoidFixedBars: config.avoidFixedBars ?? true,
|
|
1681
|
+
tuckOnScroll: config.tuckOnScroll ?? true,
|
|
1682
|
+
dismissible: config.dismissible ?? true,
|
|
1628
1683
|
brandFooter: config.brandFooter ?? false,
|
|
1629
1684
|
outdatedBanner: config.outdatedBanner ?? "auto",
|
|
1630
1685
|
screenshotSensitiveHint: config.screenshotSensitiveHint ?? true,
|
|
@@ -1642,6 +1697,7 @@ var MushiWidget = class _MushiWidget {
|
|
|
1642
1697
|
accentText: config.accentText ?? ""
|
|
1643
1698
|
};
|
|
1644
1699
|
this.callbacks = callbacks;
|
|
1700
|
+
this.draggableSet = config.draggable !== void 0;
|
|
1645
1701
|
this.locale = getLocale(this.config.locale === "auto" ? void 0 : this.config.locale);
|
|
1646
1702
|
this.rc = this.resolveCopy();
|
|
1647
1703
|
const saved = loadAssistantSession();
|
|
@@ -1688,8 +1744,16 @@ var MushiWidget = class _MushiWidget {
|
|
|
1688
1744
|
window.addEventListener("pointercancel", this.onPointerRelease, true);
|
|
1689
1745
|
this.syncAttachedLaunchers();
|
|
1690
1746
|
this.syncSmartHide();
|
|
1747
|
+
this.syncScrollTuck();
|
|
1691
1748
|
this.bindColorSchemeListener();
|
|
1749
|
+
window.addEventListener("resize", this.onViewportResize);
|
|
1750
|
+
window.visualViewport?.addEventListener("resize", this.onViewportResize);
|
|
1692
1751
|
this.render();
|
|
1752
|
+
this.onViewportResize();
|
|
1753
|
+
this.lateMeasureTimer = setTimeout(() => {
|
|
1754
|
+
this.lateMeasureTimer = null;
|
|
1755
|
+
this.onViewportResize();
|
|
1756
|
+
}, 1200);
|
|
1693
1757
|
}
|
|
1694
1758
|
getIsMounted() {
|
|
1695
1759
|
return this.host.isConnected;
|
|
@@ -1710,9 +1774,11 @@ var MushiWidget = class _MushiWidget {
|
|
|
1710
1774
|
if (triggerBecameBanner || bannerConfigChanged) {
|
|
1711
1775
|
this.bannerDismissed = false;
|
|
1712
1776
|
}
|
|
1777
|
+
if (config.draggable !== void 0) this.draggableSet = true;
|
|
1713
1778
|
if (this.host.isConnected) this.syncHostChromeState();
|
|
1714
1779
|
this.syncAttachedLaunchers();
|
|
1715
1780
|
this.syncSmartHide();
|
|
1781
|
+
if (this.host.isConnected) this.syncScrollTuck();
|
|
1716
1782
|
this.render();
|
|
1717
1783
|
}
|
|
1718
1784
|
// ─── Custom category helpers ──────────────────────────────────────────────
|
|
@@ -1752,6 +1818,7 @@ var MushiWidget = class _MushiWidget {
|
|
|
1752
1818
|
this.chip = options?.featureRequest ? "idea" : custom ? cat : cat && cat !== "other" && BUILTIN.includes(cat) ? cat : null;
|
|
1753
1819
|
this.showAllCategories = Boolean(custom);
|
|
1754
1820
|
this.removeToast();
|
|
1821
|
+
this.barClearance = this.measureFixedBars();
|
|
1755
1822
|
this.render();
|
|
1756
1823
|
this.callbacks.onOpen();
|
|
1757
1824
|
}
|
|
@@ -2033,6 +2100,18 @@ var MushiWidget = class _MushiWidget {
|
|
|
2033
2100
|
this.unbindColorSchemeListener();
|
|
2034
2101
|
this.smartHideCleanup?.();
|
|
2035
2102
|
this.smartHideCleanup = null;
|
|
2103
|
+
this.tuckCleanup?.();
|
|
2104
|
+
this.tuckCleanup = null;
|
|
2105
|
+
window.removeEventListener("resize", this.onViewportResize);
|
|
2106
|
+
window.visualViewport?.removeEventListener("resize", this.onViewportResize);
|
|
2107
|
+
if (this.resizeFrame !== null) {
|
|
2108
|
+
cancelAnimationFrame(this.resizeFrame);
|
|
2109
|
+
this.resizeFrame = null;
|
|
2110
|
+
}
|
|
2111
|
+
if (this.lateMeasureTimer !== null) {
|
|
2112
|
+
clearTimeout(this.lateMeasureTimer);
|
|
2113
|
+
this.lateMeasureTimer = null;
|
|
2114
|
+
}
|
|
2036
2115
|
this.teardownViewportHandlers();
|
|
2037
2116
|
this.attachedLaunchers.forEach((cleanup) => cleanup());
|
|
2038
2117
|
this.attachedLaunchers = [];
|
|
@@ -2069,19 +2148,27 @@ var MushiWidget = class _MushiWidget {
|
|
|
2069
2148
|
this.onColorSchemeChange = null;
|
|
2070
2149
|
}
|
|
2071
2150
|
/* ── Host chrome contract ────────────────────────────────────────────────
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2151
|
+
The host element must never create an invisible full-screen touch blocker.
|
|
2152
|
+
We own these inline styles; only the shadow internals opt back into
|
|
2153
|
+
pointer events. Idempotent.
|
|
2154
|
+
|
|
2155
|
+
The host must not form a stacking context either. A `position: fixed`
|
|
2156
|
+
element always does, and so does any positioned element with a z-index;
|
|
2157
|
+
either one ranks every surface inside the shadow root at the host's
|
|
2158
|
+
level, so `bannerConfig.zIndex` could never put the banner under the
|
|
2159
|
+
host app's own sheets. The host is an absolute 0×0 box with
|
|
2160
|
+
`z-index: auto`, and the trigger, panel, toast and banner each carry
|
|
2161
|
+
their own z-index, which is then compared directly with the page's. */
|
|
2075
2162
|
syncHostChromeState() {
|
|
2076
2163
|
const s = this.host.style;
|
|
2077
|
-
s.setProperty("position", "
|
|
2164
|
+
s.setProperty("position", "absolute");
|
|
2078
2165
|
s.setProperty("top", "0");
|
|
2079
2166
|
s.setProperty("left", "0");
|
|
2080
2167
|
s.setProperty("width", "0");
|
|
2081
2168
|
s.setProperty("height", "0");
|
|
2082
2169
|
s.setProperty("overflow", "visible");
|
|
2083
2170
|
s.setProperty("pointer-events", "none");
|
|
2084
|
-
s.setProperty("z-index",
|
|
2171
|
+
s.setProperty("z-index", "auto");
|
|
2085
2172
|
s.setProperty("margin", "0");
|
|
2086
2173
|
s.setProperty("padding", "0");
|
|
2087
2174
|
s.setProperty("border", "none");
|
|
@@ -2101,7 +2188,7 @@ var MushiWidget = class _MushiWidget {
|
|
|
2101
2188
|
const s = this.host.style;
|
|
2102
2189
|
const widgetHostPointerSafe = s.pointerEvents === "none" && (s.width === "0" || s.width === "0px") && (s.height === "0" || s.height === "0px");
|
|
2103
2190
|
const widgetHostBounds = this.host.isConnected ? { width: this.host.offsetWidth, height: this.host.offsetHeight } : null;
|
|
2104
|
-
const widgetSuppressed = this.isSuppressedByHost() || this.isRouteHidden() || !this.triggerVisible;
|
|
2191
|
+
const widgetSuppressed = this.isSuppressedByHost() || this.isRouteHidden() || !this.triggerVisible || this.launcherDismissed;
|
|
2105
2192
|
const bannerRendered = this.config.trigger === "banner" && !this.bannerDismissed && !this.isSuppressedByHost() && !this.isRouteHidden() && this.triggerVisible;
|
|
2106
2193
|
return { widgetHostPointerSafe, widgetHostBounds, widgetSuppressed, bannerRendered };
|
|
2107
2194
|
}
|
|
@@ -2134,8 +2221,73 @@ var MushiWidget = class _MushiWidget {
|
|
|
2134
2221
|
window.addEventListener("scroll", onScroll, { passive: true });
|
|
2135
2222
|
this.smartHideCleanup = () => window.removeEventListener("scroll", onScroll);
|
|
2136
2223
|
}
|
|
2224
|
+
/** Tuck the launcher while anything scrolls (capture: inner scrollers count). A class toggle, not a rebuild, so focus and drag survive. */
|
|
2225
|
+
syncScrollTuck() {
|
|
2226
|
+
this.tuckCleanup?.();
|
|
2227
|
+
this.tuckCleanup = null;
|
|
2228
|
+
const smart = this.config.smartHide;
|
|
2229
|
+
const legacyScroll = smart === true || typeof smart === "object" && Boolean(smart.onScroll);
|
|
2230
|
+
if (!this.config.tuckOnScroll || legacyScroll || typeof document === "undefined") return;
|
|
2231
|
+
const IDLE_MS = 700;
|
|
2232
|
+
const onScroll = () => {
|
|
2233
|
+
const t = this.triggerEl;
|
|
2234
|
+
if (!t || this.isOpen || this.shadow.activeElement === t || t.classList.contains("dragging")) return;
|
|
2235
|
+
t.classList.add("tucked");
|
|
2236
|
+
if (this.tuckTimer !== null) clearTimeout(this.tuckTimer);
|
|
2237
|
+
this.tuckTimer = setTimeout(() => {
|
|
2238
|
+
this.tuckTimer = null;
|
|
2239
|
+
this.triggerEl?.classList.remove("tucked");
|
|
2240
|
+
const next = this.measureFixedBars();
|
|
2241
|
+
if (next !== this.barClearance) {
|
|
2242
|
+
this.barClearance = next;
|
|
2243
|
+
this.render();
|
|
2244
|
+
}
|
|
2245
|
+
}, IDLE_MS);
|
|
2246
|
+
};
|
|
2247
|
+
document.addEventListener("scroll", onScroll, { capture: true, passive: true });
|
|
2248
|
+
this.tuckCleanup = () => {
|
|
2249
|
+
document.removeEventListener("scroll", onScroll, { capture: true });
|
|
2250
|
+
if (this.tuckTimer !== null) clearTimeout(this.tuckTimer);
|
|
2251
|
+
this.tuckTimer = null;
|
|
2252
|
+
};
|
|
2253
|
+
}
|
|
2254
|
+
/**
|
|
2255
|
+
* px that clears a bar docked at the viewport bottom, + 8px: a short fixed/sticky
|
|
2256
|
+
* element, or a flow child of a fixed full-height shell. Scroller content never counts.
|
|
2257
|
+
*/
|
|
2258
|
+
measureFixedBars() {
|
|
2259
|
+
if (!this.config.avoidFixedBars || typeof document === "undefined" || typeof document.elementsFromPoint !== "function") return 0;
|
|
2260
|
+
const H = window.innerHeight;
|
|
2261
|
+
const W = window.innerWidth;
|
|
2262
|
+
if (!H || !W) return 0;
|
|
2263
|
+
const left = this.config.position.endsWith("left");
|
|
2264
|
+
const isBar = (r) => r.height > 0 && r.height <= H * 0.4 && r.top < H && r.bottom >= H - 4 && r.bottom <= H + 4;
|
|
2265
|
+
let barTop = H;
|
|
2266
|
+
for (const x of [left ? 24 : W - 24, W / 2]) {
|
|
2267
|
+
const hit = document.elementsFromPoint(x, H - 2).find((el) => el !== this.host && !this.host.contains(el));
|
|
2268
|
+
let flowBar = null;
|
|
2269
|
+
for (let el = hit ?? null; el && el !== document.body && el !== document.documentElement; el = el.parentElement) {
|
|
2270
|
+
const cs = getComputedStyle(el);
|
|
2271
|
+
const r = el.getBoundingClientRect();
|
|
2272
|
+
if (cs.position === "fixed" || cs.position === "sticky") {
|
|
2273
|
+
const bar = isBar(r) ? r : flowBar;
|
|
2274
|
+
if (bar) barTop = Math.min(barTop, bar.top);
|
|
2275
|
+
break;
|
|
2276
|
+
}
|
|
2277
|
+
if (/(auto|scroll)/.test(cs.overflowY)) flowBar = null;
|
|
2278
|
+
else if (isBar(r)) flowBar = r;
|
|
2279
|
+
}
|
|
2280
|
+
}
|
|
2281
|
+
return barTop < H ? Math.ceil(H - barTop + 8) : 0;
|
|
2282
|
+
}
|
|
2283
|
+
dismissLauncherForSession() {
|
|
2284
|
+
this.launcherDismissed = true;
|
|
2285
|
+
writeLauncherDismissed();
|
|
2286
|
+
this.close();
|
|
2287
|
+
}
|
|
2137
2288
|
shouldRenderTrigger() {
|
|
2138
2289
|
if (!this.triggerVisible) return false;
|
|
2290
|
+
if (this.launcherDismissed) return false;
|
|
2139
2291
|
if (this.triggerHiddenByScroll) return false;
|
|
2140
2292
|
if (this.config.trigger === "manual" || this.config.trigger === "hidden" || this.config.trigger === "attach" || this.config.trigger === "banner") {
|
|
2141
2293
|
return false;
|
|
@@ -2246,7 +2398,7 @@ var MushiWidget = class _MushiWidget {
|
|
|
2246
2398
|
if (richLayout) {
|
|
2247
2399
|
const body = document.createElement("div");
|
|
2248
2400
|
body.className = "mushi-banner-body";
|
|
2249
|
-
const labelText = bc.label === false ? null : bc.label ??
|
|
2401
|
+
const labelText = bc.label === false ? null : bc.label ?? MUSHI_COPY.bannerLabel;
|
|
2250
2402
|
if (labelText) {
|
|
2251
2403
|
const pill = document.createElement("span");
|
|
2252
2404
|
pill.className = "mushi-banner-pill";
|
|
@@ -2331,9 +2483,14 @@ var MushiWidget = class _MushiWidget {
|
|
|
2331
2483
|
this.trackBannerHeight(banner, position);
|
|
2332
2484
|
}
|
|
2333
2485
|
effectiveTrigger() {
|
|
2334
|
-
if (
|
|
2335
|
-
|
|
2336
|
-
|
|
2486
|
+
if (typeof window === "undefined") return this.config.trigger;
|
|
2487
|
+
if (this.config.smartHide) {
|
|
2488
|
+
const smart = this.config.smartHide === true ? { onMobile: "edge-tab" } : this.config.smartHide;
|
|
2489
|
+
if (window.matchMedia("(max-width: 768px)").matches && smart.onMobile === "edge-tab") {
|
|
2490
|
+
return "edge-tab";
|
|
2491
|
+
}
|
|
2492
|
+
}
|
|
2493
|
+
if (this.config.trigger === "auto" && this.config.mobileTrigger === "edge-tab" && typeof window.matchMedia === "function" && window.matchMedia("(max-width: 768px)")?.matches) {
|
|
2337
2494
|
return "edge-tab";
|
|
2338
2495
|
}
|
|
2339
2496
|
return this.config.trigger;
|
|
@@ -2436,20 +2593,34 @@ var MushiWidget = class _MushiWidget {
|
|
|
2436
2593
|
const pos = this.config.position;
|
|
2437
2594
|
const effective = show ? this.effectiveTrigger() : "";
|
|
2438
2595
|
const key = JSON.stringify([show, effective, pos, this.triggerShrunk, this.config.triggerText, this.config.zIndex, this.config.draggable, this.lang]);
|
|
2596
|
+
let rebuilt = false;
|
|
2439
2597
|
if (key !== this.triggerKey || show && !this.triggerEl?.isConnected) {
|
|
2440
2598
|
this.triggerKey = key;
|
|
2441
2599
|
this.triggerEl?.remove();
|
|
2442
2600
|
this.triggerEl = show ? this.buildTrigger(effective) : null;
|
|
2601
|
+
rebuilt = true;
|
|
2443
2602
|
}
|
|
2444
2603
|
if (this.triggerEl) {
|
|
2445
2604
|
this.triggerEl.setAttribute("aria-expanded", String(this.isOpen));
|
|
2446
2605
|
this.applyInsetVars(this.triggerEl);
|
|
2606
|
+
if ((rebuilt || this.barClearance !== this.clampedForClearance) && this.fabPos && this.dragOptions(this.triggerEl)) {
|
|
2607
|
+
this.restoreFabPos(this.triggerEl);
|
|
2608
|
+
}
|
|
2609
|
+
this.clampedForClearance = this.barClearance;
|
|
2447
2610
|
}
|
|
2448
2611
|
}
|
|
2449
2612
|
buildTrigger(effective) {
|
|
2613
|
+
const tab = effective === "edge-tab";
|
|
2450
2614
|
const trigger = document.createElement("button");
|
|
2451
|
-
trigger.className = `mushi-trigger ${this.config.position}${
|
|
2452
|
-
|
|
2615
|
+
trigger.className = `mushi-trigger ${this.config.position}${tab ? " edge-tab" : ""}${tab && isTextLabel(this.config.triggerText) ? " text" : ""}${this.triggerShrunk ? " shrunk" : ""}`;
|
|
2616
|
+
if (tab) {
|
|
2617
|
+
const face = document.createElement("span");
|
|
2618
|
+
face.className = "mushi-trigger-face";
|
|
2619
|
+
face.textContent = this.config.triggerText;
|
|
2620
|
+
trigger.appendChild(face);
|
|
2621
|
+
} else {
|
|
2622
|
+
trigger.textContent = this.config.triggerText;
|
|
2623
|
+
}
|
|
2453
2624
|
trigger.setAttribute("aria-label", this.locale.widget.trigger);
|
|
2454
2625
|
trigger.setAttribute("aria-haspopup", "dialog");
|
|
2455
2626
|
trigger.style.zIndex = String(this.config.zIndex);
|
|
@@ -2458,10 +2629,10 @@ var MushiWidget = class _MushiWidget {
|
|
|
2458
2629
|
else this.open();
|
|
2459
2630
|
});
|
|
2460
2631
|
trigger.addEventListener("keydown", (e) => {
|
|
2461
|
-
const
|
|
2462
|
-
if (!
|
|
2632
|
+
const drag = this.dragOptions(trigger);
|
|
2633
|
+
if (!drag) return;
|
|
2463
2634
|
const STEP = 8;
|
|
2464
|
-
const
|
|
2635
|
+
const { axis } = drag;
|
|
2465
2636
|
let dx = 0, dy = 0;
|
|
2466
2637
|
if (axis !== "y") {
|
|
2467
2638
|
if (e.key === "ArrowLeft") dx = -STEP;
|
|
@@ -2474,18 +2645,28 @@ var MushiWidget = class _MushiWidget {
|
|
|
2474
2645
|
if (dx !== 0 || dy !== 0) {
|
|
2475
2646
|
e.preventDefault();
|
|
2476
2647
|
const cur = this.fabPos ?? { x: 0, y: 0 };
|
|
2477
|
-
this.moveFab(trigger, cur.x + dx, cur.y + dy,
|
|
2648
|
+
this.moveFab(trigger, cur.x + dx, cur.y + dy, "end");
|
|
2478
2649
|
}
|
|
2479
2650
|
});
|
|
2480
|
-
if (this.
|
|
2651
|
+
if (this.dragOptions(trigger)) this.attachDragHandlers(trigger);
|
|
2481
2652
|
this.shadow.insertBefore(trigger, this.panel);
|
|
2482
|
-
if (this.fabPos && this.config.draggable) {
|
|
2483
|
-
const savedPos = this.fabPos;
|
|
2484
|
-
this.fabPos = { x: 0, y: 0 };
|
|
2485
|
-
this.moveFab(trigger, savedPos.x, savedPos.y, false);
|
|
2486
|
-
}
|
|
2487
2653
|
return trigger;
|
|
2488
2654
|
}
|
|
2655
|
+
restoreFabPos(trigger) {
|
|
2656
|
+
if (!this.fabPos) return;
|
|
2657
|
+
const savedPos = this.fabPos;
|
|
2658
|
+
this.fabPos = { x: 0, y: 0 };
|
|
2659
|
+
trigger.style.setProperty("--mushi-drag-active", "0");
|
|
2660
|
+
this.moveFab(trigger, savedPos.x, savedPos.y, "restore");
|
|
2661
|
+
}
|
|
2662
|
+
/** Drag options, or null when fixed. The tab drags along its edge unless `draggable: false`. */
|
|
2663
|
+
dragOptions(trigger) {
|
|
2664
|
+
const tab = trigger.classList.contains("edge-tab");
|
|
2665
|
+
const d = this.config.draggable;
|
|
2666
|
+
if (!d && (this.draggableSet || !tab)) return null;
|
|
2667
|
+
const o = typeof d === "object" ? d : {};
|
|
2668
|
+
return { axis: tab ? "y" : o.axis ?? "both", persist: o.persist ?? true, snap: !tab && (o.snapToEdge ?? true) };
|
|
2669
|
+
}
|
|
2489
2670
|
// ─── Rendering ─────────────────────────────────────────────────────
|
|
2490
2671
|
render() {
|
|
2491
2672
|
if (this.isOpen && this.pointerDownAt !== null && Date.now() - this.pointerDownAt < 2e3) {
|
|
@@ -2601,32 +2782,44 @@ var MushiWidget = class _MushiWidget {
|
|
|
2601
2782
|
}
|
|
2602
2783
|
}
|
|
2603
2784
|
}
|
|
2604
|
-
/**
|
|
2785
|
+
/**
|
|
2786
|
+
* Queries `avoidSelectors` and returns a top offset clearing the ones in the
|
|
2787
|
+
* top half of the viewport, or null. A bottom tab bar is ignored here: clearing
|
|
2788
|
+
* it from the top edge would push the widget off-screen.
|
|
2789
|
+
*/
|
|
2605
2790
|
computeAvoidTopPx(gap = 8) {
|
|
2606
2791
|
const sels = this.config.avoidSelectors;
|
|
2607
2792
|
if (!sels?.length) return null;
|
|
2793
|
+
const mid = window.innerHeight / 2;
|
|
2608
2794
|
let maxBottom = 0;
|
|
2609
2795
|
for (const sel of sels) {
|
|
2610
2796
|
try {
|
|
2611
2797
|
const el = document.querySelector(sel);
|
|
2612
2798
|
if (!el) continue;
|
|
2613
2799
|
const r = el.getBoundingClientRect();
|
|
2800
|
+
if ((r.top + r.bottom) / 2 >= mid) continue;
|
|
2614
2801
|
if (r.bottom > maxBottom && r.width > 0 && r.height > 0) maxBottom = r.bottom;
|
|
2615
2802
|
} catch {
|
|
2616
2803
|
}
|
|
2617
2804
|
}
|
|
2618
2805
|
return maxBottom > 0 ? Math.ceil(maxBottom) + gap : null;
|
|
2619
2806
|
}
|
|
2620
|
-
/**
|
|
2807
|
+
/**
|
|
2808
|
+
* Bottom offset so a bottom-anchored trigger clears avoided elements in the
|
|
2809
|
+
* bottom half of the viewport (tab bars, fixed CTAs). A top header is ignored
|
|
2810
|
+
* here: clearing it from the bottom edge would push the widget off-screen.
|
|
2811
|
+
*/
|
|
2621
2812
|
computeAvoidBottomPx(gap = 8) {
|
|
2622
2813
|
const sels = this.config.avoidSelectors;
|
|
2623
2814
|
if (!sels?.length) return null;
|
|
2815
|
+
const mid = window.innerHeight / 2;
|
|
2624
2816
|
let maxClearance = 0;
|
|
2625
2817
|
for (const sel of sels) {
|
|
2626
2818
|
try {
|
|
2627
2819
|
const el = document.querySelector(sel);
|
|
2628
2820
|
if (!el) continue;
|
|
2629
2821
|
const r = el.getBoundingClientRect();
|
|
2822
|
+
if ((r.top + r.bottom) / 2 <= mid) continue;
|
|
2630
2823
|
if (r.width > 0 && r.height > 0) {
|
|
2631
2824
|
const clearance = window.innerHeight - r.top + gap;
|
|
2632
2825
|
if (clearance > maxClearance) maxClearance = clearance;
|
|
@@ -2636,8 +2829,17 @@ var MushiWidget = class _MushiWidget {
|
|
|
2636
2829
|
}
|
|
2637
2830
|
return maxClearance > 0 ? Math.ceil(maxClearance) : null;
|
|
2638
2831
|
}
|
|
2832
|
+
hostCssVar(name) {
|
|
2833
|
+
if (!this.host.isConnected) return "";
|
|
2834
|
+
try {
|
|
2835
|
+
return getComputedStyle(this.host).getPropertyValue(name).trim();
|
|
2836
|
+
} catch {
|
|
2837
|
+
return "";
|
|
2838
|
+
}
|
|
2839
|
+
}
|
|
2639
2840
|
applyInsetVars(el) {
|
|
2640
2841
|
const { anchor } = this.config;
|
|
2842
|
+
for (const edge of ["top", "right", "bottom", "left"]) el.style.removeProperty(`--mushi-${edge}`);
|
|
2641
2843
|
if (anchor && Object.keys(anchor).length > 0) {
|
|
2642
2844
|
["top", "right", "bottom", "left"].forEach((edge) => {
|
|
2643
2845
|
const value = anchor[edge];
|
|
@@ -2665,23 +2867,30 @@ var MushiWidget = class _MushiWidget {
|
|
|
2665
2867
|
}
|
|
2666
2868
|
if (isBottomAnchored) {
|
|
2667
2869
|
const avoidBottomPx = this.computeAvoidBottomPx();
|
|
2668
|
-
if (avoidBottomPx !== null)
|
|
2870
|
+
if (avoidBottomPx !== null) {
|
|
2871
|
+
el.style.setProperty("--mushi-bottom", `${Math.max(avoidBottomPx, this.barClearance)}px`);
|
|
2872
|
+
} else if (this.barClearance > 0) {
|
|
2873
|
+
const base = el.style.getPropertyValue("--mushi-bottom").trim() || this.hostCssVar("--mushi-bottom") || `calc(${MUSHI_GEOMETRY.gutter}px + env(safe-area-inset-bottom, 0px))`;
|
|
2874
|
+
if (base !== "auto") el.style.setProperty("--mushi-bottom", `max(${base}, ${this.barClearance}px)`);
|
|
2875
|
+
}
|
|
2669
2876
|
}
|
|
2670
2877
|
}
|
|
2671
|
-
// ─── Draggable
|
|
2672
|
-
/**
|
|
2673
|
-
fabStorageKey() {
|
|
2878
|
+
// ─── Draggable launcher ─────────────────────────────────────────────────────
|
|
2879
|
+
/** Per-site (origin) key; the FAB and the tab measure from different anchors. */
|
|
2880
|
+
fabStorageKey(trigger) {
|
|
2674
2881
|
const id = this.config["projectId"] ?? "";
|
|
2675
|
-
|
|
2882
|
+
const shape = trigger.classList.contains("edge-tab") ? "mushi_tab_pos" : "mushi_fab_pos";
|
|
2883
|
+
return `${shape}${id ? `_${id}` : ""}`;
|
|
2676
2884
|
}
|
|
2677
2885
|
/**
|
|
2678
|
-
* Move the
|
|
2679
|
-
* inside the
|
|
2886
|
+
* Move the launcher to a translated offset (relative to its CSS anchor),
|
|
2887
|
+
* clamped inside the safe area and above host bars. `end` snaps and persists.
|
|
2680
2888
|
* The base position is derived by subtracting the applied drag offset.
|
|
2681
2889
|
*/
|
|
2682
|
-
moveFab(trigger, x, y,
|
|
2683
|
-
const
|
|
2684
|
-
|
|
2890
|
+
moveFab(trigger, x, y, phase) {
|
|
2891
|
+
const drag = this.dragOptions(trigger);
|
|
2892
|
+
if (!drag) return;
|
|
2893
|
+
const { axis } = drag;
|
|
2685
2894
|
const W = window.innerWidth;
|
|
2686
2895
|
const H = window.innerHeight;
|
|
2687
2896
|
const btnW = trigger.offsetWidth || 52;
|
|
@@ -2699,35 +2908,31 @@ var MushiWidget = class _MushiWidget {
|
|
|
2699
2908
|
const minX = safeL + margin - baseLeft;
|
|
2700
2909
|
const maxX = W - safeR - margin - btnW - baseLeft;
|
|
2701
2910
|
const minY = safeT + margin - baseTop;
|
|
2702
|
-
const maxY = H - safeB
|
|
2911
|
+
const maxY = H - Math.max(safeB + margin, this.barClearance) - btnH - baseTop;
|
|
2703
2912
|
const newY = axis === "x" ? 0 : Math.max(minY, Math.min(maxY, y));
|
|
2704
2913
|
let finalX = axis === "y" ? 0 : Math.max(minX, Math.min(maxX, x));
|
|
2705
|
-
if (snap) {
|
|
2706
|
-
|
|
2707
|
-
if (shouldSnap && axis !== "y") {
|
|
2708
|
-
finalX = rect.left + btnW / 2 < W / 2 ? safeL + margin - baseLeft : W - safeR - margin - btnW - baseLeft;
|
|
2709
|
-
}
|
|
2914
|
+
if (phase === "end" && drag.snap && axis !== "y") {
|
|
2915
|
+
finalX = rect.left + btnW / 2 < W / 2 ? safeL + margin - baseLeft : W - safeR - margin - btnW - baseLeft;
|
|
2710
2916
|
}
|
|
2711
2917
|
this.fabPos = { x: finalX, y: newY };
|
|
2712
2918
|
trigger.style.setProperty("--mushi-drag-x", `${finalX}px`);
|
|
2713
2919
|
trigger.style.setProperty("--mushi-drag-y", `${newY}px`);
|
|
2714
2920
|
trigger.style.setProperty("--mushi-drag-active", "1");
|
|
2715
|
-
|
|
2716
|
-
if (shouldPersist) {
|
|
2921
|
+
if (phase === "end" && drag.persist) {
|
|
2717
2922
|
try {
|
|
2718
|
-
localStorage.setItem(this.fabStorageKey(), JSON.stringify(this.fabPos));
|
|
2923
|
+
localStorage.setItem(this.fabStorageKey(trigger), JSON.stringify(this.fabPos));
|
|
2719
2924
|
} catch {
|
|
2720
2925
|
}
|
|
2721
2926
|
}
|
|
2722
2927
|
}
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
if (!
|
|
2928
|
+
loadFabPos(trigger) {
|
|
2929
|
+
const key = this.fabStorageKey(trigger);
|
|
2930
|
+
if (key === this.fabPosKey) return;
|
|
2931
|
+
this.fabPosKey = key;
|
|
2932
|
+
this.fabPos = null;
|
|
2933
|
+
if (!this.dragOptions(trigger)?.persist) return;
|
|
2729
2934
|
try {
|
|
2730
|
-
const raw = localStorage.getItem(
|
|
2935
|
+
const raw = localStorage.getItem(key);
|
|
2731
2936
|
if (raw) {
|
|
2732
2937
|
const parsed = JSON.parse(raw);
|
|
2733
2938
|
if (typeof parsed?.x === "number" && typeof parsed?.y === "number") this.fabPos = parsed;
|
|
@@ -2737,7 +2942,7 @@ var MushiWidget = class _MushiWidget {
|
|
|
2737
2942
|
}
|
|
2738
2943
|
/** Attach Pointer Events-based drag to the trigger element. */
|
|
2739
2944
|
attachDragHandlers(trigger) {
|
|
2740
|
-
|
|
2945
|
+
this.loadFabPos(trigger);
|
|
2741
2946
|
let startX = 0, startY = 0;
|
|
2742
2947
|
let originX = 0, originY = 0;
|
|
2743
2948
|
let dragging = false;
|
|
@@ -2745,7 +2950,7 @@ var MushiWidget = class _MushiWidget {
|
|
|
2745
2950
|
const DRAG_THRESHOLD = 6;
|
|
2746
2951
|
trigger.addEventListener("pointerdown", (e) => {
|
|
2747
2952
|
if (e.button !== 0 && e.pointerType !== "touch") return;
|
|
2748
|
-
trigger.setPointerCapture(e.pointerId);
|
|
2953
|
+
trigger.setPointerCapture?.(e.pointerId);
|
|
2749
2954
|
startX = e.clientX;
|
|
2750
2955
|
startY = e.clientY;
|
|
2751
2956
|
const cur = this.fabPos ?? { x: 0, y: 0 };
|
|
@@ -2760,11 +2965,12 @@ var MushiWidget = class _MushiWidget {
|
|
|
2760
2965
|
const dy = e.clientY - startY;
|
|
2761
2966
|
if (!moved && Math.hypot(dx, dy) > DRAG_THRESHOLD) {
|
|
2762
2967
|
moved = true;
|
|
2968
|
+
trigger.classList.remove("tucked");
|
|
2763
2969
|
trigger.classList.add("dragging");
|
|
2764
2970
|
}
|
|
2765
2971
|
if (moved) {
|
|
2766
2972
|
e.preventDefault();
|
|
2767
|
-
this.moveFab(trigger, originX + dx, originY + dy,
|
|
2973
|
+
this.moveFab(trigger, originX + dx, originY + dy, "move");
|
|
2768
2974
|
}
|
|
2769
2975
|
});
|
|
2770
2976
|
const onPointerUp = (e) => {
|
|
@@ -2772,7 +2978,7 @@ var MushiWidget = class _MushiWidget {
|
|
|
2772
2978
|
dragging = false;
|
|
2773
2979
|
trigger.classList.remove("dragging");
|
|
2774
2980
|
if (moved) {
|
|
2775
|
-
this.moveFab(trigger, originX + e.clientX - startX, originY + e.clientY - startY,
|
|
2981
|
+
this.moveFab(trigger, originX + e.clientX - startX, originY + e.clientY - startY, "end");
|
|
2776
2982
|
const suppressClick = (ev) => {
|
|
2777
2983
|
ev.stopImmediatePropagation();
|
|
2778
2984
|
trigger.removeEventListener("click", suppressClick, { capture: true });
|
|
@@ -2843,6 +3049,7 @@ var MushiWidget = class _MushiWidget {
|
|
|
2843
3049
|
intent: this.intent,
|
|
2844
3050
|
showAllCategories: this.showAllCategories,
|
|
2845
3051
|
draftLength: (this.drafts.description ?? "").length,
|
|
3052
|
+
launcherDismissible: this.config.dismissible && this.triggerEl !== null,
|
|
2846
3053
|
canSend: this.canSend(),
|
|
2847
3054
|
submitting: this.submitting,
|
|
2848
3055
|
screenshotCapturing: this.screenshotCapturing,
|
|
@@ -3015,6 +3222,9 @@ var MushiWidget = class _MushiWidget {
|
|
|
3015
3222
|
case "brand-footer":
|
|
3016
3223
|
this.callbacks.onBrandFooterClick?.();
|
|
3017
3224
|
return;
|
|
3225
|
+
case "hide-launcher":
|
|
3226
|
+
this.dismissLauncherForSession();
|
|
3227
|
+
return;
|
|
3018
3228
|
case "toggle-more-nav":
|
|
3019
3229
|
this.showMoreNav = !this.showMoreNav;
|
|
3020
3230
|
this.render();
|
|
@@ -3559,10 +3769,13 @@ var MushiWidget = class _MushiWidget {
|
|
|
3559
3769
|
void this.loadReporterReports();
|
|
3560
3770
|
}
|
|
3561
3771
|
/* ── Marketing / Playwright recorder (debug GIF capture) ─────────── */
|
|
3772
|
+
// Hooks for `window.__mushiRecorder` (marketing-recorder.ts, `debug: true`
|
|
3773
|
+
// only). Tagged @internal: not supported public API, may change any release.
|
|
3774
|
+
/** @internal */
|
|
3562
3775
|
getRecorderStep() {
|
|
3563
3776
|
return this.step;
|
|
3564
3777
|
}
|
|
3565
|
-
/** QA / Playwright: report-screen IA without piercing the shadow root. */
|
|
3778
|
+
/** @internal QA / Playwright: report-screen IA without piercing the shadow root. */
|
|
3566
3779
|
getRecorderCategoryStepIA() {
|
|
3567
3780
|
return {
|
|
3568
3781
|
sectionLabel: this.shadow.querySelector("#mushi-title")?.textContent?.trim() ?? "",
|
|
@@ -3570,22 +3783,28 @@ var MushiWidget = class _MushiWidget {
|
|
|
3570
3783
|
footerStepIndicators: 0
|
|
3571
3784
|
};
|
|
3572
3785
|
}
|
|
3786
|
+
/** @internal */
|
|
3573
3787
|
getRecorderTrigger() {
|
|
3574
3788
|
return this.triggerEl;
|
|
3575
3789
|
}
|
|
3790
|
+
/** @internal */
|
|
3576
3791
|
getRecorderCategoryButton(category) {
|
|
3577
3792
|
return this.shadow.querySelector(`[data-category="${category}"]`);
|
|
3578
3793
|
}
|
|
3794
|
+
/** @internal */
|
|
3579
3795
|
getRecorderIntentButton(label) {
|
|
3580
3796
|
return Array.from(this.shadow.querySelectorAll("[data-intent]")).find((el) => el.dataset.intent === label) ?? null;
|
|
3581
3797
|
}
|
|
3798
|
+
/** @internal */
|
|
3582
3799
|
getRecorderSubmitButton() {
|
|
3583
3800
|
return this.shadow.querySelector('[data-action="submit"]');
|
|
3584
3801
|
}
|
|
3802
|
+
/** @internal */
|
|
3585
3803
|
recorderClickTrigger() {
|
|
3586
3804
|
if (this.isOpen) this.close();
|
|
3587
3805
|
this.open();
|
|
3588
3806
|
}
|
|
3807
|
+
/** @internal */
|
|
3589
3808
|
recorderSelectCategory(category) {
|
|
3590
3809
|
if (!this.isOpen) this.open();
|
|
3591
3810
|
this.step = "report";
|
|
@@ -3593,21 +3812,34 @@ var MushiWidget = class _MushiWidget {
|
|
|
3593
3812
|
this.intent = null;
|
|
3594
3813
|
this.render();
|
|
3595
3814
|
}
|
|
3815
|
+
/** @internal */
|
|
3596
3816
|
recorderSelectIntent(label) {
|
|
3597
3817
|
if (!this.isOpen || this.step !== "report") return;
|
|
3598
3818
|
this.intent = label;
|
|
3599
3819
|
this.render();
|
|
3600
3820
|
}
|
|
3821
|
+
/** @internal */
|
|
3601
3822
|
recorderFocusDescription() {
|
|
3602
3823
|
this.shadow.querySelector('[data-role="description"]')?.focus();
|
|
3603
3824
|
}
|
|
3825
|
+
/** @internal */
|
|
3604
3826
|
recorderSubmit() {
|
|
3605
3827
|
this.submitReport();
|
|
3606
3828
|
}
|
|
3829
|
+
/** @internal */
|
|
3607
3830
|
recorderOpenMyReports() {
|
|
3608
3831
|
void this.loadReporterReports();
|
|
3609
3832
|
}
|
|
3610
3833
|
};
|
|
3834
|
+
function isTextLabel(text) {
|
|
3835
|
+
return Array.from(text.trim()).length > 2;
|
|
3836
|
+
}
|
|
3837
|
+
function placesLauncher(config) {
|
|
3838
|
+
const { anchor, inset } = config;
|
|
3839
|
+
return Boolean(
|
|
3840
|
+
config.draggable || isTextLabel(config.triggerText ?? "") || anchor?.left !== void 0 || anchor?.right !== void 0 || inset?.left !== void 0 || inset?.right !== void 0
|
|
3841
|
+
);
|
|
3842
|
+
}
|
|
3611
3843
|
function focusKey(el) {
|
|
3612
3844
|
const d = el.dataset;
|
|
3613
3845
|
if (d.role) return `[data-role="${d.role}"]`;
|
|
@@ -3767,10 +3999,8 @@ function exposeMarketingRecorder(widget) {
|
|
|
3767
3999
|
}
|
|
3768
4000
|
|
|
3769
4001
|
// src/history-patch.ts
|
|
3770
|
-
var
|
|
3771
|
-
var
|
|
3772
|
-
var nativePushState = null;
|
|
3773
|
-
var nativeReplaceState = null;
|
|
4002
|
+
var prevPushState = null;
|
|
4003
|
+
var prevReplaceState = null;
|
|
3774
4004
|
var pushWrapper = null;
|
|
3775
4005
|
var replaceWrapper = null;
|
|
3776
4006
|
var popListener = null;
|
|
@@ -3802,24 +4032,24 @@ function notifyPop() {
|
|
|
3802
4032
|
}
|
|
3803
4033
|
function ensurePatch() {
|
|
3804
4034
|
if (patched || typeof window === "undefined") return;
|
|
3805
|
-
|
|
3806
|
-
|
|
3807
|
-
|
|
3808
|
-
|
|
3809
|
-
|
|
3810
|
-
const
|
|
3811
|
-
|
|
3812
|
-
notifyPush();
|
|
4035
|
+
const prevPush = history.pushState;
|
|
4036
|
+
const prevReplace = history.replaceState;
|
|
4037
|
+
prevPushState = prevPush;
|
|
4038
|
+
prevReplaceState = prevReplace;
|
|
4039
|
+
const push = function historyPatchPushState(...args) {
|
|
4040
|
+
const ret = prevPush.apply(history, args);
|
|
4041
|
+
if (pushWrapper === push) notifyPush();
|
|
3813
4042
|
return ret;
|
|
3814
4043
|
};
|
|
3815
|
-
|
|
3816
|
-
const
|
|
3817
|
-
|
|
3818
|
-
notifyReplace();
|
|
4044
|
+
const replace = function historyPatchReplaceState(...args) {
|
|
4045
|
+
const ret = prevReplace.apply(history, args);
|
|
4046
|
+
if (replaceWrapper === replace) notifyReplace();
|
|
3819
4047
|
return ret;
|
|
3820
4048
|
};
|
|
3821
|
-
|
|
3822
|
-
|
|
4049
|
+
pushWrapper = push;
|
|
4050
|
+
replaceWrapper = replace;
|
|
4051
|
+
history.pushState = push;
|
|
4052
|
+
history.replaceState = replace;
|
|
3823
4053
|
popListener = () => notifyPop();
|
|
3824
4054
|
window.addEventListener("popstate", popListener);
|
|
3825
4055
|
patched = true;
|
|
@@ -3830,22 +4060,22 @@ function uninstallPatch() {
|
|
|
3830
4060
|
window.removeEventListener("popstate", popListener);
|
|
3831
4061
|
popListener = null;
|
|
3832
4062
|
}
|
|
3833
|
-
if (pushWrapper && history.pushState === pushWrapper &&
|
|
3834
|
-
history.pushState =
|
|
4063
|
+
if (pushWrapper && history.pushState === pushWrapper && prevPushState) {
|
|
4064
|
+
history.pushState = prevPushState;
|
|
3835
4065
|
}
|
|
3836
|
-
if (replaceWrapper && history.replaceState === replaceWrapper &&
|
|
3837
|
-
history.replaceState =
|
|
4066
|
+
if (replaceWrapper && history.replaceState === replaceWrapper && prevReplaceState) {
|
|
4067
|
+
history.replaceState = prevReplaceState;
|
|
3838
4068
|
}
|
|
3839
4069
|
pushWrapper = null;
|
|
3840
4070
|
replaceWrapper = null;
|
|
3841
|
-
|
|
3842
|
-
|
|
3843
|
-
nativePushState = null;
|
|
3844
|
-
nativeReplaceState = null;
|
|
4071
|
+
prevPushState = null;
|
|
4072
|
+
prevReplaceState = null;
|
|
3845
4073
|
patched = false;
|
|
3846
4074
|
}
|
|
3847
4075
|
function subscribeHistory(sub) {
|
|
3848
4076
|
ensurePatch();
|
|
4077
|
+
if (!patched) return () => {
|
|
4078
|
+
};
|
|
3849
4079
|
subscribers.add(sub);
|
|
3850
4080
|
return () => {
|
|
3851
4081
|
subscribers.delete(sub);
|
|
@@ -3875,6 +4105,7 @@ var apiClient = null;
|
|
|
3875
4105
|
var optedIn = false;
|
|
3876
4106
|
var tierCache = null;
|
|
3877
4107
|
var tierCacheTime = 0;
|
|
4108
|
+
var tierCacheUserId = null;
|
|
3878
4109
|
var TIER_CACHE_TTL = 5 * 60 * 1e3;
|
|
3879
4110
|
var rewardsApiBackoffUntil = 0;
|
|
3880
4111
|
var REWARDS_4XX_BACKOFF_MS = 15 * 60 * 1e3;
|
|
@@ -4004,7 +4235,7 @@ async function flush(ctx) {
|
|
|
4004
4235
|
}
|
|
4005
4236
|
async function getTier(userId) {
|
|
4006
4237
|
const now = Date.now();
|
|
4007
|
-
if (tierCache && now - tierCacheTime < TIER_CACHE_TTL) return tierCache;
|
|
4238
|
+
if (tierCache && tierCacheUserId === userId && now - tierCacheTime < TIER_CACHE_TTL) return tierCache;
|
|
4008
4239
|
return fetchAndCacheTier(userId);
|
|
4009
4240
|
}
|
|
4010
4241
|
async function fetchAndCacheTier(userId) {
|
|
@@ -4013,6 +4244,7 @@ async function fetchAndCacheTier(userId) {
|
|
|
4013
4244
|
if (res.ok && res.data) {
|
|
4014
4245
|
tierCache = res.data;
|
|
4015
4246
|
tierCacheTime = Date.now();
|
|
4247
|
+
tierCacheUserId = userId;
|
|
4016
4248
|
return tierCache;
|
|
4017
4249
|
}
|
|
4018
4250
|
noteRewardsApiFailure(res.error?.code);
|
|
@@ -4056,6 +4288,7 @@ function teardown() {
|
|
|
4056
4288
|
apiClient = null;
|
|
4057
4289
|
optedIn = false;
|
|
4058
4290
|
tierCache = null;
|
|
4291
|
+
tierCacheUserId = null;
|
|
4059
4292
|
rewardsApiBackoffUntil = 0;
|
|
4060
4293
|
}
|
|
4061
4294
|
var routeObserver = null;
|
|
@@ -4071,6 +4304,14 @@ function installActivityListeners(projectId) {
|
|
|
4071
4304
|
removeActivityListeners();
|
|
4072
4305
|
}
|
|
4073
4306
|
listenersInstalled = true;
|
|
4307
|
+
try {
|
|
4308
|
+
attachActivityListeners(projectId);
|
|
4309
|
+
} catch (err) {
|
|
4310
|
+
removeActivityListeners();
|
|
4311
|
+
throw err;
|
|
4312
|
+
}
|
|
4313
|
+
}
|
|
4314
|
+
function attachActivityListeners(projectId) {
|
|
4074
4315
|
const emitRoute = () => {
|
|
4075
4316
|
const route = location.pathname;
|
|
4076
4317
|
if (route === lastRoute) return;
|
|
@@ -4409,6 +4650,10 @@ function createNetworkCapture(options = {}) {
|
|
|
4409
4650
|
const _prevXhrState = xhrStateMap.get(this);
|
|
4410
4651
|
if (_prevXhrState?._listener) {
|
|
4411
4652
|
this.removeEventListener("readystatechange", _prevXhrState._listener);
|
|
4653
|
+
if (_prevXhrState.correlationId) {
|
|
4654
|
+
const idx = _activeCorrelationStack.lastIndexOf(_prevXhrState.correlationId);
|
|
4655
|
+
if (idx !== -1) _activeCorrelationStack.splice(idx, 1);
|
|
4656
|
+
}
|
|
4412
4657
|
}
|
|
4413
4658
|
xhrStateMap.set(this, {
|
|
4414
4659
|
method: String(method).toUpperCase(),
|
|
@@ -4437,6 +4682,8 @@ function createNetworkCapture(options = {}) {
|
|
|
4437
4682
|
if (state.correlationId) _activeCorrelationStack.push(state.correlationId);
|
|
4438
4683
|
const _readystateHandler = () => {
|
|
4439
4684
|
if (this.readyState !== 4) return;
|
|
4685
|
+
this.removeEventListener("readystatechange", _readystateHandler);
|
|
4686
|
+
state._listener = void 0;
|
|
4440
4687
|
if (state.shouldRecord) {
|
|
4441
4688
|
const duration = Date.now() - state.startTime;
|
|
4442
4689
|
const entry = {
|
|
@@ -4462,7 +4709,19 @@ function createNetworkCapture(options = {}) {
|
|
|
4462
4709
|
state._listener = _readystateHandler;
|
|
4463
4710
|
this.addEventListener("readystatechange", _readystateHandler);
|
|
4464
4711
|
}
|
|
4465
|
-
|
|
4712
|
+
try {
|
|
4713
|
+
originalXhrSend.call(this, body);
|
|
4714
|
+
} catch (err) {
|
|
4715
|
+
if (state?.correlationId) {
|
|
4716
|
+
const idx = _activeCorrelationStack.lastIndexOf(state.correlationId);
|
|
4717
|
+
if (idx !== -1) _activeCorrelationStack.splice(idx, 1);
|
|
4718
|
+
}
|
|
4719
|
+
if (state?._listener) {
|
|
4720
|
+
this.removeEventListener("readystatechange", state._listener);
|
|
4721
|
+
state._listener = void 0;
|
|
4722
|
+
}
|
|
4723
|
+
throw err;
|
|
4724
|
+
}
|
|
4466
4725
|
};
|
|
4467
4726
|
}
|
|
4468
4727
|
const xhrOpenWrapper = OriginalXHR ? XMLHttpRequest.prototype.open : null;
|
|
@@ -5169,8 +5428,10 @@ function createTimelineCapture() {
|
|
|
5169
5428
|
onReplace: () => recordRoute("replaceState"),
|
|
5170
5429
|
onPop: () => recordRoute("popstate")
|
|
5171
5430
|
});
|
|
5172
|
-
window
|
|
5173
|
-
document
|
|
5431
|
+
const hasWindow = typeof window !== "undefined";
|
|
5432
|
+
const hasDocument = typeof document !== "undefined";
|
|
5433
|
+
if (hasWindow) window.addEventListener("hashchange", handleHashChange);
|
|
5434
|
+
if (hasDocument) document.addEventListener("click", handleClick, true);
|
|
5174
5435
|
return {
|
|
5175
5436
|
setScreen(screen) {
|
|
5176
5437
|
record({
|
|
@@ -5209,8 +5470,8 @@ function createTimelineCapture() {
|
|
|
5209
5470
|
},
|
|
5210
5471
|
destroy() {
|
|
5211
5472
|
unsubHistory();
|
|
5212
|
-
window.removeEventListener("hashchange", handleHashChange);
|
|
5213
|
-
document.removeEventListener("click", handleClick, true);
|
|
5473
|
+
if (hasWindow) window.removeEventListener("hashchange", handleHashChange);
|
|
5474
|
+
if (hasDocument) document.removeEventListener("click", handleClick, true);
|
|
5214
5475
|
}
|
|
5215
5476
|
};
|
|
5216
5477
|
}
|
|
@@ -6051,7 +6312,7 @@ function createProactiveManager(config = {}) {
|
|
|
6051
6312
|
|
|
6052
6313
|
// src/version.ts
|
|
6053
6314
|
var MUSHI_SDK_PACKAGE = "@mushi-mushi/web";
|
|
6054
|
-
var MUSHI_SDK_VERSION = "1.
|
|
6315
|
+
var MUSHI_SDK_VERSION = "1.33.0" ;
|
|
6055
6316
|
function resolveReportAppVersion(config, environment) {
|
|
6056
6317
|
if (config.appVersion) return config.appVersion;
|
|
6057
6318
|
const vercelId = config.integrations?.vercel?.analyticsId;
|
|
@@ -6062,7 +6323,7 @@ var instance = null;
|
|
|
6062
6323
|
var Mushi = class {
|
|
6063
6324
|
constructor() {
|
|
6064
6325
|
}
|
|
6065
|
-
static init(config) {
|
|
6326
|
+
static init(config = {}) {
|
|
6066
6327
|
if (instance) {
|
|
6067
6328
|
createLogger({ scope: "mushi", level: "warn", format: "pretty" }).warn("Already initialized \u2014 call destroy() first to reinitialize");
|
|
6068
6329
|
return instance;
|
|
@@ -6489,7 +6750,8 @@ function createInstance(config) {
|
|
|
6489
6750
|
screenshotCaptureInFlight = true;
|
|
6490
6751
|
try {
|
|
6491
6752
|
const result = await provider();
|
|
6492
|
-
if (result) return result;
|
|
6753
|
+
if (result?.startsWith("data:image/")) return result;
|
|
6754
|
+
if (result) log.warn("screenshotProvider must resolve to a data:image/ URL; ignoring", { prefix: result.slice(0, 16) });
|
|
6493
6755
|
} catch (err) {
|
|
6494
6756
|
log.warn("screenshotProvider threw, falling back to built-in capturer", {
|
|
6495
6757
|
error: err instanceof Error ? err.message : String(err)
|
|
@@ -6532,7 +6794,7 @@ function createInstance(config) {
|
|
|
6532
6794
|
widget = new MushiWidget(bootstrapConfig.widget, {
|
|
6533
6795
|
onSubmit: async ({ category, userCategory, description, intent }) => {
|
|
6534
6796
|
log.info("Report submitted", { category, userCategory, intent });
|
|
6535
|
-
proactiveManager?.recordSubmission();
|
|
6797
|
+
if (pendingProactiveTrigger) proactiveManager?.recordSubmission();
|
|
6536
6798
|
await autoCaptureScreenshot("submit");
|
|
6537
6799
|
const outcome = await submitReport(category, description, intent, userCategory);
|
|
6538
6800
|
return outcome ?? { reportId: null, queuedOffline: true };
|
|
@@ -6635,7 +6897,7 @@ function createInstance(config) {
|
|
|
6635
6897
|
if (container.childElementCount > 0) return;
|
|
6636
6898
|
let session;
|
|
6637
6899
|
try {
|
|
6638
|
-
const { createScreenshotAnnotation } = await import('./chunks/screenshot-annotation-
|
|
6900
|
+
const { createScreenshotAnnotation } = await import('./chunks/screenshot-annotation-5R6MVBEY.js');
|
|
6639
6901
|
session = await createScreenshotAnnotation(pendingScreenshot, container);
|
|
6640
6902
|
} catch (err) {
|
|
6641
6903
|
log.warn("Screenshot annotation failed", {
|
|
@@ -7467,7 +7729,11 @@ function createInstance(config) {
|
|
|
7467
7729
|
breadcrumbs.add({ category: "lifecycle", level: "info", message: "Mushi.identifyWithToken() refreshed" });
|
|
7468
7730
|
return;
|
|
7469
7731
|
}
|
|
7470
|
-
|
|
7732
|
+
const sub = claims.sub;
|
|
7733
|
+
void sha256Hex(sub).then((hash) => {
|
|
7734
|
+
if (userInfo?.id === sub) updateSessionIdentity(hash);
|
|
7735
|
+
}).catch(() => {
|
|
7736
|
+
});
|
|
7471
7737
|
userInfo = {
|
|
7472
7738
|
id: claims.sub,
|
|
7473
7739
|
...claims.email ? { email: claims.email } : {},
|
|
@@ -7485,6 +7751,7 @@ function createInstance(config) {
|
|
|
7485
7751
|
} else {
|
|
7486
7752
|
userInfo = null;
|
|
7487
7753
|
lastIdentifySig = null;
|
|
7754
|
+
updateSessionIdentity(null);
|
|
7488
7755
|
widget.setIdentifiedUser(null);
|
|
7489
7756
|
breadcrumbs.add({ category: "lifecycle", level: "info", message: "Mushi.identifyWithToken(null)" });
|
|
7490
7757
|
}
|