@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.cjs
CHANGED
|
@@ -462,6 +462,20 @@ function estimateDataUrlBytes(dataUrl) {
|
|
|
462
462
|
const b64 = dataUrl.slice(comma + 1);
|
|
463
463
|
return Math.ceil(b64.length * 3 / 4);
|
|
464
464
|
}
|
|
465
|
+
var LAUNCHER_DISMISSED_STORAGE_KEY = "mushi-launcher-hidden";
|
|
466
|
+
function readLauncherDismissed() {
|
|
467
|
+
try {
|
|
468
|
+
return typeof sessionStorage !== "undefined" && sessionStorage.getItem(LAUNCHER_DISMISSED_STORAGE_KEY) === "1";
|
|
469
|
+
} catch {
|
|
470
|
+
return false;
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
function writeLauncherDismissed() {
|
|
474
|
+
try {
|
|
475
|
+
if (typeof sessionStorage !== "undefined") sessionStorage.setItem(LAUNCHER_DISMISSED_STORAGE_KEY, "1");
|
|
476
|
+
} catch {
|
|
477
|
+
}
|
|
478
|
+
}
|
|
465
479
|
var ASSISTANT_SESSION_STORAGE_KEY = "mushi-assistant-session-v1";
|
|
466
480
|
function loadAssistantSession() {
|
|
467
481
|
try {
|
|
@@ -649,7 +663,8 @@ var en = {
|
|
|
649
663
|
submit: "Submit",
|
|
650
664
|
submitting: "Sending\u2026",
|
|
651
665
|
submitted: "Thank you! Your report has been submitted.",
|
|
652
|
-
error: "Could not send your report. Check your connection and try again."
|
|
666
|
+
error: "Could not send your report. Check your connection and try again.",
|
|
667
|
+
hideLauncher: "Hide the bug button for this visit"
|
|
653
668
|
},
|
|
654
669
|
step1: {
|
|
655
670
|
moreNav: {
|
|
@@ -825,7 +840,8 @@ var ja = {
|
|
|
825
840
|
submit: "\u9001\u4FE1",
|
|
826
841
|
submitting: "\u9001\u4FE1\u4E2D\u2026",
|
|
827
842
|
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",
|
|
828
|
-
error: "\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F\u3002\u3082\u3046\u4E00\u5EA6\u304A\u8A66\u3057\u304F\u3060\u3055\u3044\u3002"
|
|
843
|
+
error: "\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F\u3002\u3082\u3046\u4E00\u5EA6\u304A\u8A66\u3057\u304F\u3060\u3055\u3044\u3002",
|
|
844
|
+
hideLauncher: "\u3053\u306E\u30A2\u30AF\u30BB\u30B9\u4E2D\u306F\u30D0\u30B0\u30DC\u30BF\u30F3\u3092\u96A0\u3059"
|
|
829
845
|
},
|
|
830
846
|
step1: {
|
|
831
847
|
moreNav: {
|
|
@@ -1001,7 +1017,8 @@ var th = {
|
|
|
1001
1017
|
submit: "\u0E2A\u0E48\u0E07",
|
|
1002
1018
|
submitting: "\u0E01\u0E33\u0E25\u0E31\u0E07\u0E2A\u0E48\u0E07\u2026",
|
|
1003
1019
|
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",
|
|
1004
|
-
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"
|
|
1020
|
+
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",
|
|
1021
|
+
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"
|
|
1005
1022
|
},
|
|
1006
1023
|
step1: {
|
|
1007
1024
|
moreNav: {
|
|
@@ -1177,7 +1194,8 @@ var es = {
|
|
|
1177
1194
|
submit: "Enviar",
|
|
1178
1195
|
submitting: "Enviando\u2026",
|
|
1179
1196
|
submitted: "\xA1Gracias! Tu reporte ha sido enviado.",
|
|
1180
|
-
error: "No se pudo enviar tu reporte. Revisa tu conexi\xF3n e int\xE9ntalo de nuevo."
|
|
1197
|
+
error: "No se pudo enviar tu reporte. Revisa tu conexi\xF3n e int\xE9ntalo de nuevo.",
|
|
1198
|
+
hideLauncher: "Ocultar el bot\xF3n de errores durante esta visita"
|
|
1181
1199
|
},
|
|
1182
1200
|
step1: {
|
|
1183
1201
|
moreNav: {
|
|
@@ -1353,7 +1371,8 @@ var zh = {
|
|
|
1353
1371
|
submit: "\u63D0\u4EA4",
|
|
1354
1372
|
submitting: "\u63D0\u4EA4\u4E2D\u2026",
|
|
1355
1373
|
submitted: "\u8C22\u8C22\uFF01\u4F60\u7684\u53CD\u9988\u5DF2\u63D0\u4EA4\u3002",
|
|
1356
|
-
error: "\u51FA\u9519\u4E86\uFF0C\u8BF7\u518D\u8BD5\u4E00\u6B21\u3002"
|
|
1374
|
+
error: "\u51FA\u9519\u4E86\uFF0C\u8BF7\u518D\u8BD5\u4E00\u6B21\u3002",
|
|
1375
|
+
hideLauncher: "\u672C\u6B21\u8BBF\u95EE\u671F\u95F4\u9690\u85CF\u53CD\u9988\u6309\u94AE"
|
|
1357
1376
|
},
|
|
1358
1377
|
step1: {
|
|
1359
1378
|
moreNav: {
|
|
@@ -1651,12 +1670,15 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
|
|
|
1651
1670
|
const { durationFast } = core.MUSHI_MOTION;
|
|
1652
1671
|
const { instant: durInstant, panel: durPanel } = core.MUSHI_DURATION;
|
|
1653
1672
|
const { bannerHeight, gutter, panelWidth, panelMaxHeight, panelSheetBreakpoint, edgeTabWidth } = core.MUSHI_GEOMETRY;
|
|
1673
|
+
const edgeTabHeight = 48;
|
|
1674
|
+
const touchTarget = 44;
|
|
1654
1675
|
const panelLauncherGap = fabSize + core.MUSHI_SPACING.comfy;
|
|
1655
1676
|
const controlRadius = core.MUSHI_RADIUS.control;
|
|
1656
|
-
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,${core.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;}}`;
|
|
1677
|
+
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,${core.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;}}`;
|
|
1657
1678
|
}
|
|
1658
1679
|
var esc = escapeHtml;
|
|
1659
1680
|
var BUILTIN_CHIPS = ["bug", "slow", "visual", "confusing"];
|
|
1681
|
+
var HIDE_LAUNCHER_FALLBACK = "Hide the bug button for this visit";
|
|
1660
1682
|
function btn(action, label, cls = "", extra = "") {
|
|
1661
1683
|
return `<button type="button" class="${cls}" data-action="${action}"${extra}>${label}</button>`;
|
|
1662
1684
|
}
|
|
@@ -1748,16 +1770,26 @@ function intentOptions(ctx) {
|
|
|
1748
1770
|
const list = ctx.locale.step2.intents[id] ?? [];
|
|
1749
1771
|
return list.slice(0, -1).slice(0, 4);
|
|
1750
1772
|
}
|
|
1773
|
+
function reportTypeIds(config) {
|
|
1774
|
+
const primary = [...BUILTIN_CHIPS];
|
|
1775
|
+
if (config.featureRequestCard !== false) primary.push("idea");
|
|
1776
|
+
const seen = new Set(primary);
|
|
1777
|
+
const more = [];
|
|
1778
|
+
for (const { id } of config.categories ?? []) {
|
|
1779
|
+
if (seen.has(id)) continue;
|
|
1780
|
+
seen.add(id);
|
|
1781
|
+
more.push(id);
|
|
1782
|
+
}
|
|
1783
|
+
return { primary, more };
|
|
1784
|
+
}
|
|
1751
1785
|
function reportView(ctx) {
|
|
1752
1786
|
const t = ctx.locale;
|
|
1753
1787
|
const p = t.panel;
|
|
1754
1788
|
const s3 = t.step3;
|
|
1755
|
-
const
|
|
1756
|
-
|
|
1757
|
-
const custom = ctx.config.categories ?? [];
|
|
1758
|
-
if (ctx.showAllCategories) ids.push(...custom.map((c) => c.id));
|
|
1789
|
+
const { primary, more: extra } = reportTypeIds(ctx.config);
|
|
1790
|
+
const ids = ctx.showAllCategories ? [...primary, ...extra] : primary;
|
|
1759
1791
|
const chips = ids.map((id, i) => chip(ctx, id, i, ids.includes(ctx.chip ?? "") ? ctx.chip : null)).join("");
|
|
1760
|
-
const more =
|
|
1792
|
+
const more = extra.length && !ctx.showAllCategories ? btn("show-all-categories", esc(p.more), "mushi-chip mushi-chip-more") : "";
|
|
1761
1793
|
const intents = intentOptions(ctx);
|
|
1762
1794
|
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>` : "";
|
|
1763
1795
|
const shotLabel = ctx.screenshotCapturing ? s3.screenshotCapturing : ctx.screenshotError ? s3.screenshotRetry : s3.screenshotButton;
|
|
@@ -1772,7 +1804,7 @@ function reportView(ctx) {
|
|
|
1772
1804
|
return {
|
|
1773
1805
|
header: renderHeader(ctx, ctx.config.expandedTitle || p.title),
|
|
1774
1806
|
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>`,
|
|
1775
|
-
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>` : ""}`,
|
|
1807
|
+
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>` : ""}`,
|
|
1776
1808
|
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>`
|
|
1777
1809
|
};
|
|
1778
1810
|
}
|
|
@@ -2007,6 +2039,25 @@ var MushiWidget = class _MushiWidget {
|
|
|
2007
2039
|
bannerResizeObserver = null;
|
|
2008
2040
|
/** Persisted FAB position when draggable is enabled. */
|
|
2009
2041
|
fabPos = null;
|
|
2042
|
+
/** Storage key `fabPos` was loaded for. */
|
|
2043
|
+
fabPosKey = "";
|
|
2044
|
+
draggableSet = false;
|
|
2045
|
+
/** px from the viewport bottom that clears fixed host bars. */
|
|
2046
|
+
barClearance = 0;
|
|
2047
|
+
clampedForClearance = 0;
|
|
2048
|
+
tuckCleanup = null;
|
|
2049
|
+
tuckTimer = null;
|
|
2050
|
+
resizeFrame = null;
|
|
2051
|
+
lateMeasureTimer = null;
|
|
2052
|
+
onViewportResize = () => {
|
|
2053
|
+
if (this.resizeFrame !== null) return;
|
|
2054
|
+
this.resizeFrame = requestAnimationFrame(() => {
|
|
2055
|
+
this.resizeFrame = null;
|
|
2056
|
+
this.barClearance = this.measureFixedBars();
|
|
2057
|
+
this.render();
|
|
2058
|
+
});
|
|
2059
|
+
};
|
|
2060
|
+
launcherDismissed = readLauncherDismissed();
|
|
2010
2061
|
/** Cleanup fn for visualViewport keyboard listener. */
|
|
2011
2062
|
vvCleanup = null;
|
|
2012
2063
|
/** Host-app user identity from `identify()` — shown as "Reporting as <name>". */
|
|
@@ -2050,6 +2101,10 @@ var MushiWidget = class _MushiWidget {
|
|
|
2050
2101
|
environments: config.environments ?? {},
|
|
2051
2102
|
smartHide: config.smartHide ?? false,
|
|
2052
2103
|
draggable: config.draggable ?? false,
|
|
2104
|
+
mobileTrigger: config.mobileTrigger ?? (placesLauncher(config) ? "auto" : "edge-tab"),
|
|
2105
|
+
avoidFixedBars: config.avoidFixedBars ?? true,
|
|
2106
|
+
tuckOnScroll: config.tuckOnScroll ?? true,
|
|
2107
|
+
dismissible: config.dismissible ?? true,
|
|
2053
2108
|
brandFooter: config.brandFooter ?? false,
|
|
2054
2109
|
outdatedBanner: config.outdatedBanner ?? "auto",
|
|
2055
2110
|
screenshotSensitiveHint: config.screenshotSensitiveHint ?? true,
|
|
@@ -2067,6 +2122,7 @@ var MushiWidget = class _MushiWidget {
|
|
|
2067
2122
|
accentText: config.accentText ?? ""
|
|
2068
2123
|
};
|
|
2069
2124
|
this.callbacks = callbacks;
|
|
2125
|
+
this.draggableSet = config.draggable !== void 0;
|
|
2070
2126
|
this.locale = getLocale(this.config.locale === "auto" ? void 0 : this.config.locale);
|
|
2071
2127
|
this.rc = this.resolveCopy();
|
|
2072
2128
|
const saved = loadAssistantSession();
|
|
@@ -2113,8 +2169,16 @@ var MushiWidget = class _MushiWidget {
|
|
|
2113
2169
|
window.addEventListener("pointercancel", this.onPointerRelease, true);
|
|
2114
2170
|
this.syncAttachedLaunchers();
|
|
2115
2171
|
this.syncSmartHide();
|
|
2172
|
+
this.syncScrollTuck();
|
|
2116
2173
|
this.bindColorSchemeListener();
|
|
2174
|
+
window.addEventListener("resize", this.onViewportResize);
|
|
2175
|
+
window.visualViewport?.addEventListener("resize", this.onViewportResize);
|
|
2117
2176
|
this.render();
|
|
2177
|
+
this.onViewportResize();
|
|
2178
|
+
this.lateMeasureTimer = setTimeout(() => {
|
|
2179
|
+
this.lateMeasureTimer = null;
|
|
2180
|
+
this.onViewportResize();
|
|
2181
|
+
}, 1200);
|
|
2118
2182
|
}
|
|
2119
2183
|
getIsMounted() {
|
|
2120
2184
|
return this.host.isConnected;
|
|
@@ -2135,9 +2199,11 @@ var MushiWidget = class _MushiWidget {
|
|
|
2135
2199
|
if (triggerBecameBanner || bannerConfigChanged) {
|
|
2136
2200
|
this.bannerDismissed = false;
|
|
2137
2201
|
}
|
|
2202
|
+
if (config.draggable !== void 0) this.draggableSet = true;
|
|
2138
2203
|
if (this.host.isConnected) this.syncHostChromeState();
|
|
2139
2204
|
this.syncAttachedLaunchers();
|
|
2140
2205
|
this.syncSmartHide();
|
|
2206
|
+
if (this.host.isConnected) this.syncScrollTuck();
|
|
2141
2207
|
this.render();
|
|
2142
2208
|
}
|
|
2143
2209
|
// ─── Custom category helpers ──────────────────────────────────────────────
|
|
@@ -2177,6 +2243,7 @@ var MushiWidget = class _MushiWidget {
|
|
|
2177
2243
|
this.chip = options?.featureRequest ? "idea" : custom ? cat : cat && cat !== "other" && BUILTIN.includes(cat) ? cat : null;
|
|
2178
2244
|
this.showAllCategories = Boolean(custom);
|
|
2179
2245
|
this.removeToast();
|
|
2246
|
+
this.barClearance = this.measureFixedBars();
|
|
2180
2247
|
this.render();
|
|
2181
2248
|
this.callbacks.onOpen();
|
|
2182
2249
|
}
|
|
@@ -2458,6 +2525,18 @@ var MushiWidget = class _MushiWidget {
|
|
|
2458
2525
|
this.unbindColorSchemeListener();
|
|
2459
2526
|
this.smartHideCleanup?.();
|
|
2460
2527
|
this.smartHideCleanup = null;
|
|
2528
|
+
this.tuckCleanup?.();
|
|
2529
|
+
this.tuckCleanup = null;
|
|
2530
|
+
window.removeEventListener("resize", this.onViewportResize);
|
|
2531
|
+
window.visualViewport?.removeEventListener("resize", this.onViewportResize);
|
|
2532
|
+
if (this.resizeFrame !== null) {
|
|
2533
|
+
cancelAnimationFrame(this.resizeFrame);
|
|
2534
|
+
this.resizeFrame = null;
|
|
2535
|
+
}
|
|
2536
|
+
if (this.lateMeasureTimer !== null) {
|
|
2537
|
+
clearTimeout(this.lateMeasureTimer);
|
|
2538
|
+
this.lateMeasureTimer = null;
|
|
2539
|
+
}
|
|
2461
2540
|
this.teardownViewportHandlers();
|
|
2462
2541
|
this.attachedLaunchers.forEach((cleanup) => cleanup());
|
|
2463
2542
|
this.attachedLaunchers = [];
|
|
@@ -2494,19 +2573,27 @@ var MushiWidget = class _MushiWidget {
|
|
|
2494
2573
|
this.onColorSchemeChange = null;
|
|
2495
2574
|
}
|
|
2496
2575
|
/* ── Host chrome contract ────────────────────────────────────────────────
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2576
|
+
The host element must never create an invisible full-screen touch blocker.
|
|
2577
|
+
We own these inline styles; only the shadow internals opt back into
|
|
2578
|
+
pointer events. Idempotent.
|
|
2579
|
+
|
|
2580
|
+
The host must not form a stacking context either. A `position: fixed`
|
|
2581
|
+
element always does, and so does any positioned element with a z-index;
|
|
2582
|
+
either one ranks every surface inside the shadow root at the host's
|
|
2583
|
+
level, so `bannerConfig.zIndex` could never put the banner under the
|
|
2584
|
+
host app's own sheets. The host is an absolute 0×0 box with
|
|
2585
|
+
`z-index: auto`, and the trigger, panel, toast and banner each carry
|
|
2586
|
+
their own z-index, which is then compared directly with the page's. */
|
|
2500
2587
|
syncHostChromeState() {
|
|
2501
2588
|
const s = this.host.style;
|
|
2502
|
-
s.setProperty("position", "
|
|
2589
|
+
s.setProperty("position", "absolute");
|
|
2503
2590
|
s.setProperty("top", "0");
|
|
2504
2591
|
s.setProperty("left", "0");
|
|
2505
2592
|
s.setProperty("width", "0");
|
|
2506
2593
|
s.setProperty("height", "0");
|
|
2507
2594
|
s.setProperty("overflow", "visible");
|
|
2508
2595
|
s.setProperty("pointer-events", "none");
|
|
2509
|
-
s.setProperty("z-index",
|
|
2596
|
+
s.setProperty("z-index", "auto");
|
|
2510
2597
|
s.setProperty("margin", "0");
|
|
2511
2598
|
s.setProperty("padding", "0");
|
|
2512
2599
|
s.setProperty("border", "none");
|
|
@@ -2526,7 +2613,7 @@ var MushiWidget = class _MushiWidget {
|
|
|
2526
2613
|
const s = this.host.style;
|
|
2527
2614
|
const widgetHostPointerSafe = s.pointerEvents === "none" && (s.width === "0" || s.width === "0px") && (s.height === "0" || s.height === "0px");
|
|
2528
2615
|
const widgetHostBounds = this.host.isConnected ? { width: this.host.offsetWidth, height: this.host.offsetHeight } : null;
|
|
2529
|
-
const widgetSuppressed = this.isSuppressedByHost() || this.isRouteHidden() || !this.triggerVisible;
|
|
2616
|
+
const widgetSuppressed = this.isSuppressedByHost() || this.isRouteHidden() || !this.triggerVisible || this.launcherDismissed;
|
|
2530
2617
|
const bannerRendered = this.config.trigger === "banner" && !this.bannerDismissed && !this.isSuppressedByHost() && !this.isRouteHidden() && this.triggerVisible;
|
|
2531
2618
|
return { widgetHostPointerSafe, widgetHostBounds, widgetSuppressed, bannerRendered };
|
|
2532
2619
|
}
|
|
@@ -2559,8 +2646,73 @@ var MushiWidget = class _MushiWidget {
|
|
|
2559
2646
|
window.addEventListener("scroll", onScroll, { passive: true });
|
|
2560
2647
|
this.smartHideCleanup = () => window.removeEventListener("scroll", onScroll);
|
|
2561
2648
|
}
|
|
2649
|
+
/** Tuck the launcher while anything scrolls (capture: inner scrollers count). A class toggle, not a rebuild, so focus and drag survive. */
|
|
2650
|
+
syncScrollTuck() {
|
|
2651
|
+
this.tuckCleanup?.();
|
|
2652
|
+
this.tuckCleanup = null;
|
|
2653
|
+
const smart = this.config.smartHide;
|
|
2654
|
+
const legacyScroll = smart === true || typeof smart === "object" && Boolean(smart.onScroll);
|
|
2655
|
+
if (!this.config.tuckOnScroll || legacyScroll || typeof document === "undefined") return;
|
|
2656
|
+
const IDLE_MS = 700;
|
|
2657
|
+
const onScroll = () => {
|
|
2658
|
+
const t = this.triggerEl;
|
|
2659
|
+
if (!t || this.isOpen || this.shadow.activeElement === t || t.classList.contains("dragging")) return;
|
|
2660
|
+
t.classList.add("tucked");
|
|
2661
|
+
if (this.tuckTimer !== null) clearTimeout(this.tuckTimer);
|
|
2662
|
+
this.tuckTimer = setTimeout(() => {
|
|
2663
|
+
this.tuckTimer = null;
|
|
2664
|
+
this.triggerEl?.classList.remove("tucked");
|
|
2665
|
+
const next = this.measureFixedBars();
|
|
2666
|
+
if (next !== this.barClearance) {
|
|
2667
|
+
this.barClearance = next;
|
|
2668
|
+
this.render();
|
|
2669
|
+
}
|
|
2670
|
+
}, IDLE_MS);
|
|
2671
|
+
};
|
|
2672
|
+
document.addEventListener("scroll", onScroll, { capture: true, passive: true });
|
|
2673
|
+
this.tuckCleanup = () => {
|
|
2674
|
+
document.removeEventListener("scroll", onScroll, { capture: true });
|
|
2675
|
+
if (this.tuckTimer !== null) clearTimeout(this.tuckTimer);
|
|
2676
|
+
this.tuckTimer = null;
|
|
2677
|
+
};
|
|
2678
|
+
}
|
|
2679
|
+
/**
|
|
2680
|
+
* px that clears a bar docked at the viewport bottom, + 8px: a short fixed/sticky
|
|
2681
|
+
* element, or a flow child of a fixed full-height shell. Scroller content never counts.
|
|
2682
|
+
*/
|
|
2683
|
+
measureFixedBars() {
|
|
2684
|
+
if (!this.config.avoidFixedBars || typeof document === "undefined" || typeof document.elementsFromPoint !== "function") return 0;
|
|
2685
|
+
const H = window.innerHeight;
|
|
2686
|
+
const W = window.innerWidth;
|
|
2687
|
+
if (!H || !W) return 0;
|
|
2688
|
+
const left = this.config.position.endsWith("left");
|
|
2689
|
+
const isBar = (r) => r.height > 0 && r.height <= H * 0.4 && r.top < H && r.bottom >= H - 4 && r.bottom <= H + 4;
|
|
2690
|
+
let barTop = H;
|
|
2691
|
+
for (const x of [left ? 24 : W - 24, W / 2]) {
|
|
2692
|
+
const hit = document.elementsFromPoint(x, H - 2).find((el) => el !== this.host && !this.host.contains(el));
|
|
2693
|
+
let flowBar = null;
|
|
2694
|
+
for (let el = hit ?? null; el && el !== document.body && el !== document.documentElement; el = el.parentElement) {
|
|
2695
|
+
const cs = getComputedStyle(el);
|
|
2696
|
+
const r = el.getBoundingClientRect();
|
|
2697
|
+
if (cs.position === "fixed" || cs.position === "sticky") {
|
|
2698
|
+
const bar = isBar(r) ? r : flowBar;
|
|
2699
|
+
if (bar) barTop = Math.min(barTop, bar.top);
|
|
2700
|
+
break;
|
|
2701
|
+
}
|
|
2702
|
+
if (/(auto|scroll)/.test(cs.overflowY)) flowBar = null;
|
|
2703
|
+
else if (isBar(r)) flowBar = r;
|
|
2704
|
+
}
|
|
2705
|
+
}
|
|
2706
|
+
return barTop < H ? Math.ceil(H - barTop + 8) : 0;
|
|
2707
|
+
}
|
|
2708
|
+
dismissLauncherForSession() {
|
|
2709
|
+
this.launcherDismissed = true;
|
|
2710
|
+
writeLauncherDismissed();
|
|
2711
|
+
this.close();
|
|
2712
|
+
}
|
|
2562
2713
|
shouldRenderTrigger() {
|
|
2563
2714
|
if (!this.triggerVisible) return false;
|
|
2715
|
+
if (this.launcherDismissed) return false;
|
|
2564
2716
|
if (this.triggerHiddenByScroll) return false;
|
|
2565
2717
|
if (this.config.trigger === "manual" || this.config.trigger === "hidden" || this.config.trigger === "attach" || this.config.trigger === "banner") {
|
|
2566
2718
|
return false;
|
|
@@ -2671,7 +2823,7 @@ var MushiWidget = class _MushiWidget {
|
|
|
2671
2823
|
if (richLayout) {
|
|
2672
2824
|
const body = document.createElement("div");
|
|
2673
2825
|
body.className = "mushi-banner-body";
|
|
2674
|
-
const labelText = bc.label === false ? null : bc.label ??
|
|
2826
|
+
const labelText = bc.label === false ? null : bc.label ?? core.MUSHI_COPY.bannerLabel;
|
|
2675
2827
|
if (labelText) {
|
|
2676
2828
|
const pill = document.createElement("span");
|
|
2677
2829
|
pill.className = "mushi-banner-pill";
|
|
@@ -2756,9 +2908,14 @@ var MushiWidget = class _MushiWidget {
|
|
|
2756
2908
|
this.trackBannerHeight(banner, position);
|
|
2757
2909
|
}
|
|
2758
2910
|
effectiveTrigger() {
|
|
2759
|
-
if (
|
|
2760
|
-
|
|
2761
|
-
|
|
2911
|
+
if (typeof window === "undefined") return this.config.trigger;
|
|
2912
|
+
if (this.config.smartHide) {
|
|
2913
|
+
const smart = this.config.smartHide === true ? { onMobile: "edge-tab" } : this.config.smartHide;
|
|
2914
|
+
if (window.matchMedia("(max-width: 768px)").matches && smart.onMobile === "edge-tab") {
|
|
2915
|
+
return "edge-tab";
|
|
2916
|
+
}
|
|
2917
|
+
}
|
|
2918
|
+
if (this.config.trigger === "auto" && this.config.mobileTrigger === "edge-tab" && typeof window.matchMedia === "function" && window.matchMedia("(max-width: 768px)")?.matches) {
|
|
2762
2919
|
return "edge-tab";
|
|
2763
2920
|
}
|
|
2764
2921
|
return this.config.trigger;
|
|
@@ -2861,20 +3018,34 @@ var MushiWidget = class _MushiWidget {
|
|
|
2861
3018
|
const pos = this.config.position;
|
|
2862
3019
|
const effective = show ? this.effectiveTrigger() : "";
|
|
2863
3020
|
const key = JSON.stringify([show, effective, pos, this.triggerShrunk, this.config.triggerText, this.config.zIndex, this.config.draggable, this.lang]);
|
|
3021
|
+
let rebuilt = false;
|
|
2864
3022
|
if (key !== this.triggerKey || show && !this.triggerEl?.isConnected) {
|
|
2865
3023
|
this.triggerKey = key;
|
|
2866
3024
|
this.triggerEl?.remove();
|
|
2867
3025
|
this.triggerEl = show ? this.buildTrigger(effective) : null;
|
|
3026
|
+
rebuilt = true;
|
|
2868
3027
|
}
|
|
2869
3028
|
if (this.triggerEl) {
|
|
2870
3029
|
this.triggerEl.setAttribute("aria-expanded", String(this.isOpen));
|
|
2871
3030
|
this.applyInsetVars(this.triggerEl);
|
|
3031
|
+
if ((rebuilt || this.barClearance !== this.clampedForClearance) && this.fabPos && this.dragOptions(this.triggerEl)) {
|
|
3032
|
+
this.restoreFabPos(this.triggerEl);
|
|
3033
|
+
}
|
|
3034
|
+
this.clampedForClearance = this.barClearance;
|
|
2872
3035
|
}
|
|
2873
3036
|
}
|
|
2874
3037
|
buildTrigger(effective) {
|
|
3038
|
+
const tab = effective === "edge-tab";
|
|
2875
3039
|
const trigger = document.createElement("button");
|
|
2876
|
-
trigger.className = `mushi-trigger ${this.config.position}${
|
|
2877
|
-
|
|
3040
|
+
trigger.className = `mushi-trigger ${this.config.position}${tab ? " edge-tab" : ""}${tab && isTextLabel(this.config.triggerText) ? " text" : ""}${this.triggerShrunk ? " shrunk" : ""}`;
|
|
3041
|
+
if (tab) {
|
|
3042
|
+
const face = document.createElement("span");
|
|
3043
|
+
face.className = "mushi-trigger-face";
|
|
3044
|
+
face.textContent = this.config.triggerText;
|
|
3045
|
+
trigger.appendChild(face);
|
|
3046
|
+
} else {
|
|
3047
|
+
trigger.textContent = this.config.triggerText;
|
|
3048
|
+
}
|
|
2878
3049
|
trigger.setAttribute("aria-label", this.locale.widget.trigger);
|
|
2879
3050
|
trigger.setAttribute("aria-haspopup", "dialog");
|
|
2880
3051
|
trigger.style.zIndex = String(this.config.zIndex);
|
|
@@ -2883,10 +3054,10 @@ var MushiWidget = class _MushiWidget {
|
|
|
2883
3054
|
else this.open();
|
|
2884
3055
|
});
|
|
2885
3056
|
trigger.addEventListener("keydown", (e) => {
|
|
2886
|
-
const
|
|
2887
|
-
if (!
|
|
3057
|
+
const drag = this.dragOptions(trigger);
|
|
3058
|
+
if (!drag) return;
|
|
2888
3059
|
const STEP = 8;
|
|
2889
|
-
const
|
|
3060
|
+
const { axis } = drag;
|
|
2890
3061
|
let dx = 0, dy = 0;
|
|
2891
3062
|
if (axis !== "y") {
|
|
2892
3063
|
if (e.key === "ArrowLeft") dx = -STEP;
|
|
@@ -2899,18 +3070,28 @@ var MushiWidget = class _MushiWidget {
|
|
|
2899
3070
|
if (dx !== 0 || dy !== 0) {
|
|
2900
3071
|
e.preventDefault();
|
|
2901
3072
|
const cur = this.fabPos ?? { x: 0, y: 0 };
|
|
2902
|
-
this.moveFab(trigger, cur.x + dx, cur.y + dy,
|
|
3073
|
+
this.moveFab(trigger, cur.x + dx, cur.y + dy, "end");
|
|
2903
3074
|
}
|
|
2904
3075
|
});
|
|
2905
|
-
if (this.
|
|
3076
|
+
if (this.dragOptions(trigger)) this.attachDragHandlers(trigger);
|
|
2906
3077
|
this.shadow.insertBefore(trigger, this.panel);
|
|
2907
|
-
if (this.fabPos && this.config.draggable) {
|
|
2908
|
-
const savedPos = this.fabPos;
|
|
2909
|
-
this.fabPos = { x: 0, y: 0 };
|
|
2910
|
-
this.moveFab(trigger, savedPos.x, savedPos.y, false);
|
|
2911
|
-
}
|
|
2912
3078
|
return trigger;
|
|
2913
3079
|
}
|
|
3080
|
+
restoreFabPos(trigger) {
|
|
3081
|
+
if (!this.fabPos) return;
|
|
3082
|
+
const savedPos = this.fabPos;
|
|
3083
|
+
this.fabPos = { x: 0, y: 0 };
|
|
3084
|
+
trigger.style.setProperty("--mushi-drag-active", "0");
|
|
3085
|
+
this.moveFab(trigger, savedPos.x, savedPos.y, "restore");
|
|
3086
|
+
}
|
|
3087
|
+
/** Drag options, or null when fixed. The tab drags along its edge unless `draggable: false`. */
|
|
3088
|
+
dragOptions(trigger) {
|
|
3089
|
+
const tab = trigger.classList.contains("edge-tab");
|
|
3090
|
+
const d = this.config.draggable;
|
|
3091
|
+
if (!d && (this.draggableSet || !tab)) return null;
|
|
3092
|
+
const o = typeof d === "object" ? d : {};
|
|
3093
|
+
return { axis: tab ? "y" : o.axis ?? "both", persist: o.persist ?? true, snap: !tab && (o.snapToEdge ?? true) };
|
|
3094
|
+
}
|
|
2914
3095
|
// ─── Rendering ─────────────────────────────────────────────────────
|
|
2915
3096
|
render() {
|
|
2916
3097
|
if (this.isOpen && this.pointerDownAt !== null && Date.now() - this.pointerDownAt < 2e3) {
|
|
@@ -3026,32 +3207,44 @@ var MushiWidget = class _MushiWidget {
|
|
|
3026
3207
|
}
|
|
3027
3208
|
}
|
|
3028
3209
|
}
|
|
3029
|
-
/**
|
|
3210
|
+
/**
|
|
3211
|
+
* Queries `avoidSelectors` and returns a top offset clearing the ones in the
|
|
3212
|
+
* top half of the viewport, or null. A bottom tab bar is ignored here: clearing
|
|
3213
|
+
* it from the top edge would push the widget off-screen.
|
|
3214
|
+
*/
|
|
3030
3215
|
computeAvoidTopPx(gap = 8) {
|
|
3031
3216
|
const sels = this.config.avoidSelectors;
|
|
3032
3217
|
if (!sels?.length) return null;
|
|
3218
|
+
const mid = window.innerHeight / 2;
|
|
3033
3219
|
let maxBottom = 0;
|
|
3034
3220
|
for (const sel of sels) {
|
|
3035
3221
|
try {
|
|
3036
3222
|
const el = document.querySelector(sel);
|
|
3037
3223
|
if (!el) continue;
|
|
3038
3224
|
const r = el.getBoundingClientRect();
|
|
3225
|
+
if ((r.top + r.bottom) / 2 >= mid) continue;
|
|
3039
3226
|
if (r.bottom > maxBottom && r.width > 0 && r.height > 0) maxBottom = r.bottom;
|
|
3040
3227
|
} catch {
|
|
3041
3228
|
}
|
|
3042
3229
|
}
|
|
3043
3230
|
return maxBottom > 0 ? Math.ceil(maxBottom) + gap : null;
|
|
3044
3231
|
}
|
|
3045
|
-
/**
|
|
3232
|
+
/**
|
|
3233
|
+
* Bottom offset so a bottom-anchored trigger clears avoided elements in the
|
|
3234
|
+
* bottom half of the viewport (tab bars, fixed CTAs). A top header is ignored
|
|
3235
|
+
* here: clearing it from the bottom edge would push the widget off-screen.
|
|
3236
|
+
*/
|
|
3046
3237
|
computeAvoidBottomPx(gap = 8) {
|
|
3047
3238
|
const sels = this.config.avoidSelectors;
|
|
3048
3239
|
if (!sels?.length) return null;
|
|
3240
|
+
const mid = window.innerHeight / 2;
|
|
3049
3241
|
let maxClearance = 0;
|
|
3050
3242
|
for (const sel of sels) {
|
|
3051
3243
|
try {
|
|
3052
3244
|
const el = document.querySelector(sel);
|
|
3053
3245
|
if (!el) continue;
|
|
3054
3246
|
const r = el.getBoundingClientRect();
|
|
3247
|
+
if ((r.top + r.bottom) / 2 <= mid) continue;
|
|
3055
3248
|
if (r.width > 0 && r.height > 0) {
|
|
3056
3249
|
const clearance = window.innerHeight - r.top + gap;
|
|
3057
3250
|
if (clearance > maxClearance) maxClearance = clearance;
|
|
@@ -3061,8 +3254,17 @@ var MushiWidget = class _MushiWidget {
|
|
|
3061
3254
|
}
|
|
3062
3255
|
return maxClearance > 0 ? Math.ceil(maxClearance) : null;
|
|
3063
3256
|
}
|
|
3257
|
+
hostCssVar(name) {
|
|
3258
|
+
if (!this.host.isConnected) return "";
|
|
3259
|
+
try {
|
|
3260
|
+
return getComputedStyle(this.host).getPropertyValue(name).trim();
|
|
3261
|
+
} catch {
|
|
3262
|
+
return "";
|
|
3263
|
+
}
|
|
3264
|
+
}
|
|
3064
3265
|
applyInsetVars(el) {
|
|
3065
3266
|
const { anchor } = this.config;
|
|
3267
|
+
for (const edge of ["top", "right", "bottom", "left"]) el.style.removeProperty(`--mushi-${edge}`);
|
|
3066
3268
|
if (anchor && Object.keys(anchor).length > 0) {
|
|
3067
3269
|
["top", "right", "bottom", "left"].forEach((edge) => {
|
|
3068
3270
|
const value = anchor[edge];
|
|
@@ -3090,23 +3292,30 @@ var MushiWidget = class _MushiWidget {
|
|
|
3090
3292
|
}
|
|
3091
3293
|
if (isBottomAnchored) {
|
|
3092
3294
|
const avoidBottomPx = this.computeAvoidBottomPx();
|
|
3093
|
-
if (avoidBottomPx !== null)
|
|
3295
|
+
if (avoidBottomPx !== null) {
|
|
3296
|
+
el.style.setProperty("--mushi-bottom", `${Math.max(avoidBottomPx, this.barClearance)}px`);
|
|
3297
|
+
} else if (this.barClearance > 0) {
|
|
3298
|
+
const base = el.style.getPropertyValue("--mushi-bottom").trim() || this.hostCssVar("--mushi-bottom") || `calc(${core.MUSHI_GEOMETRY.gutter}px + env(safe-area-inset-bottom, 0px))`;
|
|
3299
|
+
if (base !== "auto") el.style.setProperty("--mushi-bottom", `max(${base}, ${this.barClearance}px)`);
|
|
3300
|
+
}
|
|
3094
3301
|
}
|
|
3095
3302
|
}
|
|
3096
|
-
// ─── Draggable
|
|
3097
|
-
/**
|
|
3098
|
-
fabStorageKey() {
|
|
3303
|
+
// ─── Draggable launcher ─────────────────────────────────────────────────────
|
|
3304
|
+
/** Per-site (origin) key; the FAB and the tab measure from different anchors. */
|
|
3305
|
+
fabStorageKey(trigger) {
|
|
3099
3306
|
const id = this.config["projectId"] ?? "";
|
|
3100
|
-
|
|
3307
|
+
const shape = trigger.classList.contains("edge-tab") ? "mushi_tab_pos" : "mushi_fab_pos";
|
|
3308
|
+
return `${shape}${id ? `_${id}` : ""}`;
|
|
3101
3309
|
}
|
|
3102
3310
|
/**
|
|
3103
|
-
* Move the
|
|
3104
|
-
* inside the
|
|
3311
|
+
* Move the launcher to a translated offset (relative to its CSS anchor),
|
|
3312
|
+
* clamped inside the safe area and above host bars. `end` snaps and persists.
|
|
3105
3313
|
* The base position is derived by subtracting the applied drag offset.
|
|
3106
3314
|
*/
|
|
3107
|
-
moveFab(trigger, x, y,
|
|
3108
|
-
const
|
|
3109
|
-
|
|
3315
|
+
moveFab(trigger, x, y, phase) {
|
|
3316
|
+
const drag = this.dragOptions(trigger);
|
|
3317
|
+
if (!drag) return;
|
|
3318
|
+
const { axis } = drag;
|
|
3110
3319
|
const W = window.innerWidth;
|
|
3111
3320
|
const H = window.innerHeight;
|
|
3112
3321
|
const btnW = trigger.offsetWidth || 52;
|
|
@@ -3124,35 +3333,31 @@ var MushiWidget = class _MushiWidget {
|
|
|
3124
3333
|
const minX = safeL + margin - baseLeft;
|
|
3125
3334
|
const maxX = W - safeR - margin - btnW - baseLeft;
|
|
3126
3335
|
const minY = safeT + margin - baseTop;
|
|
3127
|
-
const maxY = H - safeB
|
|
3336
|
+
const maxY = H - Math.max(safeB + margin, this.barClearance) - btnH - baseTop;
|
|
3128
3337
|
const newY = axis === "x" ? 0 : Math.max(minY, Math.min(maxY, y));
|
|
3129
3338
|
let finalX = axis === "y" ? 0 : Math.max(minX, Math.min(maxX, x));
|
|
3130
|
-
if (snap) {
|
|
3131
|
-
|
|
3132
|
-
if (shouldSnap && axis !== "y") {
|
|
3133
|
-
finalX = rect.left + btnW / 2 < W / 2 ? safeL + margin - baseLeft : W - safeR - margin - btnW - baseLeft;
|
|
3134
|
-
}
|
|
3339
|
+
if (phase === "end" && drag.snap && axis !== "y") {
|
|
3340
|
+
finalX = rect.left + btnW / 2 < W / 2 ? safeL + margin - baseLeft : W - safeR - margin - btnW - baseLeft;
|
|
3135
3341
|
}
|
|
3136
3342
|
this.fabPos = { x: finalX, y: newY };
|
|
3137
3343
|
trigger.style.setProperty("--mushi-drag-x", `${finalX}px`);
|
|
3138
3344
|
trigger.style.setProperty("--mushi-drag-y", `${newY}px`);
|
|
3139
3345
|
trigger.style.setProperty("--mushi-drag-active", "1");
|
|
3140
|
-
|
|
3141
|
-
if (shouldPersist) {
|
|
3346
|
+
if (phase === "end" && drag.persist) {
|
|
3142
3347
|
try {
|
|
3143
|
-
localStorage.setItem(this.fabStorageKey(), JSON.stringify(this.fabPos));
|
|
3348
|
+
localStorage.setItem(this.fabStorageKey(trigger), JSON.stringify(this.fabPos));
|
|
3144
3349
|
} catch {
|
|
3145
3350
|
}
|
|
3146
3351
|
}
|
|
3147
3352
|
}
|
|
3148
|
-
|
|
3149
|
-
|
|
3150
|
-
|
|
3151
|
-
|
|
3152
|
-
|
|
3153
|
-
if (!
|
|
3353
|
+
loadFabPos(trigger) {
|
|
3354
|
+
const key = this.fabStorageKey(trigger);
|
|
3355
|
+
if (key === this.fabPosKey) return;
|
|
3356
|
+
this.fabPosKey = key;
|
|
3357
|
+
this.fabPos = null;
|
|
3358
|
+
if (!this.dragOptions(trigger)?.persist) return;
|
|
3154
3359
|
try {
|
|
3155
|
-
const raw = localStorage.getItem(
|
|
3360
|
+
const raw = localStorage.getItem(key);
|
|
3156
3361
|
if (raw) {
|
|
3157
3362
|
const parsed = JSON.parse(raw);
|
|
3158
3363
|
if (typeof parsed?.x === "number" && typeof parsed?.y === "number") this.fabPos = parsed;
|
|
@@ -3162,7 +3367,7 @@ var MushiWidget = class _MushiWidget {
|
|
|
3162
3367
|
}
|
|
3163
3368
|
/** Attach Pointer Events-based drag to the trigger element. */
|
|
3164
3369
|
attachDragHandlers(trigger) {
|
|
3165
|
-
|
|
3370
|
+
this.loadFabPos(trigger);
|
|
3166
3371
|
let startX = 0, startY = 0;
|
|
3167
3372
|
let originX = 0, originY = 0;
|
|
3168
3373
|
let dragging = false;
|
|
@@ -3170,7 +3375,7 @@ var MushiWidget = class _MushiWidget {
|
|
|
3170
3375
|
const DRAG_THRESHOLD = 6;
|
|
3171
3376
|
trigger.addEventListener("pointerdown", (e) => {
|
|
3172
3377
|
if (e.button !== 0 && e.pointerType !== "touch") return;
|
|
3173
|
-
trigger.setPointerCapture(e.pointerId);
|
|
3378
|
+
trigger.setPointerCapture?.(e.pointerId);
|
|
3174
3379
|
startX = e.clientX;
|
|
3175
3380
|
startY = e.clientY;
|
|
3176
3381
|
const cur = this.fabPos ?? { x: 0, y: 0 };
|
|
@@ -3185,11 +3390,12 @@ var MushiWidget = class _MushiWidget {
|
|
|
3185
3390
|
const dy = e.clientY - startY;
|
|
3186
3391
|
if (!moved && Math.hypot(dx, dy) > DRAG_THRESHOLD) {
|
|
3187
3392
|
moved = true;
|
|
3393
|
+
trigger.classList.remove("tucked");
|
|
3188
3394
|
trigger.classList.add("dragging");
|
|
3189
3395
|
}
|
|
3190
3396
|
if (moved) {
|
|
3191
3397
|
e.preventDefault();
|
|
3192
|
-
this.moveFab(trigger, originX + dx, originY + dy,
|
|
3398
|
+
this.moveFab(trigger, originX + dx, originY + dy, "move");
|
|
3193
3399
|
}
|
|
3194
3400
|
});
|
|
3195
3401
|
const onPointerUp = (e) => {
|
|
@@ -3197,7 +3403,7 @@ var MushiWidget = class _MushiWidget {
|
|
|
3197
3403
|
dragging = false;
|
|
3198
3404
|
trigger.classList.remove("dragging");
|
|
3199
3405
|
if (moved) {
|
|
3200
|
-
this.moveFab(trigger, originX + e.clientX - startX, originY + e.clientY - startY,
|
|
3406
|
+
this.moveFab(trigger, originX + e.clientX - startX, originY + e.clientY - startY, "end");
|
|
3201
3407
|
const suppressClick = (ev) => {
|
|
3202
3408
|
ev.stopImmediatePropagation();
|
|
3203
3409
|
trigger.removeEventListener("click", suppressClick, { capture: true });
|
|
@@ -3268,6 +3474,7 @@ var MushiWidget = class _MushiWidget {
|
|
|
3268
3474
|
intent: this.intent,
|
|
3269
3475
|
showAllCategories: this.showAllCategories,
|
|
3270
3476
|
draftLength: (this.drafts.description ?? "").length,
|
|
3477
|
+
launcherDismissible: this.config.dismissible && this.triggerEl !== null,
|
|
3271
3478
|
canSend: this.canSend(),
|
|
3272
3479
|
submitting: this.submitting,
|
|
3273
3480
|
screenshotCapturing: this.screenshotCapturing,
|
|
@@ -3440,6 +3647,9 @@ var MushiWidget = class _MushiWidget {
|
|
|
3440
3647
|
case "brand-footer":
|
|
3441
3648
|
this.callbacks.onBrandFooterClick?.();
|
|
3442
3649
|
return;
|
|
3650
|
+
case "hide-launcher":
|
|
3651
|
+
this.dismissLauncherForSession();
|
|
3652
|
+
return;
|
|
3443
3653
|
case "toggle-more-nav":
|
|
3444
3654
|
this.showMoreNav = !this.showMoreNav;
|
|
3445
3655
|
this.render();
|
|
@@ -3984,10 +4194,13 @@ var MushiWidget = class _MushiWidget {
|
|
|
3984
4194
|
void this.loadReporterReports();
|
|
3985
4195
|
}
|
|
3986
4196
|
/* ── Marketing / Playwright recorder (debug GIF capture) ─────────── */
|
|
4197
|
+
// Hooks for `window.__mushiRecorder` (marketing-recorder.ts, `debug: true`
|
|
4198
|
+
// only). Tagged @internal: not supported public API, may change any release.
|
|
4199
|
+
/** @internal */
|
|
3987
4200
|
getRecorderStep() {
|
|
3988
4201
|
return this.step;
|
|
3989
4202
|
}
|
|
3990
|
-
/** QA / Playwright: report-screen IA without piercing the shadow root. */
|
|
4203
|
+
/** @internal QA / Playwright: report-screen IA without piercing the shadow root. */
|
|
3991
4204
|
getRecorderCategoryStepIA() {
|
|
3992
4205
|
return {
|
|
3993
4206
|
sectionLabel: this.shadow.querySelector("#mushi-title")?.textContent?.trim() ?? "",
|
|
@@ -3995,22 +4208,28 @@ var MushiWidget = class _MushiWidget {
|
|
|
3995
4208
|
footerStepIndicators: 0
|
|
3996
4209
|
};
|
|
3997
4210
|
}
|
|
4211
|
+
/** @internal */
|
|
3998
4212
|
getRecorderTrigger() {
|
|
3999
4213
|
return this.triggerEl;
|
|
4000
4214
|
}
|
|
4215
|
+
/** @internal */
|
|
4001
4216
|
getRecorderCategoryButton(category) {
|
|
4002
4217
|
return this.shadow.querySelector(`[data-category="${category}"]`);
|
|
4003
4218
|
}
|
|
4219
|
+
/** @internal */
|
|
4004
4220
|
getRecorderIntentButton(label) {
|
|
4005
4221
|
return Array.from(this.shadow.querySelectorAll("[data-intent]")).find((el) => el.dataset.intent === label) ?? null;
|
|
4006
4222
|
}
|
|
4223
|
+
/** @internal */
|
|
4007
4224
|
getRecorderSubmitButton() {
|
|
4008
4225
|
return this.shadow.querySelector('[data-action="submit"]');
|
|
4009
4226
|
}
|
|
4227
|
+
/** @internal */
|
|
4010
4228
|
recorderClickTrigger() {
|
|
4011
4229
|
if (this.isOpen) this.close();
|
|
4012
4230
|
this.open();
|
|
4013
4231
|
}
|
|
4232
|
+
/** @internal */
|
|
4014
4233
|
recorderSelectCategory(category) {
|
|
4015
4234
|
if (!this.isOpen) this.open();
|
|
4016
4235
|
this.step = "report";
|
|
@@ -4018,21 +4237,34 @@ var MushiWidget = class _MushiWidget {
|
|
|
4018
4237
|
this.intent = null;
|
|
4019
4238
|
this.render();
|
|
4020
4239
|
}
|
|
4240
|
+
/** @internal */
|
|
4021
4241
|
recorderSelectIntent(label) {
|
|
4022
4242
|
if (!this.isOpen || this.step !== "report") return;
|
|
4023
4243
|
this.intent = label;
|
|
4024
4244
|
this.render();
|
|
4025
4245
|
}
|
|
4246
|
+
/** @internal */
|
|
4026
4247
|
recorderFocusDescription() {
|
|
4027
4248
|
this.shadow.querySelector('[data-role="description"]')?.focus();
|
|
4028
4249
|
}
|
|
4250
|
+
/** @internal */
|
|
4029
4251
|
recorderSubmit() {
|
|
4030
4252
|
this.submitReport();
|
|
4031
4253
|
}
|
|
4254
|
+
/** @internal */
|
|
4032
4255
|
recorderOpenMyReports() {
|
|
4033
4256
|
void this.loadReporterReports();
|
|
4034
4257
|
}
|
|
4035
4258
|
};
|
|
4259
|
+
function isTextLabel(text) {
|
|
4260
|
+
return Array.from(text.trim()).length > 2;
|
|
4261
|
+
}
|
|
4262
|
+
function placesLauncher(config) {
|
|
4263
|
+
const { anchor, inset } = config;
|
|
4264
|
+
return Boolean(
|
|
4265
|
+
config.draggable || isTextLabel(config.triggerText ?? "") || anchor?.left !== void 0 || anchor?.right !== void 0 || inset?.left !== void 0 || inset?.right !== void 0
|
|
4266
|
+
);
|
|
4267
|
+
}
|
|
4036
4268
|
function focusKey(el) {
|
|
4037
4269
|
const d = el.dataset;
|
|
4038
4270
|
if (d.role) return `[data-role="${d.role}"]`;
|
|
@@ -4192,10 +4424,8 @@ function exposeMarketingRecorder(widget) {
|
|
|
4192
4424
|
}
|
|
4193
4425
|
|
|
4194
4426
|
// src/history-patch.ts
|
|
4195
|
-
var
|
|
4196
|
-
var
|
|
4197
|
-
var nativePushState = null;
|
|
4198
|
-
var nativeReplaceState = null;
|
|
4427
|
+
var prevPushState = null;
|
|
4428
|
+
var prevReplaceState = null;
|
|
4199
4429
|
var pushWrapper = null;
|
|
4200
4430
|
var replaceWrapper = null;
|
|
4201
4431
|
var popListener = null;
|
|
@@ -4227,24 +4457,24 @@ function notifyPop() {
|
|
|
4227
4457
|
}
|
|
4228
4458
|
function ensurePatch() {
|
|
4229
4459
|
if (patched || typeof window === "undefined") return;
|
|
4230
|
-
|
|
4231
|
-
|
|
4232
|
-
|
|
4233
|
-
|
|
4234
|
-
|
|
4235
|
-
const
|
|
4236
|
-
|
|
4237
|
-
notifyPush();
|
|
4460
|
+
const prevPush = history.pushState;
|
|
4461
|
+
const prevReplace = history.replaceState;
|
|
4462
|
+
prevPushState = prevPush;
|
|
4463
|
+
prevReplaceState = prevReplace;
|
|
4464
|
+
const push = function historyPatchPushState(...args) {
|
|
4465
|
+
const ret = prevPush.apply(history, args);
|
|
4466
|
+
if (pushWrapper === push) notifyPush();
|
|
4238
4467
|
return ret;
|
|
4239
4468
|
};
|
|
4240
|
-
|
|
4241
|
-
const
|
|
4242
|
-
|
|
4243
|
-
notifyReplace();
|
|
4469
|
+
const replace = function historyPatchReplaceState(...args) {
|
|
4470
|
+
const ret = prevReplace.apply(history, args);
|
|
4471
|
+
if (replaceWrapper === replace) notifyReplace();
|
|
4244
4472
|
return ret;
|
|
4245
4473
|
};
|
|
4246
|
-
|
|
4247
|
-
|
|
4474
|
+
pushWrapper = push;
|
|
4475
|
+
replaceWrapper = replace;
|
|
4476
|
+
history.pushState = push;
|
|
4477
|
+
history.replaceState = replace;
|
|
4248
4478
|
popListener = () => notifyPop();
|
|
4249
4479
|
window.addEventListener("popstate", popListener);
|
|
4250
4480
|
patched = true;
|
|
@@ -4255,22 +4485,22 @@ function uninstallPatch() {
|
|
|
4255
4485
|
window.removeEventListener("popstate", popListener);
|
|
4256
4486
|
popListener = null;
|
|
4257
4487
|
}
|
|
4258
|
-
if (pushWrapper && history.pushState === pushWrapper &&
|
|
4259
|
-
history.pushState =
|
|
4488
|
+
if (pushWrapper && history.pushState === pushWrapper && prevPushState) {
|
|
4489
|
+
history.pushState = prevPushState;
|
|
4260
4490
|
}
|
|
4261
|
-
if (replaceWrapper && history.replaceState === replaceWrapper &&
|
|
4262
|
-
history.replaceState =
|
|
4491
|
+
if (replaceWrapper && history.replaceState === replaceWrapper && prevReplaceState) {
|
|
4492
|
+
history.replaceState = prevReplaceState;
|
|
4263
4493
|
}
|
|
4264
4494
|
pushWrapper = null;
|
|
4265
4495
|
replaceWrapper = null;
|
|
4266
|
-
|
|
4267
|
-
|
|
4268
|
-
nativePushState = null;
|
|
4269
|
-
nativeReplaceState = null;
|
|
4496
|
+
prevPushState = null;
|
|
4497
|
+
prevReplaceState = null;
|
|
4270
4498
|
patched = false;
|
|
4271
4499
|
}
|
|
4272
4500
|
function subscribeHistory(sub) {
|
|
4273
4501
|
ensurePatch();
|
|
4502
|
+
if (!patched) return () => {
|
|
4503
|
+
};
|
|
4274
4504
|
subscribers.add(sub);
|
|
4275
4505
|
return () => {
|
|
4276
4506
|
subscribers.delete(sub);
|
|
@@ -4300,6 +4530,7 @@ var apiClient = null;
|
|
|
4300
4530
|
var optedIn = false;
|
|
4301
4531
|
var tierCache = null;
|
|
4302
4532
|
var tierCacheTime = 0;
|
|
4533
|
+
var tierCacheUserId = null;
|
|
4303
4534
|
var TIER_CACHE_TTL = 5 * 60 * 1e3;
|
|
4304
4535
|
var rewardsApiBackoffUntil = 0;
|
|
4305
4536
|
var REWARDS_4XX_BACKOFF_MS = 15 * 60 * 1e3;
|
|
@@ -4429,7 +4660,7 @@ async function flush(ctx) {
|
|
|
4429
4660
|
}
|
|
4430
4661
|
async function getTier(userId) {
|
|
4431
4662
|
const now = Date.now();
|
|
4432
|
-
if (tierCache && now - tierCacheTime < TIER_CACHE_TTL) return tierCache;
|
|
4663
|
+
if (tierCache && tierCacheUserId === userId && now - tierCacheTime < TIER_CACHE_TTL) return tierCache;
|
|
4433
4664
|
return fetchAndCacheTier(userId);
|
|
4434
4665
|
}
|
|
4435
4666
|
async function fetchAndCacheTier(userId) {
|
|
@@ -4438,6 +4669,7 @@ async function fetchAndCacheTier(userId) {
|
|
|
4438
4669
|
if (res.ok && res.data) {
|
|
4439
4670
|
tierCache = res.data;
|
|
4440
4671
|
tierCacheTime = Date.now();
|
|
4672
|
+
tierCacheUserId = userId;
|
|
4441
4673
|
return tierCache;
|
|
4442
4674
|
}
|
|
4443
4675
|
noteRewardsApiFailure(res.error?.code);
|
|
@@ -4481,6 +4713,7 @@ function teardown() {
|
|
|
4481
4713
|
apiClient = null;
|
|
4482
4714
|
optedIn = false;
|
|
4483
4715
|
tierCache = null;
|
|
4716
|
+
tierCacheUserId = null;
|
|
4484
4717
|
rewardsApiBackoffUntil = 0;
|
|
4485
4718
|
}
|
|
4486
4719
|
var routeObserver = null;
|
|
@@ -4496,6 +4729,14 @@ function installActivityListeners(projectId) {
|
|
|
4496
4729
|
removeActivityListeners();
|
|
4497
4730
|
}
|
|
4498
4731
|
listenersInstalled = true;
|
|
4732
|
+
try {
|
|
4733
|
+
attachActivityListeners(projectId);
|
|
4734
|
+
} catch (err) {
|
|
4735
|
+
removeActivityListeners();
|
|
4736
|
+
throw err;
|
|
4737
|
+
}
|
|
4738
|
+
}
|
|
4739
|
+
function attachActivityListeners(projectId) {
|
|
4499
4740
|
const emitRoute = () => {
|
|
4500
4741
|
const route = location.pathname;
|
|
4501
4742
|
if (route === lastRoute) return;
|
|
@@ -4834,6 +5075,10 @@ function createNetworkCapture(options = {}) {
|
|
|
4834
5075
|
const _prevXhrState = xhrStateMap.get(this);
|
|
4835
5076
|
if (_prevXhrState?._listener) {
|
|
4836
5077
|
this.removeEventListener("readystatechange", _prevXhrState._listener);
|
|
5078
|
+
if (_prevXhrState.correlationId) {
|
|
5079
|
+
const idx = _activeCorrelationStack.lastIndexOf(_prevXhrState.correlationId);
|
|
5080
|
+
if (idx !== -1) _activeCorrelationStack.splice(idx, 1);
|
|
5081
|
+
}
|
|
4837
5082
|
}
|
|
4838
5083
|
xhrStateMap.set(this, {
|
|
4839
5084
|
method: String(method).toUpperCase(),
|
|
@@ -4862,6 +5107,8 @@ function createNetworkCapture(options = {}) {
|
|
|
4862
5107
|
if (state.correlationId) _activeCorrelationStack.push(state.correlationId);
|
|
4863
5108
|
const _readystateHandler = () => {
|
|
4864
5109
|
if (this.readyState !== 4) return;
|
|
5110
|
+
this.removeEventListener("readystatechange", _readystateHandler);
|
|
5111
|
+
state._listener = void 0;
|
|
4865
5112
|
if (state.shouldRecord) {
|
|
4866
5113
|
const duration = Date.now() - state.startTime;
|
|
4867
5114
|
const entry = {
|
|
@@ -4887,7 +5134,19 @@ function createNetworkCapture(options = {}) {
|
|
|
4887
5134
|
state._listener = _readystateHandler;
|
|
4888
5135
|
this.addEventListener("readystatechange", _readystateHandler);
|
|
4889
5136
|
}
|
|
4890
|
-
|
|
5137
|
+
try {
|
|
5138
|
+
originalXhrSend.call(this, body);
|
|
5139
|
+
} catch (err) {
|
|
5140
|
+
if (state?.correlationId) {
|
|
5141
|
+
const idx = _activeCorrelationStack.lastIndexOf(state.correlationId);
|
|
5142
|
+
if (idx !== -1) _activeCorrelationStack.splice(idx, 1);
|
|
5143
|
+
}
|
|
5144
|
+
if (state?._listener) {
|
|
5145
|
+
this.removeEventListener("readystatechange", state._listener);
|
|
5146
|
+
state._listener = void 0;
|
|
5147
|
+
}
|
|
5148
|
+
throw err;
|
|
5149
|
+
}
|
|
4891
5150
|
};
|
|
4892
5151
|
}
|
|
4893
5152
|
const xhrOpenWrapper = OriginalXHR ? XMLHttpRequest.prototype.open : null;
|
|
@@ -5594,8 +5853,10 @@ function createTimelineCapture() {
|
|
|
5594
5853
|
onReplace: () => recordRoute("replaceState"),
|
|
5595
5854
|
onPop: () => recordRoute("popstate")
|
|
5596
5855
|
});
|
|
5597
|
-
window
|
|
5598
|
-
document
|
|
5856
|
+
const hasWindow = typeof window !== "undefined";
|
|
5857
|
+
const hasDocument = typeof document !== "undefined";
|
|
5858
|
+
if (hasWindow) window.addEventListener("hashchange", handleHashChange);
|
|
5859
|
+
if (hasDocument) document.addEventListener("click", handleClick, true);
|
|
5599
5860
|
return {
|
|
5600
5861
|
setScreen(screen) {
|
|
5601
5862
|
record({
|
|
@@ -5634,8 +5895,8 @@ function createTimelineCapture() {
|
|
|
5634
5895
|
},
|
|
5635
5896
|
destroy() {
|
|
5636
5897
|
unsubHistory();
|
|
5637
|
-
window.removeEventListener("hashchange", handleHashChange);
|
|
5638
|
-
document.removeEventListener("click", handleClick, true);
|
|
5898
|
+
if (hasWindow) window.removeEventListener("hashchange", handleHashChange);
|
|
5899
|
+
if (hasDocument) document.removeEventListener("click", handleClick, true);
|
|
5639
5900
|
}
|
|
5640
5901
|
};
|
|
5641
5902
|
}
|
|
@@ -6476,7 +6737,7 @@ function createProactiveManager(config = {}) {
|
|
|
6476
6737
|
|
|
6477
6738
|
// src/version.ts
|
|
6478
6739
|
var MUSHI_SDK_PACKAGE = "@mushi-mushi/web";
|
|
6479
|
-
var MUSHI_SDK_VERSION = "1.
|
|
6740
|
+
var MUSHI_SDK_VERSION = "1.33.0" ;
|
|
6480
6741
|
function resolveReportAppVersion(config, environment) {
|
|
6481
6742
|
if (config.appVersion) return config.appVersion;
|
|
6482
6743
|
const vercelId = config.integrations?.vercel?.analyticsId;
|
|
@@ -6487,7 +6748,7 @@ var instance = null;
|
|
|
6487
6748
|
var Mushi = class {
|
|
6488
6749
|
constructor() {
|
|
6489
6750
|
}
|
|
6490
|
-
static init(config) {
|
|
6751
|
+
static init(config = {}) {
|
|
6491
6752
|
if (instance) {
|
|
6492
6753
|
core.createLogger({ scope: "mushi", level: "warn", format: "pretty" }).warn("Already initialized \u2014 call destroy() first to reinitialize");
|
|
6493
6754
|
return instance;
|
|
@@ -6914,7 +7175,8 @@ function createInstance(config) {
|
|
|
6914
7175
|
screenshotCaptureInFlight = true;
|
|
6915
7176
|
try {
|
|
6916
7177
|
const result = await provider();
|
|
6917
|
-
if (result) return result;
|
|
7178
|
+
if (result?.startsWith("data:image/")) return result;
|
|
7179
|
+
if (result) log.warn("screenshotProvider must resolve to a data:image/ URL; ignoring", { prefix: result.slice(0, 16) });
|
|
6918
7180
|
} catch (err) {
|
|
6919
7181
|
log.warn("screenshotProvider threw, falling back to built-in capturer", {
|
|
6920
7182
|
error: err instanceof Error ? err.message : String(err)
|
|
@@ -6957,7 +7219,7 @@ function createInstance(config) {
|
|
|
6957
7219
|
widget = new MushiWidget(bootstrapConfig.widget, {
|
|
6958
7220
|
onSubmit: async ({ category, userCategory, description, intent }) => {
|
|
6959
7221
|
log.info("Report submitted", { category, userCategory, intent });
|
|
6960
|
-
proactiveManager?.recordSubmission();
|
|
7222
|
+
if (pendingProactiveTrigger) proactiveManager?.recordSubmission();
|
|
6961
7223
|
await autoCaptureScreenshot("submit");
|
|
6962
7224
|
const outcome = await submitReport(category, description, intent, userCategory);
|
|
6963
7225
|
return outcome ?? { reportId: null, queuedOffline: true };
|
|
@@ -7892,7 +8154,11 @@ function createInstance(config) {
|
|
|
7892
8154
|
breadcrumbs.add({ category: "lifecycle", level: "info", message: "Mushi.identifyWithToken() refreshed" });
|
|
7893
8155
|
return;
|
|
7894
8156
|
}
|
|
7895
|
-
|
|
8157
|
+
const sub = claims.sub;
|
|
8158
|
+
void core.sha256Hex(sub).then((hash) => {
|
|
8159
|
+
if (userInfo?.id === sub) core.updateSessionIdentity(hash);
|
|
8160
|
+
}).catch(() => {
|
|
8161
|
+
});
|
|
7896
8162
|
userInfo = {
|
|
7897
8163
|
id: claims.sub,
|
|
7898
8164
|
...claims.email ? { email: claims.email } : {},
|
|
@@ -7910,6 +8176,7 @@ function createInstance(config) {
|
|
|
7910
8176
|
} else {
|
|
7911
8177
|
userInfo = null;
|
|
7912
8178
|
lastIdentifySig = null;
|
|
8179
|
+
core.updateSessionIdentity(null);
|
|
7913
8180
|
widget.setIdentifiedUser(null);
|
|
7914
8181
|
breadcrumbs.add({ category: "lifecycle", level: "info", message: "Mushi.identifyWithToken(null)" });
|
|
7915
8182
|
}
|