makethisbetter 1.7.0 → 1.8.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.
@@ -1,9 +1,9 @@
1
- const yt = '*,*:before,*:after{box-sizing:border-box;margin:0;padding:0}:host{all:initial;font-family:Inter,-apple-system,BlinkMacSystemFont,sans-serif;font-size:14px;line-height:1.5;color:#191a1c;-webkit-font-smoothing:antialiased}:host([data-mtb-theme="dark"]) .mtb-popup,:host([data-mtb-theme="dark"]) .mtb-success{background:#151719;border-color:#ffffff1f;color:#f9fafb}:host([data-mtb-theme="dark"]) .mtb-popup-header{border-bottom-color:#ffffff1a}:host([data-mtb-theme="dark"]) .mtb-popup-title,:host([data-mtb-theme="dark"]) .mtb-success-title{color:#f9fafb}:host([data-mtb-theme="dark"]) .mtb-quick-option,:host([data-mtb-theme="dark"]) .mtb-textarea{background:#1f2327;border-color:#ffffff1f;color:#f9fafb}:host([data-mtb-theme="dark"]) .mtb-popup-close,:host([data-mtb-theme="dark"]) .mtb-success-msg,:host([data-mtb-theme="dark"]) .mtb-close-link{color:#ffffffad}@media (prefers-color-scheme: dark){:host([data-mtb-theme="auto"]) .mtb-popup,:host([data-mtb-theme="auto"]) .mtb-success{background:#151719;border-color:#ffffff1f;color:#f9fafb}:host([data-mtb-theme="auto"]) .mtb-popup-header{border-bottom-color:#ffffff1a}:host([data-mtb-theme="auto"]) .mtb-popup-title,:host([data-mtb-theme="auto"]) .mtb-success-title{color:#f9fafb}:host([data-mtb-theme="auto"]) .mtb-quick-option,:host([data-mtb-theme="auto"]) .mtb-textarea{background:#1f2327;border-color:#ffffff1f;color:#f9fafb}:host([data-mtb-theme="auto"]) .mtb-popup-close,:host([data-mtb-theme="auto"]) .mtb-success-msg,:host([data-mtb-theme="auto"]) .mtb-close-link{color:#ffffffad}}.mtb-tab{position:fixed;top:50%;right:0;transform:translateY(-50%);z-index:2147483646;display:flex;align-items:center;justify-content:center;width:32px;padding:14px 0;background:#059669;color:#fff;border-radius:8px 0 0 8px;cursor:pointer;box-shadow:-2px 0 14px #05966959;transition:background .15s,box-shadow .15s,width .15s;writing-mode:vertical-lr;text-orientation:mixed;font-size:12px;font-weight:600;letter-spacing:.04em;user-select:none;border:none;outline:none}.mtb-tab.left{right:auto;left:0;border-radius:0 8px 8px 0;box-shadow:2px 0 14px #05966959}.mtb-tab:hover{background:#047857;box-shadow:-3px 0 20px #05966973}.mtb-tab.active{background:#065f46}.mtb-toolbar{position:fixed;top:18px;left:50%;transform:translate(-50%);z-index:2147483647;display:flex;align-items:center;gap:11px;height:46px;padding:0 7px;border-radius:13px;background:linear-gradient(120deg,#10b981,#059669);box-shadow:0 10px 26px #0f172a38;animation:mtbBarIn .2s ease;white-space:nowrap}@keyframes mtbBarIn{0%{transform:translate(-50%,12px);opacity:0}to{transform:translate(-50%);opacity:1}}.mtb-toolbar-modes{display:flex;align-items:center;gap:3px;background:#ffffff29;border-radius:9px;padding:3px}.mtb-toolbar-mode-btn{display:inline-flex;align-items:center;gap:6px;height:30px;padding:0 12px;border-radius:7px;border:none;cursor:pointer;font-family:inherit;font-size:12px;font-weight:550;white-space:nowrap;background:transparent;color:#fffffff2;transition:all .12s}.mtb-toolbar-mode-btn.active{background:#fff;color:#047857}.mtb-toolbar-hint{font-size:12px;color:#fffffff2;white-space:nowrap}.mtb-toolbar-sep{width:1px;height:20px;background:#ffffff38}.mtb-exit-btn{display:inline-flex;align-items:center;gap:5px;height:30px;padding:0 12px;border-radius:8px;font-size:11.5px;font-weight:500;color:#fff;cursor:pointer;background:#ffffff29;border:none;font-family:inherit;transition:background .12s}.mtb-exit-btn:hover{background:#ffffff47}@media (max-width: 480px){.mtb-toolbar{max-width:calc(100vw - 16px);gap:6px}.mtb-toolbar-hint,.mtb-toolbar-sep{display:none}.mtb-toolbar-mode-btn,.mtb-exit-btn{padding-right:10px;padding-left:10px}}.mtb-overlay{position:fixed;inset:0;z-index:2147483640;cursor:crosshair}.mtb-dim{position:fixed;inset:0;z-index:2147483639;background:#00000014}.mtb-highlight{position:fixed;z-index:2147483641;pointer-events:none;border:2px solid #10b981;border-radius:6px;background:#10b9810f;transition:all .08s ease}.mtb-highlight-tooltip{position:fixed;z-index:2147483642;pointer-events:none;transform:translate(-50%,-100%);max-width:240px;overflow:hidden;text-overflow:ellipsis;background:#064e3b;color:#fff;padding:4px 10px;border-radius:6px;font-size:11px;font-weight:500;white-space:nowrap;box-shadow:0 4px 12px #0000002e;font-family:Inter,-apple-system,BlinkMacSystemFont,sans-serif}.mtb-highlight-tooltip.below{transform:translate(-50%)}.mtb-highlight-tooltip:after{content:"";position:absolute;top:100%;left:50%;transform:translate(-50%);border:4px solid transparent;border-top-color:#064e3b}.mtb-highlight-tooltip.below:after{top:auto;bottom:100%;border-top-color:transparent;border-bottom-color:#064e3b}.mtb-draw-svg{position:fixed;inset:0;z-index:2147483643;pointer-events:none;width:100%;height:100%;overflow:visible}.mtb-pin{position:fixed;z-index:2147483644;pointer-events:none;width:22px;height:22px;border-radius:50% 50% 50% 2px;background:#059669;border:2px solid #fff;display:flex;align-items:center;justify-content:center;font-size:10px;color:#fff;font-weight:700;box-shadow:0 2px 8px #05966973;animation:mtbPinPop .25s cubic-bezier(.34,1.56,.64,1);transform:translate(-50%,-50%)}@keyframes mtbPinPop{0%{transform:translate(-50%,-50%) scale(.4)}to{transform:translate(-50%,-50%) scale(1)}}.mtb-popup{position:fixed;z-index:2147483645;display:flex;flex-direction:column;width:320px;background:#fff;border:1px solid rgba(0,0,0,.1);border-radius:16px;box-shadow:0 24px 64px #0000003d;overflow:hidden;animation:mtbSlideUp .28s cubic-bezier(.34,1.56,.64,1);font-family:Inter,-apple-system,BlinkMacSystemFont,sans-serif}@keyframes mtbSlideUp{0%{transform:translateY(14px) scale(.97);opacity:0}to{transform:translateY(0) scale(1);opacity:1}}.mtb-popup-header{flex-shrink:0;padding:11px 13px 11px 14px;border-bottom:1px solid rgba(0,0,0,.06);display:flex;align-items:center;gap:8px}.mtb-popup-icon{width:20px;height:20px;border-radius:5px;background:#10b9811a;display:flex;align-items:center;justify-content:center;flex-shrink:0}.mtb-popup-title{flex:1;font-size:12.5px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#191a1c}.mtb-popup-close{background:none;border:none;cursor:pointer;padding:3px;color:#00000061;display:flex;align-items:center;border-radius:4px;transition:color .12s}.mtb-popup-close:hover{color:#000000b3}.mtb-popup-body{min-height:0;padding:13px;overflow-y:auto;overscroll-behavior:contain}.mtb-quick-options{display:flex;flex-direction:column;gap:6px;margin-bottom:12px}.mtb-quick-option{display:flex;align-items:center;gap:10px;width:100%;padding:10px 12px;border:1px solid rgba(0,0,0,.09);border-radius:10px;background:#fafafa;cursor:pointer;font-family:inherit;font-size:13px;color:#191a1c;text-align:left;transition:all .12s}.mtb-quick-option:hover{background:#10b9810f;border-color:#10b9814d}.mtb-quick-option-emoji{font-size:15px;flex-shrink:0;line-height:1}.mtb-textarea-wrap{position:relative}.mtb-textarea{width:100%;height:64px;padding:9px 11px;border:1px solid rgba(0,0,0,.12);border-radius:10px;font-family:inherit;font-size:12.5px;line-height:1.5;color:#191a1c;outline:none;background:#fff;resize:none;transition:border-color .12s,box-shadow .12s}.mtb-textarea:focus{border-color:#10b981;box-shadow:0 0 0 3px #10b98126}.mtb-textarea::placeholder{color:#00000057}.mtb-popup-error{margin-top:8px;color:#dc2626;font-size:11.5px}.mtb-popup-error:empty,.mtb-popup-error[hidden]{display:none}.mtb-popup-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:12px}.mtb-cancel-btn,.mtb-submit-btn{min-width:72px;height:32px;border:none;border-radius:8px;cursor:pointer;display:flex;align-items:center;justify-content:center;padding:0 12px;font-family:inherit;font-size:12.5px;font-weight:600;transition:background .12s}.mtb-cancel-btn{background:#f3f4f6;color:#000000ad}.mtb-cancel-btn:hover{background:#e5e7eb}.mtb-submit-btn{background:#d1d5db;color:#fff}.mtb-submit-btn.ready{background:#059669}.mtb-submit-btn.ready:hover{background:#047857}.mtb-submit-btn.loading{background:#059669;opacity:.7;cursor:wait}.mtb-submit-btn:disabled{cursor:not-allowed}.mtb-success{position:fixed;z-index:2147483645;width:332px;background:#fff;border:1px solid rgba(0,0,0,.1);border-radius:16px;box-shadow:0 24px 64px #0000003d;padding:24px 22px;text-align:center;animation:mtbSlideUp .35s cubic-bezier(.34,1.56,.64,1);font-family:Inter,-apple-system,BlinkMacSystemFont,sans-serif}.mtb-success-icon{width:46px;height:46px;border-radius:50%;background:#05966917;display:flex;align-items:center;justify-content:center;margin:0 auto 12px}.mtb-success-title{font-size:16px;font-weight:700;margin-bottom:5px;letter-spacing:-.01em;color:#191a1c}.mtb-success-msg{font-size:13px;color:#0000008c;margin-bottom:16px;line-height:1.6}.mtb-view-feedback-link{display:inline-flex;align-items:center;gap:5px;color:#047857;text-decoration:none;font-size:13px;font-weight:500;font-family:JetBrains Mono,monospace;background:none;border:none;cursor:pointer;transition:text-decoration .12s}.mtb-view-feedback-link:hover{text-decoration:underline}.mtb-close-link{margin-top:13px;background:none;border:none;cursor:pointer;font-size:12px;color:#0006;font-family:inherit;transition:color .12s}.mtb-close-link:hover{color:#000000b3}.mtb-email-capture{margin-bottom:14px;text-align:left}.mtb-email-prompt{font-size:12px;color:#0000008c;line-height:1.5;margin-bottom:8px}.mtb-email-row{display:flex;gap:6px}.mtb-email-input{flex:1;min-width:0;font-size:12.5px;font-family:inherit;padding:7px 10px;border:1px solid rgba(0,0,0,.14);border-radius:8px;outline:none}.mtb-email-input:focus{border-color:#059669}.mtb-email-input.mtb-email-invalid{border-color:#dc2626}.mtb-email-submit{font-size:12px;font-weight:600;font-family:inherit;color:#fff;background:#059669;border:none;border-radius:8px;padding:7px 12px;cursor:pointer;white-space:nowrap}.mtb-email-submit:disabled{opacity:.6;cursor:default}.mtb-email-error{font-size:11.5px;color:#dc2626;margin-top:6px}.mtb-email-saved{font-size:12px;color:#059669;line-height:1.5}.mtb-my-feedback{display:block;margin:8px auto 0;background:none;border:none;cursor:pointer;font-size:11.5px;font-family:inherit;color:#0006;text-decoration:underline;text-underline-offset:2px;transition:color .12s}.mtb-my-feedback:hover{color:#059669}.mtb-pet{position:fixed;bottom:20px;right:20px;z-index:2147483646;cursor:pointer;width:52px;height:52px;display:flex;align-items:center;justify-content:center;border-radius:50%;background:transparent;animation:mtbPetBounce 3s ease-in-out infinite;transition:transform .2s;user-select:none;outline:none;filter:drop-shadow(0 4px 12px rgba(5,150,105,.35))}.mtb-pet:hover{transform:scale(1.12);animation-play-state:paused}.mtb-pet:hover .mtb-pet-bubble{opacity:1;transform:translate(-50%) translateY(0);pointer-events:auto}.mtb-pet.active{animation:none;opacity:.6}.mtb-pet-svg{display:block}@keyframes mtbPetBounce{0%,to{transform:translateY(0)}50%{transform:translateY(-6px)}}.mtb-pet-bubble{position:absolute;bottom:100%;left:50%;transform:translate(-50%) translateY(4px);margin-bottom:8px;background:#064e3b;color:#fff;padding:6px 12px;border-radius:8px;font-size:12px;font-weight:500;white-space:nowrap;box-shadow:0 4px 14px #0000002e;opacity:0;pointer-events:none;transition:opacity .2s,transform .2s}.mtb-pet-bubble.visible{opacity:1;transform:translate(-50%) translateY(0);pointer-events:auto}.mtb-pet-bubble.hidden{opacity:0;pointer-events:none}.mtb-pet-bubble:after{content:"";position:absolute;top:100%;left:50%;transform:translate(-50%);border:5px solid transparent;border-top-color:#064e3b}.mtb-frustration-prompt{position:fixed;bottom:20px;right:20px;z-index:2147483645;display:flex;align-items:center;gap:10px;padding:12px 16px;background:#fff;border:1px solid rgba(0,0,0,.1);border-radius:12px;box-shadow:0 8px 30px #0000001f;animation:mtbSlideUp .35s cubic-bezier(.34,1.56,.64,1);font-family:Inter,-apple-system,BlinkMacSystemFont,sans-serif}:host([data-mtb-theme="dark"]) .mtb-frustration-prompt{background:#151719;border-color:#ffffff1f;color:#f9fafb}@media (prefers-color-scheme: dark){:host([data-mtb-theme="auto"]) .mtb-frustration-prompt{background:#151719;border-color:#ffffff1f;color:#f9fafb}}.mtb-frustration-icon{width:32px;height:32px;border-radius:50%;background:#eab3081a;display:flex;align-items:center;justify-content:center;flex-shrink:0;font-size:16px;line-height:1}.mtb-frustration-text{font-size:13px;font-weight:500;color:inherit;line-height:1.4}.mtb-frustration-actions{display:flex;gap:6px;flex-shrink:0}.mtb-frustration-tell{height:28px;padding:0 12px;border:none;border-radius:7px;background:#059669;color:#fff;cursor:pointer;font-family:inherit;font-size:12px;font-weight:600;transition:background .12s}.mtb-frustration-tell:hover{background:#047857}.mtb-frustration-dismiss{height:28px;padding:0 8px;border:none;border-radius:7px;background:transparent;color:#0006;cursor:pointer;font-family:inherit;font-size:12px;transition:color .12s}.mtb-frustration-dismiss:hover{color:#000000b3}:host([data-mtb-theme="dark"]) .mtb-frustration-dismiss{color:#fff6}:host([data-mtb-theme="dark"]) .mtb-frustration-dismiss:hover{color:#ffffffb3}@media (prefers-color-scheme: dark){:host([data-mtb-theme="auto"]) .mtb-frustration-dismiss{color:#fff6}:host([data-mtb-theme="auto"]) .mtb-frustration-dismiss:hover{color:#ffffffb3}}.mtb-record-bar{position:fixed;bottom:24px;left:50%;transform:translate(-50%);z-index:2147483647;display:flex;align-items:center;gap:12px;height:42px;padding:0 8px 0 14px;border-radius:12px;background:#0f172aeb;box-shadow:0 8px 24px #00000040;animation:mtbBarIn .2s ease}.mtb-record-dot{width:8px;height:8px;border-radius:50%;background:#ef4444;animation:mtbRecordPulse 1.2s ease-in-out infinite;flex-shrink:0}@keyframes mtbRecordPulse{0%,to{opacity:1}50%{opacity:.3}}.mtb-record-timer{font-family:JetBrains Mono,SF Mono,Fira Code,Cascadia Code,monospace;font-size:13px;font-weight:500;color:#fff;font-variant-numeric:tabular-nums;letter-spacing:.02em;min-width:38px}.mtb-record-stop{height:28px;padding:0 14px;border:none;border-radius:7px;background:#059669;color:#fff;cursor:pointer;font-family:inherit;font-size:12px;font-weight:600;transition:background .12s}.mtb-record-stop:hover{background:#047857}.mtb-click-ripple{position:fixed;z-index:2147483644;width:24px;height:24px;border-radius:50%;border:2px solid #10b981;background:#10b98133;pointer-events:none;transform:translate(-50%,-50%) scale(.5);animation:mtbClickRipple .3s ease-out forwards}@keyframes mtbClickRipple{0%{transform:translate(-50%,-50%) scale(.5);opacity:1}to{transform:translate(-50%,-50%) scale(2);opacity:0}}.mtb-dot{display:inline-block;width:4px;height:4px;border-radius:50%;background:#fff;animation:mtbDot 1.2s infinite}.mtb-dot:nth-child(2){animation-delay:.2s}.mtb-dot:nth-child(3){animation-delay:.4s}@keyframes mtbDot{0%,80%,to{opacity:.3;transform:translateY(0)}40%{opacity:1;transform:translateY(-3px)}}.mtb-clarify{position:fixed;z-index:2147483645;width:346px;background:#fff;border:1px solid rgba(0,0,0,.1);border-radius:16px;box-shadow:0 24px 64px #0000003d;display:flex;flex-direction:column;animation:mtbSlideUp .28s cubic-bezier(.34,1.56,.64,1);font-family:Inter,-apple-system,BlinkMacSystemFont,sans-serif;overflow:hidden}.mtb-clarify-header{padding:11px 13px 11px 14px;display:flex;align-items:center;gap:9px;border-bottom:1px solid rgba(0,0,0,.06)}.mtb-clarify-icon{width:24px;height:24px;border-radius:7px;background:linear-gradient(140deg,#10b981,#059669);box-shadow:0 1px 3px #05966966;display:flex;align-items:center;justify-content:center;flex-shrink:0}.mtb-clarify-titles{flex:1;min-width:0}.mtb-clarify-title{font-size:12.5px;font-weight:650;line-height:1.2;color:#191a1c}.mtb-clarify-subtitle{font-size:10px;color:#0000006b}.mtb-clarify-close{background:none;border:none;cursor:pointer;padding:3px;color:#00000061;display:flex;transition:color .12s}.mtb-clarify-close:hover{color:#000000b3}.mtb-clarify-messages{flex:1;max-height:250px;overflow-y:auto;padding:13px 13px 5px;display:flex;flex-direction:column;gap:9px}.mtb-clarify-bubble{max-width:82%;padding:9px 12px;font-size:12.5px;line-height:1.5;white-space:pre-wrap;word-break:break-word}.mtb-clarify-ai{align-self:flex-start;background:#fff;color:#191a1c;border:1px solid rgba(0,0,0,.09);border-radius:13px 13px 13px 4px}.mtb-clarify-user{align-self:flex-end;background:#059669;color:#fff;border:1px solid #059669;border-radius:13px 13px 4px}.mtb-clarify-thinking{display:flex;align-items:center;gap:4px;padding:11px 14px}.mtb-clarify-thinking .mtb-dot{width:6px;height:6px;background:#059669b3}.mtb-clarify-footer{padding:3px 13px 13px;display:flex;flex-direction:column}.mtb-clarify-input{width:100%;height:52px;padding:9px 11px;border:1px solid rgba(0,0,0,.12);border-radius:10px;font-family:inherit;font-size:13px;line-height:1.5;color:#191a1c;outline:none;background:#fafafa;resize:none;box-sizing:border-box;transition:border-color .12s,box-shadow .12s,background .12s}.mtb-clarify-input:focus{border-color:#10b981;box-shadow:0 0 0 3px #10b98126;background:#fff}.mtb-clarify-input::placeholder{color:#00000057}.mtb-clarify-actions{display:flex;gap:8px;margin-top:9px}.mtb-clarify-skip{flex:0 0 auto;height:34px;padding:0 14px;border:1px solid rgba(0,0,0,.12);border-radius:10px;background:#fff;cursor:pointer;font-family:inherit;font-size:12.5px;font-weight:550;color:#0000008c;white-space:nowrap;transition:background .12s}.mtb-clarify-skip:hover{background:#0000000a}.mtb-clarify-send{flex:1;height:34px;display:inline-flex;align-items:center;justify-content:center;gap:6px;border:none;border-radius:10px;background:#059669;color:#fff;cursor:pointer;font-family:inherit;font-size:12.5px;font-weight:600;transition:background .12s}.mtb-clarify-send:not(:disabled):hover{background:#047857}.mtb-clarify-send:disabled{background:#00000026;cursor:not-allowed}.mtb-clarify-error{margin-bottom:8px;color:#dc2626;font-size:11.5px;line-height:1.4;text-align:center}:host([data-mtb-theme="dark"]) .mtb-clarify{background:#151719;border-color:#ffffff1f;color:#f9fafb}:host([data-mtb-theme="dark"]) .mtb-clarify-header{border-bottom-color:#ffffff1a}:host([data-mtb-theme="dark"]) .mtb-clarify-title{color:#f9fafb}:host([data-mtb-theme="dark"]) .mtb-clarify-subtitle{color:#ffffff73}:host([data-mtb-theme="dark"]) .mtb-clarify-close{color:#ffffff73}:host([data-mtb-theme="dark"]) .mtb-clarify-close:hover{color:#ffffffbf}:host([data-mtb-theme="dark"]) .mtb-clarify-skip{background:#1f2327;border-color:#ffffff24;color:#ffffffb3}:host([data-mtb-theme="dark"]) .mtb-clarify-skip:hover{background:#ffffff0f}:host([data-mtb-theme="dark"]) .mtb-clarify-ai{background:#1f2327;border-color:#ffffff1f;color:#f9fafb}:host([data-mtb-theme="dark"]) .mtb-clarify-input{background:#1f2327;border-color:#ffffff1f;color:#f9fafb}@media (prefers-color-scheme: dark){:host([data-mtb-theme="auto"]) .mtb-clarify{background:#151719;border-color:#ffffff1f;color:#f9fafb}:host([data-mtb-theme="auto"]) .mtb-clarify-header{border-bottom-color:#ffffff1a}:host([data-mtb-theme="auto"]) .mtb-clarify-title{color:#f9fafb}:host([data-mtb-theme="auto"]) .mtb-clarify-subtitle{color:#ffffff73}:host([data-mtb-theme="auto"]) .mtb-clarify-close{color:#ffffff73}:host([data-mtb-theme="auto"]) .mtb-clarify-close:hover{color:#ffffffbf}:host([data-mtb-theme="auto"]) .mtb-clarify-skip{background:#1f2327;border-color:#ffffff24;color:#ffffffb3}:host([data-mtb-theme="auto"]) .mtb-clarify-skip:hover{background:#ffffff0f}:host([data-mtb-theme="auto"]) .mtb-clarify-ai{background:#1f2327;border-color:#ffffff1f;color:#f9fafb}:host([data-mtb-theme="auto"]) .mtb-clarify-input{background:#1f2327;border-color:#ffffff1f;color:#f9fafb}}.mtb-dim-clickable{z-index:2147483643;pointer-events:auto;cursor:default;background:#0000001f}.mtb-draw-bar{position:fixed;bottom:24px;left:50%;transform:translate(-50%);z-index:2147483647;display:flex;align-items:center;gap:8px;height:46px;padding:0 8px 0 12px;border-radius:13px;background:#fff;border:1px solid rgba(0,0,0,.08);box-shadow:0 10px 30px #0f172a38;animation:mtbBarIn .2s ease;font-family:Inter,-apple-system,BlinkMacSystemFont,sans-serif}.mtb-draw-input{width:220px;height:32px;padding:0 10px;border:1px solid rgba(0,0,0,.12);border-radius:8px;font-family:inherit;font-size:13px;color:#191a1c;outline:none;background:#fafafa;transition:border-color .12s,box-shadow .12s,background .12s}.mtb-draw-input:focus{border-color:#10b981;box-shadow:0 0 0 3px #10b98126;background:#fff}.mtb-draw-input::placeholder{color:#00000057}.mtb-draw-icon-btn{width:30px;height:30px;display:inline-flex;align-items:center;justify-content:center;border:none;border-radius:8px;background:transparent;color:#374151;cursor:pointer;transition:background .12s,color .12s}.mtb-draw-icon-btn:hover:not(:disabled){background:#0000000f}.mtb-draw-icon-btn:disabled{color:#00000038;cursor:default}.mtb-draw-sep{width:1px;height:22px;background:#0000001a}.mtb-draw-cancel{height:32px;padding:0 12px;border:1px solid rgba(0,0,0,.12);border-radius:8px;background:#fff;color:#0000008c;cursor:pointer;font-family:inherit;font-size:12.5px;font-weight:550;transition:background .12s}.mtb-draw-cancel:hover{background:#0000000a}.mtb-draw-submit{height:32px;padding:0 14px;border:none;border-radius:8px;background:#059669;color:#fff;cursor:pointer;font-family:inherit;font-size:12.5px;font-weight:600;transition:background .12s}.mtb-draw-submit:hover:not(:disabled){background:#047857}.mtb-draw-submit:disabled{opacity:.6;cursor:default}.mtb-draw-error{position:absolute;bottom:100%;left:12px;margin-bottom:6px;color:#dc2626;font-size:11.5px}.mtb-record-preview{margin-bottom:12px}.mtb-record-preview-stage{position:relative;width:100%;height:132px;border-radius:10px;overflow:hidden;background:#0f172a;display:flex;align-items:center;justify-content:center}.mtb-record-preview-stage.playing{align-items:flex-start;justify-content:flex-start}.mtb-record-preview-play{width:44px;height:44px;border-radius:50%;border:none;background:#ffffffeb;color:#059669;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;transition:transform .12s,background .12s}.mtb-record-preview-play:hover:not(:disabled){transform:scale(1.06);background:#fff}.mtb-record-preview-play:disabled{cursor:default;opacity:.6}.mtb-record-preview-badge{position:absolute;right:8px;bottom:8px;padding:2px 7px;border-radius:6px;background:#0009;color:#fff;font-size:11px;font-variant-numeric:tabular-nums;font-family:JetBrains Mono,SF Mono,monospace}.mtb-record-preview-fallback{color:#ffffffd9;font-size:12px}.mtb-record-preview-name{display:block;margin-top:5px;font-size:11px;color:#0000006b}.mtb-clarify-summary{align-self:stretch;border:1px solid rgba(5,150,105,.28);background:#0596690d;border-radius:12px;padding:11px 12px;display:flex;flex-direction:column;gap:9px}.mtb-summary-head{display:flex;align-items:center;gap:6px;color:#059669;font-size:12.5px;font-weight:650}.mtb-summary-section{display:flex;flex-direction:column;gap:3px}.mtb-summary-label{font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:.04em;color:#0006}.mtb-summary-quote{font-size:12.5px;color:#191a1c;line-height:1.45}.mtb-summary-qa{display:flex;flex-direction:column;gap:1px;font-size:12px;line-height:1.4}.mtb-summary-q{color:#00000080}.mtb-summary-a{color:#191a1c;font-weight:550}.mtb-summary-ctx{display:flex;justify-content:space-between;gap:10px;font-size:11.5px}.mtb-summary-ctx>span:first-child{color:#00000073}.mtb-summary-ctx>span:last-child{color:#191a1c;text-align:right;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:210px}.mtb-clarify-send-feedback{width:100%;height:36px;border:none;border-radius:10px;background:#059669;color:#fff;cursor:pointer;font-family:inherit;font-size:13px;font-weight:600;transition:background .12s}.mtb-clarify-send-feedback:hover{background:#047857}';
2
- class wt {
1
+ const gt = '*,*:before,*:after{box-sizing:border-box;margin:0;padding:0}:host{all:initial;font-family:Inter,-apple-system,BlinkMacSystemFont,sans-serif;font-size:14px;line-height:1.5;color:#191a1c;-webkit-font-smoothing:antialiased}:host([data-mtb-theme="dark"]) .mtb-popup,:host([data-mtb-theme="dark"]) .mtb-success{background:#151719;border-color:#ffffff1f;color:#f9fafb}:host([data-mtb-theme="dark"]) .mtb-popup-header{border-bottom-color:#ffffff1a}:host([data-mtb-theme="dark"]) .mtb-popup-title,:host([data-mtb-theme="dark"]) .mtb-success-title{color:#f9fafb}:host([data-mtb-theme="dark"]) .mtb-quick-option,:host([data-mtb-theme="dark"]) .mtb-textarea{background:#1f2327;border-color:#ffffff1f;color:#f9fafb}:host([data-mtb-theme="dark"]) .mtb-popup-close,:host([data-mtb-theme="dark"]) .mtb-success-msg,:host([data-mtb-theme="dark"]) .mtb-close-link{color:#ffffffad}@media (prefers-color-scheme: dark){:host([data-mtb-theme="auto"]) .mtb-popup,:host([data-mtb-theme="auto"]) .mtb-success{background:#151719;border-color:#ffffff1f;color:#f9fafb}:host([data-mtb-theme="auto"]) .mtb-popup-header{border-bottom-color:#ffffff1a}:host([data-mtb-theme="auto"]) .mtb-popup-title,:host([data-mtb-theme="auto"]) .mtb-success-title{color:#f9fafb}:host([data-mtb-theme="auto"]) .mtb-quick-option,:host([data-mtb-theme="auto"]) .mtb-textarea{background:#1f2327;border-color:#ffffff1f;color:#f9fafb}:host([data-mtb-theme="auto"]) .mtb-popup-close,:host([data-mtb-theme="auto"]) .mtb-success-msg,:host([data-mtb-theme="auto"]) .mtb-close-link{color:#ffffffad}}.mtb-tab{position:fixed;top:50%;right:0;transform:translateY(-50%);z-index:2147483646;display:flex;align-items:center;justify-content:center;width:32px;padding:14px 0;background:#059669;color:#fff;border-radius:8px 0 0 8px;cursor:pointer;box-shadow:-2px 0 14px #05966959;transition:background .15s,box-shadow .15s,width .15s;writing-mode:vertical-lr;text-orientation:mixed;font-size:12px;font-weight:600;letter-spacing:.04em;user-select:none;border:none;outline:none}.mtb-tab.left{right:auto;left:0;border-radius:0 8px 8px 0;box-shadow:2px 0 14px #05966959}.mtb-tab:hover{background:#047857;box-shadow:-3px 0 20px #05966973}.mtb-tab.active{background:#065f46}.mtb-toolbar{position:fixed;top:18px;left:50%;transform:translate(-50%);z-index:2147483647;display:flex;align-items:center;gap:11px;height:46px;padding:0 7px;border-radius:13px;background:linear-gradient(120deg,#10b981,#059669);box-shadow:0 10px 26px #0f172a38;animation:mtbBarIn .2s ease;white-space:nowrap}@keyframes mtbBarIn{0%{transform:translate(-50%,12px);opacity:0}to{transform:translate(-50%);opacity:1}}.mtb-toolbar-modes{display:flex;align-items:center;gap:3px;background:#ffffff29;border-radius:9px;padding:3px}.mtb-toolbar-mode-btn{display:inline-flex;align-items:center;gap:6px;height:30px;padding:0 12px;border-radius:7px;border:none;cursor:pointer;font-family:inherit;font-size:12px;font-weight:550;white-space:nowrap;background:transparent;color:#fffffff2;transition:all .12s}.mtb-toolbar-mode-btn.active{background:#fff;color:#047857}.mtb-toolbar-hint{font-size:12px;color:#fffffff2;white-space:nowrap}.mtb-toolbar-sep{width:1px;height:20px;background:#ffffff38}.mtb-exit-btn{display:inline-flex;align-items:center;gap:5px;height:30px;padding:0 12px;border-radius:8px;font-size:11.5px;font-weight:500;color:#fff;cursor:pointer;background:#ffffff29;border:none;font-family:inherit;transition:background .12s}.mtb-exit-btn:hover{background:#ffffff47}@media (max-width: 480px){.mtb-toolbar{max-width:calc(100vw - 16px);gap:6px}.mtb-toolbar-hint,.mtb-toolbar-sep{display:none}.mtb-toolbar-mode-btn,.mtb-exit-btn{padding-right:10px;padding-left:10px}}.mtb-overlay{position:fixed;inset:0;z-index:2147483640;cursor:crosshair}.mtb-dim{position:fixed;inset:0;z-index:2147483639;background:#00000014}.mtb-highlight{position:fixed;z-index:2147483641;pointer-events:none;border:2px solid #10b981;border-radius:6px;background:#10b9810f;transition:all .08s ease}.mtb-highlight-tooltip{position:fixed;z-index:2147483642;pointer-events:none;transform:translate(-50%,-100%);max-width:240px;overflow:hidden;text-overflow:ellipsis;background:#064e3b;color:#fff;padding:4px 10px;border-radius:6px;font-size:11px;font-weight:500;white-space:nowrap;box-shadow:0 4px 12px #0000002e;font-family:Inter,-apple-system,BlinkMacSystemFont,sans-serif}.mtb-highlight-tooltip.below{transform:translate(-50%)}.mtb-highlight-tooltip:after{content:"";position:absolute;top:100%;left:50%;transform:translate(-50%);border:4px solid transparent;border-top-color:#064e3b}.mtb-highlight-tooltip.below:after{top:auto;bottom:100%;border-top-color:transparent;border-bottom-color:#064e3b}.mtb-draw-svg{position:fixed;inset:0;z-index:2147483643;pointer-events:none;width:100%;height:100%;overflow:visible}.mtb-pin{position:fixed;z-index:2147483644;pointer-events:none;width:22px;height:22px;border-radius:50% 50% 50% 2px;background:#059669;border:2px solid #fff;display:flex;align-items:center;justify-content:center;font-size:10px;color:#fff;font-weight:700;box-shadow:0 2px 8px #05966973;animation:mtbPinPop .25s cubic-bezier(.34,1.56,.64,1);transform:translate(-50%,-50%)}@keyframes mtbPinPop{0%{transform:translate(-50%,-50%) scale(.4)}to{transform:translate(-50%,-50%) scale(1)}}.mtb-popup{position:fixed;z-index:2147483645;display:flex;flex-direction:column;width:320px;background:#fff;border:1px solid rgba(0,0,0,.1);border-radius:16px;box-shadow:0 24px 64px #0000003d;overflow:hidden;animation:mtbSlideUp .28s cubic-bezier(.34,1.56,.64,1);font-family:Inter,-apple-system,BlinkMacSystemFont,sans-serif}@keyframes mtbSlideUp{0%{transform:translateY(14px) scale(.97);opacity:0}to{transform:translateY(0) scale(1);opacity:1}}.mtb-popup-header{flex-shrink:0;padding:11px 13px 11px 14px;border-bottom:1px solid rgba(0,0,0,.06);display:flex;align-items:center;gap:8px}.mtb-popup-icon{width:20px;height:20px;border-radius:5px;background:#10b9811a;display:flex;align-items:center;justify-content:center;flex-shrink:0}.mtb-popup-title{flex:1;font-size:12.5px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#191a1c}.mtb-popup-close{background:none;border:none;cursor:pointer;padding:3px;color:#00000061;display:flex;align-items:center;border-radius:4px;transition:color .12s}.mtb-popup-close:hover{color:#000000b3}.mtb-popup-body{min-height:0;padding:13px;overflow-y:auto;overscroll-behavior:contain}.mtb-quick-options{display:flex;flex-direction:column;gap:6px;margin-bottom:12px}.mtb-quick-option{display:flex;align-items:center;gap:10px;width:100%;padding:10px 12px;border:1px solid rgba(0,0,0,.09);border-radius:10px;background:#fafafa;cursor:pointer;font-family:inherit;font-size:13px;color:#191a1c;text-align:left;transition:all .12s}.mtb-quick-option:hover{background:#10b9810f;border-color:#10b9814d}.mtb-quick-option-emoji{font-size:15px;flex-shrink:0;line-height:1}.mtb-textarea-wrap{position:relative}.mtb-textarea{width:100%;height:64px;padding:9px 11px;border:1px solid rgba(0,0,0,.12);border-radius:10px;font-family:inherit;font-size:12.5px;line-height:1.5;color:#191a1c;outline:none;background:#fff;resize:none;transition:border-color .12s,box-shadow .12s}.mtb-textarea:focus{border-color:#10b981;box-shadow:0 0 0 3px #10b98126}.mtb-textarea::placeholder{color:#00000057}.mtb-popup-error{margin-top:8px;color:#dc2626;font-size:11.5px}.mtb-popup-error:empty,.mtb-popup-error[hidden]{display:none}.mtb-popup-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:12px}.mtb-cancel-btn,.mtb-submit-btn{min-width:72px;height:32px;border:none;border-radius:8px;cursor:pointer;display:flex;align-items:center;justify-content:center;padding:0 12px;font-family:inherit;font-size:12.5px;font-weight:600;transition:background .12s}.mtb-cancel-btn{background:#f3f4f6;color:#000000ad}.mtb-cancel-btn:hover{background:#e5e7eb}.mtb-submit-btn{background:#d1d5db;color:#fff}.mtb-submit-btn.ready{background:#059669}.mtb-submit-btn.ready:hover{background:#047857}.mtb-submit-btn.loading{background:#059669;opacity:.7;cursor:wait}.mtb-submit-btn:disabled{cursor:not-allowed}.mtb-success{position:fixed;z-index:2147483645;width:332px;background:#fff;border:1px solid rgba(0,0,0,.1);border-radius:16px;box-shadow:0 24px 64px #0000003d;padding:24px 22px;text-align:center;animation:mtbSlideUp .35s cubic-bezier(.34,1.56,.64,1);font-family:Inter,-apple-system,BlinkMacSystemFont,sans-serif}.mtb-success-icon{width:46px;height:46px;border-radius:50%;background:#05966917;display:flex;align-items:center;justify-content:center;margin:0 auto 12px}.mtb-success-title{font-size:16px;font-weight:700;margin-bottom:5px;letter-spacing:-.01em;color:#191a1c}.mtb-success-msg{font-size:13px;color:#0000008c;margin-bottom:16px;line-height:1.6}.mtb-view-feedback-link{display:inline-flex;align-items:center;gap:5px;color:#047857;text-decoration:none;font-size:13px;font-weight:500;font-family:JetBrains Mono,monospace;background:none;border:none;cursor:pointer;transition:text-decoration .12s}.mtb-view-feedback-link:hover{text-decoration:underline}.mtb-close-link{margin-top:13px;background:none;border:none;cursor:pointer;font-size:12px;color:#0006;font-family:inherit;transition:color .12s}.mtb-close-link:hover{color:#000000b3}.mtb-email-capture{margin-bottom:14px;text-align:left}.mtb-email-prompt{font-size:12px;color:#0000008c;line-height:1.5;margin-bottom:8px}.mtb-email-row{display:flex;gap:6px}.mtb-email-input{flex:1;min-width:0;font-size:12.5px;font-family:inherit;padding:7px 10px;border:1px solid rgba(0,0,0,.14);border-radius:8px;outline:none}.mtb-email-input:focus{border-color:#059669}.mtb-email-input.mtb-email-invalid{border-color:#dc2626}.mtb-email-submit{font-size:12px;font-weight:600;font-family:inherit;color:#fff;background:#059669;border:none;border-radius:8px;padding:7px 12px;cursor:pointer;white-space:nowrap}.mtb-email-submit:disabled{opacity:.6;cursor:default}.mtb-email-error{font-size:11.5px;color:#dc2626;margin-top:6px}.mtb-email-saved{font-size:12px;color:#059669;line-height:1.5}.mtb-my-feedback{display:block;margin:8px auto 0;background:none;border:none;cursor:pointer;font-size:11.5px;font-family:inherit;color:#0006;text-decoration:underline;text-underline-offset:2px;transition:color .12s}.mtb-my-feedback:hover{color:#059669}.mtb-pet{position:fixed;bottom:20px;right:20px;z-index:2147483646;cursor:pointer;width:52px;height:52px;display:flex;align-items:center;justify-content:center;border-radius:50%;background:transparent;animation:mtbPetBounce 3s ease-in-out infinite;transition:transform .2s;user-select:none;outline:none;filter:drop-shadow(0 4px 12px rgba(5,150,105,.35))}.mtb-pet:hover{transform:scale(1.12);animation-play-state:paused}.mtb-pet:hover .mtb-pet-bubble{opacity:1;transform:translate(-50%) translateY(0);pointer-events:auto}.mtb-pet.active{animation:none;opacity:.6}.mtb-pet-svg{display:block}@keyframes mtbPetBounce{0%,to{transform:translateY(0)}50%{transform:translateY(-6px)}}.mtb-pet-bubble{position:absolute;bottom:100%;left:50%;transform:translate(-50%) translateY(4px);margin-bottom:8px;background:#064e3b;color:#fff;padding:6px 12px;border-radius:8px;font-size:12px;font-weight:500;white-space:nowrap;box-shadow:0 4px 14px #0000002e;opacity:0;pointer-events:none;transition:opacity .2s,transform .2s}.mtb-pet-bubble.visible{opacity:1;transform:translate(-50%) translateY(0);pointer-events:auto}.mtb-pet-bubble.hidden{opacity:0;pointer-events:none}.mtb-pet-bubble:after{content:"";position:absolute;top:100%;left:50%;transform:translate(-50%);border:5px solid transparent;border-top-color:#064e3b}.mtb-frustration-prompt{position:fixed;bottom:20px;right:20px;z-index:2147483645;display:flex;align-items:center;gap:10px;padding:12px 16px;background:#fff;border:1px solid rgba(0,0,0,.1);border-radius:12px;box-shadow:0 8px 30px #0000001f;animation:mtbSlideUp .35s cubic-bezier(.34,1.56,.64,1);font-family:Inter,-apple-system,BlinkMacSystemFont,sans-serif}:host([data-mtb-theme="dark"]) .mtb-frustration-prompt{background:#151719;border-color:#ffffff1f;color:#f9fafb}@media (prefers-color-scheme: dark){:host([data-mtb-theme="auto"]) .mtb-frustration-prompt{background:#151719;border-color:#ffffff1f;color:#f9fafb}}.mtb-frustration-icon{width:32px;height:32px;border-radius:50%;background:#eab3081a;display:flex;align-items:center;justify-content:center;flex-shrink:0;font-size:16px;line-height:1}.mtb-frustration-text{font-size:13px;font-weight:500;color:inherit;line-height:1.4}.mtb-frustration-actions{display:flex;gap:6px;flex-shrink:0}.mtb-frustration-tell{height:28px;padding:0 12px;border:none;border-radius:7px;background:#059669;color:#fff;cursor:pointer;font-family:inherit;font-size:12px;font-weight:600;transition:background .12s}.mtb-frustration-tell:hover{background:#047857}.mtb-frustration-dismiss{height:28px;padding:0 8px;border:none;border-radius:7px;background:transparent;color:#0006;cursor:pointer;font-family:inherit;font-size:12px;transition:color .12s}.mtb-frustration-dismiss:hover{color:#000000b3}:host([data-mtb-theme="dark"]) .mtb-frustration-dismiss{color:#fff6}:host([data-mtb-theme="dark"]) .mtb-frustration-dismiss:hover{color:#ffffffb3}@media (prefers-color-scheme: dark){:host([data-mtb-theme="auto"]) .mtb-frustration-dismiss{color:#fff6}:host([data-mtb-theme="auto"]) .mtb-frustration-dismiss:hover{color:#ffffffb3}}.mtb-record-bar{position:fixed;bottom:24px;left:50%;transform:translate(-50%);z-index:2147483647;display:flex;align-items:center;gap:12px;height:42px;padding:0 8px 0 14px;border-radius:12px;background:#0f172aeb;box-shadow:0 8px 24px #00000040;animation:mtbBarIn .2s ease}.mtb-record-dot{width:8px;height:8px;border-radius:50%;background:#ef4444;animation:mtbRecordPulse 1.2s ease-in-out infinite;flex-shrink:0}@keyframes mtbRecordPulse{0%,to{opacity:1}50%{opacity:.3}}.mtb-record-timer{font-family:JetBrains Mono,SF Mono,Fira Code,Cascadia Code,monospace;font-size:13px;font-weight:500;color:#fff;font-variant-numeric:tabular-nums;letter-spacing:.02em;min-width:38px}.mtb-record-stop{height:28px;padding:0 14px;border:none;border-radius:7px;background:#059669;color:#fff;cursor:pointer;font-family:inherit;font-size:12px;font-weight:600;transition:background .12s}.mtb-record-stop:hover{background:#047857}.mtb-click-ripple{position:fixed;z-index:2147483644;width:24px;height:24px;border-radius:50%;border:2px solid #10b981;background:#10b98133;pointer-events:none;transform:translate(-50%,-50%) scale(.5);animation:mtbClickRipple .3s ease-out forwards}@keyframes mtbClickRipple{0%{transform:translate(-50%,-50%) scale(.5);opacity:1}to{transform:translate(-50%,-50%) scale(2);opacity:0}}.mtb-dot{display:inline-block;width:4px;height:4px;border-radius:50%;background:#fff;animation:mtbDot 1.2s infinite}.mtb-dot:nth-child(2){animation-delay:.2s}.mtb-dot:nth-child(3){animation-delay:.4s}@keyframes mtbDot{0%,80%,to{opacity:.3;transform:translateY(0)}40%{opacity:1;transform:translateY(-3px)}}.mtb-clarify{position:fixed;z-index:2147483645;width:346px;background:#fff;border:1px solid rgba(0,0,0,.1);border-radius:16px;box-shadow:0 24px 64px #0000003d;display:flex;flex-direction:column;animation:mtbSlideUp .28s cubic-bezier(.34,1.56,.64,1);font-family:Inter,-apple-system,BlinkMacSystemFont,sans-serif;overflow:hidden}.mtb-clarify-header{padding:11px 13px 11px 14px;display:flex;align-items:center;gap:9px;border-bottom:1px solid rgba(0,0,0,.06)}.mtb-clarify-icon{width:24px;height:24px;border-radius:7px;background:linear-gradient(140deg,#10b981,#059669);box-shadow:0 1px 3px #05966966;display:flex;align-items:center;justify-content:center;flex-shrink:0}.mtb-clarify-titles{flex:1;min-width:0}.mtb-clarify-title{font-size:12.5px;font-weight:650;line-height:1.2;color:#191a1c}.mtb-clarify-subtitle{font-size:10px;color:#0000006b}.mtb-clarify-close{background:none;border:none;cursor:pointer;padding:3px;color:#00000061;display:flex;transition:color .12s}.mtb-clarify-close:hover{color:#000000b3}.mtb-clarify-messages{flex:1;max-height:250px;overflow-y:auto;padding:13px 13px 5px;display:flex;flex-direction:column;gap:9px}.mtb-clarify-bubble{max-width:82%;padding:9px 12px;font-size:12.5px;line-height:1.5;white-space:pre-wrap;word-break:break-word}.mtb-clarify-ai{align-self:flex-start;background:#fff;color:#191a1c;border:1px solid rgba(0,0,0,.09);border-radius:13px 13px 13px 4px}.mtb-clarify-user{align-self:flex-end;background:#059669;color:#fff;border:1px solid #059669;border-radius:13px 13px 4px}.mtb-clarify-thinking{display:flex;align-items:center;gap:4px;padding:11px 14px}.mtb-clarify-thinking .mtb-dot{width:6px;height:6px;background:#059669b3}.mtb-clarify-footer{padding:3px 13px 13px;display:flex;flex-direction:column}.mtb-clarify-input{width:100%;height:52px;padding:9px 11px;border:1px solid rgba(0,0,0,.12);border-radius:10px;font-family:inherit;font-size:13px;line-height:1.5;color:#191a1c;outline:none;background:#fafafa;resize:none;box-sizing:border-box;transition:border-color .12s,box-shadow .12s,background .12s}.mtb-clarify-input:focus{border-color:#10b981;box-shadow:0 0 0 3px #10b98126;background:#fff}.mtb-clarify-input::placeholder{color:#00000057}.mtb-clarify-actions{display:flex;gap:8px;margin-top:9px}.mtb-clarify-skip{flex:0 0 auto;height:34px;padding:0 14px;border:1px solid rgba(0,0,0,.12);border-radius:10px;background:#fff;cursor:pointer;font-family:inherit;font-size:12.5px;font-weight:550;color:#0000008c;white-space:nowrap;transition:background .12s}.mtb-clarify-skip:hover{background:#0000000a}.mtb-clarify-send{flex:1;height:34px;display:inline-flex;align-items:center;justify-content:center;gap:6px;border:none;border-radius:10px;background:#059669;color:#fff;cursor:pointer;font-family:inherit;font-size:12.5px;font-weight:600;transition:background .12s}.mtb-clarify-send:not(:disabled):hover{background:#047857}.mtb-clarify-send:disabled{background:#00000026;cursor:not-allowed}.mtb-clarify-error{margin-bottom:8px;color:#dc2626;font-size:11.5px;line-height:1.4;text-align:center}:host([data-mtb-theme="dark"]) .mtb-clarify{background:#151719;border-color:#ffffff1f;color:#f9fafb}:host([data-mtb-theme="dark"]) .mtb-clarify-header{border-bottom-color:#ffffff1a}:host([data-mtb-theme="dark"]) .mtb-clarify-title{color:#f9fafb}:host([data-mtb-theme="dark"]) .mtb-clarify-subtitle{color:#ffffff73}:host([data-mtb-theme="dark"]) .mtb-clarify-close{color:#ffffff73}:host([data-mtb-theme="dark"]) .mtb-clarify-close:hover{color:#ffffffbf}:host([data-mtb-theme="dark"]) .mtb-clarify-skip{background:#1f2327;border-color:#ffffff24;color:#ffffffb3}:host([data-mtb-theme="dark"]) .mtb-clarify-skip:hover{background:#ffffff0f}:host([data-mtb-theme="dark"]) .mtb-clarify-ai{background:#1f2327;border-color:#ffffff1f;color:#f9fafb}:host([data-mtb-theme="dark"]) .mtb-clarify-input{background:#1f2327;border-color:#ffffff1f;color:#f9fafb}@media (prefers-color-scheme: dark){:host([data-mtb-theme="auto"]) .mtb-clarify{background:#151719;border-color:#ffffff1f;color:#f9fafb}:host([data-mtb-theme="auto"]) .mtb-clarify-header{border-bottom-color:#ffffff1a}:host([data-mtb-theme="auto"]) .mtb-clarify-title{color:#f9fafb}:host([data-mtb-theme="auto"]) .mtb-clarify-subtitle{color:#ffffff73}:host([data-mtb-theme="auto"]) .mtb-clarify-close{color:#ffffff73}:host([data-mtb-theme="auto"]) .mtb-clarify-close:hover{color:#ffffffbf}:host([data-mtb-theme="auto"]) .mtb-clarify-skip{background:#1f2327;border-color:#ffffff24;color:#ffffffb3}:host([data-mtb-theme="auto"]) .mtb-clarify-skip:hover{background:#ffffff0f}:host([data-mtb-theme="auto"]) .mtb-clarify-ai{background:#1f2327;border-color:#ffffff1f;color:#f9fafb}:host([data-mtb-theme="auto"]) .mtb-clarify-input{background:#1f2327;border-color:#ffffff1f;color:#f9fafb}}.mtb-dim-clickable{z-index:2147483643;pointer-events:auto;cursor:default;background:#0000001f}.mtb-draw-bar{position:fixed;bottom:24px;left:50%;transform:translate(-50%);z-index:2147483647;display:flex;align-items:center;gap:8px;height:46px;padding:0 8px 0 12px;border-radius:13px;background:#fff;border:1px solid rgba(0,0,0,.08);box-shadow:0 10px 30px #0f172a38;animation:mtbBarIn .2s ease;font-family:Inter,-apple-system,BlinkMacSystemFont,sans-serif}.mtb-draw-input{width:220px;height:32px;padding:0 10px;border:1px solid rgba(0,0,0,.12);border-radius:8px;font-family:inherit;font-size:13px;color:#191a1c;outline:none;background:#fafafa;transition:border-color .12s,box-shadow .12s,background .12s}.mtb-draw-input:focus{border-color:#10b981;box-shadow:0 0 0 3px #10b98126;background:#fff}.mtb-draw-input::placeholder{color:#00000057}.mtb-draw-icon-btn{width:30px;height:30px;display:inline-flex;align-items:center;justify-content:center;border:none;border-radius:8px;background:transparent;color:#374151;cursor:pointer;transition:background .12s,color .12s}.mtb-draw-icon-btn:hover:not(:disabled){background:#0000000f}.mtb-draw-icon-btn:disabled{color:#00000038;cursor:default}.mtb-draw-sep{width:1px;height:22px;background:#0000001a}.mtb-draw-cancel{height:32px;padding:0 12px;border:1px solid rgba(0,0,0,.12);border-radius:8px;background:#fff;color:#0000008c;cursor:pointer;font-family:inherit;font-size:12.5px;font-weight:550;transition:background .12s}.mtb-draw-cancel:hover{background:#0000000a}.mtb-draw-submit{height:32px;padding:0 14px;border:none;border-radius:8px;background:#059669;color:#fff;cursor:pointer;font-family:inherit;font-size:12.5px;font-weight:600;transition:background .12s}.mtb-draw-submit:hover:not(:disabled){background:#047857}.mtb-draw-submit:disabled{opacity:.6;cursor:default}.mtb-draw-error{position:absolute;bottom:100%;left:12px;margin-bottom:6px;color:#dc2626;font-size:11.5px}.mtb-record-preview{margin-bottom:12px}.mtb-record-preview-stage{position:relative;width:100%;height:132px;border-radius:10px;overflow:hidden;background:#0f172a;display:flex;align-items:center;justify-content:center}.mtb-record-preview-stage.playing{align-items:flex-start;justify-content:flex-start}.mtb-record-preview-play{width:44px;height:44px;border-radius:50%;border:none;background:#ffffffeb;color:#059669;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;transition:transform .12s,background .12s}.mtb-record-preview-play:hover:not(:disabled){transform:scale(1.06);background:#fff}.mtb-record-preview-play:disabled{cursor:default;opacity:.6}.mtb-record-preview-badge{position:absolute;right:8px;bottom:8px;padding:2px 7px;border-radius:6px;background:#0009;color:#fff;font-size:11px;font-variant-numeric:tabular-nums;font-family:JetBrains Mono,SF Mono,monospace}.mtb-record-preview-fallback{color:#ffffffd9;font-size:12px}.mtb-record-preview-name{display:block;margin-top:5px;font-size:11px;color:#0000006b}';
2
+ class yt {
3
3
  constructor(t = "auto") {
4
4
  this.host = document.createElement("div"), this.host.id = "mtb-widget-host", this.host.style.cssText = "position:fixed;top:0;left:0;width:0;height:0;overflow:visible;z-index:2147483646;", this.host.setAttribute("data-mtb-theme", t), document.body.appendChild(this.host), this.root = this.host.attachShadow({ mode: "open" });
5
5
  const e = document.createElement("style");
6
- e.textContent = yt, this.root.appendChild(e);
6
+ e.textContent = gt, this.root.appendChild(e);
7
7
  }
8
8
  el(t, e) {
9
9
  const r = document.createElement(t);
@@ -20,7 +20,7 @@ class wt {
20
20
  this.host.remove();
21
21
  }
22
22
  }
23
- class xt {
23
+ class wt {
24
24
  constructor(t, e, r, s, n) {
25
25
  this.onClick = s, this.el = t.el("button", "mtb-tab"), r === "left" && this.el.classList.add("left"), this.idleLabel = n ?? e.tab, this.activeLabel = e.toolbar.exit, this.setLabel(this.idleLabel), this.el.addEventListener("click", s), t.append(this.el);
26
26
  }
@@ -34,8 +34,8 @@ class xt {
34
34
  this.el.removeEventListener("click", this.onClick), this.el.remove();
35
35
  }
36
36
  }
37
- const vt = 8e3;
38
- class kt {
37
+ const xt = 8e3;
38
+ class vt {
39
39
  constructor(t, e, r) {
40
40
  this.el = t.el("div", "mtb-frustration-prompt"), this.el.innerHTML = `
41
41
  <div class="mtb-frustration-icon">&#9888;&#65039;</div>
@@ -44,13 +44,13 @@ class kt {
44
44
  <button class="mtb-frustration-tell">${e.frustration.action}</button>
45
45
  <button class="mtb-frustration-dismiss">${e.frustration.dismiss}</button>
46
46
  </div>
47
- `, this.el.querySelector(".mtb-frustration-tell").addEventListener("click", r.onTell), this.el.querySelector(".mtb-frustration-dismiss").addEventListener("click", r.onDismiss), t.append(this.el), setTimeout(r.onDismiss, vt);
47
+ `, this.el.querySelector(".mtb-frustration-tell").addEventListener("click", r.onTell), this.el.querySelector(".mtb-frustration-dismiss").addEventListener("click", r.onDismiss), t.append(this.el), setTimeout(r.onDismiss, xt);
48
48
  }
49
49
  destroy() {
50
50
  this.el.remove();
51
51
  }
52
52
  }
53
- class St {
53
+ class kt {
54
54
  constructor(t, e) {
55
55
  this.onClick = e, this.el = t.el("div", "mtb-dim mtb-dim-clickable"), this.el.addEventListener("click", this.onClick), t.append(this.el);
56
56
  }
@@ -58,7 +58,7 @@ class St {
58
58
  this.el.removeEventListener("click", this.onClick), this.el.remove();
59
59
  }
60
60
  }
61
- class Et {
61
+ class St {
62
62
  constructor(t, e, r, s) {
63
63
  this.currentMode = "markup", this.messages = e, this.el = t.el("div", "mtb-toolbar"), this.el.innerHTML = this.buildHTML(e), t.append(this.el), this.hintEl = this.el.querySelector(".mtb-toolbar-hint"), this.markupBtn = this.el.querySelector(".mtb-toolbar-mode-markup"), this.recordBtn = this.el.querySelector(".mtb-toolbar-mode-record"), this.markupBtn.addEventListener("click", () => {
64
64
  this.setMode("markup"), s?.("markup");
@@ -95,7 +95,7 @@ class Et {
95
95
  this.el.remove();
96
96
  }
97
97
  }
98
- class Ct {
98
+ class Et {
99
99
  constructor(t, e) {
100
100
  this.onMouseDown = e.onMouseDown, this.onMouseMove = e.onMouseMove, this.onMouseUp = e.onMouseUp, this.onMouseLeave = e.onMouseLeave, this.overlayEl = t.el("div", "mtb-overlay"), this.overlayEl.addEventListener("mousedown", this.onMouseDown), this.overlayEl.addEventListener("mousemove", this.onMouseMove), this.overlayEl.addEventListener("mouseup", this.onMouseUp), this.overlayEl.addEventListener("mouseleave", this.onMouseLeave), t.append(this.overlayEl), this.dimEl = t.el("div", "mtb-dim"), t.append(this.dimEl);
101
101
  }
@@ -103,7 +103,7 @@ class Ct {
103
103
  this.overlayEl.removeEventListener("mousedown", this.onMouseDown), this.overlayEl.removeEventListener("mousemove", this.onMouseMove), this.overlayEl.removeEventListener("mouseup", this.onMouseUp), this.overlayEl.removeEventListener("mouseleave", this.onMouseLeave), this.overlayEl.remove(), this.dimEl.remove();
104
104
  }
105
105
  }
106
- class _t {
106
+ class Ct {
107
107
  constructor(t) {
108
108
  this.highlightEl = t.el("div", "mtb-highlight"), this.tooltipEl = t.el("div", "mtb-highlight-tooltip"), this.hide(), t.append(this.highlightEl, this.tooltipEl);
109
109
  }
@@ -112,7 +112,7 @@ class _t {
112
112
  this.highlightEl.style.top = `${e.top - 2}px`, this.highlightEl.style.left = `${e.left - 2}px`, this.highlightEl.style.width = `${e.width + 4}px`, this.highlightEl.style.height = `${e.height + 4}px`, this.highlightEl.style.display = "block", this.showTooltip(t, e);
113
113
  }
114
114
  showTooltip(t, e) {
115
- this.tooltipEl.textContent = H(t);
115
+ this.tooltipEl.textContent = I(t);
116
116
  const r = e.top < 30;
117
117
  this.tooltipEl.classList.toggle("below", r), this.tooltipEl.style.left = `${e.left + e.width / 2}px`, this.tooltipEl.style.top = r ? `${e.bottom + 8}px` : `${e.top - 8}px`, this.tooltipEl.style.display = "block";
118
118
  }
@@ -123,7 +123,7 @@ class _t {
123
123
  this.highlightEl.remove(), this.tooltipEl.remove();
124
124
  }
125
125
  }
126
- function H(i) {
126
+ function I(i) {
127
127
  if (i instanceof HTMLElement) {
128
128
  const t = i.getAttribute("aria-label");
129
129
  if (t) return t;
@@ -140,7 +140,7 @@ function H(i) {
140
140
  }
141
141
  return i.tagName.toLowerCase();
142
142
  }
143
- function st(i) {
143
+ function rt(i) {
144
144
  const t = [];
145
145
  let e = i;
146
146
  for (; e && e !== document.body && t.length < 5; ) {
@@ -165,7 +165,7 @@ function st(i) {
165
165
  }
166
166
  return t.join(" > ");
167
167
  }
168
- class Tt {
168
+ class _t {
169
169
  constructor(t) {
170
170
  this.pins = [], this.shadow = t;
171
171
  }
@@ -181,7 +181,7 @@ class Tt {
181
181
  this.clearAll();
182
182
  }
183
183
  }
184
- const M = "#059669", Mt = '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif', v = {
184
+ const M = "#059669", Tt = '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif', v = {
185
185
  color: M,
186
186
  width: "3.5",
187
187
  linecap: "round",
@@ -196,12 +196,12 @@ class Lt {
196
196
  this.isDrawing = !0, this.currentPoints = [[t, e]], this.currentPath = this.createPath(), this.svg.appendChild(this.currentPath);
197
197
  }
198
198
  continueDraw(t, e) {
199
- !this.isDrawing || !this.currentPath || (this.currentPoints.push([t, e]), this.currentPath.setAttribute("d", z(this.currentPoints)));
199
+ !this.isDrawing || !this.currentPath || (this.currentPoints.push([t, e]), this.currentPath.setAttribute("d", U(this.currentPoints)));
200
200
  }
201
201
  // Commits the in-progress stroke to the undo stack and clears the redo stack.
202
202
  // Callers decide whether the stroke has enough points before committing.
203
203
  commitStroke() {
204
- return !this.isDrawing || !this.currentPath ? !1 : (this.isDrawing = !1, this.committed.push({ path: this.currentPath, d: z(this.currentPoints), points: this.currentPoints }), this.redoStack = [], this.currentPath = null, this.currentPoints = [], !0);
204
+ return !this.isDrawing || !this.currentPath ? !1 : (this.isDrawing = !1, this.committed.push({ path: this.currentPath, d: U(this.currentPoints), points: this.currentPoints }), this.redoStack = [], this.currentPath = null, this.currentPoints = [], !0);
205
205
  }
206
206
  cancelCurrentDraw() {
207
207
  this.currentPath?.remove(), this.currentPath = null, this.isDrawing = !1, this.currentPoints = [];
@@ -227,7 +227,7 @@ class Lt {
227
227
  }
228
228
  getAnnotation() {
229
229
  if (this.committed.length === 0) return null;
230
- const t = this.committed.flatMap((s) => s.points), [e, r] = Pt(t);
230
+ const t = this.committed.flatMap((s) => s.points), [e, r] = Mt(t);
231
231
  return {
232
232
  type: "draw",
233
233
  x: e,
@@ -253,7 +253,7 @@ class Lt {
253
253
  return t.setAttribute("fill", "none"), t.setAttribute("stroke", v.color), t.setAttribute("stroke-width", v.width), t.setAttribute("stroke-linecap", v.linecap), t.setAttribute("stroke-linejoin", v.linejoin), t.setAttribute("style", `filter:${v.filter}`), t;
254
254
  }
255
255
  }
256
- function z(i) {
256
+ function U(i) {
257
257
  if (i.length === 0) return "";
258
258
  const [t, e] = i[0];
259
259
  let r = `M ${t} ${e}`;
@@ -263,14 +263,14 @@ function z(i) {
263
263
  }
264
264
  return r;
265
265
  }
266
- function Pt(i) {
266
+ function Mt(i) {
267
267
  const t = i.map((n) => n[0]), e = i.map((n) => n[1]), r = (Math.min(...t) + Math.max(...t)) / 2, s = (Math.min(...e) + Math.max(...e)) / 2;
268
268
  return [r, s];
269
269
  }
270
- const At = 5;
270
+ const Pt = 5;
271
271
  class Dt {
272
272
  constructor(t, e, r) {
273
- this.messages = e, this.handlers = r, this.pinCount = 0, this.interactionActive = !0, this.pendingHighlightFrame = null, this.lastMoveX = 0, this.lastMoveY = 0, this.highlighter = new _t(t), this.pinMarker = new Tt(t), this.drawLayer = new Lt(t), this.overlay = new Ct(t, {
273
+ this.messages = e, this.handlers = r, this.pinCount = 0, this.interactionActive = !0, this.pendingHighlightFrame = null, this.lastMoveX = 0, this.lastMoveY = 0, this.highlighter = new Ct(t), this.pinMarker = new _t(t), this.drawLayer = new Lt(t), this.overlay = new Et(t, {
274
274
  onMouseDown: (s) => this.handleMouseDown(s),
275
275
  onMouseMove: (s) => this.handleMouseMove(s),
276
276
  onMouseUp: (s) => this.handleMouseUp(s),
@@ -306,16 +306,16 @@ class Dt {
306
306
  // draw note bar; a tap on an element becomes a pin. Stray taps while a
307
307
  // drawing already exists are ignored so they don't hijack the draw flow.
308
308
  finishStroke(t) {
309
- if (this.drawLayer.getCurrentPointCount() >= At) {
309
+ if (this.drawLayer.getCurrentPointCount() >= Pt) {
310
310
  this.drawLayer.commitStroke(), this.highlighter.hide(), this.handlers.onDrawStroke();
311
311
  return;
312
312
  }
313
313
  if (this.drawLayer.cancelCurrentDraw(), this.drawLayer.hasStrokes() || !t) return;
314
- const e = O(t.clientX, t.clientY), r = e ? H(e) : this.messages.annotation.element, s = {
314
+ const e = O(t.clientX, t.clientY), r = e ? I(e) : this.messages.annotation.element, s = {
315
315
  type: "pin",
316
316
  x: t.clientX,
317
317
  y: t.clientY,
318
- targetSelector: e ? st(e) : void 0,
318
+ targetSelector: e ? rt(e) : void 0,
319
319
  targetText: e?.textContent?.trim().slice(0, 200) ?? "",
320
320
  targetName: r
321
321
  };
@@ -363,7 +363,7 @@ function S(i) {
363
363
  function d(i) {
364
364
  return i.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#039;");
365
365
  }
366
- class It {
366
+ class At {
367
367
  constructor(t, e) {
368
368
  this.loading = !1, this.onSubmit = e.onSubmit, this.submitLabel = e.messages.draw.submit, this.el = t.el("div", "mtb-draw-bar"), this.el.innerHTML = this.buildHTML(e.messages), t.append(this.el), this.input = this.el.querySelector(".mtb-draw-input"), this.undoBtn = this.el.querySelector(".mtb-draw-undo"), this.redoBtn = this.el.querySelector(".mtb-draw-redo"), this.submitBtn = this.el.querySelector(".mtb-draw-submit"), this.errorEl = this.el.querySelector(".mtb-draw-error"), this.undoBtn.addEventListener("click", e.onUndo), this.redoBtn.addEventListener("click", e.onRedo), this.el.querySelector(".mtb-draw-cancel").addEventListener("click", e.onCancel), this.submitBtn.addEventListener("click", () => this.submit()), this.input.addEventListener("keydown", (r) => {
369
369
  r.isComposing || r.keyCode === 229 || r.key === "Enter" && !r.shiftKey && (r.preventDefault(), this.submit());
@@ -443,9 +443,9 @@ class Ht {
443
443
  `;
444
444
  }
445
445
  positionPopup(t, e) {
446
- const n = window.innerWidth, o = window.innerHeight, a = 12;
446
+ const s = this.el.offsetHeight || 260, n = window.innerWidth, o = window.innerHeight, a = 12;
447
447
  let l = t + 12, c = e + 12;
448
- l + 320 > n - a && (l = t - 320 - 12), l < a && (l = a), c + 260 > o - a && (c = o - 260 - a), c < a && (c = a), this.el.style.left = `${l}px`, this.el.style.top = `${c}px`, this.el.style.maxHeight = `${o - c - a}px`;
448
+ l + 320 > n - a && (l = t - 320 - 12), l < a && (l = a), c + s > o - a && (c = o - s - a), c < a && (c = a), this.el.style.left = `${l}px`, this.el.style.top = `${c}px`, this.el.style.maxHeight = `${o - c - a}px`;
449
449
  }
450
450
  bindEvents(t) {
451
451
  this.el.querySelector(".mtb-popup-close").addEventListener("click", () => this.onClose()), this.el.querySelector(".mtb-cancel-btn").addEventListener("click", () => this.onClose()), this.errorEl = this.el.querySelector(".mtb-popup-error"), this.el.querySelectorAll(".mtb-quick-option").forEach((e) => {
@@ -475,21 +475,21 @@ class Ht {
475
475
  this.el.remove();
476
476
  }
477
477
  }
478
- const $t = 2e3, Bt = 45e3, P = 346, A = 320;
479
- class Ft {
478
+ const It = 2e3, $t = 45e3, Bt = 346, Ft = 320;
479
+ class Ut {
480
480
  constructor(t, e) {
481
- this.pollTimer = null, this.pollDeadline = 0, this.streamingBubble = null, this.lastMessages = [], this.done = !1, this.sending = !1, this.finalizing = !1, this.destroyed = !1, this.submissionSessionId = e.submissionSessionId, this.submissionToken = e.submissionToken, this.apiClient = e.apiClient, this.onFinalize = e.onFinalize, this.i18n = e.messages, this.summaryCtx = e.summary, this.el = t.el("div", "mtb-clarify"), this.el.innerHTML = this.buildHTML(e.messages), this.positionCard(e.x, e.y), t.append(this.el), this.messagesEl = this.el.querySelector(".mtb-clarify-messages"), this.inputEl = this.el.querySelector(".mtb-clarify-input"), this.sendBtn = this.el.querySelector(".mtb-clarify-send"), this.bindEvents(), this.startConversation();
481
+ this.pollTimer = null, this.pollDeadline = 0, this.streamingBubble = null, this.lastMessages = [], this.done = !1, this.sending = !1, this.finalizing = !1, this.destroyed = !1, this.submissionSessionId = e.submissionSessionId, this.submissionToken = e.submissionToken, this.apiClient = e.apiClient, this.onFinalize = e.onFinalize, this.i18n = e.messages, this.el = t.el("div", "mtb-clarify"), this.el.innerHTML = this.buildHTML(e.messages), t.append(this.el), this.positionCard(e.x, e.y), this.messagesEl = this.el.querySelector(".mtb-clarify-messages"), this.inputEl = this.el.querySelector(".mtb-clarify-input"), this.sendBtn = this.el.querySelector(".mtb-clarify-send"), this.bindEvents(), this.startConversation();
482
482
  }
483
483
  // Anchors the card near the annotation point, clamped to the viewport so it
484
484
  // never overflows a screen edge (mirrors CommentPopup.positionPopup).
485
485
  positionCard(t, e) {
486
- const r = window.innerWidth, s = window.innerHeight, n = 12;
486
+ const r = Bt, s = this.el.offsetHeight || Ft, n = window.innerWidth, o = window.innerHeight, a = 12;
487
487
  if (t === void 0 || e === void 0) {
488
- this.el.style.left = `${Math.max(n, (r - P) / 2)}px`, this.el.style.top = `${Math.max(n, (s - A) / 2)}px`;
488
+ this.el.style.left = `${Math.max(a, (n - r) / 2)}px`, this.el.style.top = `${Math.max(a, (o - s) / 2)}px`, this.el.style.maxHeight = `${o - 2 * a}px`;
489
489
  return;
490
490
  }
491
- let o = t + 12, a = e + 12;
492
- o + P > r - n && (o = t - P - 12), o < n && (o = n), a + A > s - n && (a = s - A - n), a < n && (a = n), this.el.style.left = `${o}px`, this.el.style.top = `${a}px`;
491
+ let l = t + 12, c = e + 12;
492
+ l + r > n - a && (l = t - r - 12), l < a && (l = a), c + s > o - a && (c = o - s - a), c < a && (c = a), this.el.style.left = `${l}px`, this.el.style.top = `${c}px`, this.el.style.maxHeight = `${o - c - a}px`;
493
493
  }
494
494
  buildHTML(t) {
495
495
  return `
@@ -603,7 +603,7 @@ class Ft {
603
603
  this.streamingBubble = null;
604
604
  }
605
605
  startPolling() {
606
- this.stopPolling(), this.pollDeadline = Date.now() + Bt, this.pollTimer = setInterval(() => this.poll(), $t);
606
+ this.stopPolling(), this.pollDeadline = Date.now() + $t, this.pollTimer = setInterval(() => this.poll(), It);
607
607
  }
608
608
  stopPolling() {
609
609
  this.pollTimer !== null && (clearInterval(this.pollTimer), this.pollTimer = null);
@@ -626,15 +626,10 @@ class Ft {
626
626
  }
627
627
  }
628
628
  handleDone() {
629
- this.done || (this.done = !0, this.stopPolling(), this.removeThinking(), this.renderSummary());
629
+ this.done || (this.done = !0, this.stopPolling(), this.removeThinking(), this.disableConversationInput(), this.finalize());
630
630
  }
631
- renderSummary() {
632
- const t = this.i18n.clarify.summary, e = document.createElement("div");
633
- e.className = "mtb-clarify-summary", e.innerHTML = this.buildSummaryHTML(t), this.messagesEl.appendChild(e), this.messagesEl.scrollTop = this.messagesEl.scrollHeight;
634
- const r = this.el.querySelector(".mtb-clarify-footer");
635
- r.innerHTML = `<button class="mtb-clarify-send-feedback" type="button">${d(t.send_feedback)}</button>`, r.querySelector(".mtb-clarify-send-feedback").addEventListener("click", () => {
636
- this.destroyed || this.finalize();
637
- });
631
+ disableConversationInput() {
632
+ this.inputEl.disabled = !0, this.sendBtn.disabled = !0;
638
633
  }
639
634
  async finalize() {
640
635
  if (!(this.finalizing || this.destroyed)) {
@@ -645,36 +640,15 @@ class Ft {
645
640
  await this.onFinalize();
646
641
  } catch {
647
642
  if (this.destroyed) return;
648
- this.finalizing = !1, this.handleDone(), this.el.querySelectorAll("button").forEach((t) => {
649
- t.disabled = !1;
650
- }), this.clearError(), this.showError();
643
+ this.finalizing = !1, this.clearError(), this.showError(), this.showRetryButton();
651
644
  }
652
645
  }
653
646
  }
654
- buildSummaryHTML(t) {
655
- const e = this.summaryCtx?.originalDescription?.trim(), r = e ? `<div class="mtb-summary-section">
656
- <div class="mtb-summary-label">${d(t.what_you_said)}</div>
657
- <div class="mtb-summary-quote">${d(e)}</div>
658
- </div>` : "", s = this.clarifiedPairs(), n = s.length ? `<div class="mtb-summary-section">
659
- <div class="mtb-summary-label">${d(t.clarified)}</div>
660
- ${s.map((o) => `<div class="mtb-summary-qa"><span class="mtb-summary-q">${d(o.q)}</span><span class="mtb-summary-a">${d(o.a)}</span></div>`).join("")}
661
- </div>` : "";
662
- return `
663
- <div class="mtb-summary-head">
664
- <svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"/></svg>
665
- <span>${d(t.ready)}</span>
666
- </div>
667
- ${r}
668
- ${n}
669
- `;
670
- }
671
- clarifiedPairs() {
672
- const t = [];
673
- for (let e = 0; e < this.lastMessages.length - 1; e++) {
674
- const r = this.lastMessages[e], s = this.lastMessages[e + 1];
675
- r.role !== "user" && s.role === "user" && t.push({ q: r.content, a: s.content });
676
- }
677
- return t;
647
+ showRetryButton() {
648
+ const t = this.el.querySelector(".mtb-clarify-footer");
649
+ t.innerHTML = `<button class="mtb-clarify-retry" type="button">${d(this.i18n.clarify.retry)}</button>`, t.querySelector(".mtb-clarify-retry").addEventListener("click", () => {
650
+ this.destroyed || this.finalize();
651
+ });
678
652
  }
679
653
  renderConversation(t, e) {
680
654
  this.lastMessages = t, this.renderMessages(t);
@@ -703,8 +677,8 @@ class Ft {
703
677
  this.destroyed = !0, this.stopPolling(), this.el.remove();
704
678
  }
705
679
  }
706
- const zt = 5e3, Ot = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
707
- class Ut {
680
+ const Ot = 5e3, zt = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
681
+ class jt {
708
682
  constructor(t, e, r, s, n) {
709
683
  this.messages = e, this.el = t.el("div", "mtb-success"), this.el.style.right = "20px", this.el.style.bottom = "20px";
710
684
  const o = n?.skipFollowup ? e.success.title_no_ai : e.success.title, a = n?.skipFollowup ? e.success.message_no_ai : e.success.message, l = s ? `<button class="mtb-view-feedback-link">${e.success.view_feedback} <svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12h14M12 5l7 7-7 7"/></svg></button>` : "", c = n?.emailCapture ? `
@@ -727,12 +701,12 @@ class Ut {
727
701
  ${c}
728
702
  ${l}
729
703
  <button class="mtb-close-link">${e.success.close}</button>
730
- `, t.append(this.el), this.el.querySelector(".mtb-close-link").addEventListener("click", r), s && this.el.querySelector(".mtb-view-feedback-link").addEventListener("click", s), n?.emailCapture ? this.bindEmailCapture(n.emailCapture.onSubmit) : setTimeout(() => r(), zt);
704
+ `, t.append(this.el), this.el.querySelector(".mtb-close-link").addEventListener("click", r), s && this.el.querySelector(".mtb-view-feedback-link").addEventListener("click", s), n?.emailCapture ? this.bindEmailCapture(n.emailCapture.onSubmit) : setTimeout(() => r(), Ot);
731
705
  }
732
706
  bindEmailCapture(t) {
733
707
  const e = this.el.querySelector(".mtb-email-input"), r = this.el.querySelector(".mtb-email-submit"), s = this.el.querySelector(".mtb-email-error"), n = async () => {
734
708
  const o = e.value.trim();
735
- if (!Ot.test(o)) {
709
+ if (!zt.test(o)) {
736
710
  e.classList.add("mtb-email-invalid");
737
711
  return;
738
712
  }
@@ -746,7 +720,7 @@ class Ut {
746
720
  this.el.remove();
747
721
  }
748
722
  }
749
- function jt(i, t) {
723
+ function qt(i, t) {
750
724
  if (i.match(/^[a-z]+:\/\//i))
751
725
  return i;
752
726
  if (i.match(/^\/\//))
@@ -756,7 +730,7 @@ function jt(i, t) {
756
730
  const e = document.implementation.createHTMLDocument(), r = e.createElement("base"), s = e.createElement("a");
757
731
  return e.head.appendChild(r), e.body.appendChild(s), t && (r.href = t), s.href = i, s.href;
758
732
  }
759
- const qt = /* @__PURE__ */ (() => {
733
+ const Nt = /* @__PURE__ */ (() => {
760
734
  let i = 0;
761
735
  const t = () => (
762
736
  // eslint-disable-next-line no-bitwise
@@ -764,33 +738,33 @@ const qt = /* @__PURE__ */ (() => {
764
738
  );
765
739
  return () => (i += 1, `u${t()}${i}`);
766
740
  })();
767
- function f(i) {
741
+ function b(i) {
768
742
  const t = [];
769
743
  for (let e = 0, r = i.length; e < r; e++)
770
744
  t.push(i[e]);
771
745
  return t;
772
746
  }
773
747
  let g = null;
774
- function nt(i = {}) {
775
- return g || (i.includeStyleProperties ? (g = i.includeStyleProperties, g) : (g = f(window.getComputedStyle(document.documentElement)), g));
748
+ function st(i = {}) {
749
+ return g || (i.includeStyleProperties ? (g = i.includeStyleProperties, g) : (g = b(window.getComputedStyle(document.documentElement)), g));
776
750
  }
777
751
  function _(i, t) {
778
752
  const r = (i.ownerDocument.defaultView || window).getComputedStyle(i).getPropertyValue(t);
779
753
  return r ? parseFloat(r.replace("px", "")) : 0;
780
754
  }
781
- function Nt(i) {
755
+ function Wt(i) {
782
756
  const t = _(i, "border-left-width"), e = _(i, "border-right-width");
783
757
  return i.clientWidth + t + e;
784
758
  }
785
- function Wt(i) {
759
+ function Vt(i) {
786
760
  const t = _(i, "border-top-width"), e = _(i, "border-bottom-width");
787
761
  return i.clientHeight + t + e;
788
762
  }
789
- function ot(i, t = {}) {
790
- const e = t.width || Nt(i), r = t.height || Wt(i);
763
+ function nt(i, t = {}) {
764
+ const e = t.width || Wt(i), r = t.height || Vt(i);
791
765
  return { width: e, height: r };
792
766
  }
793
- function Vt() {
767
+ function Yt() {
794
768
  let i, t;
795
769
  try {
796
770
  t = process;
@@ -800,7 +774,7 @@ function Vt() {
800
774
  return e && (i = parseInt(e, 10), Number.isNaN(i) && (i = 1)), i || window.devicePixelRatio || 1;
801
775
  }
802
776
  const m = 16384;
803
- function Yt(i) {
777
+ function Kt(i) {
804
778
  (i.width > m || i.height > m) && (i.width > m && i.height > m ? i.width > i.height ? (i.height *= m / i.width, i.width = m) : (i.width *= m / i.height, i.height = m) : i.width > m ? (i.height *= m / i.width, i.width = m) : (i.width *= m / i.height, i.height = m));
805
779
  }
806
780
  function T(i) {
@@ -813,50 +787,50 @@ function T(i) {
813
787
  }, r.onerror = e, r.crossOrigin = "anonymous", r.decoding = "async", r.src = i;
814
788
  });
815
789
  }
816
- async function Kt(i) {
790
+ async function Xt(i) {
817
791
  return Promise.resolve().then(() => new XMLSerializer().serializeToString(i)).then(encodeURIComponent).then((t) => `data:image/svg+xml;charset=utf-8,${t}`);
818
792
  }
819
- async function Xt(i, t, e) {
793
+ async function Gt(i, t, e) {
820
794
  const r = "http://www.w3.org/2000/svg", s = document.createElementNS(r, "svg"), n = document.createElementNS(r, "foreignObject");
821
- return s.setAttribute("width", `${t}`), s.setAttribute("height", `${e}`), s.setAttribute("viewBox", `0 0 ${t} ${e}`), n.setAttribute("width", "100%"), n.setAttribute("height", "100%"), n.setAttribute("x", "0"), n.setAttribute("y", "0"), n.setAttribute("externalResourcesRequired", "true"), s.appendChild(n), n.appendChild(i), Kt(s);
795
+ return s.setAttribute("width", `${t}`), s.setAttribute("height", `${e}`), s.setAttribute("viewBox", `0 0 ${t} ${e}`), n.setAttribute("width", "100%"), n.setAttribute("height", "100%"), n.setAttribute("x", "0"), n.setAttribute("y", "0"), n.setAttribute("externalResourcesRequired", "true"), s.appendChild(n), n.appendChild(i), Xt(s);
822
796
  }
823
- const u = (i, t) => {
797
+ const h = (i, t) => {
824
798
  if (i instanceof t)
825
799
  return !0;
826
800
  const e = Object.getPrototypeOf(i);
827
- return e === null ? !1 : e.constructor.name === t.name || u(e, t);
801
+ return e === null ? !1 : e.constructor.name === t.name || h(e, t);
828
802
  };
829
- function Gt(i) {
803
+ function Jt(i) {
830
804
  const t = i.getPropertyValue("content");
831
805
  return `${i.cssText} content: '${t.replace(/'|"/g, "")}';`;
832
806
  }
833
- function Jt(i, t) {
834
- return nt(t).map((e) => {
807
+ function Qt(i, t) {
808
+ return st(t).map((e) => {
835
809
  const r = i.getPropertyValue(e), s = i.getPropertyPriority(e);
836
810
  return `${e}: ${r}${s ? " !important" : ""};`;
837
811
  }).join(" ");
838
812
  }
839
- function Qt(i, t, e, r) {
840
- const s = `.${i}:${t}`, n = e.cssText ? Gt(e) : Jt(e, r);
813
+ function Zt(i, t, e, r) {
814
+ const s = `.${i}:${t}`, n = e.cssText ? Jt(e) : Qt(e, r);
841
815
  return document.createTextNode(`${s}{${n}}`);
842
816
  }
843
- function U(i, t, e, r) {
817
+ function z(i, t, e, r) {
844
818
  const s = window.getComputedStyle(i, e), n = s.getPropertyValue("content");
845
819
  if (n === "" || n === "none")
846
820
  return;
847
- const o = qt();
821
+ const o = Nt();
848
822
  try {
849
823
  t.className = `${t.className} ${o}`;
850
824
  } catch {
851
825
  return;
852
826
  }
853
827
  const a = document.createElement("style");
854
- a.appendChild(Qt(o, e, s, r)), t.appendChild(a);
828
+ a.appendChild(Zt(o, e, s, r)), t.appendChild(a);
855
829
  }
856
- function Zt(i, t, e) {
857
- U(i, t, ":before", e), U(i, t, ":after", e);
830
+ function te(i, t, e) {
831
+ z(i, t, ":before", e), z(i, t, ":after", e);
858
832
  }
859
- const j = "application/font-woff", q = "image/jpeg", te = {
833
+ const j = "application/font-woff", q = "image/jpeg", ee = {
860
834
  woff: j,
861
835
  woff2: j,
862
836
  ttf: "application/font-truetype",
@@ -869,24 +843,24 @@ const j = "application/font-woff", q = "image/jpeg", te = {
869
843
  svg: "image/svg+xml",
870
844
  webp: "image/webp"
871
845
  };
872
- function ee(i) {
846
+ function ie(i) {
873
847
  const t = /\.([^./]*?)$/g.exec(i);
874
848
  return t ? t[1] : "";
875
849
  }
876
850
  function $(i) {
877
- const t = ee(i).toLowerCase();
878
- return te[t] || "";
851
+ const t = ie(i).toLowerCase();
852
+ return ee[t] || "";
879
853
  }
880
- function ie(i) {
854
+ function re(i) {
881
855
  return i.split(/,/)[1];
882
856
  }
883
857
  function R(i) {
884
858
  return i.search(/^(data:)/) !== -1;
885
859
  }
886
- function re(i, t) {
860
+ function se(i, t) {
887
861
  return `data:${t};base64,${i}`;
888
862
  }
889
- async function at(i, t, e) {
863
+ async function ot(i, t, e) {
890
864
  const r = await fetch(i, t);
891
865
  if (r.status === 404)
892
866
  throw new Error(`Resource "${r.url}" not found`);
@@ -903,19 +877,19 @@ async function at(i, t, e) {
903
877
  });
904
878
  }
905
879
  const D = {};
906
- function se(i, t, e) {
880
+ function ne(i, t, e) {
907
881
  let r = i.replace(/\?.*/, "");
908
882
  return e && (r = i), /ttf|otf|eot|woff2?/i.test(r) && (r = r.replace(/.*\//, "")), t ? `[${t}]${r}` : r;
909
883
  }
910
884
  async function B(i, t, e) {
911
- const r = se(i, t, e.includeQueryParams);
885
+ const r = ne(i, t, e.includeQueryParams);
912
886
  if (D[r] != null)
913
887
  return D[r];
914
888
  e.cacheBust && (i += (/\?/.test(i) ? "&" : "?") + (/* @__PURE__ */ new Date()).getTime());
915
889
  let s;
916
890
  try {
917
- const n = await at(i, e.fetchRequestInit, ({ res: o, result: a }) => (t || (t = o.headers.get("Content-Type") || ""), ie(a)));
918
- s = re(n, t);
891
+ const n = await ot(i, e.fetchRequestInit, ({ res: o, result: a }) => (t || (t = o.headers.get("Content-Type") || ""), re(a)));
892
+ s = se(n, t);
919
893
  } catch (n) {
920
894
  s = e.imagePlaceholder || "";
921
895
  let o = `Failed to fetch resource: ${i}`;
@@ -923,11 +897,11 @@ async function B(i, t, e) {
923
897
  }
924
898
  return D[r] = s, s;
925
899
  }
926
- async function ne(i) {
900
+ async function oe(i) {
927
901
  const t = i.toDataURL();
928
902
  return t === "data:," ? i.cloneNode(!1) : T(t);
929
903
  }
930
- async function oe(i, t) {
904
+ async function ae(i, t) {
931
905
  if (i.currentSrc) {
932
906
  const n = document.createElement("canvas"), o = n.getContext("2d");
933
907
  n.width = i.clientWidth, n.height = i.clientHeight, o?.drawImage(i, 0, 0, n.width, n.height);
@@ -937,51 +911,51 @@ async function oe(i, t) {
937
911
  const e = i.poster, r = $(e), s = await B(e, r, t);
938
912
  return T(s);
939
913
  }
940
- async function ae(i, t) {
914
+ async function le(i, t) {
941
915
  var e;
942
916
  try {
943
917
  if (!((e = i?.contentDocument) === null || e === void 0) && e.body)
944
- return await L(i.contentDocument.body, t, !0);
918
+ return await P(i.contentDocument.body, t, !0);
945
919
  } catch {
946
920
  }
947
921
  return i.cloneNode(!1);
948
922
  }
949
- async function le(i, t) {
950
- return u(i, HTMLCanvasElement) ? ne(i) : u(i, HTMLVideoElement) ? oe(i, t) : u(i, HTMLIFrameElement) ? ae(i, t) : i.cloneNode(lt(i));
923
+ async function ce(i, t) {
924
+ return h(i, HTMLCanvasElement) ? oe(i) : h(i, HTMLVideoElement) ? ae(i, t) : h(i, HTMLIFrameElement) ? le(i, t) : i.cloneNode(at(i));
951
925
  }
952
- const ce = (i) => i.tagName != null && i.tagName.toUpperCase() === "SLOT", lt = (i) => i.tagName != null && i.tagName.toUpperCase() === "SVG";
953
- async function de(i, t, e) {
926
+ const de = (i) => i.tagName != null && i.tagName.toUpperCase() === "SLOT", at = (i) => i.tagName != null && i.tagName.toUpperCase() === "SVG";
927
+ async function he(i, t, e) {
954
928
  var r, s;
955
- if (lt(t))
929
+ if (at(t))
956
930
  return t;
957
931
  let n = [];
958
- return ce(i) && i.assignedNodes ? n = f(i.assignedNodes()) : u(i, HTMLIFrameElement) && (!((r = i.contentDocument) === null || r === void 0) && r.body) ? n = f(i.contentDocument.body.childNodes) : n = f(((s = i.shadowRoot) !== null && s !== void 0 ? s : i).childNodes), n.length === 0 || u(i, HTMLVideoElement) || await n.reduce((o, a) => o.then(() => L(a, e)).then((l) => {
932
+ return de(i) && i.assignedNodes ? n = b(i.assignedNodes()) : h(i, HTMLIFrameElement) && (!((r = i.contentDocument) === null || r === void 0) && r.body) ? n = b(i.contentDocument.body.childNodes) : n = b(((s = i.shadowRoot) !== null && s !== void 0 ? s : i).childNodes), n.length === 0 || h(i, HTMLVideoElement) || await n.reduce((o, a) => o.then(() => P(a, e)).then((l) => {
959
933
  l && t.appendChild(l);
960
934
  }), Promise.resolve()), t;
961
935
  }
962
- function he(i, t, e) {
936
+ function ue(i, t, e) {
963
937
  const r = t.style;
964
938
  if (!r)
965
939
  return;
966
940
  const s = window.getComputedStyle(i);
967
- s.cssText ? (r.cssText = s.cssText, r.transformOrigin = s.transformOrigin) : nt(e).forEach((n) => {
941
+ s.cssText ? (r.cssText = s.cssText, r.transformOrigin = s.transformOrigin) : st(e).forEach((n) => {
968
942
  let o = s.getPropertyValue(n);
969
- n === "font-size" && o.endsWith("px") && (o = `${Math.floor(parseFloat(o.substring(0, o.length - 2))) - 0.1}px`), u(i, HTMLIFrameElement) && n === "display" && o === "inline" && (o = "block"), n === "d" && t.getAttribute("d") && (o = `path(${t.getAttribute("d")})`), r.setProperty(n, o, s.getPropertyPriority(n));
943
+ n === "font-size" && o.endsWith("px") && (o = `${Math.floor(parseFloat(o.substring(0, o.length - 2))) - 0.1}px`), h(i, HTMLIFrameElement) && n === "display" && o === "inline" && (o = "block"), n === "d" && t.getAttribute("d") && (o = `path(${t.getAttribute("d")})`), r.setProperty(n, o, s.getPropertyPriority(n));
970
944
  });
971
945
  }
972
- function ue(i, t) {
973
- u(i, HTMLTextAreaElement) && (t.innerHTML = i.value), u(i, HTMLInputElement) && t.setAttribute("value", i.value);
974
- }
975
946
  function me(i, t) {
976
- if (u(i, HTMLSelectElement)) {
947
+ h(i, HTMLTextAreaElement) && (t.innerHTML = i.value), h(i, HTMLInputElement) && t.setAttribute("value", i.value);
948
+ }
949
+ function pe(i, t) {
950
+ if (h(i, HTMLSelectElement)) {
977
951
  const e = t, r = Array.from(e.children).find((s) => i.value === s.getAttribute("value"));
978
952
  r && r.setAttribute("selected", "");
979
953
  }
980
954
  }
981
- function pe(i, t, e) {
982
- return u(t, Element) && (he(i, t, e), Zt(i, t, e), ue(i, t), me(i, t)), t;
955
+ function fe(i, t, e) {
956
+ return h(t, Element) && (ue(i, t, e), te(i, t, e), me(i, t), pe(i, t)), t;
983
957
  }
984
- async function fe(i, t) {
958
+ async function be(i, t) {
985
959
  const e = i.querySelectorAll ? i.querySelectorAll("use") : [];
986
960
  if (e.length === 0)
987
961
  return i;
@@ -990,7 +964,7 @@ async function fe(i, t) {
990
964
  const a = e[n].getAttribute("xlink:href");
991
965
  if (a) {
992
966
  const l = i.querySelector(a), c = document.querySelector(a);
993
- !l && c && !r[a] && (r[a] = await L(c, t, !0));
967
+ !l && c && !r[a] && (r[a] = await P(c, t, !0));
994
968
  }
995
969
  }
996
970
  const s = Object.values(r);
@@ -1005,31 +979,31 @@ async function fe(i, t) {
1005
979
  }
1006
980
  return i;
1007
981
  }
1008
- async function L(i, t, e) {
1009
- return !e && t.filter && !t.filter(i) ? null : Promise.resolve(i).then((r) => le(r, t)).then((r) => de(i, r, t)).then((r) => pe(i, r, t)).then((r) => fe(r, t));
982
+ async function P(i, t, e) {
983
+ return !e && t.filter && !t.filter(i) ? null : Promise.resolve(i).then((r) => ce(r, t)).then((r) => he(i, r, t)).then((r) => fe(i, r, t)).then((r) => be(r, t));
1010
984
  }
1011
- const ct = /url\((['"]?)([^'"]+?)\1\)/g, be = /url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g, ge = /src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;
1012
- function ye(i) {
985
+ const lt = /url\((['"]?)([^'"]+?)\1\)/g, ge = /url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g, ye = /src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;
986
+ function we(i) {
1013
987
  const t = i.replace(/([.*+?^${}()|\[\]\/\\])/g, "\\$1");
1014
988
  return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`, "g");
1015
989
  }
1016
- function we(i) {
990
+ function xe(i) {
1017
991
  const t = [];
1018
- return i.replace(ct, (e, r, s) => (t.push(s), e)), t.filter((e) => !R(e));
992
+ return i.replace(lt, (e, r, s) => (t.push(s), e)), t.filter((e) => !R(e));
1019
993
  }
1020
- async function xe(i, t, e, r, s) {
994
+ async function ve(i, t, e, r, s) {
1021
995
  try {
1022
- const n = e ? jt(t, e) : t, o = $(t);
996
+ const n = e ? qt(t, e) : t, o = $(t);
1023
997
  let a;
1024
- return s || (a = await B(n, o, r)), i.replace(ye(t), `$1${a}$3`);
998
+ return s || (a = await B(n, o, r)), i.replace(we(t), `$1${a}$3`);
1025
999
  } catch {
1026
1000
  }
1027
1001
  return i;
1028
1002
  }
1029
- function ve(i, { preferredFontFormat: t }) {
1030
- return t ? i.replace(ge, (e) => {
1003
+ function ke(i, { preferredFontFormat: t }) {
1004
+ return t ? i.replace(ye, (e) => {
1031
1005
  for (; ; ) {
1032
- const [r, , s] = be.exec(e) || [];
1006
+ const [r, , s] = ge.exec(e) || [];
1033
1007
  if (!s)
1034
1008
  return "";
1035
1009
  if (s === t)
@@ -1037,30 +1011,30 @@ function ve(i, { preferredFontFormat: t }) {
1037
1011
  }
1038
1012
  }) : i;
1039
1013
  }
1040
- function dt(i) {
1041
- return i.search(ct) !== -1;
1014
+ function ct(i) {
1015
+ return i.search(lt) !== -1;
1042
1016
  }
1043
- async function ht(i, t, e) {
1044
- if (!dt(i))
1017
+ async function dt(i, t, e) {
1018
+ if (!ct(i))
1045
1019
  return i;
1046
- const r = ve(i, e);
1047
- return we(r).reduce((n, o) => n.then((a) => xe(a, o, t, e)), Promise.resolve(r));
1020
+ const r = ke(i, e);
1021
+ return xe(r).reduce((n, o) => n.then((a) => ve(a, o, t, e)), Promise.resolve(r));
1048
1022
  }
1049
1023
  async function y(i, t, e) {
1050
1024
  var r;
1051
1025
  const s = (r = t.style) === null || r === void 0 ? void 0 : r.getPropertyValue(i);
1052
1026
  if (s) {
1053
- const n = await ht(s, null, e);
1027
+ const n = await dt(s, null, e);
1054
1028
  return t.style.setProperty(i, n, t.style.getPropertyPriority(i)), !0;
1055
1029
  }
1056
1030
  return !1;
1057
1031
  }
1058
- async function ke(i, t) {
1032
+ async function Se(i, t) {
1059
1033
  await y("background", i, t) || await y("background-image", i, t), await y("mask", i, t) || await y("-webkit-mask", i, t) || await y("mask-image", i, t) || await y("-webkit-mask-image", i, t);
1060
1034
  }
1061
- async function Se(i, t) {
1062
- const e = u(i, HTMLImageElement);
1063
- if (!(e && !R(i.src)) && !(u(i, SVGImageElement) && !R(i.href.baseVal)))
1035
+ async function Ee(i, t) {
1036
+ const e = h(i, HTMLImageElement);
1037
+ if (!(e && !R(i.src)) && !(h(i, SVGImageElement) && !R(i.href.baseVal)))
1064
1038
  return;
1065
1039
  const r = e ? i.src : i.href.baseVal, s = await B(r, $(r), t);
1066
1040
  await new Promise((n, o) => {
@@ -1075,14 +1049,14 @@ async function Se(i, t) {
1075
1049
  a.decode && (a.decode = n), a.loading === "lazy" && (a.loading = "eager"), e ? (i.srcset = "", i.src = s) : i.href.baseVal = s;
1076
1050
  });
1077
1051
  }
1078
- async function Ee(i, t) {
1079
- const r = f(i.childNodes).map((s) => ut(s, t));
1052
+ async function Ce(i, t) {
1053
+ const r = b(i.childNodes).map((s) => ht(s, t));
1080
1054
  await Promise.all(r).then(() => i);
1081
1055
  }
1082
- async function ut(i, t) {
1083
- u(i, Element) && (await ke(i, t), await Se(i, t), await Ee(i, t));
1056
+ async function ht(i, t) {
1057
+ h(i, Element) && (await Se(i, t), await Ee(i, t), await Ce(i, t));
1084
1058
  }
1085
- function Ce(i, t) {
1059
+ function _e(i, t) {
1086
1060
  const { style: e } = i;
1087
1061
  t.backgroundColor && (e.backgroundColor = t.backgroundColor), t.width && (e.width = `${t.width}px`), t.height && (e.height = `${t.height}px`);
1088
1062
  const r = t.style;
@@ -1102,7 +1076,7 @@ async function V(i, t) {
1102
1076
  let e = i.cssText;
1103
1077
  const r = /url\(["']?([^"')]+)["']?\)/g, n = (e.match(/url\([^)]+\)/g) || []).map(async (o) => {
1104
1078
  let a = o.replace(r, "$1");
1105
- return a.startsWith("https://") || (a = new URL(a, i.url).href), at(a, t.fetchRequestInit, ({ result: l }) => (e = e.replace(o, `url(${l})`), [o, l]));
1079
+ return a.startsWith("https://") || (a = new URL(a, i.url).href), ot(a, t.fetchRequestInit, ({ result: l }) => (e = e.replace(o, `url(${l})`), [o, l]));
1106
1080
  });
1107
1081
  return Promise.all(n).then(() => e);
1108
1082
  }
@@ -1132,15 +1106,15 @@ function Y(i) {
1132
1106
  }
1133
1107
  return t;
1134
1108
  }
1135
- async function _e(i, t) {
1109
+ async function Te(i, t) {
1136
1110
  const e = [], r = [];
1137
1111
  return i.forEach((s) => {
1138
1112
  if ("cssRules" in s)
1139
1113
  try {
1140
- f(s.cssRules || []).forEach((n, o) => {
1114
+ b(s.cssRules || []).forEach((n, o) => {
1141
1115
  if (n.type === CSSRule.IMPORT_RULE) {
1142
1116
  let a = o + 1;
1143
- const l = n.href, c = W(l).then((h) => V(h, t)).then((h) => Y(h).forEach((p) => {
1117
+ const l = n.href, c = W(l).then((u) => V(u, t)).then((u) => Y(u).forEach((p) => {
1144
1118
  try {
1145
1119
  s.insertRule(p, p.startsWith("@import") ? a += 1 : s.cssRules.length);
1146
1120
  } catch (x) {
@@ -1149,8 +1123,8 @@ async function _e(i, t) {
1149
1123
  error: x
1150
1124
  });
1151
1125
  }
1152
- })).catch((h) => {
1153
- console.error("Error loading remote css", h.toString());
1126
+ })).catch((u) => {
1127
+ console.error("Error loading remote css", u.toString());
1154
1128
  });
1155
1129
  r.push(c);
1156
1130
  }
@@ -1166,7 +1140,7 @@ async function _e(i, t) {
1166
1140
  }), Promise.all(r).then(() => (i.forEach((s) => {
1167
1141
  if ("cssRules" in s)
1168
1142
  try {
1169
- f(s.cssRules || []).forEach((n) => {
1143
+ b(s.cssRules || []).forEach((n) => {
1170
1144
  e.push(n);
1171
1145
  });
1172
1146
  } catch (n) {
@@ -1174,56 +1148,56 @@ async function _e(i, t) {
1174
1148
  }
1175
1149
  }), e));
1176
1150
  }
1177
- function Te(i) {
1178
- return i.filter((t) => t.type === CSSRule.FONT_FACE_RULE).filter((t) => dt(t.style.getPropertyValue("src")));
1151
+ function Le(i) {
1152
+ return i.filter((t) => t.type === CSSRule.FONT_FACE_RULE).filter((t) => ct(t.style.getPropertyValue("src")));
1179
1153
  }
1180
1154
  async function Me(i, t) {
1181
1155
  if (i.ownerDocument == null)
1182
1156
  throw new Error("Provided element is not within a Document");
1183
- const e = f(i.ownerDocument.styleSheets), r = await _e(e, t);
1184
- return Te(r);
1157
+ const e = b(i.ownerDocument.styleSheets), r = await Te(e, t);
1158
+ return Le(r);
1185
1159
  }
1186
- function mt(i) {
1160
+ function ut(i) {
1187
1161
  return i.trim().replace(/["']/g, "");
1188
1162
  }
1189
- function Le(i) {
1163
+ function Pe(i) {
1190
1164
  const t = /* @__PURE__ */ new Set();
1191
1165
  function e(r) {
1192
1166
  (r.style.fontFamily || getComputedStyle(r).fontFamily).split(",").forEach((n) => {
1193
- t.add(mt(n));
1167
+ t.add(ut(n));
1194
1168
  }), Array.from(r.children).forEach((n) => {
1195
1169
  n instanceof HTMLElement && e(n);
1196
1170
  });
1197
1171
  }
1198
1172
  return e(i), t;
1199
1173
  }
1200
- async function Pe(i, t) {
1201
- const e = await Me(i, t), r = Le(i);
1202
- return (await Promise.all(e.filter((n) => r.has(mt(n.style.fontFamily))).map((n) => {
1174
+ async function De(i, t) {
1175
+ const e = await Me(i, t), r = Pe(i);
1176
+ return (await Promise.all(e.filter((n) => r.has(ut(n.style.fontFamily))).map((n) => {
1203
1177
  const o = n.parentStyleSheet ? n.parentStyleSheet.href : null;
1204
- return ht(n.cssText, o, t);
1178
+ return dt(n.cssText, o, t);
1205
1179
  }))).join(`
1206
1180
  `);
1207
1181
  }
1208
- async function Ae(i, t) {
1209
- const e = t.fontEmbedCSS != null ? t.fontEmbedCSS : t.skipFonts ? null : await Pe(i, t);
1182
+ async function Re(i, t) {
1183
+ const e = t.fontEmbedCSS != null ? t.fontEmbedCSS : t.skipFonts ? null : await De(i, t);
1210
1184
  if (e) {
1211
1185
  const r = document.createElement("style"), s = document.createTextNode(e);
1212
1186
  r.appendChild(s), i.firstChild ? i.insertBefore(r, i.firstChild) : i.appendChild(r);
1213
1187
  }
1214
1188
  }
1215
- async function De(i, t = {}) {
1216
- const { width: e, height: r } = ot(i, t), s = await L(i, t, !0);
1217
- return await Ae(s, t), await ut(s, t), Ce(s, t), await Xt(s, e, r);
1189
+ async function Ae(i, t = {}) {
1190
+ const { width: e, height: r } = nt(i, t), s = await P(i, t, !0);
1191
+ return await Re(s, t), await ht(s, t), _e(s, t), await Gt(s, e, r);
1218
1192
  }
1219
- async function Re(i, t = {}) {
1220
- const { width: e, height: r } = ot(i, t), s = await De(i, t), n = await T(s), o = document.createElement("canvas"), a = o.getContext("2d"), l = t.pixelRatio || Vt(), c = t.canvasWidth || e, h = t.canvasHeight || r;
1221
- return o.width = c * l, o.height = h * l, t.skipAutoScale || Yt(o), o.style.width = `${c}`, o.style.height = `${h}`, t.backgroundColor && (a.fillStyle = t.backgroundColor, a.fillRect(0, 0, o.width, o.height)), a.drawImage(n, 0, 0, o.width, o.height), o;
1193
+ async function He(i, t = {}) {
1194
+ const { width: e, height: r } = nt(i, t), s = await Ae(i, t), n = await T(s), o = document.createElement("canvas"), a = o.getContext("2d"), l = t.pixelRatio || Yt(), c = t.canvasWidth || e, u = t.canvasHeight || r;
1195
+ return o.width = c * l, o.height = u * l, t.skipAutoScale || Kt(o), o.style.width = `${c}`, o.style.height = `${u}`, t.backgroundColor && (a.fillStyle = t.backgroundColor, a.fillRect(0, 0, o.width, o.height)), a.drawImage(n, 0, 0, o.width, o.height), o;
1222
1196
  }
1223
1197
  async function Ie(i, t = {}) {
1224
- return (await Re(i, t)).toDataURL("image/jpeg", t.quality || 1);
1198
+ return (await He(i, t)).toDataURL("image/jpeg", t.quality || 1);
1225
1199
  }
1226
- async function He(i = []) {
1200
+ async function $e(i = []) {
1227
1201
  try {
1228
1202
  const t = await Ie(document.body, {
1229
1203
  quality: 0.85,
@@ -1234,29 +1208,29 @@ async function He(i = []) {
1234
1208
  filter: (e) => !(e instanceof HTMLElement && e.id === "mtb-widget-host")
1235
1209
  });
1236
1210
  if (i.length > 0) {
1237
- const e = await $e(t, i);
1211
+ const e = await Be(t, i);
1238
1212
  if (e) return e;
1239
1213
  }
1240
- return je(t);
1214
+ return qe(t);
1241
1215
  } catch {
1242
1216
  return null;
1243
1217
  }
1244
1218
  }
1245
- async function $e(i, t) {
1219
+ async function Be(i, t) {
1246
1220
  const e = document.createElement("canvas"), r = e.getContext("2d");
1247
1221
  if (!r) return null;
1248
- const s = await Oe(i);
1222
+ const s = await ze(i);
1249
1223
  if (!s) return null;
1250
1224
  e.width = s.naturalWidth || window.innerWidth, e.height = s.naturalHeight || window.innerHeight, r.drawImage(s, 0, 0);
1251
1225
  const n = e.width / window.innerWidth, o = e.height / window.innerHeight;
1252
1226
  let a = 0;
1253
1227
  for (const l of t)
1254
- l.type === "draw" && l.drawPath ? Be(r, l.drawPath, n, o) : l.type === "pin" && Fe(r, l.x * n, l.y * o, ++a);
1255
- return Ue(e);
1228
+ l.type === "draw" && l.drawPath ? Fe(r, l.drawPath, n, o) : l.type === "pin" && Ue(r, l.x * n, l.y * o, ++a);
1229
+ return je(e);
1256
1230
  }
1257
- function Be(i, t, e, r) {
1231
+ function Fe(i, t, e, r) {
1258
1232
  i.save(), i.strokeStyle = M, i.lineWidth = 3.5, i.lineCap = "round", i.lineJoin = "round", i.shadowColor = "rgba(5,150,105,0.35)", i.shadowOffsetY = 1, i.shadowBlur = 2;
1259
- for (const s of ze(t))
1233
+ for (const s of Oe(t))
1260
1234
  if (s.length !== 0) {
1261
1235
  i.beginPath(), i.moveTo(s[0][0] * e, s[0][1] * r);
1262
1236
  for (let n = 1; n < s.length; n++) i.lineTo(s[n][0] * e, s[n][1] * r);
@@ -1264,10 +1238,10 @@ function Be(i, t, e, r) {
1264
1238
  }
1265
1239
  i.restore();
1266
1240
  }
1267
- function Fe(i, t, e, r) {
1268
- i.save(), i.shadowColor = "rgba(5,150,105,0.45)", i.shadowOffsetY = 2, i.shadowBlur = 8, i.fillStyle = M, i.beginPath(), i.arc(t, e, 11, 0, Math.PI * 2), i.fill(), i.shadowColor = "transparent", i.lineWidth = 2, i.strokeStyle = "#ffffff", i.stroke(), i.fillStyle = "#ffffff", i.font = `700 10px ${Mt}`, i.textAlign = "center", i.textBaseline = "middle", i.fillText(String(r), t, e), i.restore();
1241
+ function Ue(i, t, e, r) {
1242
+ i.save(), i.shadowColor = "rgba(5,150,105,0.45)", i.shadowOffsetY = 2, i.shadowBlur = 8, i.fillStyle = M, i.beginPath(), i.arc(t, e, 11, 0, Math.PI * 2), i.fill(), i.shadowColor = "transparent", i.lineWidth = 2, i.strokeStyle = "#ffffff", i.stroke(), i.fillStyle = "#ffffff", i.font = `700 10px ${Tt}`, i.textAlign = "center", i.textBaseline = "middle", i.fillText(String(r), t, e), i.restore();
1269
1243
  }
1270
- function ze(i) {
1244
+ function Oe(i) {
1271
1245
  const t = [];
1272
1246
  let e = null;
1273
1247
  const r = i.match(/[ML]\s*[-\d.]+\s+[-\d.]+/g) ?? [];
@@ -1277,13 +1251,13 @@ function ze(i) {
1277
1251
  }
1278
1252
  return t;
1279
1253
  }
1280
- function Oe(i) {
1254
+ function ze(i) {
1281
1255
  return new Promise((t) => {
1282
1256
  const e = new Image();
1283
1257
  e.onload = () => t(e), e.onerror = () => t(null), e.src = i;
1284
1258
  });
1285
1259
  }
1286
- function Ue(i) {
1260
+ function je(i) {
1287
1261
  return new Promise((t) => {
1288
1262
  try {
1289
1263
  i.toBlob((e) => t(e), "image/jpeg", 0.85);
@@ -1292,13 +1266,13 @@ function Ue(i) {
1292
1266
  }
1293
1267
  });
1294
1268
  }
1295
- function je(i) {
1269
+ function qe(i) {
1296
1270
  const [t, e] = i.split(","), r = t.match(/:(.*?);/)?.[1] ?? "image/png", s = atob(e), n = new Uint8Array(s.length);
1297
1271
  for (let o = 0; o < s.length; o++)
1298
1272
  n[o] = s.charCodeAt(o);
1299
1273
  return new Blob([n], { type: r });
1300
1274
  }
1301
- class qe {
1275
+ class Ne {
1302
1276
  constructor() {
1303
1277
  this.listeners = /* @__PURE__ */ new Set(), this.originalOnError = null, this.installedOnError = null, this.rejectionHandler = null, this.hooked = !1;
1304
1278
  }
@@ -1320,8 +1294,8 @@ class qe {
1320
1294
  for (const e of this.listeners) e(t);
1321
1295
  }
1322
1296
  }
1323
- const F = new qe(), Ne = 20;
1324
- class We {
1297
+ const F = new Ne(), We = 20;
1298
+ class Ve {
1325
1299
  constructor() {
1326
1300
  this.errors = [], this.unsubscribe = null;
1327
1301
  }
@@ -1333,7 +1307,7 @@ class We {
1333
1307
  this.addError(`${t.message}${e}`);
1334
1308
  }
1335
1309
  addError(t) {
1336
- this.errors.length >= Ne || this.errors.includes(t) || this.errors.push(t);
1310
+ this.errors.length >= We || this.errors.includes(t) || this.errors.push(t);
1337
1311
  }
1338
1312
  getErrors() {
1339
1313
  return [...this.errors];
@@ -1342,8 +1316,8 @@ class We {
1342
1316
  this.unsubscribe?.(), this.unsubscribe = null;
1343
1317
  }
1344
1318
  }
1345
- const Ve = 20;
1346
- class Ye {
1319
+ const Ye = 20;
1320
+ class Ke {
1347
1321
  constructor() {
1348
1322
  this.breadcrumbs = [], this.active = !1, this.unsubscribeErrors = null, this.boundPopstateHandler = null, this.originalPushState = null, this.originalReplaceState = null, this.installedPushState = null, this.installedReplaceState = null, this.lastUrl = "", this.boundClickHandler = (t) => this.handleClick(t), this.boundChangeHandler = (t) => this.handleChange(t);
1349
1323
  }
@@ -1357,7 +1331,7 @@ class Ye {
1357
1331
  return [...this.breadcrumbs];
1358
1332
  }
1359
1333
  add(t) {
1360
- this.breadcrumbs.push(t), this.breadcrumbs.length > Ve && this.breadcrumbs.shift();
1334
+ this.breadcrumbs.push(t), this.breadcrumbs.length > Ye && this.breadcrumbs.shift();
1361
1335
  }
1362
1336
  handleClick(t) {
1363
1337
  const e = t.target;
@@ -1367,8 +1341,8 @@ class Ye {
1367
1341
  type: "ui",
1368
1342
  category: "ui.click",
1369
1343
  timestamp: Date.now(),
1370
- message: H(e),
1371
- data: { selector: st(e) }
1344
+ message: I(e),
1345
+ data: { selector: rt(e) }
1372
1346
  });
1373
1347
  } catch {
1374
1348
  }
@@ -1421,7 +1395,7 @@ class Ye {
1421
1395
  }));
1422
1396
  }
1423
1397
  }
1424
- const Ke = 3, Xe = 1e3, Ge = 3, Je = 5e3, Qe = 500, Ze = 500, ti = 300, ei = /* @__PURE__ */ new Set([
1398
+ const Xe = 3, Ge = 1e3, Je = 3, Qe = 5e3, Ze = 500, ti = 500, ei = 300, ii = /* @__PURE__ */ new Set([
1425
1399
  "A",
1426
1400
  "BUTTON",
1427
1401
  "INPUT",
@@ -1430,7 +1404,7 @@ const Ke = 3, Xe = 1e3, Ge = 3, Je = 5e3, Qe = 500, Ze = 500, ti = 300, ei = /*
1430
1404
  "LABEL",
1431
1405
  "SUMMARY",
1432
1406
  "DETAILS"
1433
- ]), ii = /* @__PURE__ */ new Set([
1407
+ ]), ri = /* @__PURE__ */ new Set([
1434
1408
  "button",
1435
1409
  "link",
1436
1410
  "checkbox",
@@ -1486,8 +1460,8 @@ const Ke = 3, Xe = 1e3, Ge = 3, Je = 5e3, Qe = 500, Ze = 500, ti = 300, ei = /*
1486
1460
  if (!e || S(e)) return;
1487
1461
  const r = Date.now();
1488
1462
  this.clickHistory.push({ target: e, time: r });
1489
- const s = r - Xe;
1490
- if (this.clickHistory = this.clickHistory.filter((o) => o.time > s), this.clickHistory.filter((o) => o.target === e).length >= Ke) {
1463
+ const s = r - Ge;
1464
+ if (this.clickHistory = this.clickHistory.filter((o) => o.time > s), this.clickHistory.filter((o) => o.target === e).length >= Xe) {
1491
1465
  this.clickHistory = [], this.emitHighPriority({
1492
1466
  signal: "rage_click",
1493
1467
  target: w(e),
@@ -1504,13 +1478,13 @@ const Ke = 3, Xe = 1e3, Ge = 3, Je = 5e3, Qe = 500, Ze = 500, ti = 300, ei = /*
1504
1478
  handleNavigation() {
1505
1479
  const t = Date.now();
1506
1480
  this.navTimestamps.push(t);
1507
- const e = t - Je;
1508
- this.navTimestamps = this.navTimestamps.filter((r) => r > e), this.navTimestamps.length >= Ge && (this.navTimestamps = [], this.emitIfReady({
1481
+ const e = t - Qe;
1482
+ this.navTimestamps = this.navTimestamps.filter((r) => r > e), this.navTimestamps.length >= Je && (this.navTimestamps = [], this.emitIfReady({
1509
1483
  signal: "rapid_navigation",
1510
1484
  timestamp: t
1511
1485
  })), setTimeout(() => {
1512
1486
  this.active && this.checkErrorPage();
1513
- }, ti);
1487
+ }, ei);
1514
1488
  }
1515
1489
  handleFormSubmit(t) {
1516
1490
  const e = t.target;
@@ -1520,7 +1494,7 @@ const Ke = 3, Xe = 1e3, Ge = 3, Je = 5e3, Qe = 500, Ze = 500, ti = 300, ei = /*
1520
1494
  target: w(e),
1521
1495
  timestamp: Date.now()
1522
1496
  });
1523
- }, Qe));
1497
+ }, Ze));
1524
1498
  }
1525
1499
  handleFormInvalid(t) {
1526
1500
  const e = t.target;
@@ -1571,7 +1545,7 @@ const Ke = 3, Xe = 1e3, Ge = 3, Je = 5e3, Qe = 500, Ze = 500, ti = 300, ei = /*
1571
1545
  target: w(t),
1572
1546
  timestamp: e
1573
1547
  });
1574
- }, Ze));
1548
+ }, ti));
1575
1549
  }
1576
1550
  ensureDomObserver() {
1577
1551
  this.domObserver || (this.domObserver = new MutationObserver(() => {
@@ -1596,9 +1570,9 @@ const Ke = 3, Xe = 1e3, Ge = 3, Je = 5e3, Qe = 500, Ze = 500, ti = 300, ei = /*
1596
1570
  return !1;
1597
1571
  }
1598
1572
  isInteractive(t) {
1599
- if (ei.has(t.tagName)) return !0;
1573
+ if (ii.has(t.tagName)) return !0;
1600
1574
  const e = t.getAttribute("role");
1601
- return !!(e && ii.has(e) || t.hasAttribute("onclick") || t.hasAttribute("tabindex") || t.contentEditable === "true" || window.getComputedStyle(t).cursor === "pointer" || t.closest('a, button, [role="button"], [role="link"], label'));
1575
+ return !!(e && ri.has(e) || t.hasAttribute("onclick") || t.hasAttribute("tabindex") || t.contentEditable === "true" || window.getComputedStyle(t).cursor === "pointer" || t.closest('a, button, [role="button"], [role="link"], label'));
1602
1576
  }
1603
1577
  emitIfReady(t) {
1604
1578
  const e = Date.now();
@@ -1609,33 +1583,33 @@ const Ke = 3, Xe = 1e3, Ge = 3, Je = 5e3, Qe = 500, Ze = 500, ti = 300, ei = /*
1609
1583
  }
1610
1584
  };
1611
1585
  E.COOLDOWN_MS = 6e4;
1612
- let I = E;
1586
+ let A = E;
1613
1587
  function w(i) {
1614
1588
  const t = i.tagName.toLowerCase(), e = i.id ? `#${i.id}` : "", r = i.className && typeof i.className == "string" ? "." + i.className.trim().split(/\s+/).slice(0, 2).join(".") : "", s = i.textContent?.trim().slice(0, 30) ?? "";
1615
1589
  return `<${t}${e}${r}>${s ? ` "${s}"` : ""}`;
1616
1590
  }
1617
- function ri() {
1591
+ function si() {
1618
1592
  return {
1619
1593
  page_url: window.location.href,
1620
1594
  user_agent: navigator.userAgent,
1621
- browser: si(),
1622
- os: ni(),
1595
+ browser: ni(),
1596
+ os: oi(),
1623
1597
  screen_width: window.screen.width,
1624
1598
  screen_height: window.screen.height
1625
1599
  };
1626
1600
  }
1627
- function si() {
1601
+ function ni() {
1628
1602
  const i = navigator.userAgent;
1629
1603
  return /Edg\//.test(i) ? `Edge ${i.match(/Edg\/(\S+)/)?.[1] ?? ""}` : /OPR\//.test(i) ? `Opera ${i.match(/OPR\/(\S+)/)?.[1] ?? ""}` : /Chrome\//.test(i) ? `Chrome ${i.match(/Chrome\/(\S+)/)?.[1] ?? ""}` : /Safari\//.test(i) && /Version\//.test(i) ? `Safari ${i.match(/Version\/(\S+)/)?.[1] ?? ""}` : /Firefox\//.test(i) ? `Firefox ${i.match(/Firefox\/(\S+)/)?.[1] ?? ""}` : "Unknown";
1630
1604
  }
1631
- function ni() {
1605
+ function oi() {
1632
1606
  const i = navigator.userAgent;
1633
1607
  return /Windows NT 10/.test(i) ? "Windows 10/11" : /Windows NT/.test(i) ? "Windows" : /Mac OS X 10_15|macOS 1[56789]/.test(i) || /Mac OS X/.test(i) ? "macOS" : /Android/.test(i) ? `Android ${i.match(/Android (\d+)/)?.[1] ?? ""}` : /iPhone|iPad|iPod/.test(i) ? "iOS" : /Linux/.test(i) ? "Linux" : "Unknown";
1634
1608
  }
1635
- const oi = "https://makethisbetter.dev/api/v1";
1636
- class ai {
1609
+ const ai = "https://makethisbetter.dev/api/v1";
1610
+ class li {
1637
1611
  constructor(t, e, r = 1e3, s, n) {
1638
- this.projectKey = t, this.apiUrl = (e ?? oi).replace(/\/$/, ""), this.retryDelayMs = r, this.userToken = s, this.userTokenFn = n;
1612
+ this.projectKey = t, this.apiUrl = (e ?? ai).replace(/\/$/, ""), this.retryDelayMs = r, this.userToken = s, this.userTokenFn = n;
1639
1613
  }
1640
1614
  async resolveUserToken() {
1641
1615
  return this.userTokenFn ? this.userTokenFn() : this.userToken;
@@ -1649,7 +1623,7 @@ class ai {
1649
1623
  return r["X-Submission-Token"] = t, r;
1650
1624
  }
1651
1625
  async createSubmissionSession(t, e) {
1652
- const r = di(), s = new FormData();
1626
+ const r = hi(), s = new FormData();
1653
1627
  if (s.append("feedback[description]", t.description), s.append("feedback[page_url]", t.page_url), s.append("feedback[user_agent]", t.user_agent), s.append("feedback[browser]", t.browser), s.append("feedback[os]", t.os), s.append("feedback[screen_width]", String(t.screen_width)), s.append("feedback[screen_height]", String(t.screen_height)), s.append("feedback[console_errors]", JSON.stringify(t.console_errors)), s.append("feedback[annotations]", JSON.stringify(t.annotations)), t.target_element && s.append("feedback[target_element]", JSON.stringify(t.target_element)), t.user_id && s.append("feedback[user_id]", t.user_id), t.reporter_external_id && s.append("feedback[reporter_external_id]", t.reporter_external_id), t.reporter_email && s.append("feedback[reporter_email]", t.reporter_email), t.user_email && s.append("feedback[user_email]", t.user_email), t.user_name && s.append("feedback[user_name]", t.user_name), t.breadcrumbs && t.breadcrumbs.length > 0 && s.append("feedback[breadcrumbs]", JSON.stringify(t.breadcrumbs)), t.recording_events && t.recording_events.length > 0) {
1654
1628
  const l = JSON.stringify(t.recording_events), c = new Blob([l], { type: "application/json" });
1655
1629
  s.append("feedback[recording]", c, "interaction-replay.json"), s.append("feedback[recording_duration]", String(t.recording_duration ?? 0));
@@ -1659,7 +1633,7 @@ class ai {
1659
1633
  s.append("feedback[screenshot]", e, `screenshot.${l}`);
1660
1634
  }
1661
1635
  const n = await this.authHeaders();
1662
- return n["X-Submission-Token"] = r, n["X-Idempotency-Key"] = ci(), { ...(await (await this.fetchWithRetry(`${this.apiUrl}/widget/feedback_submission_sessions`, {
1636
+ return n["X-Submission-Token"] = r, n["X-Idempotency-Key"] = di(), { ...(await (await this.fetchWithRetry(`${this.apiUrl}/widget/feedback_submission_sessions`, {
1663
1637
  method: "POST",
1664
1638
  headers: n,
1665
1639
  body: s
@@ -1720,7 +1694,7 @@ class ai {
1720
1694
  }), o = n.headers.get("Content-Type") ?? "";
1721
1695
  if (!n.ok || !n.body || !o.includes("text/event-stream"))
1722
1696
  throw new Error("clarify stream unavailable");
1723
- return li(n.body, r);
1697
+ return ci(n.body, r);
1724
1698
  }
1725
1699
  async finalizeSubmissionSession(t, e) {
1726
1700
  const r = await this.submissionHeaders(e);
@@ -1754,7 +1728,7 @@ class ai {
1754
1728
  function X(i) {
1755
1729
  return i <= 0 ? Promise.resolve() : new Promise((t) => setTimeout(t, i));
1756
1730
  }
1757
- async function li(i, t) {
1731
+ async function ci(i, t) {
1758
1732
  const e = i.getReader(), r = new TextDecoder();
1759
1733
  let s = "", n = { messages: [], done: !0 };
1760
1734
  const o = (a) => {
@@ -1762,8 +1736,8 @@ async function li(i, t) {
1762
1736
  `).find((x) => x.startsWith("event:")), c = a.split(`
1763
1737
  `).find((x) => x.startsWith("data:"));
1764
1738
  if (!c) return;
1765
- const h = l?.slice(6).trim(), p = JSON.parse(c.slice(5).trim());
1766
- h === "delta" && typeof p.text == "string" ? t(p.text) : h === "done" && (n = {
1739
+ const u = l?.slice(6).trim(), p = JSON.parse(c.slice(5).trim());
1740
+ u === "delta" && typeof p.text == "string" ? t(p.text) : u === "done" && (n = {
1767
1741
  messages: Array.isArray(p.messages) ? p.messages : [],
1768
1742
  done: p.done !== !1
1769
1743
  });
@@ -1776,26 +1750,26 @@ async function li(i, t) {
1776
1750
  for (; (c = s.indexOf(`
1777
1751
 
1778
1752
  `)) !== -1; ) {
1779
- const h = s.slice(0, c);
1753
+ const u = s.slice(0, c);
1780
1754
  s = s.slice(c + 2);
1781
1755
  try {
1782
- o(h);
1756
+ o(u);
1783
1757
  } catch {
1784
1758
  }
1785
1759
  }
1786
1760
  }
1787
1761
  return n;
1788
1762
  }
1789
- function ci() {
1763
+ function di() {
1790
1764
  return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : `${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 12)}`;
1791
1765
  }
1792
- function di() {
1766
+ function hi() {
1793
1767
  if (typeof crypto > "u" || typeof crypto.getRandomValues != "function")
1794
1768
  throw new Error("Secure random generation is unavailable");
1795
1769
  const i = crypto.getRandomValues(new Uint8Array(32));
1796
1770
  return Array.from(i, (t) => t.toString(16).padStart(2, "0")).join("");
1797
1771
  }
1798
- function hi(i, t, e, r, s, n, o, a, l) {
1772
+ function ui(i, t, e, r, s, n, o, a, l) {
1799
1773
  return {
1800
1774
  description: i,
1801
1775
  ...t,
@@ -1816,8 +1790,8 @@ function hi(i, t, e, r, s, n, o, a, l) {
1816
1790
  breadcrumbs: l
1817
1791
  };
1818
1792
  }
1819
- const G = "mtb_anon_id", pt = "mtb_reporter_email", ft = "mtb_board_url";
1820
- let J = null, bt = null, gt = null;
1793
+ const G = "mtb_anon_id", mt = "mtb_reporter_email", pt = "mtb_board_url";
1794
+ let J = null, ft = null, bt = null;
1821
1795
  function Q() {
1822
1796
  try {
1823
1797
  const i = window.localStorage.getItem(G);
@@ -1830,36 +1804,36 @@ function Q() {
1830
1804
  }
1831
1805
  function Z() {
1832
1806
  try {
1833
- return window.localStorage.getItem(pt) ?? void 0;
1807
+ return window.localStorage.getItem(mt) ?? void 0;
1834
1808
  } catch {
1835
- return bt ?? void 0;
1809
+ return ft ?? void 0;
1836
1810
  }
1837
1811
  }
1838
- function ui(i) {
1839
- bt = i;
1812
+ function mi(i) {
1813
+ ft = i;
1840
1814
  try {
1841
- window.localStorage.setItem(pt, i);
1815
+ window.localStorage.setItem(mt, i);
1842
1816
  } catch {
1843
1817
  }
1844
1818
  }
1845
- function mi() {
1819
+ function pi() {
1846
1820
  try {
1847
- return window.localStorage.getItem(ft) ?? void 0;
1821
+ return window.localStorage.getItem(pt) ?? void 0;
1848
1822
  } catch {
1849
- return gt ?? void 0;
1823
+ return bt ?? void 0;
1850
1824
  }
1851
1825
  }
1852
1826
  function tt(i) {
1853
- gt = i;
1827
+ bt = i;
1854
1828
  try {
1855
- window.localStorage.setItem(ft, i);
1829
+ window.localStorage.setItem(pt, i);
1856
1830
  } catch {
1857
1831
  }
1858
1832
  }
1859
1833
  function et() {
1860
1834
  return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? `anon_${crypto.randomUUID()}` : `anon_${`${Date.now().toString(16)}-${Math.random().toString(16).slice(2, 10)}`}`;
1861
1835
  }
1862
- const pi = {
1836
+ const fi = {
1863
1837
  tab: "Feedback",
1864
1838
  toolbar: {
1865
1839
  markup: "Mark up",
@@ -1931,21 +1905,9 @@ const pi = {
1931
1905
  placeholder: "Type your answer — or skip the question",
1932
1906
  send: "Send",
1933
1907
  skip: "Skip & send",
1934
- summary: {
1935
- ready: "Ready to send",
1936
- what_you_said: "What you said",
1937
- clarified: "Clarified with AI",
1938
- auto_captured: "Auto-captured",
1939
- element: "Element",
1940
- page: "Page",
1941
- browser: "Browser",
1942
- captured: "Captured",
1943
- send_feedback: "Send feedback",
1944
- screenshot: "Screenshot",
1945
- recording: "Interaction replay"
1946
- }
1908
+ retry: "Retry"
1947
1909
  }
1948
- }, fi = {
1910
+ }, bi = {
1949
1911
  tab: "反馈",
1950
1912
  toolbar: {
1951
1913
  markup: "标注",
@@ -2017,21 +1979,9 @@ const pi = {
2017
1979
  placeholder: "输入回答,或跳过问题",
2018
1980
  send: "发送",
2019
1981
  skip: "跳过并发送",
2020
- summary: {
2021
- ready: "准备发送",
2022
- what_you_said: "你的描述",
2023
- clarified: "AI 追问澄清",
2024
- auto_captured: "自动采集",
2025
- element: "元素",
2026
- page: "页面",
2027
- browser: "浏览器",
2028
- captured: "已采集",
2029
- send_feedback: "发送反馈",
2030
- screenshot: "截图",
2031
- recording: "交互回放"
2032
- }
1982
+ retry: "重试"
2033
1983
  }
2034
- }, bi = {
1984
+ }, gi = {
2035
1985
  tab: "フィードバック",
2036
1986
  toolbar: {
2037
1987
  markup: "マークアップ",
@@ -2103,21 +2053,9 @@ const pi = {
2103
2053
  placeholder: "回答を入力、または質問をスキップ",
2104
2054
  send: "送信",
2105
2055
  skip: "スキップして送信",
2106
- summary: {
2107
- ready: "送信の準備ができました",
2108
- what_you_said: "あなたの入力",
2109
- clarified: "AI で明確化",
2110
- auto_captured: "自動取得",
2111
- element: "要素",
2112
- page: "ページ",
2113
- browser: "ブラウザ",
2114
- captured: "取得済み",
2115
- send_feedback: "フィードバックを送信",
2116
- screenshot: "スクリーンショット",
2117
- recording: "操作リプレイ"
2118
- }
2056
+ retry: "再試行"
2119
2057
  }
2120
- }, gi = {
2058
+ }, yi = {
2121
2059
  tab: "피드백",
2122
2060
  toolbar: {
2123
2061
  markup: "마크업",
@@ -2189,21 +2127,9 @@ const pi = {
2189
2127
  placeholder: "답변을 입력하거나 질문을 건너뛰세요",
2190
2128
  send: "보내기",
2191
2129
  skip: "건너뛰고 보내기",
2192
- summary: {
2193
- ready: "보낼 준비 완료",
2194
- what_you_said: "입력한 내용",
2195
- clarified: "AI로 명확화",
2196
- auto_captured: "자동 수집",
2197
- element: "요소",
2198
- page: "페이지",
2199
- browser: "브라우저",
2200
- captured: "수집됨",
2201
- send_feedback: "피드백 보내기",
2202
- screenshot: "스크린샷",
2203
- recording: "상호작용 리플레이"
2204
- }
2130
+ retry: "재시도"
2205
2131
  }
2206
- }, yi = {
2132
+ }, wi = {
2207
2133
  tab: "Comentarios",
2208
2134
  toolbar: {
2209
2135
  markup: "Anotar",
@@ -2275,21 +2201,9 @@ const pi = {
2275
2201
  placeholder: "Escribe tu respuesta — u omite la pregunta",
2276
2202
  send: "Enviar",
2277
2203
  skip: "Omitir y enviar",
2278
- summary: {
2279
- ready: "Listo para enviar",
2280
- what_you_said: "Lo que dijiste",
2281
- clarified: "Aclarado con IA",
2282
- auto_captured: "Capturado automáticamente",
2283
- element: "Elemento",
2284
- page: "Página",
2285
- browser: "Navegador",
2286
- captured: "Capturado",
2287
- send_feedback: "Enviar comentario",
2288
- screenshot: "Captura de pantalla",
2289
- recording: "Repetición de interacción"
2290
- }
2204
+ retry: "Reintentar"
2291
2205
  }
2292
- }, wi = {
2206
+ }, xi = {
2293
2207
  tab: "Avis",
2294
2208
  toolbar: {
2295
2209
  markup: "Annoter",
@@ -2361,21 +2275,9 @@ const pi = {
2361
2275
  placeholder: "Saisissez votre réponse — ou ignorez la question",
2362
2276
  send: "Envoyer",
2363
2277
  skip: "Ignorer et envoyer",
2364
- summary: {
2365
- ready: "Prêt à envoyer",
2366
- what_you_said: "Ce que vous avez dit",
2367
- clarified: "Clarifié avec l'IA",
2368
- auto_captured: "Capturé automatiquement",
2369
- element: "Élément",
2370
- page: "Page",
2371
- browser: "Navigateur",
2372
- captured: "Capturé",
2373
- send_feedback: "Envoyer le retour",
2374
- screenshot: "Capture d'écran",
2375
- recording: "Relecture des interactions"
2376
- }
2278
+ retry: "Réessayer"
2377
2279
  }
2378
- }, xi = {
2280
+ }, vi = {
2379
2281
  tab: "Feedback",
2380
2282
  toolbar: {
2381
2283
  markup: "Markieren",
@@ -2447,47 +2349,35 @@ const pi = {
2447
2349
  placeholder: "Antwort eingeben — oder Frage überspringen",
2448
2350
  send: "Senden",
2449
2351
  skip: "Überspringen & senden",
2450
- summary: {
2451
- ready: "Bereit zum Senden",
2452
- what_you_said: "Was Sie gesagt haben",
2453
- clarified: "Mit KI geklärt",
2454
- auto_captured: "Automatisch erfasst",
2455
- element: "Element",
2456
- page: "Seite",
2457
- browser: "Browser",
2458
- captured: "Erfasst",
2459
- send_feedback: "Feedback senden",
2460
- screenshot: "Screenshot",
2461
- recording: "Interaktions-Replay"
2462
- }
2352
+ retry: "Erneut versuchen"
2463
2353
  }
2464
2354
  }, k = {
2465
- en: pi,
2466
- "zh-CN": fi,
2467
- ja: bi,
2468
- ko: gi,
2469
- es: yi,
2470
- fr: wi,
2471
- de: xi
2355
+ en: fi,
2356
+ "zh-CN": bi,
2357
+ ja: gi,
2358
+ ko: yi,
2359
+ es: wi,
2360
+ fr: xi,
2361
+ de: vi
2472
2362
  };
2473
- function vi(i) {
2363
+ function ki(i) {
2474
2364
  if (k[i]) return k[i];
2475
2365
  const t = i.split("-")[0];
2476
2366
  return k[t] ? k[t] : k.en;
2477
2367
  }
2478
- const ki = 60, Si = "https://cdn.jsdelivr.net/npm/@rrweb/record@2.1.0/umd/record.min.js", Ei = "sha384-MrD66HBNSykaP2N95+6hQCFlF5oH2tvL3TD/zyvHNkP/sAFWZx98DX9MEDy8MdVT";
2368
+ const Si = 60, Ei = "https://cdn.jsdelivr.net/npm/@rrweb/record@2.1.0/umd/record.min.js", Ci = "sha384-MrD66HBNSykaP2N95+6hQCFlF5oH2tvL3TD/zyvHNkP/sAFWZx98DX9MEDy8MdVT";
2479
2369
  let C = null;
2480
- function Ci() {
2481
- return C || (C = _i().catch(() => Ti()), C);
2370
+ function _i() {
2371
+ return C || (C = Ti().catch(() => Li()), C);
2482
2372
  }
2483
- async function _i() {
2373
+ async function Ti() {
2484
2374
  return (await import("@rrweb/record")).record;
2485
2375
  }
2486
2376
  function it() {
2487
2377
  const i = globalThis;
2488
2378
  return i.rrwebRecord?.record ?? i.rrweb?.record;
2489
2379
  }
2490
- function Ti() {
2380
+ function Li() {
2491
2381
  return new Promise((i, t) => {
2492
2382
  const e = it();
2493
2383
  if (e) {
@@ -2495,7 +2385,7 @@ function Ti() {
2495
2385
  return;
2496
2386
  }
2497
2387
  const r = document.createElement("script");
2498
- r.src = Si, r.integrity = Ei, r.crossOrigin = "anonymous", r.onload = () => {
2388
+ r.src = Ei, r.integrity = Ci, r.crossOrigin = "anonymous", r.onload = () => {
2499
2389
  const s = it();
2500
2390
  s ? i(s) : t(new Error("rrweb record global not found after script load"));
2501
2391
  }, r.onerror = () => t(new Error("Failed to load rrweb from CDN")), document.head.appendChild(r);
@@ -2506,7 +2396,7 @@ class Mi {
2506
2396
  this.events = [], this.stopFn = null, this.startedAt = 0, this.timer = null, this.clickHandler = null, this.stopped = !1, this.shadow = t, this.onMaxReached = e;
2507
2397
  }
2508
2398
  async start() {
2509
- const t = await Ci();
2399
+ const t = await _i();
2510
2400
  this.startedAt = Date.now(), this.stopped = !1, this.stopFn = t({
2511
2401
  emit: (e) => {
2512
2402
  this.stopped || this.events.push(e);
@@ -2519,7 +2409,7 @@ class Mi {
2519
2409
  });
2520
2410
  }, document.addEventListener("click", this.clickHandler, !0), this.timer = setTimeout(() => {
2521
2411
  this.onMaxReached?.();
2522
- }, ki * 1e3);
2412
+ }, Si * 1e3);
2523
2413
  }
2524
2414
  stop() {
2525
2415
  return this.stopped = !0, this.stopFn?.(), this.stopFn = null, this.cleanupTimer(), this.cleanupClickHandler(), {
@@ -2544,7 +2434,7 @@ class Mi {
2544
2434
  r.style.left = `${t}px`, r.style.top = `${e}px`, this.shadow.append(r), r.addEventListener("animationend", () => r.remove());
2545
2435
  }
2546
2436
  }
2547
- class Li {
2437
+ class Pi {
2548
2438
  constructor(t, e, r, s) {
2549
2439
  this.intervalId = null, this.getDuration = r, this.el = t.el("div", "mtb-record-bar"), this.el.innerHTML = `
2550
2440
  <span class="mtb-record-dot"></span>
@@ -2560,12 +2450,12 @@ class Li {
2560
2450
  this.intervalId && (clearInterval(this.intervalId), this.intervalId = null), this.el.remove();
2561
2451
  }
2562
2452
  }
2563
- class Pi {
2453
+ class Di {
2564
2454
  constructor() {
2565
2455
  this.session = null, this.bar = null, this.result = null;
2566
2456
  }
2567
2457
  async start(t, e, r) {
2568
- this.session = new Mi(t, r), this.bar = new Li(
2458
+ this.session = new Mi(t, r), this.bar = new Pi(
2569
2459
  t,
2570
2460
  e,
2571
2461
  () => this.session?.getDuration() ?? 0,
@@ -2585,9 +2475,9 @@ class Pi {
2585
2475
  this.session?.destroy(), this.session = null, this.bar?.destroy(), this.bar = null;
2586
2476
  }
2587
2477
  }
2588
- class rt {
2478
+ class H {
2589
2479
  constructor(t) {
2590
- this.tab = null, this.toolbar = null, this.session = null, this.drawBar = null, this.dim = null, this.popup = null, this.clarify = null, this.success = null, this.frustrationPrompt = null, this.frustrationDetector = null, this.mode = "idle", this.via = "pin", this.currentAnnotation = null, this.submittingUi = null, this.lastPopupPos = null, this.recordingManager = null, this.activeSubmission = null, this.submissionAttempt = 0, this.lastHandoff = {}, this.handleKeydown = (e) => {
2480
+ this.tab = null, this.toolbar = null, this.session = null, this.drawBar = null, this.dim = null, this.popup = null, this.clarify = null, this.success = null, this.frustrationPrompt = null, this.frustrationDetector = null, this.mode = "idle", this.via = "pin", this.currentAnnotation = null, this.submittingUi = null, this.lastPopupPos = null, this.recordingManager = null, this.activeSubmission = null, this.submissionAttempt = 0, this.lastHandoff = {}, this.frustrationDismissedByUser = !1, this.handleKeydown = (e) => {
2591
2481
  if (e.key === "Escape")
2592
2482
  switch (this.mode) {
2593
2483
  case "annotating":
@@ -2603,10 +2493,10 @@ class rt {
2603
2493
  }
2604
2494
  }, this.handleRecordStop = () => {
2605
2495
  this.recordingManager && (this.recordingManager.stop(), this.via = "record", this.showPopup(window.innerWidth / 2, window.innerHeight / 2, this.messages.record.timer_label));
2606
- }, this.config = t, this.messages = vi(t.locale ?? "en"), this.apiClient = new ai(t.projectKey, t.apiUrl, void 0, t.userToken, t.userTokenFn), this.consoleCollector = new We(), this.consoleCollector.start(), this.breadcrumbCollector = new Ye(), this.breadcrumbCollector.start(), this.buildUI(), t.frustrationDetection !== !1 && (this.frustrationDetector = new I(() => this.handleFrustration()), this.frustrationDetector.start()), document.addEventListener("keydown", this.handleKeydown, !0);
2496
+ }, this.config = t, this.messages = ki(t.locale ?? "en"), this.apiClient = new li(t.projectKey, t.apiUrl, void 0, t.userToken, t.userTokenFn), this.consoleCollector = new Ve(), this.consoleCollector.start(), this.breadcrumbCollector = new Ke(), this.breadcrumbCollector.start(), this.buildUI(), t.frustrationDetection !== !1 && (this.frustrationDetector = new A(() => this.handleFrustration()), this.frustrationDetector.start()), document.addEventListener("keydown", this.handleKeydown, !0);
2607
2497
  }
2608
2498
  buildUI() {
2609
- this.shadow = new wt(this.config.theme ?? "auto"), this.tab = new xt(
2499
+ this.shadow = new yt(this.config.theme ?? "auto"), this.tab = new wt(
2610
2500
  this.shadow,
2611
2501
  this.messages,
2612
2502
  this.config.position ?? "right",
@@ -2618,18 +2508,20 @@ class rt {
2618
2508
  this.mode === "idle" ? (this.dismissFrustrationPrompt(), this.enterAnnotationMode()) : this.exitAll();
2619
2509
  }
2620
2510
  handleFrustration() {
2621
- this.mode !== "idle" || this.frustrationPrompt || (this.frustrationPrompt = new kt(this.shadow, this.messages, {
2511
+ this.mode !== "idle" || this.frustrationPrompt || this.frustrationDismissedByUser || (this.frustrationPrompt = new vt(this.shadow, this.messages, {
2622
2512
  onTell: () => {
2623
2513
  this.dismissFrustrationPrompt(), this.enterAnnotationMode();
2624
2514
  },
2625
- onDismiss: () => this.dismissFrustrationPrompt()
2515
+ onDismiss: () => {
2516
+ this.frustrationDismissedByUser = !0, this.dismissFrustrationPrompt();
2517
+ }
2626
2518
  }));
2627
2519
  }
2628
2520
  dismissFrustrationPrompt() {
2629
2521
  this.frustrationPrompt?.destroy(), this.frustrationPrompt = null;
2630
2522
  }
2631
2523
  enterAnnotationMode() {
2632
- this.mode = "annotating", this.tab?.setActive(!0), this.toolbar = new Et(
2524
+ this.mode = "annotating", this.tab?.setActive(!0), this.toolbar = new St(
2633
2525
  this.shadow,
2634
2526
  this.messages,
2635
2527
  () => this.exitAll(),
@@ -2651,14 +2543,14 @@ class rt {
2651
2543
  }
2652
2544
  if (t === "record") {
2653
2545
  if (this.mode === "recording") return;
2654
- this.mode = "recording", this.currentAnnotation = null, this.teardownDraw(), this.session?.destroy(), this.session = null, this.recordingManager = new Pi(), this.recordingManager.start(this.shadow, this.messages, this.handleRecordStop).catch((e) => {
2546
+ this.mode = "recording", this.currentAnnotation = null, this.teardownDraw(), this.session?.destroy(), this.session = null, this.recordingManager = new Di(), this.recordingManager.start(this.shadow, this.messages, this.handleRecordStop).catch((e) => {
2655
2547
  console.warn("[MakeThisBetter] Interaction replay unavailable, falling back to markup:", e), this.mode === "recording" && (this.toolbar?.setMode("markup"), this.handleToolbarModeChange("markup"));
2656
2548
  });
2657
2549
  } else
2658
2550
  this.recordingManager?.destroy(), this.recordingManager = null, this.teardownDraw(), this.session || (this.session = this.createSession()), this.mode = "annotating";
2659
2551
  }
2660
2552
  handleDrawStroke() {
2661
- this.mode !== "drawing" && (this.mode = "drawing", this.drawBar = new It(this.shadow, {
2553
+ this.mode !== "drawing" && (this.mode = "drawing", this.drawBar = new At(this.shadow, {
2662
2554
  messages: this.messages,
2663
2555
  onUndo: () => this.handleDrawUndoRedo("undo"),
2664
2556
  onRedo: () => this.handleDrawUndoRedo("redo"),
@@ -2687,7 +2579,7 @@ class rt {
2687
2579
  this.currentAnnotation = e, this.via = "draw", this.session?.dismissInteraction(), this.submittingUi = this.drawBar, this.handleSubmit(t || this.messages.annotation.drawing);
2688
2580
  }
2689
2581
  showPopup(t, e, r) {
2690
- this.mode = "popup", this.lastPopupPos = { x: t, y: e }, this.teardownDraw(), this.session?.dismissInteraction(), this.popup?.destroy(), this.popup = null, this.dim?.destroy(), this.dim = null, this.dim = new St(this.shadow, () => this.exitAll()), this.popup = new Ht(this.shadow, {
2582
+ this.mode = "popup", this.lastPopupPos = { x: t, y: e }, this.teardownDraw(), this.session?.dismissInteraction(), this.popup?.destroy(), this.popup = null, this.dim?.destroy(), this.dim = null, this.dim = new kt(this.shadow, () => this.exitAll()), this.popup = new Ht(this.shadow, {
2691
2583
  targetName: r,
2692
2584
  x: t,
2693
2585
  y: e,
@@ -2698,7 +2590,7 @@ class rt {
2698
2590
  }), this.submittingUi = this.popup;
2699
2591
  }
2700
2592
  buildMyFeedbackHandler() {
2701
- if (!this.config.user && mi())
2593
+ if (!this.config.user && pi())
2702
2594
  return async () => {
2703
2595
  const t = await this.apiClient.createIdentityToken(Q());
2704
2596
  !t?.identity_token || !t.board_url || (tt(t.board_url), window.open(`${t.board_url}?identity=${encodeURIComponent(t.identity_token)}`, "_blank"));
@@ -2708,11 +2600,11 @@ class rt {
2708
2600
  const e = this.submittingUi;
2709
2601
  if (!e) return;
2710
2602
  const r = ++this.submissionAttempt;
2711
- e.setLoading(!0), await Ai();
2603
+ e.setLoading(!0), await Ri();
2712
2604
  const s = this.currentAnnotation, n = this.recordingManager?.getRecording() ?? void 0, [o, a] = await Promise.all([
2713
- He(s ? [s] : []),
2714
- Promise.resolve(ri())
2715
- ]), l = hi(
2605
+ $e(s ? [s] : []),
2606
+ Promise.resolve(si())
2607
+ ]), l = ui(
2716
2608
  t,
2717
2609
  a,
2718
2610
  this.consoleCollector.getErrors(),
@@ -2730,31 +2622,18 @@ class rt {
2730
2622
  });
2731
2623
  return;
2732
2624
  }
2733
- this.activeSubmission = c;
2734
- const h = this.buildSummaryContext(t, a, s);
2735
- this.teardownDraw(), this.popup?.destroy(), this.popup = null, this.dim?.destroy(), this.dim = null, this.session?.destroy(), this.session = null, this.recordingManager?.destroy(), this.recordingManager = null, this.submittingUi = null, this.showClarify(c, this.lastPopupPos, h);
2625
+ this.activeSubmission = c, this.teardownDraw(), this.popup?.destroy(), this.popup = null, this.dim?.destroy(), this.dim = null, this.session?.destroy(), this.session = null, this.recordingManager?.destroy(), this.recordingManager = null, this.submittingUi = null, this.showClarify(c, this.lastPopupPos);
2736
2626
  } catch {
2737
2627
  if (r !== this.submissionAttempt) return;
2738
2628
  e.setLoading(!1), e.setError(this.messages.error.submit);
2739
2629
  }
2740
2630
  }
2741
- buildSummaryContext(t, e, r) {
2742
- const s = this.messages.clarify.summary;
2743
- return {
2744
- originalDescription: t,
2745
- element: r?.targetName ?? this.messages.annotation.element,
2746
- page: e.page_url,
2747
- browser: `${e.browser} · ${e.os}`,
2748
- captured: this.via === "record" ? s.recording : s.screenshot
2749
- };
2750
- }
2751
- showClarify(t, e, r) {
2752
- this.mode = "clarifying", this.tab?.setActive(!0), this.clarify = new Ft(this.shadow, {
2631
+ showClarify(t, e) {
2632
+ this.mode = "clarifying", this.tab?.setActive(!0), this.clarify = new Ut(this.shadow, {
2753
2633
  submissionSessionId: t.id,
2754
2634
  submissionToken: t.token,
2755
2635
  apiClient: this.apiClient,
2756
2636
  messages: this.messages,
2757
- summary: r,
2758
2637
  x: e?.x,
2759
2638
  y: e?.y,
2760
2639
  onFinalize: () => this.finalizeSubmission()
@@ -2771,17 +2650,18 @@ class rt {
2771
2650
  }, r.board_url && tt(r.board_url), this.clarify?.destroy(), this.clarify = null, this.toolbar?.destroy(), this.toolbar = null, this.showSuccess({ skipFollowup: t.ai_clarify_available === !1 }));
2772
2651
  }
2773
2652
  showSuccess(t) {
2774
- this.mode = "idle", this.tab?.setActive(!1), this.success = new Ut(this.shadow, this.messages, () => {
2653
+ this.mode = "idle", this.tab?.setActive(!1), this.success = new jt(this.shadow, this.messages, () => {
2775
2654
  this.success?.destroy(), this.success = null;
2776
2655
  }, this.buildViewFeedbackHandler(), { ...t, emailCapture: this.buildEmailCapture() });
2777
2656
  }
2778
2657
  buildEmailCapture() {
2658
+ if (this.config.user) return;
2779
2659
  const { feedbackId: t, identityToken: e } = this.lastHandoff;
2780
2660
  if (!(!t || !e) && !Z())
2781
2661
  return {
2782
2662
  onSubmit: async (r) => {
2783
2663
  const s = await this.apiClient.updateReporter(t, r, e);
2784
- return s && ui(r), s;
2664
+ return s && mi(r), s;
2785
2665
  }
2786
2666
  };
2787
2667
  }
@@ -2809,22 +2689,24 @@ class rt {
2809
2689
  document.removeEventListener("keydown", this.handleKeydown, !0), this.exitAll(), this.consoleCollector.stop(), this.breadcrumbCollector.stop(), this.frustrationDetector?.stop(), this.dismissFrustrationPrompt(), this.clarify?.destroy(), this.success?.destroy(), this.tab?.destroy(), this.recordingManager?.destroy(), this.shadow.destroy();
2810
2690
  }
2811
2691
  }
2812
- function Ai() {
2692
+ function Ri() {
2813
2693
  return new Promise((i) => requestAnimationFrame(() => setTimeout(i, 0)));
2814
2694
  }
2815
- let b = null;
2816
- const Di = {
2695
+ let f = null, L = null;
2696
+ const Ai = {
2817
2697
  init(i) {
2818
- b && (b.destroy(), b = null), document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", () => {
2819
- b = new rt(i);
2820
- }) : b = new rt(i);
2698
+ f && (f.destroy(), f = null), L = i, document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", () => {
2699
+ f = new H(i);
2700
+ }) : f = new H(i);
2821
2701
  },
2822
2702
  destroy() {
2823
- b?.destroy(), b = null;
2703
+ f?.destroy(), f = null, L = null;
2824
2704
  }
2825
2705
  };
2826
- typeof window < "u" && (window.MakeThisBetter = Di);
2706
+ typeof window < "u" && (window.MakeThisBetter = Ai, document.addEventListener("turbo:load", () => {
2707
+ L && !document.getElementById("mtb-widget-host") && (f?.destroy(), f = new H(L));
2708
+ }));
2827
2709
  export {
2828
- Di as MakeThisBetter
2710
+ Ai as MakeThisBetter
2829
2711
  };
2830
2712
  //# sourceMappingURL=makethisbetter.esm.js.map