helldots 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +102 -14
- package/dist/helldots.esm.js +5 -1451
- package/dist/helldots.esm.js.map +4 -4
- package/dist/helldots.umd.js +13 -1459
- package/dist/index.d.ts +110 -3
- package/package.json +1 -1
package/dist/helldots.esm.js
CHANGED
|
@@ -1,1455 +1,9 @@
|
|
|
1
1
|
/*! HellDots — MIT. Bundles nanoid (MIT) © 2017 Andrey Sitnik <andrey@sitnik.es> — https://github.com/ai/nanoid */
|
|
2
|
-
import{domToCanvas as
|
|
3
|
-
|
|
4
|
-
scrollbar-color: rgba(255,255,255,0.22) transparent;`,Tt=(...n)=>n.map(e=>`
|
|
5
|
-
${e}::-webkit-scrollbar {
|
|
6
|
-
width: 8px;
|
|
7
|
-
height: 8px;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
${e}::-webkit-scrollbar-track {
|
|
11
|
-
background: transparent;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
${e}::-webkit-scrollbar-thumb {
|
|
15
|
-
background: rgba(255,255,255,0.22);
|
|
16
|
-
border-radius: 4px;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
${e}::-webkit-scrollbar-thumb:hover {
|
|
20
|
-
background: rgba(255,255,255,0.35);
|
|
21
|
-
}
|
|
22
|
-
`).join(""),$e=()=>`
|
|
23
|
-
|
|
24
|
-
:host {
|
|
25
|
-
all: initial;
|
|
26
|
-
display: block;
|
|
27
|
-
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
|
|
28
|
-
line-height: 1.5;
|
|
29
|
-
color-scheme: light;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
:host *,
|
|
33
|
-
:host *::before,
|
|
34
|
-
:host *::after {
|
|
35
|
-
box-sizing: border-box;
|
|
36
|
-
font-family: inherit;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
button {
|
|
40
|
-
padding: 0;
|
|
41
|
-
font: inherit;
|
|
42
|
-
color: inherit;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
#${T.TOOLBAR} {
|
|
46
|
-
position: fixed;
|
|
47
|
-
bottom: 20px;
|
|
48
|
-
left: 50%;
|
|
49
|
-
transform: translateX(-50%);
|
|
50
|
-
z-index: ${O.TOOLBAR};
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.${o.TOOLBAR_ACTION_WRAPPER} {
|
|
54
|
-
position: relative;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
.${o.TOOLBAR_ACTION_TOOLTIP} {
|
|
2
|
+
import{domToCanvas as Xt}from"modern-screenshot";var I="helldots-root",Ht=()=>{customElements.get(I)||customElements.define(I,class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}})};function We(){Ht();let o=document.querySelector(I);return o||(o=document.createElement(I),document.body.appendChild(o)),o.shadowRoot}var ie=.5,Ft=.7,Ke=o=>!o||o==="transparent"||o==="rgba(0, 0, 0, 0)",qe=()=>{let o=getComputedStyle(document.documentElement).backgroundColor;if(!Ke(o))return o;let e=getComputedStyle(document.body).backgroundColor;return Ke(e)?"#ffffff":e},Ze=()=>{try{let o=document.implementation.createHTMLDocument(""),e=o.createElement("style");return o.head.appendChild(e),e.sheet!==null}catch{return!1}},Ut=o=>{let e=[],t=o.indexOf("@font-face");for(;t!==-1;){let n=o.indexOf("{",t),s=n===-1?-1:o.indexOf("}",n);if(s===-1)break;e.push(o.slice(t,s+1)),t=o.indexOf("@font-face",s)}return e.join(`
|
|
3
|
+
`)},Ae=new Map,Vt=o=>(Ae.has(o)||Ae.set(o,fetch(o,{mode:"cors",credentials:"omit"}).then(e=>e.ok?e.text():"").then(Ut).catch(()=>"")),Ae.get(o)),zt=o=>{try{return!!o.cssRules}catch{return!1}},Gt=async o=>{let e=()=>{};if(!o||!Ze())return e;let t=Array.from(document.styleSheets).filter(r=>r.href&&!zt(r)).map(r=>r.href);if(!t.length)return e;let n=(await Promise.all(t.map(Vt))).filter(Boolean).join(`
|
|
4
|
+
`);if(!n)return e;let s=document.createElement("style");return s.textContent=n,document.head.appendChild(s),()=>s.remove()};async function ve({scale:o=1,embedCrossOriginFonts:e=!1}={}){let t=await Gt(e);try{return await Xt(document.documentElement,{scale:o,backgroundColor:qe(),...Ze()?{}:{font:!1},filter:n=>n.nodeName?.toLowerCase()!==I})}finally{t()}}var Qe=(o,e,t)=>{o.fillStyle=qe(),o.fillRect(0,0,e,t)};function Je(o,{left:e,top:t,width:n,height:s}){let r=document.createElement("canvas");r.width=n,r.height=s;let a=r.getContext("2d");return a?(Qe(a,n,s),a.drawImage(o,e+window.scrollX,t+window.scrollY,n,s,0,0,n,s),r.toDataURL("image/png")):null}function Ie(o,{sourceScale:e=1,outputScale:t=ie,quality:n=Ft}={}){let s=document.createElement("canvas");s.width=Math.round(window.innerWidth*t),s.height=Math.round(window.innerHeight*t);let r=s.getContext("2d");return r?(Qe(r,s.width,s.height),r.drawImage(o,window.scrollX*e,window.scrollY*e,window.innerWidth*e,window.innerHeight*e,0,0,s.width,s.height),s.toDataURL("image/jpeg",n)):null}var i={CIRCLE:"comment-circle",CIRCLE_ACTIVE:"comment-circle--active",TOOLTIP:"comment-tooltip",TOOLBAR_TEXT:"toolbar-text",SHORTCUT_HINT:"shortcut-hint",COMMENT_INPUT_AREA:"comment-input-area",CLOSE_TOOLTIP:"close-tooltip",ACTIVE:"active",COMMENT_CURSOR:"comment-cursor",COMMENT_OVERLAY:"comment-overlay",THREAD_POPOVER:"comment-thread-popover",THREAD_HEADER:"thread-header",THREAD_BODY:"thread-body",THREAD_REPLIES:"thread-replies",THREAD_REPLY:"thread-reply",THREAD_REPLY_ACTIONS:"thread-reply-actions",THREAD_INPUT_AREA:"thread-input-area",THREAD_INPUT:"thread-input",THREAD_SUBMIT:"thread-submit",THREAD_ACTIONS_ROW:"thread-actions-row",THREAD_SCROLL:"thread-scroll",THREAD_META:"thread-meta",THREAD_AUTHOR:"thread-author",THREAD_TIME:"thread-time",THREAD_EDITED:"thread-edited",EDITOR:"helldots-editor",EDITOR_INPUT:"helldots-editor-input",EDITOR_ACTIONS:"helldots-editor-actions",EDITOR_SAVE:"helldots-editor-save",EDITOR_CANCEL:"helldots-editor-cancel",INBOX_NOTICE:"inbox-notice",PREVIEW_CIRCLE:"preview-circle",SELECTION_RECT:"selection-rect",SCREENSHOT_IMG:"screenshot-img",SCREENSHOT_REMOVE:"screenshot-remove",SCREENSHOTS_CONTAINER:"screenshots-container",SCREENSHOT_ITEM:"screenshot-item",CONFIRM:"helldots-confirm",CONFIRM_PANEL:"helldots-confirm-panel",CONFIRM_TITLE:"helldots-confirm-title",CONFIRM_MESSAGE:"helldots-confirm-message",CONFIRM_ACTIONS:"helldots-confirm-actions",CONFIRM_CANCEL:"helldots-confirm-cancel",CONFIRM_ACCEPT:"helldots-confirm-accept",LIGHTBOX:"helldots-lightbox",LIGHTBOX_IMG:"helldots-lightbox-img",LIGHTBOX_CLOSE:"helldots-lightbox-close",COMMENT_ACTIONS_BAR:"comment-actions-bar",ATTACH_IMAGE_BTN:"attach-image-btn",TOOLBAR_ACTIONS:"toolbar-actions",TOOLBAR_ACTION_BTN:"toolbar-action-btn",TOOLBAR_ACTION_WRAPPER:"toolbar-action-wrapper",TOOLBAR_ACTION_TOOLTIP:"toolbar-action-tooltip",TOOLBAR_COMMENT_BTN:"toolbar-comment-btn",TOOLBAR_MENU_BTN:"toolbar-menu-btn",INBOX_PANEL:"inbox-panel",INBOX_HEADER:"inbox-header",INBOX_FILTER:"inbox-filter",INBOX_FILTER_MENU:"inbox-filter-menu",INBOX_FILTER_MENU_HEADER:"inbox-filter-menu-header",INBOX_FILTER_CLEAR:"inbox-filter-clear",INBOX_FILTER_GROUP:"inbox-filter-group",INBOX_FILTER_CHIPS:"inbox-filter-chips",INBOX_FILTER_CHIP:"inbox-filter-chip",INBOX_FILTER_SECTION:"inbox-filter-section",INBOX_CLOSE:"inbox-close",INBOX_LIST:"inbox-list",INBOX_CARD:"inbox-card",INBOX_CARD_HEADER:"inbox-card-header",INBOX_CARD_ACTIONS:"inbox-card-actions",INBOX_CARD_TEXT:"inbox-card-text",INBOX_CARD_TAG:"inbox-card-tag",INBOX_CARD_REPLY_LINK:"inbox-card-reply-link",INBOX_ACTION_BTN:"inbox-action-btn",INBOX_ACTION_BTN_LABELED:"inbox-action-btn--labeled",INBOX_ACTION_LABEL:"inbox-action-label",INBOX_STATUS_DOT:"inbox-status-dot",INBOX_MENU:"inbox-menu",INBOX_MENU_UP:"inbox-menu--up",INBOX_MENU_ITEM:"inbox-menu-item",INBOX_DETAIL:"inbox-detail",INBOX_DETAIL_HEADER:"inbox-detail-header",INBOX_BACK:"inbox-back",INBOX_NAV_BTN:"inbox-nav-btn",INBOX_REPLIES:"inbox-replies",TOOLTIP_REPLY_COUNT:"comment-tooltip-reply-count",INBOX_EMPTY:"inbox-empty",INBOX_EMPTY_ICON:"inbox-empty-icon",INBOX_EMPTY_TITLE:"inbox-empty-title",INBOX_EMPTY_TEXT:"inbox-empty-text",INBOX_EMPTY_KBD:"inbox-empty-kbd",INBOX_EMPTY_ACTION:"inbox-empty-action",CLASSIFY_ROW:"classify-row",INBOX_BADGES:"inbox-badges",BADGE:"helldots-badge",BADGE_STATUS:"helldots-badge--status",BADGE_TYPE:"helldots-badge--type",BADGE_PRIORITY:"helldots-badge--priority",BADGE_TAG:"helldots-badge--tag",BADGE_DURATION:"helldots-badge--duration",CONTEXT_BLOCK:"inbox-context",CONTEXT_TITLE:"inbox-context-title",CONTEXT_BODY:"inbox-context-body",CONTEXT_ROW:"inbox-context-row",CONTEXT_SCREENSHOT_CAPTION:"inbox-context-screenshot-caption",CONTEXT_TOGGLE:"inbox-context-toggle",HIGHLIGHT:"helldots-highlight"},et=[i.COMMENT_CURSOR],T={TOOLBAR:"comment-toolbar",COMMENT_BOX:"comment-box",COMMENT_INPUT:"comment-input",SUBMIT_COMMENT:"submit-comment",STYLES:"comment-overlay-styles",GLOBAL_STYLES:"comment-overlay-global-styles",ATTACH_IMAGE_INPUT:"attach-image-input"},A=28,ne=5,M=["open","in_progress","resolved"],oe={open:"#2E90FA",in_progress:"#FF9F0A",resolved:"#30D158"},N=["bug","suggestion","question","improvement"],j={bug:"#FF453A",suggestion:"#BF5AF2",question:"#64D2FF",improvement:"#5E5CE6"},w=["high","medium","low"],W={high:"#FF453A",medium:"#FF9F0A",low:"#8E8E93"},tt={CONTAINER:'section, div[class*="container"], div[class*="content"]'},S={CIRCLE:9997,TOOLTIP:1e4,TOOLBAR:9998,COMMENT_BOX:9999,LIGHTBOX:10001,CONFIRM:10002},it='data:image/svg+xml;utf8,<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg"><g transform="translate(-4,-4)"><path d="M6 8C6 6.89543 6.89543 6 8 6H20C27.732 6 34 12.268 34 20V20C34 27.732 27.732 34 20 34V34C12.268 34 6 27.732 6 20V8Z" fill="%232E90FA"/><path d="M8 7H20C27.1797 7 33 12.8203 33 20C33 27.1797 27.1797 33 20 33C12.8203 33 7 27.1797 7 20V8C7 7.44772 7.44772 7 8 7Z" stroke="white" stroke-width="2"/></g></svg>',nt="2 2";var re=class{constructor({host:e,autoScreenshot:t,embedCrossOriginFonts:n=!1,onRegionCaptured:s,onPlace:r}){this.host=e,this.autoScreenshot=t,this.embedCrossOriginFonts=n,this.onRegionCaptured=s,this.onPlace=r,this.pendingCapture=null,this._dragStart=null,this._isDragging=!1,this._selectionRect=null,this._boundDragMove=a=>this.onDragMove(a),this._boundDragEnd=a=>this.onDragEnd(a)}beginDrag(e){this._dragStart={x:e.clientX,y:e.clientY},this._isDragging=!1,document.addEventListener("mousemove",this._boundDragMove),document.addEventListener("mouseup",this._boundDragEnd)}onDragMove(e){let t=e.clientX-this._dragStart.x,n=e.clientY-this._dragStart.y;if(!this._isDragging&&Math.hypot(t,n)<5)return;this._isDragging=!0;let s=Math.min(this._dragStart.x,e.clientX),r=Math.min(this._dragStart.y,e.clientY),a=Math.abs(t),l=Math.abs(n);this._selectionRect||(this._selectionRect=document.createElement("div"),this._selectionRect.className=i.SELECTION_RECT,this.host.appendChild(this._selectionRect)),this._selectionRect.style.left=`${s}px`,this._selectionRect.style.top=`${r}px`,this._selectionRect.style.width=`${a}px`,this._selectionRect.style.height=`${l}px`}async onDragEnd(e){if(document.removeEventListener("mousemove",this._boundDragMove),document.removeEventListener("mouseup",this._boundDragEnd),this._isDragging){let t=Math.min(this._dragStart.x,e.clientX),n=Math.min(this._dragStart.y,e.clientY),s=Math.abs(e.clientX-this._dragStart.x),r=Math.abs(e.clientY-this._dragStart.y);if(this._selectionRect?.remove(),this._selectionRect=null,s>10&&r>10)try{let a=await ve({scale:1,embedCrossOriginFonts:this.embedCrossOriginFonts}),l=Je(a,{left:t,top:n,width:s,height:r});l&&this.onRegionCaptured(l),this.autoScreenshot&&(this.pendingCapture=Promise.resolve(Ie(a,{sourceScale:1})))}catch(a){console.warn("HellDots: screenshot capture failed:",a)}await this.onPlace(e.clientX,e.clientY)}else await this.onPlace(this._dragStart.x,this._dragStart.y);this._isDragging=!1,this._dragStart=null}armClickCapture(){!this.autoScreenshot||this.pendingCapture||(this.pendingCapture=ve({scale:ie,embedCrossOriginFonts:this.embedCrossOriginFonts}).then(e=>Ie(e,{sourceScale:ie})).catch(e=>(console.warn("HellDots: automatic screenshot failed",e),null)))}async consumePending(){return this.pendingCapture?await this.pendingCapture:null}clearPending(){this.pendingCapture=null}destroy(){document.removeEventListener("mousemove",this._boundDragMove),document.removeEventListener("mouseup",this._boundDragEnd),this._selectionRect?.remove(),this._selectionRect=null,this.pendingCapture=null,this._dragStart=null,this._isDragging=!1}};var Yt=[{name:"Edge",re:/Edg\/([\d.]+)/},{name:"Chrome",re:/Chrome\/([\d.]+)/},{name:"Firefox",re:/Firefox\/([\d.]+)/},{name:"Safari",re:/Version\/([\d.]+).*Safari/}],jt=[{name:"iOS",re:/(?:iPhone|iPad).*OS ([\d_]+) like Mac OS X/},{name:"Android",re:/Android ([\d.]+)/},{name:"Windows",re:/Windows NT ([\d.]+)/},{name:"macOS",re:/Mac OS X ([\d_.]+)/},{name:"Linux",re:/Linux/}],Wt={name:"unknown",version:""},Kt=o=>/not[\W_]*a[\W_]*brand/i.test(o),ot=(o,e)=>{for(let{name:t,re:n}of o){let s=e.match(n);if(s)return{name:t,version:(s[1]||"").replace(/_/g,".")}}return{...Wt}};function rt(o=window){let e=o.navigator||{},t=e.userAgent||"",n=e.userAgentData,s=ot(Yt,t),r=n?.brands?.find(l=>!Kt(l.brand));r&&(s={name:r.brand,version:r.version||""});let a=ot(jt,t);return n?.platform&&(a.name=n.platform),{version:1,url:o.location?.href||"",viewport:{width:o.innerWidth,height:o.innerHeight},screen:{width:o.screen?.width??0,height:o.screen?.height??0},devicePixelRatio:o.devicePixelRatio??1,userAgent:t,browser:s,os:a,language:e.language||""}}var se=" scrollbar-width:thin;scrollbar-color:rgba(255,255,255,0.22) transparent;",qt=(...o)=>o.map(e=>` ${e}::-webkit-scrollbar{width:8px;height:8px;}${e}::-webkit-scrollbar-track{background:transparent;}${e}::-webkit-scrollbar-thumb{background:rgba(255,255,255,0.22);border-radius:4px;}${e}::-webkit-scrollbar-thumb:hover{background:rgba(255,255,255,0.35);}`).join(""),st=()=>` :host{all:initial;display:block;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;line-height:1.5;color-scheme:light;}:host *,:host *::before,:host *::after{box-sizing:border-box;font-family:inherit;}button{padding:0;font:inherit;color:inherit;}#${T.TOOLBAR}{position:fixed;bottom:20px;left:50%;transform:translateX(-50%);z-index:${S.TOOLBAR};}.${i.TOOLBAR_ACTION_WRAPPER}{position:relative;}.${i.TOOLBAR_ACTION_TOOLTIP}{position:absolute;bottom:calc(100% + 10px);left:50%;transform:translateX(-50%) translateY(4px);display:flex;align-items:center;gap:8px;background:rgba(20,20,23,0.95);backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px);padding:8px 12px;border-radius:10px;border:1px solid rgba(255,255,255,0.08);box-shadow:0 4px 24px rgba(0,0,0,0.35);color:white;white-space:nowrap;opacity:0;pointer-events:none;transition:opacity 0.15s ease,transform 0.15s ease;}.${i.TOOLBAR_ACTION_WRAPPER}:hover .${i.TOOLBAR_ACTION_TOOLTIP}{opacity:1;pointer-events:auto;transform:translateX(-50%) translateY(0);}.${i.TOOLBAR_TEXT}{font-size:13px;font-weight:500;letter-spacing:-0.01em;}.${i.SHORTCUT_HINT}{font-size:11px;font-weight:500;color:rgba(255,255,255,0.5);background:rgba(255,255,255,0.06);border:1px solid rgba(255,255,255,0.1);padding:2px 6px;border-radius:5px;line-height:1;white-space:nowrap;}.${i.TOOLBAR_ACTIONS}{display:flex;flex-direction:row;background:rgba(20,20,23,0.95);backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px);border-radius:12px;box-shadow:0 4px 24px rgba(0,0,0,0.35);}.${i.TOOLBAR_ACTION_BTN}{width:42px;height:42px;display:flex;align-items:center;justify-content:center;background:none;border:none;outline:none;color:rgba(255,255,255,0.65);cursor:pointer;transition:background 0.2s,color 0.2s;padding:0;}.${i.TOOLBAR_ACTION_WRAPPER}:first-child .${i.TOOLBAR_ACTION_BTN}{border-radius:12px 0 0 12px;}.${i.TOOLBAR_ACTION_WRAPPER}:last-child .${i.TOOLBAR_ACTION_BTN}{border-radius:0 12px 12px 0;}.${i.TOOLBAR_ACTION_BTN}:hover{background:rgba(255,255,255,0.08);color:white;}.${i.TOOLBAR_COMMENT_BTN}.${i.ACTIVE}{color:#2E90FA;background:rgba(46,144,250,0.1);}#${T.COMMENT_BOX}{position:fixed;background:#1C1C1E;border-radius:12px;box-shadow:0 4px 20px rgba(0,0,0,0.4);padding:16px;z-index:${S.COMMENT_BOX};width:min(400px,calc(100vw - 24px));display:none;box-sizing:border-box;}#${T.COMMENT_BOX} .${i.COMMENT_INPUT_AREA}{display:flex;flex-direction:column;gap:0;}.${i.CLASSIFY_ROW}{display:flex;align-items:center;flex-wrap:wrap;gap:8px;padding:0 0 10px;border-bottom:1px solid rgba(255,255,255,0.08);}.${i.CLASSIFY_ROW} .${i.INBOX_ACTION_BTN}{height:26px;border:1px solid rgba(255,255,255,0.12);border-radius:8px;}.${i.CLASSIFY_ROW} .${i.INBOX_ACTION_BTN}:hover{border-color:rgba(255,255,255,0.28);}#${T.COMMENT_INPUT}{flex:1;min-height:20px;background:#1C1C1E;border:none;resize:none;font-family:inherit;color:white;font-size:14px;line-height:1.4;box-sizing:border-box;field-sizing:content;padding:8px 0;}#${T.COMMENT_INPUT}::placeholder{color:rgba(255,255,255,0.5);}#${T.COMMENT_INPUT}:focus{outline:none;box-shadow:none;}.${i.COMMENT_ACTIONS_BAR}{display:flex;align-items:center;justify-content:space-between;padding-top:12px;}.${i.ATTACH_IMAGE_BTN}{background:none;border:none;color:rgba(255,255,255,0.5);cursor:pointer;display:flex;align-items:center;justify-content:center;border-radius:6px;transition:background 0.2s,color 0.2s;}.${i.ATTACH_IMAGE_BTN}:hover{background:rgba(255,255,255,0.1);color:rgba(255,255,255,0.8);}.${i.CIRCLE}{position:absolute;width:${A}px;height:${A}px;background:#2E90FA;border-radius:0% 100% 100% 100%;border:2px solid #FFF;cursor:pointer;box-shadow:0 1px 5px rgba(0,0,0,0.2);transition:transform 0.2s,background 0.2s;z-index:${S.CIRCLE};transform:translate(-50%,-50%);}.${i.CIRCLE}:hover{transform:translate(-50%,-50%) scale(1.2) !important;background:rgb(0,123,255);}.${i.CIRCLE}.${i.HIGHLIGHT}{transform:translate(-50%,-50%) scale(1.2) !important;background:rgb(0,123,255);box-shadow:0 0 0 4px rgba(46,144,250,0.35),0 1px 5px rgba(0,0,0,0.2);}.${i.CIRCLE}.${i.CIRCLE_ACTIVE}{transform:translate(-50%,-50%) scale(1.2) !important;background:rgb(0,123,255);box-shadow:0 0 0 5px rgba(46,144,250,0.5),0 1px 5px rgba(0,0,0,0.2);}.${i.TOOLTIP}{position:fixed;background:#1C1C1E;border-radius:12px;padding:16px;box-shadow:0 4px 20px rgba(0,0,0,0.4);width:min(400px,calc(100vw - 24px));max-height:calc(100vh - 20px);overflow-y:auto;overscroll-behavior:contain;${se} z-index:${S.TOOLTIP};color:white;font-size:14px;line-height:1.5;box-sizing:border-box;}.${i.TOOLTIP} .${i.THREAD_BODY}{padding:8px 0;}.${i.THREAD_POPOVER}{position:fixed;background:#1C1C1E;border-radius:12px;padding:16px;box-shadow:0 4px 20px rgba(0,0,0,0.4);width:min(400px,calc(100vw - 24px));max-height:calc(100vh - 20px);display:flex;flex-direction:column;z-index:${S.TOOLTIP};color:white;font-size:14px;line-height:1.5;box-sizing:border-box;}.${i.THREAD_POPOVER}>.${i.THREAD_HEADER},.${i.THREAD_POPOVER}>.${i.THREAD_ACTIONS_ROW},.${i.THREAD_POPOVER}>.${i.THREAD_INPUT_AREA}{flex:none;}.${i.THREAD_SCROLL}{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;${se}}${qt(`.${i.THREAD_SCROLL}`,`.${i.TOOLTIP}`,`.${i.INBOX_LIST}`,`.${i.INBOX_DETAIL}`,`.${i.EDITOR_INPUT}`)} .${i.INBOX_PANEL}{position:fixed;top:16px;right:16px;bottom:16px;width:380px;display:flex;flex-direction:column;background:#1C1C1E;border:1px solid rgba(255,255,255,0.08);border-radius:14px;box-shadow:0 8px 32px rgba(0,0,0,0.5);z-index:${S.COMMENT_BOX};color:white;font-size:14px;line-height:1.5;box-sizing:border-box;overflow:hidden;}@media (max-width:480px){.${i.INBOX_PANEL}{left:16px;width:auto;}}.${i.INBOX_HEADER},.${i.INBOX_DETAIL_HEADER}{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:12px 14px;border-bottom:1px solid rgba(255,255,255,0.08);flex:none;}.${i.INBOX_FILTER}-wrapper{position:relative;}.${i.INBOX_FILTER}{display:flex;align-items:center;gap:6px;background:transparent;border:none;color:white;font-size:13px;font-weight:600;cursor:pointer;padding:4px 6px;border-radius:6px;}.${i.INBOX_FILTER}:hover{background:rgba(255,255,255,0.08);}.${i.INBOX_FILTER_MENU}{position:absolute;top:calc(100% + 6px);left:0;background:#2C2C2E;border:1px solid rgba(255,255,255,0.1);border-radius:12px;padding:14px;width:300px;max-width:calc(100vw - 40px);z-index:1;box-shadow:0 8px 28px rgba(0,0,0,0.5);}.${i.INBOX_FILTER_MENU_HEADER}{display:flex;align-items:baseline;justify-content:space-between;gap:12px;font-size:13px;font-weight:600;margin-bottom:12px;}.${i.INBOX_FILTER_CLEAR}{background:transparent;border:none;color:rgba(255,255,255,0.55);font-size:12px;font-weight:500;cursor:pointer;padding:0;}.${i.INBOX_FILTER_CLEAR}:hover:not(:disabled){color:white;}.${i.INBOX_FILTER_CLEAR}:disabled{opacity:0.35;cursor:default;}.${i.INBOX_FILTER_GROUP} + .${i.INBOX_FILTER_GROUP}{margin-top:14px;}.${i.INBOX_FILTER_SECTION}{font-size:11px;font-weight:600;color:rgba(255,255,255,0.45);margin-bottom:8px;}.${i.INBOX_FILTER_CHIPS}{display:flex;flex-wrap:wrap;gap:6px;}.${i.INBOX_FILTER_CHIP}{background:transparent;border:1px solid rgba(255,255,255,0.18);border-radius:999px;color:rgba(255,255,255,0.75);font-size:12px;line-height:1;padding:7px 12px;cursor:pointer;transition:background 0.15s,border-color 0.15s,color 0.15s;}.${i.INBOX_FILTER_CHIP}:hover{border-color:rgba(255,255,255,0.4);color:white;}.${i.INBOX_FILTER_CHIP}[aria-checked="true"]{background:rgba(255,255,255,0.92);border-color:rgba(255,255,255,0.92);color:#1C1C1E;font-weight:600;}.${i.INBOX_MENU_ITEM}{display:block;width:100%;text-align:left;background:transparent;border:none;color:white;font-size:13px;padding:7px 10px;border-radius:6px;cursor:pointer;}.${i.INBOX_MENU_ITEM}:hover{background:rgba(255,255,255,0.08);}.${i.INBOX_CLOSE},.${i.INBOX_NAV_BTN},.${i.INBOX_BACK}{display:flex;align-items:center;gap:4px;background:transparent;border:none;color:rgba(255,255,255,0.75);cursor:pointer;padding:4px 6px;border-radius:6px;font-size:14px;}.${i.INBOX_CLOSE}{font-size:20px;line-height:1;}.${i.INBOX_CLOSE}:hover,.${i.INBOX_NAV_BTN}:not(:disabled):hover,.${i.INBOX_BACK}:hover{background:rgba(255,255,255,0.08);color:white;}.${i.INBOX_NAV_BTN}:disabled{opacity:0.35;cursor:default;}.${i.INBOX_LIST},.${i.INBOX_DETAIL}{flex:1;overflow-y:auto;${se} padding:12px;display:flex;flex-direction:column;gap:12px;}.${i.INBOX_CARD}{border:1px solid rgba(255,255,255,0.1);border-radius:10px;padding:12px;display:flex;flex-direction:column;gap:8px;}.${i.INBOX_LIST} .${i.INBOX_CARD}{cursor:pointer;}.${i.INBOX_LIST} .${i.INBOX_CARD}:hover{border-color:rgba(255,255,255,0.22);}.${i.INBOX_CARD}--resolved{border-color:rgba(48,209,88,0.4);opacity:0.75;}.${i.INBOX_LIST} .${i.INBOX_CARD}--resolved:hover{border-color:rgba(48,209,88,0.7);opacity:1;}.${i.INBOX_CARD_HEADER}{display:flex;align-items:center;justify-content:space-between;gap:8px;}.${i.INBOX_CARD_ACTIONS}{display:flex;align-items:center;flex-wrap:wrap;justify-content:flex-end;gap:6px;}.${i.INBOX_ACTION_BTN}{display:flex;align-items:center;justify-content:center;width:24px;height:24px;background:transparent;border:none;border-radius:6px;color:rgba(255,255,255,0.65);cursor:pointer;}.${i.INBOX_ACTION_BTN}:hover{background:rgba(255,255,255,0.08);color:white;}.${i.INBOX_ACTION_BTN_LABELED}{width:auto;padding:0 8px 0 6px;gap:5px;justify-content:flex-start;flex:none;}.${i.INBOX_ACTION_LABEL}{font-size:11px;line-height:1;white-space:nowrap;}.${i.INBOX_STATUS_DOT}{width:12px;height:12px;border-radius:50%;border:1.5px solid rgba(255,255,255,0.45);display:inline-block;flex:none;}.${i.INBOX_MENU_ITEM} .${i.INBOX_STATUS_DOT}{width:9px;height:9px;border:none;margin-right:8px;vertical-align:baseline;}.${i.INBOX_MENU_ITEM}[aria-checked="true"]{background:rgba(255,255,255,0.08);}.${i.THREAD_ACTIONS_ROW}{display:flex;justify-content:flex-end;}.${i.THREAD_POPOVER}>.${i.THREAD_ACTIONS_ROW}{padding-top:8px;}[data-hd-tooltip]{position:relative;}[data-hd-tooltip]::after{content:attr(data-hd-tooltip);position:absolute;bottom:calc(100% + 6px);left:50%;transform:translateX(-50%);background:#000;color:white;padding:4px 8px;border-radius:6px;font-size:11px;white-space:nowrap;opacity:0;pointer-events:none;transition:opacity 0.12s ease;z-index:2;}[data-hd-tooltip]:hover::after{opacity:1;}.${i.INBOX_MENU}{position:absolute;top:calc(100% + 4px);right:0;background:#2C2C2E;border:1px solid rgba(255,255,255,0.1);border-radius:8px;padding:4px;min-width:130px;z-index:1;box-shadow:0 4px 16px rgba(0,0,0,0.4);}.${i.INBOX_MENU}.${i.INBOX_MENU_UP}{top:auto;bottom:calc(100% + 4px);}.${i.INBOX_CARD_TEXT}{white-space:pre-wrap;word-break:break-word;}.${i.INBOX_CARD_TAG}{align-self:flex-start;padding:1px 8px;border-radius:999px;background:rgba(255,159,10,0.2);color:#FF9F0A;font-size:11px;font-weight:600;}.${i.INBOX_BADGES}{display:flex;flex-wrap:wrap;gap:4px;}.${i.INBOX_CARD} .${i.INBOX_BADGES}{margin-top:6px;}.${i.TOOLTIP} .${i.INBOX_BADGES}{margin-bottom:4px;}.${i.BADGE}{display:inline-flex;align-items:center;padding:1px 6px;border:1px solid rgba(255,255,255,0.18);border-radius:10px;font-size:10px;line-height:1.6;letter-spacing:0.01em;white-space:nowrap;}.${i.BADGE_STATUS},.${i.BADGE_TYPE},.${i.BADGE_PRIORITY}{font-weight:600;}.${i.BADGE_TAG}{opacity:0.75;}.${i.BADGE_DURATION}{opacity:0.75;border-style:dashed;}.${i.CONTEXT_BLOCK}{display:flex;flex-direction:column;padding:10px 12px;border-top:1px solid rgba(255,255,255,0.08);font-size:11px;}.${i.CONTEXT_BODY}{display:flex;flex-direction:column;gap:4px;}.${i.CONTEXT_TITLE}{font-size:11px;font-weight:600;color:rgba(255,255,255,0.45);padding-bottom:4px;}.${i.CONTEXT_TOGGLE}{display:flex;align-items:center;justify-content:space-between;width:100%;background:transparent;border:none;color:rgba(255,255,255,0.45);font-size:11px;font-weight:600;cursor:pointer;padding:2px 0;}.${i.CONTEXT_TOGGLE}:hover{color:rgba(255,255,255,0.75);}.${i.CONTEXT_TOGGLE} svg{flex:none;transition:transform 0.15s ease;}.${i.CONTEXT_TOGGLE}[aria-expanded="true"] svg{transform:rotate(180deg);}.${i.CONTEXT_TOGGLE}[aria-expanded="true"] + .${i.CONTEXT_BODY}{padding-top:8px;}.${i.CONTEXT_BLOCK} img{width:100%;border-radius:6px;margin-bottom:6px;cursor:zoom-in;}.${i.CONTEXT_SCREENSHOT_CAPTION}{opacity:0.75;}.${i.CONTEXT_ROW}{display:flex;justify-content:space-between;gap:12px;opacity:0.75;}.${i.CONTEXT_ROW} span:last-child{text-align:right;word-break:break-all;}.${i.INBOX_CARD_REPLY_LINK}{align-self:flex-start;background:transparent;border:none;color:rgba(255,255,255,0.55);font-size:13px;cursor:pointer;padding:0;}.${i.INBOX_CARD_REPLY_LINK}:hover{color:white;}.${i.INBOX_REPLIES}{display:flex;flex-direction:column;gap:10px;padding:0 4px;}.${i.TOOLTIP_REPLY_COUNT}{font-size:12px;color:rgba(255,255,255,0.45);padding-top:4px;}.${i.INBOX_EMPTY}{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;padding:32px 24px;color:rgba(255,255,255,0.55);text-align:center;}.${i.INBOX_EMPTY_ICON}{width:44px;height:44px;margin-bottom:6px;border:2px dashed rgba(255,255,255,0.25);border-radius:0% 100% 100% 100%;flex:none;}.${i.INBOX_EMPTY_TITLE}{color:white;font-size:14px;font-weight:600;}.${i.INBOX_EMPTY_TEXT}{font-size:13px;line-height:1.5;max-width:30ch;}.${i.INBOX_EMPTY_KBD}{font-family:inherit;font-size:12px;font-weight:500;color:rgba(255,255,255,0.8);background:rgba(255,255,255,0.08);border:1px solid rgba(255,255,255,0.14);border-radius:5px;padding:1px 5px;white-space:nowrap;}.${i.INBOX_EMPTY_ACTION}{margin-top:6px;background:transparent;border:1px solid rgba(255,255,255,0.2);border-radius:8px;color:white;font-size:13px;font-weight:500;padding:8px 16px;cursor:pointer;transition:background 0.15s,border-color 0.15s;}.${i.INBOX_EMPTY_ACTION}:hover{background:rgba(255,255,255,0.08);border-color:rgba(255,255,255,0.35);}.${i.THREAD_HEADER}{display:flex;justify-content:space-between;align-items:center;padding:0;}.${i.THREAD_META}{display:flex;align-items:center;gap:6px;flex:1;min-width:0;}.${i.THREAD_AUTHOR}{font-weight:600;font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.${i.THREAD_TIME}{font-size:12px;color:rgba(255,255,255,0.5);cursor:default;position:relative;flex:none;}.${i.THREAD_TIME}::after{content:attr(data-full-date);position:absolute;bottom:calc(100% + 6px);left:50%;transform:translateX(-50%);background:#000;color:white;padding:4px 8px;border-radius:6px;font-size:11px;white-space:nowrap;opacity:0;pointer-events:none;transition:opacity 0.15s ease;z-index:1;}.${i.THREAD_TIME}:hover::after{opacity:1;}.${i.THREAD_BODY}{padding:8px 0;white-space:pre-wrap;word-break:break-word;}.${i.THREAD_REPLIES}{padding:0;}.${i.THREAD_REPLIES}:empty{display:none;}.${i.THREAD_REPLY}{padding:16px 0 0 0;border-top:1px solid rgba(255,255,255,0.1);white-space:pre-wrap;word-break:break-word;font-size:13px;color:rgba(255,255,255,0.85);}.${i.THREAD_REPLY} .${i.THREAD_META}{margin-bottom:2px;}.${i.THREAD_REPLY_ACTIONS}{margin-left:auto;flex:none;}.${i.THREAD_REPLY} .${i.SCREENSHOT_IMG}{width:144px;height:100px;object-fit:cover;border-radius:8px;margin-top:4px;cursor:pointer;display:block;}.${i.THREAD_INPUT_AREA}{display:flex;flex-direction:column;gap:0;padding:12px 0 0;border-top:1px solid rgba(255,255,255,0.1);}.${i.THREAD_INPUT}{width:100%;background:transparent;border:none;padding:0;color:white;font-size:14px;font-family:inherit;outline:none;box-sizing:border-box;}.${i.THREAD_INPUT}::placeholder{color:rgba(255,255,255,0.5);}.${i.THREAD_INPUT}:focus{outline:none;box-shadow:none;}.${i.THREAD_SUBMIT}{background:none;border:none;color:#2E90FA;cursor:pointer;display:flex;align-items:center;justify-content:center;border-radius:6px;transition:background 0.2s;}.${i.THREAD_SUBMIT}:hover{background:rgba(46,144,250,0.15);color:#1570D6;}.${i.CLOSE_TOOLTIP}{background:none;border:none;font-size:18px;cursor:pointer;color:rgba(255,255,255,0.5);line-height:1;}.${i.CLOSE_TOOLTIP}:hover{color:white;}.${i.PREVIEW_CIRCLE}{animation:helldots-pulse 1.5s ease-in-out infinite;}@keyframes helldots-pulse{0%,100%{box-shadow:0 0 0 0 rgba(46,144,250,0.4),0 1px 5px rgba(0,0,0,0.2);}50%{box-shadow:0 0 0 8px rgba(46,144,250,0),0 1px 5px rgba(0,0,0,0.2);}}.${i.COMMENT_OVERLAY}{position:fixed;top:0;left:0;right:0;bottom:0;background:transparent;pointer-events:none;z-index:${S.TOOLBAR-1};}.${i.COMMENT_OVERLAY}.${i.ACTIVE}{pointer-events:auto;background:rgba(0,0,0,0.1);}.${i.SELECTION_RECT}{position:fixed;border:2px solid #2E90FA;background:rgba(46,144,250,0.1);pointer-events:none;z-index:${S.TOOLTIP};box-sizing:border-box;}.${i.SCREENSHOTS_CONTAINER}{display:none;overflow-x:auto;gap:8px;margin-top:4px;padding:4px 0;scrollbar-width:none;-ms-overflow-style:none;margin-bottom:8px;}.${i.SCREENSHOTS_CONTAINER}::-webkit-scrollbar{display:none;}.${i.SCREENSHOTS_CONTAINER}.${i.ACTIVE}{display:flex;}.${i.SCREENSHOT_ITEM}{position:relative;flex-shrink:0;}.${i.SCREENSHOT_ITEM} .${i.SCREENSHOT_IMG}{width:50px;height:50px;object-fit:cover;border-radius:8px;cursor:pointer;display:block;margin:0;}.${i.SCREENSHOT_ITEM} .${i.SCREENSHOT_IMG}:hover{opacity:0.85;}.${i.SCREENSHOT_ITEM} .${i.SCREENSHOT_REMOVE}{position:absolute;top:-5px;right:-5px;width:18px;height:18px;background:rgba(0,0,0,0.7);border:none;border-radius:50%;color:white;font-size:12px;line-height:1;cursor:pointer;display:none;align-items:center;justify-content:center;z-index:1;}.${i.SCREENSHOT_ITEM}:hover .${i.SCREENSHOT_REMOVE}{display:flex;}.${i.SCREENSHOT_ITEM} .${i.SCREENSHOT_REMOVE}:hover{background:rgba(0,0,0,0.9);}.${i.TOOLTIP}>.${i.SCREENSHOTS_CONTAINER} .${i.SCREENSHOT_ITEM} .${i.SCREENSHOT_IMG},.${i.THREAD_SCROLL}>.${i.SCREENSHOTS_CONTAINER} .${i.SCREENSHOT_ITEM} .${i.SCREENSHOT_IMG},.${i.THREAD_REPLY} .${i.SCREENSHOT_ITEM} .${i.SCREENSHOT_IMG}{width:144px;height:100px;}.${i.CONFIRM}{position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,0.6);display:flex;align-items:center;justify-content:center;padding:16px;animation:helldots-fade-in 0.15s ease;}.${i.CONFIRM_PANEL}{width:min(360px,100%);background:#1C1C1E;border:1px solid rgba(255,255,255,0.1);border-radius:14px;box-shadow:0 8px 32px rgba(0,0,0,0.5);padding:20px;color:white;font-size:14px;line-height:1.5;box-sizing:border-box;}.${i.CONFIRM_TITLE}{margin:0 0 8px;font-size:15px;font-weight:600;}.${i.CONFIRM_MESSAGE}{margin:0 0 20px;font-size:13px;color:rgba(255,255,255,0.65);}.${i.CONFIRM_ACTIONS}{display:flex;justify-content:flex-end;gap:8px;}.${i.CONFIRM_CANCEL},.${i.CONFIRM_ACCEPT}{padding:7px 14px;border:1px solid transparent;border-radius:8px;font-size:13px;font-weight:600;cursor:pointer;}.${i.CONFIRM_CANCEL}:focus-visible,.${i.CONFIRM_ACCEPT}:focus-visible{outline:2px solid #2E90FA;outline-offset:2px;}.${i.CONFIRM_CANCEL}{background:rgba(255,255,255,0.08);border-color:rgba(255,255,255,0.12);color:white;}.${i.CONFIRM_CANCEL}:hover{background:rgba(255,255,255,0.14);}.${i.CONFIRM_ACCEPT}{background:#FF453A;color:white;}.${i.CONFIRM_ACCEPT}:hover{background:#FF6961;}.${i.LIGHTBOX}{position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,0.92);z-index:${S.LIGHTBOX};display:flex;align-items:center;justify-content:center;animation:helldots-fade-in 0.2s ease;}@keyframes helldots-fade-in{from{opacity:0;}to{opacity:1;}}.${i.LIGHTBOX_IMG}{max-width:90vw;max-height:90vh;object-fit:contain;border-radius:8px;}.${i.LIGHTBOX_CLOSE}{position:absolute;top:16px;right:16px;background:rgba(255,255,255,0.15);border:none;color:white;font-size:24px;width:40px;height:40px;border-radius:50%;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:background 0.2s;}.${i.LIGHTBOX_CLOSE}:hover{background:rgba(255,255,255,0.3);}.${i.EDITOR}{display:flex;flex-direction:column;gap:8px;margin:4px 0 2px;}.${i.EDITOR_INPUT}{width:100%;box-sizing:border-box;resize:vertical;min-height:60px;background:rgba(255,255,255,0.06);border:1px solid rgba(255,255,255,0.14);border-radius:8px;padding:8px 10px;color:white;font-size:14px;font-family:inherit;line-height:1.45;outline:none;${se}}.${i.EDITOR_INPUT}:focus{border-color:rgba(46,144,250,0.7);}.${i.EDITOR_ACTIONS}{display:flex;justify-content:flex-end;gap:8px;}.${i.EDITOR_CANCEL},.${i.EDITOR_SAVE}{padding:5px 12px;border:1px solid transparent;border-radius:7px;font-size:13px;font-weight:600;font-family:inherit;cursor:pointer;}.${i.EDITOR_CANCEL}{background:rgba(255,255,255,0.08);border-color:rgba(255,255,255,0.12);color:white;}.${i.EDITOR_CANCEL}:hover{background:rgba(255,255,255,0.14);}.${i.EDITOR_SAVE}{background:#2E90FA;color:white;}.${i.EDITOR_SAVE}:hover:not(:disabled){background:#57A6FB;}.${i.EDITOR_SAVE}:disabled{background:rgba(255,255,255,0.10);color:rgba(255,255,255,0.4);cursor:not-allowed;}.${i.THREAD_EDITED}{font-size:12px;color:rgba(255,255,255,0.4);cursor:default;position:relative;flex:none;}.${i.THREAD_EDITED}::before{content:"\xB7";margin-right:4px;}.${i.THREAD_EDITED}::after{content:attr(data-full-date);position:absolute;bottom:calc(100% + 6px);left:50%;transform:translateX(-50%);background:#000;color:white;padding:4px 8px;border-radius:6px;font-size:11px;white-space:nowrap;opacity:0;pointer-events:none;transition:opacity 0.15s ease;}.${i.THREAD_EDITED}:hover::after{opacity:1;}.${i.INBOX_NOTICE}{margin:0 0 10px;padding:9px 11px;border-radius:8px;background:rgba(255,255,255,0.06);border:1px solid rgba(255,255,255,0.12);color:rgba(255,255,255,0.75);font-size:13px;line-height:1.4;}`,at=()=>` .${i.COMMENT_CURSOR},.${i.COMMENT_CURSOR} *{cursor:url('${it}') ${nt},auto !important;}`;function Re(o,e,t){let n=Zt(e,o);if(n)return o.adoptedStyleSheets=[...o.adoptedStyleSheets??[],n],()=>{o.adoptedStyleSheets=(o.adoptedStyleSheets??[]).filter(a=>a!==n)};let s=o.head??o;s.querySelector?.(`#${t}`)?.remove();let r=document.createElement("style");return r.id=t,r.textContent=e,s.appendChild(r),()=>r.remove()}function Zt(o,e){if(typeof CSSStyleSheet!="function"||!("adoptedStyleSheets"in e))return null;try{let t=new CSSStyleSheet;return t.replaceSync(o),t}catch{return null}}var L={commentAriaLabelPrefix:"Comment: ",anonymous:"Anonymous",justNow:"Just now",minutesAgoTemplate:"{n}m",hoursAgoTemplate:"{n}h",daysAgoTemplate:"{n}d",toolbarComment:"Comment",toolbarInbox:"Inbox",modifierAlt:"Alt",modifierCtrl:"Ctrl",modifierShift:"Shift",commentBoxAriaLabel:"New comment",commentPlaceholder:"Type your comment...",attachImage:"Attach image",send:"Send",tooltipAriaLabel:"Comment preview",close:"Close",popoverAriaLabel:"Comment thread",replyPlaceholder:"Reply...",attachedScreenshot:"Attached screenshot",screenshotPreview:"Screenshot preview",removeScreenshot:"Remove screenshot",inboxAriaLabel:"Comments inbox",inboxEmptyTitle:"No comments yet",inboxEmptyHintTemplate:"Press {n} and click anywhere on the page to start.",inboxEmptyAction:"Turn on comment mode",inboxNoMatches:"No comments match these filters",orphanedBadge:"Unanchored",hiddenBadge:"Hidden",filterAll:"All pages",filterCurrentPage:"Current page",filterTitle:"Filter",filterClear:"Clear",filterByPage:"Page",filterByStatus:"Status",back:"Back",deleteComment:"Delete",deleteReply:"Delete reply",replyOptions:"Reply options",editComment:"Edit",editReply:"Edit reply",copyLink:"Copy link",linkCopied:"Link copied",editorAriaLabel:"Edit text",editSave:"Save",editCancel:"Cancel",editedMark:"edited",editedAtPrefix:"Edited ",confirmDiscardTitle:"Discard changes?",confirmDiscardMessage:"The changes you made to this text have not been saved and will be lost.",confirmDiscard:"Discard",confirmKeepEditing:"Keep editing",commentNotFound:"That comment is not on this page.",confirmDelete:"Delete",confirmCancel:"Cancel",confirmDeleteCommentTitle:"Delete this comment?",confirmDeleteCommentMessage:"This comment will be permanently deleted. This action cannot be undone.",confirmDeleteThreadMessage:"This comment and all of its replies will be permanently deleted. This action cannot be undone.",confirmDeleteReplyTitle:"Delete this reply?",confirmDeleteReplyMessage:"This reply will be permanently deleted. This action cannot be undone.",copyAgentContext:"Copy agent context",copied:"Copied",statusLabel:"Status",prevComment:"Previous comment",nextComment:"Next comment",replyLink:"Reply",replyCountOne:"1 reply",replyCountTemplate:"{n} replies",commentOptions:"Comment options",moreOptions:"More",statusOpen:"Open",statusInProgress:"In progress",statusResolved:"Resolved",durationLessThanMinute:"<1m",resolvedInTemplate:"Resolved in {n}",typeLabel:"Type",priorityLabel:"Priority",unset:"Unset",typeBug:"Bug",typeSuggestion:"Suggestion",typeQuestion:"Question",typeImprovement:"Improvement",priorityHigh:"High",priorityMedium:"Medium",priorityLow:"Low",filterByType:"Type",filterByPriority:"Priority",contextSection:"Context",autoScreenshotLabel:"Automatic context",contextUrl:"URL",contextViewport:"Viewport",contextScreen:"Screen",contextBrowser:"Browser",contextOs:"OS"};var lt={commentAriaLabelPrefix:"Comentario: ",anonymous:"An\xF3nimo",justNow:"Justo ahora",minutesAgoTemplate:"{n}m",hoursAgoTemplate:"{n}h",daysAgoTemplate:"{n}d",toolbarComment:"Comentar",toolbarInbox:"Bandeja",modifierAlt:"Alt",modifierCtrl:"Ctrl",modifierShift:"May\xFAs",commentBoxAriaLabel:"Nuevo comentario",commentPlaceholder:"Escribe tu comentario...",attachImage:"Adjuntar imagen",send:"Enviar",tooltipAriaLabel:"Vista previa del comentario",close:"Cerrar",popoverAriaLabel:"Hilo de comentarios",replyPlaceholder:"Responder...",attachedScreenshot:"Captura de pantalla adjunta",screenshotPreview:"Vista previa de la captura",removeScreenshot:"Quitar captura de pantalla",inboxAriaLabel:"Bandeja de comentarios",inboxEmptyTitle:"Todav\xEDa no hay comentarios",inboxEmptyHintTemplate:"Pulsa {n} y haz clic en cualquier parte de la p\xE1gina para empezar.",inboxEmptyAction:"Activar modo",inboxNoMatches:"Ning\xFAn comentario coincide con estos filtros",orphanedBadge:"Desanclado",hiddenBadge:"Oculto",filterAll:"Todas las p\xE1ginas",filterCurrentPage:"P\xE1gina actual",filterTitle:"Filtrar",filterClear:"Limpiar",filterByPage:"P\xE1gina",filterByStatus:"Estado",back:"Volver",deleteComment:"Eliminar",deleteReply:"Eliminar respuesta",replyOptions:"Opciones de la respuesta",editComment:"Editar",editReply:"Editar respuesta",copyLink:"Copiar enlace",linkCopied:"Enlace copiado",editorAriaLabel:"Editar texto",editSave:"Guardar",editCancel:"Cancelar",editedMark:"editado",editedAtPrefix:"Editado el ",confirmDiscardTitle:"\xBFDescartar los cambios?",confirmDiscardMessage:"Los cambios que hiciste en este texto no se han guardado y se perder\xE1n.",confirmDiscard:"Descartar",confirmKeepEditing:"Seguir editando",commentNotFound:"Ese comentario no est\xE1 en esta p\xE1gina.",confirmDelete:"Eliminar",confirmCancel:"Cancelar",confirmDeleteCommentTitle:"\xBFEliminar comentario?",confirmDeleteCommentMessage:"Este comentario se eliminar\xE1 de forma permanente. Esta acci\xF3n no se puede deshacer.",confirmDeleteThreadMessage:"Este comentario y todas sus respuestas se eliminar\xE1n de forma permanente. Esta acci\xF3n no se puede deshacer.",confirmDeleteReplyTitle:"\xBFEliminar respuesta?",confirmDeleteReplyMessage:"Esta respuesta se eliminar\xE1 de forma permanente. Esta acci\xF3n no se puede deshacer.",copyAgentContext:"Copiar contexto de agente",copied:"Copiado",statusLabel:"Estado",prevComment:"Comentario anterior",nextComment:"Comentario siguiente",replyLink:"Responder",replyCountOne:"1 respuesta",replyCountTemplate:"{n} respuestas",commentOptions:"Opciones del comentario",moreOptions:"M\xE1s",statusOpen:"Abierto",statusInProgress:"En progreso",statusResolved:"Resuelto",durationLessThanMinute:"<1m",resolvedInTemplate:"Resuelto en {n}",typeLabel:"Tipo",priorityLabel:"Prioridad",unset:"Sin definir",typeBug:"Bug",typeSuggestion:"Sugerencia",typeQuestion:"Pregunta",typeImprovement:"Mejora",priorityHigh:"Alta",priorityMedium:"Media",priorityLow:"Baja",filterByType:"Tipo",filterByPriority:"Prioridad",contextSection:"Contexto",autoScreenshotLabel:"Contexto autom\xE1tico",contextUrl:"URL",contextViewport:"Viewport",contextScreen:"Pantalla",contextBrowser:"Navegador",contextOs:"SO"};var ae={en:L,es:lt},K="en";function ct(){let o=(navigator.language||K).slice(0,2).toLowerCase();return o in ae?o:K}function dt(o){let e=ae[o];return!e||o===K?ae[K]:{...ae[K],...e}}function v(o,e){return o.replace("{n}",String(e))}var Qt=6e4;function le(o,e){if(!Number.isFinite(o)||o<0)return"";let t=Math.floor(o/Qt);if(t<1)return e.durationLessThanMinute;if(t<60)return v(e.minutesAgoTemplate,t);let n=Math.floor(t/60);if(n<24){let l=t%60,c=v(e.hoursAgoTemplate,n);return l?`${c} ${v(e.minutesAgoTemplate,l)}`:c}let s=Math.floor(n/24),r=n%24,a=v(e.daysAgoTemplate,s);return r?`${a} ${v(e.hoursAgoTemplate,r)}`:a}var Ne=64,Jt=3,ei=5,ti=.6,ii=.7,ni=/^(css|sc|jsx|emotion)-/i,oi=/^data-(reactid|react-|v-|svelte-)/,ri=["id","name","role","aria-label"],si=["data-testid","name","aria-label"],we=o=>typeof CSS<"u"&&CSS.escape?CSS.escape(o):String(o).replace(/[^a-zA-Z0-9_-]/g,"\\$&"),ai=o=>String(o).replace(/["\\]/g,"\\$&"),q=(o,e)=>{try{return e.querySelectorAll(o).length===1}catch{return!1}},ut=o=>(o||"").replace(/\s+/g," ").trim().slice(0,Ne),li=o=>et.includes(o)||ni.test(o)?!1:!o.split(/[-_]/).some(e=>e.length>=5&&/\d/.test(e)),ci=o=>[...o.classList].filter(li),di=o=>{let e={};for(let{name:t,value:n}of o.attributes)(ri.includes(t)||t.startsWith("data-")&&!oi.test(t))&&n&&(e[t]=n.slice(0,Ne));return e},Le=o=>{let e=o.parentElement;if(!e)return{index:0,count:1};let t=[...e.children].filter(n=>n.tagName===o.tagName);return{index:t.indexOf(o),count:t.length}},hi=(o,e)=>{if(!o.id)return null;let t=`#${we(o.id)}`;return q(t,e)?t:null},pi=(o,e)=>{let t=o.tagName.toLowerCase();for(let n of si){let s=o.getAttribute(n);if(!s)continue;let r=`${t}[${n}="${ai(s)}"]`;if(q(r,e))return r}return null},ui=(o,e)=>{let t=[],n=o;for(let s=0;s<Jt&&n;s++){let r=ci(n),a=n.tagName.toLowerCase();if(t.unshift(r.length?`${a}.${r.map(we).join(".")}`:a),s===0&&!r.length)return null;let l=t.join(" > ");if(q(l,e))return l;n=n.parentElement}return null},mi=(o,e)=>{if(o===e.body)return"body";let t=[],n=o;for(let r=0;r<ei&&n;r++){if(n===e.body){t.unshift("body");break}if(n.id){let l=[`#${we(n.id)}`,...t].join(" > ");if(q(l,e))return l}let{index:a}=Le(n);t.unshift(`${n.tagName.toLowerCase()}:nth-of-type(${a+1})`),n=n.parentElement}let s=t.join(" > ");return q(s,e)?s:null},mt=(o,e)=>hi(o,e)||pi(o,e)||ui(o,e)||mi(o,e);function gt(o){return mt(o,o.ownerDocument)}function ft(o,e,t){let n=o.ownerDocument,{index:s,count:r}=Le(o);return{version:1,selector:mt(o,n),fingerprint:{tagName:o.tagName,textSnippet:ut(o.textContent),attributes:di(o),siblingIndex:s,siblingCount:r},relativeX:e,relativeY:t}}var gi=(o,e)=>{if(!o&&!e)return 1;if(!o||!e)return 0;if(o===e)return 1;if(o.startsWith(e)||e.startsWith(o))return .8;let t=new Set(o.split(" ")),n=new Set(e.split(" ")),s=0;for(let r of t)n.has(r)&&s++;return 2*s/(t.size+n.size)},fi=(o,e)=>{let t=Object.keys(e);if(!t.length)return 1;let n=0;for(let s of t)(o.getAttribute(s)||"").slice(0,Ne)===e[s]&&n++;return n/t.length},ht=(o,e)=>{let{index:t,count:n}=Le(o),s=Math.abs(t-e.siblingIndex),r=Math.max(e.siblingCount,n,1);return Math.max(0,1-s/r)},Ei=(o,e)=>{if(o.tagName!==e.tagName)return 0;let t=!!e.textSnippet,n=Object.keys(e.attributes||{}).length>0,s=.5,r=.3,a=.2;return n?t||(r+=s,s=0):(s+=r,r=0),!t&&!n?ht(o,e):s*gi(ut(o.textContent),e.textSnippet)+r*fi(o,e.attributes||{})+a*ht(o,e)},pt=(o,e)=>{let t=null;for(let n of o){let s=Ei(n,e);(!t||s>t.confidence)&&(t={element:n,confidence:s})}return t};function Be(o,e=document){if(o?.version!=null&&o.version>1)return null;let t=o?.fingerprint;if(!t||!t.tagName)return null;if(o.selector){let a=[];try{a=[...e.querySelectorAll(o.selector)]}catch{}let l=pt(a,t);if(l&&l.confidence>=ti)return l}if(!(!!t.textSnippet||Object.keys(t.attributes||{}).length>0))return null;let s;try{s=[...e.querySelectorAll(t.tagName)]}catch{return null}let r=pt(s,t);return r&&r.confidence>=ii?r:null}var ce="helldots-comments",de="helldots-pending-detail";function Me(){try{let o=localStorage.getItem(ce);if(!o)return[];let e=JSON.parse(o);return Array.isArray(e)?e:[]}catch(o){return console.warn("HellDots: could not read stored comments",o),[]}}function Et(o){try{return localStorage.setItem(ce,JSON.stringify(o)),!0}catch{return!1}}function he(o){if(Et(o))return!0;let e=o.map((s,r)=>({comment:s,index:r})).filter(({comment:s})=>s?.contextScreenshot).sort((s,r)=>{let a=Date.parse(s.comment.createdAt),l=Date.parse(r.comment.createdAt);return Number.isFinite(a)&&Number.isFinite(l)&&a!==l?a-l:s.index-r.index});if(e.length===0)return console.warn("HellDots: could not persist comments (storage quota exceeded, nothing left to shed)"),!1;let t=[...o],n=0;for(let{index:s}of e)if(t[s]={...t[s],contextScreenshot:null},n++,Et(t))return console.warn(`HellDots: localStorage quota exceeded \u2014 dropped the automatic context screenshot from the ${n} oldest comment(s) to keep all comments persisted. Comment text, replies and user-attached screenshots were not touched.`),!0;return console.warn(`HellDots: could not persist comments even after dropping all ${n} automatic context screenshot(s); storage quota exceeded`),!1}function De(o,e,t){let n=new Set(e.map(r=>String(r.id)));return[...o.filter(r=>!n.has(String(r.id))&&r.page!==t),...e]}var _t="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var bt=(o=21)=>{let e="",t=crypto.getRandomValues(new Uint8Array(o|=0));for(;o--;)e+=_t[t[o]&63];return e};var ke=()=>bt(),O=(o,e)=>String(o)===String(e);var pe="helldotsComment",$=(o,e=pe,t=location.href)=>{let n=new URL(t),s=o.page||n.pathname,r=s===n.pathname?n:new URL(s,n);return r.searchParams.set(e,String(o.id)),r.href},Ct=(o=pe,e=location.href)=>{try{return new URL(e).searchParams.get(o)}catch{return null}};var H=new Set,X=null,ue=null,_i=o=>[...o.querySelectorAll('[role="menuitem"], [role="menuitemradio"]')],Tt=4,bi=o=>{for(let e=o.parentElement;e;e=e.parentElement){let{overflowX:t,overflowY:n}=getComputedStyle(e);if(t!=="visible"||n!=="visible")return e.getBoundingClientRect()}return null},Ci=(o,e)=>{e.classList.remove(i.INBOX_MENU_UP);let t=bi(e),n=Math.min(t?.bottom??1/0,window.innerHeight),s=Math.max(t?.top??0,0),{height:r}=e.getBoundingClientRect(),a=o.getBoundingClientRect(),l=a.bottom+Tt+r,c=a.top-Tt-r;l>n&&c>=s&&e.classList.add(i.INBOX_MENU_UP)},xt=(o,e)=>(typeof e.composedPath=="function"?e.composedPath():[]).includes(o)||o.contains(e.target),Ti=()=>{X||(X=o=>{for(let e of[...H])xt(e.menu,o)||xt(e.button,o)||e.close()},document.addEventListener("mousedown",X,!0),ue=o=>{let e=[...H].pop();if(e){if(o.key==="Escape"){o.preventDefault(),o.stopPropagation(),e.close(),e.button.focus();return}if(["ArrowDown","ArrowUp","Home","End"].includes(o.key)){let t=_i(e.menu);if(t.length===0)return;o.preventDefault(),o.stopPropagation();let n=e.menu.getRootNode(),s=t.indexOf(n.activeElement),r;if(o.key==="Home")r=0;else if(o.key==="End")r=t.length-1;else if(s===-1)r=o.key==="ArrowDown"?0:t.length-1;else{let a=o.key==="ArrowDown"?1:-1;r=(s+a+t.length)%t.length}t[r].focus()}}},document.addEventListener("keydown",ue,!0))},xi=()=>{X&&(document.removeEventListener("mousedown",X,!0),X=null,document.removeEventListener("keydown",ue,!0),ue=null)},me=()=>{for(let o of[...H])o.close()},Z=(o,e)=>{let t={button:o,menu:e,close:()=>{e.style.display="none",o.setAttribute("aria-expanded","false"),H.delete(t),H.size===0&&xi()}},n=()=>{me(),e.style.display="block",Ci(o,e),o.setAttribute("aria-expanded","true"),H.add(t),Ti()},s=()=>e.style.display!=="none";return e.style.display="none",o.setAttribute("aria-expanded","false"),o.addEventListener("click",r=>{r.stopPropagation();let a=s();me(),a||n()}),{open:n,close:t.close,isOpen:s}};var Pe=new Set,Ot=()=>{for(let o of[...Pe])o(!1)},ge=(o,{title:e,message:t,confirmLabel:n,cancelLabel:s})=>new Promise(r=>{let a=document.createElement("div");a.className=i.CONFIRM,a.style.zIndex=String(S.CONFIRM);let l=document.createElement("div");l.className=i.CONFIRM_PANEL,l.setAttribute("role","alertdialog"),l.setAttribute("aria-modal","true");let c=document.createElement("h2");c.className=i.CONFIRM_TITLE,c.textContent=e,c.id=`hd-confirm-title-${Math.random().toString(36).slice(2,9)}`,l.setAttribute("aria-labelledby",c.id);let d=document.createElement("p");d.className=i.CONFIRM_MESSAGE,d.textContent=t,d.id=`hd-confirm-message-${Math.random().toString(36).slice(2,9)}`,l.setAttribute("aria-describedby",d.id);let p=document.createElement("div");p.className=i.CONFIRM_ACTIONS;let h=document.createElement("button");h.type="button",h.className=i.CONFIRM_CANCEL,h.textContent=s;let m=document.createElement("button");m.type="button",m.className=i.CONFIRM_ACCEPT,m.textContent=n,p.appendChild(h),p.appendChild(m),l.appendChild(c),l.appendChild(d),l.appendChild(p),a.appendChild(l);let u=o.activeElement||document.activeElement,g=!1,E=b=>{g||(g=!0,Pe.delete(E),document.removeEventListener("keydown",_,!0),a.remove(),u?.focus?.(),r(b))},_=b=>{if(b.key==="Escape"){b.stopPropagation(),b.preventDefault(),E(!1);return}if(b.key!=="Tab")return;let B=[h,m],f=o.activeElement||document.activeElement,x=B.indexOf(f);b.preventDefault(),(b.shiftKey?B[(x<=0?B.length:x)-1]:B[(x+1)%B.length]).focus()};h.addEventListener("click",()=>E(!1)),m.addEventListener("click",()=>E(!0));let C=!1;a.addEventListener("mousedown",b=>{C=b.target===a,b.stopPropagation()}),a.addEventListener("click",b=>{b.target===a&&C&&E(!1),C=!1}),Pe.add(E),document.addEventListener("keydown",_,!0),(o.body||o).appendChild(a),h.focus()});var yt='<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"/><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/></svg>',Oi='<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"/></svg>',yi='<svg width="14" height="14" viewBox="0 0 24 24" fill="currentColor"><circle cx="5" cy="12" r="1.6"/><circle cx="12" cy="12" r="1.6"/><circle cx="19" cy="12" r="1.6"/></svg>',U=o=>{if(navigator.clipboard?.writeText)return navigator.clipboard.writeText(o).catch(()=>{});let e=document.createElement("textarea");e.value=o,e.style.position="fixed",e.style.opacity="0",document.body.appendChild(e),e.select();try{document.execCommand("copy")}catch{}return e.remove(),Promise.resolve()},V=(o,e)=>({open:e.statusOpen,in_progress:e.statusInProgress,resolved:e.statusResolved})[o]||e.statusOpen,D=(o,e)=>({bug:e.typeBug,suggestion:e.typeSuggestion,question:e.typeQuestion,improvement:e.typeImprovement})[o]||e.unset,k=(o,e)=>({high:e.priorityHigh,medium:e.priorityMedium,low:e.priorityLow})[o]||e.unset,F=({action:o,options:e,value:t,colorOf:n,labelOf:s,tooltipLabel:r,onSelect:a,showLabel:l=!1})=>{let c=document.createElement("div");c.style.position="relative";let d=document.createElement("button");d.type="button",d.className=i.INBOX_ACTION_BTN,l&&d.classList.add(i.INBOX_ACTION_BTN_LABELED),d.dataset.action=o,d.setAttribute("aria-haspopup","true");let p=document.createElement("span");p.className=i.INBOX_STATUS_DOT,d.appendChild(p);let h=null;l&&(h=document.createElement("span"),h.className=i.INBOX_ACTION_LABEL,d.appendChild(h));let m=document.createElement("div");m.className=i.INBOX_MENU,m.setAttribute("role","menu");let u=Z(d,m),g=t,E=()=>{let _=`${r}: ${s(g)}`;p.style.backgroundColor=n(g),d.dataset.hdTooltip=_,d.setAttribute("aria-label",_),h&&(h.textContent=s(g)),m.querySelectorAll("[data-picker-option]").forEach(C=>{let y=C.dataset.pickerOption,b=y===""?null:y;C.setAttribute("aria-checked",String(b===g))})};for(let _ of e){let C=document.createElement("button");C.type="button",C.className=i.INBOX_MENU_ITEM,C.dataset.pickerOption=_===null?"":_,C.setAttribute("role","menuitemradio");let y=document.createElement("span");y.className=i.INBOX_STATUS_DOT,y.style.backgroundColor=n(_),C.appendChild(y),C.appendChild(document.createTextNode(s(_))),C.addEventListener("click",b=>{b.stopPropagation(),u.close(),_!==g&&(g=_,a(_),E())}),m.appendChild(C)}return c.appendChild(d),c.appendChild(m),E(),c},$e=({label:o,tooltip:e,items:t})=>{let n=document.createElement("div");n.style.position="relative";let s=document.createElement("button");s.type="button",s.className=i.INBOX_ACTION_BTN,s.dataset.action="menu",e&&(s.dataset.hdTooltip=e),s.setAttribute("aria-label",o),s.innerHTML=yi;let r=document.createElement("div");r.className=i.INBOX_MENU,r.setAttribute("role","menu");let a=Z(s,r);for(let l of t){let c=document.createElement("button");c.type="button",c.className=i.INBOX_MENU_ITEM,c.setAttribute("role","menuitem"),c.textContent=l.label,c.addEventListener("click",async d=>{if(d.stopPropagation(),l.feedbackLabel){l.onSelect(),c.textContent=l.feedbackLabel,setTimeout(()=>{c.textContent=l.label,a.close()},1200);return}if(a.close(),l.confirm){let p=c.getRootNode();if(!await ge(p,l.confirm()))return}l.onSelect()}),r.appendChild(c)}return n.appendChild(s),n.appendChild(r),n},fe=(o,{strings:e,onCopy:t,onCopyLink:n,onEdit:s,onSetStatus:r,onSetType:a,onSetPriority:l,onDelete:c})=>{let d=document.createElement("div");d.className=i.INBOX_CARD_ACTIONS;let p=document.createElement("button");return p.type="button",p.className=i.INBOX_ACTION_BTN,p.dataset.action="copy",p.dataset.hdTooltip=e.copyAgentContext,p.setAttribute("aria-label",e.copyAgentContext),p.innerHTML=yt,p.addEventListener("click",h=>{h.stopPropagation(),t(o),p.innerHTML=Oi,p.dataset.hdTooltip=e.copied,setTimeout(()=>{p.innerHTML=yt,p.dataset.hdTooltip=e.copyAgentContext},1500)}),d.appendChild(p),d.appendChild(F({action:"status",options:M,value:o.status||"open",colorOf:h=>oe[h]||"",labelOf:h=>V(h,e),tooltipLabel:e.statusLabel,onSelect:h=>r(o,h),showLabel:!0})),d.appendChild(F({action:"type",options:[null,...N],value:o.type||null,colorOf:h=>j[h]||"transparent",labelOf:h=>D(h,e),tooltipLabel:e.typeLabel,onSelect:h=>a?.(o,h),showLabel:!0})),d.appendChild(F({action:"priority",options:[null,...w],value:o.priority||null,colorOf:h=>W[h]||"transparent",labelOf:h=>k(h,e),tooltipLabel:e.priorityLabel,onSelect:h=>l?.(o,h),showLabel:!0})),d.appendChild($e({label:e.commentOptions,tooltip:e.moreOptions,items:[{label:e.copyLink,feedbackLabel:e.linkCopied,onSelect:()=>n?.(o)},{label:e.editComment,onSelect:()=>s?.(o)},{label:e.deleteComment,onSelect:()=>c(o),confirm:()=>({title:e.confirmDeleteCommentTitle,message:o.replies?.length?e.confirmDeleteThreadMessage:e.confirmDeleteCommentMessage,confirmLabel:e.confirmDelete,cancelLabel:e.confirmCancel})}]})),d};var z=({value:o,strings:e,onInput:t,onSave:n,onCancel:s})=>{let r=document.createElement("div");r.className=i.EDITOR;let a=document.createElement("textarea");a.className=i.EDITOR_INPUT,a.value=o,a.rows=3,a.setAttribute("aria-label",e.editorAriaLabel);let l=document.createElement("div");l.className=i.EDITOR_ACTIONS;let c=document.createElement("button");c.type="button",c.className=i.EDITOR_CANCEL,c.textContent=e.editCancel;let d=document.createElement("button");d.type="button",d.className=i.EDITOR_SAVE,d.textContent=e.editSave;let p=()=>{d.disabled=a.value.trim().length===0};return p(),a.addEventListener("input",()=>{p(),t(a.value)}),a.addEventListener("keydown",h=>{if(h.key==="Escape"){h.stopPropagation(),h.preventDefault(),s();return}h.key==="Enter"&&(h.metaKey||h.ctrlKey)&&!d.disabled&&(h.preventDefault(),n(a.value))}),c.addEventListener("click",h=>{h.stopPropagation(),s()}),d.addEventListener("click",h=>{h.stopPropagation(),d.disabled||n(a.value)}),l.appendChild(c),l.appendChild(d),r.appendChild(a),r.appendChild(l),queueMicrotask(()=>{a.focus(),a.setSelectionRange(a.value.length,a.value.length)}),r},Ee=(o,e)=>ge(o,{title:e.confirmDiscardTitle,message:e.confirmDiscardMessage,confirmLabel:e.confirmDiscard,cancelLabel:e.confirmKeepEditing});var Si=(o,e)=>{let t=Date.now()-new Date(o).getTime(),n=Math.floor(t/6e4),s=Math.floor(t/36e5),r=Math.floor(t/864e5);return n<1?e.justNow:n<60?v(e.minutesAgoTemplate,n):s<24?v(e.hoursAgoTemplate,s):v(e.daysAgoTemplate,r)},At=(o,e)=>new Intl.DateTimeFormat(e,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}).format(new Date(o)),Q=(o,e,t,n,s=null)=>{let r=document.createElement("div");r.className=i.THREAD_META;let a=document.createElement("span");a.className=i.THREAD_AUTHOR,a.textContent=o||t.anonymous;let l=document.createElement("span");return l.className=i.THREAD_TIME,l.textContent=Si(e,t),l.dataset.fullDate=At(e,n),r.appendChild(a),r.appendChild(l),s&&r.appendChild(He(s,t,n)),r},He=(o,e,t)=>{let n=document.createElement("span");return n.className=i.THREAD_EDITED,n.textContent=e.editedMark,n.dataset.fullDate=e.editedAtPrefix+At(o,t),n},Xe=()=>/Mac|iPod|iPhone|iPad/.test(navigator.userAgent),Fe=(o,e)=>{let t=Xe(),n={alt:t?"\u2325":e.modifierAlt,ctrl:t?"\u2318":e.modifierCtrl,shift:t?"\u21E7":e.modifierShift},s=n[o.shortcutModifier]||n.alt,r=o.shortcutKey?.toUpperCase()||"C";return`${s} + ${r}`},_e='<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"/></svg>',Ai='<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"/><circle cx="8.5" cy="8.5" r="1.5"/><polyline points="21 15 16 10 5 21"/></svg>',vi='<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M22 2L11 13M22 2L15 22L11 13M11 13L2 9L22 2"/></svg>',Ii='<svg width="16" height="16" viewBox="0 0 16 16" stroke-linejoin="round" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M2.8914 10.4028L2.98327 10.6318C3.22909 11.2445 3.5 12.1045 3.5 13C3.5 13.3588 3.4564 13.7131 3.38773 14.0495C3.69637 13.9446 4.01409 13.8159 4.32918 13.6584C4.87888 13.3835 5.33961 13.0611 5.70994 12.7521L6.22471 12.3226L6.88809 12.4196C7.24851 12.4724 7.61994 12.5 8 12.5C11.7843 12.5 14.5 9.85569 14.5 7C14.5 4.14431 11.7843 1.5 8 1.5C4.21574 1.5 1.5 4.14431 1.5 7C1.5 8.18175 1.94229 9.29322 2.73103 10.2153L2.8914 10.4028ZM2.8135 15.7653C1.76096 16 1 16 1 16C1 16 1.43322 15.3097 1.72937 14.4367C1.88317 13.9834 2 13.4808 2 13C2 12.3826 1.80733 11.7292 1.59114 11.1903C0.591845 10.0221 0 8.57152 0 7C0 3.13401 3.58172 0 8 0C12.4183 0 16 3.13401 16 7C16 10.866 12.4183 14 8 14C7.54721 14 7.10321 13.9671 6.67094 13.9038C6.22579 14.2753 5.66881 14.6656 5 15C4.23366 15.3832 3.46733 15.6195 2.8135 15.7653Z"/></svg>',Ri='<svg width="16" height="16" viewBox="0 0 16 16" stroke-linejoin="round" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M1.67705 7.5L3.92705 3H12.0729L14.3229 7.5H10H9.25V8.25C9.25 8.94036 8.69036 9.5 8 9.5C7.30964 9.5 6.75 8.94036 6.75 8.25V7.5H6H1.67705ZM1.5 9V12C1.5 12.5523 1.94772 13 2.5 13H13.5C14.0523 13 14.5 12.5523 14.5 12V9H10.6465C10.32 10.1543 9.25878 11 8 11C6.74122 11 5.67998 10.1543 5.35352 9H1.5ZM3 1.5H13L15.8944 7.28885C15.9639 7.42771 16 7.58082 16 7.73607V12C16 13.3807 14.8807 14.5 13.5 14.5H2.5C1.11929 14.5 0 13.3807 0 12V7.73607C0 7.58082 0.0361451 7.42771 0.105573 7.28885L3 1.5Z"/></svg>',be=({areaClassName:o,inputTag:e="textarea",inputClassName:t,inputId:n,inputPlaceholder:s,submitBtnId:r,fileInputId:a},l)=>{let c=document.createElement("div");c.className=o;let d=document.createElement(e);n&&(d.id=n),t&&(d.className=t),d.placeholder=s,d.setAttribute("aria-label",s),e==="input"&&(d.type="text");let p=document.createElement("div");p.className=i.SCREENSHOTS_CONTAINER;let h=document.createElement("div");h.className=i.COMMENT_ACTIONS_BAR;let m=document.createElement("button");m.className=i.ATTACH_IMAGE_BTN,m.type="button",m.setAttribute("aria-label",l.attachImage),m.innerHTML=Ai;let u=document.createElement("input");u.type="file",a&&(u.id=a),u.accept="image/*",u.style.display="none";let g=document.createElement("button");return r&&(g.id=r),g.className=i.THREAD_SUBMIT,g.type="button",g.setAttribute("aria-label",l.send),g.innerHTML=vi,h.appendChild(m),h.appendChild(u),h.appendChild(g),c.appendChild(d),c.appendChild(p),c.appendChild(h),{container:c,inputEl:d,screenshotsContainer:p,attachBtn:m,fileInput:u,submitBtn:g}},St=(o,e,t,n)=>{let s=document.createElement("div");s.className=i.TOOLBAR_ACTION_WRAPPER;let r=document.createElement("div");r.className=i.TOOLBAR_ACTION_TOOLTIP,t.forEach(l=>r.appendChild(l));let a=document.createElement("button");return a.type="button",a.className=`${i.TOOLBAR_ACTION_BTN} ${o}`,a.setAttribute("aria-label",n),a.innerHTML=e,s.appendChild(r),s.appendChild(a),s},vt=(o={},e=L)=>{let t=document.createElement("div");t.id=T.TOOLBAR;let n=document.createElement("div");n.className=i.TOOLBAR_ACTIONS;let s=document.createElement("span");s.className=i.TOOLBAR_TEXT,s.textContent=e.toolbarComment;let r=document.createElement("span");r.className=i.SHORTCUT_HINT,r.textContent=Fe(o,e);let a=St(i.TOOLBAR_COMMENT_BTN,Ii,[s,r],e.toolbarComment);a.querySelector(`.${i.TOOLBAR_COMMENT_BTN}`)?.setAttribute("aria-pressed","false");let l=document.createElement("span");l.className=i.TOOLBAR_TEXT,l.textContent=e.toolbarInbox;let c=St(i.TOOLBAR_MENU_BTN,Ri,[l],e.toolbarInbox);return n.appendChild(a),n.appendChild(c),t.appendChild(n),t},Ue=(o,e,{includeStatus:t=!1,includeClassification:n=!0}={})=>{let s=document.createElement("div");s.className=i.INBOX_BADGES;let r=(a,l,c)=>{let d=document.createElement("span");d.className=`${i.BADGE} ${l}`,d.textContent=a,c&&(d.style.borderColor=c),s.appendChild(d)};if(t){let a=o.status||"open";r(V(a,e),i.BADGE_STATUS,oe[a])}n&&o.type&&r(D(o.type,e),i.BADGE_TYPE,j[o.type]),n&&o.priority&&r(k(o.priority,e),i.BADGE_PRIORITY,W[o.priority]);for(let a of o.tags||[])r(a,i.BADGE_TAG,null);if(o.status==="resolved"){let a=o.resolvedAt?le(new Date(o.resolvedAt).getTime()-new Date(o.createdAt).getTime(),e):"";r(v(e.resolvedInTemplate,a||"\u2014"),i.BADGE_DURATION,null)}return s.children.length?s:null},Ni=o=>{let e=document.createElement("div");e.className=i.CLASSIFY_ROW;let t=null,n=null,s=()=>{e.replaceChildren(),e.appendChild(F({action:"type",options:[null,...N],value:null,colorOf:r=>j[r]||"transparent",labelOf:r=>D(r,o),tooltipLabel:o.typeLabel,onSelect:r=>t=r,showLabel:!0})),e.appendChild(F({action:"priority",options:[null,...w],value:null,colorOf:r=>W[r]||"transparent",labelOf:r=>k(r,o),tooltipLabel:o.priorityLabel,onSelect:r=>n=r,showLabel:!0}))};return s(),{container:e,getType:()=>t,getPriority:()=>n,reset:()=>{t=null,n=null,s()}}},It=(o=L)=>{let e=document.createElement("div");e.id=T.COMMENT_BOX,e.setAttribute("role","dialog"),e.setAttribute("aria-label",o.commentBoxAriaLabel);let{container:t}=be({areaClassName:i.COMMENT_INPUT_AREA,inputTag:"textarea",inputId:T.COMMENT_INPUT,inputPlaceholder:o.commentPlaceholder,submitBtnId:T.SUBMIT_COMMENT,fileInputId:T.ATTACH_IMAGE_INPUT},o),n=Ni(o);return e.appendChild(n.container),e.appendChild(t),e.style.display="none",e.classify=n,e},P=o=>String(o).replace(/[\\"]/g,"\\$&"),Rt=o=>`[data-comment-id="${P(o)}"]`,Ve=o=>o.screenshots||(o.screenshot?[o.screenshot]:[]),G=(o,e,{strings:t,onShow:n,rerender:s})=>{o.innerHTML="",o.classList.toggle(i.ACTIVE,e.length>0),e.forEach((r,a)=>{let l=document.createElement("div");l.className=i.SCREENSHOT_ITEM;let c=document.createElement("img");c.className=i.SCREENSHOT_IMG,c.src=r,c.alt=t.attachedScreenshot,Nt(c,()=>n(r));let d=document.createElement("button");d.type="button",d.className=i.SCREENSHOT_REMOVE,d.setAttribute("aria-label",t.removeScreenshot),d.innerHTML="×",d.onclick=p=>{p.stopPropagation(),e.splice(a,1),s()},l.appendChild(c),l.appendChild(d),o.appendChild(l)})},Y=(o,e,t)=>{o.addEventListener("change",n=>{let s=n.target.files[0];if(!s||s.type&&!s.type.startsWith("image/"))return;let r=e();if(r.length>=ne)return;let a=new FileReader;a.onload=l=>{r.push(l.target.result),t()},a.readAsDataURL(s),o.value=""})},R=(o,e)=>{o.querySelectorAll(`.${i.SCREENSHOT_IMG}`).forEach(t=>{Nt(t,()=>e(t.src))})},Nt=(o,e)=>{o.setAttribute("role","button"),o.setAttribute("tabindex","0"),o.addEventListener("click",t=>{t.stopPropagation(),e()}),o.addEventListener("keydown",t=>{(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),e())})},wt=(o,e=L)=>{let t=document.createElement("div");return t.className=i.CIRCLE,t.dataset.commentId=o.id,t.setAttribute("role","button"),t.setAttribute("tabindex","0"),t.setAttribute("aria-label",`${e.commentAriaLabelPrefix}${o.text}`),t.style.cssText=`
|
|
58
5
|
position: absolute;
|
|
59
|
-
bottom: calc(100% + 10px);
|
|
60
|
-
left: 50%;
|
|
61
|
-
transform: translateX(-50%) translateY(4px);
|
|
62
|
-
display: flex;
|
|
63
|
-
align-items: center;
|
|
64
|
-
gap: 8px;
|
|
65
|
-
background: rgba(20, 20, 23, 0.95);
|
|
66
|
-
backdrop-filter: blur(16px);
|
|
67
|
-
-webkit-backdrop-filter: blur(16px);
|
|
68
|
-
padding: 8px 12px;
|
|
69
|
-
border-radius: 10px;
|
|
70
|
-
border: 1px solid rgba(255, 255, 255, 0.08);
|
|
71
|
-
box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
|
|
72
|
-
color: white;
|
|
73
|
-
white-space: nowrap;
|
|
74
|
-
opacity: 0;
|
|
75
|
-
pointer-events: none;
|
|
76
|
-
transition: opacity 0.15s ease, transform 0.15s ease;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
.${o.TOOLBAR_ACTION_WRAPPER}:hover .${o.TOOLBAR_ACTION_TOOLTIP} {
|
|
80
|
-
opacity: 1;
|
|
81
6
|
pointer-events: auto;
|
|
82
|
-
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
.${o.TOOLBAR_TEXT} {
|
|
86
|
-
font-size: 13px;
|
|
87
|
-
font-weight: 500;
|
|
88
|
-
letter-spacing: -0.01em;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
.${o.SHORTCUT_HINT} {
|
|
92
|
-
font-size: 11px;
|
|
93
|
-
font-weight: 500;
|
|
94
|
-
color: rgba(255, 255, 255, 0.5);
|
|
95
|
-
background: rgba(255, 255, 255, 0.06);
|
|
96
|
-
border: 1px solid rgba(255, 255, 255, 0.1);
|
|
97
|
-
padding: 2px 6px;
|
|
98
|
-
border-radius: 5px;
|
|
99
|
-
line-height: 1;
|
|
100
|
-
white-space: nowrap;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
.${o.TOOLBAR_ACTIONS} {
|
|
104
|
-
display: flex;
|
|
105
|
-
flex-direction: row;
|
|
106
|
-
background: rgba(20, 20, 23, 0.95);
|
|
107
|
-
backdrop-filter: blur(16px);
|
|
108
|
-
-webkit-backdrop-filter: blur(16px);
|
|
109
|
-
border-radius: 12px;
|
|
110
|
-
box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
.${o.TOOLBAR_ACTION_BTN} {
|
|
114
|
-
width: 42px;
|
|
115
|
-
height: 42px;
|
|
116
|
-
display: flex;
|
|
117
|
-
align-items: center;
|
|
118
|
-
justify-content: center;
|
|
119
|
-
background: none;
|
|
120
|
-
border: none;
|
|
121
|
-
outline: none;
|
|
122
|
-
color: rgba(255, 255, 255, 0.65);
|
|
123
|
-
cursor: pointer;
|
|
124
|
-
transition: background 0.2s, color 0.2s;
|
|
125
|
-
padding: 0;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
.${o.TOOLBAR_ACTION_WRAPPER}:first-child .${o.TOOLBAR_ACTION_BTN} {
|
|
129
|
-
border-radius: 12px 0 0 12px;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
.${o.TOOLBAR_ACTION_WRAPPER}:last-child .${o.TOOLBAR_ACTION_BTN} {
|
|
133
|
-
border-radius: 0 12px 12px 0;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
.${o.TOOLBAR_ACTION_BTN}:hover {
|
|
137
|
-
background: rgba(255, 255, 255, 0.08);
|
|
138
|
-
color: white;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
.${o.TOOLBAR_COMMENT_BTN}.${o.ACTIVE} {
|
|
142
|
-
color: #2E90FA;
|
|
143
|
-
background: rgba(46, 144, 250, 0.1);
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
#${T.COMMENT_BOX} {
|
|
148
|
-
position: fixed;
|
|
149
|
-
background: #1C1C1E;
|
|
150
|
-
border-radius: 12px;
|
|
151
|
-
box-shadow: 0 4px 20px rgba(0,0,0,0.4);
|
|
152
|
-
padding: 16px;
|
|
153
|
-
z-index: ${O.COMMENT_BOX};
|
|
154
|
-
width: min(400px, calc(100vw - 24px));
|
|
155
|
-
display: none;
|
|
156
|
-
box-sizing: border-box;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
#${T.COMMENT_BOX} .${o.COMMENT_INPUT_AREA} {
|
|
160
|
-
display: flex;
|
|
161
|
-
flex-direction: column;
|
|
162
|
-
gap: 0;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
/* Shares the comment box's own 16px inset instead of adding its own, so
|
|
166
|
-
the pickers line up with the textarea below them. The hairline is the
|
|
167
|
-
mirror of the one .thread-input-area carries on top. */
|
|
168
|
-
.${o.CLASSIFY_ROW} {
|
|
169
|
-
display: flex;
|
|
170
|
-
align-items: center;
|
|
171
|
-
flex-wrap: wrap;
|
|
172
|
-
gap: 8px;
|
|
173
|
-
padding: 0 0 10px;
|
|
174
|
-
border-bottom: 1px solid rgba(255, 255, 255, 0.08);
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
/* In the inbox the pickers sit in a strip of other icon buttons and read
|
|
178
|
-
as controls on their own. Alone at the top of an empty comment box
|
|
179
|
-
they need an outline to do the same. */
|
|
180
|
-
.${o.CLASSIFY_ROW} .${o.INBOX_ACTION_BTN} {
|
|
181
|
-
height: 26px;
|
|
182
|
-
border: 1px solid rgba(255, 255, 255, 0.12);
|
|
183
|
-
border-radius: 8px;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
.${o.CLASSIFY_ROW} .${o.INBOX_ACTION_BTN}:hover {
|
|
187
|
-
border-color: rgba(255, 255, 255, 0.28);
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
#${T.COMMENT_INPUT} {
|
|
191
|
-
flex: 1;
|
|
192
|
-
min-height: 20px;
|
|
193
|
-
background: #1C1C1E;
|
|
194
|
-
border: none;
|
|
195
|
-
resize: none;
|
|
196
|
-
font-family: inherit;
|
|
197
|
-
color: white;
|
|
198
|
-
font-size: 14px;
|
|
199
|
-
line-height: 1.4;
|
|
200
|
-
box-sizing: border-box;
|
|
201
|
-
field-sizing: content;
|
|
202
|
-
padding: 8px 0;
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
#${T.COMMENT_INPUT}::placeholder {
|
|
206
|
-
color: rgba(255, 255, 255, 0.5);
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
#${T.COMMENT_INPUT}:focus {
|
|
210
|
-
outline: none;
|
|
211
|
-
box-shadow: none;
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
.${o.COMMENT_ACTIONS_BAR} {
|
|
215
|
-
display: flex;
|
|
216
|
-
align-items: center;
|
|
217
|
-
justify-content: space-between;
|
|
218
|
-
padding-top: 12px;
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
.${o.ATTACH_IMAGE_BTN} {
|
|
222
|
-
background: none;
|
|
223
|
-
border: none;
|
|
224
|
-
color: rgba(255, 255, 255, 0.5);
|
|
225
|
-
cursor: pointer;
|
|
226
|
-
display: flex;
|
|
227
|
-
align-items: center;
|
|
228
|
-
justify-content: center;
|
|
229
|
-
border-radius: 6px;
|
|
230
|
-
transition: background 0.2s, color 0.2s;
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
.${o.ATTACH_IMAGE_BTN}:hover {
|
|
234
|
-
background: rgba(255, 255, 255, 0.1);
|
|
235
|
-
color: rgba(255, 255, 255, 0.8);
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
.${o.CIRCLE} {
|
|
239
|
-
position: absolute;
|
|
240
|
-
width: 28px;
|
|
241
|
-
height: 28px;
|
|
242
|
-
background: #2E90FA;
|
|
243
|
-
border-radius: 0% 100% 100% 100%;
|
|
244
|
-
border: 2px solid #FFF;
|
|
245
|
-
cursor: pointer;
|
|
246
|
-
box-shadow: 0 1px 5px rgba(0,0,0,0.2);
|
|
247
|
-
transition: transform 0.2s, background 0.2s;
|
|
248
|
-
z-index: ${O.CIRCLE};
|
|
249
|
-
transform: translate(-50%, -50%);
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
.${o.CIRCLE}:hover {
|
|
253
|
-
transform: translate(-50%, -50%) scale(1.2) !important;
|
|
254
|
-
background: rgb(0, 123, 255);
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
.${o.CIRCLE}.${o.HIGHLIGHT} {
|
|
258
|
-
transform: translate(-50%, -50%) scale(1.2) !important;
|
|
259
|
-
background: rgb(0, 123, 255);
|
|
260
|
-
box-shadow: 0 0 0 4px rgba(46, 144, 250, 0.35), 0 1px 5px rgba(0,0,0,0.2);
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
/* The marker whose thread is open. Grows like hover does \u2014 the pointer
|
|
264
|
-
has to leave the circle to reach the popover, so hover alone can't
|
|
265
|
-
carry the selected state \u2014 and adds a heavier ring. Size and ring,
|
|
266
|
-
not colour alone (WCAG 1.4.1). */
|
|
267
|
-
.${o.CIRCLE}.${o.CIRCLE_ACTIVE} {
|
|
268
|
-
transform: translate(-50%, -50%) scale(1.2) !important;
|
|
269
|
-
background: rgb(0, 123, 255);
|
|
270
|
-
box-shadow: 0 0 0 5px rgba(46, 144, 250, 0.5), 0 1px 5px rgba(0,0,0,0.2);
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
.${o.CIRCLE_WRAPPER} {
|
|
274
|
-
position: absolute;
|
|
275
|
-
left: 0;
|
|
276
|
-
top: 0;
|
|
277
|
-
width: 100%;
|
|
278
|
-
height: 100%;
|
|
279
|
-
pointer-events: none;
|
|
280
|
-
z-index: ${O.CIRCLE};
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
.${o.TOOLTIP} {
|
|
284
|
-
position: fixed;
|
|
285
|
-
background: #1C1C1E;
|
|
286
|
-
border-radius: 12px;
|
|
287
|
-
padding: 16px;
|
|
288
|
-
box-shadow: 0 4px 20px rgba(0,0,0,0.4);
|
|
289
|
-
width: min(400px, calc(100vw - 24px));
|
|
290
|
-
max-height: calc(100vh - 20px);
|
|
291
|
-
overflow-y: auto;
|
|
292
|
-
overscroll-behavior: contain;${Q}
|
|
293
|
-
z-index: ${O.TOOLTIP};
|
|
294
|
-
color: white;
|
|
295
|
-
font-size: 14px;
|
|
296
|
-
line-height: 1.5;
|
|
297
|
-
box-sizing: border-box;
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
.${o.TOOLTIP} .${o.THREAD_HEADER} {
|
|
301
|
-
padding: 0 0 0;
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
.${o.TOOLTIP} .${o.THREAD_BODY} {
|
|
305
|
-
padding: 8px 0;
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
.${o.THREAD_POPOVER} {
|
|
309
|
-
position: fixed;
|
|
310
|
-
background: #1C1C1E;
|
|
311
|
-
border-radius: 12px;
|
|
312
|
-
padding: 16px;
|
|
313
|
-
box-shadow: 0 4px 20px rgba(0,0,0,0.4);
|
|
314
|
-
width: min(400px, calc(100vw - 24px));
|
|
315
|
-
max-height: calc(100vh - 20px);
|
|
316
|
-
display: flex;
|
|
317
|
-
flex-direction: column;
|
|
318
|
-
z-index: ${O.TOOLTIP};
|
|
319
|
-
color: white;
|
|
320
|
-
font-size: 14px;
|
|
321
|
-
line-height: 1.5;
|
|
322
|
-
box-sizing: border-box;
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
/* The header, its action row and the reply box are pinned; the comment
|
|
326
|
-
body, context block and replies scroll between them. The min-height: 0
|
|
327
|
-
is required \u2014 a flex item's default minimum is its content height, so
|
|
328
|
-
without it the popover grows past max-height instead of scrolling. */
|
|
329
|
-
.${o.THREAD_POPOVER} > .${o.THREAD_HEADER},
|
|
330
|
-
.${o.THREAD_POPOVER} > .${o.THREAD_ACTIONS_ROW},
|
|
331
|
-
.${o.THREAD_POPOVER} > .${o.THREAD_INPUT_AREA} {
|
|
332
|
-
flex: none;
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
.${o.THREAD_SCROLL} {
|
|
336
|
-
flex: 1 1 auto;
|
|
337
|
-
min-height: 0;
|
|
338
|
-
overflow-y: auto;
|
|
339
|
-
overscroll-behavior: contain;${Q}
|
|
340
|
-
}
|
|
341
|
-
${Tt(`.${o.THREAD_SCROLL}`,`.${o.TOOLTIP}`,`.${o.INBOX_LIST}`,`.${o.INBOX_DETAIL}`,`.${o.EDITOR_INPUT}`)}
|
|
342
|
-
.${o.INBOX_PANEL} {
|
|
343
|
-
position: fixed;
|
|
344
|
-
top: 16px;
|
|
345
|
-
right: 16px;
|
|
346
|
-
bottom: 16px;
|
|
347
|
-
width: 380px;
|
|
348
|
-
display: flex;
|
|
349
|
-
flex-direction: column;
|
|
350
|
-
background: #1C1C1E;
|
|
351
|
-
border: 1px solid rgba(255,255,255,0.08);
|
|
352
|
-
border-radius: 14px;
|
|
353
|
-
box-shadow: 0 8px 32px rgba(0,0,0,0.5);
|
|
354
|
-
z-index: ${O.COMMENT_BOX};
|
|
355
|
-
color: white;
|
|
356
|
-
font-size: 14px;
|
|
357
|
-
line-height: 1.5;
|
|
358
|
-
box-sizing: border-box;
|
|
359
|
-
overflow: hidden;
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
/* 380px panel + 16px of gutter each side needs 412px to sit flush on
|
|
363
|
-
the right; below that it spans the viewport instead. */
|
|
364
|
-
@media (max-width: 480px) {
|
|
365
|
-
.${o.INBOX_PANEL} {
|
|
366
|
-
left: 16px;
|
|
367
|
-
width: auto;
|
|
368
|
-
}
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
.${o.INBOX_HEADER},
|
|
372
|
-
.${o.INBOX_DETAIL_HEADER} {
|
|
373
|
-
display: flex;
|
|
374
|
-
align-items: center;
|
|
375
|
-
justify-content: space-between;
|
|
376
|
-
gap: 8px;
|
|
377
|
-
padding: 12px 14px;
|
|
378
|
-
border-bottom: 1px solid rgba(255,255,255,0.08);
|
|
379
|
-
flex: none;
|
|
380
|
-
}
|
|
381
|
-
|
|
382
|
-
.${o.INBOX_FILTER}-wrapper {
|
|
383
|
-
position: relative;
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
.${o.INBOX_FILTER} {
|
|
387
|
-
display: flex;
|
|
388
|
-
align-items: center;
|
|
389
|
-
gap: 6px;
|
|
390
|
-
background: transparent;
|
|
391
|
-
border: none;
|
|
392
|
-
color: white;
|
|
393
|
-
font-size: 13px;
|
|
394
|
-
font-weight: 600;
|
|
395
|
-
cursor: pointer;
|
|
396
|
-
padding: 4px 6px;
|
|
397
|
-
border-radius: 6px;
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
.${o.INBOX_FILTER}:hover {
|
|
401
|
-
background: rgba(255,255,255,0.08);
|
|
402
|
-
}
|
|
403
|
-
|
|
404
|
-
.${o.INBOX_FILTER_MENU} {
|
|
405
|
-
position: absolute;
|
|
406
|
-
top: calc(100% + 6px);
|
|
407
|
-
left: 0;
|
|
408
|
-
background: #2C2C2E;
|
|
409
|
-
border: 1px solid rgba(255,255,255,0.1);
|
|
410
|
-
border-radius: 12px;
|
|
411
|
-
padding: 14px;
|
|
412
|
-
width: 300px;
|
|
413
|
-
max-width: calc(100vw - 40px);
|
|
414
|
-
z-index: 1;
|
|
415
|
-
box-shadow: 0 8px 28px rgba(0,0,0,0.5);
|
|
416
|
-
}
|
|
417
|
-
|
|
418
|
-
.${o.INBOX_FILTER_MENU_HEADER} {
|
|
419
|
-
display: flex;
|
|
420
|
-
align-items: baseline;
|
|
421
|
-
justify-content: space-between;
|
|
422
|
-
gap: 12px;
|
|
423
|
-
font-size: 13px;
|
|
424
|
-
font-weight: 600;
|
|
425
|
-
margin-bottom: 12px;
|
|
426
|
-
}
|
|
427
|
-
|
|
428
|
-
.${o.INBOX_FILTER_CLEAR} {
|
|
429
|
-
background: transparent;
|
|
430
|
-
border: none;
|
|
431
|
-
color: rgba(255,255,255,0.55);
|
|
432
|
-
font-size: 12px;
|
|
433
|
-
font-weight: 500;
|
|
434
|
-
cursor: pointer;
|
|
435
|
-
padding: 0;
|
|
436
|
-
}
|
|
437
|
-
|
|
438
|
-
.${o.INBOX_FILTER_CLEAR}:hover:not(:disabled) {
|
|
439
|
-
color: white;
|
|
440
|
-
}
|
|
441
|
-
|
|
442
|
-
.${o.INBOX_FILTER_CLEAR}:disabled {
|
|
443
|
-
opacity: 0.35;
|
|
444
|
-
cursor: default;
|
|
445
|
-
}
|
|
446
|
-
|
|
447
|
-
.${o.INBOX_FILTER_GROUP} + .${o.INBOX_FILTER_GROUP} {
|
|
448
|
-
margin-top: 14px;
|
|
449
|
-
}
|
|
450
|
-
|
|
451
|
-
.${o.INBOX_FILTER_SECTION} {
|
|
452
|
-
font-size: 11px;
|
|
453
|
-
font-weight: 600;
|
|
454
|
-
color: rgba(255,255,255,0.45);
|
|
455
|
-
margin-bottom: 8px;
|
|
456
|
-
}
|
|
457
|
-
|
|
458
|
-
.${o.INBOX_FILTER_CHIPS} {
|
|
459
|
-
display: flex;
|
|
460
|
-
flex-wrap: wrap;
|
|
461
|
-
gap: 6px;
|
|
462
|
-
}
|
|
463
|
-
|
|
464
|
-
.${o.INBOX_FILTER_CHIP} {
|
|
465
|
-
background: transparent;
|
|
466
|
-
border: 1px solid rgba(255,255,255,0.18);
|
|
467
|
-
border-radius: 999px;
|
|
468
|
-
color: rgba(255,255,255,0.75);
|
|
469
|
-
font-size: 12px;
|
|
470
|
-
line-height: 1;
|
|
471
|
-
padding: 7px 12px;
|
|
472
|
-
cursor: pointer;
|
|
473
|
-
transition: background 0.15s, border-color 0.15s, color 0.15s;
|
|
474
|
-
}
|
|
475
|
-
|
|
476
|
-
.${o.INBOX_FILTER_CHIP}:hover {
|
|
477
|
-
border-color: rgba(255,255,255,0.4);
|
|
478
|
-
color: white;
|
|
479
|
-
}
|
|
480
|
-
|
|
481
|
-
/* Selected chips are filled *and* carry aria-checked \u2014 the fill is a
|
|
482
|
-
convenience, never the only way to tell them apart. */
|
|
483
|
-
.${o.INBOX_FILTER_CHIP}[aria-checked="true"] {
|
|
484
|
-
background: rgba(255,255,255,0.92);
|
|
485
|
-
border-color: rgba(255,255,255,0.92);
|
|
486
|
-
color: #1C1C1E;
|
|
487
|
-
font-weight: 600;
|
|
488
|
-
}
|
|
489
|
-
|
|
490
|
-
.${o.INBOX_MENU_ITEM} {
|
|
491
|
-
display: block;
|
|
492
|
-
width: 100%;
|
|
493
|
-
text-align: left;
|
|
494
|
-
background: transparent;
|
|
495
|
-
border: none;
|
|
496
|
-
color: white;
|
|
497
|
-
font-size: 13px;
|
|
498
|
-
padding: 7px 10px;
|
|
499
|
-
border-radius: 6px;
|
|
500
|
-
cursor: pointer;
|
|
501
|
-
}
|
|
502
|
-
|
|
503
|
-
.${o.INBOX_MENU_ITEM}:hover {
|
|
504
|
-
background: rgba(255,255,255,0.08);
|
|
505
|
-
}
|
|
506
|
-
|
|
507
|
-
.${o.INBOX_CLOSE},
|
|
508
|
-
.${o.INBOX_NAV_BTN},
|
|
509
|
-
.${o.INBOX_BACK} {
|
|
510
|
-
display: flex;
|
|
511
|
-
align-items: center;
|
|
512
|
-
gap: 4px;
|
|
513
|
-
background: transparent;
|
|
514
|
-
border: none;
|
|
515
|
-
color: rgba(255,255,255,0.75);
|
|
516
|
-
cursor: pointer;
|
|
517
|
-
padding: 4px 6px;
|
|
518
|
-
border-radius: 6px;
|
|
519
|
-
font-size: 14px;
|
|
520
|
-
}
|
|
521
|
-
|
|
522
|
-
.${o.INBOX_CLOSE} {
|
|
523
|
-
font-size: 20px;
|
|
524
|
-
line-height: 1;
|
|
525
|
-
}
|
|
526
|
-
|
|
527
|
-
.${o.INBOX_CLOSE}:hover,
|
|
528
|
-
.${o.INBOX_NAV_BTN}:not(:disabled):hover,
|
|
529
|
-
.${o.INBOX_BACK}:hover {
|
|
530
|
-
background: rgba(255,255,255,0.08);
|
|
531
|
-
color: white;
|
|
532
|
-
}
|
|
533
|
-
|
|
534
|
-
.${o.INBOX_NAV_BTN}:disabled {
|
|
535
|
-
opacity: 0.35;
|
|
536
|
-
cursor: default;
|
|
537
|
-
}
|
|
538
|
-
|
|
539
|
-
.${o.INBOX_LIST},
|
|
540
|
-
.${o.INBOX_DETAIL} {
|
|
541
|
-
flex: 1;
|
|
542
|
-
overflow-y: auto;${Q}
|
|
543
|
-
padding: 12px;
|
|
544
|
-
display: flex;
|
|
545
|
-
flex-direction: column;
|
|
546
|
-
gap: 12px;
|
|
547
|
-
}
|
|
548
|
-
|
|
549
|
-
.${o.INBOX_CARD} {
|
|
550
|
-
border: 1px solid rgba(255,255,255,0.1);
|
|
551
|
-
border-radius: 10px;
|
|
552
|
-
padding: 12px;
|
|
553
|
-
display: flex;
|
|
554
|
-
flex-direction: column;
|
|
555
|
-
gap: 8px;
|
|
556
|
-
}
|
|
557
|
-
|
|
558
|
-
.${o.INBOX_LIST} .${o.INBOX_CARD} {
|
|
559
|
-
cursor: pointer;
|
|
560
|
-
}
|
|
561
|
-
|
|
562
|
-
.${o.INBOX_LIST} .${o.INBOX_CARD}:hover {
|
|
563
|
-
border-color: rgba(255,255,255,0.22);
|
|
564
|
-
}
|
|
565
|
-
|
|
566
|
-
.${o.INBOX_CARD}--resolved {
|
|
567
|
-
border-color: rgba(48, 209, 88, 0.4);
|
|
568
|
-
opacity: 0.75;
|
|
569
|
-
}
|
|
570
|
-
|
|
571
|
-
.${o.INBOX_LIST} .${o.INBOX_CARD}--resolved:hover {
|
|
572
|
-
border-color: rgba(48, 209, 88, 0.7);
|
|
573
|
-
opacity: 1;
|
|
574
|
-
}
|
|
575
|
-
|
|
576
|
-
.${o.INBOX_CARD_HEADER} {
|
|
577
|
-
display: flex;
|
|
578
|
-
align-items: center;
|
|
579
|
-
justify-content: space-between;
|
|
580
|
-
gap: 8px;
|
|
581
|
-
}
|
|
582
|
-
|
|
583
|
-
/* Labels made the strip wide enough to overflow a narrow card in the
|
|
584
|
-
worst case ("In progress" + "Improvement" + "Medium"), so it wraps to
|
|
585
|
-
a second line rather than pushing the card sideways. */
|
|
586
|
-
.${o.INBOX_CARD_ACTIONS} {
|
|
587
|
-
display: flex;
|
|
588
|
-
align-items: center;
|
|
589
|
-
flex-wrap: wrap;
|
|
590
|
-
justify-content: flex-end;
|
|
591
|
-
gap: 6px;
|
|
592
|
-
}
|
|
593
|
-
|
|
594
|
-
.${o.INBOX_ACTION_BTN} {
|
|
595
|
-
display: flex;
|
|
596
|
-
align-items: center;
|
|
597
|
-
justify-content: center;
|
|
598
|
-
width: 24px;
|
|
599
|
-
height: 24px;
|
|
600
|
-
background: transparent;
|
|
601
|
-
border: none;
|
|
602
|
-
border-radius: 6px;
|
|
603
|
-
color: rgba(255,255,255,0.65);
|
|
604
|
-
cursor: pointer;
|
|
605
|
-
}
|
|
606
|
-
|
|
607
|
-
.${o.INBOX_ACTION_BTN}:hover {
|
|
608
|
-
background: rgba(255,255,255,0.08);
|
|
609
|
-
color: white;
|
|
610
|
-
}
|
|
611
|
-
|
|
612
|
-
/* Status/type/priority pickers show their current value as text next to
|
|
613
|
-
the dot (colour alone can't tell bug/high apart \u2014 same hex, and
|
|
614
|
-
there's no hover on touch). The 72px cap they used to carry is gone:
|
|
615
|
-
the strip has its own row now, so labels show in full. */
|
|
616
|
-
.${o.INBOX_ACTION_BTN_LABELED} {
|
|
617
|
-
width: auto;
|
|
618
|
-
padding: 0 8px 0 6px;
|
|
619
|
-
gap: 5px;
|
|
620
|
-
justify-content: flex-start;
|
|
621
|
-
flex: none;
|
|
622
|
-
}
|
|
623
|
-
|
|
624
|
-
.${o.INBOX_ACTION_LABEL} {
|
|
625
|
-
font-size: 11px;
|
|
626
|
-
line-height: 1;
|
|
627
|
-
white-space: nowrap;
|
|
628
|
-
}
|
|
629
|
-
|
|
630
|
-
.${o.INBOX_STATUS_DOT} {
|
|
631
|
-
width: 12px;
|
|
632
|
-
height: 12px;
|
|
633
|
-
border-radius: 50%;
|
|
634
|
-
border: 1.5px solid rgba(255,255,255,0.45);
|
|
635
|
-
display: inline-block;
|
|
636
|
-
flex: none;
|
|
637
|
-
}
|
|
638
|
-
|
|
639
|
-
.${o.INBOX_MENU_ITEM} .${o.INBOX_STATUS_DOT} {
|
|
640
|
-
width: 9px;
|
|
641
|
-
height: 9px;
|
|
642
|
-
border: none;
|
|
643
|
-
margin-right: 8px;
|
|
644
|
-
vertical-align: baseline;
|
|
645
|
-
}
|
|
646
|
-
|
|
647
|
-
.${o.INBOX_MENU_ITEM}[aria-checked="true"] {
|
|
648
|
-
background: rgba(255,255,255,0.08);
|
|
649
|
-
}
|
|
650
|
-
|
|
651
|
-
/* The action strip on its own row under the author. Shared by the inbox
|
|
652
|
-
card and the thread popover so the two read the same; only the
|
|
653
|
-
popover needs the extra top padding, since the card's column gap
|
|
654
|
-
already spaces it. */
|
|
655
|
-
.${o.THREAD_ACTIONS_ROW} {
|
|
656
|
-
display: flex;
|
|
657
|
-
justify-content: flex-end;
|
|
658
|
-
}
|
|
659
|
-
|
|
660
|
-
.${o.THREAD_POPOVER} > .${o.THREAD_ACTIONS_ROW} {
|
|
661
|
-
padding-top: 8px;
|
|
662
|
-
}
|
|
663
|
-
|
|
664
|
-
/* Generic hover tooltip, same look as .thread-time[data-full-date] */
|
|
665
|
-
[data-hd-tooltip] {
|
|
666
|
-
position: relative;
|
|
667
|
-
}
|
|
668
|
-
|
|
669
|
-
[data-hd-tooltip]::after {
|
|
670
|
-
content: attr(data-hd-tooltip);
|
|
671
|
-
position: absolute;
|
|
672
|
-
bottom: calc(100% + 6px);
|
|
673
|
-
left: 50%;
|
|
674
|
-
transform: translateX(-50%);
|
|
675
|
-
background: #000;
|
|
676
|
-
color: white;
|
|
677
|
-
padding: 4px 8px;
|
|
678
|
-
border-radius: 6px;
|
|
679
|
-
font-size: 11px;
|
|
680
|
-
white-space: nowrap;
|
|
681
|
-
opacity: 0;
|
|
682
|
-
pointer-events: none;
|
|
683
|
-
transition: opacity 0.12s ease;
|
|
684
|
-
z-index: 2;
|
|
685
|
-
}
|
|
686
|
-
|
|
687
|
-
[data-hd-tooltip]:hover::after {
|
|
688
|
-
opacity: 1;
|
|
689
|
-
}
|
|
690
|
-
|
|
691
|
-
.${o.INBOX_MENU} {
|
|
692
|
-
position: absolute;
|
|
693
|
-
top: calc(100% + 4px);
|
|
694
|
-
right: 0;
|
|
695
|
-
background: #2C2C2E;
|
|
696
|
-
border: 1px solid rgba(255,255,255,0.1);
|
|
697
|
-
border-radius: 8px;
|
|
698
|
-
padding: 4px;
|
|
699
|
-
min-width: 130px;
|
|
700
|
-
z-index: 1;
|
|
701
|
-
box-shadow: 0 4px 16px rgba(0,0,0,0.4);
|
|
702
|
-
}
|
|
703
|
-
|
|
704
|
-
.${o.INBOX_CARD_TEXT} {
|
|
705
|
-
white-space: pre-wrap;
|
|
706
|
-
word-break: break-word;
|
|
707
|
-
}
|
|
708
|
-
|
|
709
|
-
.${o.INBOX_CARD_TAG} {
|
|
710
|
-
align-self: flex-start;
|
|
711
|
-
padding: 1px 8px;
|
|
712
|
-
border-radius: 999px;
|
|
713
|
-
background: rgba(255, 159, 10, 0.2);
|
|
714
|
-
color: #FF9F0A;
|
|
715
|
-
font-size: 11px;
|
|
716
|
-
font-weight: 600;
|
|
717
|
-
}
|
|
718
|
-
|
|
719
|
-
.${o.INBOX_BADGES} {
|
|
720
|
-
display: flex;
|
|
721
|
-
flex-wrap: wrap;
|
|
722
|
-
gap: 4px;
|
|
723
|
-
}
|
|
724
|
-
/* Vertical separation from the card text above only applies to the
|
|
725
|
-
badge row on inbox cards -- inside the comment-box classify row,
|
|
726
|
-
.inbox-badges is one flex item among the type/priority pickers and
|
|
727
|
-
the tags input, and the classify row's own gap already spaces it
|
|
728
|
-
from its siblings, so an extra margin here would nudge it out of
|
|
729
|
-
alignment with them. */
|
|
730
|
-
.${o.INBOX_CARD} .${o.INBOX_BADGES} {
|
|
731
|
-
margin-top: 6px;
|
|
732
|
-
}
|
|
733
|
-
.${o.TOOLTIP} .${o.INBOX_BADGES} {
|
|
734
|
-
margin-bottom: 4px;
|
|
735
|
-
}
|
|
736
|
-
.${o.BADGE} {
|
|
737
|
-
display: inline-flex;
|
|
738
|
-
align-items: center;
|
|
739
|
-
padding: 1px 6px;
|
|
740
|
-
border: 1px solid rgba(255, 255, 255, 0.18);
|
|
741
|
-
border-radius: 10px;
|
|
742
|
-
font-size: 10px;
|
|
743
|
-
line-height: 1.6;
|
|
744
|
-
letter-spacing: 0.01em;
|
|
745
|
-
white-space: nowrap;
|
|
746
|
-
}
|
|
747
|
-
.${o.BADGE_STATUS},
|
|
748
|
-
.${o.BADGE_TYPE},
|
|
749
|
-
.${o.BADGE_PRIORITY} {
|
|
750
|
-
font-weight: 600;
|
|
751
|
-
}
|
|
752
|
-
.${o.BADGE_TAG} {
|
|
753
|
-
opacity: 0.75;
|
|
754
|
-
}
|
|
755
|
-
.${o.BADGE_DURATION} {
|
|
756
|
-
opacity: 0.75;
|
|
757
|
-
border-style: dashed;
|
|
758
|
-
}
|
|
759
|
-
|
|
760
|
-
.${o.CONTEXT_BLOCK} {
|
|
761
|
-
display: flex;
|
|
762
|
-
flex-direction: column;
|
|
763
|
-
padding: 10px 12px;
|
|
764
|
-
border-top: 1px solid rgba(255, 255, 255, 0.08);
|
|
765
|
-
font-size: 11px;
|
|
766
|
-
}
|
|
767
|
-
.${o.CONTEXT_BODY} {
|
|
768
|
-
display: flex;
|
|
769
|
-
flex-direction: column;
|
|
770
|
-
gap: 4px;
|
|
771
|
-
}
|
|
772
|
-
.${o.CONTEXT_TITLE} {
|
|
773
|
-
font-size: 11px;
|
|
774
|
-
font-weight: 600;
|
|
775
|
-
color: rgba(255,255,255,0.45);
|
|
776
|
-
padding-bottom: 4px;
|
|
777
|
-
}
|
|
778
|
-
/* The popover's collapsed variant. Same weight and colour as the inbox
|
|
779
|
-
title so the two surfaces read as the same block. */
|
|
780
|
-
.${o.CONTEXT_TOGGLE} {
|
|
781
|
-
display: flex;
|
|
782
|
-
align-items: center;
|
|
783
|
-
justify-content: space-between;
|
|
784
|
-
width: 100%;
|
|
785
|
-
background: transparent;
|
|
786
|
-
border: none;
|
|
787
|
-
color: rgba(255,255,255,0.45);
|
|
788
|
-
font-size: 11px;
|
|
789
|
-
font-weight: 600;
|
|
790
|
-
cursor: pointer;
|
|
791
|
-
padding: 2px 0;
|
|
792
|
-
}
|
|
793
|
-
.${o.CONTEXT_TOGGLE}:hover {
|
|
794
|
-
color: rgba(255,255,255,0.75);
|
|
795
|
-
}
|
|
796
|
-
.${o.CONTEXT_TOGGLE} svg {
|
|
797
|
-
flex: none;
|
|
798
|
-
transition: transform 0.15s ease;
|
|
799
|
-
}
|
|
800
|
-
.${o.CONTEXT_TOGGLE}[aria-expanded="true"] svg {
|
|
801
|
-
transform: rotate(180deg);
|
|
802
|
-
}
|
|
803
|
-
.${o.CONTEXT_TOGGLE}[aria-expanded="true"] + .${o.CONTEXT_BODY} {
|
|
804
|
-
padding-top: 8px;
|
|
805
|
-
}
|
|
806
|
-
.${o.CONTEXT_BLOCK} img {
|
|
807
|
-
width: 100%;
|
|
808
|
-
border-radius: 6px;
|
|
809
|
-
margin-bottom: 6px;
|
|
810
|
-
cursor: zoom-in;
|
|
811
|
-
}
|
|
812
|
-
.${o.CONTEXT_SCREENSHOT_CAPTION} {
|
|
813
|
-
opacity: 0.75;
|
|
814
|
-
}
|
|
815
|
-
.${o.CONTEXT_ROW} {
|
|
816
|
-
display: flex;
|
|
817
|
-
justify-content: space-between;
|
|
818
|
-
gap: 12px;
|
|
819
|
-
opacity: 0.75;
|
|
820
|
-
}
|
|
821
|
-
/* URLs and user agents have no spaces to break on, so the value column
|
|
822
|
-
would otherwise push the row wider than the panel. */
|
|
823
|
-
.${o.CONTEXT_ROW} span:last-child {
|
|
824
|
-
text-align: right;
|
|
825
|
-
word-break: break-all;
|
|
826
|
-
}
|
|
827
|
-
|
|
828
|
-
.${o.INBOX_CARD_REPLY_LINK} {
|
|
829
|
-
align-self: flex-start;
|
|
830
|
-
background: transparent;
|
|
831
|
-
border: none;
|
|
832
|
-
color: rgba(255,255,255,0.55);
|
|
833
|
-
font-size: 13px;
|
|
834
|
-
cursor: pointer;
|
|
835
|
-
padding: 0;
|
|
836
|
-
}
|
|
837
|
-
|
|
838
|
-
.${o.INBOX_CARD_REPLY_LINK}:hover {
|
|
839
|
-
color: white;
|
|
840
|
-
}
|
|
841
|
-
|
|
842
|
-
.${o.INBOX_REPLIES} {
|
|
843
|
-
display: flex;
|
|
844
|
-
flex-direction: column;
|
|
845
|
-
gap: 10px;
|
|
846
|
-
padding: 0 4px;
|
|
847
|
-
}
|
|
848
|
-
|
|
849
|
-
/* Centred in whatever height the list has, so the state sits in the
|
|
850
|
-
middle of the panel rather than clinging to the top. */
|
|
851
|
-
/* Sits under the body as a quiet aside: the preview shows the root
|
|
852
|
-
comment only, so this says "there is more" without competing with it. */
|
|
853
|
-
.${o.TOOLTIP_REPLY_COUNT} {
|
|
854
|
-
font-size: 12px;
|
|
855
|
-
color: rgba(255,255,255,0.45);
|
|
856
|
-
padding-top: 4px;
|
|
857
|
-
}
|
|
858
|
-
|
|
859
|
-
.${o.INBOX_EMPTY} {
|
|
860
|
-
flex: 1;
|
|
861
|
-
display: flex;
|
|
862
|
-
flex-direction: column;
|
|
863
|
-
align-items: center;
|
|
864
|
-
justify-content: center;
|
|
865
|
-
gap: 10px;
|
|
866
|
-
padding: 32px 24px;
|
|
867
|
-
color: rgba(255,255,255,0.55);
|
|
868
|
-
text-align: center;
|
|
869
|
-
}
|
|
870
|
-
|
|
871
|
-
/* The marker's own silhouette, drawn as an outline: what the user is
|
|
872
|
-
about to place, not a generic placeholder. Same border-radius as
|
|
873
|
-
.comment-circle. */
|
|
874
|
-
.${o.INBOX_EMPTY_ICON} {
|
|
875
|
-
width: 44px;
|
|
876
|
-
height: 44px;
|
|
877
|
-
margin-bottom: 6px;
|
|
878
|
-
border: 2px dashed rgba(255,255,255,0.25);
|
|
879
|
-
border-radius: 0% 100% 100% 100%;
|
|
880
|
-
flex: none;
|
|
881
|
-
}
|
|
882
|
-
|
|
883
|
-
.${o.INBOX_EMPTY_TITLE} {
|
|
884
|
-
color: white;
|
|
885
|
-
font-size: 14px;
|
|
886
|
-
font-weight: 600;
|
|
887
|
-
}
|
|
888
|
-
|
|
889
|
-
.${o.INBOX_EMPTY_TEXT} {
|
|
890
|
-
font-size: 13px;
|
|
891
|
-
line-height: 1.5;
|
|
892
|
-
max-width: 30ch;
|
|
893
|
-
}
|
|
894
|
-
|
|
895
|
-
.${o.INBOX_EMPTY_KBD} {
|
|
896
|
-
font-family: inherit;
|
|
897
|
-
font-size: 12px;
|
|
898
|
-
font-weight: 500;
|
|
899
|
-
color: rgba(255,255,255,0.8);
|
|
900
|
-
background: rgba(255,255,255,0.08);
|
|
901
|
-
border: 1px solid rgba(255,255,255,0.14);
|
|
902
|
-
border-radius: 5px;
|
|
903
|
-
padding: 1px 5px;
|
|
904
|
-
white-space: nowrap;
|
|
905
|
-
}
|
|
906
|
-
|
|
907
|
-
.${o.INBOX_EMPTY_ACTION} {
|
|
908
|
-
margin-top: 6px;
|
|
909
|
-
background: transparent;
|
|
910
|
-
border: 1px solid rgba(255,255,255,0.2);
|
|
911
|
-
border-radius: 8px;
|
|
912
|
-
color: white;
|
|
913
|
-
font-size: 13px;
|
|
914
|
-
font-weight: 500;
|
|
915
|
-
padding: 8px 16px;
|
|
916
|
-
cursor: pointer;
|
|
917
|
-
transition: background 0.15s, border-color 0.15s;
|
|
918
|
-
}
|
|
919
|
-
|
|
920
|
-
.${o.INBOX_EMPTY_ACTION}:hover {
|
|
921
|
-
background: rgba(255,255,255,0.08);
|
|
922
|
-
border-color: rgba(255,255,255,0.35);
|
|
923
|
-
}
|
|
924
|
-
|
|
925
|
-
.${o.THREAD_HEADER} {
|
|
926
|
-
display: flex;
|
|
927
|
-
justify-content: space-between;
|
|
928
|
-
align-items: center;
|
|
929
|
-
padding: 0 0 0;
|
|
930
|
-
}
|
|
931
|
-
|
|
932
|
-
/* min-width:0 is what lets the author actually shrink: a flex item
|
|
933
|
-
defaults to min-content, so without it the name pushes the row wider
|
|
934
|
-
instead of truncating. */
|
|
935
|
-
.${o.THREAD_META} {
|
|
936
|
-
display: flex;
|
|
937
|
-
align-items: center;
|
|
938
|
-
gap: 6px;
|
|
939
|
-
flex: 1;
|
|
940
|
-
min-width: 0;
|
|
941
|
-
}
|
|
942
|
-
|
|
943
|
-
.${o.THREAD_AUTHOR} {
|
|
944
|
-
font-weight: 600;
|
|
945
|
-
font-size: 13px;
|
|
946
|
-
overflow: hidden;
|
|
947
|
-
text-overflow: ellipsis;
|
|
948
|
-
white-space: nowrap;
|
|
949
|
-
}
|
|
950
|
-
|
|
951
|
-
.${o.THREAD_TIME} {
|
|
952
|
-
font-size: 12px;
|
|
953
|
-
color: rgba(255,255,255,0.5);
|
|
954
|
-
cursor: default;
|
|
955
|
-
position: relative;
|
|
956
|
-
flex: none;
|
|
957
|
-
}
|
|
958
|
-
|
|
959
|
-
.${o.THREAD_TIME}::after {
|
|
960
|
-
content: attr(data-full-date);
|
|
961
|
-
position: absolute;
|
|
962
|
-
bottom: calc(100% + 6px);
|
|
963
|
-
left: 50%;
|
|
964
|
-
transform: translateX(-50%);
|
|
965
|
-
background: #000;
|
|
966
|
-
color: white;
|
|
967
|
-
padding: 4px 8px;
|
|
968
|
-
border-radius: 6px;
|
|
969
|
-
font-size: 11px;
|
|
970
|
-
white-space: nowrap;
|
|
971
|
-
opacity: 0;
|
|
972
|
-
pointer-events: none;
|
|
973
|
-
transition: opacity 0.15s ease;
|
|
974
|
-
z-index: 1;
|
|
975
|
-
}
|
|
976
|
-
|
|
977
|
-
.${o.THREAD_TIME}:hover::after {
|
|
978
|
-
opacity: 1;
|
|
979
|
-
}
|
|
980
|
-
|
|
981
|
-
.${o.THREAD_BODY} {
|
|
982
|
-
padding: 8px 0;
|
|
983
|
-
white-space: pre-wrap;
|
|
984
|
-
word-break: break-word;
|
|
985
|
-
}
|
|
986
|
-
|
|
987
|
-
.${o.THREAD_REPLIES} {
|
|
988
|
-
padding: 0;
|
|
989
|
-
}
|
|
990
|
-
|
|
991
|
-
.${o.THREAD_REPLIES}:empty {
|
|
992
|
-
display: none;
|
|
993
|
-
}
|
|
994
|
-
|
|
995
|
-
.${o.THREAD_REPLY} {
|
|
996
|
-
padding: 16px 0 0 0;
|
|
997
|
-
border-top: 1px solid rgba(255,255,255,0.1);
|
|
998
|
-
white-space: pre-wrap;
|
|
999
|
-
word-break: break-word;
|
|
1000
|
-
font-size: 13px;
|
|
1001
|
-
color: rgba(255,255,255,0.85);
|
|
1002
|
-
}
|
|
1003
|
-
|
|
1004
|
-
.${o.THREAD_REPLY} .${o.THREAD_META} {
|
|
1005
|
-
margin-bottom: 2px;
|
|
1006
|
-
}
|
|
1007
|
-
|
|
1008
|
-
/* Pushed to the far edge of the reply's meta row, where the same \u22EF sits
|
|
1009
|
-
on the comment above it. flex: none keeps it off the author's
|
|
1010
|
-
truncation budget. */
|
|
1011
|
-
.${o.THREAD_REPLY_ACTIONS} {
|
|
1012
|
-
margin-left: auto;
|
|
1013
|
-
flex: none;
|
|
1014
|
-
}
|
|
1015
|
-
|
|
1016
|
-
.${o.THREAD_REPLY} .${o.SCREENSHOT_IMG} {
|
|
1017
|
-
width: 144px;
|
|
1018
|
-
height: 100px;
|
|
1019
|
-
object-fit: cover;
|
|
1020
|
-
border-radius: 8px;
|
|
1021
|
-
margin-top: 4px;
|
|
1022
|
-
cursor: pointer;
|
|
1023
|
-
display: block;
|
|
1024
|
-
}
|
|
1025
|
-
|
|
1026
|
-
.${o.THREAD_INPUT_AREA} {
|
|
1027
|
-
display: flex;
|
|
1028
|
-
flex-direction: column;
|
|
1029
|
-
gap: 0;
|
|
1030
|
-
padding: 12px 0 0;
|
|
1031
|
-
border-top: 1px solid rgba(255,255,255,0.1);
|
|
1032
|
-
}
|
|
1033
|
-
|
|
1034
|
-
.${o.THREAD_INPUT} {
|
|
1035
|
-
width: 100%;
|
|
1036
|
-
background: transparent;
|
|
1037
|
-
border: none;
|
|
1038
|
-
padding: 0;
|
|
1039
|
-
color: white;
|
|
1040
|
-
font-size: 14px;
|
|
1041
|
-
font-family: inherit;
|
|
1042
|
-
outline: none;
|
|
1043
|
-
box-sizing: border-box;
|
|
1044
|
-
}
|
|
1045
|
-
|
|
1046
|
-
.${o.THREAD_INPUT}::placeholder {
|
|
1047
|
-
color: rgba(255,255,255,0.5);
|
|
1048
|
-
}
|
|
1049
|
-
|
|
1050
|
-
.${o.THREAD_INPUT}:focus {
|
|
1051
|
-
outline: none;
|
|
1052
|
-
box-shadow: none;
|
|
1053
|
-
}
|
|
1054
|
-
|
|
1055
|
-
.${o.THREAD_SUBMIT} {
|
|
1056
|
-
background: none;
|
|
1057
|
-
border: none;
|
|
1058
|
-
color: #2E90FA;
|
|
1059
|
-
cursor: pointer;
|
|
1060
|
-
display: flex;
|
|
1061
|
-
align-items: center;
|
|
1062
|
-
justify-content: center;
|
|
1063
|
-
border-radius: 6px;
|
|
1064
|
-
transition: background 0.2s;
|
|
1065
|
-
}
|
|
1066
|
-
|
|
1067
|
-
.${o.THREAD_SUBMIT}:hover {
|
|
1068
|
-
background: rgba(46, 144, 250, 0.15);
|
|
1069
|
-
color: #1570D6;
|
|
1070
|
-
}
|
|
1071
|
-
|
|
1072
|
-
.${o.CLOSE_TOOLTIP} {
|
|
1073
|
-
background: none;
|
|
1074
|
-
border: none;
|
|
1075
|
-
font-size: 18px;
|
|
1076
|
-
cursor: pointer;
|
|
1077
|
-
color: rgba(255,255,255,0.5);
|
|
1078
|
-
line-height: 1;
|
|
1079
|
-
}
|
|
1080
|
-
|
|
1081
|
-
.${o.CLOSE_TOOLTIP}:hover {
|
|
1082
|
-
color: white;
|
|
1083
|
-
}
|
|
1084
|
-
|
|
1085
|
-
.${o.PREVIEW_CIRCLE} {
|
|
1086
|
-
animation: helldots-pulse 1.5s ease-in-out infinite;
|
|
1087
|
-
}
|
|
1088
|
-
|
|
1089
|
-
@keyframes helldots-pulse {
|
|
1090
|
-
0%, 100% { box-shadow: 0 0 0 0 rgba(46, 144, 250, 0.4), 0 1px 5px rgba(0,0,0,0.2); }
|
|
1091
|
-
50% { box-shadow: 0 0 0 8px rgba(46, 144, 250, 0), 0 1px 5px rgba(0,0,0,0.2); }
|
|
1092
|
-
}
|
|
1093
|
-
|
|
1094
|
-
.${o.COMMENT_OVERLAY} {
|
|
1095
|
-
position: fixed;
|
|
1096
|
-
top: 0;
|
|
1097
|
-
left: 0;
|
|
1098
|
-
right: 0;
|
|
1099
|
-
bottom: 0;
|
|
1100
|
-
background: transparent;
|
|
1101
|
-
pointer-events: none;
|
|
1102
|
-
z-index: ${O.TOOLBAR-1};
|
|
1103
|
-
}
|
|
1104
|
-
|
|
1105
|
-
.${o.COMMENT_OVERLAY}.${o.ACTIVE} {
|
|
1106
|
-
pointer-events: auto;
|
|
1107
|
-
background: rgba(0, 0, 0, 0.1);
|
|
1108
|
-
}
|
|
1109
|
-
|
|
1110
|
-
.${o.SELECTION_RECT} {
|
|
1111
|
-
position: fixed;
|
|
1112
|
-
border: 2px solid #2E90FA;
|
|
1113
|
-
background: rgba(46, 144, 250, 0.1);
|
|
1114
|
-
pointer-events: none;
|
|
1115
|
-
z-index: ${O.TOOLTIP};
|
|
1116
|
-
box-sizing: border-box;
|
|
1117
|
-
}
|
|
1118
|
-
|
|
1119
|
-
.${o.SCREENSHOTS_CONTAINER} {
|
|
1120
|
-
display: none;
|
|
1121
|
-
overflow-x: auto;
|
|
1122
|
-
gap: 8px;
|
|
1123
|
-
margin-top: 4px;
|
|
1124
|
-
padding: 4px 0;
|
|
1125
|
-
scrollbar-width: none;
|
|
1126
|
-
-ms-overflow-style: none;
|
|
1127
|
-
margin-bottom: 8px;
|
|
1128
|
-
}
|
|
1129
|
-
|
|
1130
|
-
.${o.SCREENSHOTS_CONTAINER}::-webkit-scrollbar {
|
|
1131
|
-
display: none;
|
|
1132
|
-
}
|
|
1133
|
-
|
|
1134
|
-
.${o.SCREENSHOTS_CONTAINER}.${o.ACTIVE} {
|
|
1135
|
-
display: flex;
|
|
1136
|
-
}
|
|
1137
|
-
|
|
1138
|
-
.${o.SCREENSHOT_ITEM} {
|
|
1139
|
-
position: relative;
|
|
1140
|
-
flex-shrink: 0;
|
|
1141
|
-
}
|
|
1142
|
-
|
|
1143
|
-
.${o.SCREENSHOT_ITEM} .${o.SCREENSHOT_IMG} {
|
|
1144
|
-
width: 50px;
|
|
1145
|
-
height: 50px;
|
|
1146
|
-
object-fit: cover;
|
|
1147
|
-
border-radius: 8px;
|
|
1148
|
-
cursor: pointer;
|
|
1149
|
-
display: block;
|
|
1150
|
-
margin: 0;
|
|
1151
|
-
}
|
|
1152
|
-
|
|
1153
|
-
.${o.SCREENSHOT_ITEM} .${o.SCREENSHOT_IMG}:hover {
|
|
1154
|
-
opacity: 0.85;
|
|
1155
|
-
}
|
|
1156
|
-
|
|
1157
|
-
.${o.SCREENSHOT_ITEM} .${o.SCREENSHOT_REMOVE} {
|
|
1158
|
-
position: absolute;
|
|
1159
|
-
top: -5px;
|
|
1160
|
-
right: -5px;
|
|
1161
|
-
width: 18px;
|
|
1162
|
-
height: 18px;
|
|
1163
|
-
background: rgba(0,0,0,0.7);
|
|
1164
|
-
border: none;
|
|
1165
|
-
border-radius: 50%;
|
|
1166
|
-
color: white;
|
|
1167
|
-
font-size: 12px;
|
|
1168
|
-
line-height: 1;
|
|
1169
|
-
cursor: pointer;
|
|
1170
|
-
display: none;
|
|
1171
|
-
align-items: center;
|
|
1172
|
-
justify-content: center;
|
|
1173
|
-
z-index: 1;
|
|
1174
|
-
}
|
|
1175
|
-
|
|
1176
|
-
.${o.SCREENSHOT_ITEM}:hover .${o.SCREENSHOT_REMOVE} {
|
|
1177
|
-
display: flex;
|
|
1178
|
-
}
|
|
1179
|
-
|
|
1180
|
-
.${o.SCREENSHOT_ITEM} .${o.SCREENSHOT_REMOVE}:hover {
|
|
1181
|
-
background: rgba(0,0,0,0.9);
|
|
1182
|
-
}
|
|
1183
|
-
|
|
1184
|
-
.${o.TOOLTIP} > .${o.SCREENSHOTS_CONTAINER} .${o.SCREENSHOT_ITEM} .${o.SCREENSHOT_IMG},
|
|
1185
|
-
.${o.THREAD_SCROLL} > .${o.SCREENSHOTS_CONTAINER} .${o.SCREENSHOT_ITEM} .${o.SCREENSHOT_IMG},
|
|
1186
|
-
.${o.THREAD_REPLY} .${o.SCREENSHOT_ITEM} .${o.SCREENSHOT_IMG} {
|
|
1187
|
-
width: 144px;
|
|
1188
|
-
height: 100px;
|
|
1189
|
-
}
|
|
1190
|
-
|
|
1191
|
-
.${o.CONFIRM} {
|
|
1192
|
-
position: fixed;
|
|
1193
|
-
top: 0;
|
|
1194
|
-
left: 0;
|
|
1195
|
-
right: 0;
|
|
1196
|
-
bottom: 0;
|
|
1197
|
-
background: rgba(0,0,0,0.6);
|
|
1198
|
-
display: flex;
|
|
1199
|
-
align-items: center;
|
|
1200
|
-
justify-content: center;
|
|
1201
|
-
padding: 16px;
|
|
1202
|
-
animation: helldots-fade-in 0.15s ease;
|
|
1203
|
-
}
|
|
1204
|
-
|
|
1205
|
-
.${o.CONFIRM_PANEL} {
|
|
1206
|
-
width: min(360px, 100%);
|
|
1207
|
-
background: #1C1C1E;
|
|
1208
|
-
border: 1px solid rgba(255,255,255,0.1);
|
|
1209
|
-
border-radius: 14px;
|
|
1210
|
-
box-shadow: 0 8px 32px rgba(0,0,0,0.5);
|
|
1211
|
-
padding: 20px;
|
|
1212
|
-
color: white;
|
|
1213
|
-
font-size: 14px;
|
|
1214
|
-
line-height: 1.5;
|
|
1215
|
-
box-sizing: border-box;
|
|
1216
|
-
}
|
|
1217
|
-
|
|
1218
|
-
/* :host { all: initial } does not reach descendants, so the heading and
|
|
1219
|
-
paragraph still arrive with UA margins. */
|
|
1220
|
-
.${o.CONFIRM_TITLE} {
|
|
1221
|
-
margin: 0 0 8px;
|
|
1222
|
-
font-size: 15px;
|
|
1223
|
-
font-weight: 600;
|
|
1224
|
-
}
|
|
1225
|
-
|
|
1226
|
-
.${o.CONFIRM_MESSAGE} {
|
|
1227
|
-
margin: 0 0 20px;
|
|
1228
|
-
font-size: 13px;
|
|
1229
|
-
color: rgba(255,255,255,0.65);
|
|
1230
|
-
}
|
|
1231
|
-
|
|
1232
|
-
.${o.CONFIRM_ACTIONS} {
|
|
1233
|
-
display: flex;
|
|
1234
|
-
justify-content: flex-end;
|
|
1235
|
-
gap: 8px;
|
|
1236
|
-
}
|
|
1237
|
-
|
|
1238
|
-
.${o.CONFIRM_CANCEL},
|
|
1239
|
-
.${o.CONFIRM_ACCEPT} {
|
|
1240
|
-
padding: 7px 14px;
|
|
1241
|
-
border: 1px solid transparent;
|
|
1242
|
-
border-radius: 8px;
|
|
1243
|
-
font-size: 13px;
|
|
1244
|
-
font-weight: 600;
|
|
1245
|
-
cursor: pointer;
|
|
1246
|
-
}
|
|
1247
|
-
|
|
1248
|
-
/* The one place in the widget with visible focus rings. The dialog traps
|
|
1249
|
-
Tab between exactly two buttons, one of them destructive, so a
|
|
1250
|
-
keyboard user who cannot see which one is focused is being asked to
|
|
1251
|
-
guess. Scoped here on purpose \u2014 see DECISIONS.md; it does not reopen
|
|
1252
|
-
the rings that were reverted elsewhere for visual parity. */
|
|
1253
|
-
.${o.CONFIRM_CANCEL}:focus-visible,
|
|
1254
|
-
.${o.CONFIRM_ACCEPT}:focus-visible {
|
|
1255
|
-
outline: 2px solid #2E90FA;
|
|
1256
|
-
outline-offset: 2px;
|
|
1257
|
-
}
|
|
1258
|
-
|
|
1259
|
-
.${o.CONFIRM_CANCEL} {
|
|
1260
|
-
background: rgba(255,255,255,0.08);
|
|
1261
|
-
border-color: rgba(255,255,255,0.12);
|
|
1262
|
-
color: white;
|
|
1263
|
-
}
|
|
1264
|
-
|
|
1265
|
-
.${o.CONFIRM_CANCEL}:hover {
|
|
1266
|
-
background: rgba(255,255,255,0.14);
|
|
1267
|
-
}
|
|
1268
|
-
|
|
1269
|
-
.${o.CONFIRM_ACCEPT} {
|
|
1270
|
-
background: #FF453A;
|
|
1271
|
-
color: white;
|
|
1272
|
-
}
|
|
1273
|
-
|
|
1274
|
-
.${o.CONFIRM_ACCEPT}:hover {
|
|
1275
|
-
background: #FF6961;
|
|
1276
|
-
}
|
|
1277
|
-
|
|
1278
|
-
.${o.LIGHTBOX} {
|
|
1279
|
-
position: fixed;
|
|
1280
|
-
top: 0;
|
|
1281
|
-
left: 0;
|
|
1282
|
-
right: 0;
|
|
1283
|
-
bottom: 0;
|
|
1284
|
-
background: rgba(0,0,0,0.92);
|
|
1285
|
-
z-index: ${O.LIGHTBOX};
|
|
1286
|
-
display: flex;
|
|
1287
|
-
align-items: center;
|
|
1288
|
-
justify-content: center;
|
|
1289
|
-
animation: helldots-fade-in 0.2s ease;
|
|
1290
|
-
}
|
|
1291
|
-
|
|
1292
|
-
@keyframes helldots-fade-in {
|
|
1293
|
-
from { opacity: 0; }
|
|
1294
|
-
to { opacity: 1; }
|
|
1295
|
-
}
|
|
1296
|
-
|
|
1297
|
-
.${o.LIGHTBOX_IMG} {
|
|
1298
|
-
max-width: 90vw;
|
|
1299
|
-
max-height: 90vh;
|
|
1300
|
-
object-fit: contain;
|
|
1301
|
-
border-radius: 8px;
|
|
1302
|
-
}
|
|
1303
|
-
|
|
1304
|
-
.${o.LIGHTBOX_CLOSE} {
|
|
1305
|
-
position: absolute;
|
|
1306
|
-
top: 16px;
|
|
1307
|
-
right: 16px;
|
|
1308
|
-
background: rgba(255,255,255,0.15);
|
|
1309
|
-
border: none;
|
|
1310
|
-
color: white;
|
|
1311
|
-
font-size: 24px;
|
|
1312
|
-
width: 40px;
|
|
1313
|
-
height: 40px;
|
|
1314
|
-
border-radius: 50%;
|
|
1315
|
-
cursor: pointer;
|
|
1316
|
-
display: flex;
|
|
1317
|
-
align-items: center;
|
|
1318
|
-
justify-content: center;
|
|
1319
|
-
transition: background 0.2s;
|
|
1320
|
-
}
|
|
1321
|
-
|
|
1322
|
-
.${o.LIGHTBOX_CLOSE}:hover {
|
|
1323
|
-
background: rgba(255,255,255,0.3);
|
|
1324
|
-
}
|
|
1325
|
-
/* --- inline editor --- */
|
|
1326
|
-
|
|
1327
|
-
.${o.EDITOR} {
|
|
1328
|
-
display: flex;
|
|
1329
|
-
flex-direction: column;
|
|
1330
|
-
gap: 8px;
|
|
1331
|
-
margin: 4px 0 2px;
|
|
1332
|
-
}
|
|
1333
|
-
|
|
1334
|
-
.${o.EDITOR_INPUT} {
|
|
1335
|
-
width: 100%;
|
|
1336
|
-
box-sizing: border-box;
|
|
1337
|
-
resize: vertical;
|
|
1338
|
-
min-height: 60px;
|
|
1339
|
-
background: rgba(255,255,255,0.06);
|
|
1340
|
-
border: 1px solid rgba(255,255,255,0.14);
|
|
1341
|
-
border-radius: 8px;
|
|
1342
|
-
padding: 8px 10px;
|
|
1343
|
-
color: white;
|
|
1344
|
-
font-size: 14px;
|
|
1345
|
-
font-family: inherit;
|
|
1346
|
-
line-height: 1.45;
|
|
1347
|
-
outline: none;${Q}
|
|
1348
|
-
}
|
|
1349
|
-
|
|
1350
|
-
.${o.EDITOR_INPUT}:focus {
|
|
1351
|
-
border-color: rgba(46,144,250,0.7);
|
|
1352
|
-
}
|
|
1353
|
-
|
|
1354
|
-
.${o.EDITOR_ACTIONS} {
|
|
1355
|
-
display: flex;
|
|
1356
|
-
justify-content: flex-end;
|
|
1357
|
-
gap: 8px;
|
|
1358
|
-
}
|
|
1359
|
-
|
|
1360
|
-
.${o.EDITOR_CANCEL},
|
|
1361
|
-
.${o.EDITOR_SAVE} {
|
|
1362
|
-
padding: 5px 12px;
|
|
1363
|
-
border: 1px solid transparent;
|
|
1364
|
-
border-radius: 7px;
|
|
1365
|
-
font-size: 13px;
|
|
1366
|
-
font-weight: 600;
|
|
1367
|
-
font-family: inherit;
|
|
1368
|
-
cursor: pointer;
|
|
1369
|
-
}
|
|
1370
|
-
|
|
1371
|
-
.${o.EDITOR_CANCEL} {
|
|
1372
|
-
background: rgba(255,255,255,0.08);
|
|
1373
|
-
border-color: rgba(255,255,255,0.12);
|
|
1374
|
-
color: white;
|
|
1375
|
-
}
|
|
1376
|
-
|
|
1377
|
-
.${o.EDITOR_CANCEL}:hover {
|
|
1378
|
-
background: rgba(255,255,255,0.14);
|
|
1379
|
-
}
|
|
1380
|
-
|
|
1381
|
-
.${o.EDITOR_SAVE} {
|
|
1382
|
-
background: #2E90FA;
|
|
1383
|
-
color: white;
|
|
1384
|
-
}
|
|
1385
|
-
|
|
1386
|
-
.${o.EDITOR_SAVE}:hover:not(:disabled) {
|
|
1387
|
-
background: #57A6FB;
|
|
1388
|
-
}
|
|
1389
|
-
|
|
1390
|
-
/* Blanking a body is not a way to delete \u2014 the comment would keep its
|
|
1391
|
-
marker, its replies and its inbox row while saying nothing. The
|
|
1392
|
-
disabled state is carried by more than colour: the cursor changes and
|
|
1393
|
-
the control stops responding (WCAG 1.4.1). */
|
|
1394
|
-
.${o.EDITOR_SAVE}:disabled {
|
|
1395
|
-
background: rgba(255,255,255,0.10);
|
|
1396
|
-
color: rgba(255,255,255,0.4);
|
|
1397
|
-
cursor: not-allowed;
|
|
1398
|
-
}
|
|
1399
|
-
|
|
1400
|
-
.${o.THREAD_EDITED} {
|
|
1401
|
-
font-size: 12px;
|
|
1402
|
-
color: rgba(255,255,255,0.4);
|
|
1403
|
-
cursor: default;
|
|
1404
|
-
position: relative;
|
|
1405
|
-
flex: none;
|
|
1406
|
-
}
|
|
1407
|
-
|
|
1408
|
-
.${o.THREAD_EDITED}::before {
|
|
1409
|
-
content: "\xB7";
|
|
1410
|
-
margin-right: 4px;
|
|
1411
|
-
}
|
|
1412
|
-
|
|
1413
|
-
.${o.THREAD_EDITED}::after {
|
|
1414
|
-
content: attr(data-full-date);
|
|
1415
|
-
position: absolute;
|
|
1416
|
-
bottom: calc(100% + 6px);
|
|
1417
|
-
left: 50%;
|
|
1418
|
-
transform: translateX(-50%);
|
|
1419
|
-
background: #000;
|
|
1420
|
-
color: white;
|
|
1421
|
-
padding: 4px 8px;
|
|
1422
|
-
border-radius: 6px;
|
|
1423
|
-
font-size: 11px;
|
|
1424
|
-
white-space: nowrap;
|
|
1425
|
-
opacity: 0;
|
|
1426
|
-
pointer-events: none;
|
|
1427
|
-
transition: opacity 0.15s ease;
|
|
1428
|
-
}
|
|
1429
|
-
|
|
1430
|
-
.${o.THREAD_EDITED}:hover::after {
|
|
1431
|
-
opacity: 1;
|
|
1432
|
-
}
|
|
1433
|
-
|
|
1434
|
-
.${o.INBOX_NOTICE} {
|
|
1435
|
-
margin: 0 0 10px;
|
|
1436
|
-
padding: 9px 11px;
|
|
1437
|
-
border-radius: 8px;
|
|
1438
|
-
background: rgba(255,255,255,0.06);
|
|
1439
|
-
border: 1px solid rgba(255,255,255,0.12);
|
|
1440
|
-
color: rgba(255,255,255,0.75);
|
|
1441
|
-
font-size: 13px;
|
|
1442
|
-
line-height: 1.4;
|
|
1443
|
-
}
|
|
1444
|
-
`,ke=()=>`
|
|
1445
|
-
.${o.COMMENT_CURSOR},
|
|
1446
|
-
.${o.COMMENT_CURSOR} * {
|
|
1447
|
-
cursor: url('${Pe}') ${De}, auto !important;
|
|
1448
|
-
}
|
|
1449
|
-
|
|
1450
|
-
`;var N={commentAriaLabelPrefix:"Comment: ",anonymous:"Anonymous",justNow:"Just now",minutesAgoTemplate:"{n}m",hoursAgoTemplate:"{n}h",daysAgoTemplate:"{n}d",toolbarComment:"Comment",toolbarInbox:"Inbox",modifierAlt:"Alt",modifierCtrl:"Ctrl",commentBoxAriaLabel:"New comment",commentPlaceholder:"Type your comment...",attachImage:"Attach image",send:"Send",tooltipAriaLabel:"Comment preview",close:"Close",popoverAriaLabel:"Comment thread",replyPlaceholder:"Reply...",attachedScreenshot:"Attached screenshot",screenshotPreview:"Screenshot preview",removeScreenshot:"Remove screenshot",inboxAriaLabel:"Comments inbox",inboxEmptyTitle:"No comments yet",inboxEmptyHintTemplate:"Press {n} and click anywhere on the page to start.",inboxEmptyAction:"Turn on comment mode",inboxNoMatches:"No comments match these filters",orphanedBadge:"Unanchored",hiddenBadge:"Hidden",filterAll:"All pages",filterCurrentPage:"Current page",filterTitle:"Filter",filterClear:"Clear",filterByPage:"Page",filterByStatus:"Status",back:"Back",deleteComment:"Delete",deleteReply:"Delete reply",replyOptions:"Reply options",editComment:"Edit",editReply:"Edit reply",copyLink:"Copy link",linkCopied:"Link copied",editorAriaLabel:"Edit text",editSave:"Save",editCancel:"Cancel",editedMark:"edited",editedAtPrefix:"Edited ",confirmDiscardTitle:"Discard changes?",confirmDiscardMessage:"The changes you made to this text have not been saved and will be lost.",confirmDiscard:"Discard",confirmKeepEditing:"Keep editing",commentNotFound:"That comment is not on this page.",confirmDelete:"Delete",confirmCancel:"Cancel",confirmDeleteCommentTitle:"Delete this comment?",confirmDeleteCommentMessage:"This comment will be permanently deleted. This action cannot be undone.",confirmDeleteThreadMessage:"This comment and all of its replies will be permanently deleted. This action cannot be undone.",confirmDeleteReplyTitle:"Delete this reply?",confirmDeleteReplyMessage:"This reply will be permanently deleted. This action cannot be undone.",copyAgentContext:"Copy agent context",copied:"Copied",statusLabel:"Status",prevComment:"Previous comment",nextComment:"Next comment",replyLink:"Reply",replyCountOne:"1 reply",replyCountTemplate:"{n} replies",commentOptions:"Comment options",moreOptions:"More",statusOpen:"Open",statusInProgress:"In progress",statusResolved:"Resolved",durationLessThanMinute:"<1m",resolvedInTemplate:"Resolved in {n}",typeLabel:"Type",priorityLabel:"Priority",unset:"Unset",typeBug:"Bug",typeSuggestion:"Suggestion",typeQuestion:"Question",typeImprovement:"Improvement",priorityHigh:"High",priorityMedium:"Medium",priorityLow:"Low",filterByType:"Type",filterByPriority:"Priority",contextSection:"Context",autoScreenshotLabel:"Automatic context",contextUrl:"URL",contextViewport:"Viewport",contextScreen:"Screen",contextBrowser:"Browser",contextOs:"OS"};var He={commentAriaLabelPrefix:"Comentario: ",anonymous:"An\xF3nimo",justNow:"Justo ahora",minutesAgoTemplate:"{n}m",hoursAgoTemplate:"{n}h",daysAgoTemplate:"{n}d",toolbarComment:"Comentar",toolbarInbox:"Bandeja",modifierAlt:"Alt",modifierCtrl:"Ctrl",commentBoxAriaLabel:"Nuevo comentario",commentPlaceholder:"Escribe tu comentario...",attachImage:"Adjuntar imagen",send:"Enviar",tooltipAriaLabel:"Vista previa del comentario",close:"Cerrar",popoverAriaLabel:"Hilo de comentarios",replyPlaceholder:"Responder...",attachedScreenshot:"Captura de pantalla adjunta",screenshotPreview:"Vista previa de la captura",removeScreenshot:"Quitar captura de pantalla",inboxAriaLabel:"Bandeja de comentarios",inboxEmptyTitle:"Todav\xEDa no hay comentarios",inboxEmptyHintTemplate:"Pulsa {n} y haz clic en cualquier parte de la p\xE1gina para empezar.",inboxEmptyAction:"Activar modo",inboxNoMatches:"Ning\xFAn comentario coincide con estos filtros",orphanedBadge:"Desanclado",hiddenBadge:"Oculto",filterAll:"Todas las p\xE1ginas",filterCurrentPage:"P\xE1gina actual",filterTitle:"Filtrar",filterClear:"Limpiar",filterByPage:"P\xE1gina",filterByStatus:"Estado",back:"Volver",deleteComment:"Eliminar",deleteReply:"Eliminar respuesta",replyOptions:"Opciones de la respuesta",editComment:"Editar",editReply:"Editar respuesta",copyLink:"Copiar enlace",linkCopied:"Enlace copiado",editorAriaLabel:"Editar texto",editSave:"Guardar",editCancel:"Cancelar",editedMark:"editado",editedAtPrefix:"Editado el ",confirmDiscardTitle:"\xBFDescartar los cambios?",confirmDiscardMessage:"Los cambios que hiciste en este texto no se han guardado y se perder\xE1n.",confirmDiscard:"Descartar",confirmKeepEditing:"Seguir editando",commentNotFound:"Ese comentario no est\xE1 en esta p\xE1gina.",confirmDelete:"Eliminar",confirmCancel:"Cancelar",confirmDeleteCommentTitle:"\xBFEliminar comentario?",confirmDeleteCommentMessage:"Este comentario se eliminar\xE1 de forma permanente. Esta acci\xF3n no se puede deshacer.",confirmDeleteThreadMessage:"Este comentario y todas sus respuestas se eliminar\xE1n de forma permanente. Esta acci\xF3n no se puede deshacer.",confirmDeleteReplyTitle:"\xBFEliminar respuesta?",confirmDeleteReplyMessage:"Esta respuesta se eliminar\xE1 de forma permanente. Esta acci\xF3n no se puede deshacer.",copyAgentContext:"Copiar contexto de agente",copied:"Copiado",statusLabel:"Estado",prevComment:"Comentario anterior",nextComment:"Comentario siguiente",replyLink:"Responder",replyCountOne:"1 respuesta",replyCountTemplate:"{n} respuestas",commentOptions:"Opciones del comentario",moreOptions:"M\xE1s",statusOpen:"Abierto",statusInProgress:"En progreso",statusResolved:"Resuelto",durationLessThanMinute:"<1m",resolvedInTemplate:"Resuelto en {n}",typeLabel:"Tipo",priorityLabel:"Prioridad",unset:"Sin definir",typeBug:"Bug",typeSuggestion:"Sugerencia",typeQuestion:"Pregunta",typeImprovement:"Mejora",priorityHigh:"Alta",priorityMedium:"Media",priorityLow:"Baja",filterByType:"Tipo",filterByPriority:"Prioridad",contextSection:"Contexto",autoScreenshotLabel:"Contexto autom\xE1tico",contextUrl:"URL",contextViewport:"Viewport",contextScreen:"Pantalla",contextBrowser:"Navegador",contextOs:"SO"};var me={en:N,es:He},ge="en";function Xe(){let n=(navigator.language||ge).slice(0,2).toLowerCase();return n in me?n:ge}function Fe(n){return me[n]||me[ge]}function v(n,e){return n.replace("{n}",String(e))}var xt=6e4;function J(n,e){if(!Number.isFinite(n)||n<0)return"";let t=Math.floor(n/xt);if(t<1)return e.durationLessThanMinute;if(t<60)return v(e.minutesAgoTemplate,t);let i=Math.floor(t/60);if(i<24){let l=t%60,c=v(e.hoursAgoTemplate,i);return l?`${c} ${v(e.minutesAgoTemplate,l)}`:c}let s=Math.floor(i/24),r=i%24,a=v(e.daysAgoTemplate,s);return r?`${a} ${v(e.hoursAgoTemplate,r)}`:a}var Ee=64,_t=3,Ot=5,yt=.6,vt=.7,St=/^(css|sc|jsx|emotion)-/i,At=/^data-(reactid|react-|v-|svelte-)/,Rt=["id","name","role","aria-label"],It=["data-testid","name","aria-label"],fe=n=>typeof CSS<"u"&&CSS.escape?CSS.escape(n):String(n).replace(/[^a-zA-Z0-9_-]/g,"\\$&"),Nt=n=>String(n).replace(/["\\]/g,"\\$&"),U=(n,e)=>{try{return e.querySelectorAll(n).length===1}catch{return!1}},Ve=n=>(n||"").replace(/\s+/g," ").trim().slice(0,Ee),wt=n=>Be.includes(n)||St.test(n)?!1:!n.split(/[-_]/).some(e=>e.length>=5&&/\d/.test(e)),Lt=n=>[...n.classList].filter(wt),Bt=n=>{let e={};for(let{name:t,value:i}of n.attributes)(Rt.includes(t)||t.startsWith("data-")&&!At.test(t))&&i&&(e[t]=i.slice(0,Ee));return e},be=n=>{let e=n.parentElement;if(!e)return{index:0,count:1};let t=[...e.children].filter(i=>i.tagName===n.tagName);return{index:t.indexOf(n),count:t.length}},Mt=(n,e)=>{if(!n.id)return null;let t=`#${fe(n.id)}`;return U(t,e)?t:null},Pt=(n,e)=>{let t=n.tagName.toLowerCase();for(let i of It){let s=n.getAttribute(i);if(!s)continue;let r=`${t}[${i}="${Nt(s)}"]`;if(U(r,e))return r}return null},Dt=(n,e)=>{let t=[],i=n;for(let s=0;s<_t&&i;s++){let r=Lt(i),a=i.tagName.toLowerCase();if(t.unshift(r.length?`${a}.${r.map(fe).join(".")}`:a),s===0&&!r.length)return null;let l=t.join(" > ");if(U(l,e))return l;i=i.parentElement}return null},$t=(n,e)=>{if(n===e.body)return"body";let t=[],i=n;for(let r=0;r<Ot&&i;r++){if(i===e.body){t.unshift("body");break}if(i.id){let l=[`#${fe(i.id)}`,...t].join(" > ");if(U(l,e))return l}let{index:a}=be(i);t.unshift(`${i.tagName.toLowerCase()}:nth-of-type(${a+1})`),i=i.parentElement}let s=t.join(" > ");return U(s,e)?s:null},ze=(n,e)=>Mt(n,e)||Pt(n,e)||Dt(n,e)||$t(n,e);function Ye(n){return ze(n,n.ownerDocument)}function We(n,e,t){let i=n.ownerDocument,{index:s,count:r}=be(n);return{version:1,selector:ze(n,i),fingerprint:{tagName:n.tagName,textSnippet:Ve(n.textContent),attributes:Bt(n),siblingIndex:s,siblingCount:r},relativeX:e,relativeY:t}}var kt=(n,e)=>{if(!n&&!e)return 1;if(!n||!e)return 0;if(n===e)return 1;if(n.startsWith(e)||e.startsWith(n))return .8;let t=new Set(n.split(" ")),i=new Set(e.split(" ")),s=0;for(let r of t)i.has(r)&&s++;return 2*s/(t.size+i.size)},Ht=(n,e)=>{let t=Object.keys(e);if(!t.length)return 1;let i=0;for(let s of t)(n.getAttribute(s)||"").slice(0,Ee)===e[s]&&i++;return i/t.length},Ue=(n,e)=>{let{index:t,count:i}=be(n),s=Math.abs(t-e.siblingIndex),r=Math.max(e.siblingCount,i,1);return Math.max(0,1-s/r)},Xt=(n,e)=>{if(n.tagName!==e.tagName)return 0;let t=!!e.textSnippet,i=Object.keys(e.attributes||{}).length>0,s=.5,r=.3,a=.2;return i?t||(r+=s,s=0):(s+=r,r=0),!t&&!i?Ue(n,e):s*kt(Ve(n.textContent),e.textSnippet)+r*Ht(n,e.attributes||{})+a*Ue(n,e)},Ge=(n,e)=>{let t=null;for(let i of n){let s=Xt(i,e);(!t||s>t.confidence)&&(t={element:i,confidence:s})}return t};function je(n,e=document){let t=n?.fingerprint;if(!t||!t.tagName)return null;if(n.selector){let a=[];try{a=[...e.querySelectorAll(n.selector)]}catch{}let l=Ge(a,t);if(l&&l.confidence>=yt)return l}if(!(!!t.textSnippet||Object.keys(t.attributes||{}).length>0))return null;let s;try{s=[...e.querySelectorAll(t.tagName)]}catch{return null}let r=Ge(s,t);return r&&r.confidence>=vt?r:null}var Ke="helldots-comments",ee="helldots-pending-detail";function te(){try{let n=localStorage.getItem(Ke);if(!n)return[];let e=JSON.parse(n);return Array.isArray(e)?e:[]}catch(n){return console.warn("HellDots: could not read stored comments",n),[]}}function qe(n){try{return localStorage.setItem(Ke,JSON.stringify(n)),!0}catch{return!1}}function Ce(n){if(qe(n))return!0;let e=n.map((s,r)=>({comment:s,index:r})).filter(({comment:s})=>s?.contextScreenshot).sort((s,r)=>{let a=Date.parse(s.comment.createdAt),l=Date.parse(r.comment.createdAt);return Number.isFinite(a)&&Number.isFinite(l)&&a!==l?a-l:s.index-r.index});if(e.length===0)return console.warn("HellDots: could not persist comments (storage quota exceeded, nothing left to shed)"),!1;let t=[...n],i=0;for(let{index:s}of e)if(t[s]={...t[s],contextScreenshot:null},i++,qe(t))return console.warn(`HellDots: localStorage quota exceeded \u2014 dropped the automatic context screenshot from the ${i} oldest comment(s) to keep all comments persisted. Comment text, replies and user-attached screenshots were not touched.`),!0;return console.warn(`HellDots: could not persist comments even after dropping all ${i} automatic context screenshot(s); storage quota exceeded`),!1}function Te(n,e,t){let i=new Set(e.map(r=>r.id));return[...n.filter(r=>!i.has(r.id)&&r.page!==t),...e]}var Ze="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var Qe=(n=21)=>{let e="",t=crypto.getRandomValues(new Uint8Array(n|=0));for(;n--;)e+=Ze[t[n]&63];return e};var xe=()=>Qe();var oe="helldotsComment",G=(n,e=oe,t=location.href)=>{let i=new URL(t),s=n.page||i.pathname,r=s===i.pathname?i:new URL(s,i);return r.searchParams.set(e,String(n.id)),r.href},Je=(n=oe,e=location.href)=>{try{return new URL(e).searchParams.get(n)}catch{return null}};var V=new Set,P=null,et=(n,e)=>(typeof e.composedPath=="function"?e.composedPath():[]).includes(n)||n.contains(e.target),Ft=()=>{P||(P=n=>{for(let e of[...V])et(e.menu,n)||et(e.button,n)||e.close()},document.addEventListener("mousedown",P,!0))},Ut=()=>{P&&(document.removeEventListener("mousedown",P,!0),P=null)},ie=()=>{for(let n of[...V])n.close()},z=(n,e)=>{let t={button:n,menu:e,close:()=>{e.style.display="none",n.setAttribute("aria-expanded","false"),V.delete(t),V.size===0&&Ut()}},i=()=>{ie(),e.style.display="block",n.setAttribute("aria-expanded","true"),V.add(t),Ft()},s=()=>e.style.display!=="none";return e.style.display="none",n.setAttribute("aria-expanded","false"),n.addEventListener("click",r=>{r.stopPropagation();let a=s();ie(),a||i()}),{open:i,close:t.close,isOpen:s}};var _e=new Set,tt=()=>{for(let n of[..._e])n(!1)},ne=(n,{title:e,message:t,confirmLabel:i,cancelLabel:s})=>new Promise(r=>{let a=document.createElement("div");a.className=o.CONFIRM,a.style.zIndex=String(O.CONFIRM);let l=document.createElement("div");l.className=o.CONFIRM_PANEL,l.setAttribute("role","alertdialog"),l.setAttribute("aria-modal","true");let c=document.createElement("h2");c.className=o.CONFIRM_TITLE,c.textContent=e,c.id=`hd-confirm-title-${Math.random().toString(36).slice(2,9)}`,l.setAttribute("aria-labelledby",c.id);let p=document.createElement("p");p.className=o.CONFIRM_MESSAGE,p.textContent=t;let h=document.createElement("div");h.className=o.CONFIRM_ACTIONS;let d=document.createElement("button");d.type="button",d.className=o.CONFIRM_CANCEL,d.textContent=s;let g=document.createElement("button");g.type="button",g.className=o.CONFIRM_ACCEPT,g.textContent=i,h.appendChild(d),h.appendChild(g),l.appendChild(c),l.appendChild(p),l.appendChild(h),a.appendChild(l);let m=n.activeElement||document.activeElement,u=!1,f=E=>{u||(u=!0,_e.delete(f),document.removeEventListener("keydown",b,!0),a.remove(),m?.focus?.(),r(E))},b=E=>{if(E.key==="Escape"){E.stopPropagation(),E.preventDefault(),f(!1);return}if(E.key!=="Tab")return;let C=[d,g],y=n.activeElement||document.activeElement,_=C.indexOf(y);E.preventDefault(),(E.shiftKey?C[(_<=0?C.length:_)-1]:C[(_+1)%C.length]).focus()};d.addEventListener("click",()=>f(!1)),g.addEventListener("click",()=>f(!0));let x=!1;a.addEventListener("mousedown",E=>{x=E.target===a,E.stopPropagation()}),a.addEventListener("click",E=>{E.target===a&&x&&f(!1),x=!1}),_e.add(f),document.addEventListener("keydown",b,!0),(n.body||n).appendChild(a),d.focus()});var ot='<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"/><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/></svg>',Gt='<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"/></svg>',Vt='<svg width="14" height="14" viewBox="0 0 24 24" fill="currentColor"><circle cx="5" cy="12" r="1.6"/><circle cx="12" cy="12" r="1.6"/><circle cx="19" cy="12" r="1.6"/></svg>',$=n=>{if(navigator.clipboard?.writeText)return navigator.clipboard.writeText(n).catch(()=>{});let e=document.createElement("textarea");e.value=n,e.style.position="fixed",e.style.opacity="0",document.body.appendChild(e),e.select();try{document.execCommand("copy")}catch{}return e.remove(),Promise.resolve()},k=(n,e)=>({open:e.statusOpen,in_progress:e.statusInProgress,resolved:e.statusResolved})[n]||e.statusOpen,B=(n,e)=>({bug:e.typeBug,suggestion:e.typeSuggestion,question:e.typeQuestion,improvement:e.typeImprovement})[n]||e.unset,M=(n,e)=>({high:e.priorityHigh,medium:e.priorityMedium,low:e.priorityLow})[n]||e.unset,D=({action:n,options:e,value:t,colorOf:i,labelOf:s,tooltipLabel:r,onSelect:a,showLabel:l=!1})=>{let c=document.createElement("div");c.style.position="relative";let p=document.createElement("button");p.type="button",p.className=o.INBOX_ACTION_BTN,l&&p.classList.add(o.INBOX_ACTION_BTN_LABELED),p.dataset.action=n,p.setAttribute("aria-haspopup","true");let h=document.createElement("span");h.className=o.INBOX_STATUS_DOT,p.appendChild(h);let d=null;l&&(d=document.createElement("span"),d.className=o.INBOX_ACTION_LABEL,p.appendChild(d));let g=document.createElement("div");g.className=o.INBOX_MENU,g.setAttribute("role","menu");let m=z(p,g),u=t,f=()=>{let b=`${r}: ${s(u)}`;h.style.backgroundColor=i(u),p.dataset.hdTooltip=b,p.setAttribute("aria-label",b),d&&(d.textContent=s(u)),g.querySelectorAll("[data-picker-option]").forEach(x=>{let S=x.dataset.pickerOption,E=S===""?null:S;x.setAttribute("aria-checked",String(E===u))})};for(let b of e){let x=document.createElement("button");x.type="button",x.className=o.INBOX_MENU_ITEM,x.dataset.pickerOption=b===null?"":b,x.setAttribute("role","menuitemradio");let S=document.createElement("span");S.className=o.INBOX_STATUS_DOT,S.style.backgroundColor=i(b),x.appendChild(S),x.appendChild(document.createTextNode(s(b))),x.addEventListener("click",E=>{E.stopPropagation(),m.close(),b!==u&&(u=b,a(b),f())}),g.appendChild(x)}return c.appendChild(p),c.appendChild(g),f(),c},Oe=({label:n,tooltip:e,items:t})=>{let i=document.createElement("div");i.style.position="relative";let s=document.createElement("button");s.type="button",s.className=o.INBOX_ACTION_BTN,s.dataset.action="menu",e&&(s.dataset.hdTooltip=e),s.setAttribute("aria-label",n),s.innerHTML=Vt;let r=document.createElement("div");r.className=o.INBOX_MENU,r.setAttribute("role","menu");let a=z(s,r);for(let l of t){let c=document.createElement("button");c.type="button",c.className=o.INBOX_MENU_ITEM,c.setAttribute("role","menuitem"),c.textContent=l.label,c.addEventListener("click",async p=>{if(p.stopPropagation(),l.feedbackLabel){l.onSelect(),c.textContent=l.feedbackLabel,setTimeout(()=>{c.textContent=l.label,a.close()},1200);return}if(a.close(),l.confirm){let h=c.getRootNode();if(!await ne(h,l.confirm()))return}l.onSelect()}),r.appendChild(c)}return i.appendChild(s),i.appendChild(r),i},re=(n,{strings:e,onCopy:t,onCopyLink:i,onEdit:s,onSetStatus:r,onSetType:a,onSetPriority:l,onDelete:c})=>{let p=document.createElement("div");p.className=o.INBOX_CARD_ACTIONS;let h=document.createElement("button");return h.type="button",h.className=o.INBOX_ACTION_BTN,h.dataset.action="copy",h.dataset.hdTooltip=e.copyAgentContext,h.setAttribute("aria-label",e.copyAgentContext),h.innerHTML=ot,h.addEventListener("click",d=>{d.stopPropagation(),t(n),h.innerHTML=Gt,h.dataset.hdTooltip=e.copied,setTimeout(()=>{h.innerHTML=ot,h.dataset.hdTooltip=e.copyAgentContext},1500)}),p.appendChild(h),p.appendChild(D({action:"status",options:L,value:n.status||"open",colorOf:d=>Z[d]||"",labelOf:d=>k(d,e),tooltipLabel:e.statusLabel,onSelect:d=>r(n,d),showLabel:!0})),p.appendChild(D({action:"type",options:[null,...R],value:n.type||null,colorOf:d=>X[d]||"transparent",labelOf:d=>B(d,e),tooltipLabel:e.typeLabel,onSelect:d=>a?.(n,d),showLabel:!0})),p.appendChild(D({action:"priority",options:[null,...I],value:n.priority||null,colorOf:d=>F[d]||"transparent",labelOf:d=>M(d,e),tooltipLabel:e.priorityLabel,onSelect:d=>l?.(n,d),showLabel:!0})),p.appendChild(Oe({label:e.commentOptions,tooltip:e.moreOptions,items:[{label:e.copyLink,feedbackLabel:e.linkCopied,onSelect:()=>i?.(n)},{label:e.editComment,onSelect:()=>s?.(n)},{label:e.deleteComment,onSelect:()=>c(n),confirm:()=>({title:e.confirmDeleteCommentTitle,message:n.replies?.length?e.confirmDeleteThreadMessage:e.confirmDeleteCommentMessage,confirmLabel:e.confirmDelete,cancelLabel:e.confirmCancel})}]})),p};var H=({value:n,strings:e,onInput:t,onSave:i,onCancel:s})=>{let r=document.createElement("div");r.className=o.EDITOR;let a=document.createElement("textarea");a.className=o.EDITOR_INPUT,a.value=n,a.rows=3,a.setAttribute("aria-label",e.editorAriaLabel);let l=document.createElement("div");l.className=o.EDITOR_ACTIONS;let c=document.createElement("button");c.type="button",c.className=o.EDITOR_CANCEL,c.textContent=e.editCancel;let p=document.createElement("button");p.type="button",p.className=o.EDITOR_SAVE,p.textContent=e.editSave;let h=()=>{p.disabled=a.value.trim().length===0};return h(),a.addEventListener("input",()=>{h(),t(a.value)}),a.addEventListener("keydown",d=>{if(d.key==="Escape"){d.stopPropagation(),d.preventDefault(),s();return}d.key==="Enter"&&(d.metaKey||d.ctrlKey)&&!p.disabled&&(d.preventDefault(),i(a.value))}),c.addEventListener("click",d=>{d.stopPropagation(),s()}),p.addEventListener("click",d=>{d.stopPropagation(),p.disabled||i(a.value)}),l.appendChild(c),l.appendChild(p),r.appendChild(a),r.appendChild(l),queueMicrotask(()=>{a.focus(),a.setSelectionRange(a.value.length,a.value.length)}),r},se=(n,e)=>ne(n,{title:e.confirmDiscardTitle,message:e.confirmDiscardMessage,confirmLabel:e.confirmDiscard,cancelLabel:e.confirmKeepEditing});var zt=(n,e)=>{let t=Date.now()-new Date(n).getTime(),i=Math.floor(t/6e4),s=Math.floor(t/36e5),r=Math.floor(t/864e5);return i<1?e.justNow:i<60?v(e.minutesAgoTemplate,i):s<24?v(e.hoursAgoTemplate,s):v(e.daysAgoTemplate,r)},nt=(n,e)=>new Intl.DateTimeFormat(e,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}).format(new Date(n)),Y=(n,e,t,i,s=null)=>{let r=document.createElement("div");r.className=o.THREAD_META;let a=document.createElement("span");a.className=o.THREAD_AUTHOR,a.textContent=n||t.anonymous;let l=document.createElement("span");return l.className=o.THREAD_TIME,l.textContent=zt(e,t),l.dataset.fullDate=nt(e,i),r.appendChild(a),r.appendChild(l),s&&r.appendChild(ye(s,t,i)),r},ye=(n,e,t)=>{let i=document.createElement("span");return i.className=o.THREAD_EDITED,i.textContent=e.editedMark,i.dataset.fullDate=e.editedAtPrefix+nt(n,t),i},ve=(n,e)=>{let t=/Mac|iPod|iPhone|iPad/.test(navigator.userAgent),i={alt:t?"\u2325":e.modifierAlt,ctrl:t?"\u2318":e.modifierCtrl,shift:"\u21E7"},s=i[n.shortcutModifier]||i.alt,r=n.shortcutKey?.toUpperCase()||"C";return`${s} + ${r}`},Yt='<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"/><circle cx="8.5" cy="8.5" r="1.5"/><polyline points="21 15 16 10 5 21"/></svg>',Wt='<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M22 2L11 13M22 2L15 22L11 13M11 13L2 9L22 2"/></svg>',jt='<svg width="16" height="16" viewBox="0 0 16 16" stroke-linejoin="round" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M2.8914 10.4028L2.98327 10.6318C3.22909 11.2445 3.5 12.1045 3.5 13C3.5 13.3588 3.4564 13.7131 3.38773 14.0495C3.69637 13.9446 4.01409 13.8159 4.32918 13.6584C4.87888 13.3835 5.33961 13.0611 5.70994 12.7521L6.22471 12.3226L6.88809 12.4196C7.24851 12.4724 7.61994 12.5 8 12.5C11.7843 12.5 14.5 9.85569 14.5 7C14.5 4.14431 11.7843 1.5 8 1.5C4.21574 1.5 1.5 4.14431 1.5 7C1.5 8.18175 1.94229 9.29322 2.73103 10.2153L2.8914 10.4028ZM2.8135 15.7653C1.76096 16 1 16 1 16C1 16 1.43322 15.3097 1.72937 14.4367C1.88317 13.9834 2 13.4808 2 13C2 12.3826 1.80733 11.7292 1.59114 11.1903C0.591845 10.0221 0 8.57152 0 7C0 3.13401 3.58172 0 8 0C12.4183 0 16 3.13401 16 7C16 10.866 12.4183 14 8 14C7.54721 14 7.10321 13.9671 6.67094 13.9038C6.22579 14.2753 5.66881 14.6656 5 15C4.23366 15.3832 3.46733 15.6195 2.8135 15.7653Z"/></svg>',qt='<svg width="16" height="16" viewBox="0 0 16 16" stroke-linejoin="round" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M1.67705 7.5L3.92705 3H12.0729L14.3229 7.5H10H9.25V8.25C9.25 8.94036 8.69036 9.5 8 9.5C7.30964 9.5 6.75 8.94036 6.75 8.25V7.5H6H1.67705ZM1.5 9V12C1.5 12.5523 1.94772 13 2.5 13H13.5C14.0523 13 14.5 12.5523 14.5 12V9H10.6465C10.32 10.1543 9.25878 11 8 11C6.74122 11 5.67998 10.1543 5.35352 9H1.5ZM3 1.5H13L15.8944 7.28885C15.9639 7.42771 16 7.58082 16 7.73607V12C16 13.3807 14.8807 14.5 13.5 14.5H2.5C1.11929 14.5 0 13.3807 0 12V7.73607C0 7.58082 0.0361451 7.42771 0.105573 7.28885L3 1.5Z"/></svg>',ae=({areaClassName:n,inputTag:e="textarea",inputClassName:t,inputId:i,inputPlaceholder:s,submitBtnId:r,fileInputId:a},l)=>{let c=document.createElement("div");c.className=n;let p=document.createElement(e);i&&(p.id=i),t&&(p.className=t),p.placeholder=s,p.setAttribute("aria-label",s),e==="input"&&(p.type="text");let h=document.createElement("div");h.className=o.SCREENSHOTS_CONTAINER;let d=document.createElement("div");d.className=o.COMMENT_ACTIONS_BAR;let g=document.createElement("button");g.className=o.ATTACH_IMAGE_BTN,g.type="button",g.setAttribute("aria-label",l.attachImage),g.innerHTML=Yt;let m=document.createElement("input");m.type="file",a&&(m.id=a),m.accept="image/*",m.style.display="none";let u=document.createElement("button");return r&&(u.id=r),u.className=o.THREAD_SUBMIT,u.type="button",u.setAttribute("aria-label",l.send),u.innerHTML=Wt,d.appendChild(g),d.appendChild(m),d.appendChild(u),c.appendChild(p),c.appendChild(h),c.appendChild(d),{container:c,inputEl:p,screenshotsContainer:h,attachBtn:g,fileInput:m,submitBtn:u}},it=(n,e,t,i)=>{let s=document.createElement("div");s.className=o.TOOLBAR_ACTION_WRAPPER;let r=document.createElement("div");r.className=o.TOOLBAR_ACTION_TOOLTIP,t.forEach(l=>r.appendChild(l));let a=document.createElement("button");return a.type="button",a.className=`${o.TOOLBAR_ACTION_BTN} ${n}`,a.setAttribute("aria-label",i),a.innerHTML=e,s.appendChild(r),s.appendChild(a),s},rt=(n={},e=N)=>{let t=document.createElement("div");t.id=T.TOOLBAR;let i=document.createElement("div");i.className=o.TOOLBAR_ACTIONS;let s=document.createElement("span");s.className=o.TOOLBAR_TEXT,s.textContent=e.toolbarComment;let r=document.createElement("span");r.className=o.SHORTCUT_HINT,r.textContent=ve(n,e);let a=it(o.TOOLBAR_COMMENT_BTN,jt,[s,r],e.toolbarComment);a.querySelector(`.${o.TOOLBAR_COMMENT_BTN}`)?.setAttribute("aria-pressed","false");let l=document.createElement("span");l.className=o.TOOLBAR_TEXT,l.textContent=e.toolbarInbox;let c=it(o.TOOLBAR_MENU_BTN,qt,[l],e.toolbarInbox);return i.appendChild(a),i.appendChild(c),t.appendChild(i),t},Se=(n,e,{includeStatus:t=!1,includeClassification:i=!0}={})=>{let s=document.createElement("div");s.className=o.INBOX_BADGES;let r=(a,l,c)=>{let p=document.createElement("span");p.className=`${o.BADGE} ${l}`,p.textContent=a,c&&(p.style.borderColor=c),s.appendChild(p)};if(t){let a=n.status||"open";r(k(a,e),o.BADGE_STATUS,Z[a])}i&&n.type&&r(B(n.type,e),o.BADGE_TYPE,X[n.type]),i&&n.priority&&r(M(n.priority,e),o.BADGE_PRIORITY,F[n.priority]);for(let a of n.tags||[])r(a,o.BADGE_TAG,null);if(n.status==="resolved"){let a=n.resolvedAt?J(new Date(n.resolvedAt).getTime()-new Date(n.createdAt).getTime(),e):"";r(v(e.resolvedInTemplate,a||"\u2014"),o.BADGE_DURATION,null)}return s.children.length?s:null},Kt=n=>{let e=document.createElement("div");e.className=o.CLASSIFY_ROW;let t=null,i=null,s=()=>{e.replaceChildren(),e.appendChild(D({action:"type",options:[null,...R],value:null,colorOf:r=>X[r]||"transparent",labelOf:r=>B(r,n),tooltipLabel:n.typeLabel,onSelect:r=>t=r,showLabel:!0})),e.appendChild(D({action:"priority",options:[null,...I],value:null,colorOf:r=>F[r]||"transparent",labelOf:r=>M(r,n),tooltipLabel:n.priorityLabel,onSelect:r=>i=r,showLabel:!0}))};return s(),{container:e,getType:()=>t,getPriority:()=>i,reset:()=>{t=null,i=null,s()}}},st=(n=N)=>{let e=document.createElement("div");e.id=T.COMMENT_BOX,e.setAttribute("role","dialog"),e.setAttribute("aria-label",n.commentBoxAriaLabel);let{container:t}=ae({areaClassName:o.COMMENT_INPUT_AREA,inputTag:"textarea",inputId:T.COMMENT_INPUT,inputPlaceholder:n.commentPlaceholder,submitBtnId:T.SUBMIT_COMMENT,fileInputId:T.ATTACH_IMAGE_INPUT},n),i=Kt(n);return e.appendChild(i.container),e.appendChild(t),e.style.display="none",e.classify=i,e},at=(n,e=N)=>{let t=document.createElement("div");return t.className=o.CIRCLE,t.dataset.commentId=n.id,t.dataset.commentText=n.text,t.setAttribute("role","button"),t.setAttribute("tabindex","0"),t.setAttribute("aria-label",`${e.commentAriaLabelPrefix}${n.text}`),t.style.cssText=`
|
|
1451
|
-
position: absolute;
|
|
1452
|
-
pointer-events: auto;
|
|
1453
|
-
`,t},W=(n,e)=>{let t=document.createElement("div");return t.className=o.SCREENSHOTS_CONTAINER,t.classList.add(o.ACTIVE),n.forEach(i=>{let s=document.createElement("div");s.className=o.SCREENSHOT_ITEM;let r=document.createElement("img");r.className=o.SCREENSHOT_IMG,r.src=i,r.alt=e.attachedScreenshot,s.appendChild(r),t.appendChild(s)}),t},lt=(n,e=N,t)=>{let i=document.createElement("div");i.className=o.TOOLTIP,i.dataset.for=n.id,i.setAttribute("role","dialog"),i.setAttribute("aria-label",e.tooltipAriaLabel);let s=document.createElement("div");s.className=o.THREAD_HEADER;let r=Y(n.author,n.createdAt,e,t,n.editedAt),a=document.createElement("button");a.type="button",a.className=o.CLOSE_TOOLTIP,a.setAttribute("aria-label",e.close),a.innerHTML="×",s.appendChild(r),s.appendChild(a);let l=document.createElement("div");l.className=o.THREAD_BODY,l.textContent=n.text,i.appendChild(s),i.appendChild(l);let c=Se(n,e,{includeStatus:!0});c&&i.appendChild(c);let p=n.screenshots||(n.screenshot?[n.screenshot]:[]);p.length>0&&i.appendChild(W(p,e));let h=n.replies?.length||0;if(h>0){let d=document.createElement("div");d.className=o.TOOLTIP_REPLY_COUNT,d.textContent=h===1?e.replyCountOne:v(e.replyCountTemplate,h),i.appendChild(d)}return i},j=(n,e=N,t,{onDelete:i,onEdit:s,editing:r=null}={})=>{let a=document.createElement("div");a.className=o.THREAD_REPLY,a.dataset.replyId=String(n.id);let l=Y(n.author,n.timestamp,e,t,n.editedAt),c=[];if(s&&c.push({label:e.editReply,onSelect:()=>s(n)}),i&&c.push({label:e.deleteReply,onSelect:()=>i(n,a),confirm:()=>({title:e.confirmDeleteReplyTitle,message:e.confirmDeleteReplyMessage,confirmLabel:e.confirmDelete,cancelLabel:e.confirmCancel})}),c.length>0){let d=Oe({label:e.replyOptions,items:c});d.classList.add(o.THREAD_REPLY_ACTIONS),l.appendChild(d)}let p;r?p=H({value:r.draft,strings:e,onInput:r.onInput,onSave:r.onSave,onCancel:r.onCancel}):(p=document.createElement("div"),p.className=o.THREAD_BODY,p.textContent=n.text),a.appendChild(l),a.appendChild(p);let h=n.screenshots||(n.screenshot?[n.screenshot]:[]);return h.length>0&&a.appendChild(W(h,e)),a},ct=(n,e=N,t,{onDeleteReply:i,onEditReply:s}={})=>{let r=document.createElement("div");r.className=o.THREAD_POPOVER,r.dataset.for=n.id,r.setAttribute("role","dialog"),r.setAttribute("aria-label",e.popoverAriaLabel);let a=document.createElement("div");a.className=o.THREAD_HEADER;let l=Y(n.author,n.createdAt,e,t,n.editedAt),c=document.createElement("button");c.type="button",c.className=o.CLOSE_TOOLTIP,c.setAttribute("aria-label",e.close),c.innerHTML="×",a.appendChild(l),a.appendChild(c);let p=document.createElement("div");p.className=o.THREAD_BODY,p.textContent=n.text;let h=document.createElement("div");h.className=o.THREAD_REPLIES,n.replies&&n.replies.forEach(u=>{h.appendChild(j(u,e,t,{onDelete:i,onEdit:s}))});let{container:d}=ae({areaClassName:o.THREAD_INPUT_AREA,inputTag:"input",inputClassName:o.THREAD_INPUT,inputPlaceholder:e.replyPlaceholder},e),g=document.createElement("div");g.className=o.THREAD_SCROLL,r.appendChild(a),g.appendChild(p);let m=n.screenshots||(n.screenshot?[n.screenshot]:[]);return m.length>0&&g.appendChild(W(m,e)),g.appendChild(h),r.appendChild(g),r.appendChild(d),r};var Zt=n=>{let e=[...n.attributes].map(({name:t,value:i})=>`${t}="${i}"`).join(" ");return`<${n.tagName.toLowerCase()}${e?` ${e}`:""}>`},Qt=n=>{if(!n?.tagName)return"(unknown)";let e=Object.entries(n.attributes||{}).map(([t,i])=>`${t}="${i}"`).join(" ");return`<${n.tagName.toLowerCase()}${e?` ${e}`:""}>`},Jt=n=>{let e=[],t=n;for(;t&&t!==document.documentElement;){let i=t.tagName.toLowerCase(),s=t.id?`#${t.id}`:"",r=[...t.classList].slice(0,2).map(a=>`.${a}`).join("");if(e.unshift(`${i}${s}${r}`),t===document.body)break;t=t.parentElement}return e.join(" > ")};function le(n,{viewportWidth:e,viewportHeight:t,strings:i}){let s=n.anchor,r=s?.fingerprint,a=n.container?.isConnected?n.container:null,l=n.hidden?"hidden":n.anchorState,c=a?Zt(a):Qt(r),p=a?Jt(a):"(unavailable)",h=n.context?.viewport,d=h?.width??e,g=h?.height??t,m=[`Page: ${n.page}`,`Viewport: ${d}x${g}`,`Anchor state: ${l}`,`Status: ${n.status||"open"}`,`Selector: ${s?.selector||"(none)"}`,`Element: ${c}`,`DOM path: ${p}`,`Nearby text: "${r?.textSnippet??""}"`,`Comment by ${n.author} (${n.createdAt}):`,`"${n.text}"`];n.type&&m.push(`Type: ${n.type}`),n.priority&&m.push(`Priority: ${n.priority}`),n.tags?.length&&m.push(`Tags: ${n.tags.join(", ")}`);let u=n.context;if(u&&(u.url&&m.push(`URL: ${u.url}`),u.screen&&m.push(`Screen: ${u.screen.width}x${u.screen.height}`),u.browser?.name&&m.push(`Browser: ${`${u.browser.name} ${u.browser.version||""}`.trim()}`),u.os?.name&&m.push(`OS: ${`${u.os.name} ${u.os.version||""}`.trim()}`)),i&&n.status==="resolved"&&n.resolvedAt){let b=J(new Date(n.resolvedAt).getTime()-new Date(n.createdAt).getTime(),i);b&&m.push(`Resolution time: ${b}`)}let f=n.replies||[];if(f.length>0){m.push(`Replies (${f.length}):`);for(let b of f)m.push(`- ${b.author}: "${b.text}"`)}return m.join(`
|
|
1454
|
-
`)}var eo='<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"/></svg>',ce=(n,{strings:e,onShowLightbox:t,collapsible:i=!1})=>{let{context:s,contextScreenshot:r}=n;if(!s&&!r)return null;let a=document.createElement("div");a.className=o.CONTEXT_BLOCK;let l=document.createElement("div");if(l.className=o.CONTEXT_BODY,i){let c=document.createElement("button");c.type="button",c.className=o.CONTEXT_TOGGLE,c.setAttribute("aria-expanded","false"),c.innerHTML=`<span>${e.contextSection}</span>${eo}`,l.style.display="none",c.addEventListener("click",p=>{p.stopPropagation();let h=c.getAttribute("aria-expanded")==="true";c.setAttribute("aria-expanded",String(!h)),l.style.display=h?"none":""}),a.appendChild(c)}else{let c=document.createElement("div");c.className=o.CONTEXT_TITLE,c.textContent=e.contextSection,a.appendChild(c)}if(r){let c=document.createElement("div");c.className=o.CONTEXT_SCREENSHOT_CAPTION,c.textContent=e.autoScreenshotLabel,l.appendChild(c);let p=document.createElement("img");p.className=o.SCREENSHOT_IMG,p.src=r,p.alt=e.autoScreenshotLabel,p.addEventListener("click",h=>{h.stopPropagation(),t(r)}),l.appendChild(p)}if(s){let c=(d,g)=>{if(!g)return;let m=document.createElement("div");m.className=o.CONTEXT_ROW;let u=document.createElement("span");u.textContent=d;let f=document.createElement("span");f.textContent=g,m.appendChild(u),m.appendChild(f),l.appendChild(m)},p=d=>d?`${d.width}\xD7${d.height}`:"",h=d=>d?.name?`${d.name} ${d.version||""}`.trim():"";c(e.contextUrl,s.url),c(e.contextViewport,p(s.viewport)),c(e.contextScreen,p(s.screen)),c(e.contextBrowser,h(s.browser)),c(e.contextOs,h(s.os))}return a.appendChild(l),a};var to='<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"/></svg>',oo='<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="15 18 9 12 15 6"/></svg>',io='<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="18 15 12 9 6 15"/></svg>',no='<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"/></svg>',de=class{constructor({shadowRoot:e,strings:t,locale:i,currentPage:s,getComments:r,callbacks:a,options:l={}}){this.shadowRoot=e,this.strings=t,this.locale=i,this.currentPage=s,this.getComments=r,this.callbacks=a,this.options=l,this.pageFilter="page",this.statusFilter="all",this.typeFilter="all",this.priorityFilter="all",this.detailId=null,this.editing=null,this.notice=null,this.el=null,this._highlightedEl=null,this._activeMarkerEl=null}isOpen(){return!!this.el}open(){this.el||(this.el=document.createElement("div"),this.el.className=o.INBOX_PANEL,this.el.setAttribute("role","dialog"),this.el.setAttribute("aria-label",this.strings.inboxAriaLabel),this.shadowRoot.appendChild(this.el),this.render())}close(){this._clearHighlight(),this._setActiveMarker(null),this.el?.remove(),this.el=null,this.detailId=null,this.editing=null,this.notice=null}refresh(){this.el&&this.render()}showNotice(e){this.notice=e,this.refresh()}clearNotice(){this.notice&&(this.notice=null,this.refresh())}isDirty(){return this.editing?this.editing.draft.trim()!==this._editingOriginalText().trim():!1}_editingOriginalText(){if(!this.editing)return"";let e=this.getComments().find(i=>String(i.id)===String(this.editing.commentId));return e?this.editing.replyId==null?e.text||"":(e.replies||[]).find(i=>String(i.id)===String(this.editing.replyId))?.text||"":""}async releaseEditor(){if(!this.editing)return!0;if(this.isDirty()){let e=this.el||this.shadowRoot;if(!await se(e,this.strings))return!1}return this.editing=null,!0}_editorHandlers(){return{draft:this.editing.draft,onInput:e=>{this.editing.draft=e},onSave:e=>{let{commentId:t,replyId:i}=this.editing;i==null?this.callbacks.onEditComment(t,e):this.callbacks.onEditReply(t,i,e),this.editing=null,this.render()},onCancel:async()=>{await this.releaseEditor()&&this.render()}}}_buildEditor(){let e=this._editorHandlers();return H({value:e.draft,strings:this.strings,onInput:e.onInput,onSave:e.onSave,onCancel:e.onCancel})}async startEditing(e,t=null){await this.releaseEditor()&&(this.detailId=e,this.editing={commentId:e,replyId:t,draft:""},this.editing.draft=this._editingOriginalText(),this.render())}_markerFor(e){return e.anchorState!=="anchored"||e.hidden||e.status==="resolved"?null:this.shadowRoot.querySelector(`[data-comment-id="${e.id}"]`)}_highlight(e){this._clearHighlight();let t=this._markerFor(e);t&&(t.classList.add(o.HIGHLIGHT),this._highlightedEl=t)}_clearHighlight(){this._highlightedEl?.classList.remove(o.HIGHLIGHT),this._highlightedEl=null}_setActiveMarker(e){if(this._activeMarkerEl?.classList.remove(o.CIRCLE_ACTIVE),this._activeMarkerEl=null,!e)return;let t=this._markerFor(e);t&&(t.classList.add(o.CIRCLE_ACTIVE),this._activeMarkerEl=t)}filteredComments(){let e=this.getComments();return this.pageFilter==="page"&&(e=e.filter(t=>t.page===this.currentPage)),this.statusFilter!=="all"&&(e=e.filter(t=>(t.status||"open")===this.statusFilter)),this.typeFilter!=="all"&&(e=e.filter(t=>t.type===this.typeFilter)),this.priorityFilter!=="all"&&(e=e.filter(t=>t.priority===this.priorityFilter)),[...e.filter(t=>t.status!=="resolved"),...e.filter(t=>t.status==="resolved")]}render(){if(!this.el)return;this._clearHighlight(),this.el.innerHTML="";let e=this.filteredComments(),t=this.detailId!=null?e.find(i=>i.id===this.detailId):null;this._setActiveMarker(t),t?this._renderDetail(t,e):(this.detailId=null,this._renderList(e))}openDetail(e){this.el||this.open();let t=this.getComments().find(i=>i.id===e);t&&this._openDetail(t)}_openDetail(e){this.detailId=e.id,e.anchorState==="anchored"&&!e.hidden&&this.callbacks.onOpenDetailScroll(e),this.render()}_closeButton(){let e=document.createElement("button");return e.type="button",e.className=o.INBOX_CLOSE,e.setAttribute("aria-label",this.strings.close),e.innerHTML="×",e.addEventListener("click",async()=>{this.editing&&!await this.releaseEditor()||this.callbacks.onClose()}),e}_renderList(e){let t=document.createElement("div");t.className=o.INBOX_HEADER,t.appendChild(this._buildFilter()),t.appendChild(this._closeButton()),this.el.appendChild(t);let i=document.createElement("div");if(i.className=o.INBOX_LIST,this.el.appendChild(i),this.notice){let s=document.createElement("div");s.className=o.INBOX_NOTICE,s.setAttribute("role","status"),s.textContent=this.notice,i.appendChild(s)}if(e.length===0){i.appendChild(this._buildEmptyState());return}for(let s of e)i.appendChild(this._buildCard(s,{interactive:!0}))}_buildEmptyState(){let e=document.createElement("div");e.className=o.INBOX_EMPTY;let t=document.createElement("div");t.className=o.INBOX_EMPTY_ICON,t.setAttribute("aria-hidden","true"),e.appendChild(t);let i=this.getComments().length>0,s=document.createElement("div");if(s.className=o.INBOX_EMPTY_TITLE,s.textContent=i?this.strings.inboxNoMatches:this.strings.inboxEmptyTitle,e.appendChild(s),i){let h=document.createElement("button");return h.type="button",h.className=o.INBOX_EMPTY_ACTION,h.textContent=this.strings.filterClear,h.addEventListener("click",()=>{this.pageFilter="page",this.statusFilter="all",this.typeFilter="all",this.priorityFilter="all",this.render()}),e.appendChild(h),e}let r=document.createElement("div");r.className=o.INBOX_EMPTY_TEXT;let[a,l]=String(this.strings.inboxEmptyHintTemplate).split("{n}"),c=document.createElement("kbd");c.className=o.INBOX_EMPTY_KBD,c.textContent=ve(this.options,this.strings),r.appendChild(document.createTextNode(a??"")),r.appendChild(c),r.appendChild(document.createTextNode(l??"")),e.appendChild(r);let p=document.createElement("button");return p.type="button",p.className=o.INBOX_EMPTY_ACTION,p.textContent=this.strings.inboxEmptyAction,p.addEventListener("click",()=>this.callbacks.onActivateCommentMode()),e.appendChild(p),e}_pageFilterLabel(e){return e==="all"?this.strings.filterAll:this.strings.filterCurrentPage}_filterSummaryLabel(){let e=[this._pageFilterLabel(this.pageFilter)];return this.statusFilter!=="all"&&e.push(k(this.statusFilter,this.strings)),this.typeFilter!=="all"&&e.push(B(this.typeFilter,this.strings)),this.priorityFilter!=="all"&&e.push(M(this.priorityFilter,this.strings)),e.join(" \xB7 ")}_isFilterActive(){return this.pageFilter!=="page"||this.statusFilter!=="all"||this.typeFilter!=="all"||this.priorityFilter!=="all"}_buildFilterGroup({title:e,dataAttr:t,values:i,labelOf:s,selected:r,toggles:a=!0,onSelect:l}){let c=document.createElement("div");c.className=o.INBOX_FILTER_GROUP;let p=document.createElement("div");p.className=o.INBOX_FILTER_SECTION,p.textContent=e,c.appendChild(p);let h=document.createElement("div");h.className=o.INBOX_FILTER_CHIPS;for(let d of i){let g=r===d,m=document.createElement("button");m.type="button",m.className=o.INBOX_FILTER_CHIP,m.dataset[t]=d,m.setAttribute("role",a?"switch":"radio"),m.setAttribute("aria-checked",String(g)),m.textContent=s(d),m.addEventListener("click",u=>{u.stopPropagation(),l(a&&g?"all":d),this.render()}),h.appendChild(m)}return c.appendChild(h),c}_buildFilter(){let e=document.createElement("div");e.className=o.INBOX_FILTER+"-wrapper";let t=document.createElement("button");t.type="button",t.className=o.INBOX_FILTER,t.setAttribute("aria-haspopup","true"),t.setAttribute("aria-expanded","false"),t.innerHTML=`<span>${this._filterSummaryLabel()}</span>${to}`;let i=document.createElement("div");i.className=o.INBOX_FILTER_MENU,i.setAttribute("role","group"),i.setAttribute("aria-label",this.strings.filterTitle),z(t,i);let s=document.createElement("div");s.className=o.INBOX_FILTER_MENU_HEADER;let r=document.createElement("span");r.textContent=this.strings.filterTitle,s.appendChild(r);let a=document.createElement("button");return a.type="button",a.className=o.INBOX_FILTER_CLEAR,a.textContent=this.strings.filterClear,a.disabled=!this._isFilterActive(),a.addEventListener("click",l=>{l.stopPropagation(),this.pageFilter="page",this.statusFilter="all",this.typeFilter="all",this.priorityFilter="all",this.render()}),s.appendChild(a),i.appendChild(s),i.appendChild(this._buildFilterGroup({title:this.strings.filterByPage,dataAttr:"filterPage",values:["page","all"],labelOf:l=>this._pageFilterLabel(l),selected:this.pageFilter,toggles:!1,onSelect:l=>this.pageFilter=l})),i.appendChild(this._buildFilterGroup({title:this.strings.filterByStatus,dataAttr:"filterStatus",values:[...L],labelOf:l=>k(l,this.strings),selected:this.statusFilter,onSelect:l=>this.statusFilter=l})),i.appendChild(this._buildFilterGroup({title:this.strings.filterByType,dataAttr:"filterType",values:[...R],labelOf:l=>B(l,this.strings),selected:this.typeFilter,onSelect:l=>this.typeFilter=l})),i.appendChild(this._buildFilterGroup({title:this.strings.filterByPriority,dataAttr:"filterPriority",values:[...I],labelOf:l=>M(l,this.strings),selected:this.priorityFilter,onSelect:l=>this.priorityFilter=l})),e.appendChild(t),e.appendChild(i),e}_buildCard(e,{interactive:t}){let i=document.createElement("div");i.className=o.INBOX_CARD,e.status==="resolved"&&i.classList.add(`${o.INBOX_CARD}--resolved`),i.dataset.commentId=e.id;let s=document.createElement("div");s.className=o.INBOX_CARD_HEADER,s.appendChild(Y(e.author,e.createdAt,this.strings,this.locale,e.editedAt)),i.appendChild(s);let r=document.createElement("div");if(r.className=o.THREAD_ACTIONS_ROW,r.appendChild(this._buildCardActions(e)),i.appendChild(r),!t&&this.editing&&this.editing.replyId==null&&String(this.editing.commentId)===String(e.id))i.appendChild(this._buildEditor());else{let p=document.createElement("div");p.className=o.INBOX_CARD_TEXT,p.textContent=e.text,i.appendChild(p)}if(e.screenshots?.length){let p=W(e.screenshots,this.strings);p.querySelectorAll(`.${o.SCREENSHOT_IMG}`).forEach(h=>{h.addEventListener("click",d=>{d.stopPropagation(),this.callbacks.onShowLightbox(h.src)})}),i.appendChild(p)}let l=Se(e,this.strings,{includeClassification:!1});l&&i.appendChild(l);let c=this._buildTag(e);if(c&&i.appendChild(c),t){i.setAttribute("role","button"),i.setAttribute("tabindex","0");let p=()=>e.anchorState==="inactive"?this.callbacks.onNavigateToPage(e):this._openDetail(e),h=document.createElement("button");h.type="button",h.className=o.INBOX_CARD_REPLY_LINK,h.textContent=this.strings.replyLink,h.addEventListener("click",d=>{d.stopPropagation(),p()}),i.appendChild(h),i.addEventListener("click",p),i.addEventListener("keydown",d=>{(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),p())}),i.addEventListener("mouseenter",()=>this._highlight(e)),i.addEventListener("mouseleave",()=>this._clearHighlight())}return i}_buildTag(e){let t=null;if(e.anchorState==="orphaned"?t=this.strings.orphanedBadge:e.hidden?t=this.strings.hiddenBadge:e.anchorState==="inactive"&&(t=e.page),!t)return null;let i=document.createElement("span");return i.className=o.INBOX_CARD_TAG,i.textContent=t,i}_buildCardActions(e){return re(e,{strings:this.strings,onCopy:t=>$(le(t,{viewportWidth:window.innerWidth,viewportHeight:window.innerHeight,strings:this.strings})),onCopyLink:t=>$(G(t,this.options.linkParam)),onEdit:t=>this.startEditing(t.id),onSetStatus:(t,i)=>this.callbacks.onSetStatus(t.id,i),onSetType:(t,i)=>this.callbacks.onSetType(t.id,i),onSetPriority:(t,i)=>this.callbacks.onSetPriority(t.id,i),onDelete:t=>{this.detailId===t.id&&(this.detailId=null),this.callbacks.onDelete(t.id),this.render()}})}_renderDetail(e,t){let i=t.indexOf(e),s=document.createElement("div");s.className=o.INBOX_DETAIL_HEADER;let r=document.createElement("button");r.type="button",r.className=o.INBOX_BACK,r.innerHTML=`${oo}<span>${this.strings.back}</span>`,r.addEventListener("click",async()=>{this.editing&&!await this.releaseEditor()||(this.detailId=null,this.render())}),s.appendChild(r);let a=document.createElement("div");a.className=o.INBOX_CARD_ACTIONS;let l=(d,g,m)=>{let u=document.createElement("button");u.type="button",u.className=o.INBOX_NAV_BTN,u.setAttribute("aria-label",g),u.title=g,u.innerHTML=d;let f=t[m];return u.disabled=!f,f&&u.addEventListener("click",async()=>{this.editing&&!await this.releaseEditor()||this._openDetail(f)}),u};a.appendChild(l(io,this.strings.prevComment,i-1)),a.appendChild(l(no,this.strings.nextComment,i+1)),a.appendChild(this._closeButton()),s.appendChild(a),this.el.appendChild(s);let c=document.createElement("div");c.className=o.INBOX_DETAIL,c.appendChild(this._buildCard(e,{interactive:!1}));let p=ce(e,{strings:this.strings,onShowLightbox:d=>this.callbacks.onShowLightbox(d)});p&&c.appendChild(p);let h=document.createElement("div");h.className=o.INBOX_REPLIES;for(let d of e.replies||[]){let g=this.editing&&String(this.editing.commentId)===String(e.id)&&String(this.editing.replyId)===String(d.id),m=j(d,this.strings,this.locale,{onDelete:(u,f)=>{this.callbacks.onDeleteReply(e.id,u.id)&&f.remove()},onEdit:u=>this.startEditing(e.id,u.id),editing:g?this._editorHandlers():null});m.querySelectorAll(`.${o.SCREENSHOT_IMG}`).forEach(u=>{u.addEventListener("click",f=>{f.stopPropagation(),this.callbacks.onShowLightbox(u.src)})}),h.appendChild(m)}c.appendChild(h),c.appendChild(this._buildReplyInput(e)),this.el.appendChild(c)}_buildReplyInput(e){let{container:t,inputEl:i,screenshotsContainer:s,attachBtn:r,fileInput:a,submitBtn:l}=ae({areaClassName:o.THREAD_INPUT_AREA,inputTag:"input",inputClassName:o.THREAD_INPUT,inputPlaceholder:this.strings.replyPlaceholder},this.strings),c=[],p=()=>{s.innerHTML="",s.classList.toggle(o.ACTIVE,c.length>0),c.forEach((d,g)=>{let m=document.createElement("div");m.className=o.SCREENSHOT_ITEM;let u=document.createElement("img");u.className=o.SCREENSHOT_IMG,u.src=d,u.alt=this.strings.attachedScreenshot,u.onclick=()=>this.callbacks.onShowLightbox(d);let f=document.createElement("button");f.type="button",f.className=o.SCREENSHOT_REMOVE,f.setAttribute("aria-label",this.strings.removeScreenshot),f.innerHTML="×",f.onclick=b=>{b.stopPropagation(),c.splice(g,1),p()},m.appendChild(u),m.appendChild(f),s.appendChild(m)})};r.addEventListener("click",()=>a.click()),a.addEventListener("change",d=>{let g=d.target.files[0];if(!g||c.length>=5)return;let m=new FileReader;m.onload=u=>{c.push(u.target.result),p()},m.readAsDataURL(g),a.value=""});let h=()=>{let d=i.value.trim();!d&&c.length===0||(this.callbacks.onReply(e,d,[...c]),c=[],this.render())};return l.addEventListener("click",h),i.addEventListener("keydown",d=>{d.key==="Enter"&&!d.shiftKey&&(d.preventDefault(),h())}),t}};var ro=n=>{let e=new Set;for(let t of n){let i=String(t).trim().toLowerCase();i&&e.add(i)}return[...e]},Ae=class{constructor(e={}){this.comments=[],this.commentMode=!1,this.isMac=/Mac|iPod|iPhone|iPad/.test(navigator.userAgent),this.options={shortcutKey:e.shortcutKey||(this.isMac?"c":"C"),shortcutModifier:e.shortcutModifier||"alt",autoScreenshot:e.autoScreenshot!==!1,...e},this.locale=this.options.locale||Xe(),this.strings=Fe(this.locale),this.resizeObservers=new Map,this.mutationObservers=new Map,this.positionValidationEnabled=!0,this._pendingRaf=null,this._pendingContextScreenshot=null,this._popoverEditing=null,this._pendingDetailId=null,document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>this.initOverlay()):this.initOverlay()}initOverlay(){this.shadowRoot=Re(),this.toolbar=rt(this.options,this.strings),this.commentBox=st(this.strings),this.overlay=document.createElement("div"),this.overlay.className=o.COMMENT_OVERLAY,this.shadowRoot.appendChild(this.overlay),this.shadowRoot.appendChild(this.toolbar),this.shadowRoot.appendChild(this.commentBox),this.commentBtn=this.toolbar.querySelector(`.${o.TOOLBAR_COMMENT_BTN}`),this.inboxBtn=this.toolbar.querySelector(`.${o.TOOLBAR_MENU_BTN}`),this.submitButton=this.shadowRoot.getElementById(T.SUBMIT_COMMENT),this.commentInput=this.shadowRoot.getElementById(T.COMMENT_INPUT),this.attachImageBtn=this.commentBox.querySelector(`.${o.ATTACH_IMAGE_BTN}`),this.attachImageInput=this.shadowRoot.getElementById(T.ATTACH_IMAGE_INPUT),this.bindEventListeners(),this.setupKeyboardShortcut(),this.setupResizeHandlers(),this.injectStyles(),this._pendingDetailId=this._readPendingDetailId(),this.options.persistence==="localStorage"&&this.loadComments(te()),this._openPendingDetail()}_navigateTo(e){location.assign(e)}_readPendingDetailId(){let e=Je(this._linkParam()),t=null;try{t=sessionStorage.getItem(ee),t!=null&&sessionStorage.removeItem(ee)}catch{}return e??t}_linkParam(){return this.options.linkParam||oe}_openPendingDetail(){let e=this._pendingDetailId;if(!e)return;let t=this.comments.find(i=>String(i.id)===String(e));if(!t){this.showInbox(),this.inboxView?.showNotice(this.strings.commentNotFound);return}this._pendingDetailId=null,this.showInbox(),this.inboxView.clearNotice(),this.inboxView.openDetail(t.id)}_popoverBodyEl(e=null){let t=this.activeThreadPopover;return t?e==null?t.querySelector(`.${o.THREAD_SCROLL} > .${o.THREAD_BODY}, .${o.THREAD_SCROLL} > .${o.EDITOR}`):t.querySelector(`.${o.THREAD_REPLY}[data-reply-id="${e}"]`)?.querySelector(`.${o.THREAD_BODY}, .${o.EDITOR}`)||null:null}_refreshCommentViews(e,t=null){if(this.activeThreadPopover?.dataset.for!==String(e))return;let i=this.comments.find(l=>String(l.id)===String(e));if(!i)return;let s=t==null?i:(i.replies||[]).find(l=>String(l.id)===String(t));if(!s)return;let r=document.createElement("div");r.className=o.THREAD_BODY,r.textContent=s.text,this._popoverBodyEl(t)?.replaceWith(r);let a=t==null?this.activeThreadPopover.querySelector(`.${o.THREAD_META}`):this.activeThreadPopover.querySelector(`.${o.THREAD_REPLY}[data-reply-id="${t}"]`)?.querySelector(`.${o.THREAD_META}`);if(a&&s.editedAt&&!a.querySelector(`.${o.THREAD_EDITED}`)){let l=ye(s.editedAt,this.strings,this.locale),c=a.querySelector(`.${o.THREAD_REPLY_ACTIONS}`);c?a.insertBefore(l,c):a.appendChild(l)}}_popoverEditorDirty(){if(!this._popoverEditing)return!1;let{commentId:e,replyId:t,draft:i}=this._popoverEditing,s=this.comments.find(a=>String(a.id)===String(e)),r=t==null?s:(s?.replies||[]).find(a=>String(a.id)===String(t));return i.trim()!==String(r?.text||"").trim()}async _releasePopoverEditor(){if(!this._popoverEditing)return!0;if(this._popoverEditorDirty()){let t=this.shadowRoot;if(!await se(t,this.strings))return!1}let{replyId:e}=this._popoverEditing;return this._popoverEditing=null,this._restorePopoverBody(e),!0}_restorePopoverBody(e){let t=this.comments.find(r=>String(r.id)===String(this.activeThreadPopover?.dataset.for));if(!t)return;let i=e==null?t:(t.replies||[]).find(r=>String(r.id)===String(e));if(!i)return;let s=document.createElement("div");s.className=o.THREAD_BODY,s.textContent=i.text,this._popoverBodyEl(e)?.replaceWith(s)}async _startPopoverEditing(e,t=null){if(!await this._releasePopoverEditor())return;let i=this.comments.find(a=>String(a.id)===String(e)),s=t==null?i:(i?.replies||[]).find(a=>String(a.id)===String(t));if(!s)return;this._popoverEditing={commentId:e,replyId:t,draft:s.text};let r=H({value:s.text,strings:this.strings,onInput:a=>{this._popoverEditing.draft=a},onSave:a=>{let l=t==null?this.editComment(e,a):this.editReply(e,t,a);this._popoverEditing=null,l?(this._refreshCommentViews(e,t),this.inboxView?.isOpen()&&this.inboxView.refresh()):this._restorePopoverBody(t)},onCancel:()=>{this._releasePopoverEditor()}});this._popoverBodyEl(t)?.replaceWith(r)}commentLink(e){let t=this.comments.find(i=>String(i.id)===String(e));return t?G(t,this._linkParam()):null}_syncStorage(){this.options.persistence==="localStorage"&&Ce(Te(te(),this.serializeComments(),location.pathname))}bindEventListeners(){this.commentBtn.addEventListener("click",()=>this.toggleCommentMode()),this.inboxBtn.addEventListener("click",()=>this.toggleInbox()),this.submitButton.addEventListener("click",()=>this.saveComment()),this.commentInput.addEventListener("keydown",e=>{e.key==="Enter"&&!e.shiftKey&&(e.preventDefault(),this.saveComment())}),this.attachImageBtn.addEventListener("click",()=>{this.attachImageInput.click()}),this.attachImageInput.addEventListener("change",e=>{let t=e.target.files[0];if(!t||(this._pendingScreenshots||(this._pendingScreenshots=[]),this._pendingScreenshots.length>=5))return;let i=new FileReader;i.onload=s=>{this._pendingScreenshots.push(s.target.result),this._updateScreenshotsPreview()},i.readAsDataURL(t),this.attachImageInput.value=""}),this._handleDocumentClickBound=e=>this.handleDocumentClick(e),document.addEventListener("mousedown",this._handleDocumentClickBound)}setupKeyboardShortcut(){this.keydownHandler&&document.removeEventListener("keydown",this.keydownHandler),this.keydownHandler=e=>{if(e.key==="Escape"){this._activeLightbox?this.closeLightbox():this.activeThreadPopover?this._popoverEditing?this._releasePopoverEditor():this.closeThreadPopover():this.inboxView?.isOpen()?this.inboxView.editing?this.inboxView.releaseEditor().then(r=>r&&this.inboxView?.refresh()):this.closeInbox():this.commentBox.style.display!=="none"?(this.hideCommentBox(),this.toggleCommentMode()):this.commentMode&&this.toggleCommentMode();return}let t=this.isMac&&e.altKey&&(e.key==="\xE7"||e.key==="\xC7"),i=!this.isMac&&e.altKey&&e.key.toLowerCase()==="c",s=e.key.toLowerCase()===this.options.shortcutKey.toLowerCase()&&(this.options.shortcutModifier==="alt"&&e.altKey||this.options.shortcutModifier==="ctrl"&&(e.ctrlKey||e.metaKey)||this.options.shortcutModifier==="shift"&&e.shiftKey);if(t||i||s)return e.preventDefault(),e.stopPropagation(),this.toggleCommentMode(),!1},document.addEventListener("keydown",this.keydownHandler)}handleDocumentClick(e){if(!this.commentMode)return;let t=e.composedPath()[0]||e.target;if(!(this.toolbar.contains(t)||t?.closest?.(`.${o.CIRCLE}`)||t?.closest?.(`.${o.TOOLTIP}`)||t?.closest?.(`.${o.THREAD_POPOVER}`)||t?.closest?.(`.${o.INBOX_PANEL}`)||t?.closest?.(`.${o.LIGHTBOX}`))&&!this.commentBox.contains(t)){if(this.commentBox.style.display!=="none"){this.hideCommentBox(),this.toggleCommentMode();return}e.button===0&&(e.preventDefault(),this._dragStart={x:e.clientX,y:e.clientY},this._isDragging=!1,this._boundDragMove=i=>this._onDragMove(i),this._boundDragEnd=i=>this._onDragEnd(i),document.addEventListener("mousemove",this._boundDragMove),document.addEventListener("mouseup",this._boundDragEnd))}}_onDragMove(e){let t=e.clientX-this._dragStart.x,i=e.clientY-this._dragStart.y;if(!this._isDragging&&Math.hypot(t,i)<5)return;this._isDragging=!0;let s=Math.min(this._dragStart.x,e.clientX),r=Math.min(this._dragStart.y,e.clientY),a=Math.abs(t),l=Math.abs(i);this._selectionRect||(this._selectionRect=document.createElement("div"),this._selectionRect.className=o.SELECTION_RECT,this.shadowRoot.appendChild(this._selectionRect)),this._selectionRect.style.left=`${s}px`,this._selectionRect.style.top=`${r}px`,this._selectionRect.style.width=`${a}px`,this._selectionRect.style.height=`${l}px`}async _onDragEnd(e){if(document.removeEventListener("mousemove",this._boundDragMove),document.removeEventListener("mouseup",this._boundDragEnd),this._isDragging){let t=Math.min(this._dragStart.x,e.clientX),i=Math.min(this._dragStart.y,e.clientY),s=Math.abs(e.clientX-this._dragStart.x),r=Math.abs(e.clientY-this._dragStart.y);if(this._selectionRect?.remove(),this._selectionRect=null,s>10&&r>10)try{this._pendingScreenshots||(this._pendingScreenshots=[]);let a=await he(()=>pe({scale:1})),l=Ne(a,{left:t,top:i,width:s,height:r});l&&this._pendingScreenshots.length<5&&this._pendingScreenshots.push(l),this.options.autoScreenshot&&(this._pendingContextScreenshot=ue(a,{sourceScale:1}))}catch(a){console.warn("Screenshot capture failed:",a)}await this._placeCommentAtPoint(e.clientX,e.clientY)}else await this._placeCommentAtPoint(this._dragStart.x,this._dragStart.y);this._isDragging=!1,this._dragStart=null}async _placeCommentAtPoint(e,t){if(this.options.autoScreenshot&&!this._pendingContextScreenshot)try{let h=await he(()=>pe({scale:K}));this._pendingContextScreenshot=ue(h,{sourceScale:K})}catch(h){console.warn("HellDots: automatic screenshot failed",h),this._pendingContextScreenshot=null}let i=this.overlay.style.pointerEvents;this.overlay.style.pointerEvents="none";let s=document.elementFromPoint(e,t);this.overlay.style.pointerEvents=i||"";let r=s?.closest?.(Me.CONTAINER)||document.body,a=r.getBoundingClientRect(),l=a.width>0?(e-a.left)/a.width:0,c=a.height>0?(t-a.top)/a.height:0,p=We(r,l,c);p.targetSelector=s&&s!==r?Ye(s):null,this.currentPosition={container:r,relativeX:l,relativeY:c,anchor:p,target:s||r},this.createPreviewCircle(e,t),document.body.classList.remove(o.COMMENT_CURSOR),this._pendingScreenshots&&this._pendingScreenshots.length>0&&this._updateScreenshotsPreview(),this.showCommentBox(e,t)}_updateScreenshotsPreview(){let e=this.commentBox.querySelector(`.${o.SCREENSHOTS_CONTAINER}`);if(e){if(e.innerHTML="",!this._pendingScreenshots||this._pendingScreenshots.length===0){e.classList.remove(o.ACTIVE);return}e.classList.add(o.ACTIVE),this._pendingScreenshots.forEach((t,i)=>{let s=document.createElement("div");s.className=o.SCREENSHOT_ITEM;let r=document.createElement("img");r.className=o.SCREENSHOT_IMG,r.src=t,r.alt=this.strings.attachedScreenshot,r.onclick=()=>this.showLightbox(t);let a=document.createElement("button");a.type="button",a.className=o.SCREENSHOT_REMOVE,a.setAttribute("aria-label",this.strings.removeScreenshot),a.innerHTML="×",a.onclick=l=>{l.stopPropagation(),this._pendingScreenshots.splice(i,1),this._updateScreenshotsPreview()},s.appendChild(r),s.appendChild(a),e.appendChild(s)})}}_clearScreenshotPreview(){this._pendingScreenshots=[];let e=this.commentBox.querySelector(`.${o.SCREENSHOTS_CONTAINER}`);e&&(e.innerHTML="",e.classList.remove(o.ACTIVE))}showCommentBox(e,t){this.commentBox.style.display="block";let s=28/2,r=s+10,a=window.innerWidth,l=window.innerHeight,c=this.commentBox.getBoundingClientRect(),p=c.width||400,h=e+s,d=t+s,g=h+r,m=d-s;g+p>a&&(g=h-r-p),g=Math.min(g,a-p-10),g=Math.max(10,g),m+c.height>l&&(m=l-c.height-10),m=Math.max(10,m),this.commentBox.style.left=`${g}px`,this.commentBox.style.top=`${m}px`,this.commentInput.value="",setTimeout(()=>this.commentInput.focus(),50)}hideCommentBox(){this.commentBox.style.display="none",this.commentInput.style.height="auto",this.currentPosition=null,this.removePreviewCircle(),this._clearScreenshotPreview(),this._pendingContextScreenshot=null,this.commentBox.classify?.reset(),this.commentMode&&document.body.classList.add(o.COMMENT_CURSOR)}toggleCommentMode(){this.commentMode=!this.commentMode,this.commentMode&&this.closeInbox(),this.commentBtn?.classList.toggle(o.ACTIVE,this.commentMode),this.commentBtn?.setAttribute("aria-pressed",String(this.commentMode)),this.overlay.classList.toggle(o.ACTIVE,this.commentMode),document.body.classList.toggle(o.COMMENT_CURSOR,this.commentMode),this.commentMode||this.hideCommentBox()}saveComment(){if(!this.commentInput.value.trim()||!this.currentPosition)return;let e={text:this.commentInput.value,container:this.currentPosition.container,relativeX:this.currentPosition.relativeX,relativeY:this.currentPosition.relativeY,anchor:this.currentPosition.anchor,anchorState:"anchored",target:this.currentPosition.target,hidden:!1,status:"open",page:location.pathname,id:xe(),replies:[],author:this.options.user?.name||this.strings.anonymous,createdAt:new Date().toISOString(),screenshots:this._pendingScreenshots?[...this._pendingScreenshots]:[],type:this.commentBox.classify?.getType()??null,priority:this.commentBox.classify?.getPriority()??null,tags:[],resolvedAt:null,context:Le(),contextScreenshot:this._pendingContextScreenshot};this.comments.push(e),this._syncStorage(),this.options.onCommentCreated?.(this._serializeComment(e)),this.renderCommentCircle(e),this.hideCommentBox(),this.toggleCommentMode();let t=this.shadowRoot.querySelector(`[data-comment-id="${e.id}"]`);t&&this.showThreadPopover(t,e)}renderCommentCircle(e){let t=at(e,this.strings);t.addEventListener("mouseenter",()=>this.showCommentTooltip(t,e)),t.addEventListener("mouseleave",()=>{setTimeout(()=>{let i=this.shadowRoot.querySelector(`.${o.TOOLTIP}[data-for="${e.id}"]`);i&&!i.matches(":hover")&&i.remove()},250)}),t.addEventListener("click",i=>{i.stopPropagation();let s=this.shadowRoot.querySelector(`.${o.TOOLTIP}[data-for="${e.id}"]`);if(s&&s.remove(),this.activeThreadPopover?.dataset.for===String(e.id)){this.closeThreadPopover();return}this.showThreadPopover(t,e)}),t.addEventListener("keydown",i=>{(i.key==="Enter"||i.key===" ")&&(i.preventDefault(),t.click())}),this.overlay.appendChild(t),this.updateCommentPosition(e,t),this.createResizeObserver(e,t),this.createMutationObserver(e)}showCommentTooltip(e,t){if(this.shadowRoot.querySelector(`.${o.THREAD_POPOVER}[data-for="${t.id}"]`)||this.shadowRoot.querySelector(`.${o.TOOLTIP}[data-for="${t.id}"]`))return;let r=lt(t,this.strings,this.locale);this.shadowRoot.appendChild(r),r.querySelectorAll(`.${o.SCREENSHOT_IMG}`).forEach(a=>{a.addEventListener("click",l=>{l.stopPropagation(),this.showLightbox(a.src)})}),setTimeout(()=>{this.positionPopoverAtCircle(r,e)},10),r.querySelector(`.${o.CLOSE_TOOLTIP}`).addEventListener("click",a=>{a.stopPropagation(),r.remove()}),r.addEventListener("mouseleave",()=>r.remove())}toggleInbox(){this.inboxView?.isOpen()?this.closeInbox():this.showInbox()}showInbox(){this.closeThreadPopover(),this.inboxView||(this.inboxView=new de({shadowRoot:this.shadowRoot,strings:this.strings,locale:this.locale,currentPage:location.pathname,getComments:()=>this.comments,options:this.options,callbacks:{onActivateCommentMode:()=>{this.closeInbox(),this.commentMode||this.toggleCommentMode()},onOpenDetailScroll:e=>this.scrollMarkerIntoView(e),onReply:(e,t,i)=>this.addReply(e,t,i),onDelete:e=>this.deleteComment(e),onDeleteReply:(e,t)=>this.deleteReply(e,t),onEditComment:(e,t)=>{this.editComment(e,t)&&this._refreshCommentViews(e)},onEditReply:(e,t,i)=>{this.editReply(e,t,i)&&this._refreshCommentViews(e)},onSetStatus:(e,t)=>this.setCommentStatus(e,t),onSetType:(e,t)=>this.setCommentType(e,t),onSetPriority:(e,t)=>this.setCommentPriority(e,t),onNavigateToPage:e=>{try{sessionStorage.setItem(ee,String(e.id))}catch{}this._navigateTo(e.page)},onShowLightbox:e=>this.showLightbox(e),onClose:()=>this.closeInbox()}})),this.inboxView.open(),setTimeout(()=>{this._inboxClickHandler=e=>{let t=e.composedPath()[0]||e.target;if(!this.inboxView.el?.contains(t)&&!this.inboxBtn.contains(t)&&!this._isInsideLightbox(t)){if(this.inboxView.isDirty())return;this.closeInbox()}},document.addEventListener("mousedown",this._inboxClickHandler)},0)}closeInbox(){this.inboxView?.close(),this._inboxClickHandler&&(document.removeEventListener("mousedown",this._inboxClickHandler),this._inboxClickHandler=null)}showThreadPopover(e,t){this.closeThreadPopover();let i=this.shadowRoot.querySelector(`.${o.TOOLTIP}[data-for="${t.id}"]`);i&&i.remove(),e?.classList.add(o.CIRCLE_ACTIVE),this._activePopoverCircle=e||null;let s=(E,C)=>{this.deleteReply(t.id,E.id)&&(C.remove(),this.inboxView?.isOpen()&&this.inboxView.refresh())},r=ct(t,this.strings,this.locale,{onDeleteReply:s,onEditReply:E=>this._startPopoverEditing(t.id,E.id)});this.shadowRoot.appendChild(r);let a=r.querySelector(`.${o.THREAD_HEADER}`),l=re(t,{strings:this.strings,onCopy:E=>$(le(E,{viewportWidth:window.innerWidth,viewportHeight:window.innerHeight,strings:this.strings})),onCopyLink:E=>$(G(E,this._linkParam())),onEdit:E=>this._startPopoverEditing(E.id),onSetStatus:(E,C)=>this.setCommentStatus(E.id,C),onSetType:(E,C)=>this.setCommentType(E.id,C),onSetPriority:(E,C)=>this.setCommentPriority(E.id,C),onDelete:E=>{this.closeThreadPopover(),this.deleteComment(E.id),this.inboxView?.isOpen()&&this.inboxView.refresh()}}),c=document.createElement("div");c.className=o.THREAD_ACTIONS_ROW,c.appendChild(l),a.insertAdjacentElement("afterend",c);let p=r.querySelector(`.${o.THREAD_SCROLL} > .${o.SCREENSHOTS_CONTAINER}`);p&&p.querySelectorAll(`.${o.SCREENSHOT_IMG}`).forEach(E=>{E.addEventListener("click",C=>{C.stopPropagation(),this.showLightbox(E.src)})});let h=ce(t,{strings:this.strings,onShowLightbox:E=>this.showLightbox(E),collapsible:!0});h&&r.querySelector(`.${o.THREAD_REPLIES}`).before(h),setTimeout(()=>{e?this.positionPopoverAtCircle(r,e):this.centerPopover(r)},10),r.querySelector(`.${o.CLOSE_TOOLTIP}`).addEventListener("click",async E=>{E.stopPropagation(),!(this._popoverEditing&&!await this._releasePopoverEditor())&&this.closeThreadPopover()});let d=r.querySelector(`.${o.THREAD_INPUT}`),g=r.querySelector(`.${o.THREAD_SUBMIT}`),m=r.querySelector(`.${o.THREAD_INPUT_AREA} .${o.ATTACH_IMAGE_BTN}`),u=r.querySelector(`.${o.THREAD_INPUT_AREA} input[type="file"]`),f=r.querySelector(`.${o.THREAD_INPUT_AREA} .${o.SCREENSHOTS_CONTAINER}`),b=[],x=()=>{if(f.innerHTML="",b.length===0){f.classList.remove(o.ACTIVE);return}f.classList.add(o.ACTIVE),b.forEach((E,C)=>{let y=document.createElement("div");y.className=o.SCREENSHOT_ITEM;let _=document.createElement("img");_.className=o.SCREENSHOT_IMG,_.src=E,_.alt=this.strings.attachedScreenshot,_.onclick=()=>this.showLightbox(E);let A=document.createElement("button");A.className=o.SCREENSHOT_REMOVE,A.innerHTML="×",A.onclick=q=>{q.stopPropagation(),b.splice(C,1),x()},y.appendChild(_),y.appendChild(A),f.appendChild(y)})};m.addEventListener("click",()=>{u.click()}),u.addEventListener("change",E=>{let C=E.target.files[0];if(!C||b.length>=5)return;let y=new FileReader;y.onload=_=>{b.push(_.target.result),x()},y.readAsDataURL(C),u.value=""});let S=()=>{let E=d.value.trim();if(!E&&b.length===0)return;let C=this.addReply(t,E,b.length>0?[...b]:[]),y=r.querySelector(`.${o.THREAD_REPLIES}`),_=j(C,this.strings,this.locale,{onDelete:s});y.appendChild(_),_.querySelectorAll(`.${o.SCREENSHOT_IMG}`).forEach(q=>{q.addEventListener("click",pt=>{pt.stopPropagation(),this.showLightbox(q.src)})});let A=r.querySelector(`.${o.THREAD_SCROLL}`);A&&(A.scrollTop=A.scrollHeight),d.value="",b=[],x(),d.focus()};g.addEventListener("click",S),d.addEventListener("keydown",E=>{E.key==="Enter"&&!E.shiftKey&&(E.preventDefault(),S())}),this.activeThreadPopover=r,typeof ResizeObserver<"u"&&(this._popoverResizeObserver=new ResizeObserver(()=>this._repositionThreadPopover()),this._popoverResizeObserver.observe(r)),setTimeout(()=>d.focus(),50),setTimeout(()=>{this._threadClickHandler=E=>{let C=E.composedPath()[0]||E.target;if(!r.contains(C)&&!e?.contains(C)&&!this._isInsideLightbox(C)){if(this._popoverEditorDirty())return;this.closeThreadPopover()}},document.addEventListener("mousedown",this._threadClickHandler)},0)}closeThreadPopover(){this.shadowRoot?.querySelectorAll(`.${o.CIRCLE_ACTIVE}`).forEach(e=>e.classList.remove(o.CIRCLE_ACTIVE)),this._popoverResizeObserver?.disconnect(),this._popoverResizeObserver=null,this._popoverEditing=null,this.activeThreadPopover&&(this.activeThreadPopover.remove(),this.activeThreadPopover=null),this._activePopoverCircle=null,this._threadClickHandler&&(document.removeEventListener("mousedown",this._threadClickHandler),this._threadClickHandler=null)}showLightbox(e){this.closeLightbox();let t=document.createElement("div");t.className=o.LIGHTBOX;let i=document.createElement("img");i.className=o.LIGHTBOX_IMG,i.src=e,i.alt=this.strings.screenshotPreview;let s=document.createElement("button");s.type="button",s.className=o.LIGHTBOX_CLOSE,s.setAttribute("aria-label",this.strings.close),s.innerHTML="×",s.addEventListener("click",()=>this.closeLightbox()),t.appendChild(i),t.appendChild(s),t.addEventListener("click",r=>{r.target===t&&this.closeLightbox()}),this.shadowRoot.appendChild(t),this._activeLightbox=t}closeLightbox(){this._activeLightbox?.remove(),this._activeLightbox=null}_isInsideLightbox(e){return!!e?.closest?.(`.${o.LIGHTBOX}`)}addReply(e,t,i=[]){e.replies||(e.replies=[]);let s={id:xe(),editedAt:null,text:t,author:this.options.user?.name||this.strings.anonymous,timestamp:new Date().toISOString(),screenshots:i};return e.replies.push(s),this._syncStorage(),this.options.onReplyAdded?.(this._serializeComment(e),this._serializeReply(s)),s}deleteReply(e,t){let i=this.comments.find(a=>a.id===e),s=i?.replies?.findIndex(a=>a.id===t)??-1;if(s<0)return!1;let[r]=i.replies.splice(s,1);return this._syncStorage(),this.options.onReplyDeleted?.(this._serializeComment(i),this._serializeReply(r)),!0}editComment(e,t){let i=this.comments.find(r=>String(r.id)===String(e)),s=String(t??"").trim();return!i||!s||s===i.text?!1:(i.text=s,i.editedAt=new Date().toISOString(),this._syncStorage(),this.options.onCommentEdited?.(this._serializeComment(i)),!0)}editReply(e,t,i){let s=this.comments.find(l=>String(l.id)===String(e)),r=s?.replies?.find(l=>String(l.id)===String(t)),a=String(i??"").trim();return!r||!a||a===r.text?!1:(r.text=a,r.editedAt=new Date().toISOString(),this._syncStorage(),this.options.onReplyEdited?.(this._serializeComment(s),this._serializeReply(r)),!0)}_serializeReply({id:e,text:t,author:i,timestamp:s,screenshots:r,editedAt:a}){return{id:e,text:t,author:i,timestamp:s,screenshots:r||[],editedAt:a||null}}_serializeComment(e){return{id:e.id,text:e.text,editedAt:e.editedAt||null,anchor:e.anchor||null,page:e.page||location.pathname,replies:(e.replies||[]).map(t=>this._serializeReply(t)),author:e.author,createdAt:e.createdAt,screenshots:e.screenshots||[],status:e.status||"open",type:e.type||null,priority:e.priority||null,tags:e.tags?[...e.tags]:[],resolvedAt:e.resolvedAt||null,context:e.context?{...e.context}:null,contextScreenshot:e.contextScreenshot||null}}setCommentStatus(e,t){if(!L.includes(t))return!1;let i=this.comments.find(r=>r.id===e);if(!i)return!1;if(i.status===t)return!0;i.status=t,i.resolvedAt=t==="resolved"?new Date().toISOString():null;let s=this.shadowRoot?.querySelector(`[data-comment-id="${e}"]`);return s&&this.updateCommentPosition(i,s),this._syncStorage(),this.inboxView?.isOpen()&&this.inboxView.refresh(),this.options.onCommentStatusChanged?.(this._serializeComment(i)),!0}_commitUpdate(e){return this._syncStorage(),this.inboxView?.isOpen()&&this.inboxView.refresh(),this.options.onCommentUpdated?.(this._serializeComment(e)),!0}setCommentType(e,t){if(t!==null&&!R.includes(t))return!1;let i=this.comments.find(s=>s.id===e);return i?(i.type=t,this._commitUpdate(i)):!1}setCommentPriority(e,t){if(t!==null&&!I.includes(t))return!1;let i=this.comments.find(s=>s.id===e);return i?(i.priority=t,this._commitUpdate(i)):!1}setCommentTags(e,t){if(!Array.isArray(t))return!1;let i=this.comments.find(s=>s.id===e);return i?(i.tags=ro(t),this._commitUpdate(i)):!1}serializeComments(){return this.comments.map(e=>this._serializeComment(e))}deleteComment(e){return this.comments.some(t=>t.id===e)?(this._removeComment(e),this.options.persistence==="localStorage"&&Ce(Te(te().filter(t=>t.id!==e),this.serializeComments(),location.pathname)),this.options.onCommentDeleted?.(e),!0):!1}_removeComment(e){if(this.cleanupResizeObserver(e),this.mutationObservers.has(e)){try{this.mutationObservers.get(e).disconnect()}catch{}this.mutationObservers.delete(e)}this.shadowRoot.querySelector(`[data-comment-id="${e}"]`)?.remove(),this.comments=this.comments.filter(t=>t.id!==e)}loadComments(e){let t=0,i=0,s=0;if(!Array.isArray(e))return{anchored:t,orphaned:i,inactive:s};for(let r of e){if(!r||r.id==null||typeof r.text!="string"){console.warn("HellDots: skipping malformed serialized comment",r);continue}this._removeComment(r.id);let a={id:r.id,text:r.text,editedAt:r.editedAt||null,anchor:r.anchor||null,anchorState:"orphaned",target:null,hidden:!1,page:r.page||location.pathname,container:null,relativeX:0,relativeY:0,replies:Array.isArray(r.replies)?[...r.replies]:[],author:r.author||this.strings.anonymous,createdAt:r.createdAt||new Date().toISOString(),screenshots:Array.isArray(r.screenshots)?[...r.screenshots]:[],status:r.status==="closed"?"resolved":L.includes(r.status)?r.status:"open",type:R.includes(r.type)?r.type:null,priority:I.includes(r.priority)?r.priority:null,tags:Array.isArray(r.tags)?[...r.tags]:[],resolvedAt:r.resolvedAt||null,context:r.context||null,contextScreenshot:r.contextScreenshot||null};if(r.page&&r.page!==location.pathname){a.anchorState="inactive",this.comments.push(a),s++;continue}let l=r.anchor?je(r.anchor):null;l?(a.container=l.element,a.relativeX=r.anchor.relativeX,a.relativeY=r.anchor.relativeY,a.anchorState="anchored",this.comments.push(a),this.renderCommentCircle(a),t++):(this.comments.push(a),i++,this.options.onAnchorLost?.(this._serializeComment(a)))}return this._openPendingDetail(),{anchored:t,orphaned:i,inactive:s}}centerPopover(e){let t=e.getBoundingClientRect(),i=Math.max(10,(window.innerWidth-(t.width||400))/2),s=Math.max(10,(window.innerHeight-t.height)/2);e.style.left=`${i}px`,e.style.bottom="auto",e.style.top=`${s}px`}scrollMarkerIntoView(e){let t=this._markerViewportY(e);t!=null&&window.scrollTo({top:Math.max(0,window.scrollY+t-window.innerHeight/2)})}_markerViewportY(e){let t=e.container;if(!t?.isConnected)return null;let i=t.getBoundingClientRect();if(i.height<=0)return null;let s=28,r=Math.max(0,Math.min(e.relativeY*i.height,i.height-s));return i.top+r+s/2}_repositionThreadPopover(){let e=this.activeThreadPopover;!e||e.style.display==="none"||(this._activePopoverCircle?this.positionPopoverAtCircle(e,this._activePopoverCircle):this.centerPopover(e))}syncThreadPopoverToMarker(){let e=this.activeThreadPopover,t=this._activePopoverCircle;if(!e||!t)return;let i=t.getBoundingClientRect();if(!(t.isConnected&&t.style.display!=="none"&&i.bottom>0&&i.right>0&&i.top<window.innerHeight&&i.left<window.innerWidth)){e.style.display="none";return}e.style.display="",this.positionPopoverAtCircle(e,t)}positionPopoverAtCircle(e,t){let i=t.getBoundingClientRect(),s=i.left+i.width/2,r=i.top+i.height/2,a=28,l=a/2+10,c=e.getBoundingClientRect(),p=c.width||400,h=s+l;h+p>window.innerWidth&&(h=s-l-p),h=Math.min(h,window.innerWidth-p-10),h=Math.max(10,h),e.style.left=`${h}px`;let d=10,g=r-a/2,m=window.innerHeight-d-g;c.height>m?(e.style.top="auto",e.style.bottom=`${d}px`):(e.style.bottom="auto",e.style.top=`${Math.max(d,g)}px`)}createPreviewCircle(e,t){this.removePreviewCircle();let i=document.createElement("div");i.className=`${o.CIRCLE} ${o.PREVIEW_CIRCLE}`,i.style.position="absolute";let s=14;i.style.left=`${e+s}px`,i.style.top=`${t+s}px`,i.style.transform="translate(-50%, -50%)",i.style.pointerEvents="none",this.overlay.appendChild(i),this.previewCircle=i}removePreviewCircle(){this.previewCircle?.remove(),this.previewCircle=null}cleanupResizeObserver(e){if(this.resizeObservers&&this.resizeObservers.has(e)){let{circle:t,observer:i}=this.resizeObservers.get(e);i&&i.disconnect(),t&&t.parentNode&&t.parentNode.removeChild(t),this.resizeObservers.delete(e)}}validateAndCalculatePosition(e,t){if(!e.container||!t)return null;let i=e.container.getBoundingClientRect(),s=i.width,r=i.height;if(s<=0||r<=0)return null;let a=e.relativeX*s,l=e.relativeY*r,c=28,p=Math.max(0,Math.min(a,s-c)),h=Math.max(0,Math.min(l,r-c)),d=p/s,g=h/r;return{absoluteX:p,absoluteY:h,relativeX:d,relativeY:g,containerWidth:s,containerHeight:r,containerLeft:i.left,containerTop:i.top}}_isAnchorTargetVisible(e){let t=e.target;if((!t||!t.isConnected)&&e.anchor?.targetSelector){try{t=document.querySelector(e.anchor.targetSelector)}catch{t=null}e.target=t||null}if(!t||!t.isConnected)return!0;let i=t.getBoundingClientRect();return i.width>0&&i.height>0}_isMarkerOccluded(e,t,i){if(typeof document.elementsFromPoint!="function"||t<0||i<0||t>=window.innerWidth||i>=window.innerHeight)return!1;let r=document.elementsFromPoint(t,i).find(c=>c.tagName.toLowerCase()!==w.toLowerCase());if(!r)return!1;let a=e.target?.isConnected?e.target:null;if(a&&(a.contains(r)||r.contains(a)))return!1;let l=e.container;if(!l?.isConnected)return!1;if(!l.contains(r)&&!r.contains(l))return!0;if(l.contains(r)&&r!==l){for(let c=r;c&&c!==l;c=c.parentElement)if(this._looksLikeModalLayer(c,a))return!0}return!1}_looksLikeModalLayer(e,t){if(t&&e.contains(t))return!1;if(e.matches?.('dialog, [aria-modal="true"], [role="dialog"]'))return!0;if(getComputedStyle(e).position!=="fixed")return!1;let i=e.getBoundingClientRect();return i.width>=window.innerWidth*.5&&i.height>=window.innerHeight*.5}_dismissMarkerUi(e){this.shadowRoot.querySelector(`.${o.TOOLTIP}[data-for="${e.id}"]`)?.remove(),this.activeThreadPopover?.dataset.for===String(e.id)&&this.closeThreadPopover()}updateCommentPosition(e,t){if(e.status==="resolved"){t&&(t.style.display="none");return}let i=this.validateAndCalculatePosition(e,t);i&&!this._isAnchorTargetVisible(e)&&(i=null);let s=e.hidden===!0;if(!i){t&&e.container&&(e.hidden=!0,t.style.display="none",this._dismissMarkerUi(e),!s&&this.inboxView?.isOpen()&&this.inboxView.refresh());return}let r=14,a=i.containerLeft+i.absoluteX+r,l=i.containerTop+i.absoluteY+r;if(this._isMarkerOccluded(e,a,l)){e.hidden=!0,t.style.display="none",this._dismissMarkerUi(e),!s&&this.inboxView?.isOpen()&&this.inboxView.refresh();return}e.hidden=!1,t.style.display="",s&&this.inboxView?.isOpen()&&this.inboxView.refresh(),t.style.left=`${a}px`,t.style.top=`${l}px`,t.style.transform="translate(-50%, -50%)",t.style.position="absolute",e.relativeX=i.relativeX,e.relativeY=i.relativeY}setupResizeHandlers(){this.scheduleUpdatePositions=()=>{this._pendingRaf||(this._pendingRaf=requestAnimationFrame(()=>{this._pendingRaf=null,this.positionValidationEnabled&&this.comments.forEach(e=>{let t=this.shadowRoot.querySelector(`[data-comment-id="${e.id}"]`);t&&this.updateCommentPosition(e,t)}),this.syncThreadPopoverToMarker()}))},this.windowResizeHandler=()=>{this.scheduleUpdatePositions()},window.addEventListener("resize",this.windowResizeHandler,{passive:!0}),this.scrollHandler=()=>{this.scheduleUpdatePositions()},window.addEventListener("scroll",this.scrollHandler,{capture:!0,passive:!0}),this.loadHandler=()=>{this.scheduleUpdatePositions()},window.addEventListener("load",this.loadHandler),window.MutationObserver&&(this._globalMutationObserver=new MutationObserver(()=>{this.scheduleUpdatePositions()}),this._globalMutationObserver.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style","class","hidden","open"]}))}debugPosition(e,t){if(!e||!t)return;let i=e.container.getBoundingClientRect(),s=t.getBoundingClientRect(),r=e.relativeX*i.width,a=e.relativeY*i.height;console.log("Position Debug:",{commentId:e.id,relativePosition:{x:e.relativeX,y:e.relativeY},containerRect:{left:i.left,top:i.top,width:i.width,height:i.height},circlePosition:{left:s.left,top:s.top,centerX:s.left+s.width/2,centerY:s.top+s.height/2},expectedPosition:{x:r,y:a},offset:{x:s.left+s.width/2-(i.left+r),y:s.top+s.height/2-(i.top+a)}})}createResizeObserver(e,t){if(!window.ResizeObserver){console.warn("ResizeObserver not supported, position validation will be limited");return}let i=new ResizeObserver(s=>{if(this.positionValidationEnabled)for(let r of s)r.target===e.container&&this.updateCommentPosition(e,t)});i.observe(e.container),this.resizeObservers.set(e.id,{circle:t,observer:i,container:e.container})}createMutationObserver(e){if(!window.MutationObserver)return;if(this.mutationObservers.has(e.id)){try{this.mutationObservers.get(e.id).disconnect()}catch{}this.mutationObservers.delete(e.id)}let t=new MutationObserver(()=>{this.scheduleUpdatePositions()});t.observe(e.container,{attributes:!0,attributeFilter:void 0,childList:!0,subtree:!0}),this.mutationObservers.set(e.id,t)}cleanup(){ie(),tt(),this.closeThreadPopover(),this.closeInbox(),this.closeLightbox(),this.removePreviewCircle(),this._selectionRect?.remove(),this._pendingScreenshots=[],this._handleDocumentClickBound&&document.removeEventListener("mousedown",this._handleDocumentClickBound),this.windowResizeHandler&&window.removeEventListener("resize",this.windowResizeHandler),this.scrollHandler&&window.removeEventListener("scroll",this.scrollHandler,{capture:!0}),this.loadHandler&&window.removeEventListener("load",this.loadHandler),this._globalMutationObserver&&(this._globalMutationObserver.disconnect(),this._globalMutationObserver=null),this.resizeObservers&&(this.resizeObservers.forEach(({observer:e})=>{e&&e.disconnect()}),this.resizeObservers.clear()),this.mutationObservers&&(this.mutationObservers.forEach(e=>{try{e.disconnect()}catch{}}),this.mutationObservers.clear()),this.keydownHandler&&document.removeEventListener("keydown",this.keydownHandler),this.toolbar&&this.toolbar.parentNode&&this.toolbar.parentNode.removeChild(this.toolbar),this.commentBox&&this.commentBox.parentNode&&this.commentBox.parentNode.removeChild(this.commentBox),this.overlay&&this.overlay.parentNode&&this.overlay.parentNode.removeChild(this.overlay),document.body.classList.remove(o.COMMENT_CURSOR),document.getElementById(T.GLOBAL_STYLES)?.remove(),this.comments.forEach(e=>{let t=this.shadowRoot.querySelector(`[data-comment-id="${e.id}"]`);t&&t.parentNode&&t.parentNode.removeChild(t)})}injectStyles(){let e=this.shadowRoot.getElementById(T.STYLES);e&&e.remove();let t=document.createElement("style");t.id=T.STYLES,t.textContent=$e(),this.shadowRoot.appendChild(t);let i=document.getElementById(T.GLOBAL_STYLES);i&&i.remove();let s=document.createElement("style");s.id=T.GLOBAL_STYLES,s.textContent=ke(),document.head.appendChild(s)}},dt=Ae;function so(n={}){let{autoInit:e=!0,...t}=n,i=()=>new dt(t);return e?i():i}var Si=so;export{dt as CommentOverlay,so as createCommentOverlay,Si as default};
|
|
7
|
+
`,t},J=(o,e)=>{let t=document.createElement("div");return t.className=i.SCREENSHOTS_CONTAINER,t.classList.add(i.ACTIVE),o.forEach(n=>{let s=document.createElement("div");s.className=i.SCREENSHOT_ITEM;let r=document.createElement("img");r.className=i.SCREENSHOT_IMG,r.src=n,r.alt=e.attachedScreenshot,s.appendChild(r),t.appendChild(s)}),t},Lt=(o,e=L,t)=>{let n=document.createElement("div");n.className=i.TOOLTIP,n.dataset.for=o.id,n.setAttribute("role","dialog"),n.setAttribute("aria-label",e.tooltipAriaLabel);let s=document.createElement("div");s.className=i.THREAD_HEADER;let r=Q(o.author,o.createdAt,e,t,o.editedAt),a=document.createElement("button");a.type="button",a.className=i.CLOSE_TOOLTIP,a.setAttribute("aria-label",e.close),a.innerHTML="×",s.appendChild(r),s.appendChild(a);let l=document.createElement("div");l.className=i.THREAD_BODY,l.textContent=o.text,n.appendChild(s),n.appendChild(l);let c=Ue(o,e,{includeStatus:!0});c&&n.appendChild(c);let d=Ve(o);d.length>0&&n.appendChild(J(d,e));let p=o.replies?.length||0;if(p>0){let h=document.createElement("div");h.className=i.TOOLTIP_REPLY_COUNT,h.textContent=p===1?e.replyCountOne:v(e.replyCountTemplate,p),n.appendChild(h)}return n},ee=(o,e=L,t,{onDelete:n,onEdit:s,editing:r=null}={})=>{let a=document.createElement("div");a.className=i.THREAD_REPLY,a.dataset.replyId=String(o.id);let l=Q(o.author,o.timestamp,e,t,o.editedAt),c=[];if(s&&c.push({label:e.editReply,onSelect:()=>s(o)}),n&&c.push({label:e.deleteReply,onSelect:()=>n(o,a),confirm:()=>({title:e.confirmDeleteReplyTitle,message:e.confirmDeleteReplyMessage,confirmLabel:e.confirmDelete,cancelLabel:e.confirmCancel})}),c.length>0){let h=$e({label:e.replyOptions,items:c});h.classList.add(i.THREAD_REPLY_ACTIONS),l.appendChild(h)}let d;r?d=z({value:r.draft,strings:e,onInput:r.onInput,onSave:r.onSave,onCancel:r.onCancel}):(d=document.createElement("div"),d.className=i.THREAD_BODY,d.textContent=o.text),a.appendChild(l),a.appendChild(d);let p=Ve(o);return p.length>0&&a.appendChild(J(p,e)),a},Bt=(o,e=L,t,{onDeleteReply:n,onEditReply:s}={})=>{let r=document.createElement("div");r.className=i.THREAD_POPOVER,r.dataset.for=o.id,r.setAttribute("role","dialog"),r.setAttribute("aria-label",e.popoverAriaLabel);let a=document.createElement("div");a.className=i.THREAD_HEADER;let l=Q(o.author,o.createdAt,e,t,o.editedAt),c=document.createElement("button");c.type="button",c.className=i.CLOSE_TOOLTIP,c.setAttribute("aria-label",e.close),c.innerHTML="×",a.appendChild(l),a.appendChild(c);let d=document.createElement("div");d.className=i.THREAD_BODY,d.textContent=o.text;let p=document.createElement("div");p.className=i.THREAD_REPLIES,o.replies&&o.replies.forEach(g=>{p.appendChild(ee(g,e,t,{onDelete:n,onEdit:s}))});let{container:h}=be({areaClassName:i.THREAD_INPUT_AREA,inputTag:"input",inputClassName:i.THREAD_INPUT,inputPlaceholder:e.replyPlaceholder},e),m=document.createElement("div");m.className=i.THREAD_SCROLL,r.appendChild(a),m.appendChild(d);let u=Ve(o);return u.length>0&&m.appendChild(J(u,e)),m.appendChild(p),r.appendChild(m),r.appendChild(h),r};var Ce=(o,{strings:e,onShowLightbox:t,collapsible:n=!1,expanded:s=!1,onToggle:r})=>{let{context:a,contextScreenshot:l}=o;if(!a&&!l)return null;let c=document.createElement("div");c.className=i.CONTEXT_BLOCK;let d=document.createElement("div");if(d.className=i.CONTEXT_BODY,n){let p=document.createElement("button");p.type="button",p.className=i.CONTEXT_TOGGLE,p.setAttribute("aria-expanded",String(s)),p.innerHTML=`<span>${e.contextSection}</span>${_e}`,d.style.display=s?"":"none",p.addEventListener("click",h=>{h.stopPropagation();let m=p.getAttribute("aria-expanded")==="true";p.setAttribute("aria-expanded",String(!m)),d.style.display=m?"none":"",r?.(!m)}),c.appendChild(p)}else{let p=document.createElement("div");p.className=i.CONTEXT_TITLE,p.textContent=e.contextSection,c.appendChild(p)}if(l){let p=document.createElement("div");p.className=i.CONTEXT_SCREENSHOT_CAPTION,p.textContent=e.autoScreenshotLabel,d.appendChild(p);let h=document.createElement("img");h.className=i.SCREENSHOT_IMG,h.src=l,h.alt=e.autoScreenshotLabel,d.appendChild(h),R(d,t)}if(a){let p=(u,g)=>{if(!g)return;let E=document.createElement("div");E.className=i.CONTEXT_ROW;let _=document.createElement("span");_.textContent=u;let C=document.createElement("span");C.textContent=g,E.appendChild(_),E.appendChild(C),d.appendChild(E)},h=u=>u?`${u.width}\xD7${u.height}`:"",m=u=>u?.name?`${u.name} ${u.version||""}`.trim():"";p(e.contextUrl,a.url),p(e.contextViewport,h(a.viewport)),p(e.contextScreen,h(a.screen)),p(e.contextBrowser,m(a.browser)),p(e.contextOs,m(a.os))}return c.appendChild(d),c};var wi=o=>{let e=[...o.attributes].map(({name:t,value:n})=>`${t}="${n}"`).join(" ");return`<${o.tagName.toLowerCase()}${e?` ${e}`:""}>`},Li=o=>{if(!o?.tagName)return"(unknown)";let e=Object.entries(o.attributes||{}).map(([t,n])=>`${t}="${n}"`).join(" ");return`<${o.tagName.toLowerCase()}${e?` ${e}`:""}>`},Bi=o=>{let e=[],t=o;for(;t&&t!==document.documentElement;){let n=t.tagName.toLowerCase(),s=t.id?`#${t.id}`:"",r=[...t.classList].slice(0,2).map(a=>`.${a}`).join("");if(e.unshift(`${n}${s}${r}`),t===document.body)break;t=t.parentElement}return e.join(" > ")};function Te(o,{viewportWidth:e,viewportHeight:t,strings:n}){let s=o.anchor,r=s?.fingerprint,a=o.container?.isConnected?o.container:null,l=o.hidden?"hidden":o.anchorState,c=a?wi(a):Li(r),d=a?Bi(a):"(unavailable)",p=o.context?.viewport,h=p?.width??e,m=p?.height??t,u=[`Page: ${o.page}`,`Viewport: ${h}x${m}`,`Anchor state: ${l}`,`Status: ${o.status||"open"}`,`Selector: ${s?.selector||"(none)"}`,`Element: ${c}`,`DOM path: ${d}`,`Nearby text: "${r?.textSnippet??""}"`,`Comment by ${o.author} (${o.createdAt}):`,`"${o.text}"`];o.type&&u.push(`Type: ${o.type}`),o.priority&&u.push(`Priority: ${o.priority}`),o.tags?.length&&u.push(`Tags: ${o.tags.join(", ")}`);let g=o.context;if(g&&(g.url&&u.push(`URL: ${g.url}`),g.screen&&u.push(`Screen: ${g.screen.width}x${g.screen.height}`),g.browser?.name&&u.push(`Browser: ${`${g.browser.name} ${g.browser.version||""}`.trim()}`),g.os?.name&&u.push(`OS: ${`${g.os.name} ${g.os.version||""}`.trim()}`)),n&&o.status==="resolved"&&o.resolvedAt){let _=le(new Date(o.resolvedAt).getTime()-new Date(o.createdAt).getTime(),n);_&&u.push(`Resolution time: ${_}`)}let E=o.replies||[];if(E.length>0){u.push(`Replies (${E.length}):`);for(let _ of E)u.push(`- ${_.author}: "${_.text}"`)}return u.join(`
|
|
8
|
+
`)}var te=(o,e)=>{let t=e.getBoundingClientRect(),n=t.left+t.width/2,s=t.top+t.height/2,r=A,a=r/2+10,l=o.getBoundingClientRect(),c=l.width||400,d=n+a;d+c>window.innerWidth&&(d=n-a-c),d=Math.min(d,window.innerWidth-c-10),d=Math.max(10,d),o.style.left=`${d}px`;let p=10,h=s-r/2,m=window.innerHeight-p-h;l.height>m?(o.style.top="auto",o.style.bottom=`${p}px`):(o.style.bottom="auto",o.style.top=`${Math.max(p,h)}px`)},Mt=o=>{let e=o.getBoundingClientRect(),t=Math.max(10,(window.innerWidth-(e.width||400))/2),n=Math.max(10,(window.innerHeight-e.height)/2);o.style.left=`${t}px`,o.style.bottom="auto",o.style.top=`${n}px`},xe=class{constructor(e){this.deps=e,this.active=null,this._activeCircle=null,this.editing=null,this._resizeObserver=null,this._clickHandler=null,this._armClickTimer=null}_bodyEl(e=null){let t=this.active;return t?e==null?t.querySelector(`.${i.THREAD_SCROLL} > .${i.THREAD_BODY}, .${i.THREAD_SCROLL} > .${i.EDITOR}`):t.querySelector(`.${i.THREAD_REPLY}[data-reply-id="${P(e)}"]`)?.querySelector(`.${i.THREAD_BODY}, .${i.EDITOR}`)||null:null}refreshCommentViews(e,t=null){if(this.active?.dataset.for!==String(e))return;let n=this.deps.findComment(e);if(!n)return;let s=t==null?n:(n.replies||[]).find(l=>O(l.id,t));if(!s)return;let r=document.createElement("div");r.className=i.THREAD_BODY,r.textContent=s.text,this._bodyEl(t)?.replaceWith(r);let a=t==null?this.active.querySelector(`.${i.THREAD_META}`):this.active.querySelector(`.${i.THREAD_REPLY}[data-reply-id="${P(t)}"]`)?.querySelector(`.${i.THREAD_META}`);if(a&&s.editedAt&&!a.querySelector(`.${i.THREAD_EDITED}`)){let l=He(s.editedAt,this.deps.strings,this.deps.locale),c=a.querySelector(`.${i.THREAD_REPLY_ACTIONS}`);c?a.insertBefore(l,c):a.appendChild(l)}}isEditing(){return this.editing!=null}editorDirty(){if(!this.editing)return!1;let{commentId:e,replyId:t,draft:n}=this.editing,s=this.deps.findComment(e),r=t==null?s:(s?.replies||[]).find(a=>O(a.id,t));return n.trim()!==String(r?.text||"").trim()}async releaseEditor(){if(!this.editing)return!0;if(this.editorDirty()){let t=this.deps.shadowRoot;if(!await Ee(t,this.deps.strings))return!1}let{replyId:e}=this.editing;return this.editing=null,this._restoreBody(e),!0}_restoreBody(e){let t=this.deps.findComment(this.active?.dataset.for);if(!t)return;let n=e==null?t:(t.replies||[]).find(r=>O(r.id,e));if(!n)return;let s=document.createElement("div");s.className=i.THREAD_BODY,s.textContent=n.text,this._bodyEl(e)?.replaceWith(s)}async startEditing(e,t=null){if(!await this.releaseEditor())return;let n=this.deps.findComment(e),s=t==null?n:(n?.replies||[]).find(a=>O(a.id,t));if(!s)return;this.editing={commentId:e,replyId:t,draft:s.text};let r=z({value:s.text,strings:this.deps.strings,onInput:a=>{this.editing.draft=a},onSave:a=>{let l=t==null?this.deps.actions.editComment(e,a):this.deps.actions.editReply(e,t,a);this.editing=null,l?(this.refreshCommentViews(e,t),this.deps.refreshInbox()):this._restoreBody(t)},onCancel:()=>{this.releaseEditor()}});this._bodyEl(t)?.replaceWith(r)}show(e,t){this.close();let{strings:n,locale:s}=this.deps;this.deps.removeTooltip(t.id),e?.classList.add(i.CIRCLE_ACTIVE),this._activeCircle=e||null;let r=(f,x)=>{this.deps.actions.deleteReply(t.id,f.id)&&(x.remove(),this.deps.refreshInbox())},a=f=>this.startEditing(t.id,f.id),l=Bt(t,n,s,{onDeleteReply:r,onEditReply:a});this.deps.shadowRoot.appendChild(l);let c=l.querySelector(`.${i.THREAD_HEADER}`),d=fe(t,{strings:n,onCopy:f=>U(Te(f,{viewportWidth:window.innerWidth,viewportHeight:window.innerHeight,strings:n})),onCopyLink:f=>U($(f,this.deps.linkParam())),onEdit:f=>this.startEditing(f.id),onSetStatus:(f,x)=>this.deps.actions.setStatus(f.id,x),onSetType:(f,x)=>this.deps.actions.setType(f.id,x),onSetPriority:(f,x)=>this.deps.actions.setPriority(f.id,x),onDelete:f=>{this.close(),this.deps.actions.deleteComment(f.id),this.deps.refreshInbox()}}),p=document.createElement("div");p.className=i.THREAD_ACTIONS_ROW,p.appendChild(d),c.insertAdjacentElement("afterend",p);let h=l.querySelector(`.${i.THREAD_SCROLL} > .${i.SCREENSHOTS_CONTAINER}`);h&&R(h,f=>this.deps.onShowLightbox(f));let m=Ce(t,{strings:n,onShowLightbox:f=>this.deps.onShowLightbox(f),collapsible:!0});m&&l.querySelector(`.${i.THREAD_REPLIES}`).before(m),setTimeout(()=>{e?te(l,e):Mt(l)},10),l.querySelector(`.${i.CLOSE_TOOLTIP}`).addEventListener("click",async f=>{f.stopPropagation(),!(this.editing&&!await this.releaseEditor())&&this.close()});let u=l.querySelector(`.${i.THREAD_INPUT}`),g=l.querySelector(`.${i.THREAD_SUBMIT}`),E=l.querySelector(`.${i.THREAD_INPUT_AREA} .${i.ATTACH_IMAGE_BTN}`),_=l.querySelector(`.${i.THREAD_INPUT_AREA} input[type="file"]`),C=l.querySelector(`.${i.THREAD_INPUT_AREA} .${i.SCREENSHOTS_CONTAINER}`),y=[],b=()=>{G(C,y,{strings:n,onShow:f=>this.deps.onShowLightbox(f),rerender:()=>b()})};E.addEventListener("click",()=>{_.click()}),Y(_,()=>y,b);let B=()=>{let f=u.value.trim();if(!f&&y.length===0)return;let x=this.deps.actions.addReply(t,f,y.length>0?[...y]:[]),Ye=l.querySelector(`.${i.THREAD_REPLIES}`),je=ee(x,n,s,{onDelete:r,onEdit:a});Ye.appendChild(je),R(je,$t=>this.deps.onShowLightbox($t));let Se=l.querySelector(`.${i.THREAD_SCROLL}`);Se&&(Se.scrollTop=Se.scrollHeight),u.value="",y=[],b(),u.focus()};g.addEventListener("click",B),u.addEventListener("keydown",f=>{f.key==="Enter"&&!f.shiftKey&&(f.preventDefault(),B())}),this.active=l,typeof ResizeObserver<"u"&&(this._resizeObserver=new ResizeObserver(()=>this.reposition()),this._resizeObserver.observe(l)),setTimeout(()=>u.focus(),50),this._armClickTimer=setTimeout(()=>{this._armClickTimer=null,this._clickHandler=f=>{let x=f.composedPath()[0]||f.target;if(!l.contains(x)&&!e?.contains(x)&&!this.deps.isInsideLightbox(x)){if(this.editorDirty())return;this.close()}},document.addEventListener("mousedown",this._clickHandler)},0)}close(){this.deps.shadowRoot?.querySelectorAll(`.${i.CIRCLE_ACTIVE}`).forEach(e=>e.classList.remove(i.CIRCLE_ACTIVE)),this._resizeObserver?.disconnect(),this._resizeObserver=null,this.editing=null,this.active&&(this.active.remove(),this.active=null),this._activeCircle=null,this._armClickTimer&&(clearTimeout(this._armClickTimer),this._armClickTimer=null),this._clickHandler&&(document.removeEventListener("mousedown",this._clickHandler),this._clickHandler=null)}reposition(){let e=this.active;!e||e.style.display==="none"||(this._activeCircle?te(e,this._activeCircle):Mt(e))}syncToMarker(){let e=this.active,t=this._activeCircle;if(!e||!t)return;let n=t.getBoundingClientRect();if(!(t.isConnected&&t.style.display!=="none"&&n.bottom>0&&n.right>0&&n.top<window.innerHeight&&n.left<window.innerWidth)){e.style.display="none";return}e.style.display="",te(e,t)}};var Dt=150,ze=(o,e)=>Math.max(0,Math.min(o,e)),Oe=class{constructor(e){this.deps=e,this.circles=new Map,this.resizeObservers=new Map,this.enabled=!0,this._lastOcclusionPass=0,this._occlusionTrailingTimer=null,this._pendingRaf=null,this._globalMutationObserver=null,this._resizeHandler=null,this._scrollHandler=null,this._loadHandler=null}start(){this._resizeHandler=()=>this.scheduleUpdate(),window.addEventListener("resize",this._resizeHandler,{passive:!0}),this._scrollHandler=()=>this.scheduleUpdate(),window.addEventListener("scroll",this._scrollHandler,{capture:!0,passive:!0}),this._loadHandler=()=>this.scheduleUpdate(),window.addEventListener("load",this._loadHandler),window.MutationObserver&&(this._globalMutationObserver=new MutationObserver(()=>{this.scheduleUpdate()}),this._globalMutationObserver.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style","class","hidden","open"]}))}render(e){let t=wt(e,this.deps.strings);this.deps.wireMarker(t,e),this.deps.container.appendChild(t),this.circles.set(String(e.id),t),this.updatePosition(e,t),this.createResizeObserver(e,t)}circleOf(e){return this.circles.get(String(e))??null}remove(e){this.cleanupResizeObserver(e),this.circles.get(String(e))?.remove(),this.circles.delete(String(e))}clear(){this.resizeObservers.forEach(({observer:e})=>e?.disconnect()),this.resizeObservers.clear(),this.circles.forEach(e=>e.remove()),this.circles.clear()}validateAndCalculatePosition(e,t){if(!e.container||!t)return null;let n=e.container.getBoundingClientRect(),s=n.width,r=n.height;if(s<=0||r<=0)return null;let a=e.relativeX*s,l=e.relativeY*r,c=ze(a,s),d=ze(l,r),p=c/s,h=d/r;return{absoluteX:c,absoluteY:d,relativeX:p,relativeY:h,containerWidth:s,containerHeight:r,containerLeft:n.left,containerTop:n.top}}_isAnchorTargetVisible(e){let t=e.target;if((!t||!t.isConnected)&&e.anchor?.targetSelector){try{t=document.querySelector(e.anchor.targetSelector)}catch{t=null}e.target=t||null}if(!t||!t.isConnected)return!0;let n=t.getBoundingClientRect();return n.width>0&&n.height>0}_isMarkerOccluded(e,t,n){if(typeof document.elementsFromPoint!="function"||t<0||n<0||t>=window.innerWidth||n>=window.innerHeight)return!1;let r=document.elementsFromPoint(t,n).find(c=>c.tagName.toLowerCase()!==I.toLowerCase());if(!r)return!1;let a=e.target?.isConnected?e.target:null;if(a&&(a.contains(r)||r.contains(a)))return!1;let l=e.container;if(!l?.isConnected)return!1;if(!l.contains(r)&&!r.contains(l))return!0;if(l.contains(r)&&r!==l){for(let c=r;c&&c!==l;c=c.parentElement)if(this._looksLikeModalLayer(c,a))return!0}return!1}_looksLikeModalLayer(e,t){if(t&&e.contains(t))return!1;if(e.matches?.('dialog, [aria-modal="true"], [role="dialog"]'))return!0;if(getComputedStyle(e).position!=="fixed")return!1;let n=e.getBoundingClientRect();return n.width>=window.innerWidth*.5&&n.height>=window.innerHeight*.5}_computeMarkerState(e,t,{checkOcclusion:n=!0}={}){if(e.status==="resolved")return{kind:"resolved"};let s=this.validateAndCalculatePosition(e,t);if(s&&!this._isAnchorTargetVisible(e)&&(s=null),!s)return e.container?{kind:"hidden"}:{kind:"noop"};let r=A/2,a=s.containerLeft+s.absoluteX+r,l=s.containerTop+s.absoluteY+r;return n&&(e._occluded=this._isMarkerOccluded(e,a,l)),e._occluded?{kind:"hidden"}:{kind:"visible",viewportX:a,viewportY:l,relativeX:s.relativeX,relativeY:s.relativeY}}_applyMarkerState(e,t,n){if(n.kind==="resolved")return t&&(t.style.display="none"),!1;if(n.kind==="noop")return!1;let s=e.hidden===!0;return n.kind==="hidden"?(e.hidden=!0,t.style.display="none",this.deps.onMarkerHidden(e),!s):(e.hidden=!1,t.style.display="",t.style.left=`${n.viewportX}px`,t.style.top=`${n.viewportY}px`,t.style.transform="translate(-50%, -50%)",t.style.position="absolute",e.relativeX=n.relativeX,e.relativeY=n.relativeY,s)}updatePosition(e,t=this.circles.get(String(e.id))){if(!t)return;let n=this._computeMarkerState(e,t);this._applyMarkerState(e,t,n)&&this.deps.onVisibilityFlip()}_updateAllPositions(){let e=Date.now(),t=e-this._lastOcclusionPass>=Dt;t?this._lastOcclusionPass=e:this._armOcclusionTrailingPass();let n=[];for(let r of this.deps.getComments()){let a=this.circles.get(String(r.id));a&&n.push([r,a,this._computeMarkerState(r,a,{checkOcclusion:t})])}let s=!1;for(let[r,a,l]of n)this._applyMarkerState(r,a,l)&&(s=!0);s&&this.deps.onVisibilityFlip()}_armOcclusionTrailingPass(){this._occlusionTrailingTimer&&clearTimeout(this._occlusionTrailingTimer),this._occlusionTrailingTimer=setTimeout(()=>{this._occlusionTrailingTimer=null,this.scheduleUpdate()},Dt)}scheduleUpdate(){this._pendingRaf||(this._pendingRaf=requestAnimationFrame(()=>{this._pendingRaf=null,this.enabled&&this._updateAllPositions(),this.deps.onAfterPass()}))}createResizeObserver(e,t){if(!window.ResizeObserver){console.warn("ResizeObserver not supported, position validation will be limited");return}let n=new ResizeObserver(s=>{if(this.enabled)for(let r of s)r.target===e.container&&this.updatePosition(e,t)});n.observe(e.container),this.resizeObservers.set(String(e.id),{circle:t,observer:n,container:e.container})}cleanupResizeObserver(e){let t=String(e);if(this.resizeObservers.has(t)){let{circle:n,observer:s}=this.resizeObservers.get(t);s&&s.disconnect(),n&&n.parentNode&&n.parentNode.removeChild(n),this.resizeObservers.delete(t)}}scrollMarkerIntoView(e){let t=this._markerViewportY(e);t!=null&&window.scrollTo({top:Math.max(0,window.scrollY+t-window.innerHeight/2)})}_markerViewportY(e){let t=e.container;if(!t?.isConnected)return null;let n=t.getBoundingClientRect();if(n.height<=0)return null;let s=ze(e.relativeY*n.height,n.height);return n.top+s+A/2}destroy(){this._pendingRaf&&(cancelAnimationFrame(this._pendingRaf),this._pendingRaf=null),this._occlusionTrailingTimer&&(clearTimeout(this._occlusionTrailingTimer),this._occlusionTrailingTimer=null),this._resizeHandler&&(window.removeEventListener("resize",this._resizeHandler),this._resizeHandler=null),this._scrollHandler&&(window.removeEventListener("scroll",this._scrollHandler,{capture:!0}),this._scrollHandler=null),this._loadHandler&&(window.removeEventListener("load",this._loadHandler),this._loadHandler=null),this._globalMutationObserver&&(this._globalMutationObserver.disconnect(),this._globalMutationObserver=null),this.clear()}};var Mi='<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="15 18 9 12 15 6"/></svg>',Di='<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="18 15 12 9 6 15"/></svg>',ki='<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"/></svg>',ye=class{constructor({shadowRoot:e,strings:t,locale:n,currentPage:s,getComments:r,callbacks:a,options:l={}}){this.shadowRoot=e,this.strings=t,this.locale=n,this.currentPage=s,this.getComments=r,this.callbacks=a,this.options=l,this.pageFilter="page",this.statusFilter="all",this.typeFilter="all",this.priorityFilter="all",this.detailId=null,this.contextExpanded=!0,this.editing=null,this.notice=null,this._cardBindings=new Map,this.el=null,this._highlightedEl=null,this._activeMarkerEl=null}isOpen(){return!!this.el}open(){this.el||(this.el=document.createElement("div"),this.el.className=i.INBOX_PANEL,this.el.setAttribute("role","dialog"),this.el.setAttribute("aria-label",this.strings.inboxAriaLabel),this.el.setAttribute("tabindex","-1"),this.shadowRoot.appendChild(this.el),this.render(),this.el.focus())}close(){this._clearHighlight(),this._setActiveMarker(null),this.el?.remove(),this.el=null,this._cardBindings.clear(),this.detailId=null,this.editing=null,this.notice=null}refresh(){this.el&&this.render()}_resetFilters(){this.pageFilter="page",this.statusFilter="all",this.typeFilter="all",this.priorityFilter="all",this.render()}showNotice(e){this.notice=e,this.refresh()}clearNotice(){this.notice&&(this.notice=null,this.refresh())}isDirty(){return this.editing?this.editing.draft.trim()!==this._editingOriginalText().trim():!1}_editingOriginalText(){if(!this.editing)return"";let e=this.getComments().find(n=>O(n.id,this.editing.commentId));return e?this.editing.replyId==null?e.text||"":(e.replies||[]).find(n=>O(n.id,this.editing.replyId))?.text||"":""}async releaseEditor(){if(!this.editing)return!0;if(this.isDirty()){let e=this.el||this.shadowRoot;if(!await Ee(e,this.strings))return!1}return this.editing=null,!0}_editorHandlers(){return{draft:this.editing.draft,onInput:e=>{this.editing.draft=e},onSave:e=>{let{commentId:t,replyId:n}=this.editing;n==null?this.callbacks.onEditComment(t,e):this.callbacks.onEditReply(t,n,e),this.editing=null,this.render()},onCancel:async()=>{await this.releaseEditor()&&this.render()}}}_buildEditor(){let e=this._editorHandlers();return z({value:e.draft,strings:this.strings,onInput:e.onInput,onSave:e.onSave,onCancel:e.onCancel})}async startEditing(e,t=null){await this.releaseEditor()&&(this.detailId=e,this.editing={commentId:e,replyId:t,draft:""},this.editing.draft=this._editingOriginalText(),this.render())}_markerFor(e){return e.anchorState!=="anchored"||e.hidden||e.status==="resolved"?null:this.shadowRoot.querySelector(Rt(e.id))}_highlight(e){this._clearHighlight();let t=this._markerFor(e);t&&(t.classList.add(i.HIGHLIGHT),this._highlightedEl=t)}_clearHighlight(){this._highlightedEl?.classList.remove(i.HIGHLIGHT),this._highlightedEl=null}_setActiveMarker(e){if(this._activeMarkerEl?.classList.remove(i.CIRCLE_ACTIVE),this._activeMarkerEl=null,!e)return;let t=this._markerFor(e);t&&(t.classList.add(i.CIRCLE_ACTIVE),this._activeMarkerEl=t)}filteredComments(){let e=this.getComments();return this.pageFilter==="page"&&(e=e.filter(t=>t.page===this.currentPage)),this.statusFilter!=="all"&&(e=e.filter(t=>(t.status||"open")===this.statusFilter)),this.typeFilter!=="all"&&(e=e.filter(t=>t.type===this.typeFilter)),this.priorityFilter!=="all"&&(e=e.filter(t=>t.priority===this.priorityFilter)),[...e.filter(t=>t.status!=="resolved"),...e.filter(t=>t.status==="resolved")]}render(){if(!this.el)return;this._clearHighlight();let e=this.filteredComments(),t=this.detailId!=null?e.find(n=>O(n.id,this.detailId)):null;this._setActiveMarker(t),t?(this._cardBindings.clear(),this.el.innerHTML="",this._renderDetail(t,e)):(this.detailId=null,this._renderList(e))}openDetail(e){this.el||this.open();let t=this.getComments().find(n=>O(n.id,e));t&&this._openDetail(t)}_openDetail(e){this.detailId=e.id,e.anchorState==="anchored"&&!e.hidden&&this.callbacks.onOpenDetailScroll(e),this.render()}_closeButton(){let e=document.createElement("button");return e.type="button",e.className=i.INBOX_CLOSE,e.setAttribute("aria-label",this.strings.close),e.innerHTML="×",e.addEventListener("click",async()=>{this.editing&&!await this.releaseEditor()||this.callbacks.onClose()}),e}_renderList(e){let t=[...this.el.children].find(s=>s.classList.contains(i.INBOX_LIST));if(!t){this.el.innerHTML="",this._cardBindings.clear();let s=document.createElement("div");s.className=i.INBOX_HEADER,this.el.appendChild(s),t=document.createElement("div"),t.className=i.INBOX_LIST,this.el.appendChild(t)}[...this.el.children].find(s=>s.classList.contains(i.INBOX_HEADER)).replaceChildren(this._buildFilter(),this._closeButton()),this._reconcileCards(t,e)}_cardFingerprint(e){return JSON.stringify([e.text,e.editedAt??null,e.status??"open",e.type??null,e.priority??null,e.tags??[],e.resolvedAt??null,e.anchorState,e.hidden===!0,e.page,e.screenshots?.length??0])}_reconcileCards(e,t){for(let r of[...e.children])(r.classList.contains(i.INBOX_NOTICE)||r.classList.contains(i.INBOX_EMPTY))&&r.remove();let n=[];if(this.notice){let r=document.createElement("div");r.className=i.INBOX_NOTICE,r.setAttribute("role","status"),r.textContent=this.notice,n.push(r)}let s=new Set;if(t.length===0)n.push(this._buildEmptyState());else for(let r of t){let a=String(r.id),l=this._cardFingerprint(r),c=this._cardBindings.get(a),d;c&&c.comment===r&&c.fingerprint===l?d=c.card:(d=this._buildCard(r,{interactive:!0}),this._cardBindings.set(a,{comment:r,fingerprint:l,card:d})),s.add(a),n.push(d)}for(let r of[...this._cardBindings.keys()])s.has(r)||this._cardBindings.delete(r);for(n.forEach((r,a)=>{e.children[a]!==r&&e.insertBefore(r,e.children[a]??null)});e.children.length>n.length;)e.lastElementChild.remove()}_buildEmptyState(){let e=document.createElement("div");e.className=i.INBOX_EMPTY;let t=document.createElement("div");t.className=i.INBOX_EMPTY_ICON,t.setAttribute("aria-hidden","true"),e.appendChild(t);let n=this.getComments().length>0,s=document.createElement("div");if(s.className=i.INBOX_EMPTY_TITLE,s.textContent=n?this.strings.inboxNoMatches:this.strings.inboxEmptyTitle,e.appendChild(s),n){let p=document.createElement("button");return p.type="button",p.className=i.INBOX_EMPTY_ACTION,p.textContent=this.strings.filterClear,p.addEventListener("click",()=>{this._resetFilters()}),e.appendChild(p),e}let r=document.createElement("div");r.className=i.INBOX_EMPTY_TEXT;let[a,l]=String(this.strings.inboxEmptyHintTemplate).split("{n}"),c=document.createElement("kbd");c.className=i.INBOX_EMPTY_KBD,c.textContent=Fe(this.options,this.strings),r.appendChild(document.createTextNode(a??"")),r.appendChild(c),r.appendChild(document.createTextNode(l??"")),e.appendChild(r);let d=document.createElement("button");return d.type="button",d.className=i.INBOX_EMPTY_ACTION,d.textContent=this.strings.inboxEmptyAction,d.addEventListener("click",()=>this.callbacks.onActivateCommentMode()),e.appendChild(d),e}_pageFilterLabel(e){return e==="all"?this.strings.filterAll:this.strings.filterCurrentPage}_filterSummaryLabel(){let e=[this._pageFilterLabel(this.pageFilter)];return this.statusFilter!=="all"&&e.push(V(this.statusFilter,this.strings)),this.typeFilter!=="all"&&e.push(D(this.typeFilter,this.strings)),this.priorityFilter!=="all"&&e.push(k(this.priorityFilter,this.strings)),e.join(" \xB7 ")}_isFilterActive(){return this.pageFilter!=="page"||this.statusFilter!=="all"||this.typeFilter!=="all"||this.priorityFilter!=="all"}_buildFilterGroup({title:e,dataAttr:t,values:n,labelOf:s,selected:r,toggles:a=!0,onSelect:l}){let c=document.createElement("div");c.className=i.INBOX_FILTER_GROUP;let d=document.createElement("div");d.className=i.INBOX_FILTER_SECTION,d.textContent=e,c.appendChild(d);let p=document.createElement("div");p.className=i.INBOX_FILTER_CHIPS,p.setAttribute("role",a?"group":"radiogroup"),p.setAttribute("aria-label",e);for(let h of n){let m=r===h,u=document.createElement("button");u.type="button",u.className=i.INBOX_FILTER_CHIP,u.dataset[t]=h,u.setAttribute("role",a?"switch":"radio"),u.setAttribute("aria-checked",String(m)),u.textContent=s(h),u.addEventListener("click",g=>{g.stopPropagation(),l(a&&m?"all":h),this.render()}),p.appendChild(u)}return c.appendChild(p),c}_buildFilter(){let e=document.createElement("div");e.className=i.INBOX_FILTER+"-wrapper";let t=document.createElement("button");t.type="button",t.className=i.INBOX_FILTER,t.setAttribute("aria-haspopup","true"),t.setAttribute("aria-expanded","false"),t.innerHTML=`<span>${this._filterSummaryLabel()}</span>${_e}`;let n=document.createElement("div");n.className=i.INBOX_FILTER_MENU,n.setAttribute("role","group"),n.setAttribute("aria-label",this.strings.filterTitle),Z(t,n);let s=document.createElement("div");s.className=i.INBOX_FILTER_MENU_HEADER;let r=document.createElement("span");r.textContent=this.strings.filterTitle,s.appendChild(r);let a=document.createElement("button");return a.type="button",a.className=i.INBOX_FILTER_CLEAR,a.textContent=this.strings.filterClear,a.disabled=!this._isFilterActive(),a.addEventListener("click",l=>{l.stopPropagation(),this._resetFilters()}),s.appendChild(a),n.appendChild(s),n.appendChild(this._buildFilterGroup({title:this.strings.filterByPage,dataAttr:"filterPage",values:["page","all"],labelOf:l=>this._pageFilterLabel(l),selected:this.pageFilter,toggles:!1,onSelect:l=>this.pageFilter=l})),n.appendChild(this._buildFilterGroup({title:this.strings.filterByStatus,dataAttr:"filterStatus",values:[...M],labelOf:l=>V(l,this.strings),selected:this.statusFilter,onSelect:l=>this.statusFilter=l})),n.appendChild(this._buildFilterGroup({title:this.strings.filterByType,dataAttr:"filterType",values:[...N],labelOf:l=>D(l,this.strings),selected:this.typeFilter,onSelect:l=>this.typeFilter=l})),n.appendChild(this._buildFilterGroup({title:this.strings.filterByPriority,dataAttr:"filterPriority",values:[...w],labelOf:l=>k(l,this.strings),selected:this.priorityFilter,onSelect:l=>this.priorityFilter=l})),e.appendChild(t),e.appendChild(n),e}_buildCard(e,{interactive:t}){let n=document.createElement("div");n.className=i.INBOX_CARD,e.status==="resolved"&&n.classList.add(`${i.INBOX_CARD}--resolved`),n.dataset.commentId=e.id;let s=document.createElement("div");s.className=i.INBOX_CARD_HEADER,s.appendChild(Q(e.author,e.createdAt,this.strings,this.locale,e.editedAt)),n.appendChild(s);let r=document.createElement("div");if(r.className=i.THREAD_ACTIONS_ROW,r.appendChild(this._buildCardActions(e)),n.appendChild(r),!t&&this.editing&&this.editing.replyId==null&&String(this.editing.commentId)===String(e.id))n.appendChild(this._buildEditor());else{let d=document.createElement("div");d.className=i.INBOX_CARD_TEXT,d.textContent=e.text,n.appendChild(d)}if(e.screenshots?.length){let d=J(e.screenshots,this.strings);R(d,p=>this.callbacks.onShowLightbox(p)),n.appendChild(d)}let l=Ue(e,this.strings,{includeClassification:!1});l&&n.appendChild(l);let c=this._buildTag(e);if(c&&n.appendChild(c),t){n.setAttribute("role","button"),n.setAttribute("tabindex","0");let d=()=>e.anchorState==="inactive"?this.callbacks.onNavigateToPage(e):this._openDetail(e),p=document.createElement("button");p.type="button",p.className=i.INBOX_CARD_REPLY_LINK,p.textContent=this.strings.replyLink,p.addEventListener("click",h=>{h.stopPropagation(),d()}),n.appendChild(p),n.addEventListener("click",d),n.addEventListener("keydown",h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),d())}),n.addEventListener("mouseenter",()=>this._highlight(e)),n.addEventListener("mouseleave",()=>this._clearHighlight())}return n}_buildTag(e){let t=null;if(e.anchorState==="orphaned"?t=this.strings.orphanedBadge:e.hidden?t=this.strings.hiddenBadge:e.anchorState==="inactive"&&(t=e.page),!t)return null;let n=document.createElement("span");return n.className=i.INBOX_CARD_TAG,n.textContent=t,n}_buildCardActions(e){return fe(e,{strings:this.strings,onCopy:t=>U(Te(t,{viewportWidth:window.innerWidth,viewportHeight:window.innerHeight,strings:this.strings})),onCopyLink:t=>U($(t,this.options.linkParam)),onEdit:t=>this.startEditing(t.id),onSetStatus:(t,n)=>this.callbacks.onSetStatus(t.id,n),onSetType:(t,n)=>this.callbacks.onSetType(t.id,n),onSetPriority:(t,n)=>this.callbacks.onSetPriority(t.id,n),onDelete:t=>{this.detailId!=null&&O(this.detailId,t.id)&&(this.detailId=null),this.callbacks.onDelete(t.id),this.render()}})}_renderDetail(e,t){let n=t.indexOf(e),s=document.createElement("div");s.className=i.INBOX_DETAIL_HEADER;let r=document.createElement("button");r.type="button",r.className=i.INBOX_BACK,r.innerHTML=`${Mi}<span>${this.strings.back}</span>`,r.addEventListener("click",async()=>{this.editing&&!await this.releaseEditor()||(this.detailId=null,this.render())}),s.appendChild(r);let a=document.createElement("div");a.className=i.INBOX_CARD_ACTIONS;let l=(h,m,u)=>{let g=document.createElement("button");g.type="button",g.className=i.INBOX_NAV_BTN,g.setAttribute("aria-label",m),g.title=m,g.innerHTML=h;let E=t[u];return g.disabled=!E,E&&g.addEventListener("click",async()=>{this.editing&&!await this.releaseEditor()||this._openDetail(E)}),g};a.appendChild(l(Di,this.strings.prevComment,n-1)),a.appendChild(l(ki,this.strings.nextComment,n+1)),a.appendChild(this._closeButton()),s.appendChild(a),this.el.appendChild(s);let c=document.createElement("div");c.className=i.INBOX_DETAIL,c.appendChild(this._buildCard(e,{interactive:!1}));let d=Ce(e,{strings:this.strings,onShowLightbox:h=>this.callbacks.onShowLightbox(h),collapsible:!0,expanded:this.contextExpanded,onToggle:h=>{this.contextExpanded=h}});d&&c.appendChild(d);let p=document.createElement("div");p.className=i.INBOX_REPLIES;for(let h of e.replies||[]){let m=this.editing&&String(this.editing.commentId)===String(e.id)&&String(this.editing.replyId)===String(h.id),u=ee(h,this.strings,this.locale,{onDelete:(g,E)=>{this.callbacks.onDeleteReply(e.id,g.id)&&E.remove()},onEdit:g=>this.startEditing(e.id,g.id),editing:m?this._editorHandlers():null});R(u,g=>this.callbacks.onShowLightbox(g)),p.appendChild(u)}c.appendChild(p),c.appendChild(this._buildReplyInput(e)),this.el.appendChild(c)}_buildReplyInput(e){let{container:t,inputEl:n,screenshotsContainer:s,attachBtn:r,fileInput:a,submitBtn:l}=be({areaClassName:i.THREAD_INPUT_AREA,inputTag:"input",inputClassName:i.THREAD_INPUT,inputPlaceholder:this.strings.replyPlaceholder},this.strings),c=[],d=()=>{G(s,c,{strings:this.strings,onShow:h=>this.callbacks.onShowLightbox(h),rerender:()=>d()})};r.addEventListener("click",()=>a.click()),Y(a,()=>c,d);let p=()=>{let h=n.value.trim();!h&&c.length===0||(this.callbacks.onReply(e,h,[...c]),c=[],this.render())};return l.addEventListener("click",p),n.addEventListener("keydown",h=>{h.key==="Enter"&&!h.shiftKey&&(h.preventDefault(),p())}),t}};var Pi=o=>{let e=new Set;for(let t of o){let n=String(t).trim().toLowerCase();n&&e.add(n)}return[...e]},kt=o=>o.filter(e=>typeof e=="string"),$i={"comment:created":"onCommentCreated","comment:edited":"onCommentEdited","comment:deleted":"onCommentDeleted","comment:status-changed":"onCommentStatusChanged","comment:updated":"onCommentUpdated","comment:anchor-lost":"onAnchorLost","reply:added":"onReplyAdded","reply:deleted":"onReplyDeleted","reply:edited":"onReplyEdited"},Ge=class{constructor(e={}){this.comments=[],this.commentMode=!1,this.isMac=Xe(),this.options={shortcutKey:e.shortcutKey||(this.isMac?"c":"C"),shortcutModifier:e.shortcutModifier||"alt",autoScreenshot:e.autoScreenshot!==!1,embedCrossOriginFonts:e.embedCrossOriginFonts===!0,...e},this.locale=this.options.locale||ct(),this.strings=dt(this.locale),this.markers=null,this._captureFlow=null,this._storedCache=null,this._popover=null,this._pendingDetailId=null,document.readyState==="loading"?(this._onDomReady=()=>this.initOverlay(),document.addEventListener("DOMContentLoaded",this._onDomReady)):this.initOverlay()}initOverlay(){this.shadowRoot=We(),this.toolbar=vt(this.options,this.strings),this.commentBox=It(this.strings),this.overlay=document.createElement("div"),this.overlay.className=i.COMMENT_OVERLAY,this.shadowRoot.appendChild(this.overlay),this.shadowRoot.appendChild(this.toolbar),this.shadowRoot.appendChild(this.commentBox),this.commentBtn=this.toolbar.querySelector(`.${i.TOOLBAR_COMMENT_BTN}`),this.inboxBtn=this.toolbar.querySelector(`.${i.TOOLBAR_MENU_BTN}`),this.submitButton=this.shadowRoot.getElementById(T.SUBMIT_COMMENT),this.commentInput=this.shadowRoot.getElementById(T.COMMENT_INPUT),this.attachImageBtn=this.commentBox.querySelector(`.${i.ATTACH_IMAGE_BTN}`),this.attachImageInput=this.shadowRoot.getElementById(T.ATTACH_IMAGE_INPUT),this._captureFlow=new re({host:this.shadowRoot,autoScreenshot:this.options.autoScreenshot,embedCrossOriginFonts:this.options.embedCrossOriginFonts,onRegionCaptured:e=>{this._pendingScreenshots||(this._pendingScreenshots=[]),this._pendingScreenshots.length<ne&&this._pendingScreenshots.push(e)},onPlace:(e,t)=>this._placeCommentAtPoint(e,t)}),this._popover=new xe({shadowRoot:this.shadowRoot,strings:this.strings,locale:this.locale,findComment:e=>this._findComment(e),removeTooltip:e=>this._tooltipEl(e)?.remove(),onShowLightbox:e=>this.showLightbox(e),isInsideLightbox:e=>this._isInsideLightbox(e),linkParam:()=>this._linkParam(),refreshInbox:()=>{this.inboxView?.isOpen()&&this.inboxView.refresh()},actions:{addReply:(e,t,n)=>this.addReply(e,t,n),deleteReply:(e,t)=>this.deleteReply(e,t),editComment:(e,t)=>this.editComment(e,t),editReply:(e,t,n)=>this.editReply(e,t,n),setStatus:(e,t)=>this.setCommentStatus(e,t),setType:(e,t)=>this.setCommentType(e,t),setPriority:(e,t)=>this.setCommentPriority(e,t),deleteComment:e=>this.deleteComment(e)}}),this.markers=new Oe({container:this.overlay,strings:this.strings,getComments:()=>this.comments,wireMarker:(e,t)=>this._wireMarker(e,t),onMarkerHidden:e=>this._dismissMarkerUi(e),onVisibilityFlip:()=>{this.inboxView?.isOpen()&&this.inboxView.refresh()},onAfterPass:()=>this.syncThreadPopoverToMarker()}),this.markers.start(),this.bindEventListeners(),this.setupKeyboardShortcut(),this.injectStyles(),this._pendingDetailId=this._readPendingDetailId(),this.options.persistence==="localStorage"&&(this._storedCache=Me(),this.loadComments(this._storedCache),this._storageHandler=e=>{(e.key===ce||e.key===null)&&(this._storedCache=null)},window.addEventListener("storage",this._storageHandler)),this._openPendingDetail(),this.options.autoDetectNavigation&&(this._popstateHandler=()=>this.notifyNavigation(),window.addEventListener("popstate",this._popstateHandler))}_navigateTo(e){if(typeof this.options.navigate=="function"){this.options.navigate(e);return}location.assign(e)}_readPendingDetailId(){let e=Ct(this._linkParam()),t=null;try{t=sessionStorage.getItem(de),t!=null&&sessionStorage.removeItem(de)}catch{}return e??t}_linkParam(){return this.options.linkParam||pe}_openPendingDetail(){let e=this._pendingDetailId;if(!e)return;let t=this._findComment(e);if(!t){this.showInbox(),this.inboxView?.showNotice(this.strings.commentNotFound);return}this._pendingDetailId=null,this.showInbox(),this.inboxView.clearNotice(),this.inboxView.openDetail(t.id)}_emit(e,t,n){let s=$i[e],r=this.options[s];if(typeof r=="function")try{r(...t)}catch(a){console.warn(`HellDots: ${s} handler threw`,a)}if(typeof this.options.onChange=="function")try{this.options.onChange({type:e,...n})}catch(a){console.warn("HellDots: onChange handler threw",a)}}commentLink(e){let t=this._findComment(e);return t?$(t,this._linkParam()):null}_readStoredCached(){return this._storedCache||(this._storedCache=Me()),this._storedCache}_syncStorage(){if(this.options.persistence!=="localStorage")return;let e=De(this._readStoredCached(),this.serializeComments(),location.pathname);he(e),this._storedCache=e}bindEventListeners(){this.commentBtn.addEventListener("click",()=>this.toggleCommentMode()),this.inboxBtn.addEventListener("click",()=>this.toggleInbox()),this.submitButton.addEventListener("click",()=>this.saveComment()),this.commentInput.addEventListener("keydown",e=>{e.key==="Enter"&&!e.shiftKey&&(e.preventDefault(),this.saveComment())}),this.attachImageBtn.addEventListener("click",()=>{this.attachImageInput.click()}),Y(this.attachImageInput,()=>(this._pendingScreenshots||(this._pendingScreenshots=[]),this._pendingScreenshots),()=>this._updateScreenshotsPreview()),this._handleDocumentClickBound=e=>this.handleDocumentClick(e),document.addEventListener("mousedown",this._handleDocumentClickBound)}setupKeyboardShortcut(){this.keydownHandler&&document.removeEventListener("keydown",this.keydownHandler),this.keydownHandler=e=>{if(e.key==="Escape"){this._activeLightbox?this.closeLightbox():this.activeThreadPopover?this._popover.isEditing()?this._popover.releaseEditor():this.closeThreadPopover():this.inboxView?.isOpen()?this.inboxView.editing?this.inboxView.releaseEditor().then(r=>r&&this.inboxView?.refresh()):this.closeInbox():this.commentBox.style.display!=="none"?(this.hideCommentBox(),this.toggleCommentMode()):this.commentMode&&this.toggleCommentMode();return}let t=this.options.shortcutKey.toLowerCase(),n=e.key.toLowerCase()===t||e.altKey&&/^[a-z]$/.test(t)&&e.code===`Key${t.toUpperCase()}`,s=this.options.shortcutModifier==="alt"&&e.altKey||this.options.shortcutModifier==="ctrl"&&(e.ctrlKey||e.metaKey)||this.options.shortcutModifier==="shift"&&e.shiftKey;n&&s&&(e.preventDefault(),e.stopPropagation(),this.toggleCommentMode())},document.addEventListener("keydown",this.keydownHandler)}handleDocumentClick(e){if(!this.commentMode)return;let t=e.composedPath()[0]||e.target;if(!(this.toolbar.contains(t)||t?.closest?.(`.${i.CIRCLE}`)||t?.closest?.(`.${i.TOOLTIP}`)||t?.closest?.(`.${i.THREAD_POPOVER}`)||t?.closest?.(`.${i.INBOX_PANEL}`)||t?.closest?.(`.${i.LIGHTBOX}`))&&!this.commentBox.contains(t)){if(this.commentBox.style.display!=="none"){this.hideCommentBox(),this.toggleCommentMode();return}e.button===0&&(e.preventDefault(),this._captureFlow.beginDrag(e))}}async _placeCommentAtPoint(e,t){this._captureFlow.armClickCapture();let n=this.overlay.style.pointerEvents;this.overlay.style.pointerEvents="none";let s=document.elementFromPoint(e,t);this.overlay.style.pointerEvents=n||"";let r=s?.closest?.(tt.CONTAINER)||document.body,a=r.getBoundingClientRect(),l=a.width>0?(e-a.left)/a.width:0,c=a.height>0?(t-a.top)/a.height:0,d=ft(r,l,c);d.targetSelector=s&&s!==r?gt(s):null,this.currentPosition={container:r,relativeX:l,relativeY:c,anchor:d,target:s||r},this.createPreviewCircle(e,t),document.body.classList.remove(i.COMMENT_CURSOR),this._pendingScreenshots&&this._pendingScreenshots.length>0&&this._updateScreenshotsPreview(),this.showCommentBox(e,t)}_updateScreenshotsPreview(){let e=this.commentBox.querySelector(`.${i.SCREENSHOTS_CONTAINER}`);e&&G(e,this._pendingScreenshots||[],{strings:this.strings,onShow:t=>this.showLightbox(t),rerender:()=>this._updateScreenshotsPreview()})}_clearScreenshotPreview(){this._pendingScreenshots=[];let e=this.commentBox.querySelector(`.${i.SCREENSHOTS_CONTAINER}`);e&&(e.innerHTML="",e.classList.remove(i.ACTIVE))}showCommentBox(e,t){this.commentBox.style.display="block";let s=A/2,r=s+10,a=window.innerWidth,l=window.innerHeight,c=this.commentBox.getBoundingClientRect(),d=c.width||400,p=e+s,h=t+s,m=p+r,u=h-s;m+d>a&&(m=p-r-d),m=Math.min(m,a-d-10),m=Math.max(10,m),u+c.height>l&&(u=l-c.height-10),u=Math.max(10,u),this.commentBox.style.left=`${m}px`,this.commentBox.style.top=`${u}px`,this.commentInput.value="",setTimeout(()=>this.commentInput.focus(),50)}hideCommentBox(){this.commentBox.style.display="none",this.commentInput.style.height="auto",this.currentPosition=null,this.removePreviewCircle(),this._clearScreenshotPreview(),this._captureFlow?.clearPending(),this.commentBox.classify?.reset(),this.commentMode&&document.body.classList.add(i.COMMENT_CURSOR)}toggleCommentMode(){this.commentMode=!this.commentMode,this.commentMode&&this.closeInbox(),this.commentBtn?.classList.toggle(i.ACTIVE,this.commentMode),this.commentBtn?.setAttribute("aria-pressed",String(this.commentMode)),this.overlay.classList.toggle(i.ACTIVE,this.commentMode),document.body.classList.toggle(i.COMMENT_CURSOR,this.commentMode),this.commentMode||this.hideCommentBox()}async saveComment(){if(!this._saving&&!(!this.commentInput.value.trim()||!this.currentPosition)){this._saving=!0;try{await this._saveCommentNow()}finally{this._saving=!1}}}async _saveCommentNow(){let e=await this._captureFlow.consumePending();if(!this.currentPosition)return;let t={text:this.commentInput.value,container:this.currentPosition.container,relativeX:this.currentPosition.relativeX,relativeY:this.currentPosition.relativeY,anchor:this.currentPosition.anchor,anchorState:"anchored",target:this.currentPosition.target,hidden:!1,status:"open",page:location.pathname,id:ke(),replies:[],author:this.options.user?.name||this.strings.anonymous,createdAt:new Date().toISOString(),screenshots:this._pendingScreenshots?[...this._pendingScreenshots]:[],type:this.commentBox.classify?.getType()??null,priority:this.commentBox.classify?.getPriority()??null,tags:[],resolvedAt:null,context:rt(),contextScreenshot:e};this.comments.push(t),this._syncStorage();let n=this._serializeComment(t);this._emit("comment:created",[n],{comment:n}),this.renderCommentCircle(t),this.hideCommentBox(),this.toggleCommentMode();let s=this._circles.get(String(t.id));s&&this.showThreadPopover(s,t)}renderCommentCircle(e){this.markers.render(e)}_wireMarker(e,t){e.addEventListener("mouseenter",()=>this.showCommentTooltip(e,t)),e.addEventListener("mouseleave",()=>{setTimeout(()=>{let n=this._tooltipEl(t.id);n&&!n.matches(":hover")&&n.remove()},250)}),e.addEventListener("click",n=>{if(n.stopPropagation(),this._tooltipEl(t.id)?.remove(),this.activeThreadPopover?.dataset.for===String(t.id)){this.closeThreadPopover();return}this.showThreadPopover(e,t)}),e.addEventListener("keydown",n=>{(n.key==="Enter"||n.key===" ")&&(n.preventDefault(),e.click())})}showCommentTooltip(e,t){if(this.shadowRoot.querySelector(`.${i.THREAD_POPOVER}[data-for="${P(t.id)}"]`)||this._tooltipEl(t.id))return;let s=Lt(t,this.strings,this.locale);this.shadowRoot.appendChild(s),R(s,r=>this.showLightbox(r)),setTimeout(()=>{te(s,e)},10),s.querySelector(`.${i.CLOSE_TOOLTIP}`).addEventListener("click",r=>{r.stopPropagation(),s.remove()}),s.addEventListener("mouseleave",()=>s.remove())}toggleInbox(){this.inboxView?.isOpen()?this.closeInbox():this.showInbox()}showInbox(){this.closeThreadPopover(),this.inboxView||(this.inboxView=new ye({shadowRoot:this.shadowRoot,strings:this.strings,locale:this.locale,currentPage:location.pathname,getComments:()=>this.comments,options:this.options,callbacks:{onActivateCommentMode:()=>{this.closeInbox(),this.commentMode||this.toggleCommentMode()},onOpenDetailScroll:e=>this.scrollMarkerIntoView(e),onReply:(e,t,n)=>this.addReply(e,t,n),onDelete:e=>this.deleteComment(e),onDeleteReply:(e,t)=>this.deleteReply(e,t),onEditComment:(e,t)=>{this.editComment(e,t)&&this._popover.refreshCommentViews(e)},onEditReply:(e,t,n)=>{this.editReply(e,t,n)&&this._popover.refreshCommentViews(e)},onSetStatus:(e,t)=>this.setCommentStatus(e,t),onSetType:(e,t)=>this.setCommentType(e,t),onSetPriority:(e,t)=>this.setCommentPriority(e,t),onNavigateToPage:e=>{try{sessionStorage.setItem(de,String(e.id))}catch{}this._navigateTo(e.page)},onShowLightbox:e=>this.showLightbox(e),onClose:()=>this.closeInbox()}})),this.inboxView.open(),this._disarmInboxOutsideClick(),this._inboxClickTimer=setTimeout(()=>{this._inboxClickTimer=null,this._inboxClickHandler=e=>{let t=e.composedPath()[0]||e.target;if(!this.inboxView.el?.contains(t)&&!this.inboxBtn.contains(t)&&!this._isInsideLightbox(t)){if(this.inboxView.isDirty())return;this.closeInbox()}},document.addEventListener("mousedown",this._inboxClickHandler)},0)}closeInbox(){this.inboxView?.close(),this._disarmInboxOutsideClick()}_disarmInboxOutsideClick(){this._inboxClickTimer&&(clearTimeout(this._inboxClickTimer),this._inboxClickTimer=null),this._inboxClickHandler&&(document.removeEventListener("mousedown",this._inboxClickHandler),this._inboxClickHandler=null)}get activeThreadPopover(){return this._popover?.active??null}showThreadPopover(e,t){this._popover.show(e,t)}closeThreadPopover(){this._popover?.close()}syncThreadPopoverToMarker(){this._popover?.syncToMarker()}showLightbox(e){this.closeLightbox(),this._lightboxReturnFocus=this.shadowRoot.activeElement||document.activeElement;let t=document.createElement("div");t.className=i.LIGHTBOX,t.setAttribute("role","dialog"),t.setAttribute("aria-modal","true"),t.setAttribute("aria-label",this.strings.screenshotPreview);let n=document.createElement("img");n.className=i.LIGHTBOX_IMG,n.src=e,n.alt=this.strings.screenshotPreview;let s=document.createElement("button");s.type="button",s.className=i.LIGHTBOX_CLOSE,s.setAttribute("aria-label",this.strings.close),s.innerHTML="×",s.addEventListener("click",()=>this.closeLightbox()),t.appendChild(n),t.appendChild(s),t.addEventListener("click",r=>{r.target===t&&this.closeLightbox()}),this.shadowRoot.appendChild(t),this._activeLightbox=t,this._lightboxKeydownHandler=r=>{r.key==="Tab"&&(r.preventDefault(),s.focus())},document.addEventListener("keydown",this._lightboxKeydownHandler,!0),s.focus()}closeLightbox(){if(!this._activeLightbox)return;this._lightboxKeydownHandler&&(document.removeEventListener("keydown",this._lightboxKeydownHandler,!0),this._lightboxKeydownHandler=null),this._activeLightbox.remove(),this._activeLightbox=null;let e=this._lightboxReturnFocus;this._lightboxReturnFocus=null,e?.isConnected&&e.focus?.()}_isInsideLightbox(e){return!!e?.closest?.(`.${i.LIGHTBOX}`)}_findComment(e){return this.comments.find(t=>O(t.id,e))}_tooltipEl(e){return this.shadowRoot?.querySelector(`.${i.TOOLTIP}[data-for="${P(e)}"]`)??null}addReply(e,t,n=[]){let s=typeof e=="object"&&e!==null?e:this._findComment(e);if(!s)return null;s.replies||(s.replies=[]);let r={id:ke(),editedAt:null,text:t,author:this.options.user?.name||this.strings.anonymous,timestamp:new Date().toISOString(),screenshots:n};s.replies.push(r),this._syncStorage();let a=this._serializeComment(s),l=this._serializeReply(r);return this._emit("reply:added",[a,l],{comment:a,reply:l}),r}deleteReply(e,t){let n=this._findComment(e),s=n?.replies?.findIndex(c=>O(c.id,t))??-1;if(s<0)return!1;let[r]=n.replies.splice(s,1);this._syncStorage();let a=this._serializeComment(n),l=this._serializeReply(r);return this._emit("reply:deleted",[a,l],{comment:a,reply:l}),!0}editComment(e,t){let n=this._findComment(e),s=String(t??"").trim();if(!n||!s||s===n.text)return!1;n.text=s,n.editedAt=new Date().toISOString(),this._circles.get(String(n.id))?.setAttribute("aria-label",`${this.strings.commentAriaLabelPrefix}${n.text}`),this._syncStorage();let r=this._serializeComment(n);return this._emit("comment:edited",[r],{comment:r}),!0}editReply(e,t,n){let s=this._findComment(e),r=s?.replies?.find(d=>O(d.id,t)),a=String(n??"").trim();if(!r||!a||a===r.text)return!1;r.text=a,r.editedAt=new Date().toISOString(),this._syncStorage();let l=this._serializeComment(s),c=this._serializeReply(r);return this._emit("reply:edited",[l,c],{comment:l,reply:c}),!0}_serializeReply({id:e,text:t,author:n,timestamp:s,screenshots:r,editedAt:a}){return{id:e,text:t,author:n,timestamp:s,screenshots:r||[],editedAt:a||null}}_serializeComment(e){return{schemaVersion:1,id:e.id,text:e.text,editedAt:e.editedAt||null,anchor:e.anchor||null,page:e.page||location.pathname,replies:(e.replies||[]).map(t=>this._serializeReply(t)),author:e.author,createdAt:e.createdAt,screenshots:e.screenshots||[],status:e.status||"open",type:e.type||null,priority:e.priority||null,tags:e.tags?[...e.tags]:[],resolvedAt:e.resolvedAt||null,context:e.context?{...e.context}:null,contextScreenshot:e.contextScreenshot||null}}setCommentStatus(e,t){if(!M.includes(t))return!1;let n=this._findComment(e);if(!n)return!1;if(n.status===t)return!0;n.status=t,n.resolvedAt=t==="resolved"?new Date().toISOString():null;let s=this._circles.get(String(n.id));s&&this.updateCommentPosition(n,s),this._syncStorage(),this.inboxView?.isOpen()&&this.inboxView.refresh();let r=this._serializeComment(n);return this._emit("comment:status-changed",[r],{comment:r}),!0}_commitUpdate(e){this._syncStorage(),this.inboxView?.isOpen()&&this.inboxView.refresh();let t=this._serializeComment(e);return this._emit("comment:updated",[t],{comment:t}),!0}setCommentType(e,t){if(t!==null&&!N.includes(t))return!1;let n=this._findComment(e);return n?(n.type=t,this._commitUpdate(n)):!1}setCommentPriority(e,t){if(t!==null&&!w.includes(t))return!1;let n=this._findComment(e);return n?(n.priority=t,this._commitUpdate(n)):!1}setCommentTags(e,t){if(!Array.isArray(t))return!1;let n=this._findComment(e);return n?(n.tags=Pi(t),this._commitUpdate(n)):!1}serializeComments(){return this.comments.map(e=>this._serializeComment(e))}deleteComment(e){if(!this._findComment(e))return!1;if(this._removeComment(e),this.options.persistence==="localStorage"){let t=De(this._readStoredCached().filter(n=>!O(n.id,e)),this.serializeComments(),location.pathname);he(t),this._storedCache=t}return this._emit("comment:deleted",[e],{id:e}),!0}_removeComment(e){this.markers.remove(e),this.comments=this.comments.filter(t=>!O(t.id,e))}clearComments(){this.closeThreadPopover();let e=this.comments;if(this.markers.clear(),this.comments=[],this.options.persistence==="localStorage"&&e.length>0){let t=new Set(e.map(s=>String(s.id))),n=this._readStoredCached().filter(s=>!t.has(String(s.id)));he(n),this._storedCache=n}this.inboxView?.isOpen()&&this.inboxView.refresh()}loadComments(e){let t=0,n=0,s=0;if(!Array.isArray(e))return{anchored:t,orphaned:n,inactive:s};for(let r of e){if(!r||r.id==null||typeof r.text!="string"){console.warn("HellDots: skipping malformed serialized comment",r);continue}this._removeComment(r.id);let a={id:r.id,text:r.text,editedAt:r.editedAt||null,anchor:r.anchor||null,anchorState:"orphaned",target:null,hidden:!1,page:r.page||location.pathname,container:null,relativeX:0,relativeY:0,replies:Array.isArray(r.replies)?r.replies.filter(c=>c&&typeof c=="object"&&c.id!=null&&typeof c.text=="string").map(c=>Array.isArray(c.screenshots)?{...c,screenshots:kt(c.screenshots)}:c):[],author:r.author||this.strings.anonymous,createdAt:r.createdAt||new Date().toISOString(),screenshots:Array.isArray(r.screenshots)?kt(r.screenshots):[],status:r.status==="closed"?"resolved":M.includes(r.status)?r.status:"open",type:N.includes(r.type)?r.type:null,priority:w.includes(r.priority)?r.priority:null,tags:Array.isArray(r.tags)?[...r.tags]:[],resolvedAt:r.resolvedAt||null,context:r.context||null,contextScreenshot:r.contextScreenshot||null};if(r.page&&r.page!==location.pathname){a.anchorState="inactive",this.comments.push(a),s++;continue}let l=r.anchor?Be(r.anchor):null;if(l)a.container=l.element,a.relativeX=r.anchor.relativeX,a.relativeY=r.anchor.relativeY,a.anchorState="anchored",this.comments.push(a),this.renderCommentCircle(a),t++;else{this.comments.push(a),n++;let c=this._serializeComment(a);this._emit("comment:anchor-lost",[c],{comment:c})}}return this._openPendingDetail(),{anchored:t,orphaned:n,inactive:s}}notifyNavigation(){let e=location.pathname,t=0,n=0,s=0;this.closeThreadPopover(),this.hideCommentBox(),this.inboxView&&(this.inboxView.currentPage=e);for(let r of this.comments){if(this.markers.remove(r.id),r.hidden=!1,r.target=null,r._occluded=!1,r.page&&r.page!==e){r.anchorState="inactive",r.container=null,s++;continue}let a=r.anchor?Be(r.anchor):null;if(a)r.container=a.element,r.relativeX=r.anchor.relativeX,r.relativeY=r.anchor.relativeY,r.anchorState="anchored",this.renderCommentCircle(r),t++;else{r.container=null,r.anchorState="orphaned",n++;let l=this._serializeComment(r);this._emit("comment:anchor-lost",[l],{comment:l})}}return this._pendingDetailId=this._readPendingDetailId(),this.inboxView?.isOpen()&&this.inboxView.refresh(),this._openPendingDetail(),{anchored:t,orphaned:n,inactive:s}}scrollMarkerIntoView(e){this.markers.scrollMarkerIntoView(e)}createPreviewCircle(e,t){this.removePreviewCircle();let n=document.createElement("div");n.className=`${i.CIRCLE} ${i.PREVIEW_CIRCLE}`,n.style.position="absolute";let s=A/2;n.style.left=`${e+s}px`,n.style.top=`${t+s}px`,n.style.transform="translate(-50%, -50%)",n.style.pointerEvents="none",this.overlay.appendChild(n),this.previewCircle=n}removePreviewCircle(){this.previewCircle?.remove(),this.previewCircle=null}cleanupResizeObserver(e){this.markers.cleanupResizeObserver(e)}validateAndCalculatePosition(e,t){return this.markers.validateAndCalculatePosition(e,t)}updateCommentPosition(e,t){this.markers.updatePosition(e,t)}scheduleUpdatePositions(){this.markers.scheduleUpdate()}get _circles(){return this.markers?.circles}get resizeObservers(){return this.markers?.resizeObservers}get positionValidationEnabled(){return this.markers?.enabled??!0}set positionValidationEnabled(e){this.markers&&(this.markers.enabled=e)}get _globalMutationObserver(){return this.markers?._globalMutationObserver??null}_dismissMarkerUi(e){this._tooltipEl(e.id)?.remove(),this.activeThreadPopover?.dataset.for===String(e.id)&&this.closeThreadPopover()}cleanup(){this._onDomReady&&(document.removeEventListener("DOMContentLoaded",this._onDomReady),this._onDomReady=null),this.markers?.destroy(),this._storageHandler&&(window.removeEventListener("storage",this._storageHandler),this._storageHandler=null),this._popstateHandler&&(window.removeEventListener("popstate",this._popstateHandler),this._popstateHandler=null),this._storedCache=null,me(),Ot(),this.closeThreadPopover(),this.closeInbox(),this.closeLightbox(),this.removePreviewCircle(),this._captureFlow?.destroy(),this._pendingScreenshots=[],this._handleDocumentClickBound&&document.removeEventListener("mousedown",this._handleDocumentClickBound),this.keydownHandler&&document.removeEventListener("keydown",this.keydownHandler),this.toolbar&&this.toolbar.parentNode&&this.toolbar.parentNode.removeChild(this.toolbar),this.commentBox&&this.commentBox.parentNode&&this.commentBox.parentNode.removeChild(this.commentBox),this.overlay&&this.overlay.parentNode&&this.overlay.parentNode.removeChild(this.overlay),document.body.classList.remove(i.COMMENT_CURSOR),this._detachStyles(),document.querySelector(I)?.remove()}injectStyles(){this._detachStyles(),this._styleDetachers=[Re(this.shadowRoot,st(),T.STYLES),Re(document,at(),T.GLOBAL_STYLES)]}_detachStyles(){for(let e of this._styleDetachers??[])e();this._styleDetachers=[]}},Pt=Ge;function Hi(o={}){let{autoInit:e=!0,...t}=o,n=()=>new Pt(t);return e?n():n}var So=Hi;export{Pt as CommentOverlay,Hi as createCommentOverlay,So as default};
|
|
1455
9
|
//# sourceMappingURL=helldots.esm.js.map
|