@qaiddev/thumbs-embed 1.9.1 → 1.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,26 +1,49 @@
1
- import { i as At, F as Tt, T as It, a as Et, R as zt } from "./annotate-D-o8xCV9.js";
2
- const Dt = "button{cursor:pointer}.qaid-buttons{display:flex;gap:.5rem}.qaid-buttons.qaid-vertical{flex-direction:column}.qaid-buttons.qaid-auto-container{position:fixed;z-index:50}.qaid-buttons.qaid-auto-container.qaid-bottom-right{bottom:1rem;right:1rem}.qaid-buttons.qaid-auto-container.qaid-bottom-left{bottom:1rem;left:1rem}.qaid-buttons.qaid-auto-container.qaid-top-right{top:1rem;right:1rem}.qaid-buttons.qaid-auto-container.qaid-top-left{top:1rem;left:1rem}.qaid-buttons.qaid-incognito{opacity:0;transition:opacity .2s ease-in-out}.qaid-buttons.qaid-incognito:hover{opacity:1}.qaid-buttons.qaid-dismissed{display:none!important}.qaid-dismiss-btn{width:20px;height:20px;padding:0;border:none;border-radius:50%;background:#0006;color:#fff;display:flex;align-items:center;justify-content:center;align-self:center;opacity:0;transition:opacity .15s,background .15s;cursor:pointer;pointer-events:auto;-webkit-appearance:none;appearance:none}.qaid-dismiss-btn:hover{background:#0009}.qaid-buttons:hover .qaid-dismiss-btn{opacity:1}button.qaid-btn-structural{display:inline-flex;align-items:center;justify-content:center;cursor:pointer;-webkit-appearance:none;appearance:none}.qaid-icon{width:24px;height:24px}:where(button.qaid-btn-structural)>svg:where(:not(.qaid-icon):not([width])){width:var(--qaid-icon-size, 24px);height:var(--qaid-icon-size, 24px)}.qaid-btn-structural:not(:has(svg)),.qaid-btn:not(:has(svg)){font-size:var(--qaid-icon-size, 24px);line-height:1}.qaid-emoji-icon{font-size:var(--qaid-icon-size, 24px);line-height:1}.qaid-buttons,.qaid-buttons *,.qaid-modal-container,.qaid-modal-container *{cursor:pointer!important}.qaid-tooltip-wrapper{position:relative}.qaid-tooltip-text{position:fixed;padding:.5rem .75rem;background:#1f2937;color:#fff;font-size:var(--qaid-font-size, 16px);font-weight:600;border-radius:.5rem;white-space:nowrap;opacity:0;pointer-events:none;transition:opacity .15s;z-index:99999}.qaid-tooltip-text.qaid-tooltip-visible{opacity:1}.qaid-targeting-overlay{position:fixed;inset:0;z-index:40;pointer-events:none}.qaid-capture-layer{position:fixed;inset:0;pointer-events:none;z-index:9999}@keyframes qaid-slideDown{0%{transform:translateY(-100%)}to{transform:translateY(0)}}.qaid-vignette{position:fixed;inset:0;pointer-events:none;background:radial-gradient(ellipse at center,transparent 30%,rgba(0,0,0,.3) 70%,rgba(0,0,0,.6) 100%);z-index:41}.qaid-crosshair-h,.qaid-crosshair-v{position:fixed;pointer-events:none;z-index:42}.qaid-crosshair-h{left:0;right:0;height:1px;background:color-mix(in srgb,var(--qaid-negative) 60%,transparent)}.qaid-crosshair-v{top:0;bottom:0;width:1px;background:color-mix(in srgb,var(--qaid-negative) 60%,transparent)}.qaid-type-up .qaid-crosshair-h,.qaid-type-up .qaid-crosshair-v{background:color-mix(in srgb,var(--qaid-positive) 60%,transparent)}.qaid-highlight-box{position:fixed;top:0;left:0;pointer-events:none;z-index:41;display:none;border:3px solid color-mix(in srgb,var(--qaid-negative) 80%,transparent);border-radius:2px;background:color-mix(in srgb,var(--qaid-negative) 8%,transparent);will-change:transform,width,height}.qaid-type-up .qaid-highlight-box{border-color:color-mix(in srgb,var(--qaid-positive) 80%,transparent);background:color-mix(in srgb,var(--qaid-positive) 8%,transparent)}.qaid-scope{position:fixed;width:80px;height:80px;pointer-events:none;z-index:43;transform:translate(-50%,-50%)}.qaid-scope-ring{position:absolute;inset:10px;border:2px solid color-mix(in srgb,var(--qaid-negative) 80%,transparent);border-radius:50%}.qaid-type-up .qaid-scope-ring{border-color:color-mix(in srgb,var(--qaid-positive) 80%,transparent)}.qaid-scope-ring-inner{position:absolute;inset:20px;border:1px solid color-mix(in srgb,var(--qaid-negative) 50%,transparent);border-radius:50%}.qaid-type-up .qaid-scope-ring-inner{border-color:color-mix(in srgb,var(--qaid-positive) 50%,transparent)}.qaid-scope-dot{position:absolute;top:50%;left:50%;width:4px;height:4px;background:var(--qaid-negative);border-radius:50%;transform:translate(-50%,-50%)}.qaid-type-up .qaid-scope-dot{background:var(--qaid-positive)}.qaid-selected-marker{position:fixed;border:3px solid var(--qaid-marker, #6365f1);border-radius:50%;pointer-events:none;z-index:44;animation:qaid-markerPulse 1.5s ease-in-out infinite}@keyframes qaid-markerPulse{0%,to{opacity:1;transform:scale(1)}50%{opacity:.7;transform:scale(1.05)}}.qaid-backdrop{position:fixed;inset:0;z-index:45;background:#0000004d}.qaid-modal-container{position:fixed;z-index:50;display:flex;flex-direction:column;align-items:flex-start;max-height:calc(100vh - 32px);font-family:var(--qaid-font-family, system-ui, -apple-system, sans-serif);font-size:var(--qaid-font-size, 16px)}.qaid-modal-container.qaid-above{flex-direction:column-reverse}.qaid-modal-arrow{width:0;height:0;border-left:12px solid transparent;border-right:12px solid transparent;position:relative;align-self:flex-start}.qaid-modal-container.qaid-below .qaid-modal-arrow{border-bottom:12px solid light-dark(#ffffff,#1f2937)}.qaid-modal-container.qaid-above .qaid-modal-arrow{border-top:12px solid light-dark(#ffffff,#1f2937)}.qaid-modal-box{color-scheme:inherit;background:light-dark(#ffffff,#1f2937);border-radius:1rem;padding:1.5rem;box-shadow:0 25px 50px -12px light-dark(rgba(0,0,0,.25),rgba(0,0,0,.5));width:var(--qaid-modal-width, 400px);max-width:calc(100vw - 32px);max-height:calc(100vh - 60px);overflow-y:auto}.qaid-modal-header{display:flex;align-items:flex-start;gap:.75rem;margin-bottom:1rem}button.qaid-type-toggle{border:none;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:all .2s;flex-shrink:0;-webkit-appearance:none;appearance:none}button.qaid-type-toggle:hover{transform:scale(1.1)}button.qaid-type-toggle:not(.qaid-type-toggle-custom){width:2.5rem;height:2.5rem;border-radius:50%}button.qaid-type-toggle:not(.qaid-type-toggle-custom) svg{width:1.25rem;height:1.25rem}button.qaid-type-toggle.qaid-type-up{background:var(--qaid-positive);color:#fff}button.qaid-type-toggle.qaid-type-down{background:var(--qaid-negative);color:#fff}.qaid-type-static{width:2.5rem;height:2.5rem;border-radius:50%;display:flex;align-items:center;justify-content:center;flex-shrink:0;background:var(--qaid-marker, #6365f1);color:var(--qaid-marker-text, white)}.qaid-type-static svg{width:1.25rem;height:1.25rem}.qaid-modal-header-text{flex:1;min-width:0}.qaid-modal-title{font-size:calc(var(--qaid-font-size, 16px) * 1.125);font-weight:700;margin:0 0 .25rem;color:light-dark(#1f2937,#f9fafb)}.qaid-modal-subtitle{color:light-dark(#6b7280,#9ca3af);margin:0;font-size:calc(var(--qaid-font-size, 16px) * .875)}.qaid-textarea{width:100%;height:6rem;padding:.75rem;border:1px solid light-dark(#d1d5db,#374151);border-radius:.5rem;font-family:inherit;font-size:var(--qaid-font-size, 16px);resize:vertical;margin-bottom:1rem;box-sizing:border-box;background:light-dark(#ffffff,#111827);color:light-dark(#1f2937,#f9fafb)}.qaid-textarea:focus{outline:none;border-color:var(--qaid-marker);box-shadow:0 0 0 3px color-mix(in srgb,var(--qaid-marker) 20%,transparent)}.qaid-btn-row{display:flex;gap:.5rem;justify-content:flex-end}button.qaid-btn-submit{padding:.5rem 1rem;background:var(--qaid-marker);color:var(--qaid-marker-text, white);border:none;border-radius:.5rem;font-size:calc(var(--qaid-font-size, 16px) * .875);font-weight:500;cursor:pointer;transition:background-color .2s,filter .2s;-webkit-appearance:none;appearance:none}button.qaid-btn-submit:hover{filter:brightness(.85)}button.qaid-btn-submit:focus{outline:none;box-shadow:0 0 0 3px color-mix(in srgb,var(--qaid-marker) 30%,transparent)}.qaid-bottom-sheet{position:fixed;bottom:0;left:0;right:0;z-index:50;animation:qaid-slideUpSheet .3s ease-out;font-family:var(--qaid-font-family, system-ui, -apple-system, sans-serif);font-size:var(--qaid-font-size, 16px)}.qaid-bottom-sheet-content{background:light-dark(#ffffff,#1f2937);border-radius:1rem 1rem 0 0;padding:1.5rem;padding-bottom:max(1.5rem,env(safe-area-inset-bottom))}.qaid-bottom-sheet-handle{width:36px;height:4px;background:light-dark(rgba(0,0,0,.2),rgba(255,255,255,.2));border-radius:2px;margin:0 auto 1rem}@keyframes qaid-slideUpSheet{0%{transform:translateY(100%)}to{transform:translateY(0)}}button.qaid-btn-record:hover{background:#dc2626;color:#fff}.qaid-recording-indicator{position:fixed;pointer-events:auto;top:12px;left:50%;transform:translate(-50%);display:flex;align-items:center;gap:.5rem;padding:.5rem 1rem;background:light-dark(#1f2937,#374151);color:#fff;border-radius:9999px;font-family:var(--qaid-font-family, system-ui, -apple-system, sans-serif);font-size:calc(var(--qaid-font-size, 16px) * .875);font-weight:500;box-shadow:0 4px 12px #0000004d;z-index:99999;animation:qaid-slideDown .2s ease-out}.qaid-recording-dot{width:10px;height:10px;background:#dc2626;border-radius:50%;animation:qaid-dotPulse 1.5s ease-in-out infinite}@keyframes qaid-dotPulse{0%,to{opacity:1}50%{opacity:.3}}.qaid-recording-time{font-variant-numeric:tabular-nums;min-width:2.5rem;text-align:center}button.qaid-recording-stop{padding:.25rem .75rem;background:#dc2626;color:#fff;border:none;border-radius:9999px;font-size:calc(var(--qaid-font-size, 16px) * .75);font-weight:600;cursor:pointer;transition:background-color .2s;-webkit-appearance:none;appearance:none}button.qaid-recording-stop:hover{background:#b91c1c}.qaid-video-preview{position:fixed;inset:0 0 auto;height:100vh;height:100dvh;display:flex;align-items:center;justify-content:center;padding:16px;padding-top:max(16px,env(safe-area-inset-top));padding-bottom:max(16px,env(safe-area-inset-bottom));box-sizing:border-box;background:#0009;z-index:99998;animation:qaid-fadeIn .2s ease-out}@keyframes qaid-fadeIn{0%{opacity:0}to{opacity:1}}.qaid-video-preview-box{color-scheme:inherit;background:light-dark(#ffffff,#1f2937);border-radius:1rem;padding:1.5rem;box-shadow:0 25px 50px -12px #00000080;width:560px;max-width:100%;max-height:100%;overflow-y:auto;font-family:var(--qaid-font-family, system-ui, -apple-system, sans-serif);font-size:var(--qaid-font-size, 16px)}.qaid-video-preview-box h3{font-size:calc(var(--qaid-font-size, 16px) * 1.125);font-weight:700;margin:0 0 1rem;color:light-dark(#1f2937,#f9fafb)}.qaid-video-preview-box video{width:100%;max-height:50vh;max-height:50dvh;object-fit:contain;border-radius:.5rem;background:#000;margin-bottom:1rem}.qaid-video-preview-box textarea{width:100%;height:4rem;padding:.75rem;border:1px solid light-dark(#d1d5db,#374151);border-radius:.5rem;font-family:inherit;font-size:calc(var(--qaid-font-size, 16px) * .875);resize:vertical;margin-bottom:1rem;box-sizing:border-box;background:light-dark(#ffffff,#111827);color:light-dark(#1f2937,#f9fafb)}.qaid-video-preview-box textarea:focus{outline:none;border-color:var(--qaid-marker);box-shadow:0 0 0 3px color-mix(in srgb,var(--qaid-marker) 20%,transparent)}.qaid-video-error{margin:0 0 .75rem;font-size:calc(var(--qaid-font-size, 16px) * .875);font-weight:500;color:light-dark(#b91c1c,#fca5a5)}.qaid-video-preview-actions{display:flex;gap:.5rem;justify-content:flex-end}button.qaid-video-btn{padding:.5rem 1rem;border:none;border-radius:.5rem;font-size:calc(var(--qaid-font-size, 16px) * .875);font-weight:500;cursor:pointer;transition:background-color .2s,filter .2s;-webkit-appearance:none;appearance:none}button.qaid-video-btn-cancel{background:light-dark(#f3f4f6,#374151);color:light-dark(#374151,#d1d5db)}button.qaid-video-btn-cancel:hover{background:light-dark(#e5e7eb,#4b5563)}button.qaid-video-btn-rerecord{background:light-dark(#fef3c7,#78350f);color:light-dark(#92400e,#fde68a)}button.qaid-video-btn-rerecord:hover{filter:brightness(.9)}button.qaid-video-btn-send{background:var(--qaid-marker);color:var(--qaid-marker-text, white)}button.qaid-video-btn-send:hover{filter:brightness(.85)}button.qaid-video-btn-send:disabled{opacity:.5;cursor:not-allowed}.qaid-video-sending{display:flex;align-items:center;gap:.5rem;font-size:calc(var(--qaid-font-size, 16px) * .875);color:light-dark(#6b7280,#9ca3af)}.qaid-annotate{position:fixed;inset:0;z-index:2147483000;display:flex;flex-direction:column;gap:.75rem;padding:16px;padding-top:max(16px,env(safe-area-inset-top));padding-bottom:max(16px,env(safe-area-inset-bottom));box-sizing:border-box;background:#000000d9;font-family:var(--qaid-font-family, system-ui, -apple-system, sans-serif);font-size:var(--qaid-font-size, 16px);animation:qaid-fadeIn .2s ease-out}.qaid-annotate-title{margin:0;font-size:var(--qaid-font-size, 16px);font-weight:700;text-align:center;color:#f9fafb}.qaid-annotate-desc{margin:0;font-size:calc(var(--qaid-font-size, 16px) * .8125);line-height:1.4;text-align:center;color:#f9fafbbf}.qaid-annotate-stage{flex:1 1 auto;min-height:0;display:flex;align-items:center;justify-content:center;overflow:auto}.qaid-annotate-canvas{max-width:100%;max-height:100%;object-fit:contain;background:light-dark(#ffffff,#111827);border-radius:.5rem;box-shadow:0 10px 30px #00000080;touch-action:none;cursor:crosshair}.qaid-annotate-toolbar{display:flex;flex-wrap:wrap;gap:.75rem;align-items:center;justify-content:center;padding:.5rem .75rem;background:light-dark(#ffffff,#1f2937);border-radius:.75rem;box-shadow:0 10px 30px light-dark(rgba(0,0,0,.25),rgba(0,0,0,.5))}.qaid-annotate-tools,.qaid-annotate-actions{display:flex;gap:.375rem;align-items:center}button.qaid-annotate-tool,button.qaid-annotate-action{display:inline-flex;align-items:center;justify-content:center;gap:.375rem;min-width:44px;min-height:44px;padding:0 .75rem;border:1px solid light-dark(#d1d5db,#374151);border-radius:.5rem;background:light-dark(#f9fafb,#111827);color:light-dark(#1f2937,#f9fafb);font-family:inherit;font-size:calc(var(--qaid-font-size, 16px) * .8125);font-weight:600;cursor:pointer;-webkit-appearance:none;appearance:none;transition:background-color .15s,color .15s,border-color .15s,filter .15s}button.qaid-annotate-tool svg,button.qaid-annotate-action svg{width:20px;height:20px}.qaid-annotate-colors{display:flex;gap:.25rem;align-items:center}button.qaid-annotate-swatch{width:28px;height:28px;min-width:28px;padding:0;border-radius:9999px;border:2px solid light-dark(#d1d5db,#4b5563);background:var(--qaid-swatch, #000);cursor:pointer;-webkit-appearance:none;appearance:none;transition:transform .1s,box-shadow .15s,border-color .15s}button.qaid-annotate-swatch:hover{transform:scale(1.12)}button.qaid-annotate-swatch[aria-pressed=true]{border-color:light-dark(#111827,#f9fafb);box-shadow:0 0 0 2px var(--qaid-swatch)}@media(forced-colors:active){button.qaid-annotate-swatch[aria-pressed=true]{outline:2px solid Highlight;outline-offset:1px}}button.qaid-annotate-tool:hover,button.qaid-annotate-action:hover{background:light-dark(#eef2ff,#312e81)}button.qaid-annotate-tool[aria-pressed=true],button.qaid-annotate-done{background:var(--qaid-marker, #6365f1);color:var(--qaid-marker-text, #fff);border-color:var(--qaid-marker, #6365f1)}button.qaid-annotate-done:hover{filter:brightness(.9);background:var(--qaid-marker, #6365f1)}button.qaid-annotate-action:disabled{opacity:.45;cursor:not-allowed}@media(forced-colors:active){button.qaid-annotate-tool[aria-pressed=true],button.qaid-annotate-done{border:2px solid Highlight}.qaid-annotate-canvas{border:1px solid CanvasText}}button:focus-visible,textarea:focus-visible,a:focus-visible,[tabindex]:focus-visible,[role=button]:focus-visible{outline:2px solid var(--qaid-marker, #6365f1);outline-offset:2px}.qaid-textarea:focus-visible,button.qaid-btn-submit:focus-visible,.qaid-video-preview-box textarea:focus-visible{outline:2px solid var(--qaid-marker, #6365f1);outline-offset:2px}.qaid-buttons.qaid-incognito:focus-within{opacity:1}.qaid-buttons:focus-within .qaid-dismiss-btn,.qaid-dismiss-btn:focus-visible{opacity:1}.qaid-dismiss-btn{min-width:24px;min-height:24px}button.qaid-recording-stop{min-height:24px}@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}@media(forced-colors:active){button:focus-visible,textarea:focus-visible,a:focus-visible,[tabindex]:focus-visible,[role=button]:focus-visible,.qaid-textarea:focus,button.qaid-btn-submit:focus,.qaid-video-preview-box textarea:focus{outline:2px solid CanvasText;outline-offset:2px}.qaid-selected-marker,.qaid-highlight-box{border-color:Highlight}}.qaid-confirm{display:flex;flex-direction:column;align-items:center;text-align:center;gap:.5rem;padding:.5rem 0}.qaid-confirm-icon{display:flex;align-items:center;justify-content:center;width:44px;height:44px;border-radius:9999px;color:#fff;background:var(--qaid-success, #22c55e);margin-bottom:.25rem;animation:qaid-confirm-pop .28s cubic-bezier(.34,1.56,.64,1)}.qaid-confirm-icon .qaid-icon{width:24px;height:24px}.qaid-confirm-error .qaid-confirm-icon{background:var(--qaid-error, #dc2626)}.qaid-confirm-title{margin:0;font-size:var(--qaid-font-size, 16px);font-weight:600;color:var(--qaid-text, light-dark(#111827, #f9fafb))}.qaid-confirm-title:focus-visible{outline:2px solid var(--qaid-primary, #6365f1);outline-offset:3px;border-radius:4px}.qaid-confirm-message{margin:0;font-size:calc(var(--qaid-font-size, 16px) * .875);color:var(--qaid-text-muted, light-dark(#6b7280, #9ca3af))}.qaid-confirm .qaid-confirm-close{margin-top:.5rem;min-width:96px}@keyframes qaid-confirm-pop{0%{transform:scale(.6);opacity:0}to{transform:scale(1);opacity:1}}@media(prefers-reduced-motion:reduce){.qaid-confirm-icon{animation:none}}", Ht = "body.qaid-targeting,body.qaid-targeting *{cursor:none!important}";
1
+ const Dt = `<svg xmlns="http://www.w3.org/2000/svg" class="qaid-icon" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
2
+ <path stroke-linecap="round" stroke-linejoin="round" d="M14 10h4.764a2 2 0 011.789 2.894l-3.5 7A2 2 0 0115.263 21h-4.017c-.163 0-.326-.02-.485-.06L7 20m7-10V5a2 2 0 00-2-2h-.095c-.5 0-.905.405-.905.905 0 .714-.211 1.412-.608 2.006L7 11v9m7-10h-2M7 20H5a2 2 0 01-2-2v-6a2 2 0 012-2h2.5"/>
3
+ </svg>`, zt = `<svg xmlns="http://www.w3.org/2000/svg" class="qaid-icon" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
4
+ <path stroke-linecap="round" stroke-linejoin="round" d="M10 14H5.236a2 2 0 01-1.789-2.894l3.5-7A2 2 0 018.737 3h4.018a2 2 0 01.485.06l3.76.94m-7 10v5a2 2 0 002 2h.095c.5 0 .905-.405.905-.905 0-.714.211-1.412.608-2.006L17 13V4m-7 10h2m5-10h2a2 2 0 012 2v6a2 2 0 01-2 2h-2.5"/>
5
+ </svg>`, Mt = `<svg xmlns="http://www.w3.org/2000/svg" class="qaid-icon" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
6
+ <path stroke-linecap="round" stroke-linejoin="round" d="M15.75 10.5l4.72-4.72a.75.75 0 011.28.53v11.38a.75.75 0 01-1.28.53l-4.72-4.72M4.5 18.75h9a2.25 2.25 0 002.25-2.25v-9a2.25 2.25 0 00-2.25-2.25h-9A2.25 2.25 0 002.25 7.5v9a2.25 2.25 0 002.25 2.25z"/>
7
+ </svg>`, Lt = `<svg xmlns="http://www.w3.org/2000/svg" class="qaid-icon" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
8
+ <path stroke-linecap="round" stroke-linejoin="round" d="M8 10h8M8 14h5m-9 6l3.5-3.5H18a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v14z"/>
9
+ </svg>`, Te = `<svg xmlns="http://www.w3.org/2000/svg" class="qaid-icon" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
10
+ <rect x="4" y="6" width="16" height="12" rx="1" stroke-linejoin="round"/>
11
+ </svg>`, Ee = `<svg xmlns="http://www.w3.org/2000/svg" class="qaid-icon" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
12
+ <path stroke-linecap="round" stroke-linejoin="round" d="M5 19L19 5m0 0h-8m8 0v8"/>
13
+ </svg>`, Ie = `<svg xmlns="http://www.w3.org/2000/svg" class="qaid-icon" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
14
+ <path stroke-linecap="round" stroke-linejoin="round" d="M12 20h9M16.5 3.5a2.121 2.121 0 013 3L7 19l-4 1 1-4L16.5 3.5z"/>
15
+ </svg>`, De = `<svg xmlns="http://www.w3.org/2000/svg" class="qaid-icon" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
16
+ <path stroke-linecap="round" stroke-linejoin="round" d="M12 3s6 6.4 6 10a6 6 0 01-12 0c0-3.6 6-10 6-10z"/>
17
+ </svg>`, ze = `<svg xmlns="http://www.w3.org/2000/svg" class="qaid-icon" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
18
+ <path stroke-linecap="round" stroke-linejoin="round" d="M9 14L4 9l5-5M4 9h11a5 5 0 010 10h-4"/>
19
+ </svg>`, Me = `<svg xmlns="http://www.w3.org/2000/svg" class="qaid-icon" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
20
+ <path stroke-linecap="round" stroke-linejoin="round" d="M20 6L9 17l-5-5"/>
21
+ </svg>`, Le = `<svg xmlns="http://www.w3.org/2000/svg" class="qaid-icon" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
22
+ <path stroke-linecap="round" stroke-linejoin="round" d="M12 6v8m0 4h.01"/>
23
+ </svg>`, He = `<svg xmlns="http://www.w3.org/2000/svg" class="qaid-icon" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
24
+ <path stroke-linecap="round" stroke-linejoin="round" d="M6 6l12 12M18 6L6 18"/>
25
+ </svg>`, Ht = "button{cursor:pointer}.qaid-buttons{display:flex;gap:.5rem}.qaid-buttons.qaid-vertical{flex-direction:column}.qaid-buttons.qaid-auto-container{position:fixed;z-index:50}.qaid-buttons.qaid-auto-container.qaid-bottom-right{bottom:1rem;right:1rem}.qaid-buttons.qaid-auto-container.qaid-bottom-left{bottom:1rem;left:1rem}.qaid-buttons.qaid-auto-container.qaid-top-right{top:1rem;right:1rem}.qaid-buttons.qaid-auto-container.qaid-top-left{top:1rem;left:1rem}.qaid-buttons.qaid-incognito{opacity:0;transition:opacity .2s ease-in-out}.qaid-buttons.qaid-incognito:hover{opacity:1}.qaid-buttons.qaid-dismissed{display:none!important}.qaid-dismiss-btn{width:20px;height:20px;padding:0;border:none;border-radius:50%;background:#0006;color:#fff;display:flex;align-items:center;justify-content:center;align-self:center;opacity:0;transition:opacity .15s,background .15s;cursor:pointer;pointer-events:auto;-webkit-appearance:none;appearance:none}.qaid-dismiss-btn:hover{background:#0009}.qaid-buttons:hover .qaid-dismiss-btn{opacity:1}button.qaid-btn-structural{display:inline-flex;align-items:center;justify-content:center;cursor:pointer;-webkit-appearance:none;appearance:none}.qaid-icon{width:24px;height:24px}:where(button.qaid-btn-structural)>svg:where(:not(.qaid-icon):not([width])){width:var(--qaid-icon-size, 24px);height:var(--qaid-icon-size, 24px)}.qaid-btn-structural:not(:has(svg)),.qaid-btn:not(:has(svg)){font-size:var(--qaid-icon-size, 24px);line-height:1}.qaid-emoji-icon{font-size:var(--qaid-icon-size, 24px);line-height:1}.qaid-buttons,.qaid-buttons *,.qaid-modal-container,.qaid-modal-container *{cursor:pointer!important}.qaid-tooltip-wrapper{position:relative}.qaid-tooltip-text{position:fixed;padding:.5rem .75rem;background:#1f2937;color:#fff;font-size:var(--qaid-font-size, 16px);font-weight:600;border-radius:.5rem;white-space:nowrap;opacity:0;pointer-events:none;transition:opacity .15s;z-index:99999}.qaid-tooltip-text.qaid-tooltip-visible{opacity:1}.qaid-targeting-overlay{position:fixed;inset:0;z-index:40;pointer-events:none}.qaid-capture-layer{position:fixed;inset:0;pointer-events:none;z-index:9999}@keyframes qaid-slideDown{0%{transform:translateY(-100%)}to{transform:translateY(0)}}.qaid-vignette{position:fixed;inset:0;pointer-events:none;background:radial-gradient(ellipse at center,transparent 30%,rgba(0,0,0,.3) 70%,rgba(0,0,0,.6) 100%);z-index:41}.qaid-crosshair-h,.qaid-crosshair-v{position:fixed;pointer-events:none;z-index:42}.qaid-crosshair-h{left:0;right:0;height:1px;background:color-mix(in srgb,var(--qaid-negative) 60%,transparent)}.qaid-crosshair-v{top:0;bottom:0;width:1px;background:color-mix(in srgb,var(--qaid-negative) 60%,transparent)}.qaid-type-up .qaid-crosshair-h,.qaid-type-up .qaid-crosshair-v{background:color-mix(in srgb,var(--qaid-positive) 60%,transparent)}.qaid-highlight-box{position:fixed;top:0;left:0;pointer-events:none;z-index:41;display:none;border:3px solid color-mix(in srgb,var(--qaid-negative) 80%,transparent);border-radius:2px;background:color-mix(in srgb,var(--qaid-negative) 8%,transparent);will-change:transform,width,height}.qaid-type-up .qaid-highlight-box{border-color:color-mix(in srgb,var(--qaid-positive) 80%,transparent);background:color-mix(in srgb,var(--qaid-positive) 8%,transparent)}.qaid-scope{position:fixed;width:80px;height:80px;pointer-events:none;z-index:43;transform:translate(-50%,-50%)}.qaid-scope-ring{position:absolute;inset:10px;border:2px solid color-mix(in srgb,var(--qaid-negative) 80%,transparent);border-radius:50%}.qaid-type-up .qaid-scope-ring{border-color:color-mix(in srgb,var(--qaid-positive) 80%,transparent)}.qaid-scope-ring-inner{position:absolute;inset:20px;border:1px solid color-mix(in srgb,var(--qaid-negative) 50%,transparent);border-radius:50%}.qaid-type-up .qaid-scope-ring-inner{border-color:color-mix(in srgb,var(--qaid-positive) 50%,transparent)}.qaid-scope-dot{position:absolute;top:50%;left:50%;width:4px;height:4px;background:var(--qaid-negative);border-radius:50%;transform:translate(-50%,-50%)}.qaid-type-up .qaid-scope-dot{background:var(--qaid-positive)}.qaid-selected-marker{position:fixed;border:3px solid var(--qaid-marker, #6365f1);border-radius:50%;pointer-events:none;z-index:44;animation:qaid-markerPulse 1.5s ease-in-out infinite}@keyframes qaid-markerPulse{0%,to{opacity:1;transform:scale(1)}50%{opacity:.7;transform:scale(1.05)}}.qaid-backdrop{position:fixed;inset:0;z-index:45;background:#0000004d}.qaid-modal-container{position:fixed;z-index:50;display:flex;flex-direction:column;align-items:flex-start;max-height:calc(100vh - 32px);font-family:var(--qaid-font-family, system-ui, -apple-system, sans-serif);font-size:var(--qaid-font-size, 16px)}.qaid-modal-container.qaid-above{flex-direction:column-reverse}.qaid-modal-arrow{width:0;height:0;border-left:12px solid transparent;border-right:12px solid transparent;position:relative;align-self:flex-start}.qaid-modal-container.qaid-below .qaid-modal-arrow{border-bottom:12px solid light-dark(#ffffff,#1f2937)}.qaid-modal-container.qaid-above .qaid-modal-arrow{border-top:12px solid light-dark(#ffffff,#1f2937)}.qaid-modal-box{color-scheme:inherit;background:light-dark(#ffffff,#1f2937);border-radius:1rem;padding:1.5rem;box-shadow:0 25px 50px -12px light-dark(rgba(0,0,0,.25),rgba(0,0,0,.5));width:var(--qaid-modal-width, 400px);max-width:calc(100vw - 32px);max-height:calc(100vh - 60px);overflow-y:auto}.qaid-modal-header{display:flex;align-items:flex-start;gap:.75rem;margin-bottom:1rem}button.qaid-type-toggle{border:none;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:all .2s;flex-shrink:0;-webkit-appearance:none;appearance:none}button.qaid-type-toggle:hover{transform:scale(1.1)}button.qaid-type-toggle:not(.qaid-type-toggle-custom){width:2.5rem;height:2.5rem;border-radius:50%}button.qaid-type-toggle:not(.qaid-type-toggle-custom) svg{width:1.25rem;height:1.25rem}button.qaid-type-toggle.qaid-type-up{background:var(--qaid-positive);color:#fff}button.qaid-type-toggle.qaid-type-down{background:var(--qaid-negative);color:#fff}.qaid-type-static{width:2.5rem;height:2.5rem;border-radius:50%;display:flex;align-items:center;justify-content:center;flex-shrink:0;background:var(--qaid-marker, #6365f1);color:var(--qaid-marker-text, white)}.qaid-type-static svg{width:1.25rem;height:1.25rem}.qaid-modal-header-text{flex:1;min-width:0}.qaid-modal-title{font-size:calc(var(--qaid-font-size, 16px) * 1.125);font-weight:700;margin:0 0 .25rem;color:light-dark(#1f2937,#f9fafb)}.qaid-modal-subtitle{color:light-dark(#6b7280,#9ca3af);margin:0;font-size:calc(var(--qaid-font-size, 16px) * .875)}.qaid-textarea{width:100%;height:6rem;padding:.75rem;border:1px solid light-dark(#d1d5db,#374151);border-radius:.5rem;font-family:inherit;font-size:var(--qaid-font-size, 16px);resize:vertical;margin-bottom:1rem;box-sizing:border-box;background:light-dark(#ffffff,#111827);color:light-dark(#1f2937,#f9fafb)}.qaid-textarea:focus{outline:none;border-color:var(--qaid-marker);box-shadow:0 0 0 3px color-mix(in srgb,var(--qaid-marker) 20%,transparent)}.qaid-btn-row{display:flex;gap:.5rem;justify-content:flex-end}button.qaid-btn-submit{padding:.5rem 1rem;background:var(--qaid-marker);color:var(--qaid-marker-text, white);border:none;border-radius:.5rem;font-size:calc(var(--qaid-font-size, 16px) * .875);font-weight:500;cursor:pointer;transition:background-color .2s,filter .2s;-webkit-appearance:none;appearance:none}button.qaid-btn-submit:hover{filter:brightness(.85)}button.qaid-btn-submit:focus{outline:none;box-shadow:0 0 0 3px color-mix(in srgb,var(--qaid-marker) 30%,transparent)}.qaid-bottom-sheet{position:fixed;bottom:0;left:0;right:0;z-index:50;animation:qaid-slideUpSheet .3s ease-out;font-family:var(--qaid-font-family, system-ui, -apple-system, sans-serif);font-size:var(--qaid-font-size, 16px)}.qaid-bottom-sheet-content{background:light-dark(#ffffff,#1f2937);border-radius:1rem 1rem 0 0;padding:1.5rem;padding-bottom:max(1.5rem,env(safe-area-inset-bottom))}.qaid-bottom-sheet-handle{width:36px;height:4px;background:light-dark(rgba(0,0,0,.2),rgba(255,255,255,.2));border-radius:2px;margin:0 auto 1rem}@keyframes qaid-slideUpSheet{0%{transform:translateY(100%)}to{transform:translateY(0)}}button.qaid-btn-record:hover{background:#dc2626;color:#fff}.qaid-recording-indicator{position:fixed;pointer-events:auto;top:12px;left:50%;transform:translate(-50%);display:flex;align-items:center;gap:.5rem;padding:.5rem 1rem;background:light-dark(#1f2937,#374151);color:#fff;border-radius:9999px;font-family:var(--qaid-font-family, system-ui, -apple-system, sans-serif);font-size:calc(var(--qaid-font-size, 16px) * .875);font-weight:500;box-shadow:0 4px 12px #0000004d;z-index:99999;animation:qaid-slideDown .2s ease-out}.qaid-recording-dot{width:10px;height:10px;background:#dc2626;border-radius:50%;animation:qaid-dotPulse 1.5s ease-in-out infinite}@keyframes qaid-dotPulse{0%,to{opacity:1}50%{opacity:.3}}.qaid-recording-time{font-variant-numeric:tabular-nums;min-width:2.5rem;text-align:center}button.qaid-recording-stop{padding:.25rem .75rem;background:#dc2626;color:#fff;border:none;border-radius:9999px;font-size:calc(var(--qaid-font-size, 16px) * .75);font-weight:600;cursor:pointer;transition:background-color .2s;-webkit-appearance:none;appearance:none}button.qaid-recording-stop:hover{background:#b91c1c}.qaid-video-preview{position:fixed;inset:0 0 auto;height:100vh;height:100dvh;display:flex;align-items:center;justify-content:center;padding:16px;padding-top:max(16px,env(safe-area-inset-top));padding-bottom:max(16px,env(safe-area-inset-bottom));box-sizing:border-box;background:#0009;z-index:99998;animation:qaid-fadeIn .2s ease-out}@keyframes qaid-fadeIn{0%{opacity:0}to{opacity:1}}.qaid-video-preview-box{color-scheme:inherit;background:light-dark(#ffffff,#1f2937);border-radius:1rem;padding:1.5rem;box-shadow:0 25px 50px -12px #00000080;width:560px;max-width:100%;max-height:100%;overflow-y:auto;font-family:var(--qaid-font-family, system-ui, -apple-system, sans-serif);font-size:var(--qaid-font-size, 16px)}.qaid-video-preview-box h3{font-size:calc(var(--qaid-font-size, 16px) * 1.125);font-weight:700;margin:0 0 1rem;color:light-dark(#1f2937,#f9fafb)}.qaid-video-preview-box video{width:100%;max-height:50vh;max-height:50dvh;object-fit:contain;border-radius:.5rem;background:#000;margin-bottom:1rem}.qaid-video-preview-box textarea{width:100%;height:4rem;padding:.75rem;border:1px solid light-dark(#d1d5db,#374151);border-radius:.5rem;font-family:inherit;font-size:calc(var(--qaid-font-size, 16px) * .875);resize:vertical;margin-bottom:1rem;box-sizing:border-box;background:light-dark(#ffffff,#111827);color:light-dark(#1f2937,#f9fafb)}.qaid-video-preview-box textarea:focus{outline:none;border-color:var(--qaid-marker);box-shadow:0 0 0 3px color-mix(in srgb,var(--qaid-marker) 20%,transparent)}.qaid-video-error{margin:0 0 .75rem;font-size:calc(var(--qaid-font-size, 16px) * .875);font-weight:500;color:light-dark(#b91c1c,#fca5a5)}.qaid-video-preview-actions{display:flex;gap:.5rem;justify-content:flex-end}button.qaid-video-btn{padding:.5rem 1rem;border:none;border-radius:.5rem;font-size:calc(var(--qaid-font-size, 16px) * .875);font-weight:500;cursor:pointer;transition:background-color .2s,filter .2s;-webkit-appearance:none;appearance:none}button.qaid-video-btn-cancel{background:light-dark(#f3f4f6,#374151);color:light-dark(#374151,#d1d5db)}button.qaid-video-btn-cancel:hover{background:light-dark(#e5e7eb,#4b5563)}button.qaid-video-btn-rerecord{background:light-dark(#fef3c7,#78350f);color:light-dark(#92400e,#fde68a)}button.qaid-video-btn-rerecord:hover{filter:brightness(.9)}button.qaid-video-btn-send{background:var(--qaid-marker);color:var(--qaid-marker-text, white)}button.qaid-video-btn-send:hover{filter:brightness(.85)}button.qaid-video-btn-send:disabled{opacity:.5;cursor:not-allowed}.qaid-video-sending{display:flex;align-items:center;gap:.5rem;font-size:calc(var(--qaid-font-size, 16px) * .875);color:light-dark(#6b7280,#9ca3af)}.qaid-annotate{position:fixed;inset:0;z-index:2147483000;display:flex;flex-direction:column;gap:.75rem;padding:16px;padding-top:max(16px,env(safe-area-inset-top));padding-bottom:max(16px,env(safe-area-inset-bottom));box-sizing:border-box;background:#000000d9;font-family:var(--qaid-font-family, system-ui, -apple-system, sans-serif);font-size:var(--qaid-font-size, 16px);animation:qaid-fadeIn .2s ease-out}.qaid-annotate-title{margin:0;font-size:var(--qaid-font-size, 16px);font-weight:700;text-align:center;color:#f9fafb}.qaid-annotate-desc{margin:0;font-size:calc(var(--qaid-font-size, 16px) * .8125);line-height:1.4;text-align:center;color:#f9fafbbf}.qaid-annotate-stage{flex:1 1 auto;min-height:0;display:flex;align-items:center;justify-content:center;overflow:auto}.qaid-annotate-canvas{max-width:100%;max-height:100%;object-fit:contain;background:light-dark(#ffffff,#111827);border-radius:.5rem;box-shadow:0 10px 30px #00000080;touch-action:none;cursor:crosshair}.qaid-annotate-toolbar{display:flex;flex-wrap:wrap;gap:.75rem;align-items:center;justify-content:center;padding:.5rem .75rem;background:light-dark(#ffffff,#1f2937);border-radius:.75rem;box-shadow:0 10px 30px light-dark(rgba(0,0,0,.25),rgba(0,0,0,.5))}.qaid-annotate-tools,.qaid-annotate-actions{display:flex;gap:.375rem;align-items:center}button.qaid-annotate-tool,button.qaid-annotate-action{display:inline-flex;align-items:center;justify-content:center;gap:.375rem;min-width:44px;min-height:44px;padding:0 .75rem;border:1px solid light-dark(#d1d5db,#374151);border-radius:.5rem;background:light-dark(#f9fafb,#111827);color:light-dark(#1f2937,#f9fafb);font-family:inherit;font-size:calc(var(--qaid-font-size, 16px) * .8125);font-weight:600;cursor:pointer;-webkit-appearance:none;appearance:none;transition:background-color .15s,color .15s,border-color .15s,filter .15s}button.qaid-annotate-tool svg,button.qaid-annotate-action svg{width:20px;height:20px}.qaid-annotate-colors{display:flex;gap:.25rem;align-items:center}button.qaid-annotate-swatch{width:28px;height:28px;min-width:28px;padding:0;border-radius:9999px;border:2px solid light-dark(#d1d5db,#4b5563);background:var(--qaid-swatch, #000);cursor:pointer;-webkit-appearance:none;appearance:none;transition:transform .1s,box-shadow .15s,border-color .15s}button.qaid-annotate-swatch:hover{transform:scale(1.12)}button.qaid-annotate-swatch[aria-pressed=true]{border-color:light-dark(#111827,#f9fafb);box-shadow:0 0 0 2px var(--qaid-swatch)}@media(forced-colors:active){button.qaid-annotate-swatch[aria-pressed=true]{outline:2px solid Highlight;outline-offset:1px}}button.qaid-annotate-tool:hover,button.qaid-annotate-action:hover{background:light-dark(#eef2ff,#312e81)}button.qaid-annotate-tool[aria-pressed=true],button.qaid-annotate-done{background:var(--qaid-marker, #6365f1);color:var(--qaid-marker-text, #fff);border-color:var(--qaid-marker, #6365f1)}button.qaid-annotate-done:hover{filter:brightness(.9);background:var(--qaid-marker, #6365f1)}button.qaid-annotate-action:disabled{opacity:.45;cursor:not-allowed}@media(forced-colors:active){button.qaid-annotate-tool[aria-pressed=true],button.qaid-annotate-done{border:2px solid Highlight}.qaid-annotate-canvas{border:1px solid CanvasText}}button:focus-visible,textarea:focus-visible,a:focus-visible,[tabindex]:focus-visible,[role=button]:focus-visible{outline:2px solid var(--qaid-marker, #6365f1);outline-offset:2px}.qaid-textarea:focus-visible,button.qaid-btn-submit:focus-visible,.qaid-video-preview-box textarea:focus-visible{outline:2px solid var(--qaid-marker, #6365f1);outline-offset:2px}.qaid-buttons.qaid-incognito:focus-within{opacity:1}.qaid-buttons:focus-within .qaid-dismiss-btn,.qaid-dismiss-btn:focus-visible{opacity:1}.qaid-dismiss-btn{min-width:24px;min-height:24px}button.qaid-recording-stop{min-height:24px}@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}@media(forced-colors:active){button:focus-visible,textarea:focus-visible,a:focus-visible,[tabindex]:focus-visible,[role=button]:focus-visible,.qaid-textarea:focus,button.qaid-btn-submit:focus,.qaid-video-preview-box textarea:focus{outline:2px solid CanvasText;outline-offset:2px}.qaid-selected-marker,.qaid-highlight-box{border-color:Highlight}}.qaid-confirm{display:flex;flex-direction:column;align-items:center;text-align:center;gap:.5rem;padding:.5rem 0}.qaid-confirm-icon{display:flex;align-items:center;justify-content:center;width:44px;height:44px;border-radius:9999px;color:#fff;background:var(--qaid-success, #22c55e);margin-bottom:.25rem;animation:qaid-confirm-pop .28s cubic-bezier(.34,1.56,.64,1)}.qaid-confirm-icon .qaid-icon{width:24px;height:24px}.qaid-confirm-error .qaid-confirm-icon{background:var(--qaid-error, #dc2626)}.qaid-confirm-title{margin:0;font-size:var(--qaid-font-size, 16px);font-weight:600;color:var(--qaid-text, light-dark(#111827, #f9fafb))}.qaid-confirm-title:focus-visible{outline:2px solid var(--qaid-primary, #6365f1);outline-offset:3px;border-radius:4px}.qaid-confirm-message{margin:0;font-size:calc(var(--qaid-font-size, 16px) * .875);color:var(--qaid-text-muted, light-dark(#6b7280, #9ca3af))}.qaid-confirm .qaid-confirm-close{margin-top:.5rem;min-width:96px}@keyframes qaid-confirm-pop{0%{transform:scale(.6);opacity:0}to{transform:scale(1);opacity:1}}@media(prefers-reduced-motion:reduce){.qaid-confirm-icon{animation:none}}", Bt = "body.qaid-targeting,body.qaid-targeting *{cursor:none!important}";
3
26
  let b = 0;
