makethisbetter 1.2.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/dist/i18n/de.d.ts +2 -0
  2. package/dist/i18n/de.d.ts.map +1 -1
  3. package/dist/i18n/en.d.ts +2 -0
  4. package/dist/i18n/en.d.ts.map +1 -1
  5. package/dist/i18n/es.d.ts +2 -0
  6. package/dist/i18n/es.d.ts.map +1 -1
  7. package/dist/i18n/fr.d.ts +2 -0
  8. package/dist/i18n/fr.d.ts.map +1 -1
  9. package/dist/i18n/ja.d.ts +2 -0
  10. package/dist/i18n/ja.d.ts.map +1 -1
  11. package/dist/i18n/ko.d.ts +2 -0
  12. package/dist/i18n/ko.d.ts.map +1 -1
  13. package/dist/i18n/zh-CN.d.ts +2 -0
  14. package/dist/i18n/zh-CN.d.ts.map +1 -1
  15. package/dist/makethisbetter.cjs.js +19 -19
  16. package/dist/makethisbetter.cjs.js.map +1 -1
  17. package/dist/makethisbetter.esm.js +261 -243
  18. package/dist/makethisbetter.esm.js.map +1 -1
  19. package/dist/makethisbetter.js +17 -17
  20. package/dist/makethisbetter.js.map +1 -1
  21. package/dist/popup/success.d.ts +4 -1
  22. package/dist/popup/success.d.ts.map +1 -1
  23. package/dist/record/session.cdn.test.d.ts +2 -0
  24. package/dist/record/session.cdn.test.d.ts.map +1 -0
  25. package/dist/record/session.d.ts.map +1 -1
  26. package/dist/types.d.ts +1 -0
  27. package/dist/types.d.ts.map +1 -1
  28. package/dist/widget/controller.d.ts.map +1 -1
  29. package/package.json +1 -1
  30. package/src/i18n/de.ts +2 -0
  31. package/src/i18n/en.ts +2 -0
  32. package/src/i18n/es.ts +2 -0
  33. package/src/i18n/fr.ts +2 -0
  34. package/src/i18n/ja.ts +2 -0
  35. package/src/i18n/ko.ts +2 -0
  36. package/src/i18n/zh-CN.ts +2 -0
  37. package/src/popup/success.test.ts +13 -0
  38. package/src/popup/success.ts +10 -3
  39. package/src/record/session.cdn.test.ts +89 -0
  40. package/src/record/session.ts +21 -7
  41. package/src/types.ts +1 -0
  42. package/src/widget/controller.test.ts +4 -1
  43. package/src/widget/controller.ts +8 -5
