makethisbetter 1.5.2 → 1.5.4

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,4 +1,4 @@
1
- const bt = '*,*:before,*:after{box-sizing:border-box;margin:0;padding:0}:host{all:initial;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,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 #05966980}.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}.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%);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}.mtb-highlight-tooltip:after{content:"";position:absolute;top:100%;left:50%;transform:translate(-50%);border:4px solid transparent;border-top-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;width:320px;background:#fff;border:1px solid rgba(0,0,0,.1);border-radius:14px;box-shadow:0 12px 40px #00000029;overflow:hidden;animation:mtbSlideUp .28s cubic-bezier(.34,1.56,.64,1);font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif}@keyframes mtbSlideUp{0%{transform:translateY(14px) scale(.97);opacity:0}to{transform:translateY(0) scale(1);opacity:1}}.mtb-popup-header{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{padding:13px}.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:9px;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 #10b9811f}.mtb-textarea::placeholder{color:#00000057}.mtb-popup-error{margin-top:8px;color:#b91c1c;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:30px;border:none;border-radius:7px;cursor:pointer;display:flex;align-items:center;justify-content:center;padding:0 12px;font-family:inherit;font-size:12px;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:300px;background:#fff;border:1px solid rgba(0,0,0,.1);border-radius:16px;box-shadow:0 20px 60px #0000001f;padding:26px 22px;text-align:center;animation:mtbSlideUp .35s cubic-bezier(.34,1.56,.64,1);font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif}.mtb-success-icon{width:44px;height:44px;border-radius:50%;background:#05966914;display:flex;align-items:center;justify-content:center;margin:0 auto 12px}.mtb-success-title{font-size:16px;font-weight:700;margin-bottom:6px;color:#191a1c}.mtb-success-msg{font-size:13px;color:#0000008c;margin-bottom:16px;line-height:1.6}.mtb-close-link{background:none;border:none;cursor:pointer;font-size:12px;color:#00000073;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:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,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:14px;box-shadow:0 12px 40px #00000029;display:flex;flex-direction:column;animation:mtbSlideUp .28s cubic-bezier(.34,1.56,.64,1);font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,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:9px;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 #10b9811f;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:9px;background:#fff;cursor:pointer;font-family:inherit;font-size:12.5px;font-weight:550;color:#0000008c;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:9px;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}: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}}';
1
+ const bt = '*,*: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}.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%);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}.mtb-highlight-tooltip:after{content:"";position:absolute;top:100%;left:50%;transform:translate(-50%);border:4px solid transparent;border-top-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;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{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{padding:13px}.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;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}: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}}';
2
2
  class gt {
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" });
@@ -174,7 +174,7 @@ const et = "#059669", v = {
174
174
  linejoin: "round",
175
175
  filter: "drop-shadow(0 1px 2px rgba(5,150,105,0.35))"
176
176
  };
177
- class Tt {
177
+ class Mt {
178
178
  constructor(t, e) {
179
179
  this.path = null, this.points = [], this.isDrawing = !1, this.onDrawComplete = e, this.svg = document.createElementNS("http://www.w3.org/2000/svg", "svg"), this.svg.setAttribute("class", "mtb-draw-svg"), t.append(this.svg);
180
180
  }
@@ -229,10 +229,10 @@ class Tt {
229
229
  this.svg.remove();
230
230
  }
231
231
  }
232
- const Mt = 5;
232
+ const Tt = 5;
233
233
  class H {
234
234
  constructor(t, e, r) {
235
- this.messages = e, this.onReady = r, this.pinCount = 0, this.interactionActive = !0, this.pendingHighlightFrame = null, this.lastMoveX = 0, this.lastMoveY = 0, this.highlighter = new St(t), this.pinMarker = new _t(t), this.drawLayer = new Tt(t, (s) => {
235
+ this.messages = e, this.onReady = r, this.pinCount = 0, this.interactionActive = !0, this.pendingHighlightFrame = null, this.lastMoveX = 0, this.lastMoveY = 0, this.highlighter = new St(t), this.pinMarker = new _t(t), this.drawLayer = new Mt(t, (s) => {
236
236
  this.onReady(s, this.messages.annotation.drawing);
237
237
  }), this.overlay = new vt(t, {
238
238
  onMouseDown: (s) => this.handleMouseDown(s),
@@ -265,7 +265,7 @@ class H {
265
265
  }
266
266
  handleMouseUp(t) {
267
267
  if (!this.drawLayer.isCurrentlyDrawing()) return;
268
- if (this.drawLayer.getPointCount() >= Mt) {
268
+ if (this.drawLayer.getPointCount() >= Tt) {
269
269
  this.drawLayer.endDraw();
270
270
  return;
271
271
  }
@@ -368,8 +368,8 @@ class Lt {
368
368
  function p(i) {
369
369
  return i.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#039;");
370
370
  }
371
- const At = 2e3, Dt = 2e3, Rt = 45e3, L = 346, A = 320;
372
- class Pt {
371
+ const At = 2e3, Dt = 2e3, Pt = 45e3, L = 346, A = 320;
372
+ class Rt {
373
373
  constructor(t, e) {
374
374
  this.pollTimer = null, this.pollDeadline = 0, this.doneTimer = null, this.streamingBubble = null, this.sending = !1, this.destroyed = !1, this.feedbackId = e.feedbackId, this.apiClient = e.apiClient, this.onDone = e.onDone, 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(e.messages), this.startConversation();
375
375
  }
@@ -407,7 +407,7 @@ class Pt {
407
407
  <textarea class="mtb-clarify-input" rows="2" placeholder="${b(t.clarify.placeholder)}"></textarea>
408
408
  <div class="mtb-clarify-actions">
409
409
  <button class="mtb-clarify-skip" type="button">${b(t.clarify.skip)}</button>
410
- <button class="mtb-clarify-send" type="button">
410
+ <button class="mtb-clarify-send" type="button" disabled>
411
411
  <svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="#fff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
412
412
  <line x1="22" y1="2" x2="11" y2="13"/>
413
413
  <polygon points="22 2 15 22 11 13 2 9 22 2"/>
@@ -422,7 +422,9 @@ class Pt {
422
422
  const e = () => {
423
423
  this.stopPolling(), this.onDone();
424
424
  };
425
- this.el.querySelector(".mtb-clarify-skip").addEventListener("click", e), this.el.querySelector(".mtb-clarify-close").addEventListener("click", e), this.inputEl.addEventListener("keydown", (r) => {
425
+ this.el.querySelector(".mtb-clarify-skip").addEventListener("click", e), this.el.querySelector(".mtb-clarify-close").addEventListener("click", e), this.inputEl.addEventListener("input", () => {
426
+ this.sendBtn.disabled = !this.inputEl.value.trim();
427
+ }), this.inputEl.addEventListener("keydown", (r) => {
426
428
  r.isComposing || r.keyCode === 229 || r.key === "Enter" && !r.shiftKey && (r.preventDefault(), this.sendMessage(t));
427
429
  }), this.sendBtn.addEventListener("click", () => this.sendMessage(t));
428
430
  }
@@ -436,7 +438,7 @@ class Pt {
436
438
  try {
437
439
  await this.runTurn(e);
438
440
  } finally {
439
- this.sending = !1, this.inputEl.disabled = !1, this.sendBtn.disabled = !1, this.inputEl.focus();
441
+ this.sending = !1, this.inputEl.disabled = !1, this.sendBtn.disabled = !this.inputEl.value.trim(), this.inputEl.focus();
440
442
  }
441
443
  }
442
444
  }
@@ -473,7 +475,7 @@ class Pt {
473
475
  this.streamingBubble = null;
474
476
  }
475
477
  startPolling() {
476
- this.stopPolling(), this.pollDeadline = Date.now() + Rt, this.pollTimer = setInterval(() => this.poll(), At);
478
+ this.stopPolling(), this.pollDeadline = Date.now() + Pt, this.pollTimer = setInterval(() => this.poll(), At);
477
479
  }
478
480
  stopPolling() {
479
481
  this.pollTimer !== null && (clearInterval(this.pollTimer), this.pollTimer = null);
@@ -531,7 +533,7 @@ const It = 5e3, $t = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
531
533
  class Ht {
532
534
  constructor(t, e, r, s, n) {
533
535
  this.messages = e, this.el = t.el("div", "mtb-success"), this.el.style.right = "20px", this.el.style.bottom = "20px";
534
- 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}</button>` : "", c = n?.emailCapture ? `
536
+ 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 ? `
535
537
  <div class="mtb-email-capture">
536
538
  <div class="mtb-email-prompt">${e.success.email_prompt}</div>
537
539
  <div class="mtb-email-row">
@@ -542,7 +544,7 @@ class Ht {
542
544
  </div>` : "";
543
545
  this.el.innerHTML = `
544
546
  <div class="mtb-success-icon">
545
- <svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="${et}" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
547
+ <svg width="23" height="23" viewBox="0 0 24 24" fill="none" stroke="${et}" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round">
546
548
  <polyline points="20 6 9 17 4 12"/>
547
549
  </svg>
548
550
  </div>
@@ -602,19 +604,19 @@ function _(i, t) {
602
604
  const r = (i.ownerDocument.defaultView || window).getComputedStyle(i).getPropertyValue(t);
603
605
  return r ? parseFloat(r.replace("px", "")) : 0;
604
606
  }
605
- function Ut(i) {
607
+ function jt(i) {
606
608
  const t = _(i, "border-left-width"), e = _(i, "border-right-width");
607
609
  return i.clientWidth + t + e;
608
610
  }
609
- function jt(i) {
611
+ function Bt(i) {
610
612
  const t = _(i, "border-top-width"), e = _(i, "border-bottom-width");
611
613
  return i.clientHeight + t + e;
612
614
  }
613
615
  function rt(i, t = {}) {
614
- const e = t.width || Ut(i), r = t.height || jt(i);
616
+ const e = t.width || jt(i), r = t.height || Bt(i);
615
617
  return { width: e, height: r };
616
618
  }
617
- function Bt() {
619
+ function Ut() {
618
620
  let i, t;
619
621
  try {
620
622
  t = process;
@@ -627,7 +629,7 @@ const u = 16384;
627
629
  function zt(i) {
628
630
  (i.width > u || i.height > u) && (i.width > u && i.height > u ? i.width > i.height ? (i.height *= u / i.width, i.width = u) : (i.width *= u / i.height, i.height = u) : i.width > u ? (i.height *= u / i.width, i.width = u) : (i.width *= u / i.height, i.height = u));
629
631
  }
630
- function T(i) {
632
+ function M(i) {
631
633
  return new Promise((t, e) => {
632
634
  const r = new Image();
633
635
  r.onload = () => {
@@ -680,14 +682,14 @@ function F(i, t, e, r) {
680
682
  function Xt(i, t, e) {
681
683
  F(i, t, ":before", e), F(i, t, ":after", e);
682
684
  }
683
- const U = "application/font-woff", j = "image/jpeg", Gt = {
684
- woff: U,
685
- woff2: U,
685
+ const j = "application/font-woff", B = "image/jpeg", Gt = {
686
+ woff: j,
687
+ woff2: j,
686
688
  ttf: "application/font-truetype",
687
689
  eot: "application/vnd.ms-fontobject",
688
690
  png: "image/png",
689
- jpg: j,
690
- jpeg: j,
691
+ jpg: B,
692
+ jpeg: B,
691
693
  gif: "image/gif",
692
694
  tiff: "image/tiff",
693
695
  svg: "image/svg+xml",
@@ -704,7 +706,7 @@ function I(i) {
704
706
  function Jt(i) {
705
707
  return i.split(/,/)[1];
706
708
  }
707
- function R(i) {
709
+ function P(i) {
708
710
  return i.search(/^(data:)/) !== -1;
709
711
  }
710
712
  function Qt(i, t) {
@@ -749,23 +751,23 @@ async function $(i, t, e) {
749
751
  }
750
752
  async function te(i) {
751
753
  const t = i.toDataURL();
752
- return t === "data:," ? i.cloneNode(!1) : T(t);
754
+ return t === "data:," ? i.cloneNode(!1) : M(t);
753
755
  }
754
756
  async function ee(i, t) {
755
757
  if (i.currentSrc) {
756
758
  const n = document.createElement("canvas"), o = n.getContext("2d");
757
759
  n.width = i.clientWidth, n.height = i.clientHeight, o?.drawImage(i, 0, 0, n.width, n.height);
758
760
  const a = n.toDataURL();
759
- return T(a);
761
+ return M(a);
760
762
  }
761
763
  const e = i.poster, r = I(e), s = await $(e, r, t);
762
- return T(s);
764
+ return M(s);
763
765
  }
764
766
  async function ie(i, t) {
765
767
  var e;
766
768
  try {
767
769
  if (!((e = i?.contentDocument) === null || e === void 0) && e.body)
768
- return await M(i.contentDocument.body, t, !0);
770
+ return await T(i.contentDocument.body, t, !0);
769
771
  } catch {
770
772
  }
771
773
  return i.cloneNode(!1);
@@ -779,7 +781,7 @@ async function ne(i, t, e) {
779
781
  if (nt(t))
780
782
  return t;
781
783
  let n = [];
782
- return se(i) && i.assignedNodes ? n = f(i.assignedNodes()) : d(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 || d(i, HTMLVideoElement) || await n.reduce((o, a) => o.then(() => M(a, e)).then((l) => {
784
+ return se(i) && i.assignedNodes ? n = f(i.assignedNodes()) : d(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 || d(i, HTMLVideoElement) || await n.reduce((o, a) => o.then(() => T(a, e)).then((l) => {
783
785
  l && t.appendChild(l);
784
786
  }), Promise.resolve()), t;
785
787
  }
@@ -814,7 +816,7 @@ async function de(i, t) {
814
816
  const a = e[n].getAttribute("xlink:href");
815
817
  if (a) {
816
818
  const l = i.querySelector(a), c = document.querySelector(a);
817
- !l && c && !r[a] && (r[a] = await M(c, t, !0));
819
+ !l && c && !r[a] && (r[a] = await T(c, t, !0));
818
820
  }
819
821
  }
820
822
  const s = Object.values(r);
@@ -829,7 +831,7 @@ async function de(i, t) {
829
831
  }
830
832
  return i;
831
833
  }
832
- async function M(i, t, e) {
834
+ async function T(i, t, e) {
833
835
  return !e && t.filter && !t.filter(i) ? null : Promise.resolve(i).then((r) => re(r, t)).then((r) => ne(i, r, t)).then((r) => ce(i, r, t)).then((r) => de(r, t));
834
836
  }
835
837
  const ot = /url\((['"]?)([^'"]+?)\1\)/g, he = /url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g, ue = /src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;
@@ -839,7 +841,7 @@ function me(i) {
839
841
  }
840
842
  function fe(i) {
841
843
  const t = [];
842
- return i.replace(ot, (e, r, s) => (t.push(s), e)), t.filter((e) => !R(e));
844
+ return i.replace(ot, (e, r, s) => (t.push(s), e)), t.filter((e) => !P(e));
843
845
  }
844
846
  async function pe(i, t, e, r, s) {
845
847
  try {
@@ -884,7 +886,7 @@ async function ge(i, t) {
884
886
  }
885
887
  async function ye(i, t) {
886
888
  const e = d(i, HTMLImageElement);
887
- if (!(e && !R(i.src)) && !(d(i, SVGImageElement) && !R(i.href.baseVal)))
889
+ if (!(e && !P(i.src)) && !(d(i, SVGImageElement) && !P(i.href.baseVal)))
888
890
  return;
889
891
  const r = e ? i.src : i.href.baseVal, s = await $(r, I(r), t);
890
892
  await new Promise((n, o) => {
@@ -914,13 +916,13 @@ function we(i, t) {
914
916
  e[s] = r[s];
915
917
  }), i;
916
918
  }
917
- const B = {};
919
+ const U = {};
918
920
  async function z(i) {
919
- let t = B[i];
921
+ let t = U[i];
920
922
  if (t != null)
921
923
  return t;
922
924
  const r = await (await fetch(i)).text();
923
- return t = { url: i, cssText: r }, B[i] = t, t;
925
+ return t = { url: i, cssText: r }, U[i] = t, t;
924
926
  }
925
927
  async function q(i, t) {
926
928
  let e = i.cssText;
@@ -1036,16 +1038,16 @@ async function _e(i, t) {
1036
1038
  r.appendChild(s), i.firstChild ? i.insertBefore(r, i.firstChild) : i.appendChild(r);
1037
1039
  }
1038
1040
  }
1039
- async function Te(i, t = {}) {
1040
- const { width: e, height: r } = rt(i, t), s = await M(i, t, !0);
1041
+ async function Me(i, t = {}) {
1042
+ const { width: e, height: r } = rt(i, t), s = await T(i, t, !0);
1041
1043
  return await _e(s, t), await ct(s, t), we(s, t), await Wt(s, e, r);
1042
1044
  }
1043
- async function Me(i, t = {}) {
1044
- const { width: e, height: r } = rt(i, t), s = await Te(i, t), n = await T(s), o = document.createElement("canvas"), a = o.getContext("2d"), l = t.pixelRatio || Bt(), c = t.canvasWidth || e, h = t.canvasHeight || r;
1045
+ async function Te(i, t = {}) {
1046
+ const { width: e, height: r } = rt(i, t), s = await Me(i, t), n = await M(s), o = document.createElement("canvas"), a = o.getContext("2d"), l = t.pixelRatio || Ut(), c = t.canvasWidth || e, h = t.canvasHeight || r;
1045
1047
  return o.width = c * l, o.height = h * l, t.skipAutoScale || zt(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;
1046
1048
  }
1047
1049
  async function Le(i, t = {}) {
1048
- return (await Me(i, t)).toDataURL("image/jpeg", t.quality || 1);
1050
+ return (await Te(i, t)).toDataURL("image/jpeg", t.quality || 1);
1049
1051
  }
1050
1052
  async function Ae(i = []) {
1051
1053
  const t = De(i);
@@ -1070,10 +1072,10 @@ function De(i) {
1070
1072
  const t = document.createElement("div");
1071
1073
  t.setAttribute("data-mtb-capture-annotations", "true"), t.setAttribute("aria-hidden", "true"), t.style.cssText = "position:fixed;inset:0;pointer-events:none;z-index:2147483645;";
1072
1074
  for (const [e, r] of i.entries())
1073
- r.type === "pin" ? t.appendChild(Re(r, e + 1)) : r.type === "draw" && r.drawPath && t.appendChild(Pe(r.drawPath));
1075
+ r.type === "pin" ? t.appendChild(Pe(r, e + 1)) : r.type === "draw" && r.drawPath && t.appendChild(Re(r.drawPath));
1074
1076
  return document.body.appendChild(t), t;
1075
1077
  }
1076
- function Re(i, t) {
1078
+ function Pe(i, t) {
1077
1079
  const e = document.createElement("div");
1078
1080
  return e.textContent = String(t), e.style.cssText = [
1079
1081
  "position:fixed",
@@ -1093,7 +1095,7 @@ function Re(i, t) {
1093
1095
  "transform:translate(-50%,-50%)"
1094
1096
  ].join(";"), e;
1095
1097
  }
1096
- function Pe(i) {
1098
+ function Re(i) {
1097
1099
  const t = document.createElementNS("http://www.w3.org/2000/svg", "svg");
1098
1100
  t.setAttribute("width", "100%"), t.setAttribute("height", "100%"), t.setAttribute("viewBox", `0 0 ${window.innerWidth} ${window.innerHeight}`), t.style.cssText = "position:fixed;inset:0;width:100%;height:100%;overflow:visible;";
1099
1101
  const e = document.createElementNS("http://www.w3.org/2000/svg", "path");
@@ -1149,7 +1151,7 @@ class Oe {
1149
1151
  this.unsubscribe?.(), this.unsubscribe = null;
1150
1152
  }
1151
1153
  }
1152
- const Fe = 3, Ue = 1e3, je = 3, Be = 5e3, ze = 500, qe = 500, We = 300, Ne = /* @__PURE__ */ new Set([
1154
+ const Fe = 3, je = 1e3, Be = 3, Ue = 5e3, ze = 500, qe = 500, We = 300, Ne = /* @__PURE__ */ new Set([
1153
1155
  "A",
1154
1156
  "BUTTON",
1155
1157
  "INPUT",
@@ -1214,7 +1216,7 @@ const Fe = 3, Ue = 1e3, je = 3, Be = 5e3, ze = 500, qe = 500, We = 300, Ne = /*
1214
1216
  if (!e || this.isWidgetElement(e)) return;
1215
1217
  const r = Date.now();
1216
1218
  this.clickHistory.push({ target: e, time: r });
1217
- const s = r - Ue;
1219
+ const s = r - je;
1218
1220
  if (this.clickHistory = this.clickHistory.filter((o) => o.time > s), this.clickHistory.filter((o) => o.target === e).length >= Fe) {
1219
1221
  this.clickHistory = [], this.emitHighPriority({
1220
1222
  signal: "rage_click",
@@ -1232,8 +1234,8 @@ const Fe = 3, Ue = 1e3, je = 3, Be = 5e3, ze = 500, qe = 500, We = 300, Ne = /*
1232
1234
  handleNavigation() {
1233
1235
  const t = Date.now();
1234
1236
  this.navTimestamps.push(t);
1235
- const e = t - Be;
1236
- this.navTimestamps = this.navTimestamps.filter((r) => r > e), this.navTimestamps.length >= je && (this.navTimestamps = [], this.emitIfReady({
1237
+ const e = t - Ue;
1238
+ this.navTimestamps = this.navTimestamps.filter((r) => r > e), this.navTimestamps.length >= Be && (this.navTimestamps = [], this.emitIfReady({
1237
1239
  signal: "rapid_navigation",
1238
1240
  timestamp: t
1239
1241
  })), setTimeout(() => {
@@ -1341,7 +1343,7 @@ const Fe = 3, Ue = 1e3, je = 3, Be = 5e3, ze = 500, qe = 500, We = 300, Ne = /*
1341
1343
  }
1342
1344
  };
1343
1345
  E.COOLDOWN_MS = 6e4;
1344
- let P = E;
1346
+ let R = E;
1345
1347
  function w(i) {
1346
1348
  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) ?? "";
1347
1349
  return `<${t}${e}${r}>${s ? ` "${s}"` : ""}`;
@@ -2135,7 +2137,7 @@ class xi {
2135
2137
  }
2136
2138
  class tt {
2137
2139
  constructor(t) {
2138
- this.tab = null, this.toolbar = null, this.session = null, this.popup = null, this.clarify = null, this.success = null, this.frustrationPrompt = null, this.frustrationDetector = null, this.mode = "idle", this.currentAnnotation = null, this.lastPopupPos = null, this.recordingManager = null, this.lastHandoff = {}, this.config = t, this.messages = di(t.locale ?? "en"), this.apiClient = new Je(t.projectKey, t.apiUrl, void 0, t.userToken, t.userTokenFn), this.consoleCollector = new Oe(), this.consoleCollector.start(), this.buildUI(), t.frustrationDetection !== !1 && (this.frustrationDetector = new P(() => this.handleFrustration()), this.frustrationDetector.start());
2140
+ this.tab = null, this.toolbar = null, this.session = null, this.popup = null, this.clarify = null, this.success = null, this.frustrationPrompt = null, this.frustrationDetector = null, this.mode = "idle", this.currentAnnotation = null, this.lastPopupPos = null, this.recordingManager = null, this.lastHandoff = {}, this.config = t, this.messages = di(t.locale ?? "en"), this.apiClient = new Je(t.projectKey, t.apiUrl, void 0, t.userToken, t.userTokenFn), this.consoleCollector = new Oe(), this.consoleCollector.start(), this.buildUI(), t.frustrationDetection !== !1 && (this.frustrationDetector = new R(() => this.handleFrustration()), this.frustrationDetector.start());
2139
2141
  }
2140
2142
  buildUI() {
2141
2143
  this.shadow = new gt(this.config.theme ?? "auto"), this.tab = new yt(
@@ -2199,7 +2201,7 @@ class tt {
2199
2201
  }
2200
2202
  async handleSubmit(t) {
2201
2203
  if (!this.popup) return;
2202
- this.popup.setLoading(!0);
2204
+ this.popup.setLoading(!0), await new Promise((a) => requestAnimationFrame(() => setTimeout(a, 0)));
2203
2205
  const e = this.currentAnnotation, r = this.recordingManager?.getRecording() ?? void 0, [s, n] = await Promise.all([
2204
2206
  Ae(e ? [e] : []),
2205
2207
  Promise.resolve(Ye())
@@ -2221,7 +2223,7 @@ class tt {
2221
2223
  }
2222
2224
  }
2223
2225
  showClarify(t, e) {
2224
- this.mode = "clarifying", this.tab?.setActive(!0), this.clarify = new Pt(this.shadow, {
2226
+ this.mode = "clarifying", this.tab?.setActive(!0), this.clarify = new Rt(this.shadow, {
2225
2227
  feedbackId: t,
2226
2228
  apiClient: this.apiClient,
2227
2229
  messages: this.messages,