makethisbetter 1.14.2 → 1.14.3

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,10 +1,10 @@
1
- const Xt = `*,*: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{--mtb-tab-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='8'/%3E%3Ccircle cx='12' cy='12' r='2.4' fill='%23000' stroke='none'/%3E%3Cpath d='M12 1.8v3.4M12 18.8v3.4M1.8 12h3.4M18.8 12h3.4'/%3E%3C/svg%3E");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-hint-bar{position:fixed;top:18px;left:50%;transform:translate(-50%);z-index:2147483647;display:flex;align-items:center;height:38px;padding:0 16px;border-radius:13px;background:linear-gradient(120deg,#10b981,#059669);box-shadow:0 10px 26px #0f172a38;animation:mtbHintIn .2s ease;white-space:nowrap;transition:opacity .15s ease;pointer-events:none}.mtb-hint-bar--under-pointer{opacity:.3}@keyframes mtbHintIn{0%{transform:translate(-50%,12px);opacity:0}to{transform:translate(-50%);opacity:1}}.mtb-toolbar{position:fixed;top:50%;right:8px;transform:translateY(-50%);z-index:2147483647;display:flex;flex-direction:column;align-items:center;gap:6px;width:38px;padding:6px 0;max-height:calc(100vh - 24px);border-radius:19px;background:linear-gradient(160deg,#10b981,#059669);box-shadow:0 8px 22px #0f172a33;animation:mtbEdgeBarIn .2s ease;white-space:nowrap;pointer-events:none}.mtb-toolbar.left{right:auto;left:8px;animation:mtbEdgeBarInLeft .2s ease}@keyframes mtbBarIn{0%{transform:translate(-50%,12px);opacity:0}to{transform:translate(-50%);opacity:1}}@keyframes mtbEdgeBarIn{0%{transform:translate(12px,-50%);opacity:0}to{transform:translateY(-50%);opacity:1}}@keyframes mtbEdgeBarInLeft{0%{transform:translate(-12px,-50%);opacity:0}to{transform:translateY(-50%);opacity:1}}.mtb-toolbar-label{display:none}:host([data-mtb-toolbar]) .mtb-tab{display:none}.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:20px;height:1px;align-self:center;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-toolbar-modes{flex-direction:column;gap:6px;padding:0;background:none;border-radius:0}.mtb-toolbar-mode-btn,.mtb-exit-btn{pointer-events:auto;display:flex;align-items:center;justify-content:center;gap:0;width:30px;height:30px;padding:0;border-radius:50%;background:none;color:#ffffffb8}.mtb-toolbar-mode-btn:hover,.mtb-exit-btn:hover{background:#ffffff29;color:#fff}.mtb-toolbar-mode-btn.active,.mtb-toolbar-mode-btn.active:hover{background:#fff;color:#047857}.mtb-exit-btn{color:#fff}.mtb-toolbar-sep{width:16px;height:1px;margin:1px 0;align-self:center;background:#ffffff47}.mtb-exit-btn:hover{background:#ffffff47}.mtb-overlay{position:fixed;inset:0;z-index:2147483640;cursor:crosshair;touch-action:none}.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.selected{border-color:#3b82f6;background:#3b82f60a}.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:min(320px,calc(100vw - 56px));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.selected{background:#10b9811a;border-color:#10b98180}.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:48px;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:min(346px,calc(100vw - 56px));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-continuation{width:min(320px,calc(100vw - 56px));animation:none}.mtb-clarify-header{padding:8px 10px;display:flex;align-items:center;gap:7px;border-bottom:1px solid rgba(0,0,0,.06)}.mtb-clarify-icon{width:20px;height:20px;border-radius:6px;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:12px;font-weight:650;line-height:1.2;color:#191a1c}.mtb-clarify-subtitle{font-size:9.5px;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;overflow-y:auto;padding:8px 10px 4px;display:flex;flex-direction:column;gap:6px}.mtb-clarify-bubble{max-width:82%;padding:6px 10px;font-size:12px;line-height:1.4;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:11px 11px 11px 3px}.mtb-clarify-user{align-self:flex-end;background:#059669;color:#fff;border:1px solid #059669;border-radius:11px 11px 3px}.mtb-clarify-thinking{display:flex;align-items:center;gap:4px;padding:8px 12px}.mtb-clarify-thinking .mtb-dot{width:6px;height:6px;background:#059669b3}.mtb-clarify-footer{padding:3px 10px 10px;display:flex;flex-direction:column}.mtb-clarify-input{width:100%;height:40px;padding:7px 10px;border:1px solid rgba(0,0,0,.12);border-radius:8px;font-family:inherit;font-size:12px;line-height:1.4;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:6px;margin-top:6px}.mtb-clarify-skip,.mtb-clarify-fallback{flex:0 0 auto;height:30px;padding:0 12px;border:1px solid rgba(0,0,0,.12);border-radius:8px;background:#fff;cursor:pointer;font-family:inherit;font-size:12px;font-weight:550;color:#0000008c;white-space:nowrap;transition:background .12s}.mtb-clarify-skip:hover,.mtb-clarify-fallback:hover{background:#0000000a}.mtb-clarify-send,.mtb-clarify-retry{flex:1;height:30px;display:inline-flex;align-items:center;justify-content:center;gap:5px;border:none;border-radius:8px;background:#059669;color:#fff;cursor:pointer;font-family:inherit;font-size:12px;font-weight:600;transition:background .12s}.mtb-clarify-send:not(:disabled):hover,.mtb-clarify-retry:not(:disabled):hover{background:#047857}.mtb-clarify-send:disabled,.mtb-clarify-retry:disabled{background:#00000026;cursor:not-allowed}.mtb-clarify-send-feedback{width:100%;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-feedback:not(:disabled):hover{background:#047857}.mtb-clarify-send-feedback: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,:host([data-mtb-theme="dark"]) .mtb-clarify-fallback{background:#1f2327;border-color:#ffffff24;color:#ffffffb3}:host([data-mtb-theme="dark"]) .mtb-clarify-skip:hover,:host([data-mtb-theme="dark"]) .mtb-clarify-fallback: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,:host([data-mtb-theme="auto"]) .mtb-clarify-fallback{background:#1f2327;border-color:#ffffff24;color:#ffffffb3}:host([data-mtb-theme="auto"]) .mtb-clarify-skip:hover,:host([data-mtb-theme="auto"]) .mtb-clarify-fallback: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:48px;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}@media (pointer: coarse){.mtb-tab:after{content:"";position:absolute;inset:-6px 0 -6px -12px}.mtb-tab.left:after{inset:-6px -12px -6px 0}.mtb-toolbar{min-height:56px;border-radius:16px}.mtb-toolbar-mode-btn,.mtb-exit-btn,.mtb-popup-close,.mtb-cancel-btn,.mtb-submit-btn{min-height:44px}.mtb-textarea,.mtb-clarify-input,.mtb-draw-input,.mtb-email-input{font-size:16px}}@media (max-width: 480px){.mtb-tab{width:36px;height:40px;padding:0;font-size:0;writing-mode:horizontal-tb;border-radius:12px 0 0 12px;right:env(safe-area-inset-right,0px)}.mtb-tab.left{left:env(safe-area-inset-left,0px);border-radius:0 12px 12px 0}.mtb-tab:before{content:"";width:18px;height:18px;background:currentColor;-webkit-mask:var(--mtb-tab-icon) center / contain no-repeat;mask:var(--mtb-tab-icon) center / contain no-repeat}.mtb-toolbar{inset:0 0 auto;width:100%;max-width:none;max-height:none;transform:none;flex-direction:row;align-items:center;border-radius:0;gap:6px;justify-content:center;padding:env(safe-area-inset-top,0px) 8px 0;height:calc(56px + env(safe-area-inset-top,0px));animation:mtbBarInMobile .2s ease}.mtb-toolbar-modes{flex-direction:row;gap:3px;padding:3px;background:#ffffff29;border-radius:9px}.mtb-hint-bar,.mtb-toolbar-sep{display:none}.mtb-toolbar-mode-btn,.mtb-exit-btn{width:auto;height:30px;gap:6px;border-radius:7px;padding-right:10px;padding-left:10px;color:#fffffff2}.mtb-exit-btn{border-radius:8px;background:#ffffff29}.mtb-toolbar-label{display:inline}:host([data-mtb-toolbar]) .mtb-tab{display:flex}.mtb-popup{inset:auto 0 0;width:auto;max-height:85%;border-radius:20px 20px 0 0;animation:mtbSheetUp .28s cubic-bezier(.34,1.56,.64,1)}.mtb-popup-actions{padding-bottom:calc(12px + env(safe-area-inset-bottom,0px))}.mtb-clarify{inset:auto 0 0;width:auto;max-height:85%;border-radius:20px 20px 0 0}.mtb-clarify-footer{padding-bottom:calc(12px + env(safe-area-inset-bottom,0px))}.mtb-draw-bar{left:0;right:0;bottom:0;transform:none;height:auto;padding:10px 12px calc(10px + env(safe-area-inset-bottom,0px));border-radius:16px 16px 0 0}}@keyframes mtbBarInMobile{0%{transform:translateY(-14px);opacity:0}to{transform:translateY(0);opacity:1}}@keyframes mtbSheetUp{0%{transform:translateY(100%)}to{transform:translateY(0)}}`;
2
- class Kt {
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{--mtb-tab-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='8'/%3E%3Ccircle cx='12' cy='12' r='2.4' fill='%23000' stroke='none'/%3E%3Cpath d='M12 1.8v3.4M12 18.8v3.4M1.8 12h3.4M18.8 12h3.4'/%3E%3C/svg%3E");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-hint-bar{position:fixed;top:18px;left:50%;transform:translate(-50%);z-index:2147483647;display:flex;align-items:center;height:38px;padding:0 16px;border-radius:13px;background:linear-gradient(120deg,#10b981,#059669);box-shadow:0 10px 26px #0f172a38;animation:mtbHintIn .2s ease;white-space:nowrap;transition:opacity .15s ease;pointer-events:none}.mtb-hint-bar--under-pointer{opacity:.3}@keyframes mtbHintIn{0%{transform:translate(-50%,12px);opacity:0}to{transform:translate(-50%);opacity:1}}.mtb-toolbar{position:fixed;top:50%;right:8px;transform:translateY(-50%);z-index:2147483647;display:flex;flex-direction:column;align-items:center;gap:6px;width:38px;padding:6px 0;max-height:calc(100vh - 24px);border-radius:19px;background:linear-gradient(160deg,#10b981,#059669);box-shadow:0 8px 22px #0f172a33;animation:mtbEdgeBarIn .2s ease;white-space:nowrap;pointer-events:none}.mtb-toolbar.left{right:auto;left:8px;animation:mtbEdgeBarInLeft .2s ease}@keyframes mtbBarIn{0%{transform:translate(-50%,12px);opacity:0}to{transform:translate(-50%);opacity:1}}@keyframes mtbEdgeBarIn{0%{transform:translate(12px,-50%);opacity:0}to{transform:translateY(-50%);opacity:1}}@keyframes mtbEdgeBarInLeft{0%{transform:translate(-12px,-50%);opacity:0}to{transform:translateY(-50%);opacity:1}}.mtb-toolbar-label{display:none}:host([data-mtb-toolbar]) .mtb-tab{display:none}.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:20px;height:1px;align-self:center;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-toolbar-modes{flex-direction:column;gap:6px;padding:0;background:none;border-radius:0}.mtb-toolbar-mode-btn,.mtb-exit-btn{pointer-events:auto;display:flex;align-items:center;justify-content:center;gap:0;width:30px;height:30px;padding:0;border-radius:50%;background:none;color:#ffffffb8}.mtb-toolbar-mode-btn:hover,.mtb-exit-btn:hover{background:#ffffff29;color:#fff}.mtb-toolbar-mode-btn.active,.mtb-toolbar-mode-btn.active:hover{background:#fff;color:#047857}.mtb-exit-btn{color:#fff}.mtb-toolbar-sep{width:16px;height:1px;margin:1px 0;align-self:center;background:#ffffff47}.mtb-exit-btn:hover{background:#ffffff47}.mtb-overlay{position:fixed;inset:0;z-index:2147483640;cursor:crosshair;touch-action:none}.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.selected{border-color:#3b82f6;background:#3b82f60a}.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:min(320px,calc(100vw - 56px));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.selected{background:#10b9811a;border-color:#10b98180}.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:48px;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:min(346px,calc(100vw - 56px));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-continuation{width:min(320px,calc(100vw - 56px));animation:none}.mtb-clarify-header{padding:8px 10px;display:flex;align-items:center;gap:7px;border-bottom:1px solid rgba(0,0,0,.06)}.mtb-clarify-icon{width:20px;height:20px;border-radius:6px;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:12px;font-weight:650;line-height:1.2;color:#191a1c}.mtb-clarify-subtitle{font-size:9.5px;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;overflow-y:auto;padding:8px 10px 4px;display:flex;flex-direction:column;gap:6px}.mtb-clarify-bubble{max-width:82%;padding:6px 10px;font-size:12px;line-height:1.4;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:11px 11px 11px 3px}.mtb-clarify-user{align-self:flex-end;background:#059669;color:#fff;border:1px solid #059669;border-radius:11px 11px 3px}.mtb-clarify-thinking{display:flex;align-items:center;gap:4px;padding:8px 12px}.mtb-clarify-thinking .mtb-dot{width:6px;height:6px;background:#059669b3}.mtb-clarify-footer{padding:3px 10px 10px;display:flex;flex-direction:column}.mtb-clarify-input{width:100%;height:40px;padding:7px 10px;border:1px solid rgba(0,0,0,.12);border-radius:8px;font-family:inherit;font-size:12px;line-height:1.4;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:6px;margin-top:6px}.mtb-clarify-skip,.mtb-clarify-fallback{flex:0 0 auto;height:30px;padding:0 12px;border:1px solid rgba(0,0,0,.12);border-radius:8px;background:#fff;cursor:pointer;font-family:inherit;font-size:12px;font-weight:550;color:#0000008c;white-space:nowrap;transition:background .12s}.mtb-clarify-skip:hover,.mtb-clarify-fallback:hover{background:#0000000a}.mtb-clarify-send,.mtb-clarify-retry{flex:1;height:30px;display:inline-flex;align-items:center;justify-content:center;gap:5px;border:none;border-radius:8px;background:#059669;color:#fff;cursor:pointer;font-family:inherit;font-size:12px;font-weight:600;transition:background .12s}.mtb-clarify-send:not(:disabled):hover,.mtb-clarify-retry:not(:disabled):hover{background:#047857}.mtb-clarify-send:disabled,.mtb-clarify-retry:disabled{background:#00000026;cursor:not-allowed}.mtb-clarify-send-feedback{width:100%;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-feedback:not(:disabled):hover{background:#047857}.mtb-clarify-send-feedback: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,:host([data-mtb-theme="dark"]) .mtb-clarify-fallback{background:#1f2327;border-color:#ffffff24;color:#ffffffb3}:host([data-mtb-theme="dark"]) .mtb-clarify-skip:hover,:host([data-mtb-theme="dark"]) .mtb-clarify-fallback: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,:host([data-mtb-theme="auto"]) .mtb-clarify-fallback{background:#1f2327;border-color:#ffffff24;color:#ffffffb3}:host([data-mtb-theme="auto"]) .mtb-clarify-skip:hover,:host([data-mtb-theme="auto"]) .mtb-clarify-fallback: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:48px;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}@media (pointer: coarse){.mtb-tab:after{content:"";position:absolute;inset:-6px 0 -6px -12px}.mtb-tab.left:after{inset:-6px -12px -6px 0}.mtb-toolbar{min-height:56px;border-radius:16px}.mtb-toolbar-mode-btn,.mtb-exit-btn,.mtb-popup-close,.mtb-cancel-btn,.mtb-submit-btn{min-height:44px}.mtb-textarea,.mtb-clarify-input,.mtb-draw-input,.mtb-email-input{font-size:16px}}@media (max-width: 480px){.mtb-tab{width:36px;height:40px;padding:0;font-size:0;writing-mode:horizontal-tb;border-radius:12px 0 0 12px;right:env(safe-area-inset-right,0px)}.mtb-tab.left{left:env(safe-area-inset-left,0px);border-radius:0 12px 12px 0}.mtb-tab:before{content:"";width:18px;height:18px;background:currentColor;-webkit-mask:var(--mtb-tab-icon) center / contain no-repeat;mask:var(--mtb-tab-icon) center / contain no-repeat}.mtb-toolbar{inset:0 0 auto;width:100%;max-width:none;max-height:none;transform:none;flex-direction:row;align-items:center;border-radius:0;gap:6px;justify-content:center;padding:env(safe-area-inset-top,0px) 8px 0;height:calc(56px + env(safe-area-inset-top,0px));animation:mtbBarInMobile .2s ease}.mtb-toolbar-modes{flex-direction:row;gap:3px;padding:3px;background:#ffffff29;border-radius:9px}.mtb-hint-bar,.mtb-toolbar-sep{display:none}.mtb-toolbar-mode-btn,.mtb-exit-btn{width:auto;height:30px;gap:6px;border-radius:7px;padding-right:10px;padding-left:10px;color:#fffffff2}.mtb-exit-btn{border-radius:8px;background:#ffffff29}.mtb-toolbar-label{display:inline}:host([data-mtb-toolbar]) .mtb-tab{display:flex}.mtb-popup{inset:auto 0 0;width:auto;max-height:85%;border-radius:20px 20px 0 0;animation:mtbSheetUp .28s cubic-bezier(.34,1.56,.64,1)}.mtb-popup-actions{padding-bottom:calc(12px + env(safe-area-inset-bottom,0px))}.mtb-clarify{inset:auto 0 0;width:auto;max-height:85%;border-radius:20px 20px 0 0}.mtb-clarify-footer{padding-bottom:calc(12px + env(safe-area-inset-bottom,0px))}.mtb-draw-bar{left:0;right:0;bottom:0;transform:none;height:auto;padding:10px 12px calc(10px + env(safe-area-inset-bottom,0px));border-radius:16px 16px 0 0}}@keyframes mtbBarInMobile{0%{transform:translateY(-14px);opacity:0}to{transform:translateY(0);opacity:1}}@keyframes mtbSheetUp{0%{transform:translateY(100%)}to{transform:translateY(0)}}`;
2
+ class Jt {
3
3
  constructor(t = "auto") {
4
4
  const e = document.getElementById("mtb-widget-host");
5
5
  this.ownsHost = !e, this.host = e ?? 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), this.ownsHost && document.body.appendChild(this.host), this.root = this.host.shadowRoot ?? this.host.attachShadow({ mode: "open" }), this.root.replaceChildren();
6
6
  const r = document.createElement("style");
7
- r.textContent = Xt, this.root.appendChild(r);
7
+ r.textContent = Gt, this.root.appendChild(r);
8
8
  }
9
9
  el(t, e) {
10
10
  const r = document.createElement(t);
@@ -25,7 +25,7 @@ class Kt {
25
25
  this.host.remove();
26
26
  }
27
27
  }
28
- class Gt {
28
+ class Qt {
29
29
  constructor(t, e, r, n, s) {
30
30
  this.active = !1, this.onClick = n, this.customText = s, this.el = t.el("button", "mtb-tab"), r === "left" && this.el.classList.add("left"), this.idleLabel = s ?? e.tab, this.activeLabel = e.toolbar.exit, this.setLabel(this.idleLabel), this.el.addEventListener("click", n), t.append(this.el);
31
31
  }
@@ -42,8 +42,8 @@ class Gt {
42
42
  this.el.removeEventListener("click", this.onClick), this.el.remove();
43
43
  }
44
44
  }
45
- const Jt = 8e3;
46
- class Qt {
45
+ const Zt = 8e3;
46
+ class te {
47
47
  constructor(t, e, r) {
48
48
  this.autoHideTimer = null, this.el = t.el("div", "mtb-frustration-prompt"), this.el.innerHTML = `
49
49
  <div class="mtb-frustration-icon">&#9888;&#65039;</div>
@@ -52,13 +52,13 @@ class Qt {
52
52
  <button class="mtb-frustration-tell">${e.frustration.action}</button>
53
53
  <button class="mtb-frustration-dismiss">${e.frustration.dismiss}</button>
54
54
  </div>
55
- `, this.el.querySelector(".mtb-frustration-tell").addEventListener("click", r.onTell), this.el.querySelector(".mtb-frustration-dismiss").addEventListener("click", r.onDismiss), t.append(this.el), this.autoHideTimer = setTimeout(r.onAutoHide, Jt);
55
+ `, this.el.querySelector(".mtb-frustration-tell").addEventListener("click", r.onTell), this.el.querySelector(".mtb-frustration-dismiss").addEventListener("click", r.onDismiss), t.append(this.el), this.autoHideTimer = setTimeout(r.onAutoHide, Zt);
56
56
  }
57
57
  destroy() {
58
58
  this.autoHideTimer && (clearTimeout(this.autoHideTimer), this.autoHideTimer = null), this.el.remove();
59
59
  }
60
60
  }
61
- class Zt {
61
+ class ee {
62
62
  constructor(t, e) {
63
63
  this.onClick = e, this.el = t.el("div", "mtb-dim mtb-dim-clickable"), this.el.addEventListener("click", this.onClick), t.append(this.el);
64
64
  }
@@ -66,28 +66,24 @@ class Zt {
66
66
  this.el.removeEventListener("click", this.onClick), this.el.remove();
67
67
  }
68
68
  }
69
- class te {
69
+ function Lt() {
70
+ return window.matchMedia?.("(pointer: coarse)").matches ?? !1;
71
+ }
72
+ class ie {
70
73
  constructor() {
71
- this.locked = !1, this.prevOverflow = "", this.prevTouchAction = "", this.anchorX = 0, this.anchorY = 0, this.onScroll = () => {
72
- (window.scrollX !== this.anchorX || window.scrollY !== this.anchorY) && window.scrollTo(this.anchorX, this.anchorY);
73
- };
74
- }
75
- // No matchMedia means no evidence of a touch device — assume a mouse and
76
- // leave the host page alone.
77
- isTouchPointer() {
78
- return window.matchMedia?.("(pointer: coarse)").matches ?? !1;
74
+ this.locked = !1, this.prevOverflow = "", this.prevTouchAction = "";
79
75
  }
80
76
  lock() {
81
- this.locked || !this.isTouchPointer() || (this.locked = !0, this.prevOverflow = document.body.style.overflow, this.prevTouchAction = document.body.style.touchAction, document.body.style.overflow = "hidden", document.body.style.touchAction = "none", this.anchorX = window.scrollX, this.anchorY = window.scrollY, window.addEventListener("scroll", this.onScroll, { passive: !0 }));
77
+ this.locked || !Lt() || (this.locked = !0, this.prevOverflow = document.body.style.overflow, this.prevTouchAction = document.body.style.touchAction, document.body.style.overflow = "hidden", document.body.style.touchAction = "none");
82
78
  }
83
79
  unlock() {
84
- this.locked && (this.locked = !1, window.removeEventListener("scroll", this.onScroll), document.body.style.overflow = this.prevOverflow, document.body.style.touchAction = this.prevTouchAction);
80
+ this.locked && (this.locked = !1, document.body.style.overflow = this.prevOverflow, document.body.style.touchAction = this.prevTouchAction);
85
81
  }
86
82
  isLocked() {
87
83
  return this.locked;
88
84
  }
89
85
  }
90
- class ee {
86
+ class re {
91
87
  constructor(t, e, r, n, s = "right") {
92
88
  this.currentMode = "markup", this.handlePointerMove = (o) => {
93
89
  if (o.pointerType !== "mouse") return;
@@ -127,7 +123,7 @@ class ee {
127
123
  document.removeEventListener("pointermove", this.handlePointerMove), this.host.removeAttribute("data-mtb-toolbar"), this.hintBarEl.remove(), this.el.remove();
128
124
  }
129
125
  }
130
- class ie {
126
+ class ne {
131
127
  constructor(t, e) {
132
128
  this.handlers = e, this.overlayEl = t.el("div", "mtb-overlay"), this.onPointerDown = (r) => {
133
129
  const n = r;
@@ -159,7 +155,7 @@ class ie {
159
155
  this.overlayEl.removeEventListener("pointerdown", this.onPointerDown), this.overlayEl.removeEventListener("pointermove", this.onPointerMove), this.overlayEl.removeEventListener("pointerup", this.onPointerUp), this.overlayEl.removeEventListener("pointercancel", this.onPointerCancel), this.overlayEl.remove(), this.dimEl.remove();
160
156
  }
161
157
  }
162
- class re {
158
+ class se {
163
159
  constructor(t) {
164
160
  this.highlightEl = t.el("div", "mtb-highlight"), this.tooltipEl = t.el("div", "mtb-highlight-tooltip"), this.hide(), t.append(this.highlightEl, this.tooltipEl);
165
161
  }
@@ -182,12 +178,12 @@ class re {
182
178
  this.highlightEl.remove(), this.tooltipEl.remove();
183
179
  }
184
180
  }
185
- const ne = /^(script|style|noscript|template)$/i;
186
- function Tt(i, t = 80) {
181
+ const oe = /^(script|style|noscript|template)$/i;
182
+ function Mt(i, t = 80) {
187
183
  let e = "";
188
184
  for (const r of Array.from(i.childNodes)) {
189
185
  if (e.length >= t) break;
190
- r.nodeType === 3 ? e += r.nodeValue ?? "" : r instanceof Element && !ne.test(r.tagName) && (e += Tt(r, t - e.length));
186
+ r.nodeType === 3 ? e += r.nodeValue ?? "" : r instanceof Element && !oe.test(r.tagName) && (e += Mt(r, t - e.length));
191
187
  }
192
188
  return e;
193
189
  }
@@ -197,7 +193,7 @@ function G(i) {
197
193
  if (t) return t;
198
194
  const e = i.getAttribute("title");
199
195
  if (e) return e;
200
- const r = Tt(i).trim().slice(0, 40);
196
+ const r = Mt(i).trim().slice(0, 40);
201
197
  if (r) return r;
202
198
  const n = i.placeholder;
203
199
  if (n) return n;
@@ -208,7 +204,7 @@ function G(i) {
208
204
  }
209
205
  return i.tagName.toLowerCase();
210
206
  }
211
- function Lt(i) {
207
+ function Pt(i) {
212
208
  const t = [];
213
209
  let e = i;
214
210
  for (; e && e !== document.body && t.length < 5; ) {
@@ -233,7 +229,7 @@ function Lt(i) {
233
229
  }
234
230
  return t.join(" > ");
235
231
  }
236
- class se {
232
+ class ae {
237
233
  constructor(t) {
238
234
  this.pins = [], this.shadow = t;
239
235
  }
@@ -249,18 +245,18 @@ class se {
249
245
  this.clearAll();
250
246
  }
251
247
  }
252
- const z = "#059669", oe = "5,150,105";
248
+ const z = "#059669", le = "5,150,105";
253
249
  function J(i) {
254
- return `rgba(${oe},${i})`;
250
+ return `rgba(${le},${i})`;
255
251
  }
256
- const ae = '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif', C = {
252
+ const ce = '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif', C = {
257
253
  color: z,
258
254
  width: "3.5",
259
255
  linecap: "round",
260
256
  linejoin: "round",
261
257
  filter: `drop-shadow(0 1px 2px ${J(0.35)})`
262
258
  };
263
- class le {
259
+ class de {
264
260
  constructor(t) {
265
261
  this.currentPath = null, this.currentPoints = [], this.isDrawing = !1, this.committed = [], this.redoStack = [], this.svg = document.createElementNS("http://www.w3.org/2000/svg", "svg"), this.svg.setAttribute("class", "mtb-draw-svg"), t.append(this.svg);
266
262
  }
@@ -315,7 +311,7 @@ class le {
315
311
  }
316
312
  getAnnotation() {
317
313
  if (this.committed.length === 0) return null;
318
- const t = this.committed.flatMap((n) => n.points), [e, r] = ce(t);
314
+ const t = this.committed.flatMap((n) => n.points), [e, r] = he(t);
319
315
  return {
320
316
  type: "draw",
321
317
  x: e,
@@ -348,14 +344,14 @@ function it(i) {
348
344
  }
349
345
  return r;
350
346
  }
351
- function ce(i) {
347
+ function he(i) {
352
348
  const t = i.map((s) => s[0]), e = i.map((s) => s[1]), r = (Math.min(...t) + Math.max(...t)) / 2, n = (Math.min(...e) + Math.max(...e)) / 2;
353
349
  return [r, n];
354
350
  }
355
- const de = 10;
356
- class he {
351
+ const ue = 10;
352
+ class me {
357
353
  constructor(t, e, r) {
358
- this.messages = e, this.handlers = r, this.interactionActive = !0, this.pendingHighlightFrame = null, this.lastMoveX = 0, this.lastMoveY = 0, this.highlighter = new re(t), this.pinMarker = new se(t), this.drawLayer = new le(t), this.overlay = new ie(t, {
354
+ this.messages = e, this.handlers = r, this.interactionActive = !0, this.pendingHighlightFrame = null, this.lastMoveX = 0, this.lastMoveY = 0, this.highlighter = new se(t), this.pinMarker = new ae(t), this.drawLayer = new de(t), this.overlay = new ne(t, {
359
355
  onPointerDown: (n) => this.handlePointerDown(n),
360
356
  onPointerMove: (n) => this.handlePointerMove(n),
361
357
  onPointerUp: (n) => this.handlePointerUp(n),
@@ -394,7 +390,7 @@ class he {
394
390
  // draw note bar; a tap on an element becomes a pin. Stray taps while a
395
391
  // drawing already exists are ignored so they don't hijack the draw flow.
396
392
  finishStroke(t) {
397
- if (this.drawLayer.getCurrentSpan() >= de) {
393
+ if (this.drawLayer.getCurrentSpan() >= ue) {
398
394
  this.drawLayer.commitStroke(), this.highlighter.hide(), this.handlers.onDrawStroke();
399
395
  return;
400
396
  }
@@ -403,7 +399,7 @@ class he {
403
399
  type: "pin",
404
400
  x: t.clientX,
405
401
  y: t.clientY,
406
- targetSelector: e ? Lt(e) : void 0,
402
+ targetSelector: e ? Pt(e) : void 0,
407
403
  targetText: e?.textContent?.trim().slice(0, 200) ?? "",
408
404
  targetName: r,
409
405
  targetRect: n ? { top: n.top, left: n.left, width: n.width, height: n.height, bottom: n.bottom } : void 0
@@ -447,15 +443,15 @@ class he {
447
443
  function rt(i, t) {
448
444
  return document.elementsFromPoint(i, t).find((e) => e.id !== "mtb-widget-host") ?? null;
449
445
  }
450
- const ue = "mtb-widget-host";
446
+ const fe = "mtb-widget-host";
451
447
  function S(i) {
452
- const t = document.getElementById(ue);
448
+ const t = document.getElementById(fe);
453
449
  return t ? t === i || t.contains(i) : !1;
454
450
  }
455
451
  function h(i) {
456
452
  return i.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#039;");
457
453
  }
458
- class me {
454
+ class be {
459
455
  constructor() {
460
456
  this.onChange = null, this.handler = () => {
461
457
  this.onChange?.(this.current());
@@ -474,17 +470,17 @@ class me {
474
470
  this.onChange = null, t && (t.removeEventListener("resize", this.handler), t.removeEventListener("scroll", this.handler));
475
471
  }
476
472
  }
477
- const fe = 480;
478
- function be() {
479
- return window.innerWidth <= fe;
473
+ const pe = 480;
474
+ function ge() {
475
+ return window.innerWidth <= pe;
480
476
  }
481
477
  class Q {
482
478
  constructor(t) {
483
- this.el = t, this.inset = new me();
479
+ this.el = t, this.inset = new be();
484
480
  }
485
481
  /** Returns true when this took over layout, i.e. the caller should not position. */
486
482
  apply() {
487
- return be() ? (this.el.style.left = "", this.el.style.top = "", this.el.style.maxHeight = "", this.lift(this.inset.current()), this.inset.observe((t) => this.lift(t)), !0) : !1;
483
+ return ge() ? (this.el.style.left = "", this.el.style.top = "", this.el.style.maxHeight = "", this.lift(this.inset.current()), this.inset.observe((t) => this.lift(t)), !0) : !1;
488
484
  }
489
485
  release() {
490
486
  this.inset.stop();
@@ -493,7 +489,7 @@ class Q {
493
489
  this.el.style.bottom = t > 0 ? `${t}px` : "";
494
490
  }
495
491
  }
496
- class pe {
492
+ class ye {
497
493
  constructor(t, e) {
498
494
  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.sheet = new Q(this.el), this.sheet.apply(), 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) => {
499
495
  r.isComposing || r.keyCode === 229 || r.key === "Enter" && !r.shiftKey && (r.preventDefault(), this.submit());
@@ -530,7 +526,7 @@ class pe {
530
526
  this.sheet.release(), this.el.remove();
531
527
  }
532
528
  }
533
- class ge {
529
+ class nt {
534
530
  constructor(t, e) {
535
531
  this.loading = !1, this.selectedQuickOption = null, this.onSubmit = e.onSubmit, this.onClose = e.onClose, this.submitLabel = e.messages.popup.submit, this.messages = e.messages, this.el = t.el("div", "mtb-popup"), this.el.innerHTML = this.buildHTML(e), t.append(this.el), this.sheet = new Q(this.el), this.textarea = this.el.querySelector(".mtb-textarea"), this.submitBtn = this.el.querySelector(".mtb-submit-btn"), this.positionPopup(e.x, e.y, e.targetRect, e.position ?? "right"), this.bindEvents(e.messages), e.onMyFeedback && this.el.querySelector(".mtb-my-feedback").addEventListener("click", e.onMyFeedback), this.textarea.focus({ preventScroll: !0 });
536
532
  }
@@ -576,8 +572,8 @@ class ge {
576
572
  if (this.sheet.apply()) return;
577
573
  const s = window.innerWidth, o = window.innerHeight, a = 12, l = 8, c = 32, d = Math.min(320, s - 2 * a - c), u = this.el.offsetHeight || 260, m = a + (n === "left" ? c : 0), g = s - a - (n === "right" ? c : 0);
578
574
  let y, w;
579
- const Yt = r && r.width < s * 0.6 && r.height < o * 0.6;
580
- r && Yt ? (y = r.left, w = r.bottom + l, w + u > o - a && (w = r.top - u - l), w < a && (w = Math.min(r.bottom + l, o - u - a))) : (y = t + 12, w = e + 12), y + d > g && (y = g - d), y < m && (y = m), w < a && (w = a), this.el.style.left = `${y}px`, this.el.style.top = `${w}px`, this.el.style.maxHeight = `${o - w - a}px`;
575
+ const Kt = r && r.width < s * 0.6 && r.height < o * 0.6;
576
+ r && Kt ? (y = r.left, w = r.bottom + l, w + u > o - a && (w = r.top - u - l), w < a && (w = Math.min(r.bottom + l, o - u - a))) : (y = t + 12, w = e + 12), y + d > g && (y = g - d), y < m && (y = m), w < a && (w = a), this.el.style.left = `${y}px`, this.el.style.top = `${w}px`, this.el.style.maxHeight = `${o - w - a}px`;
581
577
  }
582
578
  bindEvents(t) {
583
579
  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) => {
@@ -618,18 +614,18 @@ class ge {
618
614
  this.sheet.release(), this.el.remove();
619
615
  }
620
616
  }
621
- class Mt extends Error {
617
+ class At extends Error {
622
618
  constructor(t) {
623
619
  super(`HTTP ${t}`), this.name = "ApiError", this.status = t;
624
620
  }
625
621
  }
626
- function ye(i) {
627
- return i instanceof Mt && i.status === 409;
622
+ function we(i) {
623
+ return i instanceof At && i.status === 409;
628
624
  }
629
- const we = "https://makethisbetter.dev/api/v1";
630
- class xe {
625
+ const xe = "https://makethisbetter.dev/api/v1";
626
+ class ve {
631
627
  constructor(t, e, r = 1e3, n, s) {
632
- this.projectKey = t, this.apiUrl = (e ?? we).replace(/\/$/, ""), this.retryDelayMs = r, this.userToken = n, this.userTokenFn = s;
628
+ this.projectKey = t, this.apiUrl = (e ?? xe).replace(/\/$/, ""), this.retryDelayMs = r, this.userToken = n, this.userTokenFn = s;
633
629
  }
634
630
  async resolveUserToken() {
635
631
  return this.userTokenFn ? this.userTokenFn() : this.userToken;
@@ -643,7 +639,7 @@ class xe {
643
639
  return r["X-Submission-Token"] = t, r;
644
640
  }
645
641
  async createSubmissionSession(t, e) {
646
- const r = Se(), n = new FormData();
642
+ const r = Ee(), n = new FormData();
647
643
  if (n.append("feedback[description]", t.description), n.append("feedback[page_url]", t.page_url), n.append("feedback[user_agent]", t.user_agent), n.append("feedback[browser]", t.browser), n.append("feedback[os]", t.os), n.append("feedback[screen_width]", String(t.screen_width)), n.append("feedback[screen_height]", String(t.screen_height)), n.append("feedback[console_errors]", JSON.stringify(t.console_errors)), n.append("feedback[annotations]", JSON.stringify(t.annotations)), t.target_element && n.append("feedback[target_element]", JSON.stringify(t.target_element)), t.user_id && n.append("feedback[user_id]", t.user_id), t.reporter_external_id && n.append("feedback[reporter_external_id]", t.reporter_external_id), t.reporter_email && n.append("feedback[reporter_email]", t.reporter_email), t.user_email && n.append("feedback[user_email]", t.user_email), t.user_name && n.append("feedback[user_name]", t.user_name), t.breadcrumbs && t.breadcrumbs.length > 0 && n.append("feedback[breadcrumbs]", JSON.stringify(t.breadcrumbs)), t.recording_events && t.recording_events.length > 0) {
648
644
  const l = JSON.stringify(t.recording_events), c = new Blob([l], { type: "application/json" });
649
645
  n.append("feedback[recording]", c, "interaction-replay.json"), n.append("feedback[recording_duration]", String(t.recording_duration ?? 0));
@@ -653,7 +649,7 @@ class xe {
653
649
  n.append("feedback[screenshot]", e, `screenshot.${l}`);
654
650
  }
655
651
  const s = await this.authHeaders();
656
- return s["X-Submission-Token"] = r, s["X-Idempotency-Key"] = ke(), { ...(await (await this.fetchWithRetry(`${this.apiUrl}/widget/feedback_submission_sessions`, {
652
+ return s["X-Submission-Token"] = r, s["X-Idempotency-Key"] = Se(), { ...(await (await this.fetchWithRetry(`${this.apiUrl}/widget/feedback_submission_sessions`, {
657
653
  method: "POST",
658
654
  headers: s,
659
655
  body: n
@@ -720,7 +716,7 @@ class xe {
720
716
  }), a = o.headers.get("Content-Type") ?? "";
721
717
  if (!o.ok || !o.body || !a.includes("text/event-stream"))
722
718
  throw new Error("clarify stream unavailable");
723
- return ve(o.body, r);
719
+ return ke(o.body, r);
724
720
  }
725
721
  async finalizeSubmissionSession(t, e) {
726
722
  const r = await this.submissionHeaders(e);
@@ -742,19 +738,19 @@ class xe {
742
738
  n = await fetch(t, e);
743
739
  } catch (s) {
744
740
  if (r > 0)
745
- return await nt(this.retryDelayMs), this.fetchWithRetry(t, e, r - 1);
741
+ return await st(this.retryDelayMs), this.fetchWithRetry(t, e, r - 1);
746
742
  throw s;
747
743
  }
748
744
  if (n.ok) return n;
749
745
  if (n.status >= 500 && r > 0)
750
- return await nt(this.retryDelayMs), this.fetchWithRetry(t, e, r - 1);
751
- throw new Mt(n.status);
746
+ return await st(this.retryDelayMs), this.fetchWithRetry(t, e, r - 1);
747
+ throw new At(n.status);
752
748
  }
753
749
  }
754
- function nt(i) {
750
+ function st(i) {
755
751
  return i <= 0 ? Promise.resolve() : new Promise((t) => setTimeout(t, i));
756
752
  }
757
- async function ve(i, t) {
753
+ async function ke(i, t) {
758
754
  const e = i.getReader(), r = new TextDecoder();
759
755
  let n = "", s = null;
760
756
  const o = (a) => {
@@ -793,17 +789,17 @@ async function ve(i, t) {
793
789
  if (!s) throw new Error("clarify stream ended before done");
794
790
  return s;
795
791
  }
796
- function ke() {
792
+ function Se() {
797
793
  return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : `${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 12)}`;
798
794
  }
799
- function Se() {
795
+ function Ee() {
800
796
  if (typeof crypto > "u" || typeof crypto.getRandomValues != "function")
801
797
  throw new Error("Secure random generation is unavailable");
802
798
  const i = crypto.getRandomValues(new Uint8Array(32));
803
799
  return Array.from(i, (t) => t.toString(16).padStart(2, "0")).join("");
804
800
  }
805
- const Ee = 2e3, Ce = 45e3, _e = 346, Te = 270;
806
- class Le {
801
+ const Ce = 2e3, _e = 45e3, Te = 346, Le = 270;
802
+ class Me {
807
803
  constructor(t, e) {
808
804
  this.pollTimer = null, this.pollDeadline = 0, this.streamingBubble = null, this.lastMessages = [], this.done = !1, this.sending = !1, this.finalizing = !1, this.destroyed = !1, this.unrecoverable = !1, this.submissionSessionId = e.submissionSessionId, this.submissionToken = e.submissionToken, this.apiClient = e.apiClient, this.onFinalize = e.onFinalize, this.i18n = e.messages, this.preloadedResult = e.preloadedResult, this.pendingClarification = e.pendingClarification;
809
805
  const r = e.element;
@@ -813,7 +809,7 @@ class Le {
813
809
  // never overflows a screen edge (mirrors CommentPopup.positionPopup).
814
810
  positionCard(t, e, r) {
815
811
  if (this.sheet.apply()) return;
816
- const n = window.innerWidth, s = window.innerHeight, o = 12, a = 32, l = Math.min(_e, n - 2 * o - a), c = this.el.offsetHeight || Te, d = o + (r === "left" ? a : 0), u = n - o - (r === "right" ? a : 0);
812
+ const n = window.innerWidth, s = window.innerHeight, o = 12, a = 32, l = Math.min(Te, n - 2 * o - a), c = this.el.offsetHeight || Le, d = o + (r === "left" ? a : 0), u = n - o - (r === "right" ? a : 0);
817
813
  if (t === void 0 || e === void 0) {
818
814
  const y = Math.max(d, (n - l) / 2);
819
815
  this.el.style.left = `${Math.min(y, u - l)}px`, this.el.style.top = `${Math.max(o, (s - c) / 2)}px`, this.el.style.maxHeight = `${s - 2 * o}px`;
@@ -956,7 +952,7 @@ class Le {
956
952
  this.streamingBubble = null;
957
953
  }
958
954
  startPolling() {
959
- this.stopPolling(), this.pollDeadline = Date.now() + Ce, this.pollTimer = setInterval(() => this.poll(), Ee);
955
+ this.stopPolling(), this.pollDeadline = Date.now() + _e, this.pollTimer = setInterval(() => this.poll(), Ce);
960
956
  }
961
957
  stopPolling() {
962
958
  this.pollTimer !== null && (clearInterval(this.pollTimer), this.pollTimer = null);
@@ -1050,7 +1046,7 @@ class Le {
1050
1046
  await this.onFinalize();
1051
1047
  } catch (t) {
1052
1048
  if (this.destroyed) return;
1053
- if (this.finalizing = !1, this.clearError(), ye(t)) {
1049
+ if (this.finalizing = !1, this.clearError(), we(t)) {
1054
1050
  this.showUnrecoverable();
1055
1051
  return;
1056
1052
  }
@@ -1102,8 +1098,8 @@ class Le {
1102
1098
  this.destroyed = !0, this.stopPolling(), this.sheet.release(), this.el.remove();
1103
1099
  }
1104
1100
  }
1105
- const Me = 5e3, Pe = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
1106
- class Ae {
1101
+ const Pe = 5e3, Ae = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
1102
+ class Re {
1107
1103
  constructor(t, e, r, n, s) {
1108
1104
  this.messages = e, this.el = t.el("div", "mtb-success"), this.el.style.right = "20px", this.el.style.bottom = "20px";
1109
1105
  const o = s?.skipFollowup ? e.success.title_no_ai : e.success.title, a = s?.skipFollowup ? e.success.message_no_ai : e.success.message, l = n ? `<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 = s?.emailCapture ? `
@@ -1126,12 +1122,12 @@ class Ae {
1126
1122
  ${c}
1127
1123
  ${l}
1128
1124
  <button class="mtb-close-link">${e.success.close}</button>
1129
- `, t.append(this.el), this.el.querySelector(".mtb-close-link").addEventListener("click", r), n && this.el.querySelector(".mtb-view-feedback-link").addEventListener("click", n), s?.emailCapture ? this.bindEmailCapture(s.emailCapture.onSubmit) : setTimeout(() => r(), Me);
1125
+ `, t.append(this.el), this.el.querySelector(".mtb-close-link").addEventListener("click", r), n && this.el.querySelector(".mtb-view-feedback-link").addEventListener("click", n), s?.emailCapture ? this.bindEmailCapture(s.emailCapture.onSubmit) : setTimeout(() => r(), Pe);
1130
1126
  }
1131
1127
  bindEmailCapture(t) {
1132
1128
  const e = this.el.querySelector(".mtb-email-input"), r = this.el.querySelector(".mtb-email-submit"), n = this.el.querySelector(".mtb-email-error"), s = async () => {
1133
1129
  const o = e.value.trim();
1134
- if (!Pe.test(o)) {
1130
+ if (!Ae.test(o)) {
1135
1131
  e.classList.add("mtb-email-invalid");
1136
1132
  return;
1137
1133
  }
@@ -1145,7 +1141,7 @@ class Ae {
1145
1141
  this.el.remove();
1146
1142
  }
1147
1143
  }
1148
- function Re(i, t) {
1144
+ function De(i, t) {
1149
1145
  if (i.match(/^[a-z]+:\/\//i))
1150
1146
  return i;
1151
1147
  if (i.match(/^\/\//))
@@ -1170,26 +1166,26 @@ function x(i) {
1170
1166
  return t;
1171
1167
  }
1172
1168
  let v = null;
1173
- function Pt(i = {}) {
1169
+ function Rt(i = {}) {
1174
1170
  return v || (i.includeStyleProperties ? (v = i.includeStyleProperties, v) : (v = x(window.getComputedStyle(document.documentElement)), v));
1175
1171
  }
1176
1172
  function $(i, t) {
1177
1173
  const r = (i.ownerDocument.defaultView || window).getComputedStyle(i).getPropertyValue(t);
1178
1174
  return r ? parseFloat(r.replace("px", "")) : 0;
1179
1175
  }
1180
- function De(i) {
1176
+ function He(i) {
1181
1177
  const t = $(i, "border-left-width"), e = $(i, "border-right-width");
1182
1178
  return i.clientWidth + t + e;
1183
1179
  }
1184
- function He(i) {
1180
+ function $e(i) {
1185
1181
  const t = $(i, "border-top-width"), e = $(i, "border-bottom-width");
1186
1182
  return i.clientHeight + t + e;
1187
1183
  }
1188
- function At(i, t = {}) {
1189
- const e = t.width || De(i), r = t.height || He(i);
1184
+ function Dt(i, t = {}) {
1185
+ const e = t.width || He(i), r = t.height || $e(i);
1190
1186
  return { width: e, height: r };
1191
1187
  }
1192
- function $e() {
1188
+ function Be() {
1193
1189
  let i, t;
1194
1190
  try {
1195
1191
  t = process;
@@ -1199,7 +1195,7 @@ function $e() {
1199
1195
  return e && (i = parseInt(e, 10), Number.isNaN(i) && (i = 1)), i || window.devicePixelRatio || 1;
1200
1196
  }
1201
1197
  const p = 16384;
1202
- function Be(i) {
1198
+ function Fe(i) {
1203
1199
  (i.width > p || i.height > p) && (i.width > p && i.height > p ? i.width > i.height ? (i.height *= p / i.width, i.width = p) : (i.width *= p / i.height, i.height = p) : i.width > p ? (i.height *= p / i.width, i.width = p) : (i.width *= p / i.height, i.height = p));
1204
1200
  }
1205
1201
  function B(i) {
@@ -1212,12 +1208,12 @@ function B(i) {
1212
1208
  }, r.onerror = e, r.crossOrigin = "anonymous", r.decoding = "async", r.src = i;
1213
1209
  });
1214
1210
  }
1215
- async function Fe(i) {
1211
+ async function Ue(i) {
1216
1212
  return Promise.resolve().then(() => new XMLSerializer().serializeToString(i)).then(encodeURIComponent).then((t) => `data:image/svg+xml;charset=utf-8,${t}`);
1217
1213
  }
1218
- async function Ue(i, t, e) {
1214
+ async function ze(i, t, e) {
1219
1215
  const r = "http://www.w3.org/2000/svg", n = document.createElementNS(r, "svg"), s = document.createElementNS(r, "foreignObject");
1220
- return n.setAttribute("width", `${t}`), n.setAttribute("height", `${e}`), n.setAttribute("viewBox", `0 0 ${t} ${e}`), s.setAttribute("width", "100%"), s.setAttribute("height", "100%"), s.setAttribute("x", "0"), s.setAttribute("y", "0"), s.setAttribute("externalResourcesRequired", "true"), n.appendChild(s), s.appendChild(i), Fe(n);
1216
+ return n.setAttribute("width", `${t}`), n.setAttribute("height", `${e}`), n.setAttribute("viewBox", `0 0 ${t} ${e}`), s.setAttribute("width", "100%"), s.setAttribute("height", "100%"), s.setAttribute("x", "0"), s.setAttribute("y", "0"), s.setAttribute("externalResourcesRequired", "true"), n.appendChild(s), s.appendChild(i), Ue(n);
1221
1217
  }
1222
1218
  const b = (i, t) => {
1223
1219
  if (i instanceof t)
@@ -1225,21 +1221,21 @@ const b = (i, t) => {
1225
1221
  const e = Object.getPrototypeOf(i);
1226
1222
  return e === null ? !1 : e.constructor.name === t.name || b(e, t);
1227
1223
  };
1228
- function ze(i) {
1224
+ function Oe(i) {
1229
1225
  const t = i.getPropertyValue("content");
1230
1226
  return `${i.cssText} content: '${t.replace(/'|"/g, "")}';`;
1231
1227
  }
1232
- function Oe(i, t) {
1233
- return Pt(t).map((e) => {
1228
+ function je(i, t) {
1229
+ return Rt(t).map((e) => {
1234
1230
  const r = i.getPropertyValue(e), n = i.getPropertyPriority(e);
1235
1231
  return `${e}: ${r}${n ? " !important" : ""};`;
1236
1232
  }).join(" ");
1237
1233
  }
1238
- function je(i, t, e, r) {
1239
- const n = `.${i}:${t}`, s = e.cssText ? ze(e) : Oe(e, r);
1234
+ function qe(i, t, e, r) {
1235
+ const n = `.${i}:${t}`, s = e.cssText ? Oe(e) : je(e, r);
1240
1236
  return document.createTextNode(`${n}{${s}}`);
1241
1237
  }
1242
- function st(i, t, e, r) {
1238
+ function ot(i, t, e, r) {
1243
1239
  const n = window.getComputedStyle(i, e), s = n.getPropertyValue("content");
1244
1240
  if (s === "" || s === "none")
1245
1241
  return;
@@ -1250,42 +1246,42 @@ function st(i, t, e, r) {
1250
1246
  return;
1251
1247
  }
1252
1248
  const a = document.createElement("style");
1253
- a.appendChild(je(o, e, n, r)), t.appendChild(a);
1249
+ a.appendChild(qe(o, e, n, r)), t.appendChild(a);
1254
1250
  }
1255
- function qe(i, t, e) {
1256
- st(i, t, ":before", e), st(i, t, ":after", e);
1251
+ function Ne(i, t, e) {
1252
+ ot(i, t, ":before", e), ot(i, t, ":after", e);
1257
1253
  }
1258
- const ot = "application/font-woff", at = "image/jpeg", Ne = {
1259
- woff: ot,
1260
- woff2: ot,
1254
+ const at = "application/font-woff", lt = "image/jpeg", We = {
1255
+ woff: at,
1256
+ woff2: at,
1261
1257
  ttf: "application/font-truetype",
1262
1258
  eot: "application/vnd.ms-fontobject",
1263
1259
  png: "image/png",
1264
- jpg: at,
1265
- jpeg: at,
1260
+ jpg: lt,
1261
+ jpeg: lt,
1266
1262
  gif: "image/gif",
1267
1263
  tiff: "image/tiff",
1268
1264
  svg: "image/svg+xml",
1269
1265
  webp: "image/webp"
1270
1266
  };
1271
- function We(i) {
1267
+ function Ve(i) {
1272
1268
  const t = /\.([^./]*?)$/g.exec(i);
1273
1269
  return t ? t[1] : "";
1274
1270
  }
1275
1271
  function Z(i) {
1276
- const t = We(i).toLowerCase();
1277
- return Ne[t] || "";
1272
+ const t = Ve(i).toLowerCase();
1273
+ return We[t] || "";
1278
1274
  }
1279
- function Ve(i) {
1275
+ function Ye(i) {
1280
1276
  return i.split(/,/)[1];
1281
1277
  }
1282
1278
  function V(i) {
1283
1279
  return i.search(/^(data:)/) !== -1;
1284
1280
  }
1285
- function Ye(i, t) {
1281
+ function Xe(i, t) {
1286
1282
  return `data:${t};base64,${i}`;
1287
1283
  }
1288
- async function Rt(i, t, e) {
1284
+ async function It(i, t, e) {
1289
1285
  const r = await fetch(i, t);
1290
1286
  if (r.status === 404)
1291
1287
  throw new Error(`Resource "${r.url}" not found`);
@@ -1302,19 +1298,19 @@ async function Rt(i, t, e) {
1302
1298
  });
1303
1299
  }
1304
1300
  const j = {};
1305
- function Xe(i, t, e) {
1301
+ function Ke(i, t, e) {
1306
1302
  let r = i.replace(/\?.*/, "");
1307
1303
  return e && (r = i), /ttf|otf|eot|woff2?/i.test(r) && (r = r.replace(/.*\//, "")), t ? `[${t}]${r}` : r;
1308
1304
  }
1309
1305
  async function tt(i, t, e) {
1310
- const r = Xe(i, t, e.includeQueryParams);
1306
+ const r = Ke(i, t, e.includeQueryParams);
1311
1307
  if (j[r] != null)
1312
1308
  return j[r];
1313
1309
  e.cacheBust && (i += (/\?/.test(i) ? "&" : "?") + (/* @__PURE__ */ new Date()).getTime());
1314
1310
  let n;
1315
1311
  try {
1316
- const s = await Rt(i, e.fetchRequestInit, ({ res: o, result: a }) => (t || (t = o.headers.get("Content-Type") || ""), Ve(a)));
1317
- n = Ye(s, t);
1312
+ const s = await It(i, e.fetchRequestInit, ({ res: o, result: a }) => (t || (t = o.headers.get("Content-Type") || ""), Ye(a)));
1313
+ n = Xe(s, t);
1318
1314
  } catch (s) {
1319
1315
  n = e.imagePlaceholder || "";
1320
1316
  let o = `Failed to fetch resource: ${i}`;
@@ -1322,11 +1318,11 @@ async function tt(i, t, e) {
1322
1318
  }
1323
1319
  return j[r] = n, n;
1324
1320
  }
1325
- async function Ke(i) {
1321
+ async function Ge(i) {
1326
1322
  const t = i.toDataURL();
1327
1323
  return t === "data:," ? i.cloneNode(!1) : B(t);
1328
1324
  }
1329
- async function Ge(i, t) {
1325
+ async function Je(i, t) {
1330
1326
  if (i.currentSrc) {
1331
1327
  const s = document.createElement("canvas"), o = s.getContext("2d");
1332
1328
  s.width = i.clientWidth, s.height = i.clientHeight, o?.drawImage(i, 0, 0, s.width, s.height);
@@ -1336,7 +1332,7 @@ async function Ge(i, t) {
1336
1332
  const e = i.poster, r = Z(e), n = await tt(e, r, t);
1337
1333
  return B(n);
1338
1334
  }
1339
- async function Je(i, t) {
1335
+ async function Qe(i, t) {
1340
1336
  var e;
1341
1337
  try {
1342
1338
  if (!((e = i?.contentDocument) === null || e === void 0) && e.body)
@@ -1345,42 +1341,42 @@ async function Je(i, t) {
1345
1341
  }
1346
1342
  return i.cloneNode(!1);
1347
1343
  }
1348
- async function Qe(i, t) {
1349
- return b(i, HTMLCanvasElement) ? Ke(i) : b(i, HTMLVideoElement) ? Ge(i, t) : b(i, HTMLIFrameElement) ? Je(i, t) : i.cloneNode(It(i));
1344
+ async function Ze(i, t) {
1345
+ return b(i, HTMLCanvasElement) ? Ge(i) : b(i, HTMLVideoElement) ? Je(i, t) : b(i, HTMLIFrameElement) ? Qe(i, t) : i.cloneNode(Ht(i));
1350
1346
  }
1351
- const Ze = (i) => i.tagName != null && i.tagName.toUpperCase() === "SLOT", It = (i) => i.tagName != null && i.tagName.toUpperCase() === "SVG";
1352
- async function ti(i, t, e) {
1347
+ const ti = (i) => i.tagName != null && i.tagName.toUpperCase() === "SLOT", Ht = (i) => i.tagName != null && i.tagName.toUpperCase() === "SVG";
1348
+ async function ei(i, t, e) {
1353
1349
  var r, n;
1354
- if (It(t))
1350
+ if (Ht(t))
1355
1351
  return t;
1356
1352
  let s = [];
1357
- return Ze(i) && i.assignedNodes ? s = x(i.assignedNodes()) : b(i, HTMLIFrameElement) && (!((r = i.contentDocument) === null || r === void 0) && r.body) ? s = x(i.contentDocument.body.childNodes) : s = x(((n = i.shadowRoot) !== null && n !== void 0 ? n : i).childNodes), s.length === 0 || b(i, HTMLVideoElement) || await s.reduce((o, a) => o.then(() => O(a, e)).then((l) => {
1353
+ return ti(i) && i.assignedNodes ? s = x(i.assignedNodes()) : b(i, HTMLIFrameElement) && (!((r = i.contentDocument) === null || r === void 0) && r.body) ? s = x(i.contentDocument.body.childNodes) : s = x(((n = i.shadowRoot) !== null && n !== void 0 ? n : i).childNodes), s.length === 0 || b(i, HTMLVideoElement) || await s.reduce((o, a) => o.then(() => O(a, e)).then((l) => {
1358
1354
  l && t.appendChild(l);
1359
1355
  }), Promise.resolve()), t;
1360
1356
  }
1361
- function ei(i, t, e) {
1357
+ function ii(i, t, e) {
1362
1358
  const r = t.style;
1363
1359
  if (!r)
1364
1360
  return;
1365
1361
  const n = window.getComputedStyle(i);
1366
- n.cssText ? (r.cssText = n.cssText, r.transformOrigin = n.transformOrigin) : Pt(e).forEach((s) => {
1362
+ n.cssText ? (r.cssText = n.cssText, r.transformOrigin = n.transformOrigin) : Rt(e).forEach((s) => {
1367
1363
  let o = n.getPropertyValue(s);
1368
1364
  s === "font-size" && o.endsWith("px") && (o = `${Math.floor(parseFloat(o.substring(0, o.length - 2))) - 0.1}px`), b(i, HTMLIFrameElement) && s === "display" && o === "inline" && (o = "block"), s === "d" && t.getAttribute("d") && (o = `path(${t.getAttribute("d")})`), r.setProperty(s, o, n.getPropertyPriority(s));
1369
1365
  });
1370
1366
  }
1371
- function ii(i, t) {
1367
+ function ri(i, t) {
1372
1368
  b(i, HTMLTextAreaElement) && (t.innerHTML = i.value), b(i, HTMLInputElement) && t.setAttribute("value", i.value);
1373
1369
  }
1374
- function ri(i, t) {
1370
+ function ni(i, t) {
1375
1371
  if (b(i, HTMLSelectElement)) {
1376
1372
  const e = t, r = Array.from(e.children).find((n) => i.value === n.getAttribute("value"));
1377
1373
  r && r.setAttribute("selected", "");
1378
1374
  }
1379
1375
  }
1380
- function ni(i, t, e) {
1381
- return b(t, Element) && (ei(i, t, e), qe(i, t, e), ii(i, t), ri(i, t)), t;
1376
+ function si(i, t, e) {
1377
+ return b(t, Element) && (ii(i, t, e), Ne(i, t, e), ri(i, t), ni(i, t)), t;
1382
1378
  }
1383
- async function si(i, t) {
1379
+ async function oi(i, t) {
1384
1380
  const e = i.querySelectorAll ? i.querySelectorAll("use") : [];
1385
1381
  if (e.length === 0)
1386
1382
  return i;
@@ -1405,30 +1401,30 @@ async function si(i, t) {
1405
1401
  return i;
1406
1402
  }
1407
1403
  async function O(i, t, e) {
1408
- return !e && t.filter && !t.filter(i) ? null : Promise.resolve(i).then((r) => Qe(r, t)).then((r) => ti(i, r, t)).then((r) => ni(i, r, t)).then((r) => si(r, t));
1404
+ return !e && t.filter && !t.filter(i) ? null : Promise.resolve(i).then((r) => Ze(r, t)).then((r) => ei(i, r, t)).then((r) => si(i, r, t)).then((r) => oi(r, t));
1409
1405
  }
1410
- const Dt = /url\((['"]?)([^'"]+?)\1\)/g, oi = /url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g, ai = /src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;
1411
- function li(i) {
1406
+ const $t = /url\((['"]?)([^'"]+?)\1\)/g, ai = /url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g, li = /src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;
1407
+ function ci(i) {
1412
1408
  const t = i.replace(/([.*+?^${}()|\[\]\/\\])/g, "\\$1");
1413
1409
  return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`, "g");
1414
1410
  }
1415
- function ci(i) {
1411
+ function di(i) {
1416
1412
  const t = [];
1417
- return i.replace(Dt, (e, r, n) => (t.push(n), e)), t.filter((e) => !V(e));
1413
+ return i.replace($t, (e, r, n) => (t.push(n), e)), t.filter((e) => !V(e));
1418
1414
  }
1419
- async function di(i, t, e, r, n) {
1415
+ async function hi(i, t, e, r, n) {
1420
1416
  try {
1421
- const s = e ? Re(t, e) : t, o = Z(t);
1417
+ const s = e ? De(t, e) : t, o = Z(t);
1422
1418
  let a;
1423
- return n || (a = await tt(s, o, r)), i.replace(li(t), `$1${a}$3`);
1419
+ return n || (a = await tt(s, o, r)), i.replace(ci(t), `$1${a}$3`);
1424
1420
  } catch {
1425
1421
  }
1426
1422
  return i;
1427
1423
  }
1428
- function hi(i, { preferredFontFormat: t }) {
1429
- return t ? i.replace(ai, (e) => {
1424
+ function ui(i, { preferredFontFormat: t }) {
1425
+ return t ? i.replace(li, (e) => {
1430
1426
  for (; ; ) {
1431
- const [r, , n] = oi.exec(e) || [];
1427
+ const [r, , n] = ai.exec(e) || [];
1432
1428
  if (!n)
1433
1429
  return "";
1434
1430
  if (n === t)
@@ -1436,28 +1432,28 @@ function hi(i, { preferredFontFormat: t }) {
1436
1432
  }
1437
1433
  }) : i;
1438
1434
  }
1439
- function Ht(i) {
1440
- return i.search(Dt) !== -1;
1435
+ function Bt(i) {
1436
+ return i.search($t) !== -1;
1441
1437
  }
1442
- async function $t(i, t, e) {
1443
- if (!Ht(i))
1438
+ async function Ft(i, t, e) {
1439
+ if (!Bt(i))
1444
1440
  return i;
1445
- const r = hi(i, e);
1446
- return ci(r).reduce((s, o) => s.then((a) => di(a, o, t, e)), Promise.resolve(r));
1441
+ const r = ui(i, e);
1442
+ return di(r).reduce((s, o) => s.then((a) => hi(a, o, t, e)), Promise.resolve(r));
1447
1443
  }
1448
1444
  async function k(i, t, e) {
1449
1445
  var r;
1450
1446
  const n = (r = t.style) === null || r === void 0 ? void 0 : r.getPropertyValue(i);
1451
1447
  if (n) {
1452
- const s = await $t(n, null, e);
1448
+ const s = await Ft(n, null, e);
1453
1449
  return t.style.setProperty(i, s, t.style.getPropertyPriority(i)), !0;
1454
1450
  }
1455
1451
  return !1;
1456
1452
  }
1457
- async function ui(i, t) {
1453
+ async function mi(i, t) {
1458
1454
  await k("background", i, t) || await k("background-image", i, t), await k("mask", i, t) || await k("-webkit-mask", i, t) || await k("mask-image", i, t) || await k("-webkit-mask-image", i, t);
1459
1455
  }
1460
- async function mi(i, t) {
1456
+ async function fi(i, t) {
1461
1457
  const e = b(i, HTMLImageElement);
1462
1458
  if (!(e && !V(i.src)) && !(b(i, SVGImageElement) && !V(i.href.baseVal)))
1463
1459
  return;
@@ -1474,14 +1470,14 @@ async function mi(i, t) {
1474
1470
  a.decode && (a.decode = s), a.loading === "lazy" && (a.loading = "eager"), e ? (i.srcset = "", i.src = n) : i.href.baseVal = n;
1475
1471
  });
1476
1472
  }
1477
- async function fi(i, t) {
1478
- const r = x(i.childNodes).map((n) => Bt(n, t));
1473
+ async function bi(i, t) {
1474
+ const r = x(i.childNodes).map((n) => Ut(n, t));
1479
1475
  await Promise.all(r).then(() => i);
1480
1476
  }
1481
- async function Bt(i, t) {
1482
- b(i, Element) && (await ui(i, t), await mi(i, t), await fi(i, t));
1477
+ async function Ut(i, t) {
1478
+ b(i, Element) && (await mi(i, t), await fi(i, t), await bi(i, t));
1483
1479
  }
1484
- function bi(i, t) {
1480
+ function pi(i, t) {
1485
1481
  const { style: e } = i;
1486
1482
  t.backgroundColor && (e.backgroundColor = t.backgroundColor), t.width && (e.width = `${t.width}px`), t.height && (e.height = `${t.height}px`);
1487
1483
  const r = t.style;
@@ -1489,23 +1485,23 @@ function bi(i, t) {
1489
1485
  e[n] = r[n];
1490
1486
  }), i;
1491
1487
  }
1492
- const lt = {};
1493
- async function ct(i) {
1494
- let t = lt[i];
1488
+ const ct = {};
1489
+ async function dt(i) {
1490
+ let t = ct[i];
1495
1491
  if (t != null)
1496
1492
  return t;
1497
1493
  const r = await (await fetch(i)).text();
1498
- return t = { url: i, cssText: r }, lt[i] = t, t;
1494
+ return t = { url: i, cssText: r }, ct[i] = t, t;
1499
1495
  }
1500
- async function dt(i, t) {
1496
+ async function ht(i, t) {
1501
1497
  let e = i.cssText;
1502
1498
  const r = /url\(["']?([^"')]+)["']?\)/g, s = (e.match(/url\([^)]+\)/g) || []).map(async (o) => {
1503
1499
  let a = o.replace(r, "$1");
1504
- return a.startsWith("https://") || (a = new URL(a, i.url).href), Rt(a, t.fetchRequestInit, ({ result: l }) => (e = e.replace(o, `url(${l})`), [o, l]));
1500
+ return a.startsWith("https://") || (a = new URL(a, i.url).href), It(a, t.fetchRequestInit, ({ result: l }) => (e = e.replace(o, `url(${l})`), [o, l]));
1505
1501
  });
1506
1502
  return Promise.all(s).then(() => e);
1507
1503
  }
1508
- function ht(i) {
1504
+ function ut(i) {
1509
1505
  if (i == null)
1510
1506
  return [];
1511
1507
  const t = [], e = /(\/\*[\s\S]*?\*\/)/gi;
@@ -1531,7 +1527,7 @@ function ht(i) {
1531
1527
  }
1532
1528
  return t;
1533
1529
  }
1534
- async function pi(i, t) {
1530
+ async function gi(i, t) {
1535
1531
  const e = [], r = [];
1536
1532
  return i.forEach((n) => {
1537
1533
  if ("cssRules" in n)
@@ -1539,7 +1535,7 @@ async function pi(i, t) {
1539
1535
  x(n.cssRules || []).forEach((s, o) => {
1540
1536
  if (s.type === CSSRule.IMPORT_RULE) {
1541
1537
  let a = o + 1;
1542
- const l = s.href, c = ct(l).then((d) => dt(d, t)).then((d) => ht(d).forEach((u) => {
1538
+ const l = s.href, c = dt(l).then((d) => ht(d, t)).then((d) => ut(d).forEach((u) => {
1543
1539
  try {
1544
1540
  n.insertRule(u, u.startsWith("@import") ? a += 1 : n.cssRules.length);
1545
1541
  } catch (m) {
@@ -1556,7 +1552,7 @@ async function pi(i, t) {
1556
1552
  });
1557
1553
  } catch (s) {
1558
1554
  const o = i.find((a) => a.href == null) || document.styleSheets[0];
1559
- n.href != null && r.push(ct(n.href).then((a) => dt(a, t)).then((a) => ht(a).forEach((l) => {
1555
+ n.href != null && r.push(dt(n.href).then((a) => ht(a, t)).then((a) => ut(a).forEach((l) => {
1560
1556
  o.insertRule(l, o.cssRules.length);
1561
1557
  })).catch((a) => {
1562
1558
  console.error("Error loading remote stylesheet", a);
@@ -1573,57 +1569,57 @@ async function pi(i, t) {
1573
1569
  }
1574
1570
  }), e));
1575
1571
  }
1576
- function gi(i) {
1577
- return i.filter((t) => t.type === CSSRule.FONT_FACE_RULE).filter((t) => Ht(t.style.getPropertyValue("src")));
1572
+ function yi(i) {
1573
+ return i.filter((t) => t.type === CSSRule.FONT_FACE_RULE).filter((t) => Bt(t.style.getPropertyValue("src")));
1578
1574
  }
1579
- async function yi(i, t) {
1575
+ async function wi(i, t) {
1580
1576
  if (i.ownerDocument == null)
1581
1577
  throw new Error("Provided element is not within a Document");
1582
- const e = x(i.ownerDocument.styleSheets), r = await pi(e, t);
1583
- return gi(r);
1578
+ const e = x(i.ownerDocument.styleSheets), r = await gi(e, t);
1579
+ return yi(r);
1584
1580
  }
1585
- function Ft(i) {
1581
+ function zt(i) {
1586
1582
  return i.trim().replace(/["']/g, "");
1587
1583
  }
1588
- function wi(i) {
1584
+ function xi(i) {
1589
1585
  const t = /* @__PURE__ */ new Set();
1590
1586
  function e(r) {
1591
1587
  (r.style.fontFamily || getComputedStyle(r).fontFamily).split(",").forEach((s) => {
1592
- t.add(Ft(s));
1588
+ t.add(zt(s));
1593
1589
  }), Array.from(r.children).forEach((s) => {
1594
1590
  s instanceof HTMLElement && e(s);
1595
1591
  });
1596
1592
  }
1597
1593
  return e(i), t;
1598
1594
  }
1599
- async function xi(i, t) {
1600
- const e = await yi(i, t), r = wi(i);
1601
- return (await Promise.all(e.filter((s) => r.has(Ft(s.style.fontFamily))).map((s) => {
1595
+ async function vi(i, t) {
1596
+ const e = await wi(i, t), r = xi(i);
1597
+ return (await Promise.all(e.filter((s) => r.has(zt(s.style.fontFamily))).map((s) => {
1602
1598
  const o = s.parentStyleSheet ? s.parentStyleSheet.href : null;
1603
- return $t(s.cssText, o, t);
1599
+ return Ft(s.cssText, o, t);
1604
1600
  }))).join(`
1605
1601
  `);
1606
1602
  }
1607
- async function vi(i, t) {
1608
- const e = t.fontEmbedCSS != null ? t.fontEmbedCSS : t.skipFonts ? null : await xi(i, t);
1603
+ async function ki(i, t) {
1604
+ const e = t.fontEmbedCSS != null ? t.fontEmbedCSS : t.skipFonts ? null : await vi(i, t);
1609
1605
  if (e) {
1610
1606
  const r = document.createElement("style"), n = document.createTextNode(e);
1611
1607
  r.appendChild(n), i.firstChild ? i.insertBefore(r, i.firstChild) : i.appendChild(r);
1612
1608
  }
1613
1609
  }
1614
- async function ki(i, t = {}) {
1615
- const { width: e, height: r } = At(i, t), n = await O(i, t, !0);
1616
- return await vi(n, t), await Bt(n, t), bi(n, t), await Ue(n, e, r);
1617
- }
1618
1610
  async function Si(i, t = {}) {
1619
- const { width: e, height: r } = At(i, t), n = await ki(i, t), s = await B(n), o = document.createElement("canvas"), a = o.getContext("2d"), l = t.pixelRatio || $e(), c = t.canvasWidth || e, d = t.canvasHeight || r;
1620
- return o.width = c * l, o.height = d * l, t.skipAutoScale || Be(o), o.style.width = `${c}`, o.style.height = `${d}`, t.backgroundColor && (a.fillStyle = t.backgroundColor, a.fillRect(0, 0, o.width, o.height)), a.drawImage(s, 0, 0, o.width, o.height), o;
1611
+ const { width: e, height: r } = Dt(i, t), n = await O(i, t, !0);
1612
+ return await ki(n, t), await Ut(n, t), pi(n, t), await ze(n, e, r);
1621
1613
  }
1622
1614
  async function Ei(i, t = {}) {
1623
- return (await Si(i, t)).toDataURL("image/jpeg", t.quality || 1);
1615
+ const { width: e, height: r } = Dt(i, t), n = await Si(i, t), s = await B(n), o = document.createElement("canvas"), a = o.getContext("2d"), l = t.pixelRatio || Be(), c = t.canvasWidth || e, d = t.canvasHeight || r;
1616
+ return o.width = c * l, o.height = d * l, t.skipAutoScale || Fe(o), o.style.width = `${c}`, o.style.height = `${d}`, t.backgroundColor && (a.fillStyle = t.backgroundColor, a.fillRect(0, 0, o.width, o.height)), a.drawImage(s, 0, 0, o.width, o.height), o;
1624
1617
  }
1625
- const q = 400, N = 300, ut = 150, mt = 0.3, ft = 0.85;
1626
- function Ci(i) {
1618
+ async function Ci(i, t = {}) {
1619
+ return (await Ei(i, t)).toDataURL("image/jpeg", t.quality || 1);
1620
+ }
1621
+ const q = 400, N = 300, mt = 150, ft = 0.3, bt = 0.85;
1622
+ function _i(i) {
1627
1623
  let t = 1 / 0, e = 1 / 0, r = -1 / 0, n = -1 / 0;
1628
1624
  for (const s of i)
1629
1625
  if (s.type === "pin") {
@@ -1632,32 +1628,32 @@ function Ci(i) {
1632
1628
  t = Math.min(t, o.left), e = Math.min(e, o.top), r = Math.max(r, o.left + o.width), n = Math.max(n, o.bottom);
1633
1629
  }
1634
1630
  } else if (s.type === "draw" && s.drawPath)
1635
- for (const o of Ut(s.drawPath))
1631
+ for (const o of Ot(s.drawPath))
1636
1632
  for (const [a, l] of o)
1637
1633
  t = Math.min(t, a), e = Math.min(e, l), r = Math.max(r, a), n = Math.max(n, l);
1638
1634
  return !isFinite(t) || !isFinite(e) ? null : { minX: t, minY: e, maxX: r, maxY: n };
1639
1635
  }
1640
- function _i(i, t, e) {
1641
- const r = Ci(i);
1636
+ function Ti(i, t, e) {
1637
+ const r = _i(i);
1642
1638
  if (!r) return null;
1643
- const n = Math.max(ut, t * mt), s = Math.max(ut, e * mt);
1639
+ const n = Math.max(mt, t * ft), s = Math.max(mt, e * ft);
1644
1640
  let o = r.minX - n, a = r.minY - s, l = r.maxX - r.minX + n * 2, c = r.maxY - r.minY + s * 2;
1645
- return l < q && (o -= (q - l) / 2, l = q), c < N && (a -= (N - c) / 2, c = N), o = Math.max(0, o), a = Math.max(0, a), l = Math.min(l, t - o), c = Math.min(c, e - a), l >= t * ft && c >= e * ft ? null : {
1641
+ return l < q && (o -= (q - l) / 2, l = q), c < N && (a -= (N - c) / 2, c = N), o = Math.max(0, o), a = Math.max(0, a), l = Math.min(l, t - o), c = Math.min(c, e - a), l >= t * bt && c >= e * bt ? null : {
1646
1642
  x: Math.round(o),
1647
1643
  y: Math.round(a),
1648
1644
  width: Math.round(l),
1649
1645
  height: Math.round(c)
1650
1646
  };
1651
1647
  }
1652
- function Ti(i, t) {
1648
+ function Li(i, t) {
1653
1649
  const e = document.createElement("canvas");
1654
1650
  e.width = t.width, e.height = t.height;
1655
1651
  const r = e.getContext("2d");
1656
1652
  return r && r.drawImage(i, t.x, t.y, t.width, t.height, 0, 0, t.width, t.height), e;
1657
1653
  }
1658
- async function Li(i = []) {
1654
+ async function Mi(i = []) {
1659
1655
  try {
1660
- const t = Ai(document.body), e = await Ei(document.body, {
1656
+ const t = Ri(document.body), e = await Ci(document.body, {
1661
1657
  quality: 0.85,
1662
1658
  pixelRatio: 1,
1663
1659
  backgroundColor: "#ffffff",
@@ -1666,15 +1662,15 @@ async function Li(i = []) {
1666
1662
  filter: (r) => !(r instanceof HTMLElement && r.id === "mtb-widget-host")
1667
1663
  });
1668
1664
  if (i.length > 0) {
1669
- const r = await Mi(e, i, t);
1665
+ const r = await Pi(e, i, t);
1670
1666
  if (r) return r;
1671
1667
  }
1672
- return Di(e);
1668
+ return Hi(e);
1673
1669
  } catch {
1674
1670
  return null;
1675
1671
  }
1676
1672
  }
1677
- async function Mi(i, t, e) {
1673
+ async function Pi(i, t, e) {
1678
1674
  const r = document.createElement("canvas"), n = r.getContext("2d");
1679
1675
  if (!n) return null;
1680
1676
  const s = await Ii(i);
@@ -1683,13 +1679,13 @@ async function Mi(i, t, e) {
1683
1679
  const o = r.width / e.width, a = r.height / e.height;
1684
1680
  let l = 0;
1685
1681
  for (const d of t)
1686
- d.type === "draw" && d.drawPath ? Pi(n, d.drawPath, e, o, a) : d.type === "pin" && Ri(
1682
+ d.type === "draw" && d.drawPath ? Ai(n, d.drawPath, e, o, a) : d.type === "pin" && Di(
1687
1683
  n,
1688
1684
  (d.x - e.left) * o,
1689
1685
  (d.y - e.top) * a,
1690
1686
  ++l
1691
1687
  );
1692
- const c = _i(t, window.innerWidth, window.innerHeight);
1688
+ const c = Ti(t, window.innerWidth, window.innerHeight);
1693
1689
  if (c) {
1694
1690
  const d = Math.max(0, Math.round((c.x - e.left) * o)), u = Math.max(0, Math.round((c.y - e.top) * a)), m = Math.min(r.width, Math.round((c.x + c.width - e.left) * o)), g = Math.min(r.height, Math.round((c.y + c.height - e.top) * a)), y = {
1695
1691
  x: d,
@@ -1697,13 +1693,13 @@ async function Mi(i, t, e) {
1697
1693
  width: m - d,
1698
1694
  height: g - u
1699
1695
  };
1700
- return bt(Ti(r, y));
1696
+ return pt(Li(r, y));
1701
1697
  }
1702
- return bt(r);
1698
+ return pt(r);
1703
1699
  }
1704
- function Pi(i, t, e, r, n) {
1700
+ function Ai(i, t, e, r, n) {
1705
1701
  i.save(), i.strokeStyle = z, i.lineWidth = 3.5, i.lineCap = "round", i.lineJoin = "round", i.shadowColor = J(0.35), i.shadowOffsetY = 1, i.shadowBlur = 2;
1706
- for (const s of Ut(t))
1702
+ for (const s of Ot(t))
1707
1703
  if (s.length !== 0) {
1708
1704
  i.beginPath(), i.moveTo(
1709
1705
  (s[0][0] - e.left) * r,
@@ -1718,7 +1714,7 @@ function Pi(i, t, e, r, n) {
1718
1714
  }
1719
1715
  i.restore();
1720
1716
  }
1721
- function Ai(i) {
1717
+ function Ri(i) {
1722
1718
  const t = i.getBoundingClientRect(), e = window.getComputedStyle(i), r = parseFloat(e.borderLeftWidth) + parseFloat(e.borderRightWidth), n = parseFloat(e.borderTopWidth) + parseFloat(e.borderBottomWidth);
1723
1719
  return {
1724
1720
  left: t.left,
@@ -1727,10 +1723,10 @@ function Ai(i) {
1727
1723
  height: i.clientHeight + (Number.isFinite(n) ? n : 0) || window.innerHeight
1728
1724
  };
1729
1725
  }
1730
- function Ri(i, t, e, r) {
1731
- i.save(), i.shadowColor = J(0.45), i.shadowOffsetY = 2, i.shadowBlur = 8, i.fillStyle = z, 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 ${ae}`, i.textAlign = "center", i.textBaseline = "middle", i.fillText(String(r), t, e), i.restore();
1726
+ function Di(i, t, e, r) {
1727
+ i.save(), i.shadowColor = J(0.45), i.shadowOffsetY = 2, i.shadowBlur = 8, i.fillStyle = z, 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 ${ce}`, i.textAlign = "center", i.textBaseline = "middle", i.fillText(String(r), t, e), i.restore();
1732
1728
  }
1733
- function Ut(i) {
1729
+ function Ot(i) {
1734
1730
  const t = [];
1735
1731
  let e = null;
1736
1732
  const r = i.match(/[ML]\s*[-\d.]+\s+[-\d.]+/g) ?? [];
@@ -1746,7 +1742,7 @@ function Ii(i) {
1746
1742
  e.onload = () => t(e), e.onerror = () => t(null), e.src = i;
1747
1743
  });
1748
1744
  }
1749
- function bt(i) {
1745
+ function pt(i) {
1750
1746
  return new Promise((t) => {
1751
1747
  try {
1752
1748
  i.toBlob((e) => t(e), "image/jpeg", 0.85);
@@ -1755,13 +1751,13 @@ function bt(i) {
1755
1751
  }
1756
1752
  });
1757
1753
  }
1758
- function Di(i) {
1754
+ function Hi(i) {
1759
1755
  const [t, e] = i.split(","), r = t.match(/:(.*?);/)?.[1] ?? "image/png", n = atob(e), s = new Uint8Array(n.length);
1760
1756
  for (let o = 0; o < n.length; o++)
1761
1757
  s[o] = n.charCodeAt(o);
1762
1758
  return new Blob([s], { type: r });
1763
1759
  }
1764
- class Hi {
1760
+ class $i {
1765
1761
  constructor() {
1766
1762
  this.listeners = /* @__PURE__ */ new Set(), this.originalOnError = null, this.installedOnError = null, this.rejectionHandler = null, this.hooked = !1;
1767
1763
  }
@@ -1783,8 +1779,8 @@ class Hi {
1783
1779
  for (const e of this.listeners) e(t);
1784
1780
  }
1785
1781
  }
1786
- const et = new Hi(), $i = 20;
1787
- class Bi {
1782
+ const et = new $i(), Bi = 20;
1783
+ class Fi {
1788
1784
  constructor() {
1789
1785
  this.errors = [], this.unsubscribe = null;
1790
1786
  }
@@ -1796,7 +1792,7 @@ class Bi {
1796
1792
  this.addError(`${t.message}${e}`);
1797
1793
  }
1798
1794
  addError(t) {
1799
- this.errors.length >= $i || this.errors.includes(t) || this.errors.push(t);
1795
+ this.errors.length >= Bi || this.errors.includes(t) || this.errors.push(t);
1800
1796
  }
1801
1797
  getErrors() {
1802
1798
  return [...this.errors];
@@ -1805,23 +1801,23 @@ class Bi {
1805
1801
  this.unsubscribe?.(), this.unsubscribe = null;
1806
1802
  }
1807
1803
  }
1808
- const D = /* @__PURE__ */ new Set();
1804
+ const I = /* @__PURE__ */ new Set();
1809
1805
  let L = null, M = null, P = null, F = null, A = null;
1810
- function zt(i) {
1811
- D.add(i), Fi();
1806
+ function jt(i) {
1807
+ I.add(i), Ui();
1812
1808
  let t = !1;
1813
1809
  return () => {
1814
- t || (t = !0, D.delete(i), D.size === 0 && Ui());
1810
+ t || (t = !0, I.delete(i), I.size === 0 && zi());
1815
1811
  };
1816
1812
  }
1817
1813
  function W() {
1818
- for (const i of [...D])
1814
+ for (const i of [...I])
1819
1815
  try {
1820
1816
  i();
1821
1817
  } catch {
1822
1818
  }
1823
1819
  }
1824
- function Fi() {
1820
+ function Ui() {
1825
1821
  if (P) return;
1826
1822
  A = () => W(), window.addEventListener("popstate", A), L = history.pushState, M = history.replaceState;
1827
1823
  const i = L, t = M;
@@ -1831,16 +1827,16 @@ function Fi() {
1831
1827
  t.call(history, e, r, n), W();
1832
1828
  }, history.pushState = P, history.replaceState = F;
1833
1829
  }
1834
- function Ui() {
1830
+ function zi() {
1835
1831
  A && (window.removeEventListener("popstate", A), A = null), L && history.pushState === P && (history.pushState = L), M && history.replaceState === F && (history.replaceState = M), L = null, M = null, P = null, F = null;
1836
1832
  }
1837
- const zi = 20;
1838
- class Oi {
1833
+ const Oi = 20;
1834
+ class ji {
1839
1835
  constructor() {
1840
1836
  this.breadcrumbs = [], this.active = !1, this.unsubscribeErrors = null, this.unsubscribeNavigation = null, this.lastUrl = "", this.boundClickHandler = (t) => this.handleClick(t), this.boundChangeHandler = (t) => this.handleChange(t);
1841
1837
  }
1842
1838
  start() {
1843
- this.active || (this.active = !0, this.lastUrl = location.href, document.addEventListener("click", this.boundClickHandler, { capture: !0, passive: !0 }), document.addEventListener("change", this.boundChangeHandler, { capture: !0, passive: !0 }), this.unsubscribeErrors = et.subscribe((t) => this.recordError(t)), this.unsubscribeNavigation = zt(() => this.handleNavigation()));
1839
+ this.active || (this.active = !0, this.lastUrl = location.href, document.addEventListener("click", this.boundClickHandler, { capture: !0, passive: !0 }), document.addEventListener("change", this.boundChangeHandler, { capture: !0, passive: !0 }), this.unsubscribeErrors = et.subscribe((t) => this.recordError(t)), this.unsubscribeNavigation = jt(() => this.handleNavigation()));
1844
1840
  }
1845
1841
  stop() {
1846
1842
  this.active && (this.active = !1, document.removeEventListener("click", this.boundClickHandler, !0), document.removeEventListener("change", this.boundChangeHandler, !0), this.unsubscribeErrors?.(), this.unsubscribeErrors = null, this.unsubscribeNavigation?.(), this.unsubscribeNavigation = null);
@@ -1849,7 +1845,7 @@ class Oi {
1849
1845
  return [...this.breadcrumbs];
1850
1846
  }
1851
1847
  add(t) {
1852
- this.breadcrumbs.push(t), this.breadcrumbs.length > zi && this.breadcrumbs.shift();
1848
+ this.breadcrumbs.push(t), this.breadcrumbs.length > Oi && this.breadcrumbs.shift();
1853
1849
  }
1854
1850
  handleClick(t) {
1855
1851
  const e = t.target;
@@ -1860,7 +1856,7 @@ class Oi {
1860
1856
  category: "ui.click",
1861
1857
  timestamp: Date.now(),
1862
1858
  message: G(e),
1863
- data: { selector: Lt(e) }
1859
+ data: { selector: Pt(e) }
1864
1860
  });
1865
1861
  } catch {
1866
1862
  }
@@ -1901,29 +1897,29 @@ class Oi {
1901
1897
  }));
1902
1898
  }
1903
1899
  }
1904
- const Ot = "mtb_frustration_state";
1900
+ const qt = "mtb_frustration_state";
1905
1901
  let Y = null;
1906
1902
  function U() {
1907
1903
  try {
1908
- const i = window.sessionStorage.getItem(Ot);
1904
+ const i = window.sessionStorage.getItem(qt);
1909
1905
  return H(i ? JSON.parse(i) : Y);
1910
1906
  } catch {
1911
1907
  return H(Y);
1912
1908
  }
1913
1909
  }
1914
- function jt(i) {
1910
+ function Nt(i) {
1915
1911
  const t = H(i);
1916
1912
  Y = t;
1917
1913
  try {
1918
- window.sessionStorage.setItem(Ot, JSON.stringify(t));
1914
+ window.sessionStorage.setItem(qt, JSON.stringify(t));
1919
1915
  } catch {
1920
1916
  }
1921
1917
  }
1922
- function ji() {
1918
+ function qi() {
1923
1919
  return U().dismissedByUser;
1924
1920
  }
1925
- function qi() {
1926
- jt({ ...U(), dismissedByUser: !0 });
1921
+ function Ni() {
1922
+ Nt({ ...U(), dismissedByUser: !0 });
1927
1923
  }
1928
1924
  function H(i) {
1929
1925
  const t = i ?? {};
@@ -1934,7 +1930,7 @@ function H(i) {
1934
1930
  dismissedByUser: t.dismissedByUser === !0
1935
1931
  };
1936
1932
  }
1937
- const Ni = 3, Wi = 1e3, Vi = 3, Yi = 5e3, pt = 500, Xi = 500, Ki = 300, Gi = /* @__PURE__ */ new Set([
1933
+ const Wi = 3, Vi = 1e3, Yi = 3, Xi = 5e3, gt = 500, Ki = 500, Gi = 300, Ji = /* @__PURE__ */ new Set([
1938
1934
  "A",
1939
1935
  "BUTTON",
1940
1936
  "INPUT",
@@ -1943,7 +1939,7 @@ const Ni = 3, Wi = 1e3, Vi = 3, Yi = 5e3, pt = 500, Xi = 500, Ki = 300, Gi = /*
1943
1939
  "LABEL",
1944
1940
  "SUMMARY",
1945
1941
  "DETAILS"
1946
- ]), Ji = /* @__PURE__ */ new Set([
1942
+ ]), Qi = /* @__PURE__ */ new Set([
1947
1943
  "button",
1948
1944
  "link",
1949
1945
  "checkbox",
@@ -1957,7 +1953,7 @@ const Ni = 3, Wi = 1e3, Vi = 3, Yi = 5e3, pt = 500, Xi = 500, Ki = 300, Gi = /*
1957
1953
  "listbox",
1958
1954
  "slider",
1959
1955
  "spinbutton"
1960
- ]), gt = [
1956
+ ]), yt = [
1961
1957
  "404",
1962
1958
  "500",
1963
1959
  "not found",
@@ -1977,7 +1973,7 @@ const Ni = 3, Wi = 1e3, Vi = 3, Yi = 5e3, pt = 500, Xi = 500, Ki = 300, Gi = /*
1977
1973
  this.active && (this.active = !1, document.removeEventListener("click", this.boundClickHandler, !0), this.unsubscribeErrors?.(), this.unsubscribeErrors = null, this.clickHistory = [], this.stopNavigationTracking(), this.stopFormTracking(), this.errorPageUrls.clear(), this.disconnectDomObserver());
1978
1974
  }
1979
1975
  startNavigationTracking() {
1980
- this.unsubscribeNavigation = zt(() => this.handleNavigation()), this.boundPageLeaveHandler = () => this.noteNavigationStarted(), window.addEventListener("beforeunload", this.boundPageLeaveHandler), window.addEventListener("pagehide", this.boundPageLeaveHandler);
1976
+ this.unsubscribeNavigation = jt(() => this.handleNavigation()), this.boundPageLeaveHandler = () => this.noteNavigationStarted(), window.addEventListener("beforeunload", this.boundPageLeaveHandler), window.addEventListener("pagehide", this.boundPageLeaveHandler);
1981
1977
  }
1982
1978
  stopNavigationTracking() {
1983
1979
  this.unsubscribeNavigation?.(), this.unsubscribeNavigation = null, this.navTimestamps = [], this.boundPageLeaveHandler && (window.removeEventListener("beforeunload", this.boundPageLeaveHandler), window.removeEventListener("pagehide", this.boundPageLeaveHandler), this.boundPageLeaveHandler = null), this.lastNavigationAt = -1;
@@ -1995,7 +1991,7 @@ const Ni = 3, Wi = 1e3, Vi = 3, Yi = 5e3, pt = 500, Xi = 500, Ki = 300, Gi = /*
1995
1991
  }
1996
1992
  persistState() {
1997
1993
  const t = U();
1998
- jt({
1994
+ Nt({
1999
1995
  ...t,
2000
1996
  navTimestamps: this.navTimestamps,
2001
1997
  cooldownUntil: this.cooldownUntil,
@@ -2014,8 +2010,8 @@ const Ni = 3, Wi = 1e3, Vi = 3, Yi = 5e3, pt = 500, Xi = 500, Ki = 300, Gi = /*
2014
2010
  this.trackFormSubmitIntent(e);
2015
2011
  const r = Date.now();
2016
2012
  this.clickHistory.push({ target: e, time: r });
2017
- const n = r - Wi;
2018
- if (this.clickHistory = this.clickHistory.filter((o) => o.time > n), this.clickHistory.filter((o) => o.target === e).length >= Ni) {
2013
+ const n = r - Vi;
2014
+ if (this.clickHistory = this.clickHistory.filter((o) => o.time > n), this.clickHistory.filter((o) => o.target === e).length >= Wi) {
2019
2015
  this.clickHistory = [], this.emitHighPriority({
2020
2016
  signal: "rage_click",
2021
2017
  target: _(e),
@@ -2032,13 +2028,13 @@ const Ni = 3, Wi = 1e3, Vi = 3, Yi = 5e3, pt = 500, Xi = 500, Ki = 300, Gi = /*
2032
2028
  handleNavigation() {
2033
2029
  const t = Date.now();
2034
2030
  this.noteNavigationStarted(), this.navTimestamps.push(t);
2035
- const e = t - Yi;
2036
- this.navTimestamps = this.navTimestamps.filter((r) => r > e), this.navTimestamps.length >= Vi && (this.navTimestamps = [], this.emitIfReady({
2031
+ const e = t - Xi;
2032
+ this.navTimestamps = this.navTimestamps.filter((r) => r > e), this.navTimestamps.length >= Yi && (this.navTimestamps = [], this.emitIfReady({
2037
2033
  signal: "rapid_navigation",
2038
2034
  timestamp: t
2039
2035
  })), this.persistState(), setTimeout(() => {
2040
2036
  this.active && this.checkErrorPage();
2041
- }, Ki);
2037
+ }, Gi);
2042
2038
  }
2043
2039
  handleFormSubmit(t) {
2044
2040
  const e = t.target;
@@ -2048,7 +2044,7 @@ const Ni = 3, Wi = 1e3, Vi = 3, Yi = 5e3, pt = 500, Xi = 500, Ki = 300, Gi = /*
2048
2044
  target: _(e),
2049
2045
  timestamp: Date.now()
2050
2046
  });
2051
- }, pt)));
2047
+ }, gt)));
2052
2048
  }
2053
2049
  trackFormSubmitIntent(t) {
2054
2050
  const e = t.closest("button, input");
@@ -2057,7 +2053,7 @@ const Ni = 3, Wi = 1e3, Vi = 3, Yi = 5e3, pt = 500, Xi = 500, Ki = 300, Gi = /*
2057
2053
  rememberSubmitAttempt(t) {
2058
2054
  this.recentSubmitForms.add(t), setTimeout(() => {
2059
2055
  this.recentSubmitForms.delete(t);
2060
- }, pt);
2056
+ }, gt);
2061
2057
  }
2062
2058
  handleFormInvalid(t) {
2063
2059
  const e = t.target;
@@ -2073,7 +2069,7 @@ const Ni = 3, Wi = 1e3, Vi = 3, Yi = 5e3, pt = 500, Xi = 500, Ki = 300, Gi = /*
2073
2069
  const t = location.href;
2074
2070
  if (this.errorPageUrls.has(t)) return;
2075
2071
  const e = document.title.toLowerCase();
2076
- if (gt.some((n) => e.includes(n))) {
2072
+ if (yt.some((n) => e.includes(n))) {
2077
2073
  this.errorPageUrls.add(t), this.emitHighPriority({
2078
2074
  signal: "error_page",
2079
2075
  detail: document.title,
@@ -2086,7 +2082,7 @@ const Ni = 3, Wi = 1e3, Vi = 3, Yi = 5e3, pt = 500, Xi = 500, Ki = 300, Gi = /*
2086
2082
  );
2087
2083
  for (const n of r) {
2088
2084
  const s = n.textContent ?? "";
2089
- if (s.length < 200 && gt.some((o) => s.toLowerCase().includes(o))) {
2085
+ if (s.length < 200 && yt.some((o) => s.toLowerCase().includes(o))) {
2090
2086
  this.errorPageUrls.add(t), this.emitHighPriority({
2091
2087
  signal: "error_page",
2092
2088
  detail: s.trim().slice(0, 60),
@@ -2108,7 +2104,7 @@ const Ni = 3, Wi = 1e3, Vi = 3, Yi = 5e3, pt = 500, Xi = 500, Ki = 300, Gi = /*
2108
2104
  target: _(t),
2109
2105
  timestamp: e
2110
2106
  });
2111
- }, Xi));
2107
+ }, Ki));
2112
2108
  }
2113
2109
  ensureDomObserver() {
2114
2110
  this.domObserver || (this.domObserver = new MutationObserver(() => {
@@ -2133,9 +2129,9 @@ const Ni = 3, Wi = 1e3, Vi = 3, Yi = 5e3, pt = 500, Xi = 500, Ki = 300, Gi = /*
2133
2129
  return !1;
2134
2130
  }
2135
2131
  isInteractive(t) {
2136
- if (Gi.has(t.tagName)) return !0;
2132
+ if (Ji.has(t.tagName)) return !0;
2137
2133
  const e = t.getAttribute("role");
2138
- return !!(e && Ji.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'));
2134
+ return !!(e && Qi.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'));
2139
2135
  }
2140
2136
  emitIfReady(t) {
2141
2137
  const e = Date.now();
@@ -2151,25 +2147,25 @@ function _(i) {
2151
2147
  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(".") : "", n = i.textContent?.trim().slice(0, 30) ?? "";
2152
2148
  return `<${t}${e}${r}>${n ? ` "${n}"` : ""}`;
2153
2149
  }
2154
- function Qi() {
2150
+ function Zi() {
2155
2151
  return {
2156
2152
  page_url: window.location.href,
2157
2153
  user_agent: navigator.userAgent,
2158
- browser: Zi(),
2159
- os: tr(),
2154
+ browser: tr(),
2155
+ os: er(),
2160
2156
  screen_width: window.screen.width,
2161
2157
  screen_height: window.screen.height
2162
2158
  };
2163
2159
  }
2164
- function Zi() {
2160
+ function tr() {
2165
2161
  const i = navigator.userAgent;
2166
2162
  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";
2167
2163
  }
2168
- function tr() {
2164
+ function er() {
2169
2165
  const i = navigator.userAgent;
2170
2166
  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";
2171
2167
  }
2172
- function er(i, t, e, r, n, s, o, a, l) {
2168
+ function ir(i, t, e, r, n, s, o, a, l) {
2173
2169
  return {
2174
2170
  description: i,
2175
2171
  ...t,
@@ -2190,50 +2186,50 @@ function er(i, t, e, r, n, s, o, a, l) {
2190
2186
  breadcrumbs: l
2191
2187
  };
2192
2188
  }
2193
- const yt = "mtb_anon_id", qt = "mtb_reporter_email", Nt = "mtb_board_url";
2194
- let wt = null, Wt = null, Vt = null;
2195
- function xt() {
2189
+ const wt = "mtb_anon_id", Wt = "mtb_reporter_email", Vt = "mtb_board_url";
2190
+ let xt = null, Yt = null, Xt = null;
2191
+ function vt() {
2196
2192
  try {
2197
- const i = window.localStorage.getItem(yt);
2193
+ const i = window.localStorage.getItem(wt);
2198
2194
  if (i?.startsWith("anon_")) return i;
2199
- const t = St();
2200
- return window.localStorage.setItem(yt, t), t;
2195
+ const t = Et();
2196
+ return window.localStorage.setItem(wt, t), t;
2201
2197
  } catch {
2202
- return wt ?? (wt = St()), wt;
2198
+ return xt ?? (xt = Et()), xt;
2203
2199
  }
2204
2200
  }
2205
- function vt() {
2201
+ function kt() {
2206
2202
  try {
2207
- return window.localStorage.getItem(qt) ?? void 0;
2203
+ return window.localStorage.getItem(Wt) ?? void 0;
2208
2204
  } catch {
2209
- return Wt ?? void 0;
2205
+ return Yt ?? void 0;
2210
2206
  }
2211
2207
  }
2212
- function ir(i) {
2213
- Wt = i;
2208
+ function rr(i) {
2209
+ Yt = i;
2214
2210
  try {
2215
- window.localStorage.setItem(qt, i);
2211
+ window.localStorage.setItem(Wt, i);
2216
2212
  } catch {
2217
2213
  }
2218
2214
  }
2219
- function rr() {
2215
+ function nr() {
2220
2216
  try {
2221
- return window.localStorage.getItem(Nt) ?? void 0;
2217
+ return window.localStorage.getItem(Vt) ?? void 0;
2222
2218
  } catch {
2223
- return Vt ?? void 0;
2219
+ return Xt ?? void 0;
2224
2220
  }
2225
2221
  }
2226
- function kt(i) {
2227
- Vt = i;
2222
+ function St(i) {
2223
+ Xt = i;
2228
2224
  try {
2229
- window.localStorage.setItem(Nt, i);
2225
+ window.localStorage.setItem(Vt, i);
2230
2226
  } catch {
2231
2227
  }
2232
2228
  }
2233
- function St() {
2229
+ function Et() {
2234
2230
  return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? `anon_${crypto.randomUUID()}` : `anon_${`${Date.now().toString(16)}-${Math.random().toString(16).slice(2, 10)}`}`;
2235
2231
  }
2236
- const nr = {
2232
+ const sr = {
2237
2233
  tab: "Feedback",
2238
2234
  toolbar: {
2239
2235
  markup: "Mark up",
@@ -2310,7 +2306,7 @@ const nr = {
2310
2306
  error: "AI clarification failed. Please try again.",
2311
2307
  expired: "This feedback session expired before it could be sent. Please close the widget and submit again."
2312
2308
  }
2313
- }, sr = {
2309
+ }, or = {
2314
2310
  tab: "反馈",
2315
2311
  toolbar: {
2316
2312
  markup: "标注",
@@ -2387,7 +2383,7 @@ const nr = {
2387
2383
  error: "AI 澄清失败,请重试。",
2388
2384
  expired: "这条反馈在发送前已过期。请关闭组件后重新提交。"
2389
2385
  }
2390
- }, or = {
2386
+ }, ar = {
2391
2387
  tab: "フィードバック",
2392
2388
  toolbar: {
2393
2389
  markup: "マークアップ",
@@ -2464,7 +2460,7 @@ const nr = {
2464
2460
  error: "AIによる確認に失敗しました。もう一度お試しください。",
2465
2461
  expired: "このフィードバックは送信される前に有効期限が切れました。ウィジェットを閉じて、もう一度送信してください。"
2466
2462
  }
2467
- }, ar = {
2463
+ }, lr = {
2468
2464
  tab: "피드백",
2469
2465
  toolbar: {
2470
2466
  markup: "마크업",
@@ -2541,7 +2537,7 @@ const nr = {
2541
2537
  error: "AI 확인에 실패했습니다. 다시 시도해 주세요.",
2542
2538
  expired: "이 피드백 세션은 전송되기 전에 만료되었습니다. 위젯을 닫고 다시 보내 주세요."
2543
2539
  }
2544
- }, lr = {
2540
+ }, cr = {
2545
2541
  tab: "Comentarios",
2546
2542
  toolbar: {
2547
2543
  markup: "Anotar",
@@ -2618,7 +2614,7 @@ const nr = {
2618
2614
  error: "No se pudo completar la aclaración con IA. Inténtalo de nuevo.",
2619
2615
  expired: "Esta sesión de comentarios caducó antes de poder enviarse. Cierra el widget y envíalo de nuevo."
2620
2616
  }
2621
- }, cr = {
2617
+ }, dr = {
2622
2618
  tab: "Avis",
2623
2619
  toolbar: {
2624
2620
  markup: "Annoter",
@@ -2695,7 +2691,7 @@ const nr = {
2695
2691
  error: "La clarification par IA a échoué. Réessayez.",
2696
2692
  expired: "Cette session de retour a expiré avant d'avoir pu être envoyée. Fermez le widget et renvoyez-la."
2697
2693
  }
2698
- }, dr = {
2694
+ }, hr = {
2699
2695
  tab: "Feedback",
2700
2696
  toolbar: {
2701
2697
  markup: "Markieren",
@@ -2773,51 +2769,51 @@ const nr = {
2773
2769
  expired: "Diese Feedback-Sitzung ist abgelaufen, bevor sie gesendet werden konnte. Bitte schließe das Widget und sende erneut."
2774
2770
  }
2775
2771
  }, T = {
2776
- en: nr,
2777
- "zh-CN": sr,
2778
- ja: or,
2779
- ko: ar,
2780
- es: lr,
2781
- fr: cr,
2782
- de: dr
2772
+ en: sr,
2773
+ "zh-CN": or,
2774
+ ja: ar,
2775
+ ko: lr,
2776
+ es: cr,
2777
+ fr: dr,
2778
+ de: hr
2783
2779
  };
2784
- function Et(i) {
2780
+ function Ct(i) {
2785
2781
  if (T[i]) return T[i];
2786
2782
  const t = i.split("-")[0];
2787
2783
  return T[t] ? T[t] : T.en;
2788
2784
  }
2789
- const hr = 60, ur = "rr-block", mr = "rr-mask", fr = "https://cdn.jsdelivr.net/npm/@rrweb/record@2.1.0/umd/record.min.js", br = "sha384-MrD66HBNSykaP2N95+6hQCFlF5oH2tvL3TD/zyvHNkP/sAFWZx98DX9MEDy8MdVT";
2790
- let I = null;
2791
- function pr() {
2792
- return I || (I = gr().catch(() => yr()), I);
2785
+ const ur = 60, mr = "rr-block", fr = "rr-mask", br = "https://cdn.jsdelivr.net/npm/@rrweb/record@2.1.0/umd/record.min.js", pr = "sha384-MrD66HBNSykaP2N95+6hQCFlF5oH2tvL3TD/zyvHNkP/sAFWZx98DX9MEDy8MdVT";
2786
+ let D = null;
2787
+ function gr() {
2788
+ return D || (D = yr().catch(() => wr()), D);
2793
2789
  }
2794
- async function gr() {
2790
+ async function yr() {
2795
2791
  return (await import("@rrweb/record")).record;
2796
2792
  }
2797
- function Ct() {
2793
+ function _t() {
2798
2794
  const i = globalThis;
2799
2795
  return i.rrwebRecord?.record ?? i.rrweb?.record;
2800
2796
  }
2801
- function yr() {
2797
+ function wr() {
2802
2798
  return new Promise((i, t) => {
2803
- const e = Ct();
2799
+ const e = _t();
2804
2800
  if (e) {
2805
2801
  i(e);
2806
2802
  return;
2807
2803
  }
2808
2804
  const r = document.createElement("script");
2809
- r.src = fr, r.integrity = br, r.crossOrigin = "anonymous", r.onload = () => {
2810
- const n = Ct();
2805
+ r.src = br, r.integrity = pr, r.crossOrigin = "anonymous", r.onload = () => {
2806
+ const n = _t();
2811
2807
  n ? i(n) : t(new Error("rrweb record global not found after script load"));
2812
2808
  }, r.onerror = () => t(new Error("Failed to load rrweb from CDN")), document.head.appendChild(r);
2813
2809
  });
2814
2810
  }
2815
- class wr {
2811
+ class xr {
2816
2812
  constructor(t, e, r = {}) {
2817
2813
  this.events = [], this.stopFn = null, this.startedAt = 0, this.timer = null, this.clickHandler = null, this.stopped = !1, this.destroyed = !1, this.shadow = t, this.onMaxReached = e, this.options = r;
2818
2814
  }
2819
2815
  async start() {
2820
- const t = await pr();
2816
+ const t = await gr();
2821
2817
  this.destroyed || (this.startedAt = Date.now(), this.stopped = !1, this.stopFn = t({
2822
2818
  emit: (e) => {
2823
2819
  this.stopped || this.events.push(e);
@@ -2827,8 +2823,8 @@ class wr {
2827
2823
  // to be on, which may be a checkout or a 2FA prompt, and nothing downstream
2828
2824
  // scrubs it. Customers who need real values in replays must opt in.
2829
2825
  maskAllInputs: this.options.maskAllInputs ?? !0,
2830
- blockClass: ur,
2831
- maskTextClass: mr
2826
+ blockClass: mr,
2827
+ maskTextClass: fr
2832
2828
  }), this.clickHandler = (e) => {
2833
2829
  this.showClickRipple(e.clientX, e.clientY), t.addCustomEvent?.("mtb-click", {
2834
2830
  x: e.clientX,
@@ -2837,7 +2833,7 @@ class wr {
2837
2833
  });
2838
2834
  }, document.addEventListener("click", this.clickHandler, !0), this.timer = setTimeout(() => {
2839
2835
  this.onMaxReached?.();
2840
- }, hr * 1e3));
2836
+ }, ur * 1e3));
2841
2837
  }
2842
2838
  stop() {
2843
2839
  return this.stopped = !0, this.stopFn?.(), this.stopFn = null, this.cleanupTimer(), this.cleanupClickHandler(), {
@@ -2862,7 +2858,7 @@ class wr {
2862
2858
  r.style.left = `${t}px`, r.style.top = `${e}px`, this.shadow.append(r), r.addEventListener("animationend", () => r.remove());
2863
2859
  }
2864
2860
  }
2865
- class xr {
2861
+ class vr {
2866
2862
  constructor(t, e, r, n) {
2867
2863
  this.intervalId = null, this.getDuration = r, this.el = t.el("div", "mtb-record-bar"), this.el.innerHTML = `
2868
2864
  <span class="mtb-record-dot"></span>
@@ -2878,12 +2874,12 @@ class xr {
2878
2874
  this.intervalId && (clearInterval(this.intervalId), this.intervalId = null), this.el.remove();
2879
2875
  }
2880
2876
  }
2881
- class vr {
2877
+ class kr {
2882
2878
  constructor() {
2883
2879
  this.session = null, this.bar = null, this.result = null;
2884
2880
  }
2885
2881
  async start(t, e, r, n = {}) {
2886
- this.session = new wr(t, r, n), this.bar = new xr(
2882
+ this.session = new xr(t, r, n), this.bar = new vr(
2887
2883
  t,
2888
2884
  e,
2889
2885
  () => this.session?.getDuration() ?? 0,
@@ -2903,14 +2899,14 @@ class vr {
2903
2899
  this.session?.destroy(), this.session = null, this.bar?.destroy(), this.bar = null;
2904
2900
  }
2905
2901
  }
2906
- const kr = 3e3, _t = 12e3;
2907
- function Sr() {
2902
+ const Sr = 3e3, Tt = 12e3;
2903
+ function Er() {
2908
2904
  const { hostname: i } = window.location;
2909
2905
  return i === "localhost" || i === "127.0.0.1" || i === "[::1]" || i.endsWith(".localhost") || i.endsWith(".local") || i.endsWith(".test");
2910
2906
  }
2911
2907
  class K {
2912
2908
  constructor(t) {
2913
- this.tab = null, this.toolbar = null, this.session = null, this.scrollLock = new te(), 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) => {
2909
+ this.tab = null, this.toolbar = null, this.session = null, this.scrollLock = new ie(), 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) => {
2914
2910
  if (e.key === "Escape")
2915
2911
  switch (this.mode) {
2916
2912
  case "annotating":
@@ -2926,11 +2922,11 @@ class K {
2926
2922
  }
2927
2923
  }, this.handleRecordStop = () => {
2928
2924
  this.recordingManager && (this.recordingManager.stop(), this.via = "record", this.showPopup(window.innerWidth / 2, window.innerHeight / 2, this.messages.record.timer_label));
2929
- }, this.config = t, this.messages = Et(t.locale ?? document.documentElement.lang ?? "en"), this.apiClient = new xe(t.projectKey, t.apiUrl, void 0, t.userToken, t.userTokenFn), this.consoleCollector = new Bi(), this.consoleCollector.start(), this.breadcrumbCollector = new Oi(), this.breadcrumbCollector.start(), this.buildUI(), t.frustrationDetection !== !1 && (this.frustrationDetector = new X(() => this.handleFrustration()), this.frustrationDetector.start()), document.addEventListener("keydown", this.handleKeydown, !0);
2925
+ }, this.config = t, this.messages = Ct(t.locale ?? document.documentElement.lang ?? "en"), this.apiClient = new ve(t.projectKey, t.apiUrl, void 0, t.userToken, t.userTokenFn), this.consoleCollector = new Fi(), this.consoleCollector.start(), this.breadcrumbCollector = new ji(), this.breadcrumbCollector.start(), this.buildUI(), t.frustrationDetection !== !1 && (this.frustrationDetector = new X(() => this.handleFrustration()), this.frustrationDetector.start()), document.addEventListener("keydown", this.handleKeydown, !0);
2930
2926
  }
2931
2927
  buildUI() {
2932
- if (this.shadow = new Kt(this.config.theme ?? "auto"), this.config.entryMode === "api") {
2933
- Sr() && console.warn(
2928
+ if (this.shadow = new Jt(this.config.theme ?? "auto"), this.config.entryMode === "api") {
2929
+ Er() && console.warn(
2934
2930
  '[MakeThisBetter] entryMode: "api" renders no launcher. Call MakeThisBetter.open() from your own UI, or use showLauncher().'
2935
2931
  );
2936
2932
  return;
@@ -2938,7 +2934,7 @@ class K {
2938
2934
  this.mountTab();
2939
2935
  }
2940
2936
  mountTab() {
2941
- this.tab || (this.tab = new Gt(
2937
+ this.tab || (this.tab = new Qt(
2942
2938
  this.shadow,
2943
2939
  this.messages,
2944
2940
  this.config.position ?? "right",
@@ -2963,18 +2959,18 @@ class K {
2963
2959
  // the language they were opened in rather than being re-rendered underneath a
2964
2960
  // reporter who may be mid-sentence.
2965
2961
  setLocale(t) {
2966
- this.config.locale = t, this.messages = Et(t), this.tab?.setMessages(this.messages);
2962
+ this.config.locale = t, this.messages = Ct(t), this.tab?.setMessages(this.messages);
2967
2963
  }
2968
2964
  handleTabClick() {
2969
2965
  this.mode === "idle" ? (this.dismissFrustrationPrompt(), this.enterAnnotationMode()) : this.exitAll();
2970
2966
  }
2971
2967
  handleFrustration() {
2972
- this.mode !== "idle" || this.frustrationPrompt || ji() || (this.frustrationPrompt = new Qt(this.shadow, this.messages, {
2968
+ this.mode !== "idle" || this.frustrationPrompt || qi() || (this.frustrationPrompt = new te(this.shadow, this.messages, {
2973
2969
  onTell: () => {
2974
2970
  this.dismissFrustrationPrompt(), this.enterAnnotationMode();
2975
2971
  },
2976
2972
  onDismiss: () => {
2977
- qi(), this.dismissFrustrationPrompt();
2973
+ Ni(), this.dismissFrustrationPrompt();
2978
2974
  },
2979
2975
  // An unnoticed card is not a refusal, so it must not suppress later
2980
2976
  // prompts. The detector's own 60s cooldown does the rate limiting.
@@ -2985,7 +2981,7 @@ class K {
2985
2981
  this.frustrationPrompt?.destroy(), this.frustrationPrompt = null;
2986
2982
  }
2987
2983
  enterAnnotationMode() {
2988
- this.mode = "annotating", this.tab?.setActive(!0), this.scrollLock.lock(), this.toolbar = new ee(
2984
+ this.mode = "annotating", this.tab?.setActive(!0), this.scrollLock.lock(), this.toolbar = new re(
2989
2985
  this.shadow,
2990
2986
  this.messages,
2991
2987
  () => this.exitAll(),
@@ -2997,7 +2993,7 @@ class K {
2997
2993
  ), this.session = this.createSession();
2998
2994
  }
2999
2995
  createSession() {
3000
- return new he(this.shadow, this.messages, {
2996
+ return new me(this.shadow, this.messages, {
3001
2997
  onPin: (t, e) => {
3002
2998
  this.currentAnnotation = t, this.via = "pin", this.showPopup(t.x, t.y, e, t.targetRect);
3003
2999
  },
@@ -3011,7 +3007,7 @@ class K {
3011
3007
  }
3012
3008
  if (t === "record") {
3013
3009
  if (this.mode === "recording") return;
3014
- this.mode = "recording", this.currentAnnotation = null, this.teardownDraw(), this.session?.destroy(), this.session = null, this.scrollLock.unlock(), this.recordingManager = new vr(), this.recordingManager.start(
3010
+ this.mode = "recording", this.currentAnnotation = null, this.teardownDraw(), this.session?.destroy(), this.session = null, this.scrollLock.unlock(), this.recordingManager = new kr(), this.recordingManager.start(
3015
3011
  this.shadow,
3016
3012
  this.messages,
3017
3013
  this.handleRecordStop,
@@ -3023,7 +3019,11 @@ class K {
3023
3019
  this.recordingManager?.destroy(), this.recordingManager = null, this.teardownDraw(), this.session || (this.session = this.createSession()), this.scrollLock.lock(), this.mode = "annotating";
3024
3020
  }
3025
3021
  handleDrawStroke() {
3026
- this.mode !== "drawing" && (this.mode = "drawing", this.drawBar = new pe(this.shadow, {
3022
+ if (Lt()) {
3023
+ this.showDrawSheet();
3024
+ return;
3025
+ }
3026
+ this.mode !== "drawing" && (this.mode = "drawing", this.drawBar = new ye(this.shadow, {
3027
3027
  messages: this.messages,
3028
3028
  onUndo: () => this.handleDrawUndoRedo("undo"),
3029
3029
  onRedo: () => this.handleDrawUndoRedo("redo"),
@@ -3031,6 +3031,24 @@ class K {
3031
3031
  onSubmit: (t) => this.handleDrawSubmit(t)
3032
3032
  })), this.refreshDrawBar();
3033
3033
  }
3034
+ /**
3035
+ * The note sheet for a finished drawing on touch.
3036
+ *
3037
+ * Cancel here means "throw the drawing away and keep annotating", not "close
3038
+ * the widget" — the reporter is mid-task and a stray stroke should cost one
3039
+ * tap, not the whole session.
3040
+ */
3041
+ showDrawSheet() {
3042
+ this.mode !== "drawing" && (this.mode = "drawing", this.popup = new nt(this.shadow, {
3043
+ targetName: this.messages.annotation.drawing,
3044
+ x: window.innerWidth / 2,
3045
+ y: window.innerHeight / 2,
3046
+ messages: this.messages,
3047
+ onSubmit: (t) => this.handleDrawSubmit(t),
3048
+ onClose: () => this.cancelDraw(),
3049
+ position: this.config.position ?? "right"
3050
+ }), this.submittingUi = this.popup);
3051
+ }
3034
3052
  handleDrawUndoRedo(t) {
3035
3053
  t === "undo" ? this.session?.undoDraw() : this.session?.redoDraw(), this.refreshDrawBar();
3036
3054
  }
@@ -3038,7 +3056,7 @@ class K {
3038
3056
  this.session && this.drawBar?.setUndoRedo(this.session.canUndoDraw(), this.session.canRedoDraw());
3039
3057
  }
3040
3058
  cancelDraw() {
3041
- this.session?.clearDraw(), this.teardownDraw(), this.mode = "annotating";
3059
+ this.session?.clearDraw(), this.teardownDraw(), this.popup?.destroy(), this.popup = null, this.dim?.destroy(), this.dim = null, this.submittingUi = null, this.mode = "annotating";
3042
3060
  }
3043
3061
  teardownDraw() {
3044
3062
  this.drawBar?.destroy(), this.drawBar = null;
@@ -3049,10 +3067,10 @@ class K {
3049
3067
  this.cancelDraw();
3050
3068
  return;
3051
3069
  }
3052
- this.currentAnnotation = e, this.via = "draw", this.session?.dismissInteraction(), this.submittingUi = this.drawBar, this.handleSubmit(t || this.messages.annotation.drawing);
3070
+ this.currentAnnotation = e, this.via = "draw", this.session?.dismissInteraction(), this.submittingUi = this.drawBar ?? this.popup, this.handleSubmit(t || this.messages.annotation.drawing);
3053
3071
  }
3054
3072
  showPopup(t, e, r, n) {
3055
- 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 Zt(this.shadow, () => this.exitAll()), this.popup = new ge(this.shadow, {
3073
+ 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 ee(this.shadow, () => this.exitAll()), this.popup = new nt(this.shadow, {
3056
3074
  targetName: r,
3057
3075
  x: t,
3058
3076
  y: e,
@@ -3065,29 +3083,29 @@ class K {
3065
3083
  }), this.submittingUi = this.popup;
3066
3084
  }
3067
3085
  buildMyFeedbackHandler() {
3068
- if (!this.config.user && rr())
3086
+ if (!this.config.user && nr())
3069
3087
  return async () => {
3070
- const t = await this.apiClient.createIdentityToken(xt());
3071
- !t?.identity_token || !t.board_url || (kt(t.board_url), window.open(`${t.board_url}?identity=${encodeURIComponent(t.identity_token)}`, "_blank"));
3088
+ const t = await this.apiClient.createIdentityToken(vt());
3089
+ !t?.identity_token || !t.board_url || (St(t.board_url), window.open(`${t.board_url}?identity=${encodeURIComponent(t.identity_token)}`, "_blank"));
3072
3090
  };
3073
3091
  }
3074
3092
  async handleSubmit(t) {
3075
3093
  const e = this.submittingUi;
3076
3094
  if (!e) return;
3077
3095
  const r = ++this.submissionAttempt;
3078
- e.setLoading(!0), await Er();
3096
+ e.setLoading(!0), await Cr();
3079
3097
  const n = this.currentAnnotation, s = this.recordingManager?.getRecording() ?? void 0, [o, a] = await Promise.all([
3080
- Li(n ? [n] : []),
3081
- Promise.resolve(Qi())
3082
- ]), l = er(
3098
+ Mi(n ? [n] : []),
3099
+ Promise.resolve(Zi())
3100
+ ]), l = ir(
3083
3101
  t,
3084
3102
  a,
3085
3103
  this.consoleCollector.getErrors(),
3086
3104
  n,
3087
3105
  this.config.user,
3088
3106
  s,
3089
- this.config.user ? void 0 : xt(),
3090
3107
  this.config.user ? void 0 : vt(),
3108
+ this.config.user ? void 0 : kt(),
3091
3109
  this.breadcrumbCollector.getBreadcrumbs()
3092
3110
  );
3093
3111
  try {
@@ -3113,16 +3131,16 @@ class K {
3113
3131
  return;
3114
3132
  }
3115
3133
  const n = new AbortController();
3116
- let s = setTimeout(() => n.abort(), _t);
3134
+ let s = setTimeout(() => n.abort(), Tt);
3117
3135
  const o = () => {
3118
- clearTimeout(s), s = setTimeout(() => n.abort(), _t);
3136
+ clearTimeout(s), s = setTimeout(() => n.abort(), Tt);
3119
3137
  }, a = this.apiClient.streamClarification(
3120
3138
  t.id,
3121
3139
  t.token,
3122
3140
  o,
3123
3141
  n.signal
3124
3142
  ).catch(() => null).finally(() => clearTimeout(s)), l = new Promise(
3125
- (u) => setTimeout(() => u(null), kr)
3143
+ (u) => setTimeout(() => u(null), Sr)
3126
3144
  ), c = await Promise.race([a, l]);
3127
3145
  if (r !== this.submissionAttempt) return;
3128
3146
  const d = this.teardownSubmittingUi(!0);
@@ -3133,7 +3151,7 @@ class K {
3133
3151
  return this.scrollLock.unlock(), this.teardownDraw(), e || this.popup?.destroy(), this.popup = null, this.dim?.destroy(), this.dim = null, this.session?.hideHighlight(), this.session?.destroy(), this.session = null, this.recordingManager?.destroy(), this.recordingManager = null, this.submittingUi = null, e;
3134
3152
  }
3135
3153
  showClarify(t, e, r) {
3136
- this.mode = "clarifying", this.tab?.setActive(!0), this.clarify = new Le(this.shadow, {
3154
+ this.mode = "clarifying", this.tab?.setActive(!0), this.clarify = new Me(this.shadow, {
3137
3155
  submissionSessionId: t.id,
3138
3156
  submissionToken: t.token,
3139
3157
  apiClient: this.apiClient,
@@ -3155,21 +3173,21 @@ class K {
3155
3173
  feedbackId: r.id,
3156
3174
  boardUrl: r.board_url,
3157
3175
  identityToken: r.identity_token
3158
- }, r.board_url && kt(r.board_url), this.clarify?.destroy(), this.clarify = null, this.toolbar?.destroy(), this.toolbar = null, this.showSuccess({ skipFollowup: t.ai_clarify_available === !1 }));
3176
+ }, r.board_url && St(r.board_url), this.clarify?.destroy(), this.clarify = null, this.toolbar?.destroy(), this.toolbar = null, this.showSuccess({ skipFollowup: t.ai_clarify_available === !1 }));
3159
3177
  }
3160
3178
  showSuccess(t) {
3161
- this.mode = "idle", this.tab?.setActive(!1), this.success = new Ae(this.shadow, this.messages, () => {
3179
+ this.mode = "idle", this.tab?.setActive(!1), this.success = new Re(this.shadow, this.messages, () => {
3162
3180
  this.success?.destroy(), this.success = null;
3163
3181
  }, this.buildViewFeedbackHandler(), { ...t, emailCapture: this.buildEmailCapture() });
3164
3182
  }
3165
3183
  buildEmailCapture() {
3166
3184
  if (this.config.user) return;
3167
3185
  const { feedbackId: t, identityToken: e } = this.lastHandoff;
3168
- if (!(!t || !e) && !vt())
3186
+ if (!(!t || !e) && !kt())
3169
3187
  return {
3170
3188
  onSubmit: async (r) => {
3171
3189
  const n = await this.apiClient.updateReporter(t, r, e);
3172
- return n && ir(r), n;
3190
+ return n && rr(r), n;
3173
3191
  }
3174
3192
  };
3175
3193
  }
@@ -3197,11 +3215,11 @@ class K {
3197
3215
  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();
3198
3216
  }
3199
3217
  }
3200
- function Er() {
3218
+ function Cr() {
3201
3219
  return new Promise((i) => requestAnimationFrame(() => setTimeout(i, 0)));
3202
3220
  }
3203
3221
  let f = null, E = null;
3204
- const Cr = {
3222
+ const _r = {
3205
3223
  init(i) {
3206
3224
  f && (f.destroy(), f = null), E = i, document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", () => {
3207
3225
  f = new K(i);
@@ -3231,11 +3249,11 @@ const Cr = {
3231
3249
  f?.hideLauncher();
3232
3250
  }
3233
3251
  };
3234
- typeof window < "u" && (window.MakeThisBetter = Cr, document.addEventListener("turbo:load", () => {
3252
+ typeof window < "u" && (window.MakeThisBetter = _r, document.addEventListener("turbo:load", () => {
3235
3253
  const i = document.getElementById("mtb-widget-host");
3236
3254
  E && (!i || !i.shadowRoot) && (f?.destroy(), i?.remove(), f = new K(E));
3237
3255
  }));
3238
3256
  export {
3239
- Cr as MakeThisBetter
3257
+ _r as MakeThisBetter
3240
3258
  };
3241
3259
  //# sourceMappingURL=makethisbetter.esm.js.map