4
- const Lt = "button.qaid-btn{width:var(--qaid-btn-size);height:var(--qaid-btn-size);border-radius:50%;border:none;background:#f3f4f6;color:#374151;display:flex;align-items:center;justify-content:center;cursor:pointer;box-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -1px rgba(0,0,0,.06);transition:background-color .2s,color .2s,transform .2s;-webkit-appearance:none;appearance:none;--qaid-hover-up-bg:var(--qaid-positive);--qaid-hover-up-color:#fff;--qaid-hover-down-bg:var(--qaid-negative);--qaid-hover-down-color:#fff}button.qaid-btn:hover{transform:scale(1.05)}button.qaid-btn-up:hover{background:var(--qaid-hover-up-bg);color:var(--qaid-hover-up-color)}button.qaid-btn-down:hover{background:var(--qaid-hover-down-bg);color:var(--qaid-hover-down-color)}button.qaid-btn-feedback:hover{background:var(--qaid-marker,#6365f1);color:var(--qaid-marker-text,#fff)}button.qaid-btn svg{width:var(--qaid-icon-size);height:var(--qaid-icon-size)}", Mt = {
27
+ const Ot = "button.qaid-btn{width:var(--qaid-btn-size);height:var(--qaid-btn-size);border-radius:50%;border:none;background:#f3f4f6;color:#374151;display:flex;align-items:center;justify-content:center;cursor:pointer;box-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -1px rgba(0,0,0,.06);transition:background-color .2s,color .2s,transform .2s;-webkit-appearance:none;appearance:none;--qaid-hover-up-bg:var(--qaid-positive);--qaid-hover-up-color:#fff;--qaid-hover-down-bg:var(--qaid-negative);--qaid-hover-down-color:#fff}button.qaid-btn:hover{transform:scale(1.05)}button.qaid-btn-up:hover{background:var(--qaid-hover-up-bg);color:var(--qaid-hover-up-color)}button.qaid-btn-down:hover{background:var(--qaid-hover-down-bg);color:var(--qaid-hover-down-color)}button.qaid-btn-feedback:hover{background:var(--qaid-marker,#6365f1);color:var(--qaid-marker-text,#fff)}button.qaid-btn svg{width:var(--qaid-icon-size);height:var(--qaid-icon-size)}", Pt = {
5
28
  small: 36,
6
29
  medium: 48,
7
30
  large: 64
8
- }, Bt = {
31
+ }, Rt = {
9
32
  small: 18,
10
33
  medium: 24,
11
34
  large: 32
12
35
  };
13
- function Ot(e, t, i) {
14
- const [o, r, n] = [e, t, i].map((a) => (a = a / 255, a <= 0.03928 ? a / 12.92 : Math.pow((a + 0.055) / 1.055, 2.4)));
15
- return 0.2126 * o + 0.7152 * r + 0.0722 * n;
36
+ function Nt(e, t, i) {
37
+ const [o, a, n] = [e, t, i].map((r) => (r = r / 255, r <= 0.03928 ? r / 12.92 : Math.pow((r + 0.055) / 1.055, 2.4)));
38
+ return 0.2126 * o + 0.7152 * a + 0.0722 * n;
16
39
  }
17
- function Rt(e) {
40
+ function Ut(e) {
18
41
  if (e.startsWith("#")) {
19
- const i = e.slice(1), o = i.length === 3 ? i.split("").map((n) => n + n).join("") : i, r = parseInt(o, 16);
42
+ const i = e.slice(1), o = i.length === 3 ? i.split("").map((n) => n + n).join("") : i, a = parseInt(o, 16);
20
43
  return {
21
- r: r >> 16 & 255,
22
- g: r >> 8 & 255,
23
- b: r & 255
44
+ r: a >> 16 & 255,
45
+ g: a >> 8 & 255,
46
+ b: a & 255
24
47
  };
25
48
  }
26
49
  const t = e.match(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/);
@@ -30,21 +53,21 @@ function Rt(e) {
30
53
  b: parseInt(t[3])
31
54
  } : null;
32
55
  }
33
- function Pt(e) {
34
- const t = Rt(e);
35
- return t && Ot(t.r, t.g, t.b) > 0.4 ? "black" : "white";
56
+ function Ft(e) {
57
+ const t = Ut(e);
58
+ return t && Nt(t.r, t.g, t.b) > 0.4 ? "black" : "white";
36
59
  }
37
- function Ft(e = {}) {
60
+ function _t(e = {}) {
38
61
  const {
39
62
  positiveColor: t = "rgb(0, 200, 83)",
40
63
  negativeColor: i = "rgb(255, 0, 0)",
41
64
  markerColor: o = "#6365f1",
42
- buttonSize: r = "medium",
65
+ buttonSize: a = "medium",
43
66
  modalWidth: n = 400,
44
- backdropOpacity: a = 0.3,
67
+ backdropOpacity: r = 0.3,
45
68
  fontFamily: l = "system-ui, -apple-system, sans-serif",
46
69
  fontSize: c = 16
47
- } = e, d = Mt[r], s = Bt[r], u = Pt(o);
70
+ } = e, d = Pt[a], s = Rt[a], u = Ft(o);
48
71
  return {
49
72
  "--qaid-positive": t,
50
73
  "--qaid-negative": i,
@@ -53,27 +76,27 @@ function Ft(e = {}) {
53
76
  "--qaid-btn-size": `${d}px`,
54
77
  "--qaid-icon-size": `${s}px`,
55
78
  "--qaid-modal-width": `${n}px`,
56
- "--qaid-backdrop-opacity": String(a),
79
+ "--qaid-backdrop-opacity": String(r),
57
80
  "--qaid-font-family": l,
58
81
  "--qaid-font-size": `${c}px`
59
82
  };
60
83
  }
61
- function Ut(e, t) {
84
+ function Vt(e, t) {
62
85
  for (const [i, o] of Object.entries(t))
63
86
  e.style.setProperty(i, o);
64
87
  }
65
- function Q() {
66
- return Dt + Lt;
88
+ function Y() {
89
+ return Ht + Ot;
67
90
  }
68
- function Vt() {
91
+ function jt() {
69
92
  if (b++, b > 1) return;
70
93
  const e = document.createElement("style");
71
- e.id = "qaid-styles", e.textContent = Ht, document.head.appendChild(e);
94
+ e.id = "qaid-styles", e.textContent = Bt, document.head.appendChild(e);
72
95
  }
73
- function _t() {
96
+ function $t() {
74
97
  b <= 0 || (b--, b === 0 && document.getElementById("qaid-styles")?.remove());
75
98
  }
76
- const W = "data-qaid-a11y-live", $t = "position:absolute;width:1px;height:1px;margin:-1px;padding:0;border:0;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap;", Kt = [
99
+ const X = "data-qaid-a11y-live", Kt = "position:absolute;width:1px;height:1px;margin:-1px;padding:0;border:0;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap;", Qt = [
77
100
  "a[href]",
78
101
  "button",
79
102
  "input",
@@ -81,25 +104,25 @@ const W = "data-qaid-a11y-live", $t = "position:absolute;width:1px;height:1px;ma
81
104
  "select",
82
105
  "[tabindex]"
83
106
  ].join(",");
84
- function Nt(e) {
107
+ function Wt(e) {
85
108
  return e.ownerDocument || document;
86
109
  }
87
- function jt(e, t) {
110
+ function Yt(e, t) {
88
111
  const i = t ? "assertive" : "polite", o = e.querySelector(
89
- `[${W}="${i}"]`
112
+ `[${X}="${i}"]`
90
113
  );
91
114
  if (o) return o;
92
- const n = Nt(e).createElement("div");
93
- return n.setAttribute(W, i), n.setAttribute("role", t ? "alert" : "status"), n.setAttribute("aria-live", t ? "assertive" : "polite"), n.setAttribute("aria-atomic", "true"), n.style.cssText = $t, e.appendChild(n), n;
115
+ const n = Wt(e).createElement("div");
116
+ return n.setAttribute(X, i), n.setAttribute("role", t ? "alert" : "status"), n.setAttribute("aria-live", t ? "assertive" : "polite"), n.setAttribute("aria-atomic", "true"), n.style.cssText = Kt, e.appendChild(n), n;
94
117
  }
95
- function Qt(e, t, i = {}) {
96
- const o = jt(e, !!i.assertive);
118
+ function Xt(e, t, i = {}) {
119
+ const o = Yt(e, !!i.assertive);
97
120
  o.textContent = "", o.textContent = t;
98
121
  }
99
- function Wt(e) {
122
+ function Jt(e) {
100
123
  return e.hasAttribute("disabled") ? !0 : e.disabled === !0;
101
124
  }
102
- function Yt(e) {
125
+ function Gt(e) {
103
126
  let t = e;
104
127
  for (; t; ) {
105
128
  if (t.hasAttribute("hidden")) return !0;
@@ -110,52 +133,52 @@ function Yt(e) {
110
133
  }
111
134
  return !1;
112
135
  }
113
- function Y(e) {
136
+ function J(e) {
114
137
  return Array.from(
115
- e.querySelectorAll(Kt)
116
- ).filter((i) => !(i.getAttribute("tabindex") === "-1" || i instanceof HTMLInputElement && i.type === "hidden" || i instanceof HTMLAnchorElement && !i.getAttribute("href") || Wt(i) || Yt(i)));
138
+ e.querySelectorAll(Qt)
139
+ ).filter((i) => !(i.getAttribute("tabindex") === "-1" || i instanceof HTMLInputElement && i.type === "hidden" || i instanceof HTMLAnchorElement && !i.getAttribute("href") || Jt(i) || Gt(i)));
117
140
  }
118
- function tt(e) {
141
+ function it(e) {
119
142
  let t = e.activeElement;
120
143
  for (; t && t.shadowRoot && t.shadowRoot.activeElement; )
121
144
  t = t.shadowRoot.activeElement;
122
145
  return t instanceof HTMLElement ? t : null;
123
146
  }
124
- function Xt(e) {
147
+ function Zt(e) {
125
148
  const t = e.ownerDocument || document;
126
149
  let i = !1;
127
150
  const o = (n) => {
128
151
  if (n.key !== "Tab") return;
129
- const a = Y(e);
130
- if (a.length === 0) {
152
+ const r = J(e);
153
+ if (r.length === 0) {
131
154
  n.preventDefault(), e.focus();
132
155
  return;
133
156
  }
134
- const l = a[0], c = a[a.length - 1], d = tt(t), s = d ? a.indexOf(d) !== -1 : !1;
157
+ const l = r[0], c = r[r.length - 1], d = it(t), s = d ? r.indexOf(d) !== -1 : !1;
135
158
  n.shiftKey ? (!s || d === l) && (n.preventDefault(), c.focus()) : (!s || d === c) && (n.preventDefault(), l.focus());
136
159
  };
137
160
  e.addEventListener("keydown", o);
138
- const r = Y(e);
139
- return r.length > 0 ? r[0].focus() : (e.hasAttribute("tabindex") || (e.setAttribute("tabindex", "-1"), i = !0), e.focus()), {
161
+ const a = J(e);
162
+ return a.length > 0 ? a[0].focus() : (e.hasAttribute("tabindex") || (e.setAttribute("tabindex", "-1"), i = !0), e.focus()), {
140
163
  release() {
141
164
  e.removeEventListener("keydown", o), i && (e.removeAttribute("tabindex"), i = !1);
142
165
  }
143
166
  };
144
167
  }
145
- function Jt() {
146
- return tt(document);
168
+ function te() {
169
+ return it(document);
147
170
  }
148
- function Gt(e) {
171
+ function ee(e) {
149
172
  if (!(!e || typeof e.focus != "function"))
150
173
  try {
151
174
  e.focus();
152
175
  } catch {
153
176
  }
154
177
  }
155
- function Zt(e, t = {}) {
178
+ function ie(e, t = {}) {
156
179
  e.setAttribute("role", "dialog"), e.setAttribute("aria-modal", "true"), t.labelledbyId && e.setAttribute("aria-labelledby", t.labelledbyId), t.describedbyId && e.setAttribute("aria-describedby", t.describedbyId), t.label && e.setAttribute("aria-label", t.label);
157
180
  }
158
- function te(e, t) {
181
+ function oe(e, t) {
159
182
  let i = e;
160
183
  for (; i && i !== t; ) {
161
184
  const o = i.parentNode;
@@ -169,32 +192,32 @@ function te(e, t) {
169
192
  }
170
193
  return null;
171
194
  }
172
- function ee(e) {
195
+ function ne(e) {
173
196
  const i = (e.ownerDocument || document).body;
174
197
  if (!i) return () => {
175
198
  };
176
- const o = te(e, i), r = [];
199
+ const o = oe(e, i), a = [];
177
200
  return Array.from(i.children).forEach((n) => {
178
201
  if (!(n instanceof HTMLElement) || o && n === o) return;
179
- const a = n.inert === !0, l = n.getAttribute("aria-hidden");
180
- a && l === "true" || (n.inert = !0, n.setAttribute("aria-hidden", "true"), r.push({ el: n, prevInert: a, prevAriaHidden: l }));
202
+ const r = n.inert === !0, l = n.getAttribute("aria-hidden");
203
+ r && l === "true" || (n.inert = !0, n.setAttribute("aria-hidden", "true"), a.push({ el: n, prevInert: r, prevAriaHidden: l }));
181
204
  }), function() {
182
- for (; r.length; ) {
183
- const a = r.pop();
184
- a.el.inert = a.prevInert, a.prevAriaHidden === null ? a.el.removeAttribute("aria-hidden") : a.el.setAttribute("aria-hidden", a.prevAriaHidden);
205
+ for (; a.length; ) {
206
+ const r = a.pop();
207
+ r.el.inert = r.prevInert, r.prevAriaHidden === null ? r.el.removeAttribute("aria-hidden") : r.el.setAttribute("aria-hidden", r.prevAriaHidden);
185
208
  }
186
209
  };
187
210
  }
188
- const et = {
211
+ const ot = {
189
212
  width: 400,
190
213
  height: 280,
191
214
  arrowHeight: 12,
192
215
  gap: 8,
193
216
  viewportPadding: 16
194
217
  };
195
- function ie(e, t, i, o, r) {
196
- const n = e.y, a = t - (e.y + e.height);
197
- if (a >= i + o)
218
+ function ae(e, t, i, o, a) {
219
+ const n = e.y, r = t - (e.y + e.height);
220
+ if (r >= i + o)
198
221
  return {
199
222
  top: e.y + e.height + o,
200
223
  position: "below"
@@ -204,29 +227,29 @@ function ie(e, t, i, o, r) {
204
227
  top: e.y - i - o,
205
228
  position: "above"
206
229
  };
207
- const l = a > n ? "below" : "above";
230
+ const l = r > n ? "below" : "above";
208
231
  let c;
209
232
  return l === "below" ? c = Math.min(
210
233
  e.y + e.height + o,
211
- t - i - r
212
- ) : c = Math.max(r, e.y - i - o), { top: c, position: l };
234
+ t - i - a
235
+ ) : c = Math.max(a, e.y - i - o), { top: c, position: l };
213
236
  }
214
- function oe(e, t, i, o) {
237
+ function re(e, t, i, o) {
215
238
  let n = e.x + e.width / 2 - i / 2;
216
239
  return n = Math.max(o, Math.min(n, t - i - o)), n;
217
240
  }
218
- function ae(e, t, i, o = 24, r = 24) {
219
- const a = e.clickX - t - r / 2;
220
- return Math.max(o, Math.min(a, i - o - r / 2));
241
+ function se(e, t, i, o = 24, a = 24) {
242
+ const r = e.clickX - t - a / 2;
243
+ return Math.max(o, Math.min(r, i - o - a / 2));
221
244
  }
222
- function ne(e, t, i, o = et) {
223
- const r = o.height + o.arrowHeight, n = ie(
245
+ function de(e, t, i, o = ot) {
246
+ const a = o.height + o.arrowHeight, n = ae(
224
247
  e,
225
248
  i,
226
- r,
249
+ a,
227
250
  o.gap,
228
251
  o.viewportPadding
229
- ), a = oe(
252
+ ), r = re(
230
253
  e,
231
254
  t,
232
255
  o.width,
@@ -234,52 +257,80 @@ function ne(e, t, i, o = et) {
234
257
  );
235
258
  return {
236
259
  top: n.top,
237
- left: a,
260
+ left: r,
238
261
  position: n.position
239
262
  };
240
263
  }
241
- function re(e, t, i, o = {}) {
242
- const r = o.gap ?? 8;
243
- let n = e.bottom + r;
244
- n + t.height > i.height - r && (n = e.top - t.height - r);
245
- let a = e.left;
246
- return a < r ? a = r : a + t.width > i.width - r && (a = i.width - t.width - r), n < r ? n = r : n + t.height > i.height - r && (n = i.height - t.height - r), { top: n, left: a };
264
+ function le(e, t, i, o = {}) {
265
+ const a = o.gap ?? 8;
266
+ let n = e.bottom + a;
267
+ n + t.height > i.height - a && (n = e.top - t.height - a);
268
+ let r = e.left;
269
+ return r < a ? r = a : r + t.width > i.width - a && (r = i.width - t.width - a), n < a ? n = a : n + t.height > i.height - a && (n = i.height - t.height - a), { top: n, left: r };
247
270
  }
248
- function Ce(e, t, i, o = et) {
249
- const r = ne(e, t, i, o), n = ae(
271
+ function Be(e, t, i, o = ot) {
272
+ const a = de(e, t, i, o), n = se(
250
273
  e,
251
- r.left,
274
+ a.left,
252
275
  o.width
253
276
  );
254
277
  return {
255
- modal: r,
278
+ modal: a,
256
279
  arrow: { left: n }
257
280
  };
258
281
  }
259
- const se = 20;
260
- function de(e) {
261
- const t = [], i = console.error, o = console.warn, r = console.log, n = (a, l) => {
282
+ const ce = 20;
283
+ function ue(e) {
284
+ const t = [], i = console.error, o = console.warn, a = console.log, n = (r, l) => {
262
285
  const c = {
263
286
  message: l.map((d) => String(d)).join(" "),
264
287
  timestamp: Date.now(),
265
- level: a
288
+ level: r
266
289
  };
267
- t.length >= se && t.shift(), t.push(c), e && e(c);
290
+ t.length >= ce && t.shift(), t.push(c), e && e(c);
268
291
  };
269
- return console.error = function(...a) {
270
- n("error", a), i.apply(console, a);
271
- }, console.warn = function(...a) {
272
- n("warn", a), o.apply(console, a);
273
- }, console.log = function(...a) {
274
- n("log", a), r.apply(console, a);
292
+ return console.error = function(...r) {
293
+ n("error", r), i.apply(console, r);
294
+ }, console.warn = function(...r) {
295
+ n("warn", r), o.apply(console, r);
296
+ }, console.log = function(...r) {
297
+ n("log", r), a.apply(console, r);
275
298
  }, {
276
299
  errors: t,
277
300
  restore: () => {
278
- console.error = i, console.warn = o, console.log = r;
301
+ console.error = i, console.warn = o, console.log = a;
279
302
  }
280
303
  };
281
304
  }
282
- const le = "https://unpkg.com/@qaiddev/quests-embed@1/dist/qaid-quests.js", ce = (e) => (
305
+ function Oe(e, t, i) {
306
+ const o = document.createElement(e);
307
+ if (t)
308
+ for (const [a, n] of Object.entries(t))
309
+ a === "className" ? o.className = n : o.setAttribute(a, n);
310
+ return o;
311
+ }
312
+ function he(e = 640) {
313
+ return typeof window < "u" && window.innerWidth < e;
314
+ }
315
+ function Pe(e, t, i) {
316
+ const o = i.map((n) => n.style.visibility);
317
+ i.forEach((n) => n.style.visibility = "hidden");
318
+ const a = document.elementFromPoint(e, t);
319
+ return i.forEach((n, r) => n.style.visibility = o[r]), a;
320
+ }
321
+ function Re(e) {
322
+ return e ? e.hasAttribute("data-qaid-embed") || e.hasAttribute("data-qaid-embed-overlay") ? !0 : !!e.closest("[data-qaid-embed], [data-qaid-embed-overlay]") : !1;
323
+ }
324
+ function Ne(e, t = 0) {
325
+ const i = e.getBoundingClientRect();
326
+ return {
327
+ x: i.left - t,
328
+ y: i.top - t,
329
+ width: i.width + t * 2,
330
+ height: i.height + t * 2
331
+ };
332
+ }
333
+ const fe = "https://unpkg.com/@qaiddev/quests-embed@1/dist/qaid-quests.js", pe = (e) => (
283
334
  // The URL is a runtime value, not a static specifier — keep Vite from
284
335
  // trying to analyze/bundle it.
285
336
  import(
@@ -287,9 +338,25 @@ const le = "https://unpkg.com/@qaiddev/quests-embed@1/dist/qaid-quests.js", ce =
287
338
  e
288
339
  )
289
340
  );
290
- let ue = ce, p = null, k = null;
291
- function he(e) {
292
- return p && k === e || (k = e, p = Promise.resolve(ue(e)).then((t) => {
341
+ let be = pe, p = null, k = null;
342
+ const A = /* @__PURE__ */ new Map(), C = /* @__PURE__ */ new Map();
343
+ function nt(e, t) {
344
+ return `${e.replace(/\/+$/, "")}/${encodeURIComponent(t)}/definition`;
345
+ }
346
+ function me(e) {
347
+ if (A.has(e)) return Promise.resolve();
348
+ const t = C.get(e);
349
+ if (t) return t;
350
+ const i = fetch(e, { headers: { Accept: "application/json" } }).then((o) => o.ok ? o.json() : null).then((o) => {
351
+ o && A.set(e, o);
352
+ }).catch(() => {
353
+ }).finally(() => {
354
+ C.delete(e);
355
+ });
356
+ return C.set(e, i), i;
357
+ }
358
+ function at(e) {
359
+ return p && k === e || (k = e, p = Promise.resolve(be(e)).then((t) => {
293
360
  const i = t;
294
361
  if (!i || typeof i.QaidQuests != "function")
295
362
  throw new Error("quests module has no QaidQuests export");
@@ -298,17 +365,23 @@ function he(e) {
298
365
  throw p = null, k = null, t;
299
366
  })), p;
300
367
  }
301
- async function fe(e) {
302
- const t = await he(e.moduleUrl), i = e.base.replace(/\/+$/, ""), o = e.feedbackId != null ? { feedbackId: e.feedbackId } : void 0;
303
- return new t.QaidQuests({
368
+ async function ge(e) {
369
+ const t = await at(e.moduleUrl), i = e.base.replace(/\/+$/, ""), o = nt(i, e.questId), a = (l) => l != null ? { feedbackId: l } : void 0;
370
+ let n;
371
+ const r = e.feedbackId;
372
+ return r instanceof Promise ? n = t.QaidQuests.supports?.asyncMetadata ? r.then(a, () => {
373
+ }) : a(await r.catch(() => null)) : n = a(r ?? null), new t.QaidQuests({
304
374
  endpoint: `${i}/responses`,
305
- configUrl: `${i}/${encodeURIComponent(e.questId)}/definition`,
375
+ configUrl: o,
376
+ // Only a definition already in hand. One still loading is left to the
377
+ // widget, which shows its own loading state instead of nothing.
378
+ questionnaire: A.get(o),
306
379
  apiKey: e.apiKey || void 0,
307
- metadata: o,
380
+ metadata: n,
308
381
  onClose: e.onClose
309
382
  });
310
383
  }
311
- const X = "qaid_visitor_id", J = "qaid_hide_feedback", pe = [
384
+ const G = "qaid_visitor_id", Z = "qaid_hide_feedback", ve = [
312
385
  "#ef4444",
313
386
  "#f59e0b",
314
387
  "#22c55e",
@@ -316,26 +389,26 @@ const X = "qaid_visitor_id", J = "qaid_hide_feedback", pe = [
316
389
  "#111827",
317
390
  "#ffffff"
318
391
  ];
319
- function be() {
392
+ function ye() {
320
393
  return typeof window.matchMedia == "function" && window.matchMedia("(pointer: coarse)").matches;
321
394
  }
322
395
  function S(e) {
323
- return e ? `${J}_${e}` : J;
396
+ return e ? `${Z}_${e}` : Z;
324
397
  }
325
- function me(e) {
398
+ function we(e) {
326
399
  try {
327
400
  return localStorage.getItem(S(e)) === "1";
328
401
  } catch {
329
402
  return !1;
330
403
  }
331
404
  }
332
- function G(e, t = !0) {
405
+ function tt(e, t = !0) {
333
406
  try {
334
407
  t ? localStorage.setItem(S(e), "1") : localStorage.removeItem(S(e));
335
408
  } catch {
336
409
  }
337
410
  }
338
- function Z() {
411
+ function et() {
339
412
  const e = typeof crypto < "u" ? crypto : void 0;
340
413
  if (e && typeof e.randomUUID == "function") return e.randomUUID();
341
414
  const t = new Uint8Array(16);
@@ -347,15 +420,15 @@ function Z() {
347
420
  const i = Array.from(t, (o) => o.toString(16).padStart(2, "0")).join("");
348
421
  return `${i.slice(0, 8)}-${i.slice(8, 12)}-${i.slice(12, 16)}-${i.slice(16, 20)}-${i.slice(20)}`;
349
422
  }
350
- function ge() {
423
+ function qe() {
351
424
  try {
352
- let e = localStorage.getItem(X);
353
- return e || (e = Z(), localStorage.setItem(X, e)), e;
425
+ let e = localStorage.getItem(G);
426
+ return e || (e = et(), localStorage.setItem(G, e)), e;
354
427
  } catch {
355
- return Z();
428
+ return et();
356
429
  }
357
430
  }
358
- class ve {
431
+ class xe {
359
432
  config;
360
433
  state = "IDLE";
361
434
  feedbackData = {
@@ -373,7 +446,13 @@ class ve {
373
446
  clickY: 0,
374
447
  visible: !1
375
448
  };
376
- feedbackId = null;
449
+ /**
450
+ * This feedback's record id, once its POST answers (null if it failed).
451
+ * The message box and a linked quest open without waiting for it; the
452
+ * PATCHes that need the id wait on this instead.
453
+ */
454
+ feedbackIdPromise = Promise.resolve(null);
455
+ questsPrewarmed = !1;
377
456
  // A quest launched from a button (in place of the message box), if any.
378
457
  activeQuest = null;
379
458
  isMobile = !1;
@@ -473,7 +552,7 @@ class ve {
473
552
  captureScreenshot: t.captureScreenshot ?? !1,
474
553
  annotate: t.annotate ?? !0,
475
554
  annotationColor: t.annotationColor ?? t.colors?.marker ?? "#6365f1",
476
- annotationPalette: t.annotationPalette ?? pe,
555
+ annotationPalette: t.annotationPalette ?? ve,
477
556
  screenshotMethod: t.screenshotMethod ?? "permission",
478
557
  screenshotOptions: {
479
558
  quality: t.screenshotOptions?.quality ?? 0.8,
@@ -500,12 +579,12 @@ class ve {
500
579
  video: t.quests?.video ?? "",
501
580
  // Quest service reuses the feedback API key unless overridden.
502
581
  apiKey: t.quests?.apiKey ?? t.apiKey ?? "",
503
- moduleUrl: t.quests?.moduleUrl ?? le
582
+ moduleUrl: t.quests?.moduleUrl ?? fe
504
583
  }
505
- }, this.boundKeyDown = this.handleKeyDown.bind(this), this.boundResize = this.handleResize.bind(this), this.visitorId = ge(), this.init();
584
+ }, this.boundKeyDown = this.handleKeyDown.bind(this), this.boundResize = this.handleResize.bind(this), this.visitorId = qe(), this.init();
506
585
  }
507
586
  applyVars(t) {
508
- Ut(t, this.cssVars);
587
+ Vt(t, this.cssVars);
509
588
  }
510
589
  /**
511
590
  * Announce a message via the shared visually-hidden live regions.
@@ -515,7 +594,7 @@ class ve {
515
594
  */
516
595
  announceMsg(t, i = !1) {
517
596
  const o = this.overlayShadowRoot ?? this.shadowRoot;
518
- o && Qt(o, t, { assertive: i });
597
+ o && Xt(o, t, { assertive: i });
519
598
  }
520
599
  /**
521
600
  * Turn a transient surface into an accessible modal dialog: save the
@@ -523,16 +602,16 @@ class ve {
523
602
  * background. Paired with closeDialogA11y() on every close path.
524
603
  */
525
604
  openDialogA11y(t, i) {
526
- this.dialogTrigger = Jt(), Zt(t, i), this.dialogTrap = Xt(t), this.dialogRestoreInert = ee(t);
605
+ this.dialogTrigger = te(), ie(t, i), this.dialogTrap = Zt(t), this.dialogRestoreInert = ne(t);
527
606
  }
528
607
  closeDialogA11y() {
529
- this.dialogTrap?.release(), this.dialogTrap = null, this.dialogRestoreInert && (this.dialogRestoreInert(), this.dialogRestoreInert = null), Gt(this.dialogTrigger), this.dialogTrigger = null;
608
+ this.dialogTrap?.release(), this.dialogTrap = null, this.dialogRestoreInert && (this.dialogRestoreInert(), this.dialogRestoreInert = null), ee(this.dialogTrigger), this.dialogTrigger = null;
530
609
  }
531
610
  clearActiveThumb() {
532
611
  this.activeThumbBtn && (this.activeThumbBtn.setAttribute("aria-pressed", "false"), this.activeThumbBtn = null);
533
612
  }
534
613
  init() {
535
- Vt(), this.cssVars = Ft({
614
+ jt(), this.cssVars = _t({
536
615
  positiveColor: this.config.colors.positive,
537
616
  negativeColor: this.config.colors.negative,
538
617
  markerColor: this.config.colors.marker,
@@ -541,10 +620,10 @@ class ve {
541
620
  backdropOpacity: this.config.backdropOpacity,
542
621
  fontFamily: this.config.fontFamily,
543
622
  fontSize: this.config.fontSize
544
- }), !this.config.hideDismiss && me(this.config.apiKey) && (this._startDismissed = !0), this.checkMobile(), window.addEventListener("resize", this.boundResize), this.createEmbed(), this.consoleCapture = de((t) => {
623
+ }), !this.config.hideDismiss && we(this.config.apiKey) && (this._startDismissed = !0), this.checkMobile(), window.addEventListener("resize", this.boundResize), this.createEmbed(), this.consoleCapture = ue((t) => {
545
624
  this.feedbackData.consoleErrors = this.consoleCapture?.errors ?? [];
546
- }), this.feedbackData.consoleErrors = this.consoleCapture.errors, this.observeDom(), (this.config.captureVideo && this.videoSupported() || this.config.captureScreenshot) && this.schedulePrewarm(() => {
547
- this.config.captureVideo && this.videoSupported() && this.prewarmVideo(), this.config.captureScreenshot && this.prewarmScreenshot();
625
+ }), this.feedbackData.consoleErrors = this.consoleCapture.errors, this.observeDom(), (this.config.captureVideo && this.videoSupported() || this.config.captureScreenshot || this.linkedQuestIds().length > 0) && this.schedulePrewarm(() => {
626
+ this.config.captureVideo && this.videoSupported() && this.prewarmVideo(), this.config.captureScreenshot && this.prewarmScreenshot(), this.prewarmQuests();
548
627
  });
549
628
  }
550
629
  /**
@@ -554,15 +633,35 @@ class ve {
554
633
  * swallowed — a failed preload just falls back to an on-demand load.
555
634
  */
556
635
  prewarmVideo() {
557
- this.videoPrewarmed || (this.videoPrewarmed = !0, import("./recording-CcfOfIC7.js").catch(() => {
636
+ this.videoPrewarmed || (this.videoPrewarmed = !0, import("./recording-DNngIGr2.js").catch(() => {
558
637
  }), import("./video-Bd_29-rK.js").catch(() => {
559
638
  }));
560
639
  }
561
640
  prewarmScreenshot() {
562
641
  this.screenshotPrewarmed || (this.screenshotPrewarmed = !0, (this.shouldCaptureViaDom() ? import("./screenshot-dom-CME7tYRE.js") : import("./screenshot-DYOKg2bS.js")).catch(() => {
563
- }), this.config.annotate && import("./annotate-D-o8xCV9.js").then((t) => t.d).catch(() => {
642
+ }), this.config.annotate && import("./annotate-BTLeFQa0.js").catch(() => {
564
643
  }));
565
644
  }
645
+ /** Quest ids linked to any button, when quest launching is on. */
646
+ linkedQuestIds() {
647
+ const t = this.config.quests;
648
+ return t.base ? [t.up, t.down, t.video].filter((i) => i) : [];
649
+ }
650
+ /**
651
+ * Load the quests module and fetch every linked quest's definition, so a
652
+ * click opens the quest with no network wait. Both are best-effort: a miss
653
+ * just means the quest loads on click, as it always did.
654
+ */
655
+ prewarmQuests() {
656
+ if (this.questsPrewarmed) return;
657
+ const t = this.linkedQuestIds();
658
+ if (t.length !== 0) {
659
+ this.questsPrewarmed = !0, at(this.config.quests.moduleUrl).catch(() => {
660
+ });
661
+ for (const i of t)
662
+ me(nt(this.config.quests.base, i));
663
+ }
664
+ }
566
665
  /** Run fn when the main thread is idle; cancelled by destroy(). */
567
666
  schedulePrewarm(t) {
568
667
  const i = window, o = () => {
@@ -589,7 +688,7 @@ class ve {
589
688
  }), this.domObserver.observe(document.body, { childList: !0 });
590
689
  }
591
690
  checkMobile() {
592
- this.isMobile = At();
691
+ this.isMobile = he();
593
692
  }
594
693
  handleResize() {
595
694
  this.checkMobile();
@@ -599,7 +698,7 @@ class ve {
599
698
  let t = null;
600
699
  this.config.container && (t = document.querySelector(this.config.container)), t ? (t.appendChild(this.shadowHost), this.isUserProvidedContainer = !0, this.config.hideDismiss = !0) : (this.shadowHost.style.position = "fixed", this.shadowHost.style.display = "block", this.shadowHost.style.inset = "0", this.shadowHost.style.pointerEvents = "none", this.shadowHost.style.zIndex = String(this.config.zIndex), document.body.appendChild(this.shadowHost)), this.shadowRoot = this.shadowHost.attachShadow({ mode: "open" });
601
700
  const i = document.createElement("style");
602
- if (i.textContent = Q(), this.shadowRoot.appendChild(i), this.config.css) {
701
+ if (i.textContent = Y(), this.shadowRoot.appendChild(i), this.config.css) {
603
702
  const d = document.createElement("style");
604
703
  d.textContent = this.config.css, this.shadowRoot.appendChild(d);
605
704
  }
@@ -618,33 +717,33 @@ class ve {
618
717
  }), this.buttonsContainer.addEventListener("pointerdown", () => {
619
718
  this.keyboardActivation = !1;
620
719
  });
621
- const r = !!this.config.buttonClass, n = r ? `qaid-btn-structural ${this.config.buttonClass}` : "qaid-btn", l = this.config.text.tooltip || "Feedback for us?", c = document.createElement("div");
720
+ const a = !!this.config.buttonClass, n = a ? `qaid-btn-structural ${this.config.buttonClass}` : "qaid-btn", l = this.config.text.tooltip || "Feedback for us?", c = document.createElement("div");
622
721
  if (c.className = "qaid-tooltip-text", c.textContent = l, this.applyVars(c), this.shadowRoot.appendChild(c), this.tooltipElement = c, this.config.singleButton) {
623
722
  const d = document.createElement("div");
624
723
  d.className = "qaid-tooltip-wrapper";
625
724
  const s = document.createElement("button");
626
- s.type = "button", s.className = r ? `${n} qaid-btn-feedback` : "qaid-btn qaid-btn-feedback", s.setAttribute("aria-label", this.config.text.feedbackLabel), s.innerHTML = this.config.feedbackIcon || Tt, s.addEventListener("click", (u) => this.handleThumbClick("neutral", u.currentTarget, u)), s.addEventListener("mouseenter", () => {
725
+ s.type = "button", s.className = a ? `${n} qaid-btn-feedback` : "qaid-btn qaid-btn-feedback", s.setAttribute("aria-label", this.config.text.feedbackLabel), s.innerHTML = this.config.feedbackIcon || Lt, s.addEventListener("click", (u) => this.handleThumbClick("neutral", u.currentTarget, u)), s.addEventListener("mouseenter", () => {
627
726
  this.prewarmTargeting(), this.showTooltip(s);
628
727
  }), s.addEventListener("mouseleave", () => this.hideTooltip()), d.appendChild(s), this.buttonsContainer.appendChild(d);
629
728
  } else if (!this.config.hideThumbs) {
630
729
  const d = document.createElement("div");
631
730
  d.className = "qaid-tooltip-wrapper";
632
731
  const s = document.createElement("button");
633
- s.type = "button", s.className = r ? `${n} qaid-btn-up` : "qaid-btn qaid-btn-up", s.setAttribute("aria-label", this.config.text.positiveLabel), s.innerHTML = this.config.positiveIcon || It, s.addEventListener("click", (f) => this.handleThumbClick("up", f.currentTarget, f)), s.addEventListener("mouseenter", () => {
634
- this.prewarmTargeting(), this.showTooltip(s);
732
+ s.type = "button", s.className = a ? `${n} qaid-btn-up` : "qaid-btn qaid-btn-up", s.setAttribute("aria-label", this.config.text.positiveLabel), s.innerHTML = this.config.positiveIcon || Dt, s.addEventListener("click", (f) => this.handleThumbClick("up", f.currentTarget, f)), s.addEventListener("mouseenter", () => {
733
+ this.prewarmTargeting(), this.prewarmQuests(), this.showTooltip(s);
635
734
  }), s.addEventListener("mouseleave", () => this.hideTooltip()), d.appendChild(s);
636
735
  const u = document.createElement("div");
637
736
  u.className = "qaid-tooltip-wrapper";
638
737
  const h = document.createElement("button");
639
- h.type = "button", h.className = r ? `${n} qaid-btn-down` : "qaid-btn qaid-btn-down", h.setAttribute("aria-label", this.config.text.negativeLabel), h.innerHTML = this.config.negativeIcon || Et, h.addEventListener("click", (f) => this.handleThumbClick("down", f.currentTarget, f)), h.addEventListener("mouseenter", () => {
640
- this.prewarmTargeting(), this.showTooltip(h);
738
+ h.type = "button", h.className = a ? `${n} qaid-btn-down` : "qaid-btn qaid-btn-down", h.setAttribute("aria-label", this.config.text.negativeLabel), h.innerHTML = this.config.negativeIcon || zt, h.addEventListener("click", (f) => this.handleThumbClick("down", f.currentTarget, f)), h.addEventListener("mouseenter", () => {
739
+ this.prewarmTargeting(), this.prewarmQuests(), this.showTooltip(h);
641
740
  }), h.addEventListener("mouseleave", () => this.hideTooltip()), u.appendChild(h), this.buttonsContainer.appendChild(d), this.buttonsContainer.appendChild(u);
642
741
  }
643
742
  if (this.config.captureVideo && this.videoSupported()) {
644
743
  const d = document.createElement("div");
645
744
  d.className = "qaid-tooltip-wrapper";
646
745
  const s = document.createElement("button");
647
- s.type = "button", s.className = r ? `${n} qaid-btn-record` : "qaid-btn qaid-btn-record", s.setAttribute("aria-label", this.config.text.recordLabel), s.innerHTML = this.config.recordIcon || zt, s.addEventListener("click", () => {
746
+ s.type = "button", s.className = a ? `${n} qaid-btn-record` : "qaid-btn qaid-btn-record", s.setAttribute("aria-label", this.config.text.recordLabel), s.innerHTML = this.config.recordIcon || Mt, s.addEventListener("click", () => {
648
747
  this.ensureRecording().then(
649
748
  (h) => this.config.videoOptions.redaction ? h.startPicking() : h.startRecording()
650
749
  );
@@ -668,7 +767,7 @@ class ve {
668
767
  if (this.overlayShadowRoot) return this.overlayShadowRoot;
669
768
  this.overlayShadowHost = document.createElement("div"), this.overlayShadowHost.setAttribute("data-qaid-embed-overlay", ""), this.overlayShadowHost.style.position = "fixed", this.overlayShadowHost.style.inset = "0", this.overlayShadowHost.style.pointerEvents = "none", this.overlayShadowHost.style.zIndex = String(this.config.zIndex), document.body.appendChild(this.overlayShadowHost), this.overlayShadowRoot = this.overlayShadowHost.attachShadow({ mode: "open" });
670
769
  const t = document.createElement("style");
671
- if (t.textContent = Q(), this.overlayShadowRoot.appendChild(t), this.config.css) {
770
+ if (t.textContent = Y(), this.overlayShadowRoot.appendChild(t), this.config.css) {
672
771
  const i = document.createElement("style");
673
772
  i.textContent = this.config.css, this.overlayShadowRoot.appendChild(i);
674
773
  }
@@ -678,27 +777,27 @@ class ve {
678
777
  showTooltip(t) {
679
778
  const i = this.tooltipElement;
680
779
  i.style.visibility = "hidden", i.classList.add("qaid-tooltip-visible");
681
- const o = t.getBoundingClientRect(), r = i.getBoundingClientRect(), { top: n, left: a } = re(
780
+ const o = t.getBoundingClientRect(), a = i.getBoundingClientRect(), { top: n, left: r } = le(
682
781
  o,
683
- r,
782
+ a,
684
783
  { width: window.innerWidth, height: window.innerHeight }
685
784
  );
686
- i.style.top = `${n}px`, i.style.left = `${a}px`, i.style.visibility = "visible";
785
+ i.style.top = `${n}px`, i.style.left = `${r}px`, i.style.visibility = "visible";
687
786
  }
688
787
  hideTooltip() {
689
788
  this.tooltipElement.classList.remove("qaid-tooltip-visible");
690
789
  }
691
790
  handleDismiss() {
692
- this.buttonsContainer.classList.add("qaid-dismissed"), G(this.config.apiKey, !0);
791
+ this.buttonsContainer.classList.add("qaid-dismissed"), tt(this.config.apiKey, !0);
693
792
  }
694
793
  handleThumbClick(t, i, o) {
695
- if (this.buttonsContainer?.classList.contains("qaid-incognito") && (this.buttonsContainer.classList.remove("qaid-incognito"), G(this.config.apiKey, !1)), this.prewarmModal(), this.config.skipTargeting || this.config.feedbackMode === "annotate")
794
+ if (this.buttonsContainer?.classList.contains("qaid-incognito") && (this.buttonsContainer.classList.remove("qaid-incognito"), tt(this.config.apiKey, !1)), this.prewarmModal(), this.config.skipTargeting || this.config.feedbackMode === "annotate")
696
795
  this.submitDirectFeedback(t, i);
697
796
  else {
698
797
  this.activeThumbBtn = i, i.setAttribute("aria-pressed", "true");
699
- const r = this.keyboardActivation;
798
+ const a = this.keyboardActivation;
700
799
  this.keyboardActivation = !1, this.ensureTargeting().then((n) => {
701
- this.destroyed || (r ? n.startKeyboard(t) : n.startPointer(t, o));
800
+ this.destroyed || (a ? n.startKeyboard(t) : n.startPointer(t, o));
702
801
  });
703
802
  }
704
803
  }
@@ -725,7 +824,7 @@ class ve {
725
824
  * instead of the permission-based Screen Capture API. Explicit "dom" wins;
726
825
  * otherwise DOM is used on touch devices to avoid the getDisplayMedia prompt. */
727
826
  shouldCaptureViaDom() {
728
- return this.config.screenshotMethod === "dom" || be();
827
+ return this.config.screenshotMethod === "dom" || ye();
729
828
  }
730
829
  /**
731
830
  * Open the full-screen annotation editor over the captured screenshot,
@@ -735,25 +834,25 @@ class ve {
735
834
  * enabled while the editor is open and restored on close.
736
835
  */
737
836
  async openAnnotationEditor(t) {
738
- const i = this.ensureOverlayHost(), o = this.overlayShadowHost, r = o.style.pointerEvents;
837
+ const i = this.ensureOverlayHost(), o = this.overlayShadowHost, a = o.style.pointerEvents;
739
838
  o.style.pointerEvents = "auto";
740
839
  try {
741
- const { openAnnotationEditor: n } = await import("./annotate-D-o8xCV9.js").then((a) => a.d);
840
+ const { openAnnotationEditor: n } = await import("./annotate-BTLeFQa0.js");
742
841
  return await n({
743
842
  dataUrl: t,
744
843
  root: i,
745
844
  quality: this.config.screenshotOptions.quality,
746
845
  color: this.config.annotationColor,
747
846
  palette: this.config.annotationPalette,
748
- applyVars: (a) => this.applyVars(a),
749
- announce: (a, l) => this.announceMsg(a, l),
750
- openDialog: (a, l) => this.openDialogA11y(a, l),
847
+ applyVars: (r) => this.applyVars(r),
848
+ announce: (r, l) => this.announceMsg(r, l),
849
+ openDialog: (r, l) => this.openDialogA11y(r, l),
751
850
  closeDialog: () => this.closeDialogA11y()
752
851
  });
753
852
  } catch (n) {
754
853
  return console.error("Annotation editor failed to open:", n), null;
755
854
  } finally {
756
- o.style.pointerEvents = r;
855
+ o.style.pointerEvents = a;
757
856
  }
758
857
  }
759
858
  async submitFeedback() {
@@ -761,15 +860,15 @@ class ve {
761
860
  if (this.config.captureScreenshot || this.config.feedbackMode === "annotate")
762
861
  try {
763
862
  if (this.shouldCaptureViaDom()) {
764
- const { captureDomScreenshot: a } = await import("./screenshot-dom-CME7tYRE.js");
765
- t = await a(this.config.screenshotOptions);
863
+ const { captureDomScreenshot: r } = await import("./screenshot-dom-CME7tYRE.js");
864
+ t = await r(this.config.screenshotOptions);
766
865
  } else {
767
- const { captureScreenshot: a } = await import("./screenshot-DYOKg2bS.js");
768
- t = await a(this.config.screenshotOptions);
866
+ const { captureScreenshot: r } = await import("./screenshot-DYOKg2bS.js");
867
+ t = await r(this.config.screenshotOptions);
769
868
  }
770
869
  t && this.announceMsg("Screenshot captured");
771
- } catch (a) {
772
- console.error("Screenshot capture failed:", a), t = null;
870
+ } catch (r) {
871
+ console.error("Screenshot capture failed:", r), t = null;
773
872
  }
774
873
  t && this.config.annotate && (t = await this.openAnnotationEditor(t) ?? t);
775
874
  const o = this.feedbackData.elementSelector ? {
@@ -777,7 +876,7 @@ class ve {
777
876
  y: this.selectedBounds.y,
778
877
  width: this.selectedBounds.width,
779
878
  height: this.selectedBounds.height
780
- } : null, r = {
879
+ } : null, a = {
781
880
  feedbackType: this.feedbackData.feedbackType,
782
881
  pageUrl: window.location.href,
783
882
  apiKey: this.config.apiKey || void 0,
@@ -796,32 +895,37 @@ class ve {
796
895
  elementBounds: o,
797
896
  userAgent: navigator.userAgent
798
897
  };
799
- try {
800
- const a = await fetch(this.config.endpoint, {
801
- method: "POST",
802
- headers: { "Content-Type": "application/json" },
803
- body: JSON.stringify(r)
804
- });
805
- if (a.ok) {
806
- const l = await a.json();
807
- this.feedbackId = l.id, this.announceMsg("Feedback sent");
808
- }
809
- } catch (a) {
810
- console.error("Failed to submit feedback:", a), this.announceMsg("Failed to send feedback", !0);
811
- }
898
+ this.feedbackIdPromise = this.postFeedback(a);
812
899
  const n = this.feedbackData.feedbackType;
813
- if (n && n !== "neutral" && await this.tryLaunchQuest(n, this.feedbackId)) {
900
+ if (n && n !== "neutral" && await this.tryLaunchQuest(n, this.feedbackIdPromise)) {
814
901
  this.resetFeedbackUi();
815
902
  return;
816
903
  }
817
904
  this.state = "MODAL_OPEN";
818
905
  try {
819
- const a = await this.ensureModal();
906
+ const r = await this.ensureModal();
820
907
  if (this.destroyed) return;
821
- a.open(), this.overlayShadowHost && (this.overlayShadowHost.style.pointerEvents = "auto");
822
- } catch (a) {
823
- console.error("Failed to open the feedback modal:", a), this.announceMsg("Thank you for your feedback!", !0), this.resetFeedbackUi();
908
+ r.open(), this.overlayShadowHost && (this.overlayShadowHost.style.pointerEvents = "auto");
909
+ } catch (r) {
910
+ console.error("Failed to open the feedback modal:", r), this.announceMsg("Thank you for your feedback!", !0), this.resetFeedbackUi();
911
+ }
912
+ }
913
+ /** POST the feedback. Resolves to the new record's id, or null if it failed. */
914
+ async postFeedback(t) {
915
+ try {
916
+ const i = await fetch(this.config.endpoint, {
917
+ method: "POST",
918
+ headers: { "Content-Type": "application/json" },
919
+ body: JSON.stringify(t)
920
+ });
921
+ if (i.ok) {
922
+ const o = await i.json();
923
+ return this.announceMsg("Feedback sent"), o.id;
924
+ }
925
+ } catch (i) {
926
+ console.error("Failed to submit feedback:", i), this.announceMsg("Failed to send feedback", !0);
824
927
  }
928
+ return null;
825
929
  }
826
930
  /**
827
931
  * Quest id linked to `type`, or "" when quest launching is disabled
@@ -842,7 +946,7 @@ class ve {
842
946
  const o = this.questIdFor(t);
843
947
  if (!o) return !1;
844
948
  try {
845
- return this.activeQuest?.destroy(), this.activeQuest = await fe({
949
+ return this.activeQuest?.destroy(), this.activeQuest = await ge({
846
950
  questId: o,
847
951
  base: this.config.quests.base,
848
952
  apiKey: this.config.quests.apiKey || void 0,
@@ -852,8 +956,8 @@ class ve {
852
956
  this.activeQuest = null;
853
957
  }
854
958
  }), !0;
855
- } catch (r) {
856
- return console.error("Failed to launch quest:", r), this.activeQuest = null, !1;
959
+ } catch (a) {
960
+ return console.error("Failed to launch quest:", a), this.activeQuest = null, !1;
857
961
  }
858
962
  }
859
963
  /**
@@ -862,7 +966,7 @@ class ve {
862
966
  * path (which bypasses the modal entirely).
863
967
  */
864
968
  resetFeedbackUi() {
865
- this.targeting?.hideMarker(), this.overlayShadowHost && (this.overlayShadowHost.style.pointerEvents = "none"), this.state = "IDLE", this.feedbackId = null, this.feedbackData.feedbackType = null, this.feedbackData.elementSelector = null, this.feedbackData.elementText = null, this.selectedBounds.visible = !1;
969
+ this.targeting?.hideMarker(), this.overlayShadowHost && (this.overlayShadowHost.style.pointerEvents = "none"), this.state = "IDLE", this.feedbackIdPromise = Promise.resolve(null), this.feedbackData.feedbackType = null, this.feedbackData.elementSelector = null, this.feedbackData.elementText = null, this.selectedBounds.visible = !1;
866
970
  }
867
971
  /**
868
972
  * Lazily load and instantiate the modal controller. The message modal lives
@@ -871,7 +975,7 @@ class ve {
871
975
  */
872
976
  async ensureModal() {
873
977
  if (!this.modal) {
874
- const { ModalController: t } = await import("./modal-CEfcaIQR.js");
978
+ const { ModalController: t } = await import("./modal-zwBhxWO0.js");
875
979
  this.modal = new t(this.makeModalHost());
876
980
  }
877
981
  return this.modal;
@@ -901,12 +1005,7 @@ class ve {
901
1005
  get selectedBounds() {
902
1006
  return t.selectedBounds;
903
1007
  },
904
- get feedbackId() {
905
- return t.feedbackId;
906
- },
907
- setFeedbackId: (i) => {
908
- t.feedbackId = i;
909
- },
1008
+ whenFeedbackId: () => t.feedbackIdPromise,
910
1009
  ensureOverlayHost: () => t.ensureOverlayHost(),
911
1010
  applyVars: (i) => t.applyVars(i),
912
1011
  announceMsg: (i, o) => t.announceMsg(i, o),
@@ -917,7 +1016,7 @@ class ve {
917
1016
  }
918
1017
  /** Warm the modal chunk while the user is targeting, so it opens instantly. */
919
1018
  prewarmModal() {
920
- this.modalPrewarmed || (this.modalPrewarmed = !0, import("./modal-CEfcaIQR.js").catch(() => {
1019
+ this.modalPrewarmed || (this.modalPrewarmed = !0, import("./modal-zwBhxWO0.js").catch(() => {
921
1020
  }));
922
1021
  }
923
1022
  /**
@@ -927,7 +1026,7 @@ class ve {
927
1026
  */
928
1027
  async ensureTargeting() {
929
1028
  if (!this.targeting) {
930
- const { TargetingController: t } = await import("./targeting-Dz6z1BYl.js");
1029
+ const { TargetingController: t } = await import("./targeting-DaBmGVk5.js");
931
1030
  this.targeting = new t(this.makeTargetingHost());
932
1031
  }
933
1032
  return this.targeting;
@@ -972,7 +1071,7 @@ class ve {
972
1071
  }
973
1072
  /** Warm the targeting chunk on thumb-button hover, before the click. */
974
1073
  prewarmTargeting() {
975
- this.targetingPrewarmed || this.config.skipTargeting || (this.targetingPrewarmed = !0, import("./targeting-Dz6z1BYl.js").catch(() => {
1074
+ this.targetingPrewarmed || this.config.skipTargeting || (this.targetingPrewarmed = !0, import("./targeting-DaBmGVk5.js").catch(() => {
976
1075
  }));
977
1076
  }
978
1077
  // ==================== Video Recording ====================
@@ -991,7 +1090,7 @@ class ve {
991
1090
  */
992
1091
  async ensureRecording() {
993
1092
  if (!this.recording) {
994
- const { RecordingController: t } = await import("./recording-CcfOfIC7.js");
1093
+ const { RecordingController: t } = await import("./recording-DNngIGr2.js");
995
1094
  this.recording = new t(this.makeRecordingHost());
996
1095
  }
997
1096
  return this.recording;
@@ -1047,13 +1146,13 @@ class ve {
1047
1146
  const t = window;
1048
1147
  this.prewarmIsTimeout ? clearTimeout(this.prewarmHandle) : t.cancelIdleCallback?.(this.prewarmHandle), this.prewarmHandle = null;
1049
1148
  }
1050
- this.recording?.destroy(), this.recording = null, this.modal?.destroy(), this.modal = null, this.activeQuest?.destroy(), this.activeQuest = null, this.consoleCapture && (this.consoleCapture.restore(), this.consoleCapture = null), window.removeEventListener("resize", this.boundResize), document.removeEventListener("keydown", this.boundKeyDown), document.body.classList.remove("qaid-targeting", "qaid-type-up"), document.body.style.removeProperty("--qaid-positive"), document.body.style.removeProperty("--qaid-negative"), this.shadowHost && (this.shadowHost.remove(), this.shadowHost = null, this.shadowRoot = null), this.overlayShadowHost && (this.overlayShadowHost.remove(), this.overlayShadowHost = null, this.overlayShadowRoot = null), this.buttonsContainer = null, this.dismissBtn = null, this.tooltipElement = null, _t();
1149
+ this.recording?.destroy(), this.recording = null, this.modal?.destroy(), this.modal = null, this.activeQuest?.destroy(), this.activeQuest = null, this.consoleCapture && (this.consoleCapture.restore(), this.consoleCapture = null), window.removeEventListener("resize", this.boundResize), document.removeEventListener("keydown", this.boundKeyDown), document.body.classList.remove("qaid-targeting", "qaid-type-up"), document.body.style.removeProperty("--qaid-positive"), document.body.style.removeProperty("--qaid-negative"), this.shadowHost && (this.shadowHost.remove(), this.shadowHost = null, this.shadowRoot = null), this.overlayShadowHost && (this.overlayShadowHost.remove(), this.overlayShadowHost = null, this.overlayShadowRoot = null), this.buttonsContainer = null, this.dismissBtn = null, this.tooltipElement = null, $t();
1051
1150
  }
1052
1151
  }
1053
- function it(e) {
1152
+ function rt(e) {
1054
1153
  return document.querySelector(e)?.textContent?.trim() ?? "";
1055
1154
  }
1056
- function ye() {
1155
+ function ke() {
1057
1156
  const e = document.querySelector(
1058
1157
  'script[type="application/json"][data-feedback-config]'
1059
1158
  );
@@ -1062,22 +1161,22 @@ function ye() {
1062
1161
  if (!t) return null;
1063
1162
  try {
1064
1163
  const i = JSON.parse(t);
1065
- return i.cssSelector && !i.css && (i.css = it(i.cssSelector), delete i.cssSelector), i;
1164
+ return i.cssSelector && !i.css && (i.css = rt(i.cssSelector), delete i.cssSelector), i;
1066
1165
  } catch {
1067
1166
  return null;
1068
1167
  }
1069
1168
  }
1070
- function ot(e, t, i) {
1169
+ function st(e, t, i) {
1071
1170
  console.warn(`[thumbs-embed] Ignoring ${e}="${t}": expected ${i}.`);
1072
1171
  }
1073
- function qe(e) {
1172
+ function Ce(e) {
1074
1173
  const t = [];
1075
1174
  let i = 0, o = "";
1076
- for (const r of e)
1077
- r === "(" && i++, r === ")" && (i = Math.max(0, i - 1)), r === "," && i === 0 ? (t.push(o.trim()), o = "") : o += r;
1175
+ for (const a of e)
1176
+ a === "(" && i++, a === ")" && (i = Math.max(0, i - 1)), a === "," && i === 0 ? (t.push(o.trim()), o = "") : o += a;
1078
1177
  return t.push(o.trim()), t;
1079
1178
  }
1080
- function xe(e, t) {
1179
+ function Ae(e, t) {
1081
1180
  if (t === null) return;
1082
1181
  const i = t.trim();
1083
1182
  let o = null;
@@ -1088,46 +1187,46 @@ function xe(e, t) {
1088
1187
  o = null;
1089
1188
  }
1090
1189
  else
1091
- o = qe(i);
1092
- if (Array.isArray(o) && o.length > 0 && o.every((r) => typeof r == "string" && r.trim() !== ""))
1093
- return o.map((r) => r.trim());
1094
- ot(e, t, "a JSON array of colours or a comma-separated list");
1190
+ o = Ce(i);
1191
+ if (Array.isArray(o) && o.length > 0 && o.every((a) => typeof a == "string" && a.trim() !== ""))
1192
+ return o.map((a) => a.trim());
1193
+ st(e, t, "a JSON array of colours or a comma-separated list");
1095
1194
  }
1096
1195
  function m(e, t) {
1097
1196
  if (t !== null) {
1098
1197
  if (t.trim() === "") {
1099
- ot(e, t, "a non-empty label");
1198
+ st(e, t, "a non-empty label");
1100
1199
  return;
1101
1200
  }
1102
1201
  return t;
1103
1202
  }
1104
1203
  }
1105
- function we(e) {
1204
+ function Se(e) {
1106
1205
  const t = e.getAttribute("data-endpoint");
1107
1206
  if (!t) return null;
1108
- const i = e.getAttribute("data-position"), o = e.getAttribute("data-zindex"), r = e.getAttribute("data-positive-color"), n = e.getAttribute("data-negative-color"), a = e.getAttribute("data-marker-color"), l = e.getAttribute("data-container"), c = e.getAttribute("data-button-class"), d = e.getAttribute("data-skip-targeting"), s = e.getAttribute("data-hide-confirmation"), u = e.getAttribute("data-single-button"), h = e.getAttribute("data-feedback-mode"), f = e.getAttribute("data-incognito"), at = e.getAttribute("data-button-size"), g = e.getAttribute("data-offset-x"), v = e.getAttribute("data-offset-y"), C = e.getAttribute("data-modal-width"), A = e.getAttribute("data-backdrop-opacity"), nt = e.getAttribute("data-font-family"), T = e.getAttribute("data-font-size"), I = e.getAttribute("data-tooltip"), E = e.getAttribute("data-modal-title"), z = e.getAttribute("data-confirmation-title"), D = e.getAttribute("data-confirmation-message"), H = e.getAttribute("data-confirmation-close"), L = e.getAttribute("data-error-title"), M = e.getAttribute("data-error-message"), B = e.getAttribute("data-modal-subtitle"), O = e.getAttribute("data-placeholder"), R = e.getAttribute("data-submit-button"), P = e.getAttribute("data-skip-button"), rt = e.getAttribute("data-positive-icon"), st = e.getAttribute("data-negative-icon"), dt = e.getAttribute("data-feedback-icon"), F = e.getAttribute("data-feedback-label"), lt = e.getAttribute("data-api-key"), ct = e.getAttribute("data-capture-screenshot"), ut = e.getAttribute("data-annotate"), ht = e.getAttribute("data-annotation-color"), y = e.getAttribute("data-screenshot-quality"), q = e.getAttribute("data-screenshot-max-width"), x = e.getAttribute("data-screenshot-max-height"), ft = e.getAttribute("data-capture-video"), U = e.getAttribute("data-video-redaction"), pt = e.getAttribute("data-hide-thumbs"), bt = e.getAttribute("data-hide-dismiss"), w = e.getAttribute("data-video-max-duration"), mt = e.getAttribute("data-screenshot-method"), gt = e.getAttribute("data-direction"), V = e.getAttribute("data-css-selector"), vt = e.getAttribute("data-css"), _ = m("data-positive-label", e.getAttribute("data-positive-label")), $ = m("data-negative-label", e.getAttribute("data-negative-label")), K = m("data-record-label", e.getAttribute("data-record-label")), N = m("data-dismiss-label", e.getAttribute("data-dismiss-label")), yt = xe(
1207
+ const i = e.getAttribute("data-position"), o = e.getAttribute("data-zindex"), a = e.getAttribute("data-positive-color"), n = e.getAttribute("data-negative-color"), r = e.getAttribute("data-marker-color"), l = e.getAttribute("data-container"), c = e.getAttribute("data-button-class"), d = e.getAttribute("data-skip-targeting"), s = e.getAttribute("data-hide-confirmation"), u = e.getAttribute("data-single-button"), h = e.getAttribute("data-feedback-mode"), f = e.getAttribute("data-incognito"), dt = e.getAttribute("data-button-size"), g = e.getAttribute("data-offset-x"), v = e.getAttribute("data-offset-y"), T = e.getAttribute("data-modal-width"), E = e.getAttribute("data-backdrop-opacity"), lt = e.getAttribute("data-font-family"), I = e.getAttribute("data-font-size"), D = e.getAttribute("data-tooltip"), z = e.getAttribute("data-modal-title"), M = e.getAttribute("data-confirmation-title"), L = e.getAttribute("data-confirmation-message"), H = e.getAttribute("data-confirmation-close"), B = e.getAttribute("data-error-title"), O = e.getAttribute("data-error-message"), P = e.getAttribute("data-modal-subtitle"), R = e.getAttribute("data-placeholder"), N = e.getAttribute("data-submit-button"), U = e.getAttribute("data-skip-button"), ct = e.getAttribute("data-positive-icon"), ut = e.getAttribute("data-negative-icon"), ht = e.getAttribute("data-feedback-icon"), F = e.getAttribute("data-feedback-label"), ft = e.getAttribute("data-api-key"), pt = e.getAttribute("data-capture-screenshot"), bt = e.getAttribute("data-annotate"), mt = e.getAttribute("data-annotation-color"), y = e.getAttribute("data-screenshot-quality"), w = e.getAttribute("data-screenshot-max-width"), q = e.getAttribute("data-screenshot-max-height"), gt = e.getAttribute("data-capture-video"), _ = e.getAttribute("data-video-redaction"), vt = e.getAttribute("data-hide-thumbs"), yt = e.getAttribute("data-hide-dismiss"), x = e.getAttribute("data-video-max-duration"), wt = e.getAttribute("data-screenshot-method"), qt = e.getAttribute("data-direction"), V = e.getAttribute("data-css-selector"), xt = e.getAttribute("data-css"), j = m("data-positive-label", e.getAttribute("data-positive-label")), $ = m("data-negative-label", e.getAttribute("data-negative-label")), K = m("data-record-label", e.getAttribute("data-record-label")), Q = m("data-dismiss-label", e.getAttribute("data-dismiss-label")), kt = Ae(
1109
1208
  "data-annotation-palette",
1110
1209
  e.getAttribute("data-annotation-palette")
1111
- ), qt = e.getAttribute("data-record-icon"), j = e.getAttribute("data-quest-base"), xt = e.getAttribute("data-quest-up"), wt = e.getAttribute("data-quest-down"), kt = e.getAttribute("data-quest-video"), St = e.getAttribute("data-quest-api-key"), Ct = e.getAttribute("data-quest-module-url");
1210
+ ), Ct = e.getAttribute("data-record-icon"), W = e.getAttribute("data-quest-base"), At = e.getAttribute("data-quest-up"), St = e.getAttribute("data-quest-down"), Tt = e.getAttribute("data-quest-video"), Et = e.getAttribute("data-quest-api-key"), It = e.getAttribute("data-quest-module-url");
1112
1211
  return {
1113
1212
  endpoint: t,
1114
1213
  // Inline CSS wins over a selector, as `css` wins over `cssSelector` in
1115
1214
  // the JSON block.
1116
- css: vt || (V ? it(V) : void 0),
1117
- apiKey: lt ?? void 0,
1118
- captureScreenshot: ct === "true" ? !0 : void 0,
1215
+ css: xt || (V ? rt(V) : void 0),
1216
+ apiKey: ft ?? void 0,
1217
+ captureScreenshot: pt === "true" ? !0 : void 0,
1119
1218
  // Annotation is on by default; only an explicit "false" disables it.
1120
- annotate: ut === "false" ? !1 : void 0,
1121
- annotationColor: ht ?? void 0,
1122
- annotationPalette: yt,
1123
- screenshotOptions: y || q || x ? {
1219
+ annotate: bt === "false" ? !1 : void 0,
1220
+ annotationColor: mt ?? void 0,
1221
+ annotationPalette: kt,
1222
+ screenshotOptions: y || w || q ? {
1124
1223
  quality: y ? parseFloat(y) : void 0,
1125
- maxWidth: q ? parseInt(q, 10) : void 0,
1126
- maxHeight: x ? parseInt(x, 10) : void 0
1224
+ maxWidth: w ? parseInt(w, 10) : void 0,
1225
+ maxHeight: q ? parseInt(q, 10) : void 0
1127
1226
  } : void 0,
1128
1227
  container: l ?? void 0,
1129
1228
  buttonClass: c ?? void 0,
1130
- direction: gt ?? void 0,
1229
+ direction: qt ?? void 0,
1131
1230
  position: i ?? void 0,
1132
1231
  zIndex: o ? parseInt(o, 10) : void 0,
1133
1232
  skipTargeting: d === "true" ? !0 : void 0,
@@ -1135,71 +1234,86 @@ function we(e) {
1135
1234
  singleButton: u === "true" ? !0 : void 0,
1136
1235
  feedbackMode: h ?? void 0,
1137
1236
  incognito: f === "true" ? !0 : void 0,
1138
- buttonSize: at ?? void 0,
1237
+ buttonSize: dt ?? void 0,
1139
1238
  offset: g || v ? {
1140
1239
  x: g ? parseInt(g, 10) : void 0,
1141
1240
  y: v ? parseInt(v, 10) : void 0
1142
1241
  } : void 0,
1143
- modalWidth: C ? parseInt(C, 10) : void 0,
1144
- backdropOpacity: A ? parseFloat(A) : void 0,
1145
- fontFamily: nt ?? void 0,
1146
- fontSize: T ? parseInt(T, 10) : void 0,
1242
+ modalWidth: T ? parseInt(T, 10) : void 0,
1243
+ backdropOpacity: E ? parseFloat(E) : void 0,
1244
+ fontFamily: lt ?? void 0,
1245
+ fontSize: I ? parseInt(I, 10) : void 0,
1147
1246
  colors: {
1148
- positive: r ?? void 0,
1247
+ positive: a ?? void 0,
1149
1248
  negative: n ?? void 0,
1150
- marker: a ?? void 0
1249
+ marker: r ?? void 0
1151
1250
  },
1152
- text: I || E || B || O || R || P || F || z || D || H || L || M || _ || $ || K || N ? {
1153
- tooltip: I ?? void 0,
1154
- modalTitle: E ?? void 0,
1155
- modalSubtitle: B ?? void 0,
1156
- placeholder: O ?? void 0,
1157
- submitButton: R ?? void 0,
1158
- skipButton: P ?? void 0,
1251
+ text: D || z || P || R || N || U || F || M || L || H || B || O || j || $ || K || Q ? {
1252
+ tooltip: D ?? void 0,
1253
+ modalTitle: z ?? void 0,
1254
+ modalSubtitle: P ?? void 0,
1255
+ placeholder: R ?? void 0,
1256
+ submitButton: N ?? void 0,
1257
+ skipButton: U ?? void 0,
1159
1258
  feedbackLabel: F ?? void 0,
1160
- confirmationTitle: z ?? void 0,
1161
- confirmationMessage: D ?? void 0,
1259
+ confirmationTitle: M ?? void 0,
1260
+ confirmationMessage: L ?? void 0,
1162
1261
  confirmationClose: H ?? void 0,
1163
- errorTitle: L ?? void 0,
1164
- errorMessage: M ?? void 0,
1165
- positiveLabel: _,
1262
+ errorTitle: B ?? void 0,
1263
+ errorMessage: O ?? void 0,
1264
+ positiveLabel: j,
1166
1265
  negativeLabel: $,
1167
1266
  recordLabel: K,
1168
- dismissLabel: N
1267
+ dismissLabel: Q
1169
1268
  } : void 0,
1170
- positiveIcon: rt ?? void 0,
1171
- recordIcon: qt ?? void 0,
1172
- negativeIcon: st ?? void 0,
1173
- feedbackIcon: dt ?? void 0,
1174
- screenshotMethod: mt ?? void 0,
1175
- captureVideo: ft === "true" ? !0 : void 0,
1176
- hideThumbs: pt === "true" ? !0 : void 0,
1177
- hideDismiss: bt === "true" ? !0 : void 0,
1178
- videoOptions: w || U ? {
1179
- maxDuration: w ? parseInt(w, 10) : void 0,
1180
- redaction: U === "true" ? !0 : void 0
1269
+ positiveIcon: ct ?? void 0,
1270
+ recordIcon: Ct ?? void 0,
1271
+ negativeIcon: ut ?? void 0,
1272
+ feedbackIcon: ht ?? void 0,
1273
+ screenshotMethod: wt ?? void 0,
1274
+ captureVideo: gt === "true" ? !0 : void 0,
1275
+ hideThumbs: vt === "true" ? !0 : void 0,
1276
+ hideDismiss: yt === "true" ? !0 : void 0,
1277
+ videoOptions: x || _ ? {
1278
+ maxDuration: x ? parseInt(x, 10) : void 0,
1279
+ redaction: _ === "true" ? !0 : void 0
1181
1280
  } : void 0,
1182
- quests: j ? {
1183
- base: j,
1184
- up: xt ?? void 0,
1185
- down: wt ?? void 0,
1186
- video: kt ?? void 0,
1187
- apiKey: St ?? void 0,
1188
- moduleUrl: Ct ?? void 0
1281
+ quests: W ? {
1282
+ base: W,
1283
+ up: At ?? void 0,
1284
+ down: St ?? void 0,
1285
+ video: Tt ?? void 0,
1286
+ apiKey: Et ?? void 0,
1287
+ moduleUrl: It ?? void 0
1189
1288
  } : void 0
1190
1289
  };
1191
1290
  }
1192
- function ke() {
1291
+ function Ue() {
1193
1292
  if (typeof document > "u") return;
1194
1293
  const e = () => {
1195
- const t = document.currentScript ?? document.querySelector("script[data-endpoint]"), i = ye() ?? (t ? we(t) : null);
1196
- i?.endpoint && new ve(i);
1294
+ const t = document.currentScript ?? document.querySelector("script[data-endpoint]"), i = ke() ?? (t ? Se(t) : null);
1295
+ i?.endpoint && new xe(i);
1197
1296
  };
1198
1297
  document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", e) : e();
1199
1298
  }
1200
- ke();
1201
1299
  export {
1202
- ve as Q,
1203
- Ce as c
1300
+ Ee as A,
1301
+ De as B,
1302
+ Me as D,
1303
+ Le as E,
1304
+ Lt as F,
1305
+ Ie as P,
1306
+ xe as Q,
1307
+ Te as R,
1308
+ He as S,
1309
+ Dt as T,
1310
+ ze as U,
1311
+ Ue as a,
1312
+ Be as b,
1313
+ Oe as c,
1314
+ zt as d,
1315
+ Pe as e,
1316
+ Ne as g,
1317
+ Re as i
1204
1318
  };
1205
- //# sourceMappingURL=loader-DepVS4i5.js.map
1319
+ //# sourceMappingURL=core-2nGsCcZq.js.map