@@ -1,9 +1,9 @@
1
- const st = '*,*:before,*:after{box-sizing:border-box;margin:0;padding:0}:host{all:initial;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;font-size:14px;line-height:1.5;color:#191a1c;-webkit-font-smoothing:antialiased}:host([data-mtb-theme="dark"]) .mtb-popup,:host([data-mtb-theme="dark"]) .mtb-success{background:#151719;border-color:#ffffff1f;color:#f9fafb}:host([data-mtb-theme="dark"]) .mtb-popup-header{border-bottom-color:#ffffff1a}:host([data-mtb-theme="dark"]) .mtb-popup-title,:host([data-mtb-theme="dark"]) .mtb-success-title{color:#f9fafb}:host([data-mtb-theme="dark"]) .mtb-quick-option,:host([data-mtb-theme="dark"]) .mtb-textarea{background:#1f2327;border-color:#ffffff1f;color:#f9fafb}:host([data-mtb-theme="dark"]) .mtb-popup-close,:host([data-mtb-theme="dark"]) .mtb-success-msg,:host([data-mtb-theme="dark"]) .mtb-close-link{color:#ffffffad}@media (prefers-color-scheme: dark){:host([data-mtb-theme="auto"]) .mtb-popup,:host([data-mtb-theme="auto"]) .mtb-success{background:#151719;border-color:#ffffff1f;color:#f9fafb}:host([data-mtb-theme="auto"]) .mtb-popup-header{border-bottom-color:#ffffff1a}:host([data-mtb-theme="auto"]) .mtb-popup-title,:host([data-mtb-theme="auto"]) .mtb-success-title{color:#f9fafb}:host([data-mtb-theme="auto"]) .mtb-quick-option,:host([data-mtb-theme="auto"]) .mtb-textarea{background:#1f2327;border-color:#ffffff1f;color:#f9fafb}:host([data-mtb-theme="auto"]) .mtb-popup-close,:host([data-mtb-theme="auto"]) .mtb-success-msg,:host([data-mtb-theme="auto"]) .mtb-close-link{color:#ffffffad}}.mtb-tab{position:fixed;top:50%;right:0;transform:translateY(-50%);z-index:2147483646;display:flex;align-items:center;justify-content:center;width:32px;padding:14px 0;background:#059669;color:#fff;border-radius:8px 0 0 8px;cursor:pointer;box-shadow:-2px 0 14px #05966959;transition:background .15s,box-shadow .15s,width .15s;writing-mode:vertical-lr;text-orientation:mixed;font-size:12px;font-weight:600;letter-spacing:.04em;user-select:none;border:none;outline:none}.mtb-tab.left{right:auto;left:0;border-radius:0 8px 8px 0;box-shadow:2px 0 14px #05966959}.mtb-tab:hover{background:#047857;box-shadow:-3px 0 20px #05966980}.mtb-tab.active{background:#065f46}.mtb-toolbar{position:fixed;top:18px;left:50%;transform:translate(-50%);z-index:2147483647;display:flex;align-items:center;gap:11px;height:46px;padding:0 7px;border-radius:13px;background:linear-gradient(120deg,#10b981,#059669);box-shadow:0 10px 26px #0f172a38;animation:mtbBarIn .2s ease;white-space:nowrap}@keyframes mtbBarIn{0%{transform:translate(-50%,12px);opacity:0}to{transform:translate(-50%);opacity:1}}.mtb-toolbar-modes{display:flex;align-items:center;gap:3px;background:#ffffff29;border-radius:9px;padding:3px}.mtb-toolbar-mode-btn{display:inline-flex;align-items:center;gap:6px;height:30px;padding:0 12px;border-radius:7px;border:none;cursor:pointer;font-family:inherit;font-size:12px;font-weight:550;white-space:nowrap;background:transparent;color:#fffffff2;transition:all .12s}.mtb-toolbar-mode-btn.active{background:#fff;color:#047857}.mtb-toolbar-hint{font-size:12px;color:#fffffff2;white-space:nowrap}.mtb-toolbar-sep{width:1px;height:20px;background:#ffffff38}.mtb-exit-btn{display:inline-flex;align-items:center;gap:5px;height:30px;padding:0 12px;border-radius:8px;font-size:11.5px;font-weight:500;color:#fff;cursor:pointer;background:#ffffff29;border:none;font-family:inherit;transition:background .12s}.mtb-exit-btn:hover{background:#ffffff47}.mtb-overlay{position:fixed;inset:0;z-index:2147483640;cursor:crosshair}.mtb-dim{position:fixed;inset:0;z-index:2147483639;background:#00000014}.mtb-highlight{position:fixed;z-index:2147483641;pointer-events:none;border:2px solid #10b981;border-radius:6px;background:#10b9810f;transition:all .08s ease}.mtb-highlight-tooltip{position:fixed;z-index:2147483642;pointer-events:none;transform:translate(-50%);background:#064e3b;color:#fff;padding:4px 10px;border-radius:6px;font-size:11px;font-weight:500;white-space:nowrap;box-shadow:0 4px 12px #0000002e}.mtb-highlight-tooltip:after{content:"";position:absolute;top:100%;left:50%;transform:translate(-50%);border:4px solid transparent;border-top-color:#064e3b}.mtb-draw-svg{position:fixed;inset:0;z-index:2147483643;pointer-events:none;width:100%;height:100%;overflow:visible}.mtb-pin{position:fixed;z-index:2147483644;pointer-events:none;width:22px;height:22px;border-radius:50% 50% 50% 2px;background:#059669;border:2px solid #fff;display:flex;align-items:center;justify-content:center;font-size:10px;color:#fff;font-weight:700;box-shadow:0 2px 8px #05966973;animation:mtbPinPop .25s cubic-bezier(.34,1.56,.64,1);transform:translate(-50%,-50%)}@keyframes mtbPinPop{0%{transform:translate(-50%,-50%) scale(.4)}to{transform:translate(-50%,-50%) scale(1)}}.mtb-popup{position:fixed;z-index:2147483645;width:320px;background:#fff;border:1px solid rgba(0,0,0,.1);border-radius:14px;box-shadow:0 12px 40px #00000029;overflow:hidden;animation:mtbSlideUp .28s cubic-bezier(.34,1.56,.64,1);font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif}@keyframes mtbSlideUp{0%{transform:translateY(14px) scale(.97);opacity:0}to{transform:translateY(0) scale(1);opacity:1}}.mtb-popup-header{padding:11px 13px 11px 14px;border-bottom:1px solid rgba(0,0,0,.06);display:flex;align-items:center;gap:8px}.mtb-popup-icon{width:20px;height:20px;border-radius:5px;background:#10b9811a;display:flex;align-items:center;justify-content:center;flex-shrink:0}.mtb-popup-title{flex:1;font-size:12.5px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#191a1c}.mtb-popup-close{background:none;border:none;cursor:pointer;padding:3px;color:#00000061;display:flex;align-items:center;border-radius:4px;transition:color .12s}.mtb-popup-close:hover{color:#000000b3}.mtb-popup-body{padding:13px}.mtb-quick-options{display:flex;flex-direction:column;gap:6px;margin-bottom:12px}.mtb-quick-option{display:flex;align-items:center;gap:10px;width:100%;padding:10px 12px;border:1px solid rgba(0,0,0,.09);border-radius:10px;background:#fafafa;cursor:pointer;font-family:inherit;font-size:13px;color:#191a1c;text-align:left;transition:all .12s}.mtb-quick-option:hover{background:#10b9810f;border-color:#10b9814d}.mtb-quick-option-emoji{font-size:15px;flex-shrink:0;line-height:1}.mtb-textarea-wrap{position:relative}.mtb-textarea{width:100%;height:64px;padding:9px 11px;border:1px solid rgba(0,0,0,.12);border-radius:9px;font-family:inherit;font-size:12.5px;line-height:1.5;color:#191a1c;outline:none;background:#fff;resize:none;transition:border-color .12s,box-shadow .12s}.mtb-textarea:focus{border-color:#10b981;box-shadow:0 0 0 3px #10b9811f}.mtb-textarea::placeholder{color:#00000057}.mtb-popup-error{margin-top:8px;color:#b91c1c;font-size:11.5px}.mtb-popup-error:empty,.mtb-popup-error[hidden]{display:none}.mtb-popup-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:12px}.mtb-cancel-btn,.mtb-submit-btn{min-width:72px;height:30px;border:none;border-radius:7px;cursor:pointer;display:flex;align-items:center;justify-content:center;padding:0 12px;font-family:inherit;font-size:12px;font-weight:600;transition:background .12s}.mtb-cancel-btn{background:#f3f4f6;color:#000000ad}.mtb-cancel-btn:hover{background:#e5e7eb}.mtb-submit-btn{background:#d1d5db;color:#fff}.mtb-submit-btn.ready{background:#059669}.mtb-submit-btn.ready:hover{background:#047857}.mtb-submit-btn.loading{background:#059669;opacity:.7;cursor:wait}.mtb-submit-btn:disabled{cursor:not-allowed}.mtb-success{position:fixed;z-index:2147483645;width:300px;background:#fff;border:1px solid rgba(0,0,0,.1);border-radius:16px;box-shadow:0 20px 60px #0000001f;padding:26px 22px;text-align:center;animation:mtbSlideUp .35s cubic-bezier(.34,1.56,.64,1);font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif}.mtb-success-icon{width:44px;height:44px;border-radius:50%;background:#05966914;display:flex;align-items:center;justify-content:center;margin:0 auto 12px}.mtb-success-title{font-size:16px;font-weight:700;margin-bottom:6px;color:#191a1c}.mtb-success-msg{font-size:13px;color:#0000008c;margin-bottom:16px;line-height:1.6}.mtb-close-link{background:none;border:none;cursor:pointer;font-size:12px;color:#00000073;font-family:inherit;transition:color .12s}.mtb-close-link:hover{color:#000000b3}.mtb-pet{position:fixed;bottom:20px;right:20px;z-index:2147483646;cursor:pointer;width:52px;height:52px;display:flex;align-items:center;justify-content:center;border-radius:50%;background:transparent;animation:mtbPetBounce 3s ease-in-out infinite;transition:transform .2s;user-select:none;outline:none;filter:drop-shadow(0 4px 12px rgba(5,150,105,.35))}.mtb-pet:hover{transform:scale(1.12);animation-play-state:paused}.mtb-pet:hover .mtb-pet-bubble{opacity:1;transform:translate(-50%) translateY(0);pointer-events:auto}.mtb-pet.active{animation:none;opacity:.6}.mtb-pet-svg{display:block}@keyframes mtbPetBounce{0%,to{transform:translateY(0)}50%{transform:translateY(-6px)}}.mtb-pet-bubble{position:absolute;bottom:100%;left:50%;transform:translate(-50%) translateY(4px);margin-bottom:8px;background:#064e3b;color:#fff;padding:6px 12px;border-radius:8px;font-size:12px;font-weight:500;white-space:nowrap;box-shadow:0 4px 14px #0000002e;opacity:0;pointer-events:none;transition:opacity .2s,transform .2s}.mtb-pet-bubble.visible{opacity:1;transform:translate(-50%) translateY(0);pointer-events:auto}.mtb-pet-bubble.hidden{opacity:0;pointer-events:none}.mtb-pet-bubble:after{content:"";position:absolute;top:100%;left:50%;transform:translate(-50%);border:5px solid transparent;border-top-color:#064e3b}.mtb-frustration-prompt{position:fixed;bottom:20px;right:20px;z-index:2147483645;display:flex;align-items:center;gap:10px;padding:12px 16px;background:#fff;border:1px solid rgba(0,0,0,.1);border-radius:12px;box-shadow:0 8px 30px #0000001f;animation:mtbSlideUp .35s cubic-bezier(.34,1.56,.64,1);font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif}:host([data-mtb-theme="dark"]) .mtb-frustration-prompt{background:#151719;border-color:#ffffff1f;color:#f9fafb}@media (prefers-color-scheme: dark){:host([data-mtb-theme="auto"]) .mtb-frustration-prompt{background:#151719;border-color:#ffffff1f;color:#f9fafb}}.mtb-frustration-icon{width:32px;height:32px;border-radius:50%;background:#eab3081a;display:flex;align-items:center;justify-content:center;flex-shrink:0;font-size:16px;line-height:1}.mtb-frustration-text{font-size:13px;font-weight:500;color:inherit;line-height:1.4}.mtb-frustration-actions{display:flex;gap:6px;flex-shrink:0}.mtb-frustration-tell{height:28px;padding:0 12px;border:none;border-radius:7px;background:#059669;color:#fff;cursor:pointer;font-family:inherit;font-size:12px;font-weight:600;transition:background .12s}.mtb-frustration-tell:hover{background:#047857}.mtb-frustration-dismiss{height:28px;padding:0 8px;border:none;border-radius:7px;background:transparent;color:#0006;cursor:pointer;font-family:inherit;font-size:12px;transition:color .12s}.mtb-frustration-dismiss:hover{color:#000000b3}:host([data-mtb-theme="dark"]) .mtb-frustration-dismiss{color:#fff6}:host([data-mtb-theme="dark"]) .mtb-frustration-dismiss:hover{color:#ffffffb3}@media (prefers-color-scheme: dark){:host([data-mtb-theme="auto"]) .mtb-frustration-dismiss{color:#fff6}:host([data-mtb-theme="auto"]) .mtb-frustration-dismiss:hover{color:#ffffffb3}}.mtb-record-bar{position:fixed;bottom:24px;left:50%;transform:translate(-50%);z-index:2147483647;display:flex;align-items:center;gap:12px;height:42px;padding:0 8px 0 14px;border-radius:12px;background:#0f172aeb;box-shadow:0 8px 24px #00000040;animation:mtbBarIn .2s ease}.mtb-record-dot{width:8px;height:8px;border-radius:50%;background:#ef4444;animation:mtbRecordPulse 1.2s ease-in-out infinite;flex-shrink:0}@keyframes mtbRecordPulse{0%,to{opacity:1}50%{opacity:.3}}.mtb-record-timer{font-family:JetBrains Mono,SF Mono,Fira Code,Cascadia Code,monospace;font-size:13px;font-weight:500;color:#fff;font-variant-numeric:tabular-nums;letter-spacing:.02em;min-width:38px}.mtb-record-stop{height:28px;padding:0 14px;border:none;border-radius:7px;background:#059669;color:#fff;cursor:pointer;font-family:inherit;font-size:12px;font-weight:600;transition:background .12s}.mtb-record-stop:hover{background:#047857}.mtb-click-ripple{position:fixed;z-index:2147483644;width:24px;height:24px;border-radius:50%;border:2px solid #10b981;background:#10b98133;pointer-events:none;transform:translate(-50%,-50%) scale(.5);animation:mtbClickRipple .3s ease-out forwards}@keyframes mtbClickRipple{0%{transform:translate(-50%,-50%) scale(.5);opacity:1}to{transform:translate(-50%,-50%) scale(2);opacity:0}}.mtb-dot{display:inline-block;width:4px;height:4px;border-radius:50%;background:#fff;animation:mtbDot 1.2s infinite}.mtb-dot:nth-child(2){animation-delay:.2s}.mtb-dot:nth-child(3){animation-delay:.4s}@keyframes mtbDot{0%,80%,to{opacity:.3;transform:translateY(0)}40%{opacity:1;transform:translateY(-3px)}}.mtb-clarify{position:fixed;z-index:2147483645;width:320px;background:#fff;border:1px solid rgba(0,0,0,.1);border-radius:16px;box-shadow:0 20px 60px #0000001f;display:flex;flex-direction:column;animation:mtbSlideUp .35s cubic-bezier(.34,1.56,.64,1);font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;overflow:hidden}.mtb-clarify-header{padding:10px 13px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid rgba(0,0,0,.06)}.mtb-clarify-icon{width:26px;height:26px;border-radius:50%;background:#05966914;display:flex;align-items:center;justify-content:center;flex-shrink:0}.mtb-clarify-skip{background:none;border:none;cursor:pointer;font-size:12px;color:#00000073;font-family:inherit;transition:color .12s}.mtb-clarify-skip:hover{color:#000000b3}.mtb-clarify-messages{flex:1;max-height:240px;overflow-y:auto;padding:12px 13px;display:flex;flex-direction:column;gap:8px}.mtb-clarify-bubble{max-width:85%;padding:8px 12px;border-radius:12px;font-size:13px;line-height:1.5;word-wrap:break-word}.mtb-clarify-ai{align-self:flex-start;background:#f3f4f6;color:#191a1c;border-bottom-left-radius:4px}.mtb-clarify-user{align-self:flex-end;background:#059669;color:#fff;border-bottom-right-radius:4px}.mtb-clarify-thinking{display:flex;align-items:center;gap:3px;padding:10px 16px}.mtb-clarify-thinking .mtb-dot{background:#9ca3af}.mtb-clarify-footer{padding:10px 13px;border-top:1px solid rgba(0,0,0,.06);display:flex;gap:8px}.mtb-clarify-input{flex:1;height:32px;padding:0 10px;border:1px solid rgba(0,0,0,.12);border-radius:8px;font-family:inherit;font-size:12.5px;color:#191a1c;outline:none;background:#fff;transition:border-color .12s,box-shadow .12s}.mtb-clarify-input:focus{border-color:#10b981;box-shadow:0 0 0 3px #10b9811f}.mtb-clarify-input::placeholder{color:#00000057}.mtb-clarify-send{height:32px;padding:0 14px;border:none;border-radius:8px;background:#d1d5db;color:#fff;cursor:pointer;font-family:inherit;font-size:12px;font-weight:600;transition:background .12s;flex-shrink:0}.mtb-clarify-send:not(:disabled){background:#059669}.mtb-clarify-send:not(:disabled):hover{background:#047857}.mtb-clarify-send:disabled{cursor:not-allowed}:host([data-mtb-theme="dark"]) .mtb-clarify{background:#151719;border-color:#ffffff1f;color:#f9fafb}:host([data-mtb-theme="dark"]) .mtb-clarify-header{border-bottom-color:#ffffff1a}:host([data-mtb-theme="dark"]) .mtb-clarify-footer{border-top-color:#ffffff1a}:host([data-mtb-theme="dark"]) .mtb-clarify-skip{color:#ffffff73}:host([data-mtb-theme="dark"]) .mtb-clarify-skip:hover{color:#ffffffb3}:host([data-mtb-theme="dark"]) .mtb-clarify-ai{background:#1f2327;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-footer{border-top-color:#ffffff1a}:host([data-mtb-theme="auto"]) .mtb-clarify-skip{color:#ffffff73}:host([data-mtb-theme="auto"]) .mtb-clarify-skip:hover{color:#ffffffb3}:host([data-mtb-theme="auto"]) .mtb-clarify-ai{background:#1f2327;color:#f9fafb}:host([data-mtb-theme="auto"]) .mtb-clarify-input{background:#1f2327;border-color:#ffffff1f;color:#f9fafb}}';
2
- class rt {
1
+ const rt = '*,*:before,*:after{box-sizing:border-box;margin:0;padding:0}:host{all:initial;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;font-size:14px;line-height:1.5;color:#191a1c;-webkit-font-smoothing:antialiased}:host([data-mtb-theme="dark"]) .mtb-popup,:host([data-mtb-theme="dark"]) .mtb-success{background:#151719;border-color:#ffffff1f;color:#f9fafb}:host([data-mtb-theme="dark"]) .mtb-popup-header{border-bottom-color:#ffffff1a}:host([data-mtb-theme="dark"]) .mtb-popup-title,:host([data-mtb-theme="dark"]) .mtb-success-title{color:#f9fafb}:host([data-mtb-theme="dark"]) .mtb-quick-option,:host([data-mtb-theme="dark"]) .mtb-textarea{background:#1f2327;border-color:#ffffff1f;color:#f9fafb}:host([data-mtb-theme="dark"]) .mtb-popup-close,:host([data-mtb-theme="dark"]) .mtb-success-msg,:host([data-mtb-theme="dark"]) .mtb-close-link{color:#ffffffad}@media (prefers-color-scheme: dark){:host([data-mtb-theme="auto"]) .mtb-popup,:host([data-mtb-theme="auto"]) .mtb-success{background:#151719;border-color:#ffffff1f;color:#f9fafb}:host([data-mtb-theme="auto"]) .mtb-popup-header{border-bottom-color:#ffffff1a}:host([data-mtb-theme="auto"]) .mtb-popup-title,:host([data-mtb-theme="auto"]) .mtb-success-title{color:#f9fafb}:host([data-mtb-theme="auto"]) .mtb-quick-option,:host([data-mtb-theme="auto"]) .mtb-textarea{background:#1f2327;border-color:#ffffff1f;color:#f9fafb}:host([data-mtb-theme="auto"]) .mtb-popup-close,:host([data-mtb-theme="auto"]) .mtb-success-msg,:host([data-mtb-theme="auto"]) .mtb-close-link{color:#ffffffad}}.mtb-tab{position:fixed;top:50%;right:0;transform:translateY(-50%);z-index:2147483646;display:flex;align-items:center;justify-content:center;width:32px;padding:14px 0;background:#059669;color:#fff;border-radius:8px 0 0 8px;cursor:pointer;box-shadow:-2px 0 14px #05966959;transition:background .15s,box-shadow .15s,width .15s;writing-mode:vertical-lr;text-orientation:mixed;font-size:12px;font-weight:600;letter-spacing:.04em;user-select:none;border:none;outline:none}.mtb-tab.left{right:auto;left:0;border-radius:0 8px 8px 0;box-shadow:2px 0 14px #05966959}.mtb-tab:hover{background:#047857;box-shadow:-3px 0 20px #05966980}.mtb-tab.active{background:#065f46}.mtb-toolbar{position:fixed;top:18px;left:50%;transform:translate(-50%);z-index:2147483647;display:flex;align-items:center;gap:11px;height:46px;padding:0 7px;border-radius:13px;background:linear-gradient(120deg,#10b981,#059669);box-shadow:0 10px 26px #0f172a38;animation:mtbBarIn .2s ease;white-space:nowrap}@keyframes mtbBarIn{0%{transform:translate(-50%,12px);opacity:0}to{transform:translate(-50%);opacity:1}}.mtb-toolbar-modes{display:flex;align-items:center;gap:3px;background:#ffffff29;border-radius:9px;padding:3px}.mtb-toolbar-mode-btn{display:inline-flex;align-items:center;gap:6px;height:30px;padding:0 12px;border-radius:7px;border:none;cursor:pointer;font-family:inherit;font-size:12px;font-weight:550;white-space:nowrap;background:transparent;color:#fffffff2;transition:all .12s}.mtb-toolbar-mode-btn.active{background:#fff;color:#047857}.mtb-toolbar-hint{font-size:12px;color:#fffffff2;white-space:nowrap}.mtb-toolbar-sep{width:1px;height:20px;background:#ffffff38}.mtb-exit-btn{display:inline-flex;align-items:center;gap:5px;height:30px;padding:0 12px;border-radius:8px;font-size:11.5px;font-weight:500;color:#fff;cursor:pointer;background:#ffffff29;border:none;font-family:inherit;transition:background .12s}.mtb-exit-btn:hover{background:#ffffff47}.mtb-overlay{position:fixed;inset:0;z-index:2147483640;cursor:crosshair}.mtb-dim{position:fixed;inset:0;z-index:2147483639;background:#00000014}.mtb-highlight{position:fixed;z-index:2147483641;pointer-events:none;border:2px solid #10b981;border-radius:6px;background:#10b9810f;transition:all .08s ease}.mtb-highlight-tooltip{position:fixed;z-index:2147483642;pointer-events:none;transform:translate(-50%);background:#064e3b;color:#fff;padding:4px 10px;border-radius:6px;font-size:11px;font-weight:500;white-space:nowrap;box-shadow:0 4px 12px #0000002e}.mtb-highlight-tooltip:after{content:"";position:absolute;top:100%;left:50%;transform:translate(-50%);border:4px solid transparent;border-top-color:#064e3b}.mtb-draw-svg{position:fixed;inset:0;z-index:2147483643;pointer-events:none;width:100%;height:100%;overflow:visible}.mtb-pin{position:fixed;z-index:2147483644;pointer-events:none;width:22px;height:22px;border-radius:50% 50% 50% 2px;background:#059669;border:2px solid #fff;display:flex;align-items:center;justify-content:center;font-size:10px;color:#fff;font-weight:700;box-shadow:0 2px 8px #05966973;animation:mtbPinPop .25s cubic-bezier(.34,1.56,.64,1);transform:translate(-50%,-50%)}@keyframes mtbPinPop{0%{transform:translate(-50%,-50%) scale(.4)}to{transform:translate(-50%,-50%) scale(1)}}.mtb-popup{position:fixed;z-index:2147483645;width:320px;background:#fff;border:1px solid rgba(0,0,0,.1);border-radius:14px;box-shadow:0 12px 40px #00000029;overflow:hidden;animation:mtbSlideUp .28s cubic-bezier(.34,1.56,.64,1);font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif}@keyframes mtbSlideUp{0%{transform:translateY(14px) scale(.97);opacity:0}to{transform:translateY(0) scale(1);opacity:1}}.mtb-popup-header{padding:11px 13px 11px 14px;border-bottom:1px solid rgba(0,0,0,.06);display:flex;align-items:center;gap:8px}.mtb-popup-icon{width:20px;height:20px;border-radius:5px;background:#10b9811a;display:flex;align-items:center;justify-content:center;flex-shrink:0}.mtb-popup-title{flex:1;font-size:12.5px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#191a1c}.mtb-popup-close{background:none;border:none;cursor:pointer;padding:3px;color:#00000061;display:flex;align-items:center;border-radius:4px;transition:color .12s}.mtb-popup-close:hover{color:#000000b3}.mtb-popup-body{padding:13px}.mtb-quick-options{display:flex;flex-direction:column;gap:6px;margin-bottom:12px}.mtb-quick-option{display:flex;align-items:center;gap:10px;width:100%;padding:10px 12px;border:1px solid rgba(0,0,0,.09);border-radius:10px;background:#fafafa;cursor:pointer;font-family:inherit;font-size:13px;color:#191a1c;text-align:left;transition:all .12s}.mtb-quick-option:hover{background:#10b9810f;border-color:#10b9814d}.mtb-quick-option-emoji{font-size:15px;flex-shrink:0;line-height:1}.mtb-textarea-wrap{position:relative}.mtb-textarea{width:100%;height:64px;padding:9px 11px;border:1px solid rgba(0,0,0,.12);border-radius:9px;font-family:inherit;font-size:12.5px;line-height:1.5;color:#191a1c;outline:none;background:#fff;resize:none;transition:border-color .12s,box-shadow .12s}.mtb-textarea:focus{border-color:#10b981;box-shadow:0 0 0 3px #10b9811f}.mtb-textarea::placeholder{color:#00000057}.mtb-popup-error{margin-top:8px;color:#b91c1c;font-size:11.5px}.mtb-popup-error:empty,.mtb-popup-error[hidden]{display:none}.mtb-popup-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:12px}.mtb-cancel-btn,.mtb-submit-btn{min-width:72px;height:30px;border:none;border-radius:7px;cursor:pointer;display:flex;align-items:center;justify-content:center;padding:0 12px;font-family:inherit;font-size:12px;font-weight:600;transition:background .12s}.mtb-cancel-btn{background:#f3f4f6;color:#000000ad}.mtb-cancel-btn:hover{background:#e5e7eb}.mtb-submit-btn{background:#d1d5db;color:#fff}.mtb-submit-btn.ready{background:#059669}.mtb-submit-btn.ready:hover{background:#047857}.mtb-submit-btn.loading{background:#059669;opacity:.7;cursor:wait}.mtb-submit-btn:disabled{cursor:not-allowed}.mtb-success{position:fixed;z-index:2147483645;width:300px;background:#fff;border:1px solid rgba(0,0,0,.1);border-radius:16px;box-shadow:0 20px 60px #0000001f;padding:26px 22px;text-align:center;animation:mtbSlideUp .35s cubic-bezier(.34,1.56,.64,1);font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif}.mtb-success-icon{width:44px;height:44px;border-radius:50%;background:#05966914;display:flex;align-items:center;justify-content:center;margin:0 auto 12px}.mtb-success-title{font-size:16px;font-weight:700;margin-bottom:6px;color:#191a1c}.mtb-success-msg{font-size:13px;color:#0000008c;margin-bottom:16px;line-height:1.6}.mtb-close-link{background:none;border:none;cursor:pointer;font-size:12px;color:#00000073;font-family:inherit;transition:color .12s}.mtb-close-link:hover{color:#000000b3}.mtb-pet{position:fixed;bottom:20px;right:20px;z-index:2147483646;cursor:pointer;width:52px;height:52px;display:flex;align-items:center;justify-content:center;border-radius:50%;background:transparent;animation:mtbPetBounce 3s ease-in-out infinite;transition:transform .2s;user-select:none;outline:none;filter:drop-shadow(0 4px 12px rgba(5,150,105,.35))}.mtb-pet:hover{transform:scale(1.12);animation-play-state:paused}.mtb-pet:hover .mtb-pet-bubble{opacity:1;transform:translate(-50%) translateY(0);pointer-events:auto}.mtb-pet.active{animation:none;opacity:.6}.mtb-pet-svg{display:block}@keyframes mtbPetBounce{0%,to{transform:translateY(0)}50%{transform:translateY(-6px)}}.mtb-pet-bubble{position:absolute;bottom:100%;left:50%;transform:translate(-50%) translateY(4px);margin-bottom:8px;background:#064e3b;color:#fff;padding:6px 12px;border-radius:8px;font-size:12px;font-weight:500;white-space:nowrap;box-shadow:0 4px 14px #0000002e;opacity:0;pointer-events:none;transition:opacity .2s,transform .2s}.mtb-pet-bubble.visible{opacity:1;transform:translate(-50%) translateY(0);pointer-events:auto}.mtb-pet-bubble.hidden{opacity:0;pointer-events:none}.mtb-pet-bubble:after{content:"";position:absolute;top:100%;left:50%;transform:translate(-50%);border:5px solid transparent;border-top-color:#064e3b}.mtb-frustration-prompt{position:fixed;bottom:20px;right:20px;z-index:2147483645;display:flex;align-items:center;gap:10px;padding:12px 16px;background:#fff;border:1px solid rgba(0,0,0,.1);border-radius:12px;box-shadow:0 8px 30px #0000001f;animation:mtbSlideUp .35s cubic-bezier(.34,1.56,.64,1);font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif}:host([data-mtb-theme="dark"]) .mtb-frustration-prompt{background:#151719;border-color:#ffffff1f;color:#f9fafb}@media (prefers-color-scheme: dark){:host([data-mtb-theme="auto"]) .mtb-frustration-prompt{background:#151719;border-color:#ffffff1f;color:#f9fafb}}.mtb-frustration-icon{width:32px;height:32px;border-radius:50%;background:#eab3081a;display:flex;align-items:center;justify-content:center;flex-shrink:0;font-size:16px;line-height:1}.mtb-frustration-text{font-size:13px;font-weight:500;color:inherit;line-height:1.4}.mtb-frustration-actions{display:flex;gap:6px;flex-shrink:0}.mtb-frustration-tell{height:28px;padding:0 12px;border:none;border-radius:7px;background:#059669;color:#fff;cursor:pointer;font-family:inherit;font-size:12px;font-weight:600;transition:background .12s}.mtb-frustration-tell:hover{background:#047857}.mtb-frustration-dismiss{height:28px;padding:0 8px;border:none;border-radius:7px;background:transparent;color:#0006;cursor:pointer;font-family:inherit;font-size:12px;transition:color .12s}.mtb-frustration-dismiss:hover{color:#000000b3}:host([data-mtb-theme="dark"]) .mtb-frustration-dismiss{color:#fff6}:host([data-mtb-theme="dark"]) .mtb-frustration-dismiss:hover{color:#ffffffb3}@media (prefers-color-scheme: dark){:host([data-mtb-theme="auto"]) .mtb-frustration-dismiss{color:#fff6}:host([data-mtb-theme="auto"]) .mtb-frustration-dismiss:hover{color:#ffffffb3}}.mtb-record-bar{position:fixed;bottom:24px;left:50%;transform:translate(-50%);z-index:2147483647;display:flex;align-items:center;gap:12px;height:42px;padding:0 8px 0 14px;border-radius:12px;background:#0f172aeb;box-shadow:0 8px 24px #00000040;animation:mtbBarIn .2s ease}.mtb-record-dot{width:8px;height:8px;border-radius:50%;background:#ef4444;animation:mtbRecordPulse 1.2s ease-in-out infinite;flex-shrink:0}@keyframes mtbRecordPulse{0%,to{opacity:1}50%{opacity:.3}}.mtb-record-timer{font-family:JetBrains Mono,SF Mono,Fira Code,Cascadia Code,monospace;font-size:13px;font-weight:500;color:#fff;font-variant-numeric:tabular-nums;letter-spacing:.02em;min-width:38px}.mtb-record-stop{height:28px;padding:0 14px;border:none;border-radius:7px;background:#059669;color:#fff;cursor:pointer;font-family:inherit;font-size:12px;font-weight:600;transition:background .12s}.mtb-record-stop:hover{background:#047857}.mtb-click-ripple{position:fixed;z-index:2147483644;width:24px;height:24px;border-radius:50%;border:2px solid #10b981;background:#10b98133;pointer-events:none;transform:translate(-50%,-50%) scale(.5);animation:mtbClickRipple .3s ease-out forwards}@keyframes mtbClickRipple{0%{transform:translate(-50%,-50%) scale(.5);opacity:1}to{transform:translate(-50%,-50%) scale(2);opacity:0}}.mtb-dot{display:inline-block;width:4px;height:4px;border-radius:50%;background:#fff;animation:mtbDot 1.2s infinite}.mtb-dot:nth-child(2){animation-delay:.2s}.mtb-dot:nth-child(3){animation-delay:.4s}@keyframes mtbDot{0%,80%,to{opacity:.3;transform:translateY(0)}40%{opacity:1;transform:translateY(-3px)}}.mtb-clarify{position:fixed;z-index:2147483645;width:320px;background:#fff;border:1px solid rgba(0,0,0,.1);border-radius:16px;box-shadow:0 20px 60px #0000001f;display:flex;flex-direction:column;animation:mtbSlideUp .35s cubic-bezier(.34,1.56,.64,1);font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;overflow:hidden}.mtb-clarify-header{padding:10px 13px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid rgba(0,0,0,.06)}.mtb-clarify-icon{width:26px;height:26px;border-radius:50%;background:#05966914;display:flex;align-items:center;justify-content:center;flex-shrink:0}.mtb-clarify-skip{background:none;border:none;cursor:pointer;font-size:12px;color:#00000073;font-family:inherit;transition:color .12s}.mtb-clarify-skip:hover{color:#000000b3}.mtb-clarify-messages{flex:1;max-height:240px;overflow-y:auto;padding:12px 13px;display:flex;flex-direction:column;gap:8px}.mtb-clarify-bubble{max-width:85%;padding:8px 12px;border-radius:12px;font-size:13px;line-height:1.5;word-wrap:break-word}.mtb-clarify-ai{align-self:flex-start;background:#f3f4f6;color:#191a1c;border-bottom-left-radius:4px}.mtb-clarify-user{align-self:flex-end;background:#059669;color:#fff;border-bottom-right-radius:4px}.mtb-clarify-thinking{display:flex;align-items:center;gap:3px;padding:10px 16px}.mtb-clarify-thinking .mtb-dot{background:#9ca3af}.mtb-clarify-footer{padding:10px 13px;border-top:1px solid rgba(0,0,0,.06);display:flex;gap:8px}.mtb-clarify-input{flex:1;height:32px;padding:0 10px;border:1px solid rgba(0,0,0,.12);border-radius:8px;font-family:inherit;font-size:12.5px;color:#191a1c;outline:none;background:#fff;transition:border-color .12s,box-shadow .12s}.mtb-clarify-input:focus{border-color:#10b981;box-shadow:0 0 0 3px #10b9811f}.mtb-clarify-input::placeholder{color:#00000057}.mtb-clarify-send{height:32px;padding:0 14px;border:none;border-radius:8px;background:#d1d5db;color:#fff;cursor:pointer;font-family:inherit;font-size:12px;font-weight:600;transition:background .12s;flex-shrink:0}.mtb-clarify-send:not(:disabled){background:#059669}.mtb-clarify-send:not(:disabled):hover{background:#047857}.mtb-clarify-send:disabled{cursor:not-allowed}:host([data-mtb-theme="dark"]) .mtb-clarify{background:#151719;border-color:#ffffff1f;color:#f9fafb}:host([data-mtb-theme="dark"]) .mtb-clarify-header{border-bottom-color:#ffffff1a}:host([data-mtb-theme="dark"]) .mtb-clarify-footer{border-top-color:#ffffff1a}:host([data-mtb-theme="dark"]) .mtb-clarify-skip{color:#ffffff73}:host([data-mtb-theme="dark"]) .mtb-clarify-skip:hover{color:#ffffffb3}:host([data-mtb-theme="dark"]) .mtb-clarify-ai{background:#1f2327;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-footer{border-top-color:#ffffff1a}:host([data-mtb-theme="auto"]) .mtb-clarify-skip{color:#ffffff73}:host([data-mtb-theme="auto"]) .mtb-clarify-skip:hover{color:#ffffffb3}:host([data-mtb-theme="auto"]) .mtb-clarify-ai{background:#1f2327;color:#f9fafb}:host([data-mtb-theme="auto"]) .mtb-clarify-input{background:#1f2327;border-color:#ffffff1f;color:#f9fafb}}';
2
+ class nt {
3
3
  constructor(t = "auto") {
4
4
  this.host = document.createElement("div"), this.host.id = "mtb-widget-host", this.host.style.cssText = "position:fixed;top:0;left:0;width:0;height:0;overflow:visible;z-index:2147483646;", this.host.setAttribute("data-mtb-theme", t), document.body.appendChild(this.host), this.root = this.host.attachShadow({ mode: "open" });
5
5
  const e = document.createElement("style");
6
- e.textContent = st, this.root.appendChild(e);
6
+ e.textContent = rt, this.root.appendChild(e);
7
7
  }
8
8
  el(t, e) {
9
9
  const s = document.createElement(t);
@@ -20,7 +20,7 @@ class rt {
20
20
  document.body.removeChild(this.host);
21
21
  }
22
22
  }
23
- class nt {
23
+ class ot {
24
24
  constructor(t, e, s, r, n) {
25
25
  this.onClick = r, this.el = t.el("button", "mtb-tab"), s === "left" && this.el.classList.add("left");
26
26
  const o = n ?? e.tab;
@@ -33,8 +33,8 @@ class nt {
33
33
  this.el.removeEventListener("click", this.onClick), this.el.remove();
34
34
  }
35
35
  }
36
- const ot = 8e3;
37
- class at {
36
+ const at = 8e3;
37
+ class lt {
38
38
  constructor(t, e, s) {
39
39
  this.el = t.el("div", "mtb-frustration-prompt"), this.el.innerHTML = `
40
40
  <div class="mtb-frustration-icon">&#9888;&#65039;</div>
@@ -43,13 +43,13 @@ class at {
43
43
  <button class="mtb-frustration-tell">${e.frustration.action}</button>
44
44
  <button class="mtb-frustration-dismiss">${e.frustration.dismiss}</button>
45
45
  </div>
46
- `, this.el.querySelector(".mtb-frustration-tell").addEventListener("click", s.onTell), this.el.querySelector(".mtb-frustration-dismiss").addEventListener("click", s.onDismiss), t.append(this.el), setTimeout(s.onDismiss, ot);
46
+ `, this.el.querySelector(".mtb-frustration-tell").addEventListener("click", s.onTell), this.el.querySelector(".mtb-frustration-dismiss").addEventListener("click", s.onDismiss), t.append(this.el), setTimeout(s.onDismiss, at);
47
47
  }
48
48
  destroy() {
49
49
  this.el.remove();
50
50
  }
51
51
  }
52
- class lt {
52
+ class ct {
53
53
  constructor(t, e, s, r) {
54
54
  this.currentMode = "markup", this.messages = e, this.el = t.el("div", "mtb-toolbar"), this.el.innerHTML = this.buildHTML(e), t.append(this.el), this.hintEl = this.el.querySelector(".mtb-toolbar-hint"), this.markupBtn = this.el.querySelector(".mtb-toolbar-mode-markup"), this.recordBtn = this.el.querySelector(".mtb-toolbar-mode-record"), this.markupBtn.addEventListener("click", () => {
55
55
  this.setMode("markup"), r?.("markup");
@@ -86,7 +86,7 @@ class lt {
86
86
  this.el.remove();
87
87
  }
88
88
  }
89
- class ct {
89
+ class ht {
90
90
  constructor(t, e) {
91
91
  this.onMouseDown = e.onMouseDown, this.onMouseMove = e.onMouseMove, this.onMouseUp = e.onMouseUp, this.onMouseLeave = e.onMouseLeave, this.overlayEl = t.el("div", "mtb-overlay"), this.overlayEl.addEventListener("mousedown", this.onMouseDown), this.overlayEl.addEventListener("mousemove", this.onMouseMove), this.overlayEl.addEventListener("mouseup", this.onMouseUp), this.overlayEl.addEventListener("mouseleave", this.onMouseLeave), t.append(this.overlayEl), this.dimEl = t.el("div", "mtb-dim"), t.append(this.dimEl);
92
92
  }
@@ -94,7 +94,7 @@ class ct {
94
94
  this.overlayEl.removeEventListener("mousedown", this.onMouseDown), this.overlayEl.removeEventListener("mousemove", this.onMouseMove), this.overlayEl.removeEventListener("mouseup", this.onMouseUp), this.overlayEl.removeEventListener("mouseleave", this.onMouseLeave), this.overlayEl.remove(), this.dimEl.remove();
95
95
  }
96
96
  }
97
- class ht {
97
+ class dt {
98
98
  constructor(t) {
99
99
  this.highlightEl = t.el("div", "mtb-highlight"), this.hide(), t.append(this.highlightEl);
100
100
  }
@@ -109,7 +109,7 @@ class ht {
109
109
  this.highlightEl.remove();
110
110
  }
111
111
  }
112
- function dt(i) {
112
+ function ut(i) {
113
113
  if (i instanceof HTMLElement) {
114
114
  const t = i.getAttribute("aria-label");
115
115
  if (t) return t;
@@ -126,7 +126,7 @@ function dt(i) {
126
126
  }
127
127
  return i.tagName.toLowerCase();
128
128
  }
129
- function ut(i) {
129
+ function pt(i) {
130
130
  const t = [];
131
131
  let e = i;
132
132
  for (; e && e !== document.body && t.length < 5; ) {
@@ -151,7 +151,7 @@ function ut(i) {
151
151
  }
152
152
  return t.join(" > ");
153
153
  }
154
- class pt {
154
+ class mt {
155
155
  constructor(t) {
156
156
  this.pins = [], this.shadow = t;
157
157
  }
@@ -167,8 +167,8 @@ class pt {
167
167
  this.clearAll();
168
168
  }
169
169
  }
170
- const D = "#059669", x = {
171
- color: D,
170
+ const A = "#059669", x = {
171
+ color: A,
172
172
  width: "3.5",
173
173
  linecap: "round",
174
174
  linejoin: "round",
@@ -229,12 +229,12 @@ class ft {
229
229
  this.svg.remove();
230
230
  }
231
231
  }
232
- const mt = 5;
232
+ const bt = 5;
233
233
  class H {
234
234
  constructor(t, e, s) {
235
- this.messages = e, this.onReady = s, this.pinCount = 0, this.interactionActive = !0, this.pendingHighlightFrame = null, this.lastMoveX = 0, this.lastMoveY = 0, this.highlighter = new ht(t), this.pinMarker = new pt(t), this.drawLayer = new ft(t, (r) => {
235
+ this.messages = e, this.onReady = s, this.pinCount = 0, this.interactionActive = !0, this.pendingHighlightFrame = null, this.lastMoveX = 0, this.lastMoveY = 0, this.highlighter = new dt(t), this.pinMarker = new mt(t), this.drawLayer = new ft(t, (r) => {
236
236
  this.onReady(r, this.messages.annotation.drawing);
237
- }), this.overlay = new ct(t, {
237
+ }), this.overlay = new ht(t, {
238
238
  onMouseDown: (r) => this.handleMouseDown(r),
239
239
  onMouseMove: (r) => this.handleMouseMove(r),
240
240
  onMouseUp: (r) => this.handleMouseUp(r),
@@ -265,16 +265,16 @@ class H {
265
265
  }
266
266
  handleMouseUp(t) {
267
267
  if (!this.drawLayer.isCurrentlyDrawing()) return;
268
- if (this.drawLayer.getPointCount() >= mt) {
268
+ if (this.drawLayer.getPointCount() >= bt) {
269
269
  this.drawLayer.endDraw();
270
270
  return;
271
271
  }
272
272
  this.drawLayer.cancelCurrentDraw();
273
- const e = $(t.clientX, t.clientY), s = e ? dt(e) : this.messages.annotation.element, r = {
273
+ const e = $(t.clientX, t.clientY), s = e ? ut(e) : this.messages.annotation.element, r = {
274
274
  type: "pin",
275
275
  x: t.clientX,
276
276
  y: t.clientY,
277
- targetSelector: e ? ut(e) : void 0,
277
+ targetSelector: e ? pt(e) : void 0,
278
278
  targetText: e?.textContent?.trim().slice(0, 200) ?? "",
279
279
  targetName: s
280
280
  };
@@ -290,16 +290,16 @@ class H {
290
290
  function $(i, t) {
291
291
  return document.elementsFromPoint(i, t).find((e) => e.id !== "mtb-widget-host") ?? null;
292
292
  }
293
- class bt {
293
+ class gt {
294
294
  constructor(t, e) {
295
295
  this.loading = !1, this.onSubmit = e.onSubmit, this.onClose = e.onClose, this.submitLabel = e.messages.popup.submit, this.el = t.el("div", "mtb-popup"), this.el.innerHTML = this.buildHTML(e), t.append(this.el), this.textarea = this.el.querySelector(".mtb-textarea"), this.submitBtn = this.el.querySelector(".mtb-submit-btn"), this.positionPopup(e.x, e.y), this.bindEvents(e.messages), this.textarea.focus();
296
296
  }
297
297
  buildHTML(t) {
298
298
  const e = t.messages, s = e.popup.quickOptions.map(
299
299
  (r) => `
300
- <button class="mtb-quick-option" data-quick="${m(r.label)}">
300
+ <button class="mtb-quick-option" data-quick="${f(r.label)}">
301
301
  <span class="mtb-quick-option-emoji">${r.emoji}</span>
302
- <span>${m(r.label)}</span>
302
+ <span>${f(r.label)}</span>
303
303
  </button>`
304
304
  ).join("");
305
305
  return `
@@ -309,7 +309,7 @@ class bt {
309
309
  <path d="M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"/><circle cx="12" cy="10" r="3"/>
310
310
  </svg>
311
311
  </div>
312
- <span class="mtb-popup-title">${e.popup.about} "${m(t.targetName)}"</span>
312
+ <span class="mtb-popup-title">${e.popup.about} "${f(t.targetName)}"</span>
313
313
  <button class="mtb-popup-close" aria-label="Close">
314
314
  <svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round">
315
315
  <path d="M18 6L6 18M6 6l12 12"/>
@@ -321,12 +321,12 @@ class bt {
321
321
  ${s}
322
322
  </div>
323
323
  <div class="mtb-textarea-wrap">
324
- <textarea class="mtb-textarea" placeholder="${m(e.popup.placeholder)}"></textarea>
324
+ <textarea class="mtb-textarea" placeholder="${f(e.popup.placeholder)}"></textarea>
325
325
  </div>
326
326
  <div class="mtb-popup-error" role="alert"></div>
327
327
  <div class="mtb-popup-actions">
328
- <button class="mtb-cancel-btn" type="button">${m(e.popup.cancel)}</button>
329
- <button class="mtb-submit-btn" type="button" disabled>${m(e.popup.submit)}</button>
328
+ <button class="mtb-cancel-btn" type="button">${f(e.popup.cancel)}</button>
329
+ <button class="mtb-submit-btn" type="button" disabled>${f(e.popup.submit)}</button>
330
330
  </div>
331
331
  </div>
332
332
  `;
@@ -364,11 +364,11 @@ class bt {
364
364
  this.el.remove();
365
365
  }
366
366
  }
367
- function m(i) {
367
+ function f(i) {
368
368
  return i.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#039;");
369
369
  }
370
- const gt = 2e3, yt = 2e3;
371
- class xt {
370
+ const yt = 2e3, xt = 2e3;
371
+ class wt {
372
372
  constructor(t, e) {
373
373
  this.pollTimer = null, this.doneTimer = null, this.sending = !1, this.destroyed = !1, this.feedbackId = e.feedbackId, this.apiClient = e.apiClient, this.onDone = e.onDone, this.el = t.el("div", "mtb-clarify"), this.el.style.right = "20px", this.el.style.bottom = "20px", this.el.innerHTML = this.buildHTML(e.messages), t.append(this.el), this.messagesEl = this.el.querySelector(".mtb-clarify-messages"), this.inputEl = this.el.querySelector(".mtb-clarify-input"), this.sendBtn = this.el.querySelector(".mtb-clarify-send"), this.bindEvents(e.messages), this.startConversation();
374
374
  }
@@ -376,7 +376,7 @@ class xt {
376
376
  return `
377
377
  <div class="mtb-clarify-header">
378
378
  <div class="mtb-clarify-icon">
379
- <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="${D}" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
379
+ <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="${A}" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
380
380
  <path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/>
381
381
  </svg>
382
382
  </div>
@@ -427,7 +427,7 @@ class xt {
427
427
  }
428
428
  }
429
429
  startPolling() {
430
- this.stopPolling(), this.pollTimer = setInterval(() => this.poll(), gt);
430
+ this.stopPolling(), this.pollTimer = setInterval(() => this.poll(), yt);
431
431
  }
432
432
  stopPolling() {
433
433
  this.pollTimer !== null && (clearInterval(this.pollTimer), this.pollTimer = null);
@@ -445,7 +445,7 @@ class xt {
445
445
  handleDone() {
446
446
  this.inputEl.disabled = !0, this.sendBtn.disabled = !0, this.doneTimer = setTimeout(() => {
447
447
  this.destroyed || this.onDone();
448
- }, yt);
448
+ }, xt);
449
449
  }
450
450
  renderConversation(t, e) {
451
451
  this.renderMessages(t);
@@ -473,28 +473,28 @@ class xt {
473
473
  function T(i) {
474
474
  return i.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#039;");
475
475
  }
476
- const wt = 5e3;
477
- class kt {
478
- constructor(t, e, s, r) {
476
+ const kt = 5e3;
477
+ class vt {
478
+ constructor(t, e, s, r, n) {
479
479
  this.el = t.el("div", "mtb-success"), this.el.style.right = "20px", this.el.style.bottom = "20px";
480
- const n = r ? `<button class="mtb-view-feedback-link">${e.success.view_feedback}</button>` : "";
480
+ const o = n?.skipFollowup ? e.success.title_no_ai : e.success.title, a = n?.skipFollowup ? e.success.message_no_ai : e.success.message, l = r ? `<button class="mtb-view-feedback-link">${e.success.view_feedback}</button>` : "";
481
481
  this.el.innerHTML = `
482
482
  <div class="mtb-success-icon">
483
- <svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="${D}" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
483
+ <svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="${A}" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
484
484
  <polyline points="20 6 9 17 4 12"/>
485
485
  </svg>
486
486
  </div>
487
- <div class="mtb-success-title">${e.success.title}</div>
488
- <div class="mtb-success-msg">${e.success.message}</div>
489
- ${n}
487
+ <div class="mtb-success-title">${o}</div>
488
+ <div class="mtb-success-msg">${a}</div>
489
+ ${l}
490
490
  <button class="mtb-close-link">${e.success.close}</button>
491
- `, t.append(this.el), this.el.querySelector(".mtb-close-link").addEventListener("click", s), r && this.el.querySelector(".mtb-view-feedback-link").addEventListener("click", r), setTimeout(() => s(), wt);
491
+ `, t.append(this.el), this.el.querySelector(".mtb-close-link").addEventListener("click", s), r && this.el.querySelector(".mtb-view-feedback-link").addEventListener("click", r), setTimeout(() => s(), kt);
492
492
  }
493
493
  destroy() {
494
494
  this.el.remove();
495
495
  }
496
496
  }
497
- function vt(i, t) {
497
+ function St(i, t) {
498
498
  if (i.match(/^[a-z]+:\/\//i))
499
499
  return i;
500
500
  if (i.match(/^\/\//))
@@ -504,7 +504,7 @@ function vt(i, t) {
504
504
  const e = document.implementation.createHTMLDocument(), s = e.createElement("base"), r = e.createElement("a");
505
505
  return e.head.appendChild(s), e.body.appendChild(r), t && (s.href = t), r.href = i, r.href;
506
506
  }
507
- const St = /* @__PURE__ */ (() => {
507
+ const Et = /* @__PURE__ */ (() => {
508
508
  let i = 0;
509
509
  const t = () => (
510
510
  // eslint-disable-next-line no-bitwise
@@ -519,26 +519,26 @@ function p(i) {
519
519
  return t;
520
520
  }
521
521
  let b = null;
522
- function V(i = {}) {
522
+ function Y(i = {}) {
523
523
  return b || (i.includeStyleProperties ? (b = i.includeStyleProperties, b) : (b = p(window.getComputedStyle(document.documentElement)), b));
524
524
  }
525
525
  function S(i, t) {
526
526
  const s = (i.ownerDocument.defaultView || window).getComputedStyle(i).getPropertyValue(t);
527
527
  return s ? parseFloat(s.replace("px", "")) : 0;
528
528
  }
529
- function Et(i) {
529
+ function Ct(i) {
530
530
  const t = S(i, "border-left-width"), e = S(i, "border-right-width");
531
531
  return i.clientWidth + t + e;
532
532
  }
533
- function Ct(i) {
533
+ function Mt(i) {
534
534
  const t = S(i, "border-top-width"), e = S(i, "border-bottom-width");
535
535
  return i.clientHeight + t + e;
536
536
  }
537
- function Y(i, t = {}) {
538
- const e = t.width || Et(i), s = t.height || Ct(i);
537
+ function X(i, t = {}) {
538
+ const e = t.width || Ct(i), s = t.height || Mt(i);
539
539
  return { width: e, height: s };
540
540
  }
541
- function Mt() {
541
+ function Tt() {
542
542
  let i, t;
543
543
  try {
544
544
  t = process;
@@ -548,7 +548,7 @@ function Mt() {
548
548
  return e && (i = parseInt(e, 10), Number.isNaN(i) && (i = 1)), i || window.devicePixelRatio || 1;
549
549
  }
550
550
  const d = 16384;
551
- function Tt(i) {
551
+ function Lt(i) {
552
552
  (i.width > d || i.height > d) && (i.width > d && i.height > d ? i.width > i.height ? (i.height *= d / i.width, i.width = d) : (i.width *= d / i.height, i.height = d) : i.width > d ? (i.height *= d / i.width, i.width = d) : (i.width *= d / i.height, i.height = d));
553
553
  }
554
554
  function E(i) {
@@ -561,12 +561,12 @@ function E(i) {
561
561
  }, s.onerror = e, s.crossOrigin = "anonymous", s.decoding = "async", s.src = i;
562
562
  });
563
563
  }
564
- async function Lt(i) {
564
+ async function _t(i) {
565
565
  return Promise.resolve().then(() => new XMLSerializer().serializeToString(i)).then(encodeURIComponent).then((t) => `data:image/svg+xml;charset=utf-8,${t}`);
566
566
  }
567
- async function At(i, t, e) {
567
+ async function Dt(i, t, e) {
568
568
  const s = "http://www.w3.org/2000/svg", r = document.createElementNS(s, "svg"), n = document.createElementNS(s, "foreignObject");
569
- return r.setAttribute("width", `${t}`), r.setAttribute("height", `${e}`), r.setAttribute("viewBox", `0 0 ${t} ${e}`), n.setAttribute("width", "100%"), n.setAttribute("height", "100%"), n.setAttribute("x", "0"), n.setAttribute("y", "0"), n.setAttribute("externalResourcesRequired", "true"), r.appendChild(n), n.appendChild(i), Lt(r);
569
+ return r.setAttribute("width", `${t}`), r.setAttribute("height", `${e}`), r.setAttribute("viewBox", `0 0 ${t} ${e}`), n.setAttribute("width", "100%"), n.setAttribute("height", "100%"), n.setAttribute("x", "0"), n.setAttribute("y", "0"), n.setAttribute("externalResourcesRequired", "true"), r.appendChild(n), n.appendChild(i), _t(r);
570
570
  }
571
571
  const h = (i, t) => {
572
572
  if (i instanceof t)
@@ -574,67 +574,67 @@ const h = (i, t) => {
574
574
  const e = Object.getPrototypeOf(i);
575
575
  return e === null ? !1 : e.constructor.name === t.name || h(e, t);
576
576
  };
577
- function Rt(i) {
577
+ function At(i) {
578
578
  const t = i.getPropertyValue("content");
579
579
  return `${i.cssText} content: '${t.replace(/'|"/g, "")}';`;
580
580
  }
581
- function Dt(i, t) {
582
- return V(t).map((e) => {
581
+ function Pt(i, t) {
582
+ return Y(t).map((e) => {
583
583
  const s = i.getPropertyValue(e), r = i.getPropertyPriority(e);
584
584
  return `${e}: ${s}${r ? " !important" : ""};`;
585
585
  }).join(" ");
586
586
  }
587
- function Pt(i, t, e, s) {
588
- const r = `.${i}:${t}`, n = e.cssText ? Rt(e) : Dt(e, s);
587
+ function Rt(i, t, e, s) {
588
+ const r = `.${i}:${t}`, n = e.cssText ? At(e) : Pt(e, s);
589
589
  return document.createTextNode(`${r}{${n}}`);
590
590
  }
591
591
  function I(i, t, e, s) {
592
592
  const r = window.getComputedStyle(i, e), n = r.getPropertyValue("content");
593
593
  if (n === "" || n === "none")
594
594
  return;
595
- const o = St();
595
+ const o = Et();
596
596
  try {
597
597
  t.className = `${t.className} ${o}`;
598
598
  } catch {
599
599
  return;
600
600
  }
601
601
  const a = document.createElement("style");
602
- a.appendChild(Pt(o, e, r, s)), t.appendChild(a);
602
+ a.appendChild(Rt(o, e, r, s)), t.appendChild(a);
603
603
  }
604
- function _t(i, t, e) {
604
+ function Ht(i, t, e) {
605
605
  I(i, t, ":before", e), I(i, t, ":after", e);
606
606
  }
607
- const O = "application/font-woff", F = "image/jpeg", Ht = {
608
- woff: O,
609
- woff2: O,
607
+ const F = "application/font-woff", O = "image/jpeg", $t = {
608
+ woff: F,
609
+ woff2: F,
610
610
  ttf: "application/font-truetype",
611
611
  eot: "application/vnd.ms-fontobject",
612
612
  png: "image/png",
613
- jpg: F,
614
- jpeg: F,
613
+ jpg: O,
614
+ jpeg: O,
615
615
  gif: "image/gif",
616
616
  tiff: "image/tiff",
617
617
  svg: "image/svg+xml",
618
618
  webp: "image/webp"
619
619
  };
620
- function $t(i) {
620
+ function It(i) {
621
621
  const t = /\.([^./]*?)$/g.exec(i);
622
622
  return t ? t[1] : "";
623
623
  }
624
624
  function P(i) {
625
- const t = $t(i).toLowerCase();
626
- return Ht[t] || "";
625
+ const t = It(i).toLowerCase();
626
+ return $t[t] || "";
627
627
  }
628
- function It(i) {
628
+ function Ft(i) {
629
629
  return i.split(/,/)[1];
630
630
  }
631
- function A(i) {
631
+ function _(i) {
632
632
  return i.search(/^(data:)/) !== -1;
633
633
  }
634
634
  function Ot(i, t) {
635
635
  return `data:${t};base64,${i}`;
636
636
  }
637
- async function X(i, t, e) {
637
+ async function G(i, t, e) {
638
638
  const s = await fetch(i, t);
639
639
  if (s.status === 404)
640
640
  throw new Error(`Resource "${s.url}" not found`);
@@ -651,18 +651,18 @@ async function X(i, t, e) {
651
651
  });
652
652
  }
653
653
  const L = {};
654
- function Ft(i, t, e) {
654
+ function jt(i, t, e) {
655
655
  let s = i.replace(/\?.*/, "");
656
656
  return e && (s = i), /ttf|otf|eot|woff2?/i.test(s) && (s = s.replace(/.*\//, "")), t ? `[${t}]${s}` : s;
657
657
  }
658
- async function _(i, t, e) {
659
- const s = Ft(i, t, e.includeQueryParams);
658
+ async function R(i, t, e) {
659
+ const s = jt(i, t, e.includeQueryParams);
660
660
  if (L[s] != null)
661
661
  return L[s];
662
662
  e.cacheBust && (i += (/\?/.test(i) ? "&" : "?") + (/* @__PURE__ */ new Date()).getTime());
663
663
  let r;
664
664
  try {
665
- const n = await X(i, e.fetchRequestInit, ({ res: o, result: a }) => (t || (t = o.headers.get("Content-Type") || ""), It(a)));
665
+ const n = await G(i, e.fetchRequestInit, ({ res: o, result: a }) => (t || (t = o.headers.get("Content-Type") || ""), Ft(a)));
666
666
  r = Ot(n, t);
667
667
  } catch (n) {
668
668
  r = e.imagePlaceholder || "";
@@ -671,21 +671,21 @@ async function _(i, t, e) {
671
671
  }
672
672
  return L[s] = r, r;
673
673
  }
674
- async function jt(i) {
674
+ async function Ut(i) {
675
675
  const t = i.toDataURL();
676
676
  return t === "data:," ? i.cloneNode(!1) : E(t);
677
677
  }
678
- async function Ut(i, t) {
678
+ async function zt(i, t) {
679
679
  if (i.currentSrc) {
680
680
  const n = document.createElement("canvas"), o = n.getContext("2d");
681
681
  n.width = i.clientWidth, n.height = i.clientHeight, o?.drawImage(i, 0, 0, n.width, n.height);
682
682
  const a = n.toDataURL();
683
683
  return E(a);
684
684
  }
685
- const e = i.poster, s = P(e), r = await _(e, s, t);
685
+ const e = i.poster, s = P(e), r = await R(e, s, t);
686
686
  return E(r);
687
687
  }
688
- async function zt(i, t) {
688
+ async function Bt(i, t) {
689
689
  var e;
690
690
  try {
691
691
  if (!((e = i?.contentDocument) === null || e === void 0) && e.body)
@@ -694,42 +694,42 @@ async function zt(i, t) {
694
694
  }
695
695
  return i.cloneNode(!1);
696
696
  }
697
- async function Bt(i, t) {
698
- return h(i, HTMLCanvasElement) ? jt(i) : h(i, HTMLVideoElement) ? Ut(i, t) : h(i, HTMLIFrameElement) ? zt(i, t) : i.cloneNode(G(i));
697
+ async function qt(i, t) {
698
+ return h(i, HTMLCanvasElement) ? Ut(i) : h(i, HTMLVideoElement) ? zt(i, t) : h(i, HTMLIFrameElement) ? Bt(i, t) : i.cloneNode(K(i));
699
699
  }
700
- const qt = (i) => i.tagName != null && i.tagName.toUpperCase() === "SLOT", G = (i) => i.tagName != null && i.tagName.toUpperCase() === "SVG";
701
- async function Wt(i, t, e) {
700
+ const Wt = (i) => i.tagName != null && i.tagName.toUpperCase() === "SLOT", K = (i) => i.tagName != null && i.tagName.toUpperCase() === "SVG";
701
+ async function Nt(i, t, e) {
702
702
  var s, r;
703
- if (G(t))
703
+ if (K(t))
704
704
  return t;
705
705
  let n = [];
706
- return qt(i) && i.assignedNodes ? n = p(i.assignedNodes()) : h(i, HTMLIFrameElement) && (!((s = i.contentDocument) === null || s === void 0) && s.body) ? n = p(i.contentDocument.body.childNodes) : n = p(((r = i.shadowRoot) !== null && r !== void 0 ? r : i).childNodes), n.length === 0 || h(i, HTMLVideoElement) || await n.reduce((o, a) => o.then(() => C(a, e)).then((l) => {
706
+ return Wt(i) && i.assignedNodes ? n = p(i.assignedNodes()) : h(i, HTMLIFrameElement) && (!((s = i.contentDocument) === null || s === void 0) && s.body) ? n = p(i.contentDocument.body.childNodes) : n = p(((r = i.shadowRoot) !== null && r !== void 0 ? r : i).childNodes), n.length === 0 || h(i, HTMLVideoElement) || await n.reduce((o, a) => o.then(() => C(a, e)).then((l) => {
707
707
  l && t.appendChild(l);
708
708
  }), Promise.resolve()), t;
709
709
  }
710
- function Nt(i, t, e) {
710
+ function Vt(i, t, e) {
711
711
  const s = t.style;
712
712
  if (!s)
713
713
  return;
714
714
  const r = window.getComputedStyle(i);
715
- r.cssText ? (s.cssText = r.cssText, s.transformOrigin = r.transformOrigin) : V(e).forEach((n) => {
715
+ r.cssText ? (s.cssText = r.cssText, s.transformOrigin = r.transformOrigin) : Y(e).forEach((n) => {
716
716
  let o = r.getPropertyValue(n);
717
717
  n === "font-size" && o.endsWith("px") && (o = `${Math.floor(parseFloat(o.substring(0, o.length - 2))) - 0.1}px`), h(i, HTMLIFrameElement) && n === "display" && o === "inline" && (o = "block"), n === "d" && t.getAttribute("d") && (o = `path(${t.getAttribute("d")})`), s.setProperty(n, o, r.getPropertyPriority(n));
718
718
  });
719
719
  }
720
- function Vt(i, t) {
720
+ function Yt(i, t) {
721
721
  h(i, HTMLTextAreaElement) && (t.innerHTML = i.value), h(i, HTMLInputElement) && t.setAttribute("value", i.value);
722
722
  }
723
- function Yt(i, t) {
723
+ function Xt(i, t) {
724
724
  if (h(i, HTMLSelectElement)) {
725
725
  const e = t, s = Array.from(e.children).find((r) => i.value === r.getAttribute("value"));
726
726
  s && s.setAttribute("selected", "");
727
727
  }
728
728
  }
729
- function Xt(i, t, e) {
730
- return h(t, Element) && (Nt(i, t, e), _t(i, t, e), Vt(i, t), Yt(i, t)), t;
729
+ function Gt(i, t, e) {
730
+ return h(t, Element) && (Vt(i, t, e), Ht(i, t, e), Yt(i, t), Xt(i, t)), t;
731
731
  }
732
- async function Gt(i, t) {
732
+ async function Kt(i, t) {
733
733
  const e = i.querySelectorAll ? i.querySelectorAll("use") : [];
734
734
  if (e.length === 0)
735
735
  return i;
@@ -754,30 +754,30 @@ async function Gt(i, t) {
754
754
  return i;
755
755
  }
756
756
  async function C(i, t, e) {
757
- return !e && t.filter && !t.filter(i) ? null : Promise.resolve(i).then((s) => Bt(s, t)).then((s) => Wt(i, s, t)).then((s) => Xt(i, s, t)).then((s) => Gt(s, t));
757
+ return !e && t.filter && !t.filter(i) ? null : Promise.resolve(i).then((s) => qt(s, t)).then((s) => Nt(i, s, t)).then((s) => Gt(i, s, t)).then((s) => Kt(s, t));
758
758
  }
759
- const K = /url\((['"]?)([^'"]+?)\1\)/g, Kt = /url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g, Jt = /src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;
760
- function Qt(i) {
759
+ const J = /url\((['"]?)([^'"]+?)\1\)/g, Jt = /url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g, Qt = /src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;
760
+ function Zt(i) {
761
761
  const t = i.replace(/([.*+?^${}()|\[\]\/\\])/g, "\\$1");
762
762
  return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`, "g");
763
763
  }
764
- function Zt(i) {
764
+ function te(i) {
765
765
  const t = [];
766
- return i.replace(K, (e, s, r) => (t.push(r), e)), t.filter((e) => !A(e));
766
+ return i.replace(J, (e, s, r) => (t.push(r), e)), t.filter((e) => !_(e));
767
767
  }
768
- async function te(i, t, e, s, r) {
768
+ async function ee(i, t, e, s, r) {
769
769
  try {
770
- const n = e ? vt(t, e) : t, o = P(t);
770
+ const n = e ? St(t, e) : t, o = P(t);
771
771
  let a;
772
- return r || (a = await _(n, o, s)), i.replace(Qt(t), `$1${a}$3`);
772
+ return r || (a = await R(n, o, s)), i.replace(Zt(t), `$1${a}$3`);
773
773
  } catch {
774
774
  }
775
775
  return i;
776
776
  }
777
- function ee(i, { preferredFontFormat: t }) {
778
- return t ? i.replace(Jt, (e) => {
777
+ function ie(i, { preferredFontFormat: t }) {
778
+ return t ? i.replace(Qt, (e) => {
779
779
  for (; ; ) {
780
- const [s, , r] = Kt.exec(e) || [];
780
+ const [s, , r] = Jt.exec(e) || [];
781
781
  if (!r)
782
782
  return "";
783
783
  if (r === t)
@@ -785,32 +785,32 @@ function ee(i, { preferredFontFormat: t }) {
785
785
  }
786
786
  }) : i;
787
787
  }
788
- function J(i) {
789
- return i.search(K) !== -1;
788
+ function Q(i) {
789
+ return i.search(J) !== -1;
790
790
  }
791
- async function Q(i, t, e) {
792
- if (!J(i))
791
+ async function Z(i, t, e) {
792
+ if (!Q(i))
793
793
  return i;
794
- const s = ee(i, e);
795
- return Zt(s).reduce((n, o) => n.then((a) => te(a, o, t, e)), Promise.resolve(s));
794
+ const s = ie(i, e);
795
+ return te(s).reduce((n, o) => n.then((a) => ee(a, o, t, e)), Promise.resolve(s));
796
796
  }
797
797
  async function g(i, t, e) {
798
798
  var s;
799
799
  const r = (s = t.style) === null || s === void 0 ? void 0 : s.getPropertyValue(i);
800
800
  if (r) {
801
- const n = await Q(r, null, e);
801
+ const n = await Z(r, null, e);
802
802
  return t.style.setProperty(i, n, t.style.getPropertyPriority(i)), !0;
803
803
  }
804
804
  return !1;
805
805
  }
806
- async function ie(i, t) {
806
+ async function se(i, t) {
807
807
  await g("background", i, t) || await g("background-image", i, t), await g("mask", i, t) || await g("-webkit-mask", i, t) || await g("mask-image", i, t) || await g("-webkit-mask-image", i, t);
808
808
  }
809
- async function se(i, t) {
809
+ async function re(i, t) {
810
810
  const e = h(i, HTMLImageElement);
811
- if (!(e && !A(i.src)) && !(h(i, SVGImageElement) && !A(i.href.baseVal)))
811
+ if (!(e && !_(i.src)) && !(h(i, SVGImageElement) && !_(i.href.baseVal)))
812
812
  return;
813
- const s = e ? i.src : i.href.baseVal, r = await _(s, P(s), t);
813
+ const s = e ? i.src : i.href.baseVal, r = await R(s, P(s), t);
814
814
  await new Promise((n, o) => {
815
815
  i.onload = n, i.onerror = t.onImageErrorHandler ? (...l) => {
816
816
  try {
@@ -823,14 +823,14 @@ async function se(i, t) {
823
823
  a.decode && (a.decode = n), a.loading === "lazy" && (a.loading = "eager"), e ? (i.srcset = "", i.src = r) : i.href.baseVal = r;
824
824
  });
825
825
  }
826
- async function re(i, t) {
827
- const s = p(i.childNodes).map((r) => Z(r, t));
826
+ async function ne(i, t) {
827
+ const s = p(i.childNodes).map((r) => tt(r, t));
828
828
  await Promise.all(s).then(() => i);
829
829
  }
830
- async function Z(i, t) {
831
- h(i, Element) && (await ie(i, t), await se(i, t), await re(i, t));
830
+ async function tt(i, t) {
831
+ h(i, Element) && (await se(i, t), await re(i, t), await ne(i, t));
832
832
  }
833
- function ne(i, t) {
833
+ function oe(i, t) {
834
834
  const { style: e } = i;
835
835
  t.backgroundColor && (e.backgroundColor = t.backgroundColor), t.width && (e.width = `${t.width}px`), t.height && (e.height = `${t.height}px`);
836
836
  const s = t.style;
@@ -850,7 +850,7 @@ async function z(i, t) {
850
850
  let e = i.cssText;
851
851
  const s = /url\(["']?([^"')]+)["']?\)/g, n = (e.match(/url\([^)]+\)/g) || []).map(async (o) => {
852
852
  let a = o.replace(s, "$1");
853
- return a.startsWith("https://") || (a = new URL(a, i.url).href), X(a, t.fetchRequestInit, ({ result: l }) => (e = e.replace(o, `url(${l})`), [o, l]));
853
+ return a.startsWith("https://") || (a = new URL(a, i.url).href), G(a, t.fetchRequestInit, ({ result: l }) => (e = e.replace(o, `url(${l})`), [o, l]));
854
854
  });
855
855
  return Promise.all(n).then(() => e);
856
856
  }
@@ -880,7 +880,7 @@ function B(i) {
880
880
  }
881
881
  return t;
882
882
  }
883
- async function oe(i, t) {
883
+ async function ae(i, t) {
884
884
  const e = [], s = [];
885
885
  return i.forEach((r) => {
886
886
  if ("cssRules" in r)
@@ -891,10 +891,10 @@ async function oe(i, t) {
891
891
  const l = n.href, c = U(l).then((u) => z(u, t)).then((u) => B(u).forEach((M) => {
892
892
  try {
893
893
  r.insertRule(M, M.startsWith("@import") ? a += 1 : r.cssRules.length);
894
- } catch (it) {
894
+ } catch (st) {
895
895
  console.error("Error inserting rule from remote css", {
896
896
  rule: M,
897
- error: it
897
+ error: st
898
898
  });
899
899
  }
900
900
  })).catch((u) => {
@@ -922,79 +922,79 @@ async function oe(i, t) {
922
922
  }
923
923
  }), e));
924
924
  }
925
- function ae(i) {
926
- return i.filter((t) => t.type === CSSRule.FONT_FACE_RULE).filter((t) => J(t.style.getPropertyValue("src")));
925
+ function le(i) {
926
+ return i.filter((t) => t.type === CSSRule.FONT_FACE_RULE).filter((t) => Q(t.style.getPropertyValue("src")));
927
927
  }
928
- async function le(i, t) {
928
+ async function ce(i, t) {
929
929
  if (i.ownerDocument == null)
930
930
  throw new Error("Provided element is not within a Document");
931
- const e = p(i.ownerDocument.styleSheets), s = await oe(e, t);
932
- return ae(s);
931
+ const e = p(i.ownerDocument.styleSheets), s = await ae(e, t);
932
+ return le(s);
933
933
  }
934
- function tt(i) {
934
+ function et(i) {
935
935
  return i.trim().replace(/["']/g, "");
936
936
  }
937
- function ce(i) {
937
+ function he(i) {
938
938
  const t = /* @__PURE__ */ new Set();
939
939
  function e(s) {
940
940
  (s.style.fontFamily || getComputedStyle(s).fontFamily).split(",").forEach((n) => {
941
- t.add(tt(n));
941
+ t.add(et(n));
942
942
  }), Array.from(s.children).forEach((n) => {
943
943
  n instanceof HTMLElement && e(n);
944
944
  });
945
945
  }
946
946
  return e(i), t;
947
947
  }
948
- async function he(i, t) {
949
- const e = await le(i, t), s = ce(i);
950
- return (await Promise.all(e.filter((n) => s.has(tt(n.style.fontFamily))).map((n) => {
948
+ async function de(i, t) {
949
+ const e = await ce(i, t), s = he(i);
950
+ return (await Promise.all(e.filter((n) => s.has(et(n.style.fontFamily))).map((n) => {
951
951
  const o = n.parentStyleSheet ? n.parentStyleSheet.href : null;
952
- return Q(n.cssText, o, t);
952
+ return Z(n.cssText, o, t);
953
953
  }))).join(`
954
954
  `);
955
955
  }
956
- async function de(i, t) {
957
- const e = t.fontEmbedCSS != null ? t.fontEmbedCSS : t.skipFonts ? null : await he(i, t);
956
+ async function ue(i, t) {
957
+ const e = t.fontEmbedCSS != null ? t.fontEmbedCSS : t.skipFonts ? null : await de(i, t);
958
958
  if (e) {
959
959
  const s = document.createElement("style"), r = document.createTextNode(e);
960
960
  s.appendChild(r), i.firstChild ? i.insertBefore(s, i.firstChild) : i.appendChild(s);
961
961
  }
962
962
  }
963
- async function ue(i, t = {}) {
964
- const { width: e, height: s } = Y(i, t), r = await C(i, t, !0);
965
- return await de(r, t), await Z(r, t), ne(r, t), await At(r, e, s);
966
- }
967
963
  async function pe(i, t = {}) {
968
- const { width: e, height: s } = Y(i, t), r = await ue(i, t), n = await E(r), o = document.createElement("canvas"), a = o.getContext("2d"), l = t.pixelRatio || Mt(), c = t.canvasWidth || e, u = t.canvasHeight || s;
969
- return o.width = c * l, o.height = u * l, t.skipAutoScale || Tt(o), o.style.width = `${c}`, o.style.height = `${u}`, t.backgroundColor && (a.fillStyle = t.backgroundColor, a.fillRect(0, 0, o.width, o.height)), a.drawImage(n, 0, 0, o.width, o.height), o;
964
+ const { width: e, height: s } = X(i, t), r = await C(i, t, !0);
965
+ return await ue(r, t), await tt(r, t), oe(r, t), await Dt(r, e, s);
966
+ }
967
+ async function me(i, t = {}) {
968
+ const { width: e, height: s } = X(i, t), r = await pe(i, t), n = await E(r), o = document.createElement("canvas"), a = o.getContext("2d"), l = t.pixelRatio || Tt(), c = t.canvasWidth || e, u = t.canvasHeight || s;
969
+ return o.width = c * l, o.height = u * l, t.skipAutoScale || Lt(o), o.style.width = `${c}`, o.style.height = `${u}`, t.backgroundColor && (a.fillStyle = t.backgroundColor, a.fillRect(0, 0, o.width, o.height)), a.drawImage(n, 0, 0, o.width, o.height), o;
970
970
  }
971
971
  async function fe(i, t = {}) {
972
- return (await pe(i, t)).toDataURL();
972
+ return (await me(i, t)).toDataURL();
973
973
  }
974
- async function me(i = []) {
975
- const t = be(i);
974
+ async function be(i = []) {
975
+ const t = ge(i);
976
976
  try {
977
977
  const e = await fe(document.body, {
978
978
  cacheBust: !0,
979
979
  skipAutoScale: !1,
980
980
  filter: (s) => !(s instanceof HTMLElement && s.id === "mtb-widget-host")
981
981
  });
982
- return xe(e);
982
+ return we(e);
983
983
  } catch {
984
984
  return null;
985
985
  } finally {
986
986
  t?.remove();
987
987
  }
988
988
  }
989
- function be(i) {
989
+ function ge(i) {
990
990
  if (i.length === 0) return null;
991
991
  const t = document.createElement("div");
992
992
  t.setAttribute("data-mtb-capture-annotations", "true"), t.setAttribute("aria-hidden", "true"), t.style.cssText = "position:fixed;inset:0;pointer-events:none;z-index:2147483645;";
993
993
  for (const [e, s] of i.entries())
994
- s.type === "pin" ? t.appendChild(ge(s, e + 1)) : s.type === "draw" && s.drawPath && t.appendChild(ye(s.drawPath));
994
+ s.type === "pin" ? t.appendChild(ye(s, e + 1)) : s.type === "draw" && s.drawPath && t.appendChild(xe(s.drawPath));
995
995
  return document.body.appendChild(t), t;
996
996
  }
997
- function ge(i, t) {
997
+ function ye(i, t) {
998
998
  const e = document.createElement("div");
999
999
  return e.textContent = String(t), e.style.cssText = [
1000
1000
  "position:fixed",
@@ -1014,19 +1014,19 @@ function ge(i, t) {
1014
1014
  "transform:translate(-50%,-50%)"
1015
1015
  ].join(";"), e;
1016
1016
  }
1017
- function ye(i) {
1017
+ function xe(i) {
1018
1018
  const t = document.createElementNS("http://www.w3.org/2000/svg", "svg");
1019
1019
  t.setAttribute("width", "100%"), t.setAttribute("height", "100%"), t.setAttribute("viewBox", `0 0 ${window.innerWidth} ${window.innerHeight}`), t.style.cssText = "position:fixed;inset:0;width:100%;height:100%;overflow:visible;";
1020
1020
  const e = document.createElementNS("http://www.w3.org/2000/svg", "path");
1021
1021
  return e.setAttribute("d", i), e.setAttribute("fill", "none"), e.setAttribute("stroke", "#059669"), e.setAttribute("stroke-width", "3.5"), e.setAttribute("stroke-linecap", "round"), e.setAttribute("stroke-linejoin", "round"), e.setAttribute("filter", "drop-shadow(0 1px 2px rgba(5,150,105,0.35))"), t.appendChild(e), t;
1022
1022
  }
1023
- function xe(i) {
1023
+ function we(i) {
1024
1024
  const [t, e] = i.split(","), s = t.match(/:(.*?);/)?.[1] ?? "image/png", r = atob(e), n = new Uint8Array(r.length);
1025
1025
  for (let o = 0; o < r.length; o++)
1026
1026
  n[o] = r.charCodeAt(o);
1027
1027
  return new Blob([n], { type: s });
1028
1028
  }
1029
- class we {
1029
+ class ke {
1030
1030
  constructor() {
1031
1031
  this.listeners = /* @__PURE__ */ new Set(), this.originalOnError = null, this.installedOnError = null, this.rejectionHandler = null, this.hooked = !1;
1032
1032
  }
@@ -1048,20 +1048,20 @@ class we {
1048
1048
  for (const e of this.listeners) e(t);
1049
1049
  }
1050
1050
  }
1051
- const et = new we(), ke = 20;
1052
- class ve {
1051
+ const it = new ke(), ve = 20;
1052
+ class Se {
1053
1053
  constructor() {
1054
1054
  this.errors = [], this.unsubscribe = null;
1055
1055
  }
1056
1056
  start() {
1057
- this.unsubscribe || (this.unsubscribe = et.subscribe((t) => this.record(t)));
1057
+ this.unsubscribe || (this.unsubscribe = it.subscribe((t) => this.record(t)));
1058
1058
  }
1059
1059
  record(t) {
1060
1060
  const e = t.line != null ? ` (${t.line}:${t.col ?? 0})` : "";
1061
1061
  this.addError(`${t.message}${e}`);
1062
1062
  }
1063
1063
  addError(t) {
1064
- this.errors.length >= ke || this.errors.includes(t) || this.errors.push(t);
1064
+ this.errors.length >= ve || this.errors.includes(t) || this.errors.push(t);
1065
1065
  }
1066
1066
  getErrors() {
1067
1067
  return [...this.errors];
@@ -1070,7 +1070,7 @@ class ve {
1070
1070
  this.unsubscribe?.(), this.unsubscribe = null;
1071
1071
  }
1072
1072
  }
1073
- const Se = 3, Ee = 1e3, Ce = 3, Me = 5e3, Te = 500, Le = 500, Ae = 300, Re = /* @__PURE__ */ new Set([
1073
+ const Ee = 3, Ce = 1e3, Me = 3, Te = 5e3, Le = 500, _e = 500, De = 300, Ae = /* @__PURE__ */ new Set([
1074
1074
  "A",
1075
1075
  "BUTTON",
1076
1076
  "INPUT",
@@ -1079,7 +1079,7 @@ const Se = 3, Ee = 1e3, Ce = 3, Me = 5e3, Te = 500, Le = 500, Ae = 300, Re = /*
1079
1079
  "LABEL",
1080
1080
  "SUMMARY",
1081
1081
  "DETAILS"
1082
- ]), De = /* @__PURE__ */ new Set([
1082
+ ]), Pe = /* @__PURE__ */ new Set([
1083
1083
  "button",
1084
1084
  "link",
1085
1085
  "checkbox",
@@ -1105,7 +1105,7 @@ const Se = 3, Ee = 1e3, Ce = 3, Me = 5e3, Te = 500, Le = 500, Ae = 300, Re = /*
1105
1105
  this.clickHistory = [], this.unsubscribeErrors = null, this.active = !1, this.errorCount = 0, this.deadClickCount = 0, this.cooldownUntil = 0, this.navTimestamps = [], this.boundPopstateHandler = null, this.originalPushState = null, this.originalReplaceState = null, this.installedPushState = null, this.installedReplaceState = null, this.boundSubmitHandler = null, this.boundInvalidHandler = null, this.errorPageUrls = /* @__PURE__ */ new Set(), this.domObserver = null, this.pendingDomChecks = 0, this.lastMutationAt = -1, this.onFrustration = t, this.boundClickHandler = (e) => this.handleClick(e);
1106
1106
  }
1107
1107
  start() {
1108
- this.active || (this.active = !0, document.addEventListener("click", this.boundClickHandler, !0), this.unsubscribeErrors = et.subscribe((t) => {
1108
+ this.active || (this.active = !0, document.addEventListener("click", this.boundClickHandler, !0), this.unsubscribeErrors = it.subscribe((t) => {
1109
1109
  this.errorCount++;
1110
1110
  }), this.startNavigationTracking(), this.startFormTracking(), this.checkErrorPage());
1111
1111
  }
@@ -1135,8 +1135,8 @@ const Se = 3, Ee = 1e3, Ce = 3, Me = 5e3, Te = 500, Le = 500, Ae = 300, Re = /*
1135
1135
  if (!e || this.isWidgetElement(e)) return;
1136
1136
  const s = Date.now();
1137
1137
  this.clickHistory.push({ target: e, time: s });
1138
- const r = s - Ee;
1139
- if (this.clickHistory = this.clickHistory.filter((o) => o.time > r), this.clickHistory.filter((o) => o.target === e).length >= Se) {
1138
+ const r = s - Ce;
1139
+ if (this.clickHistory = this.clickHistory.filter((o) => o.time > r), this.clickHistory.filter((o) => o.target === e).length >= Ee) {
1140
1140
  this.clickHistory = [], this.emitHighPriority({
1141
1141
  signal: "rage_click",
1142
1142
  target: y(e),
@@ -1153,13 +1153,13 @@ const Se = 3, Ee = 1e3, Ce = 3, Me = 5e3, Te = 500, Le = 500, Ae = 300, Re = /*
1153
1153
  handleNavigation() {
1154
1154
  const t = Date.now();
1155
1155
  this.navTimestamps.push(t);
1156
- const e = t - Me;
1157
- this.navTimestamps = this.navTimestamps.filter((s) => s > e), this.navTimestamps.length >= Ce && (this.navTimestamps = [], this.emitIfReady({
1156
+ const e = t - Te;
1157
+ this.navTimestamps = this.navTimestamps.filter((s) => s > e), this.navTimestamps.length >= Me && (this.navTimestamps = [], this.emitIfReady({
1158
1158
  signal: "rapid_navigation",
1159
1159
  timestamp: t
1160
1160
  })), setTimeout(() => {
1161
1161
  this.active && this.checkErrorPage();
1162
- }, Ae);
1162
+ }, De);
1163
1163
  }
1164
1164
  handleFormSubmit(t) {
1165
1165
  const e = t.target;
@@ -1169,7 +1169,7 @@ const Se = 3, Ee = 1e3, Ce = 3, Me = 5e3, Te = 500, Le = 500, Ae = 300, Re = /*
1169
1169
  target: y(e),
1170
1170
  timestamp: Date.now()
1171
1171
  });
1172
- }, Te));
1172
+ }, Le));
1173
1173
  }
1174
1174
  handleFormInvalid(t) {
1175
1175
  const e = t.target;
@@ -1220,7 +1220,7 @@ const Se = 3, Ee = 1e3, Ce = 3, Me = 5e3, Te = 500, Le = 500, Ae = 300, Re = /*
1220
1220
  target: y(t),
1221
1221
  timestamp: e
1222
1222
  });
1223
- }, Le));
1223
+ }, _e));
1224
1224
  }
1225
1225
  ensureDomObserver() {
1226
1226
  this.domObserver || (this.domObserver = new MutationObserver(() => {
@@ -1245,9 +1245,9 @@ const Se = 3, Ee = 1e3, Ce = 3, Me = 5e3, Te = 500, Le = 500, Ae = 300, Re = /*
1245
1245
  return !1;
1246
1246
  }
1247
1247
  isInteractive(t) {
1248
- if (Re.has(t.tagName)) return !0;
1248
+ if (Ae.has(t.tagName)) return !0;
1249
1249
  const e = t.getAttribute("role");
1250
- return !!(e && De.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'));
1250
+ return !!(e && Pe.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'));
1251
1251
  }
1252
1252
  isWidgetElement(t) {
1253
1253
  const e = document.getElementById("mtb-widget-host");
@@ -1262,33 +1262,33 @@ const Se = 3, Ee = 1e3, Ce = 3, Me = 5e3, Te = 500, Le = 500, Ae = 300, Re = /*
1262
1262
  }
1263
1263
  };
1264
1264
  k.COOLDOWN_MS = 6e4;
1265
- let R = k;
1265
+ let D = k;
1266
1266
  function y(i) {
1267
1267
  const t = i.tagName.toLowerCase(), e = i.id ? `#${i.id}` : "", s = i.className && typeof i.className == "string" ? "." + i.className.trim().split(/\s+/).slice(0, 2).join(".") : "", r = i.textContent?.trim().slice(0, 30) ?? "";
1268
1268
  return `<${t}${e}${s}>${r ? ` "${r}"` : ""}`;
1269
1269
  }
1270
- function Pe() {
1270
+ function Re() {
1271
1271
  return {
1272
1272
  page_url: window.location.href,
1273
1273
  user_agent: navigator.userAgent,
1274
- browser: _e(),
1275
- os: He(),
1274
+ browser: He(),
1275
+ os: $e(),
1276
1276
  screen_width: window.screen.width,
1277
1277
  screen_height: window.screen.height
1278
1278
  };
1279
1279
  }
1280
- function _e() {
1280
+ function He() {
1281
1281
  const i = navigator.userAgent;
1282
1282
  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";
1283
1283
  }
1284
- function He() {
1284
+ function $e() {
1285
1285
  const i = navigator.userAgent;
1286
1286
  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";
1287
1287
  }
1288
- const $e = "https://makethisbetter.dev/api/v1";
1289
- class Ie {
1288
+ const Ie = "https://makethisbetter.dev/api/v1";
1289
+ class Fe {
1290
1290
  constructor(t, e, s = 1e3, r, n) {
1291
- this.projectKey = t, this.apiUrl = (e ?? $e).replace(/\/$/, ""), this.retryDelayMs = s, this.userToken = r, this.userTokenFn = n;
1291
+ this.projectKey = t, this.apiUrl = (e ?? Ie).replace(/\/$/, ""), this.retryDelayMs = s, this.userToken = r, this.userTokenFn = n;
1292
1292
  }
1293
1293
  async resolveUserToken() {
1294
1294
  return this.userTokenFn ? this.userTokenFn() : this.userToken;
@@ -1349,7 +1349,7 @@ function W(i) {
1349
1349
  function Oe() {
1350
1350
  return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : `${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 12)}`;
1351
1351
  }
1352
- function Fe(i, t, e, s, r, n) {
1352
+ function je(i, t, e, s, r, n) {
1353
1353
  return {
1354
1354
  description: i,
1355
1355
  ...t,
@@ -1367,7 +1367,7 @@ function Fe(i, t, e, s, r, n) {
1367
1367
  recording_duration: n?.duration
1368
1368
  };
1369
1369
  }
1370
- const je = {
1370
+ const Ue = {
1371
1371
  tab: "Feedback",
1372
1372
  toolbar: {
1373
1373
  markup: "Mark up",
@@ -1391,6 +1391,8 @@ const je = {
1391
1391
  success: {
1392
1392
  title: "Thanks!",
1393
1393
  message: "Your feedback has been received.",
1394
+ title_no_ai: "Sent — thanks!",
1395
+ message_no_ai: "We'll take it from here. You'll hear back when it's resolved.",
1394
1396
  view_feedback: "View my feedback",
1395
1397
  close: "Close"
1396
1398
  },
@@ -1420,7 +1422,7 @@ const je = {
1420
1422
  send: "Send",
1421
1423
  skip: "Skip"
1422
1424
  }
1423
- }, Ue = {
1425
+ }, ze = {
1424
1426
  tab: "反馈",
1425
1427
  toolbar: {
1426
1428
  markup: "标注",
@@ -1444,6 +1446,8 @@ const je = {
1444
1446
  success: {
1445
1447
  title: "感谢!",
1446
1448
  message: "您的反馈已收到。",
1449
+ title_no_ai: "已发送,感谢!",
1450
+ message_no_ai: "我们会跟进处理,解决后会通知您。",
1447
1451
  view_feedback: "查看我的反馈",
1448
1452
  close: "关闭"
1449
1453
  },
@@ -1473,7 +1477,7 @@ const je = {
1473
1477
  send: "发送",
1474
1478
  skip: "跳过"
1475
1479
  }
1476
- }, ze = {
1480
+ }, Be = {
1477
1481
  tab: "フィードバック",
1478
1482
  toolbar: {
1479
1483
  markup: "マークアップ",
@@ -1497,6 +1501,8 @@ const je = {
1497
1501
  success: {
1498
1502
  title: "ありがとうございます!",
1499
1503
  message: "フィードバックを受け付けました。",
1504
+ title_no_ai: "送信しました!",
1505
+ message_no_ai: "チームが対応します。解決次第お知らせします。",
1500
1506
  view_feedback: "フィードバックを確認",
1501
1507
  close: "閉じる"
1502
1508
  },
@@ -1526,7 +1532,7 @@ const je = {
1526
1532
  send: "送信",
1527
1533
  skip: "スキップ"
1528
1534
  }
1529
- }, Be = {
1535
+ }, qe = {
1530
1536
  tab: "피드백",
1531
1537
  toolbar: {
1532
1538
  markup: "마크업",
@@ -1550,6 +1556,8 @@ const je = {
1550
1556
  success: {
1551
1557
  title: "감사합니다!",
1552
1558
  message: "피드백이 접수되었습니다.",
1559
+ title_no_ai: "전송 완료!",
1560
+ message_no_ai: "팀에서 처리 후 알려드리겠습니다.",
1553
1561
  view_feedback: "내 피드백 보기",
1554
1562
  close: "닫기"
1555
1563
  },
@@ -1579,7 +1587,7 @@ const je = {
1579
1587
  send: "보내기",
1580
1588
  skip: "건너뛰기"
1581
1589
  }
1582
- }, qe = {
1590
+ }, We = {
1583
1591
  tab: "Comentarios",
1584
1592
  toolbar: {
1585
1593
  markup: "Anotar",
@@ -1603,6 +1611,8 @@ const je = {
1603
1611
  success: {
1604
1612
  title: "¡Gracias!",
1605
1613
  message: "Tu comentario ha sido recibido.",
1614
+ title_no_ai: "¡Enviado!",
1615
+ message_no_ai: "Nos encargamos. Te avisaremos cuando se resuelva.",
1606
1616
  view_feedback: "Ver mis comentarios",
1607
1617
  close: "Cerrar"
1608
1618
  },
@@ -1632,7 +1642,7 @@ const je = {
1632
1642
  send: "Enviar",
1633
1643
  skip: "Omitir"
1634
1644
  }
1635
- }, We = {
1645
+ }, Ne = {
1636
1646
  tab: "Avis",
1637
1647
  toolbar: {
1638
1648
  markup: "Annoter",
@@ -1656,6 +1666,8 @@ const je = {
1656
1666
  success: {
1657
1667
  title: "Merci !",
1658
1668
  message: "Votre avis a bien été reçu.",
1669
+ title_no_ai: "Envoyé !",
1670
+ message_no_ai: "On s'en occupe. Vous serez informé(e) dès que ce sera résolu.",
1659
1671
  view_feedback: "Voir mes avis",
1660
1672
  close: "Fermer"
1661
1673
  },
@@ -1685,7 +1697,7 @@ const je = {
1685
1697
  send: "Envoyer",
1686
1698
  skip: "Passer"
1687
1699
  }
1688
- }, Ne = {
1700
+ }, Ve = {
1689
1701
  tab: "Feedback",
1690
1702
  toolbar: {
1691
1703
  markup: "Markieren",
@@ -1709,6 +1721,8 @@ const je = {
1709
1721
  success: {
1710
1722
  title: "Vielen Dank!",
1711
1723
  message: "Ihr Feedback wurde empfangen.",
1724
+ title_no_ai: "Gesendet!",
1725
+ message_no_ai: "Wir kümmern uns darum. Sie werden benachrichtigt, sobald es gelöst ist.",
1712
1726
  view_feedback: "Mein Feedback ansehen",
1713
1727
  close: "Schließen"
1714
1728
  },
@@ -1739,47 +1753,51 @@ const je = {
1739
1753
  skip: "Überspringen"
1740
1754
  }
1741
1755
  }, w = {
1742
- en: je,
1743
- "zh-CN": Ue,
1744
- ja: ze,
1745
- ko: Be,
1746
- es: qe,
1747
- fr: We,
1748
- de: Ne
1756
+ en: Ue,
1757
+ "zh-CN": ze,
1758
+ ja: Be,
1759
+ ko: qe,
1760
+ es: We,
1761
+ fr: Ne,
1762
+ de: Ve
1749
1763
  };
1750
- function Ve(i) {
1764
+ function Ye(i) {
1751
1765
  if (w[i]) return w[i];
1752
1766
  const t = i.split("-")[0];
1753
1767
  return w[t] ? w[t] : w.en;
1754
1768
  }
1755
- const Ye = 60, Xe = "https://cdn.jsdelivr.net/npm/rrweb@2.1.0/dist/rrweb.min.js", Ge = "sha384-6qZKf9GE/E2uhA8IdLwXsQiLN/jVx8mhA0i04rQ1aHLrs2URo3ivHlSbaccG59zt";
1769
+ const Xe = 60, Ge = "https://cdn.jsdelivr.net/npm/@rrweb/record@2.1.0/umd/record.min.js", Ke = "sha384-MrD66HBNSykaP2N95+6hQCFlF5oH2tvL3TD/zyvHNkP/sAFWZx98DX9MEDy8MdVT";
1756
1770
  let v = null;
1757
- function Ke() {
1758
- return v || (v = Je().catch(() => Qe()), v);
1771
+ function Je() {
1772
+ return v || (v = Qe().catch(() => Ze()), v);
1759
1773
  }
1760
- async function Je() {
1774
+ async function Qe() {
1761
1775
  return (await import("rrweb")).record;
1762
1776
  }
1763
- function Qe() {
1777
+ function N() {
1778
+ const i = globalThis;
1779
+ return i.rrwebRecord?.record ?? i.rrweb?.record;
1780
+ }
1781
+ function Ze() {
1764
1782
  return new Promise((i, t) => {
1765
- const e = globalThis;
1766
- if (e.rrweb?.record) {
1767
- i(e.rrweb.record);
1783
+ const e = N();
1784
+ if (e) {
1785
+ i(e);
1768
1786
  return;
1769
1787
  }
1770
1788
  const s = document.createElement("script");
1771
- s.src = Xe, s.integrity = Ge, s.crossOrigin = "anonymous", s.onload = () => {
1772
- const r = globalThis;
1773
- r.rrweb?.record ? i(r.rrweb.record) : t(new Error("rrweb global not found after script load"));
1789
+ s.src = Ge, s.integrity = Ke, s.crossOrigin = "anonymous", s.onload = () => {
1790
+ const r = N();
1791
+ r ? i(r) : t(new Error("rrweb record global not found after script load"));
1774
1792
  }, s.onerror = () => t(new Error("Failed to load rrweb from CDN")), document.head.appendChild(s);
1775
1793
  });
1776
1794
  }
1777
- class Ze {
1795
+ class ti {
1778
1796
  constructor(t, e) {
1779
1797
  this.events = [], this.stopFn = null, this.startedAt = 0, this.timer = null, this.clickHandler = null, this.stopped = !1, this.shadow = t, this.onMaxReached = e;
1780
1798
  }
1781
1799
  async start() {
1782
- const t = await Ke();
1800
+ const t = await Je();
1783
1801
  this.startedAt = Date.now(), this.stopped = !1, this.stopFn = t({
1784
1802
  emit: (e) => {
1785
1803
  this.stopped || this.events.push(e);
@@ -1792,7 +1810,7 @@ class Ze {
1792
1810
  });
1793
1811
  }, document.addEventListener("click", this.clickHandler, !0), this.timer = setTimeout(() => {
1794
1812
  this.onMaxReached?.();
1795
- }, Ye * 1e3);
1813
+ }, Xe * 1e3);
1796
1814
  }
1797
1815
  stop() {
1798
1816
  return this.stopped = !0, this.stopFn?.(), this.stopFn = null, this.cleanupTimer(), this.cleanupClickHandler(), {
@@ -1817,7 +1835,7 @@ class Ze {
1817
1835
  s.style.left = `${t}px`, s.style.top = `${e}px`, this.shadow.append(s), s.addEventListener("animationend", () => s.remove());
1818
1836
  }
1819
1837
  }
1820
- class ti {
1838
+ class ei {
1821
1839
  constructor(t, e, s, r) {
1822
1840
  this.intervalId = null, this.getDuration = s, this.el = t.el("div", "mtb-record-bar"), this.el.innerHTML = `
1823
1841
  <span class="mtb-record-dot"></span>
@@ -1833,12 +1851,12 @@ class ti {
1833
1851
  this.intervalId && (clearInterval(this.intervalId), this.intervalId = null), this.el.remove();
1834
1852
  }
1835
1853
  }
1836
- class ei {
1854
+ class ii {
1837
1855
  constructor() {
1838
1856
  this.session = null, this.bar = null, this.result = null;
1839
1857
  }
1840
1858
  async start(t, e, s) {
1841
- this.session = new Ze(t, s), this.bar = new ti(
1859
+ this.session = new ti(t, s), this.bar = new ei(
1842
1860
  t,
1843
1861
  e,
1844
1862
  () => this.session?.getDuration() ?? 0,
@@ -1858,12 +1876,12 @@ class ei {
1858
1876
  this.session?.destroy(), this.session = null, this.bar?.destroy(), this.bar = null;
1859
1877
  }
1860
1878
  }
1861
- class N {
1879
+ class V {
1862
1880
  constructor(t) {
1863
- this.tab = null, this.toolbar = null, this.session = null, this.popup = null, this.clarify = null, this.success = null, this.frustrationPrompt = null, this.frustrationDetector = null, this.mode = "idle", this.currentAnnotation = null, this.recordingManager = null, this.config = t, this.messages = Ve(t.locale ?? "en"), this.apiClient = new Ie(t.projectKey, t.apiUrl, void 0, t.userToken, t.userTokenFn), this.consoleCollector = new ve(), this.consoleCollector.start(), this.buildUI(), t.frustrationDetection !== !1 && (this.frustrationDetector = new R(() => this.handleFrustration()), this.frustrationDetector.start());
1881
+ this.tab = null, this.toolbar = null, this.session = null, this.popup = null, this.clarify = null, this.success = null, this.frustrationPrompt = null, this.frustrationDetector = null, this.mode = "idle", this.currentAnnotation = null, this.recordingManager = null, this.config = t, this.messages = Ye(t.locale ?? "en"), this.apiClient = new Fe(t.projectKey, t.apiUrl, void 0, t.userToken, t.userTokenFn), this.consoleCollector = new Se(), this.consoleCollector.start(), this.buildUI(), t.frustrationDetection !== !1 && (this.frustrationDetector = new D(() => this.handleFrustration()), this.frustrationDetector.start());
1864
1882
  }
1865
1883
  buildUI() {
1866
- this.shadow = new rt(this.config.theme ?? "auto"), this.tab = new nt(
1884
+ this.shadow = new nt(this.config.theme ?? "auto"), this.tab = new ot(
1867
1885
  this.shadow,
1868
1886
  this.messages,
1869
1887
  this.config.position ?? "right",
@@ -1875,7 +1893,7 @@ class N {
1875
1893
  this.mode === "idle" ? (this.dismissFrustrationPrompt(), this.enterAnnotationMode()) : this.exitAll();
1876
1894
  }
1877
1895
  handleFrustration() {
1878
- this.mode !== "idle" || this.frustrationPrompt || (this.frustrationPrompt = new at(this.shadow, this.messages, {
1896
+ this.mode !== "idle" || this.frustrationPrompt || (this.frustrationPrompt = new lt(this.shadow, this.messages, {
1879
1897
  onTell: () => {
1880
1898
  this.dismissFrustrationPrompt(), this.enterAnnotationMode();
1881
1899
  },
@@ -1886,7 +1904,7 @@ class N {
1886
1904
  this.frustrationPrompt?.destroy(), this.frustrationPrompt = null;
1887
1905
  }
1888
1906
  enterAnnotationMode() {
1889
- this.mode = "annotating", this.tab?.setActive(!0), this.toolbar = new lt(
1907
+ this.mode = "annotating", this.tab?.setActive(!0), this.toolbar = new ct(
1890
1908
  this.shadow,
1891
1909
  this.messages,
1892
1910
  () => this.exitAll(),
@@ -1896,16 +1914,16 @@ class N {
1896
1914
  });
1897
1915
  }
1898
1916
  handleToolbarModeChange(t) {
1899
- t === "record" ? (this.mode = "recording", this.session?.destroy(), this.session = null, this.recordingManager = new ei(), this.recordingManager.start(this.shadow, this.messages, () => {
1917
+ t === "record" ? (this.mode = "recording", this.session?.destroy(), this.session = null, this.recordingManager = new ii(), this.recordingManager.start(this.shadow, this.messages, () => {
1900
1918
  this.recordingManager && (this.recordingManager.stop(), this.showPopup(window.innerWidth / 2, window.innerHeight / 2, this.messages.record.timer_label));
1901
- }).catch(() => {
1902
- this.mode === "recording" && (this.toolbar?.setMode("markup"), this.handleToolbarModeChange("markup"));
1919
+ }).catch((e) => {
1920
+ console.warn("[MakeThisBetter] Screen recording unavailable, falling back to markup:", e), this.mode === "recording" && (this.toolbar?.setMode("markup"), this.handleToolbarModeChange("markup"));
1903
1921
  })) : (this.recordingManager?.destroy(), this.recordingManager = null, this.session || (this.session = new H(this.shadow, this.messages, (e, s) => {
1904
1922
  this.currentAnnotation = e, this.showPopup(e.x, e.y, s);
1905
1923
  })), this.mode = "annotating");
1906
1924
  }
1907
1925
  showPopup(t, e, s) {
1908
- this.mode = "popup", this.session?.dismissInteraction(), this.popup = new bt(this.shadow, {
1926
+ this.mode = "popup", this.session?.dismissInteraction(), this.popup = new gt(this.shadow, {
1909
1927
  targetName: s,
1910
1928
  x: t,
1911
1929
  y: e,
@@ -1918,9 +1936,9 @@ class N {
1918
1936
  if (!this.popup) return;
1919
1937
  this.popup.setLoading(!0);
1920
1938
  const e = this.currentAnnotation, s = this.recordingManager?.getRecording() ?? void 0, [r, n] = await Promise.all([
1921
- me(e ? [e] : []),
1922
- Promise.resolve(Pe())
1923
- ]), o = Fe(
1939
+ be(e ? [e] : []),
1940
+ Promise.resolve(Re())
1941
+ ]), o = je(
1924
1942
  t,
1925
1943
  n,
1926
1944
  this.consoleCollector.getErrors(),
@@ -1930,13 +1948,13 @@ class N {
1930
1948
  );
1931
1949
  try {
1932
1950
  const a = await this.apiClient.submitFeedback(o, r);
1933
- this.popup?.destroy(), this.popup = null, this.session?.destroy(), this.session = null, this.recordingManager?.destroy(), this.recordingManager = null, a.ai_clarify_available === !1 ? this.showSuccess(a.project_id) : this.showClarify(a.id, a.project_id);
1951
+ this.popup?.destroy(), this.popup = null, this.session?.destroy(), this.session = null, this.recordingManager?.destroy(), this.recordingManager = null, a.skip_followup === !0 || a.ai_clarify_available === !1 ? this.showSuccess(a.project_id, { skipFollowup: !0 }) : this.showClarify(a.id, a.project_id);
1934
1952
  } catch {
1935
1953
  this.popup?.setLoading(!1), this.popup?.setError(this.messages.error.submit);
1936
1954
  }
1937
1955
  }
1938
1956
  showClarify(t, e) {
1939
- this.mode = "idle", this.tab?.setActive(!1), this.clarify = new xt(this.shadow, {
1957
+ this.mode = "idle", this.tab?.setActive(!1), this.clarify = new wt(this.shadow, {
1940
1958
  feedbackId: t,
1941
1959
  apiClient: this.apiClient,
1942
1960
  messages: this.messages,
@@ -1945,15 +1963,15 @@ class N {
1945
1963
  }
1946
1964
  });
1947
1965
  }
1948
- showSuccess(t) {
1966
+ showSuccess(t, e) {
1949
1967
  this.mode = "idle", this.tab?.setActive(!1);
1950
- const s = `${this.config.apiUrl ? this.config.apiUrl.replace(/\/api\/v1\/?$/, "") : "https://makethisbetter.dev"}/board/projects/${t}/feedbacks`, r = !!(this.config.userToken || this.config.userTokenFn);
1951
- this.success = new kt(this.shadow, this.messages, () => {
1968
+ const r = `${this.config.apiUrl ? this.config.apiUrl.replace(/\/api\/v1\/?$/, "") : "https://makethisbetter.dev"}/board/projects/${t}/feedbacks`, n = !!(this.config.userToken || this.config.userTokenFn);
1969
+ this.success = new vt(this.shadow, this.messages, () => {
1952
1970
  this.success?.destroy(), this.success = null;
1953
- }, r ? async () => {
1954
- const n = await this.apiClient.resolveUserToken();
1955
- n && window.open(`${s}?identity=${encodeURIComponent(n)}`, "_blank");
1956
- } : void 0);
1971
+ }, n ? async () => {
1972
+ const o = await this.apiClient.resolveUserToken();
1973
+ o && window.open(`${r}?identity=${encodeURIComponent(o)}`, "_blank");
1974
+ } : void 0, e);
1957
1975
  }
1958
1976
  exitAll() {
1959
1977
  this.mode = "idle", this.tab?.setActive(!1), this.toolbar?.destroy(), this.toolbar = null, this.session?.destroy(), this.session = null, this.popup?.destroy(), this.popup = null, this.clarify?.destroy(), this.clarify = null, this.currentAnnotation = null, this.recordingManager?.destroy(), this.recordingManager = null;
@@ -1962,19 +1980,19 @@ class N {
1962
1980
  this.exitAll(), this.consoleCollector.stop(), this.frustrationDetector?.stop(), this.dismissFrustrationPrompt(), this.clarify?.destroy(), this.success?.destroy(), this.tab?.destroy(), this.recordingManager?.destroy(), this.shadow.destroy();
1963
1981
  }
1964
1982
  }
1965
- let f = null;
1966
- const ii = {
1983
+ let m = null;
1984
+ const si = {
1967
1985
  init(i) {
1968
- f && (f.destroy(), f = null), document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", () => {
1969
- f = new N(i);
1970
- }) : f = new N(i);
1986
+ m && (m.destroy(), m = null), document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", () => {
1987
+ m = new V(i);
1988
+ }) : m = new V(i);
1971
1989
  },
1972
1990
  destroy() {
1973
- f?.destroy(), f = null;
1991
+ m?.destroy(), m = null;
1974
1992
  }
1975
1993
  };
1976
- typeof window < "u" && (window.MakeThisBetter = ii);
1994
+ typeof window < "u" && (window.MakeThisBetter = si);
1977
1995
  export {
1978
- ii as MakeThisBetter
1996
+ si as MakeThisBetter
1979
1997
  };
1980
1998
  //# sourceMappingURL=makethisbetter.esm.js.map