helldots 0.10.0 → 0.12.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.
@@ -1,10 +1,10 @@
1
1
  /*! HellDots — MIT. Bundles nanoid (MIT) © 2017 Andrey Sitnik <andrey@sitnik.es> — https://github.com/ai/nanoid */
2
- var D="helldots-root",Vo=()=>{customElements.get(D)||customElements.define(D,class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}})};function At(){Vo();let i=document.querySelector(D);return i||(i=document.createElement(D),document.body.appendChild(i)),i.shadowRoot}var Fe=()=>typeof performance?.now=="function"?performance.now():Date.now(),Yo=()=>new Promise(i=>{if(typeof MessageChannel!="function"){setTimeout(i);return}let e=new MessageChannel;e.port1.onmessage=()=>{e.port1.close(),i()},e.port2.postMessage(null)}),jo=()=>{let i=globalThis.scheduler;return typeof i?.yield=="function"?i.yield():Yo()};function St({budgetMs:i=8}={}){let e=Fe(),t=()=>{e=Fe()};return()=>{if(!(Fe()-e<i))return jo().then(t,t)}}var Wo=["background-clip","font-family","font-kerning","overflow-x","overflow-y","text-overflow","text-transform"],Nt=[...Wo,"aspect-ratio","border-collapse","border-spacing","bottom","box-sizing","caption-side","clear","display","empty-cells","float","height","isolation","left","margin-bottom","margin-left","margin-right","margin-top","max-height","max-width","min-height","min-width","padding-bottom","padding-left","padding-right","padding-top","position","right","table-layout","top","vertical-align","visibility","width","z-index","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left-color","border-left-style","border-left-width","border-right-color","border-right-style","border-right-width","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","outline-color","outline-offset","outline-style","outline-width","align-content","align-items","align-self","column-count","column-fill","column-gap","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","flex-basis","flex-direction","flex-grow","flex-shrink","flex-wrap","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column-end","grid-column-start","grid-row-end","grid-row-start","grid-template-areas","grid-template-columns","grid-template-rows","justify-content","justify-items","justify-self","order","row-gap","color","direction","font-feature-settings","font-size","font-stretch","font-style","font-variant","font-variation-settings","font-weight","hyphens","letter-spacing","line-height","list-style-image","list-style-position","list-style-type","overflow-wrap","tab-size","text-align","text-align-last","text-decoration-color","text-decoration-line","text-decoration-style","text-decoration-thickness","text-indent","text-orientation","text-shadow","text-underline-offset","text-underline-position","unicode-bidi","white-space","word-break","word-spacing","writing-mode","-webkit-box-orient","-webkit-line-clamp","-webkit-text-fill-color","-webkit-text-stroke-color","-webkit-text-stroke-width","backdrop-filter","backface-visibility","background-attachment","background-blend-mode","background-color","background-image","background-origin","background-position-x","background-position-y","background-repeat","background-size","box-shadow","clip-path","filter","mask-image","mask-mode","mask-position","mask-repeat","mask-size","mix-blend-mode","object-fit","object-position","opacity","perspective","perspective-origin","rotate","scale","transform","transform-origin","transform-style","translate","accent-color","appearance","dominant-baseline","fill","fill-opacity","fill-rule","paint-order","shape-rendering","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-opacity","stroke-width","text-anchor"];var Ko=(i,e)=>{try{let t=document.createElement("canvas");if(t.width=i,t.height=e,t.width!==i||t.height!==e)return!1;let o=t.getContext("2d");return o?(o.fillStyle="#ffffff",o.fillRect(0,0,1,1),o.getImageData(0,0,1,1).data[3]!==0):!1}catch{return!1}},be=null,qo=()=>(be!==null||(be=[65535,32767,16384,8192,4096].find(i=>Ko(1,i))??4096),be),vt=(i,e,t,o={})=>{if(!(i>0)||!(e>0))return t;let{maxDimension:s=qo(),maxArea:r=268435456}=o;return Math.min(t,s/i,s/e,Math.sqrt(r/(i*e)))},wt=i=>{try{let e=i?.getContext?.("2d");return!!e&&e.getImageData(0,0,1,1).data[3]!==0}catch{return!1}};var Ve=.5,Zo=.7,Ge,Jo=()=>(Ge??=import("modern-screenshot").catch(i=>{throw Ge=void 0,i}),Ge),Lt=i=>!i||i==="transparent"||i==="rgba(0, 0, 0, 0)",Mt=()=>{let i=getComputedStyle(document.documentElement).backgroundColor;if(!Lt(i))return i;let e=getComputedStyle(document.body).backgroundColor;return Lt(e)?"#ffffff":e},Bt=()=>{try{let i=document.implementation.createHTMLDocument(""),e=i.createElement("style");return i.head.appendChild(e),e.sheet!==null}catch{return!1}},Qo=i=>{let e=[],t=i.indexOf("@font-face");for(;t!==-1;){let o=i.indexOf("{",t),s=o===-1?-1:i.indexOf("}",o);if(s===-1)break;e.push(i.slice(t,s+1)),t=i.indexOf("@font-face",s)}return e.join(`
3
- `)},ze=new Map,ei=i=>(ze.has(i)||ze.set(i,fetch(i,{mode:"cors",credentials:"omit"}).then(e=>e.ok?e.text():"").then(Qo).catch(()=>"")),ze.get(i)),ti=i=>{try{return!!i.cssRules}catch{return!1}},oi=async i=>{let e=()=>{};if(!i||!Bt())return e;let t=Array.from(document.styleSheets).filter(r=>r.href&&!ti(r)).map(r=>r.href);if(!t.length)return e;let o=(await Promise.all(t.map(ei))).filter(Boolean).join(`
4
- `);if(!o)return e;let s=document.createElement("style");return s.textContent=o,document.head.appendChild(s),()=>s.remove()},ii=i=>e=>!(e.nodeName?.toLowerCase()===D||i&&e.ownerDocument!==document);async function Ye({scale:i=1,embedCrossOriginFonts:e=!1,fastCapture:t=!1,skipIframeContent:o=!1,captureTimeout:s}={}){let{domToCanvas:r}=await Jo(),a=await oi(e),{width:l,height:c}=document.documentElement.getBoundingClientRect(),d=vt(l,c,i);try{for(let p=3;;p--){let h=await r(document.documentElement,{scale:d,backgroundColor:Mt(),...Bt()?{}:{font:!1},filter:ii(o),onCloneEachNode:St(),...t?{includeStyleProperties:Nt}:{},...Number.isFinite(s)&&s>0?{timeout:s}:{}});if(wt(h))return{canvas:h,scale:d};if(p<=0)throw new Error(`HellDots: the page render came back holding no pixels. ${Math.round(l)}x${Math.round(c)} CSS pixels is most likely past this browser's canvas limit.`);d/=2}}finally{a()}}var Dt=(i,e,t)=>{i.fillStyle=Mt(),i.fillRect(0,0,e,t)};function kt(i,{left:e,top:t,width:o,height:s},{sourceScale:r=1}={}){let a=document.createElement("canvas");a.width=o,a.height=s;let l=a.getContext("2d");return l?(Dt(l,o,s),l.drawImage(i,(e+window.scrollX)*r,(t+window.scrollY)*r,o*r,s*r,0,0,o,s),a.toDataURL("image/png")):null}function je(i,{sourceScale:e=1,outputScale:t=Ve,quality:o=Zo}={}){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?(Dt(r,s.width,s.height),r.drawImage(i,window.scrollX*e,window.scrollY*e,window.innerWidth*e,window.innerHeight*e,0,0,s.width,s.height),s.toDataURL("image/jpeg",o)):null}var n={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_AUTHOR_NAME:"thread-author-name",INBOX_HEADER_ACTIONS:"inbox-header-actions",INBOX_METRICS_BTN:"inbox-metrics-btn",METRICS_VIEW:"metrics-view",METRICS_TILES:"metrics-tiles",METRICS_TILE:"metrics-tile",METRICS_TILE_VALUE:"metrics-tile-value",METRICS_TILE_LABEL:"metrics-tile-label",METRICS_GROUP:"metrics-group",METRICS_HEADING:"metrics-heading",METRICS_ROW:"metrics-row",METRICS_ROW_LABEL:"metrics-row-label",METRICS_TRACK:"metrics-track",METRICS_BAR:"metrics-bar",METRICS_ROW_COUNT:"metrics-row-count",METRICS_CHART:"metrics-chart",METRICS_AXIS:"metrics-axis",METRICS_EXPORTS:"metrics-exports",METRICS_EXPORT_BTN:"metrics-export-btn",METRICS_EMPTY:"metrics-empty",AUDIT_BLOCK:"audit-block",AUDIT_TOGGLE:"audit-toggle",AUDIT_BODY:"audit-body",AUDIT_LIST:"audit-list",AUDIT_ROW:"audit-row",AUDIT_ACTION:"audit-action",AUDIT_ACTOR:"audit-actor",AUDIT_TIME:"audit-time",AUDIT_HEADING:"audit-heading",AUDIT_RESOLUTIONS:"audit-resolutions",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",SCREENSHOT_PENDING:"screenshot-pending",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",TOOLBAR_VISIBILITY:"toolbar-visibility",TOOLBAR_EYE_BTN:"toolbar-eye-btn",MARKERS_HIDDEN:"markers-hidden",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_START:"inbox-menu--start",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",REACTION_BAR:"reaction-bar",REACTION_PILL:"reaction-pill",REACTION_PILL_MINE:"reaction-pill--mine",REACTION_PILL_EMOJI:"reaction-pill-emoji",REACTION_PILL_COUNT:"reaction-pill-count",REACTION_ADD:"reaction-add",REACTION_TRIGGER:"reaction-trigger",REACTION_PALETTE:"reaction-palette",REACTION_PALETTE_ITEM:"reaction-palette-item",ACTIONS_GROUP:"actions-group",ACTIONS_GROUP_END:"actions-group--end"},Pt=[n.COMMENT_CURSOR],We="helldots-markers-hidden",x={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"},k=28,le=5,S=["open","in_progress","in_review","resolved"],F={open:"#D1D1D6",in_progress:"#FF9F0A",in_review:"#2E90FA",resolved:"#30D158"},R=["bug","suggestion","question","improvement"],G={bug:"#FF453A",suggestion:"#BF5AF2",question:"#64D2FF",improvement:"#5E5CE6"},A=["high","medium","low"],z={high:"#FF453A",medium:"#FF9F0A",low:"#8E8E93"},ce=["\u{1F44D}","\u{1F44E}","\u2764\uFE0F","\u{1F389}","\u{1F440}","\u{1F680}"],$t={CONTAINER:'section, div[class*="container"], div[class*="content"]'},L={CIRCLE:9997,TOOLTIP:1e4,TOOLBAR:9998,COMMENT_BOX:9999,LIGHTBOX:10001,CONFIRM:10002},Ht='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>',Xt="2 2";var Ce=class{constructor({host:e,autoScreenshot:t,embedCrossOriginFonts:o=!1,fastCapture:s=!1,skipIframeContent:r=!1,captureTimeout:a,onRegionCaptured:l,onRegionPending:c,onPlace:d,onError:p}){this.host=e,this.autoScreenshot=t,this.embedCrossOriginFonts=o,this.fastCapture=s,this.skipIframeContent=r,this.captureTimeout=a,this.onRegionCaptured=l,this.onRegionPending=c,this.onPlace=d,this.onError=p,this.pendingCapture=null,this.pendingRegion=null,this._regionToken=null,this._dragStart=null,this._isDragging=!1,this._selectionRect=null,this._boundDragMove=h=>this.onDragMove(h),this._boundDragEnd=h=>this.onDragEnd(h)}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,o=e.clientY-this._dragStart.y;if(!this._isDragging&&Math.hypot(t,o)<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(o);this._selectionRect||(this._selectionRect=document.createElement("div"),this._selectionRect.className=n.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),o=Math.min(this._dragStart.y,e.clientY),s=Math.abs(e.clientX-this._dragStart.x),r=Math.abs(e.clientY-this._dragStart.y);this._selectionRect?.remove(),this._selectionRect=null;let a=s>10&&r>10?{left:t,top:o,width:s,height:r}:void 0;a&&this.startRegionCapture(a),await this.onPlace(t+s/2,o+r/2,a)}else await this.onPlace(this._dragStart.x,this._dragStart.y);this._isDragging=!1,this._dragStart=null}startRegionCapture(e){let t={};this._regionToken=t;let o=()=>this._regionToken===t,s=Ye({scale:1,embedCrossOriginFonts:this.embedCrossOriginFonts,fastCapture:this.fastCapture,skipIframeContent:this.skipIframeContent,captureTimeout:this.captureTimeout});this.autoScreenshot&&(this.pendingCapture=s.then(({canvas:r,scale:a})=>o()?je(r,{sourceScale:a}):null).catch(()=>null)),this.onRegionPending?.(!0),this.pendingRegion=s.then(({canvas:r,scale:a})=>{if(!o())return;let l=kt(r,e,{sourceScale:a});l&&this.onRegionCaptured(l)}).catch(r=>{console.warn("HellDots: screenshot capture failed:",r),this.onError?.(r)}).finally(()=>{o()&&this.onRegionPending?.(!1)})}armClickCapture(){!this.autoScreenshot||this.pendingCapture||(this.pendingCapture=Ye({scale:Ve,embedCrossOriginFonts:this.embedCrossOriginFonts,fastCapture:this.fastCapture,skipIframeContent:this.skipIframeContent,captureTimeout:this.captureTimeout}).then(({canvas:e,scale:t})=>je(e,{sourceScale:t})).catch(e=>(console.warn("HellDots: automatic screenshot failed",e),this.onError?.(e),null)))}async consumePending(){return await this.pendingRegion,this.pendingCapture?await this.pendingCapture:null}clearPending(){this.pendingCapture=null,this.pendingRegion=null,this._regionToken=null}destroy(){document.removeEventListener("mousemove",this._boundDragMove),document.removeEventListener("mouseup",this._boundDragEnd),this._selectionRect?.remove(),this._selectionRect=null,this.pendingCapture=null,this.pendingRegion=null,this._regionToken=null,this._dragStart=null,this._isDragging=!1}};var ni=[{name:"Edge",re:/Edg\/([\d.]+)/},{name:"Chrome",re:/Chrome\/([\d.]+)/},{name:"Firefox",re:/Firefox\/([\d.]+)/},{name:"Safari",re:/Version\/([\d.]+).*Safari/}],ri=[{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/}],si={name:"unknown",version:""},ai=i=>/not[\W_]*a[\W_]*brand/i.test(i),Ut=(i,e)=>{for(let{name:t,re:o}of i){let s=e.match(o);if(s)return{name:t,version:(s[1]||"").replace(/_/g,".")}}return{...si}};function Ft(i=window){let e=i.navigator||{},t=e.userAgent||"",o=e.userAgentData,s=Ut(ni,t),r=o?.brands?.find(l=>!ai(l.brand));r&&(s={name:r.brand,version:r.version||""});let a=Ut(ri,t);return o?.platform&&(a.name=o.platform),{version:1,url:i.location?.href||"",viewport:{width:i.innerWidth,height:i.innerHeight},screen:{width:i.screen?.width??0,height:i.screen?.height??0},devicePixelRatio:i.devicePixelRatio??1,userAgent:t,browser:s,os:a,language:e.language||""}}var Te=" scrollbar-width:thin;scrollbar-color:rgba(255,255,255,0.22) transparent;",li=(...i)=>i.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(""),Gt=()=>` :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;}#${x.TOOLBAR}{position:fixed;bottom:20px;left:50%;transform:translateX(-50%);z-index:${L.TOOLBAR};}.${n.TOOLBAR_ACTION_WRAPPER}{position:relative;}.${n.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;}.${n.TOOLBAR_ACTION_WRAPPER}:hover .${n.TOOLBAR_ACTION_TOOLTIP}{opacity:1;pointer-events:auto;transform:translateX(-50%) translateY(0);}.${n.TOOLBAR_TEXT}{font-size:13px;font-weight:500;letter-spacing:-0.01em;}.${n.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;}.${n.TOOLBAR_ACTIONS},.${n.TOOLBAR_VISIBILITY}{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);}.${n.TOOLBAR_VISIBILITY}{position:absolute;left:calc(100% + 5px);top:0;}.${n.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;}.${n.TOOLBAR_ACTION_WRAPPER}:first-child .${n.TOOLBAR_ACTION_BTN}{border-radius:12px 0 0 12px;}.${n.TOOLBAR_ACTION_WRAPPER}:last-child .${n.TOOLBAR_ACTION_BTN}{border-radius:0 12px 12px 0;}.${n.TOOLBAR_ACTION_WRAPPER}:only-child .${n.TOOLBAR_ACTION_BTN}{border-radius:12px;}.${n.TOOLBAR_ACTION_BTN}:hover{background:rgba(255,255,255,0.08);color:white;}.${n.TOOLBAR_COMMENT_BTN}.${n.ACTIVE}{color:#2E90FA;background:rgba(46,144,250,0.1);}#${x.COMMENT_BOX}{position:fixed;background:#1C1C1E;border-radius:12px;box-shadow:0 4px 20px rgba(0,0,0,0.4);padding:16px;z-index:${L.COMMENT_BOX};width:min(400px,calc(100vw - 24px));display:none;box-sizing:border-box;}#${x.COMMENT_BOX} .${n.COMMENT_INPUT_AREA}{display:flex;flex-direction:column;gap:0;}.${n.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);}.${n.CLASSIFY_ROW} .${n.INBOX_ACTION_BTN}{height:26px;border:1px solid rgba(255,255,255,0.12);border-radius:8px;}.${n.CLASSIFY_ROW} .${n.INBOX_ACTION_BTN}:hover{border-color:rgba(255,255,255,0.28);}#${x.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;}#${x.COMMENT_INPUT}::placeholder{color:rgba(255,255,255,0.5);}#${x.COMMENT_INPUT}:focus{outline:none;box-shadow:none;}.${n.COMMENT_ACTIONS_BAR}{display:flex;align-items:center;justify-content:space-between;padding-top:12px;}.${n.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;}.${n.ATTACH_IMAGE_BTN}:hover{background:rgba(255,255,255,0.1);color:rgba(255,255,255,0.8);}.${n.CIRCLE}{position:absolute;width:${k}px;height:${k}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:${L.CIRCLE};transform:translate(-50%,-50%);}.${n.CIRCLE}:hover{transform:translate(-50%,-50%) scale(1.2) !important;background:rgb(0,123,255);}.${n.CIRCLE}.${n.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);}.${n.CIRCLE}.${n.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);}.${n.MARKERS_HIDDEN} .${n.CIRCLE}{display:none !important;}.${n.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;${Te} z-index:${L.TOOLTIP};color:white;font-size:14px;line-height:1.5;box-sizing:border-box;}.${n.TOOLTIP} .${n.THREAD_BODY}{padding:8px 0;}.${n.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:${L.TOOLTIP};color:white;font-size:14px;line-height:1.5;box-sizing:border-box;}.${n.THREAD_POPOVER}>.${n.THREAD_HEADER},.${n.THREAD_POPOVER}>.${n.THREAD_ACTIONS_ROW},.${n.THREAD_POPOVER}>.${n.THREAD_INPUT_AREA}{flex:none;}.${n.THREAD_SCROLL}{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;${Te}}${li(`.${n.THREAD_SCROLL}`,`.${n.TOOLTIP}`,`.${n.INBOX_LIST}`,`.${n.INBOX_DETAIL}`,`.${n.EDITOR_INPUT}`)} .${n.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:${L.COMMENT_BOX};color:white;font-size:14px;line-height:1.5;box-sizing:border-box;overflow:hidden;}.${n.INBOX_PANEL}:focus,.${n.INBOX_PANEL}:focus-visible{outline:none;}@media (max-width:480px){.${n.INBOX_PANEL}{left:16px;width:auto;}}.${n.INBOX_HEADER},.${n.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;}.${n.INBOX_FILTER}-wrapper{position:relative;}.${n.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;}.${n.INBOX_FILTER}:hover{background:rgba(255,255,255,0.08);}.${n.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);}.${n.INBOX_FILTER_MENU_HEADER}{display:flex;align-items:baseline;justify-content:space-between;gap:12px;font-size:13px;font-weight:600;margin-bottom:12px;}.${n.INBOX_FILTER_CLEAR}{background:transparent;border:none;color:rgba(255,255,255,0.55);font-size:12px;font-weight:500;cursor:pointer;padding:0;}.${n.INBOX_FILTER_CLEAR}:hover:not(:disabled){color:white;}.${n.INBOX_FILTER_CLEAR}:disabled{opacity:0.35;cursor:default;}.${n.INBOX_FILTER_GROUP} + .${n.INBOX_FILTER_GROUP}{margin-top:14px;}.${n.INBOX_FILTER_SECTION}{font-size:11px;font-weight:600;color:rgba(255,255,255,0.45);margin-bottom:8px;}.${n.INBOX_FILTER_CHIPS}{display:flex;flex-wrap:wrap;gap:6px;}.${n.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;}.${n.INBOX_FILTER_CHIP}:hover{border-color:rgba(255,255,255,0.4);color:white;}.${n.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;}.${n.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;}.${n.INBOX_MENU_ITEM}:hover{background:rgba(255,255,255,0.08);}.${n.INBOX_CLOSE},.${n.INBOX_NAV_BTN},.${n.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;}.${n.INBOX_CLOSE}{font-size:20px;line-height:1;}.${n.INBOX_CLOSE}:hover,.${n.INBOX_NAV_BTN}:not(:disabled):hover,.${n.INBOX_BACK}:hover{background:rgba(255,255,255,0.08);color:white;}.${n.INBOX_NAV_BTN}:disabled{opacity:0.35;cursor:default;}.${n.INBOX_LIST},.${n.INBOX_DETAIL}{flex:1;overflow-y:auto;${Te} padding:12px;display:flex;flex-direction:column;gap:12px;}.${n.INBOX_CARD}{border:1px solid rgba(255,255,255,0.1);border-radius:10px;padding:12px;display:flex;flex-direction:column;gap:8px;}.${n.INBOX_LIST} .${n.INBOX_CARD}{cursor:pointer;}.${n.INBOX_LIST} .${n.INBOX_CARD}:hover{border-color:rgba(255,255,255,0.22);}.${n.INBOX_CARD}--resolved{border-color:rgba(48,209,88,0.4);opacity:0.75;}.${n.INBOX_LIST} .${n.INBOX_CARD}--resolved:hover{border-color:rgba(48,209,88,0.7);opacity:1;}.${n.INBOX_CARD}--resolved:has([aria-expanded="true"]){opacity:1;}.${n.INBOX_CARD_HEADER}{display:flex;align-items:center;justify-content:space-between;gap:8px;}.${n.INBOX_CARD_ACTIONS}{display:flex;align-items:center;justify-content:space-between;width:100%;gap:8px;}.${n.INBOX_DETAIL_HEADER} .${n.INBOX_CARD_ACTIONS}{justify-content:flex-end;gap:2px;}.${n.ACTIONS_GROUP}{display:flex;align-items:center;flex-wrap:wrap;gap:5px;}.${n.ACTIONS_GROUP_END}{flex-wrap:nowrap;gap:2px;}.${n.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;}.${n.INBOX_ACTION_BTN}:hover{background:rgba(255,255,255,0.08);color:white;}.${n.INBOX_ACTION_BTN_LABELED}{width:auto;padding:0 8px 0 6px;gap:5px;justify-content:flex-start;flex:none;}.${n.INBOX_ACTION_LABEL}{font-size:11px;line-height:1;white-space:nowrap;}.${n.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;}.${n.INBOX_MENU_ITEM} .${n.INBOX_STATUS_DOT}{width:9px;height:9px;border:none;margin-right:8px;vertical-align:baseline;}.${n.INBOX_MENU_ITEM}[aria-checked="true"]{background:rgba(255,255,255,0.08);}.${n.THREAD_ACTIONS_ROW}{display:flex;justify-content:flex-end;}.${n.THREAD_POPOVER}>.${n.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;}.${n.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);}.${n.INBOX_MENU}.${n.INBOX_MENU_UP}{top:auto;bottom:calc(100% + 4px);}.${n.INBOX_MENU}.${n.INBOX_MENU_START}{right:auto;left:0;}.${n.INBOX_CARD_TEXT}{white-space:pre-wrap;word-break:break-word;}.${n.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;}.${n.INBOX_BADGES}{display:flex;flex-wrap:wrap;gap:4px;}.${n.INBOX_CARD} .${n.INBOX_BADGES}{margin-top:6px;}.${n.TOOLTIP} .${n.INBOX_BADGES}{margin-bottom:4px;}.${n.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;}.${n.BADGE_STATUS},.${n.BADGE_TYPE},.${n.BADGE_PRIORITY}{font-weight:600;}.${n.BADGE_TAG}{opacity:0.75;}.${n.BADGE_DURATION}{opacity:0.75;border-style:dashed;}.${n.REACTION_BAR}{display:flex;align-items:center;flex-wrap:wrap;gap:6px;margin-top:2px;margin-bottom:12px;}.${n.REACTION_BAR}[hidden]{display:none;}.${n.REACTION_TRIGGER}{position:relative;display:inline-flex;}.${n.REACTION_PILL}{display:inline-flex;align-items:center;gap:5px;height:24px;padding:0 8px;border:1px solid rgba(255,255,255,0.18);border-radius:8px;background:transparent;color:#F2F2F7;font-family:inherit;font-size:12px;line-height:1;cursor:pointer;transition:background 0.12s ease,border-color 0.12s ease;}.${n.REACTION_PILL}:hover{background:rgba(255,255,255,0.08);}.${n.REACTION_PILL_MINE}{border-color:#2E90FA;background:rgba(46,144,250,0.16);}.${n.REACTION_PILL_MINE}:hover{background:rgba(46,144,250,0.24);}.${n.REACTION_PILL_EMOJI}{font-family:"Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif;font-size:13px;}.${n.REACTION_PILL_COUNT}{font-variant-numeric:tabular-nums;}.${n.REACTION_ADD}{display:inline-flex;align-items:center;justify-content:center;width:28px;height:24px;padding:0;border:1px solid rgba(255,255,255,0.18);border-radius:8px;background:transparent;color:#8E8E93;cursor:pointer;}.${n.REACTION_ADD}:hover{color:#F2F2F7;border-color:rgba(255,255,255,0.35);}.${n.REACTION_PALETTE}{position:absolute;top:calc(100% + 4px);left:0;white-space:nowrap;background:#2C2C2E;border:1px solid rgba(255,255,255,0.1);border-radius:10px;padding:4px;z-index:1;box-shadow:0 4px 16px rgba(0,0,0,0.4);}.${n.ACTIONS_GROUP_END} .${n.REACTION_PALETTE},.${n.THREAD_REPLY_ACTIONS} .${n.REACTION_PALETTE}{left:auto;right:0;}.${n.REACTION_PALETTE}.${n.INBOX_MENU_UP}{top:auto;bottom:calc(100% + 4px);}.${n.REACTION_PALETTE_ITEM}{display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;padding:0;border:0;border-radius:6px;background:transparent;font-family:"Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif;font-size:15px;cursor:pointer;}.${n.REACTION_PALETTE_ITEM}:hover{background:rgba(255,255,255,0.12);}.${n.CONTEXT_BLOCK}{display:flex;flex-direction:column;padding:10px 12px;border-top:1px solid rgba(255,255,255,0.08);font-size:11px;}.${n.CONTEXT_BODY}{display:flex;flex-direction:column;gap:4px;}.${n.CONTEXT_TITLE}{font-size:11px;font-weight:600;color:rgba(255,255,255,0.45);padding-bottom:4px;}.${n.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;}.${n.CONTEXT_TOGGLE}:hover{color:rgba(255,255,255,0.75);}.${n.CONTEXT_TOGGLE} svg{flex:none;transition:transform 0.15s ease;}.${n.CONTEXT_TOGGLE}[aria-expanded="true"] svg{transform:rotate(180deg);}.${n.CONTEXT_TOGGLE}[aria-expanded="true"] + .${n.CONTEXT_BODY}{padding-top:8px;}.${n.CONTEXT_BLOCK} img{width:100%;border-radius:6px;margin-bottom:6px;cursor:zoom-in;}.${n.CONTEXT_SCREENSHOT_CAPTION}{opacity:0.75;}.${n.CONTEXT_ROW}{display:flex;justify-content:space-between;gap:12px;opacity:0.75;}.${n.CONTEXT_ROW} span:last-child{text-align:right;word-break:break-all;}.${n.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;}.${n.INBOX_CARD_REPLY_LINK}:hover{color:white;}.${n.INBOX_REPLIES}{display:flex;flex-direction:column;gap:10px;padding:0 4px;}.${n.INBOX_REPLIES}:empty{display:none;}.${n.TOOLTIP_REPLY_COUNT}{font-size:12px;color:rgba(255,255,255,0.45);padding-top:4px;}.${n.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;}.${n.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;}.${n.INBOX_EMPTY_TITLE}{color:white;font-size:14px;font-weight:600;}.${n.INBOX_EMPTY_TEXT}{font-size:13px;line-height:1.5;max-width:30ch;}.${n.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;}.${n.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;}.${n.INBOX_EMPTY_ACTION}:hover{background:rgba(255,255,255,0.08);border-color:rgba(255,255,255,0.35);}.${n.THREAD_HEADER}{display:flex;justify-content:space-between;align-items:center;padding:0;}.${n.THREAD_META}{display:flex;align-items:center;gap:6px;flex:1;min-width:0;}.${n.THREAD_AUTHOR}{font-weight:600;font-size:13px;display:flex;min-width:0;max-width:280px;}.${n.THREAD_AUTHOR_NAME}{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.${n.THREAD_AUTHOR}[data-hd-tooltip]::after{white-space:normal;max-width:240px;width:max-content;text-align:center;}.${n.THREAD_TIME}{font-size:12px;color:rgba(255,255,255,0.5);cursor:default;position:relative;flex:none;}.${n.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;}.${n.THREAD_TIME}:hover::after{opacity:1;}.${n.THREAD_BODY}{padding:8px 0;white-space:pre-wrap;word-break:break-word;}.${n.THREAD_REPLIES}{padding:0;}.${n.THREAD_REPLIES}:empty{display:none;}.${n.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:14px;color:rgba(255,255,255,0.85);}.${n.THREAD_REPLY} .${n.THREAD_META}{margin-bottom:2px;}.${n.THREAD_REPLY_ACTIONS}{margin-left:auto;flex:none;}.${n.THREAD_REPLY} .${n.SCREENSHOT_IMG}{width:144px;height:100px;object-fit:cover;border-radius:8px;margin-top:4px;cursor:pointer;display:block;}.${n.THREAD_INPUT_AREA}{display:flex;flex-direction:column;gap:0;padding:12px 0 0;border-top:1px solid rgba(255,255,255,0.1);}.${n.THREAD_INPUT}{width:100%;background:transparent;border:none;padding:0;color:white;font-size:14px;font-family:inherit;outline:none;box-sizing:border-box;}.${n.THREAD_INPUT}::placeholder{color:rgba(255,255,255,0.5);}.${n.THREAD_INPUT}:focus{outline:none;box-shadow:none;}.${n.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;}.${n.THREAD_SUBMIT}:hover{background:rgba(46,144,250,0.15);color:#1570D6;}.${n.CLOSE_TOOLTIP}{background:none;border:none;font-size:18px;cursor:pointer;color:rgba(255,255,255,0.5);line-height:1;}.${n.CLOSE_TOOLTIP}:hover{color:white;}.${n.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);}}.${n.COMMENT_OVERLAY}{position:fixed;top:0;left:0;right:0;bottom:0;background:transparent;pointer-events:none;z-index:${L.TOOLBAR-1};}.${n.COMMENT_OVERLAY}.${n.ACTIVE}{pointer-events:auto;background:rgba(0,0,0,0.1);}.${n.SELECTION_RECT}{position:fixed;border:2px solid #2E90FA;background:rgba(46,144,250,0.1);pointer-events:none;z-index:${L.TOOLTIP};box-sizing:border-box;}.${n.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;}.${n.SCREENSHOTS_CONTAINER}::-webkit-scrollbar{display:none;}.${n.SCREENSHOTS_CONTAINER}.${n.ACTIVE}{display:flex;}.${n.SCREENSHOT_ITEM}{position:relative;flex-shrink:0;}.${n.SCREENSHOT_PENDING}{min-width:50px;height:50px;padding:0 8px;box-sizing:border-box;display:flex;align-items:center;justify-content:center;text-align:center;border:1px dashed rgba(255,255,255,0.35);border-radius:8px;font-size:10px;line-height:1.2;color:rgba(255,255,255,0.7);white-space:nowrap;}.${n.SCREENSHOT_ITEM} .${n.SCREENSHOT_IMG}{width:50px;height:50px;object-fit:cover;border-radius:8px;cursor:pointer;display:block;margin:0;}.${n.SCREENSHOT_ITEM} .${n.SCREENSHOT_IMG}:hover{opacity:0.85;}.${n.SCREENSHOT_ITEM} .${n.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;}.${n.SCREENSHOT_ITEM}:hover .${n.SCREENSHOT_REMOVE}{display:flex;}.${n.SCREENSHOT_ITEM} .${n.SCREENSHOT_REMOVE}:hover{background:rgba(0,0,0,0.9);}.${n.TOOLTIP}>.${n.SCREENSHOTS_CONTAINER} .${n.SCREENSHOT_ITEM} .${n.SCREENSHOT_IMG},.${n.THREAD_SCROLL}>.${n.SCREENSHOTS_CONTAINER} .${n.SCREENSHOT_ITEM} .${n.SCREENSHOT_IMG},.${n.THREAD_REPLY} .${n.SCREENSHOT_ITEM} .${n.SCREENSHOT_IMG}{width:144px;height:100px;}.${n.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;}.${n.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;}.${n.CONFIRM_TITLE}{margin:0 0 8px;font-size:15px;font-weight:600;}.${n.CONFIRM_MESSAGE}{margin:0 0 20px;font-size:13px;color:rgba(255,255,255,0.65);}.${n.CONFIRM_ACTIONS}{display:flex;justify-content:flex-end;gap:8px;}.${n.CONFIRM_CANCEL},.${n.CONFIRM_ACCEPT}{padding:7px 14px;border:1px solid transparent;border-radius:8px;font-size:13px;font-weight:600;cursor:pointer;}.${n.CONFIRM_CANCEL}:focus-visible,.${n.CONFIRM_ACCEPT}:focus-visible{outline:2px solid #2E90FA;outline-offset:2px;}.${n.CONFIRM_CANCEL}{background:rgba(255,255,255,0.08);border-color:rgba(255,255,255,0.12);color:white;}.${n.CONFIRM_CANCEL}:hover{background:rgba(255,255,255,0.14);}.${n.CONFIRM_ACCEPT}{background:#FF453A;color:white;}.${n.CONFIRM_ACCEPT}:hover{background:#FF6961;}.${n.LIGHTBOX}{position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,0.92);z-index:${L.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;}}.${n.LIGHTBOX_IMG}{max-width:90vw;max-height:90vh;object-fit:contain;border-radius:8px;}.${n.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;}.${n.LIGHTBOX_CLOSE}:hover{background:rgba(255,255,255,0.3);}.${n.EDITOR}{display:flex;flex-direction:column;gap:8px;margin:4px 0 2px;}.${n.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;${Te}}.${n.EDITOR_INPUT}:focus{border-color:rgba(46,144,250,0.7);}.${n.EDITOR_ACTIONS}{display:flex;justify-content:flex-end;gap:8px;}.${n.EDITOR_CANCEL},.${n.EDITOR_SAVE}{padding:5px 12px;border:1px solid transparent;border-radius:7px;font-size:13px;font-weight:600;font-family:inherit;cursor:pointer;}.${n.EDITOR_CANCEL}{background:rgba(255,255,255,0.08);border-color:rgba(255,255,255,0.12);color:white;}.${n.EDITOR_CANCEL}:hover{background:rgba(255,255,255,0.14);}.${n.EDITOR_SAVE}{background:#2E90FA;color:white;}.${n.EDITOR_SAVE}:hover:not(:disabled){background:#57A6FB;}.${n.EDITOR_SAVE}:disabled{background:rgba(255,255,255,0.10);color:rgba(255,255,255,0.4);cursor:not-allowed;}.${n.THREAD_EDITED}{font-size:12px;color:rgba(255,255,255,0.4);cursor:default;position:relative;flex:none;}.${n.THREAD_EDITED}::before{content:"\xB7";margin-right:4px;}.${n.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;}.${n.THREAD_EDITED}:hover::after{opacity:1;}.${n.AUDIT_BLOCK}{margin-top:10px;border-top:1px solid rgba(255,255,255,0.08);padding-top:8px;}.${n.AUDIT_TOGGLE}{display:flex;align-items:center;gap:6px;width:100%;padding:4px 0;border:0;background:none;color:rgba(255,255,255,0.55);font-family:inherit;font-size:12px;text-align:left;cursor:pointer;}.${n.AUDIT_TOGGLE}:hover{color:rgba(255,255,255,0.85);}.${n.AUDIT_TOGGLE}::before{content:"";width:0;height:0;border-left:4px solid currentColor;border-top:4px solid transparent;border-bottom:4px solid transparent;transition:transform 0.15s ease;}.${n.AUDIT_TOGGLE}[aria-expanded="true"]::before{transform:rotate(90deg);}.${n.AUDIT_BODY}{padding:4px 0 2px;}.${n.AUDIT_LIST}{margin:0;padding:0;list-style:none;display:flex;flex-direction:column;gap:7px;}.${n.AUDIT_ROW}{display:grid;grid-template-columns:1fr auto;align-items:baseline;column-gap:8px;font-size:12px;line-height:1.4;}.${n.AUDIT_ACTION}{grid-column:1;color:rgba(255,255,255,0.78);}.${n.AUDIT_ACTOR}{grid-column:1;color:rgba(255,255,255,0.48);font-size:11px;}.${n.AUDIT_TIME}{grid-row:1;grid-column:2;color:rgba(255,255,255,0.42);font-size:11px;white-space:nowrap;}.${n.AUDIT_HEADING}{margin:0 0 6px;color:rgba(255,255,255,0.5);font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:0.05em;}.${n.AUDIT_RESOLUTIONS}{margin-top:10px;padding-top:8px;border-top:1px solid rgba(255,255,255,0.06);}.${n.INBOX_HEADER_ACTIONS}{display:flex;align-items:center;gap:12px;}.${n.INBOX_METRICS_BTN}{padding:5px 10px;border-radius:7px;border:1px solid rgba(255,255,255,0.12);background:rgba(255,255,255,0.06);color:rgba(255,255,255,0.75);font-family:inherit;font-size:12px;white-space:nowrap;cursor:pointer;}.${n.INBOX_METRICS_BTN}:hover{background:rgba(255,255,255,0.11);color:#fff;}.${n.METRICS_VIEW}{flex:1;overflow-y:auto;padding:14px 16px;display:flex;flex-direction:column;gap:16px;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,0.22) transparent;}.${n.METRICS_VIEW}::-webkit-scrollbar{width:8px;}.${n.METRICS_VIEW}::-webkit-scrollbar-track{background:transparent;}.${n.METRICS_VIEW}::-webkit-scrollbar-thumb{background:rgba(255,255,255,0.22);border-radius:4px;}.${n.METRICS_TILES}{display:grid;grid-template-columns:repeat(auto-fit,minmax(96px,1fr));gap:8px;}.${n.METRICS_TILE}{display:flex;flex-direction:column;gap:2px;padding:10px;border-radius:9px;background:rgba(255,255,255,0.05);border:1px solid rgba(255,255,255,0.08);}.${n.METRICS_TILE_VALUE}{color:#fff;font-size:18px;font-weight:600;line-height:1.1;}.${n.METRICS_TILE_LABEL}{color:rgba(255,255,255,0.5);font-size:11px;line-height:1.3;}.${n.METRICS_GROUP}{display:flex;flex-direction:column;gap:7px;}.${n.METRICS_HEADING}{margin:0;color:rgba(255,255,255,0.5);font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:0.05em;}.${n.METRICS_ROW}{display:grid;grid-template-columns:76px 1fr 26px;align-items:center;gap:8px;font-size:12px;}.${n.METRICS_ROW_LABEL}{color:rgba(255,255,255,0.72);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.${n.METRICS_TRACK}{height:8px;border-radius:4px;background:rgba(255,255,255,0.07);overflow:hidden;}.${n.METRICS_BAR}{height:100%;border-radius:4px;background:rgba(255,255,255,0.42);min-width:2px;}.${n.METRICS_ROW_COUNT}{color:rgba(255,255,255,0.85);font-variant-numeric:tabular-nums;text-align:right;}.${n.METRICS_CHART}{width:100%;height:96px;display:block;fill:rgba(255,255,255,0.42);}.${n.METRICS_AXIS}{display:flex;justify-content:space-between;color:rgba(255,255,255,0.42);font-size:10px;font-variant-numeric:tabular-nums;}.${n.METRICS_EXPORTS}{display:flex;flex-wrap:wrap;gap:6px;padding-top:4px;border-top:1px solid rgba(255,255,255,0.08);}.${n.METRICS_EXPORT_BTN}{padding:6px 10px;border-radius:7px;border:1px solid rgba(255,255,255,0.12);background:rgba(255,255,255,0.06);color:rgba(255,255,255,0.78);font-family:inherit;font-size:12px;cursor:pointer;}.${n.METRICS_EXPORT_BTN}:hover{background:rgba(255,255,255,0.12);color:#fff;}.${n.METRICS_EMPTY}{margin:0;padding:24px 0;color:rgba(255,255,255,0.5);font-size:13px;text-align:center;}.${n.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;}`,zt=()=>` .${n.COMMENT_CURSOR},.${n.COMMENT_CURSOR} *{cursor:url('${Ht}') ${Xt},auto !important;}`,Vt=()=>' .report{margin:0;padding:24px;background:#fff;color:#111;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;font-size:12px;line-height:1.45;}.report-title{margin:0 0 4px;font-size:20px;}.report-meta{margin:0 0 2px;color:#555;font-size:11px;}.report-table{width:100%;margin-top:18px;border-collapse:collapse;break-inside:avoid;}.report-table caption{margin-bottom:4px;font-size:12px;font-weight:600;text-align:left;}.report-table th,.report-table td{padding:5px 8px;border:1px solid #d5d5d5;text-align:left;font-weight:400;}.report-table thead th{background:#f2f2f2;font-weight:600;}.report-table td{text-align:right;font-variant-numeric:tabular-nums;}@page{margin:14mm;}';function de(i,e,t){let o=ci(e,i);if(o)return i.adoptedStyleSheets=[...i.adoptedStyleSheets??[],o],()=>{i.adoptedStyleSheets=(i.adoptedStyleSheets??[]).filter(a=>a!==o)};let s=i.head??i;s.querySelector?.(`#${t}`)?.remove();let r=document.createElement("style");return r.id=t,r.textContent=e,s.appendChild(r),()=>r.remove()}function ci(i,e){let o=(e.defaultView??e.ownerDocument?.defaultView??globalThis).CSSStyleSheet;if(typeof o!="function"||!("adoptedStyleSheets"in e))return null;try{let s=new o;return s.replaceSync(i),s}catch{return null}}var H={metricsTitle:"Metrics",metricsOpen:"Metrics",metricsTotal:"Total comments",metricsAverageResolution:"Average resolution",metricsMedianResolution:"Median resolution",metricsReopened:"Reopened",metricsByStatus:"By status",metricsByType:"By type",metricsByPriority:"By priority",metricsOverTime:"Comments per day",metricsEmpty:"No comments to measure yet",metricsCategory:"Category",metricsCount:"Count",metricsDate:"Date",metricsExportComments:"Comments (CSV)",metricsExportMetrics:"Metrics (CSV)",metricsPrint:"Print / Save as PDF",metricsExportLabel:"Export",metricsGeneratedTemplate:"Generated {n}",metricsScope:"Scope",auditToggleTemplate:"History ({n})",auditTrailLabel:"Activity history",auditCreated:"Created the comment",auditEdited:"Edited the text",auditTagsChanged:"Updated the tags",auditPreviousResolutions:"Previous resolutions",auditResolvedInTemplate:"Resolved in {n}",commentAriaLabelPrefix:"Comment: ",anonymous:"Anonymous",justNow:"Just now",minutesAgoTemplate:"{n}m",hoursAgoTemplate:"{n}h",daysAgoTemplate:"{n}d",toolbarComment:"Comment",toolbarInbox:"Inbox",toolbarHideComments:"Hide comments",toolbarShowComments:"Show comments",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",capturingScreenshot:"Capturing\u2026",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",statusInReview:"In review",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",reactionsLabel:"Reactions",addReaction:"Add reaction",reactionToggleOn:"Add your reaction",reactionToggleOff:"Remove your reaction",reactionPickerLabel:"Choose a reaction"};var Yt={metricsTitle:"M\xE9tricas",metricsOpen:"M\xE9tricas",metricsTotal:"Comentarios totales",metricsAverageResolution:"Resoluci\xF3n media",metricsMedianResolution:"Resoluci\xF3n mediana",metricsReopened:"Reabiertos",metricsByStatus:"Por estado",metricsByType:"Por tipo",metricsByPriority:"Por prioridad",metricsOverTime:"Comentarios por d\xEDa",metricsEmpty:"A\xFAn no hay comentarios que medir",metricsCategory:"Categor\xEDa",metricsCount:"Cantidad",metricsDate:"Fecha",metricsExportComments:"Comentarios (CSV)",metricsExportMetrics:"M\xE9tricas (CSV)",metricsPrint:"Imprimir / Guardar como PDF",metricsExportLabel:"Exportar",metricsGeneratedTemplate:"Generado {n}",metricsScope:"Alcance",auditToggleTemplate:"Historial ({n})",auditTrailLabel:"Historial de actividad",auditCreated:"Cre\xF3 el comentario",auditEdited:"Edit\xF3 el texto",auditTagsChanged:"Actualiz\xF3 las etiquetas",auditPreviousResolutions:"Resoluciones anteriores",auditResolvedInTemplate:"Resuelto en {n}",commentAriaLabelPrefix:"Comentario: ",anonymous:"An\xF3nimo",justNow:"Justo ahora",minutesAgoTemplate:"{n}m",hoursAgoTemplate:"{n}h",daysAgoTemplate:"{n}d",toolbarComment:"Comentar",toolbarInbox:"Bandeja",toolbarHideComments:"Ocultar comentarios",toolbarShowComments:"Mostrar comentarios",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",capturingScreenshot:"Capturando\u2026",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",statusInReview:"En revisi\xF3n",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",reactionsLabel:"Reacciones",addReaction:"A\xF1adir reacci\xF3n",reactionToggleOn:"A\xF1adir tu reacci\xF3n",reactionToggleOff:"Quitar tu reacci\xF3n",reactionPickerLabel:"Elegir una reacci\xF3n"};var xe={en:H,es:Yt},pe="en";function jt(){let i=(navigator.language||pe).slice(0,2).toLowerCase();return i in xe?i:pe}function Wt(i){let e=xe[i];return!e||i===pe?xe[pe]:{...xe[pe],...e}}function I(i,e){return i.replace("{n}",String(e))}var di=6e4;function X(i,e){if(!Number.isFinite(i)||i<0)return"";let t=Math.floor(i/di);if(t<1)return e.durationLessThanMinute;if(t<60)return I(e.minutesAgoTemplate,t);let o=Math.floor(t/60);if(o<24){let l=t%60,c=I(e.hoursAgoTemplate,o);return l?`${c} ${I(e.minutesAgoTemplate,l)}`:c}let s=Math.floor(o/24),r=o%24,a=I(e.daysAgoTemplate,s);return r?`${a} ${I(e.hoursAgoTemplate,r)}`:a}var Ke=64,pi=3,hi=5,ui=.6,mi=.7,fi=/^(css|sc|jsx|emotion)-/i,gi=/^data-(reactid|react-|v-|svelte-)/,Ei=["id","name","role","aria-label"],_i=["data-testid","name","aria-label"],qe=i=>typeof CSS<"u"&&CSS.escape?CSS.escape(i):String(i).replace(/[^a-zA-Z0-9_-]/g,"\\$&"),bi=i=>String(i).replace(/["\\]/g,"\\$&"),he=(i,e)=>{try{return e.querySelectorAll(i).length===1}catch{return!1}},Zt=i=>(i||"").replace(/\s+/g," ").trim().slice(0,Ke),Ci=i=>Pt.includes(i)||fi.test(i)?!1:!i.split(/[-_]/).some(e=>e.length>=5&&/\d/.test(e)),Ti=i=>[...i.classList].filter(Ci),xi=i=>{let e={};for(let{name:t,value:o}of i.attributes)(Ei.includes(t)||t.startsWith("data-")&&!gi.test(t))&&o&&(e[t]=o.slice(0,Ke));return e},Ze=i=>{let e=i.parentElement;if(!e)return{index:0,count:1};let t=[...e.children].filter(o=>o.tagName===i.tagName);return{index:t.indexOf(i),count:t.length}},yi=(i,e)=>{if(!i.id)return null;let t=`#${qe(i.id)}`;return he(t,e)?t:null},Oi=(i,e)=>{let t=i.tagName.toLowerCase();for(let o of _i){let s=i.getAttribute(o);if(!s)continue;let r=`${t}[${o}="${bi(s)}"]`;if(he(r,e))return r}return null},Ii=(i,e)=>{let t=[],o=i;for(let s=0;s<pi&&o;s++){let r=Ti(o),a=o.tagName.toLowerCase();if(t.unshift(r.length?`${a}.${r.map(qe).join(".")}`:a),s===0&&!r.length)return null;let l=t.join(" > ");if(he(l,e))return l;o=o.parentElement}return null},Ri=(i,e)=>{if(i===e.body)return"body";let t=[],o=i;for(let r=0;r<hi&&o;r++){if(o===e.body){t.unshift("body");break}if(o.id){let l=[`#${qe(o.id)}`,...t].join(" > ");if(he(l,e))return l}let{index:a}=Ze(o);t.unshift(`${o.tagName.toLowerCase()}:nth-of-type(${a+1})`),o=o.parentElement}let s=t.join(" > ");return he(s,e)?s:null},Jt=(i,e)=>yi(i,e)||Oi(i,e)||Ii(i,e)||Ri(i,e);function Qt(i){return Jt(i,i.ownerDocument)}function eo(i,e,t){let o=i.ownerDocument,{index:s,count:r}=Ze(i);return{version:1,selector:Jt(i,o),fingerprint:{tagName:i.tagName,textSnippet:Zt(i.textContent),attributes:xi(i),siblingIndex:s,siblingCount:r},relativeX:e,relativeY:t}}var Ai=(i,e)=>{if(!i&&!e)return 1;if(!i||!e)return 0;if(i===e)return 1;if(i.startsWith(e)||e.startsWith(i))return .8;let t=new Set(i.split(" ")),o=new Set(e.split(" ")),s=0;for(let r of t)o.has(r)&&s++;return 2*s/(t.size+o.size)},Si=(i,e)=>{let t=Object.keys(e);if(!t.length)return 1;let o=0;for(let s of t)(i.getAttribute(s)||"").slice(0,Ke)===e[s]&&o++;return o/t.length},Kt=(i,e)=>{let{index:t,count:o}=Ze(i),s=Math.abs(t-e.siblingIndex),r=Math.max(e.siblingCount,o,1);return Math.max(0,1-s/r)},Ni=(i,e)=>{if(i.tagName!==e.tagName)return 0;let t=!!e.textSnippet,o=Object.keys(e.attributes||{}).length>0,s=.5,r=.3,a=.2;return o?t||(r+=s,s=0):(s+=r,r=0),!t&&!o?Kt(i,e):s*Ai(Zt(i.textContent),e.textSnippet)+r*Si(i,e.attributes||{})+a*Kt(i,e)},qt=(i,e)=>{let t=null;for(let o of i){let s=Ni(o,e);(!t||s>t.confidence||s===t.confidence&&t.element.contains(o))&&(t={element:o,confidence:s})}return t};function Je(i,e=document){if(i?.version!=null&&i.version>1)return null;let t=i?.fingerprint;if(!t||!t.tagName)return null;if(i.selector){let a=[];try{a=[...e.querySelectorAll(i.selector)]}catch{}let l=qt(a,t);if(l&&l.confidence>=ui)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=qt(s,t);return r&&r.confidence>=mi?r:null}var ye="helldots-comments",Oe="helldots-pending-detail";function Qe(){try{let i=localStorage.getItem(ye);if(!i)return[];let e=JSON.parse(i);return Array.isArray(e)?e:[]}catch(i){return console.warn("HellDots: could not read stored comments",i),[]}}function to(i){try{return localStorage.setItem(ye,JSON.stringify(i)),!0}catch{return!1}}function Ie(i){if(to(i))return!0;let e=i.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=[...i],o=0;for(let{index:s}of e)if(t[s]={...t[s],contextScreenshot:null},o++,to(t))return console.warn(`HellDots: localStorage quota exceeded \u2014 dropped the automatic context screenshot from the ${o} 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 ${o} automatic context screenshot(s); storage quota exceeded`),!1}function et(i,e,t){let o=new Set(e.map(r=>String(r.id)));return[...i.filter(r=>!o.has(String(r.id))&&r.page!==t),...e]}var oo="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var io=(i=21)=>{let e="",t=crypto.getRandomValues(new Uint8Array(i|=0));for(;i--;)e+=oo[t[i]&63];return e};var tt=()=>io(),P=i=>typeof i=="string"?i.trim():"",y=(i,e)=>String(i)===String(e);var Z=new Set,J=null,Re=null,vi=i=>[...i.querySelectorAll('[role="menuitem"], [role="menuitemradio"]')],no=4,wi=i=>{for(let e=i.parentElement;e;e=e.parentElement){let{overflowX:t,overflowY:o}=getComputedStyle(e);if(t!=="visible"||o!=="visible")return e.getBoundingClientRect()}return null},Li=(i,e)=>{e.classList.remove(n.INBOX_MENU_UP),e.classList.remove(n.INBOX_MENU_START);let t=wi(e),o=Math.min(t?.bottom??1/0,window.innerHeight),s=Math.max(t?.top??0,0),r=Math.max(t?.left??0,0),a=Math.min(t?.right??1/0,window.innerWidth),{height:l,width:c,left:d}=e.getBoundingClientRect(),p=i.getBoundingClientRect(),h=p.bottom+no+l,u=p.top-no-l;h>o&&u>=s&&e.classList.add(n.INBOX_MENU_UP),d<r&&p.left+c<=a&&e.classList.add(n.INBOX_MENU_START)},ro=(i,e)=>(typeof e.composedPath=="function"?e.composedPath():[]).includes(i)||i.contains(e.target),Mi=()=>{J||(J=i=>{for(let e of[...Z])ro(e.menu,i)||ro(e.button,i)||e.close()},document.addEventListener("mousedown",J,!0),Re=i=>{let e=[...Z].pop();if(e){if(i.key==="Escape"){i.preventDefault(),i.stopPropagation(),e.close(),e.button.focus();return}if(["ArrowDown","ArrowUp","Home","End"].includes(i.key)){let t=vi(e.menu);if(t.length===0)return;i.preventDefault(),i.stopPropagation();let o=e.menu.getRootNode(),s=t.indexOf(o.activeElement),r;if(i.key==="Home")r=0;else if(i.key==="End")r=t.length-1;else if(s===-1)r=i.key==="ArrowDown"?0:t.length-1;else{let a=i.key==="ArrowDown"?1:-1;r=(s+a+t.length)%t.length}t[r].focus()}}},document.addEventListener("keydown",Re,!0))},Bi=()=>{J&&(document.removeEventListener("mousedown",J,!0),J=null,document.removeEventListener("keydown",Re,!0),Re=null)},Ae=()=>{for(let i of[...Z])i.close()},V=(i,e)=>{let t={button:i,menu:e,close:()=>{e.style.display="none",i.setAttribute("aria-expanded","false"),Z.delete(t),Z.size===0&&Bi()}},o=()=>{Ae(),e.style.display="block",Li(i,e),i.setAttribute("aria-expanded","true"),Z.add(t),Mi()},s=()=>e.style.display!=="none";return e.style.display="none",i.setAttribute("aria-expanded","false"),i.addEventListener("click",r=>{r.stopPropagation();let a=s();Ae(),a||o()}),{open:o,close:t.close,isOpen:s}};var so=(i,e)=>P(i?.id)||i?.name||e.anonymous,ot=i=>{let e=i?.reactions;return!e||typeof e!="object"?[]:ce.filter(t=>e[t]?.length>0).map(t=>({emoji:t,authors:[...e[t]]}))},it=i=>{if(!i||typeof i!="object")return null;let e={};for(let t of ce){let o=i[t];if(!Array.isArray(o))continue;let s=[];for(let r of o){if(typeof r!="string")continue;let a=r.trim();a&&!s.includes(a)&&s.push(a)}s.length>0&&(e[t]=s)}return Object.keys(e).length>0?e:null},nt=(i,e,t)=>{if(!ce.includes(e)||!t)return!1;i.reactions||(i.reactions={});let o=i.reactions[e]||[],s=o.indexOf(t);return s>=0?o.splice(s,1):o.push(t),o.length>0?i.reactions[e]=o:delete i.reactions[e],!0},rt=i=>{let e=Object.entries(i||{}).filter(([,t])=>t?.length>0);return e.length>0?Object.fromEntries(e.map(([t,o])=>[t,[...o]])):null},Di='<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M20.94 11.08A9 9 0 1 1 12.92 3.06"/><path d="M8.5 14.2a4.6 4.6 0 0 0 7 0"/><path d="M9 9.5h.01M15 9.5h.01"/><path d="M19 2.6v4M17 4.6h4"/></svg>',Se=({actorKey:i,strings:e,onToggle:t})=>{let o=new WeakMap,s=c=>{let d=o.get(c);if(d)for(let p of d)p.el.isConnected?p.repaint():d.delete(p)},r=(c,d)=>{t(c,d),s(c)},a=(c,{className:d,tooltip:p=!0})=>{let h=document.createElement("div");h.className=n.REACTION_TRIGGER;let u=document.createElement("button");u.type="button",u.className=d,u.dataset.action="react",p&&(u.dataset.hdTooltip=e.addReaction),u.setAttribute("aria-label",e.addReaction),u.innerHTML=Di;let m=document.createElement("div");m.className=n.REACTION_PALETTE,m.setAttribute("role","menu"),m.setAttribute("aria-label",e.reactionPickerLabel);let f=V(u,m);for(let g of ce){let _=document.createElement("button");_.type="button",_.className=n.REACTION_PALETTE_ITEM,_.setAttribute("role","menuitem"),_.dataset.reactionEmoji=g,_.textContent=g,_.setAttribute("aria-label",g),_.addEventListener("click",b=>{b.stopPropagation(),f.close(),r(c,g)}),m.appendChild(_)}return h.appendChild(u),h.appendChild(m),h};return{bar:c=>{let d=document.createElement("div");d.className=n.REACTION_BAR,d.setAttribute("role","group"),d.setAttribute("aria-label",e.reactionsLabel);let p=()=>{d.replaceChildren();let u=ot(c),m=i();if(d.hidden=u.length===0,!d.hidden){for(let{emoji:f,authors:g}of u){let _=g.includes(m),b=document.createElement("button");b.type="button",b.className=n.REACTION_PILL,_&&b.classList.add(n.REACTION_PILL_MINE),b.dataset.reactionEmoji=f;let B=_?e.reactionToggleOff:e.reactionToggleOn;b.setAttribute("aria-pressed",String(_)),b.setAttribute("aria-label",`${B}: ${f} (${g.length})`),b.addEventListener("click",q=>{q.stopPropagation(),r(c,f)});let C=document.createElement("span");C.className=n.REACTION_PILL_EMOJI,C.textContent=f,C.setAttribute("aria-hidden","true");let N=document.createElement("span");N.className=n.REACTION_PILL_COUNT,N.textContent=String(g.length),b.appendChild(C),b.appendChild(N),d.appendChild(b)}d.appendChild(a(c,{className:n.REACTION_ADD}))}},h=o.get(c);return h||o.set(c,h=new Set),h.add({el:d,repaint:p}),p(),d},trigger:a,refresh:s}};var ue="helldotsComment",Q=(i,e=ue,t=location.href)=>{let o=new URL(t),s=i.page||o.pathname,r=s===o.pathname?o:new URL(s,o);return r.searchParams.set(e,String(i.id)),r.href},st=(i=ue,e=location.href)=>{try{return new URL(e).searchParams.get(i)}catch{return null}};var ao=["created","edited","status","classified"],lo=["type","priority","tags"],ki=64,Ne=i=>typeof i=="string"?i.trim().slice(0,ki):"",ve=i=>i===null?{present:!0,value:null}:typeof i=="string"?{present:!0,value:Ne(i)}:{present:!1,value:void 0};function co(i,e){let t=Ne(i?.name)||e.anonymous,o=P(i?.id);return o?{id:o,name:t}:{name:t}}function Y(i,e,t,o){if(!ao.includes(e))return null;let s={type:e,at:new Date().toISOString(),actor:t};o?.field&&lo.includes(o.field)&&(s.field=o.field);let r=ve(o?.from);r.present&&(s.from=r.value);let a=ve(o?.to);return a.present&&(s.to=a.value),Array.isArray(i.history)||(i.history=[]),i.history.push(s),s}function po(i){if(!Array.isArray(i))return null;let e=[];for(let t of i){if(!t||typeof t!="object"||!ao.includes(t.type))continue;let o=Ne(t.at);if(!Number.isFinite(Date.parse(o)))continue;let s=Ne(t.actor?.name),r=P(t.actor?.id),a={type:t.type,at:o,actor:r?{id:r,name:s}:{name:s}};lo.includes(t.field)&&(a.field=t.field);let l=ve(t.from);l.present&&(a.from=l.value);let c=ve(t.to);c.present&&(a.to=c.value),e.push(a)}return e.length===0?null:(e.sort((t,o)=>Date.parse(t.at)-Date.parse(o.at)),e)}function ho(i){return!Array.isArray(i)||i.length===0?null:i.map(e=>({...e,actor:{...e.actor}}))}function j(i){if(!Array.isArray(i?.history))return[];let e=[],t=null;for(let s of i.history)s.type==="status"&&(s.to==="resolved"?t=s.at:t&&(e.push({resolvedAt:t,reopenedAt:s.at,ms:0}),t=null));t&&e.push({resolvedAt:t,reopenedAt:null,ms:0});let o=Date.parse(i.createdAt);for(let s of e){let r=Date.parse(s.resolvedAt);s.ms=Number.isFinite(o)&&Number.isFinite(r)?Math.max(0,r-o):0}return e}function ee(i){if(i?.status!=="resolved")return null;let e=j(i),t=e[e.length-1];if(t&&!t.reopenedAt)return t.ms;let o=Date.parse(i.resolvedAt),s=Date.parse(i.createdAt);return!Number.isFinite(o)||!Number.isFinite(s)?null:Math.max(0,o-s)}var at=new Set,uo=()=>{for(let i of[...at])i(!1)},we=(i,{title:e,message:t,confirmLabel:o,cancelLabel:s})=>new Promise(r=>{let a=document.createElement("div");a.className=n.CONFIRM,a.style.zIndex=String(L.CONFIRM);let l=document.createElement("div");l.className=n.CONFIRM_PANEL,l.setAttribute("role","alertdialog"),l.setAttribute("aria-modal","true");let c=document.createElement("h2");c.className=n.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=n.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=n.CONFIRM_ACTIONS;let h=document.createElement("button");h.type="button",h.className=n.CONFIRM_CANCEL,h.textContent=s;let u=document.createElement("button");u.type="button",u.className=n.CONFIRM_ACCEPT,u.textContent=o,p.appendChild(h),p.appendChild(u),l.appendChild(c),l.appendChild(d),l.appendChild(p),a.appendChild(l);let m=i.activeElement||document.activeElement,f=!1,g=C=>{f||(f=!0,at.delete(g),document.removeEventListener("keydown",_,!0),a.remove(),m?.focus?.(),r(C))},_=C=>{if(C.key==="Escape"){C.stopPropagation(),C.preventDefault(),g(!1);return}if(C.key!=="Tab")return;let N=[h,u],q=i.activeElement||document.activeElement,E=N.indexOf(q);C.preventDefault(),(C.shiftKey?N[(E<=0?N.length:E)-1]:N[(E+1)%N.length]).focus()};h.addEventListener("click",()=>g(!1)),u.addEventListener("click",()=>g(!0));let b=!1;a.addEventListener("mousedown",C=>{b=C.target===a,C.stopPropagation()}),a.addEventListener("click",C=>{C.target===a&&b&&g(!1),b=!1}),at.add(g),document.addEventListener("keydown",_,!0),(i.body||i).appendChild(a),h.focus()});var mo='<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>',Pi='<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>',$i='<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>',oe=i=>{if(navigator.clipboard?.writeText)return navigator.clipboard.writeText(i).catch(()=>{});let e=document.createElement("textarea");e.value=i,e.style.position="fixed",e.style.opacity="0",document.body.appendChild(e),e.select();try{document.execCommand("copy")}catch{}return e.remove(),Promise.resolve()},M=(i,e)=>({open:e.statusOpen,in_progress:e.statusInProgress,in_review:e.statusInReview,resolved:e.statusResolved})[i]||e.statusOpen,v=(i,e)=>({bug:e.typeBug,suggestion:e.typeSuggestion,question:e.typeQuestion,improvement:e.typeImprovement})[i]||e.unset,w=(i,e)=>({high:e.priorityHigh,medium:e.priorityMedium,low:e.priorityLow})[i]||e.unset,te=({action:i,options:e,value:t,colorOf:o,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=n.INBOX_ACTION_BTN,l&&d.classList.add(n.INBOX_ACTION_BTN_LABELED),d.dataset.action=i,d.setAttribute("aria-haspopup","true");let p=document.createElement("span");p.className=n.INBOX_STATUS_DOT,d.appendChild(p);let h=null;l&&(h=document.createElement("span"),h.className=n.INBOX_ACTION_LABEL,d.appendChild(h));let u=document.createElement("div");u.className=n.INBOX_MENU,u.setAttribute("role","menu");let m=V(d,u),f=t,g=()=>{let _=`${r}: ${s(f)}`;p.style.backgroundColor=o(f),d.dataset.hdTooltip=_,d.setAttribute("aria-label",_),h&&(h.textContent=s(f)),u.querySelectorAll("[data-picker-option]").forEach(b=>{let B=b.dataset.pickerOption,C=B===""?null:B;b.setAttribute("aria-checked",String(C===f))})};for(let _ of e){let b=document.createElement("button");b.type="button",b.className=n.INBOX_MENU_ITEM,b.dataset.pickerOption=_===null?"":_,b.setAttribute("role","menuitemradio");let B=document.createElement("span");B.className=n.INBOX_STATUS_DOT,B.style.backgroundColor=o(_),b.appendChild(B),b.appendChild(document.createTextNode(s(_))),b.addEventListener("click",C=>{C.stopPropagation(),m.close(),_!==f&&(f=_,a(_),g())}),u.appendChild(b)}return c.appendChild(d),c.appendChild(u),g(),c},lt=({label:i,tooltip:e,items:t})=>{let o=document.createElement("div");o.style.position="relative";let s=document.createElement("button");s.type="button",s.className=n.INBOX_ACTION_BTN,s.dataset.action="menu",e&&(s.dataset.hdTooltip=e),s.setAttribute("aria-label",i),s.innerHTML=$i;let r=document.createElement("div");r.className=n.INBOX_MENU,r.setAttribute("role","menu");let a=V(s,r);for(let l of t){let c=document.createElement("button");c.type="button",c.className=n.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 we(p,l.confirm()))return}l.onSelect()}),r.appendChild(c)}return o.appendChild(s),o.appendChild(r),o},Le=(i,{strings:e,reactions:t,onCopy:o,onCopyLink:s,onEdit:r,onSetStatus:a,onSetType:l,onSetPriority:c,onDelete:d})=>{let p=document.createElement("div");p.className=n.INBOX_CARD_ACTIONS;let h=document.createElement("div");h.className=n.ACTIONS_GROUP;let u=document.createElement("div");u.className=`${n.ACTIONS_GROUP} ${n.ACTIONS_GROUP_END}`,p.appendChild(h),p.appendChild(u),t&&u.appendChild(t.trigger(i,{className:n.INBOX_ACTION_BTN}));let m=document.createElement("button");return m.type="button",m.className=n.INBOX_ACTION_BTN,m.dataset.action="copy",m.dataset.hdTooltip=e.copyAgentContext,m.setAttribute("aria-label",e.copyAgentContext),m.innerHTML=mo,m.addEventListener("click",f=>{f.stopPropagation(),o(i),m.innerHTML=Pi,m.dataset.hdTooltip=e.copied,setTimeout(()=>{m.innerHTML=mo,m.dataset.hdTooltip=e.copyAgentContext},1500)}),u.appendChild(m),h.appendChild(te({action:"status",options:S,value:i.status||"open",colorOf:f=>F[f]||F.open,labelOf:f=>M(f,e),tooltipLabel:e.statusLabel,onSelect:f=>a(i,f),showLabel:!0})),h.appendChild(te({action:"type",options:[null,...R],value:i.type||null,colorOf:f=>G[f]||"transparent",labelOf:f=>v(f,e),tooltipLabel:e.typeLabel,onSelect:f=>l?.(i,f),showLabel:!0})),h.appendChild(te({action:"priority",options:[null,...A],value:i.priority||null,colorOf:f=>z[f]||"transparent",labelOf:f=>w(f,e),tooltipLabel:e.priorityLabel,onSelect:f=>c?.(i,f),showLabel:!0})),u.appendChild(lt({label:e.commentOptions,tooltip:e.moreOptions,items:[{label:e.copyLink,feedbackLabel:e.linkCopied,onSelect:()=>s?.(i)},{label:e.editComment,onSelect:()=>r?.(i)},{label:e.deleteComment,onSelect:()=>d(i),confirm:()=>({title:e.confirmDeleteCommentTitle,message:i.replies?.length?e.confirmDeleteThreadMessage:e.confirmDeleteCommentMessage,confirmLabel:e.confirmDelete,cancelLabel:e.confirmCancel})}]})),p};var ie=({value:i,strings:e,onInput:t,onSave:o,onCancel:s})=>{let r=document.createElement("div");r.className=n.EDITOR;let a=document.createElement("textarea");a.className=n.EDITOR_INPUT,a.value=i,a.rows=3,a.setAttribute("aria-label",e.editorAriaLabel);let l=document.createElement("div");l.className=n.EDITOR_ACTIONS;let c=document.createElement("button");c.type="button",c.className=n.EDITOR_CANCEL,c.textContent=e.editCancel;let d=document.createElement("button");d.type="button",d.className=n.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(),o(a.value))}),c.addEventListener("click",h=>{h.stopPropagation(),s()}),d.addEventListener("click",h=>{h.stopPropagation(),d.disabled||o(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},Me=(i,e)=>we(i,{title:e.confirmDiscardTitle,message:e.confirmDiscardMessage,confirmLabel:e.confirmDiscard,cancelLabel:e.confirmKeepEditing});var Hi=(i,e)=>{let t=Date.now()-new Date(i).getTime(),o=Math.floor(t/6e4),s=Math.floor(t/36e5),r=Math.floor(t/864e5);return o<1?e.justNow:o<60?I(e.minutesAgoTemplate,o):s<24?I(e.hoursAgoTemplate,s):I(e.daysAgoTemplate,r)},fo=(i,e)=>new Intl.DateTimeFormat(e,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}).format(new Date(i)),Xi=i=>{let e=document.createElement("span");e.className=n.THREAD_AUTHOR;let t=document.createElement("span");return t.className=n.THREAD_AUTHOR_NAME,t.textContent=i,e.appendChild(t),e.addEventListener("mouseenter",()=>{t.scrollWidth>t.clientWidth?e.dataset.hdTooltip=i:delete e.dataset.hdTooltip}),e},me=(i,e,t,o,s=null)=>{let r=document.createElement("div");r.className=n.THREAD_META;let a=Xi(i||t.anonymous),l=document.createElement("span");return l.className=n.THREAD_TIME,l.textContent=Hi(e,t),l.dataset.fullDate=fo(e,o),r.appendChild(a),r.appendChild(l),s&&r.appendChild(dt(s,t,o)),r},dt=(i,e,t)=>{let o=document.createElement("span");return o.className=n.THREAD_EDITED,o.textContent=e.editedMark,o.dataset.fullDate=e.editedAtPrefix+fo(i,t),o},pt=()=>/Mac|iPod|iPhone|iPad/.test(navigator.userAgent),ht=(i,e)=>{let t=pt(),o={alt:t?"\u2325":e.modifierAlt,ctrl:t?"\u2318":e.modifierCtrl,shift:t?"\u21E7":e.modifierShift},s=o[i.shortcutModifier]||o.alt,r=i.shortcutKey?.toUpperCase()||"C";return`${s} + ${r}`},Be='<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>',Ui='<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>',Fi='<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>',Gi='<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>',zi='<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>',ut='<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/><circle cx="12" cy="12" r="3"/></svg>',go='<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"/><line x1="1" y1="1" x2="23" y2="23"/></svg>',De=({areaClassName:i,inputTag:e="textarea",inputClassName:t,inputId:o,inputPlaceholder:s,submitBtnId:r,fileInputId:a},l)=>{let c=document.createElement("div");c.className=i;let d=document.createElement(e);o&&(d.id=o),t&&(d.className=t),d.placeholder=s,d.setAttribute("aria-label",s),e==="input"&&(d.type="text");let p=document.createElement("div");p.className=n.SCREENSHOTS_CONTAINER;let h=document.createElement("div");h.className=n.COMMENT_ACTIONS_BAR;let u=document.createElement("button");u.className=n.ATTACH_IMAGE_BTN,u.type="button",u.setAttribute("aria-label",l.attachImage),u.innerHTML=Ui;let m=document.createElement("input");m.type="file",a&&(m.id=a),m.accept="image/*",m.style.display="none";let f=document.createElement("button");return r&&(f.id=r),f.className=n.THREAD_SUBMIT,f.type="button",f.setAttribute("aria-label",l.send),f.innerHTML=Fi,h.appendChild(u),h.appendChild(m),h.appendChild(f),c.appendChild(d),c.appendChild(p),c.appendChild(h),{container:c,inputEl:d,screenshotsContainer:p,attachBtn:u,fileInput:m,submitBtn:f}},ct=(i,e,t,o)=>{let s=document.createElement("div");s.className=n.TOOLBAR_ACTION_WRAPPER;let r=document.createElement("div");r.className=n.TOOLBAR_ACTION_TOOLTIP,t.forEach(l=>r.appendChild(l));let a=document.createElement("button");return a.type="button",a.className=`${n.TOOLBAR_ACTION_BTN} ${i}`,a.setAttribute("aria-label",o),a.innerHTML=e,s.appendChild(r),s.appendChild(a),s},Eo=(i={},e=H)=>{let t=document.createElement("div");t.id=x.TOOLBAR;let o=document.createElement("div");o.className=n.TOOLBAR_ACTIONS;let s=document.createElement("span");s.className=n.TOOLBAR_TEXT,s.textContent=e.toolbarComment;let r=document.createElement("span");r.className=n.SHORTCUT_HINT,r.textContent=ht(i,e);let a=ct(n.TOOLBAR_COMMENT_BTN,Gi,[s,r],e.toolbarComment);a.querySelector(`.${n.TOOLBAR_COMMENT_BTN}`)?.setAttribute("aria-pressed","false");let l=document.createElement("span");l.className=n.TOOLBAR_TEXT,l.textContent=e.toolbarInbox;let c=ct(n.TOOLBAR_MENU_BTN,zi,[l],e.toolbarInbox);o.appendChild(a),o.appendChild(c),t.appendChild(o);let d=document.createElement("span");d.className=n.TOOLBAR_TEXT,d.textContent=e.toolbarHideComments;let p=ct(n.TOOLBAR_EYE_BTN,ut,[d],e.toolbarHideComments),h=document.createElement("div");return h.className=n.TOOLBAR_VISIBILITY,h.appendChild(p),t.appendChild(h),t},mt=(i,e,{includeStatus:t=!1,includeClassification:o=!0}={})=>{let s=document.createElement("div");s.className=n.INBOX_BADGES;let r=(a,l,c)=>{let d=document.createElement("span");d.className=`${n.BADGE} ${l}`,d.textContent=a,c&&(d.style.borderColor=c),s.appendChild(d)};if(t){let a=i.status||"open";r(M(a,e),n.BADGE_STATUS,F[a])}o&&i.type&&r(v(i.type,e),n.BADGE_TYPE,G[i.type]),o&&i.priority&&r(w(i.priority,e),n.BADGE_PRIORITY,z[i.priority]);for(let a of i.tags||[])r(a,n.BADGE_TAG,null);if(i.status==="resolved"){let a=ee(i),l=a===null?"":X(a,e);r(I(e.resolvedInTemplate,l||"\u2014"),n.BADGE_DURATION,null)}return s.children.length?s:null},Vi=i=>{let e=document.createElement("div");e.className=n.CLASSIFY_ROW;let t=null,o=null,s=()=>{e.replaceChildren(),e.appendChild(te({action:"type",options:[null,...R],value:null,colorOf:r=>G[r]||"transparent",labelOf:r=>v(r,i),tooltipLabel:i.typeLabel,onSelect:r=>t=r,showLabel:!0})),e.appendChild(te({action:"priority",options:[null,...A],value:null,colorOf:r=>z[r]||"transparent",labelOf:r=>w(r,i),tooltipLabel:i.priorityLabel,onSelect:r=>o=r,showLabel:!0}))};return s(),{container:e,getType:()=>t,getPriority:()=>o,reset:()=>{t=null,o=null,s()}}},_o=(i=H)=>{let e=document.createElement("div");e.id=x.COMMENT_BOX,e.setAttribute("role","dialog"),e.setAttribute("aria-label",i.commentBoxAriaLabel);let{container:t}=De({areaClassName:n.COMMENT_INPUT_AREA,inputTag:"textarea",inputId:x.COMMENT_INPUT,inputPlaceholder:i.commentPlaceholder,submitBtnId:x.SUBMIT_COMMENT,fileInputId:x.ATTACH_IMAGE_INPUT},i),o=Vi(i);return e.appendChild(o.container),e.appendChild(t),e.style.display="none",e.classify=o,e},W=i=>String(i).replace(/[\\"]/g,"\\$&"),bo=i=>`[data-comment-id="${W(i)}"]`,ft=i=>i.screenshots||(i.screenshot?[i.screenshot]:[]),ne=(i,e,{strings:t,onShow:o,rerender:s,pending:r=0})=>{i.innerHTML="",i.classList.toggle(n.ACTIVE,e.length>0||r>0),e.forEach((a,l)=>{let c=document.createElement("div");c.className=n.SCREENSHOT_ITEM;let d=document.createElement("img");d.className=n.SCREENSHOT_IMG,d.src=a,d.alt=t.attachedScreenshot,Co(d,()=>o(a));let p=document.createElement("button");p.type="button",p.className=n.SCREENSHOT_REMOVE,p.setAttribute("aria-label",t.removeScreenshot),p.innerHTML="&times;",p.onclick=h=>{h.stopPropagation(),e.splice(l,1),s()},c.appendChild(d),c.appendChild(p),i.appendChild(c)});for(let a=0;a<r;a++){let l=document.createElement("div");l.className=`${n.SCREENSHOT_ITEM} ${n.SCREENSHOT_PENDING}`,l.setAttribute("role","status"),l.setAttribute("aria-live","polite"),l.textContent=t.capturingScreenshot,i.appendChild(l)}},Yi=i=>new Promise(e=>{let t=new FileReader;t.onload=o=>e(o.target.result),t.onerror=()=>e(null),t.readAsDataURL(i)}),re=(i,e,t,o)=>{i.addEventListener("change",async s=>{let r=s.target.files[0];if(!r||r.type&&!r.type.startsWith("image/")||e().length>=le)return;let a=Yi(r);i.value="";let l=await a;if(!l)return;let c=e();if(c.length>=le||(c.push(l),t(),!o))return;let d=await o(l),p=c.indexOf(l);p!==-1&&(c[p]=d,t())})},$=(i,e)=>{i.querySelectorAll(`.${n.SCREENSHOT_IMG}`).forEach(t=>{Co(t,()=>e(t.src))})},Co=(i,e)=>{i.setAttribute("role","button"),i.setAttribute("tabindex","0"),i.addEventListener("click",t=>{t.stopPropagation(),e()}),i.addEventListener("keydown",t=>{(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),e())})},To=(i,e=H)=>{let t=document.createElement("div");return t.className=n.CIRCLE,t.dataset.commentId=i.id,t.setAttribute("role","button"),t.setAttribute("tabindex","0"),t.setAttribute("aria-label",`${e.commentAriaLabelPrefix}${i.text}`),t.style.cssText=`
2
+ var k="helldots-root",Wo=()=>{customElements.get(k)||customElements.define(k,class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}})};function vt(){Wo();let o=document.querySelector(k);return o||(o=document.createElement(k),document.body.appendChild(o)),o.shadowRoot}var Ve=()=>typeof performance?.now=="function"?performance.now():Date.now(),Ko=()=>new Promise(o=>{if(typeof MessageChannel!="function"){setTimeout(o);return}let e=new MessageChannel;e.port1.onmessage=()=>{e.port1.close(),o()},e.port2.postMessage(null)}),qo=()=>{let o=globalThis.scheduler;return typeof o?.yield=="function"?o.yield():Ko()};function wt({budgetMs:o=8}={}){let e=Ve(),t=()=>{e=Ve()};return()=>{if(!(Ve()-e<o))return qo().then(t,t)}}var Zo=["background-clip","font-family","font-kerning","overflow-x","overflow-y","text-overflow","text-transform"],Lt=[...Zo,"aspect-ratio","border-collapse","border-spacing","bottom","box-sizing","caption-side","clear","display","empty-cells","float","height","isolation","left","margin-bottom","margin-left","margin-right","margin-top","max-height","max-width","min-height","min-width","padding-bottom","padding-left","padding-right","padding-top","position","right","table-layout","top","vertical-align","visibility","width","z-index","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left-color","border-left-style","border-left-width","border-right-color","border-right-style","border-right-width","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","outline-color","outline-offset","outline-style","outline-width","align-content","align-items","align-self","column-count","column-fill","column-gap","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","flex-basis","flex-direction","flex-grow","flex-shrink","flex-wrap","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column-end","grid-column-start","grid-row-end","grid-row-start","grid-template-areas","grid-template-columns","grid-template-rows","justify-content","justify-items","justify-self","order","row-gap","color","direction","font-feature-settings","font-size","font-stretch","font-style","font-variant","font-variation-settings","font-weight","hyphens","letter-spacing","line-height","list-style-image","list-style-position","list-style-type","overflow-wrap","tab-size","text-align","text-align-last","text-decoration-color","text-decoration-line","text-decoration-style","text-decoration-thickness","text-indent","text-orientation","text-shadow","text-underline-offset","text-underline-position","unicode-bidi","white-space","word-break","word-spacing","writing-mode","-webkit-box-orient","-webkit-line-clamp","-webkit-text-fill-color","-webkit-text-stroke-color","-webkit-text-stroke-width","backdrop-filter","backface-visibility","background-attachment","background-blend-mode","background-color","background-image","background-origin","background-position-x","background-position-y","background-repeat","background-size","box-shadow","clip-path","filter","mask-image","mask-mode","mask-position","mask-repeat","mask-size","mix-blend-mode","object-fit","object-position","opacity","perspective","perspective-origin","rotate","scale","transform","transform-origin","transform-style","translate","accent-color","appearance","dominant-baseline","fill","fill-opacity","fill-rule","paint-order","shape-rendering","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-opacity","stroke-width","text-anchor"];var Jo=(o,e)=>{try{let t=document.createElement("canvas");if(t.width=o,t.height=e,t.width!==o||t.height!==e)return!1;let i=t.getContext("2d");return i?(i.fillStyle="#ffffff",i.fillRect(0,0,1,1),i.getImageData(0,0,1,1).data[3]!==0):!1}catch{return!1}},Te=null,Qo=()=>(Te!==null||(Te=[65535,32767,16384,8192,4096].find(o=>Jo(1,o))??4096),Te),Mt=(o,e,t,i={})=>{if(!(o>0)||!(e>0))return t;let{maxDimension:s=Qo(),maxArea:r=268435456}=i;return Math.min(t,s/o,s/e,Math.sqrt(r/(o*e)))},Bt=o=>{try{let e=o?.getContext?.("2d");return!!e&&e.getImageData(0,0,1,1).data[3]!==0}catch{return!1}};var We=.5,ei=.7,Ye,ti=()=>(Ye??=import("modern-screenshot").catch(o=>{throw Ye=void 0,o}),Ye),Dt=o=>!o||o==="transparent"||o==="rgba(0, 0, 0, 0)",kt=()=>{let o=getComputedStyle(document.documentElement).backgroundColor;if(!Dt(o))return o;let e=getComputedStyle(document.body).backgroundColor;return Dt(e)?"#ffffff":e},Pt=()=>{try{let o=document.implementation.createHTMLDocument(""),e=o.createElement("style");return o.head.appendChild(e),e.sheet!==null}catch{return!1}},oi=o=>{let e=[],t=o.indexOf("@font-face");for(;t!==-1;){let i=o.indexOf("{",t),s=i===-1?-1:o.indexOf("}",i);if(s===-1)break;e.push(o.slice(t,s+1)),t=o.indexOf("@font-face",s)}return e.join(`
3
+ `)},je=new Map,ii=o=>(je.has(o)||je.set(o,fetch(o,{mode:"cors",credentials:"omit"}).then(e=>e.ok?e.text():"").then(oi).catch(()=>"")),je.get(o)),ni=o=>{try{return!!o.cssRules}catch{return!1}},ri=async o=>{let e=()=>{};if(!o||!Pt())return e;let t=Array.from(document.styleSheets).filter(r=>r.href&&!ni(r)).map(r=>r.href);if(!t.length)return e;let i=(await Promise.all(t.map(ii))).filter(Boolean).join(`
4
+ `);if(!i)return e;let s=document.createElement("style");return s.textContent=i,document.head.appendChild(s),()=>s.remove()},si=o=>e=>!(e.nodeName?.toLowerCase()===k||o&&e.ownerDocument!==document);async function Ke({scale:o=1,embedCrossOriginFonts:e=!1,fastCapture:t=!1,skipIframeContent:i=!1,captureTimeout:s}={}){let{domToCanvas:r}=await ti(),a=await ri(e),{width:l,height:c}=document.documentElement.getBoundingClientRect(),d=Mt(l,c,o);try{for(let p=3;;p--){let h=await r(document.documentElement,{scale:d,backgroundColor:kt(),...Pt()?{}:{font:!1},filter:si(i),onCloneEachNode:wt(),...t?{includeStyleProperties:Lt}:{},...Number.isFinite(s)&&s>0?{timeout:s}:{}});if(Bt(h))return{canvas:h,scale:d};if(p<=0)throw new Error(`HellDots: the page render came back holding no pixels. ${Math.round(l)}x${Math.round(c)} CSS pixels is most likely past this browser's canvas limit.`);d/=2}}finally{a()}}var $t=(o,e,t)=>{o.fillStyle=kt(),o.fillRect(0,0,e,t)};function Ht(o,{left:e,top:t,width:i,height:s},{sourceScale:r=1}={}){let a=document.createElement("canvas");a.width=i,a.height=s;let l=a.getContext("2d");return l?($t(l,i,s),l.drawImage(o,(e+window.scrollX)*r,(t+window.scrollY)*r,i*r,s*r,0,0,i,s),a.toDataURL("image/png")):null}function qe(o,{sourceScale:e=1,outputScale:t=We,quality:i=ei}={}){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?($t(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",i)):null}var n={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_AUTHOR_NAME:"thread-author-name",INBOX_HEADER_ACTIONS:"inbox-header-actions",INBOX_METRICS_BTN:"inbox-metrics-btn",METRICS_VIEW:"metrics-view",METRICS_TILES:"metrics-tiles",METRICS_TILE:"metrics-tile",METRICS_TILE_VALUE:"metrics-tile-value",METRICS_TILE_LABEL:"metrics-tile-label",METRICS_GROUP:"metrics-group",METRICS_HEADING:"metrics-heading",METRICS_ROW:"metrics-row",METRICS_ROW_LABEL:"metrics-row-label",METRICS_TRACK:"metrics-track",METRICS_BAR:"metrics-bar",METRICS_ROW_COUNT:"metrics-row-count",METRICS_CHART:"metrics-chart",METRICS_AXIS:"metrics-axis",METRICS_EXPORTS:"metrics-exports",METRICS_EXPORT_BTN:"metrics-export-btn",METRICS_EMPTY:"metrics-empty",AUDIT_BLOCK:"audit-block",AUDIT_TOGGLE:"audit-toggle",AUDIT_BODY:"audit-body",AUDIT_LIST:"audit-list",AUDIT_ROW:"audit-row",AUDIT_ACTION:"audit-action",AUDIT_ACTOR:"audit-actor",AUDIT_TIME:"audit-time",AUDIT_HEADING:"audit-heading",AUDIT_RESOLUTIONS:"audit-resolutions",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",SCREENSHOT_PENDING:"screenshot-pending",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",TOOLBAR_VISIBILITY:"toolbar-visibility",TOOLBAR_EYE_BTN:"toolbar-eye-btn",MARKERS_HIDDEN:"markers-hidden",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_START:"inbox-menu--start",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",REACTION_BAR:"reaction-bar",REACTION_PILL:"reaction-pill",REACTION_PILL_MINE:"reaction-pill--mine",REACTION_PILL_EMOJI:"reaction-pill-emoji",REACTION_PILL_COUNT:"reaction-pill-count",REACTION_ADD:"reaction-add",REACTION_TRIGGER:"reaction-trigger",REACTION_PALETTE:"reaction-palette",REACTION_PALETTE_ITEM:"reaction-palette-item",ACTIONS_GROUP:"actions-group",ACTIONS_GROUP_END:"actions-group--end"},Xt=[n.COMMENT_CURSOR],Ze="helldots-markers-hidden",x={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"},P=28,le=5,N=["open","in_progress","in_review","resolved"],F={open:"#D1D1D6",in_progress:"#FF9F0A",in_review:"#2E90FA",resolved:"#30D158"},A=["bug","suggestion","question","improvement"],G={bug:"#FF453A",suggestion:"#BF5AF2",question:"#64D2FF",improvement:"#5E5CE6"},S=["high","medium","low"],z={high:"#FF453A",medium:"#FF9F0A",low:"#8E8E93"},ce=["\u{1F44D}","\u{1F44E}","\u2764\uFE0F","\u{1F389}","\u{1F440}","\u{1F680}"],Ut={CONTAINER:'section, div[class*="container"], div[class*="content"]'},M={CIRCLE:9997,TOOLTIP:1e4,TOOLBAR:9998,COMMENT_BOX:9999,LIGHTBOX:10001,CONFIRM:10002},Ft='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>',Gt="2 2";var xe=class{constructor({host:e,autoScreenshot:t,embedCrossOriginFonts:i=!1,fastCapture:s=!1,skipIframeContent:r=!1,captureTimeout:a,onRegionCaptured:l,onRegionPending:c,onPlace:d,onError:p}){this.host=e,this.autoScreenshot=t,this.embedCrossOriginFonts=i,this.fastCapture=s,this.skipIframeContent=r,this.captureTimeout=a,this.onRegionCaptured=l,this.onRegionPending=c,this.onPlace=d,this.onError=p,this.pendingCapture=null,this.pendingRegion=null,this._regionToken=null,this._dragStart=null,this._isDragging=!1,this._selectionRect=null,this._boundDragMove=h=>this.onDragMove(h),this._boundDragEnd=h=>this.onDragEnd(h)}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,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=n.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),i=Math.min(this._dragStart.y,e.clientY),s=Math.abs(e.clientX-this._dragStart.x),r=Math.abs(e.clientY-this._dragStart.y);this._selectionRect?.remove(),this._selectionRect=null;let a=s>10&&r>10?{left:t,top:i,width:s,height:r}:void 0;a&&this.startRegionCapture(a),await this.onPlace(t+s/2,i+r/2,a)}else await this.onPlace(this._dragStart.x,this._dragStart.y);this._isDragging=!1,this._dragStart=null}startRegionCapture(e){let t={};this._regionToken=t;let i=()=>this._regionToken===t,s=Ke({scale:1,embedCrossOriginFonts:this.embedCrossOriginFonts,fastCapture:this.fastCapture,skipIframeContent:this.skipIframeContent,captureTimeout:this.captureTimeout});this.autoScreenshot&&(this.pendingCapture=s.then(({canvas:r,scale:a})=>i()?qe(r,{sourceScale:a}):null).catch(()=>null)),this.onRegionPending?.(!0),this.pendingRegion=s.then(({canvas:r,scale:a})=>{if(!i())return;let l=Ht(r,e,{sourceScale:a});l&&this.onRegionCaptured(l)}).catch(r=>{console.warn("HellDots: screenshot capture failed:",r),this.onError?.(r)}).finally(()=>{i()&&this.onRegionPending?.(!1)})}armClickCapture(){!this.autoScreenshot||this.pendingCapture||(this.pendingCapture=Ke({scale:We,embedCrossOriginFonts:this.embedCrossOriginFonts,fastCapture:this.fastCapture,skipIframeContent:this.skipIframeContent,captureTimeout:this.captureTimeout}).then(({canvas:e,scale:t})=>qe(e,{sourceScale:t})).catch(e=>(console.warn("HellDots: automatic screenshot failed",e),this.onError?.(e),null)))}async consumePending(){return await this.pendingRegion,this.pendingCapture?await this.pendingCapture:null}clearPending(){this.pendingCapture=null,this.pendingRegion=null,this._regionToken=null}destroy(){document.removeEventListener("mousemove",this._boundDragMove),document.removeEventListener("mouseup",this._boundDragEnd),this._selectionRect?.remove(),this._selectionRect=null,this.pendingCapture=null,this.pendingRegion=null,this._regionToken=null,this._dragStart=null,this._isDragging=!1}};var ai=[{name:"Edge",re:/Edg\/([\d.]+)/},{name:"Chrome",re:/Chrome\/([\d.]+)/},{name:"Firefox",re:/Firefox\/([\d.]+)/},{name:"Safari",re:/Version\/([\d.]+).*Safari/}],li=[{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/}],ci={name:"unknown",version:""},di=o=>/not[\W_]*a[\W_]*brand/i.test(o),zt=(o,e)=>{for(let{name:t,re:i}of o){let s=e.match(i);if(s)return{name:t,version:(s[1]||"").replace(/_/g,".")}}return{...ci}};function Vt(o=window){let e=o.navigator||{},t=e.userAgent||"",i=e.userAgentData,s=zt(ai,t),r=i?.brands?.find(l=>!di(l.brand));r&&(s={name:r.brand,version:r.version||""});let a=zt(li,t);return i?.platform&&(a.name=i.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 ye=" scrollbar-width:thin;scrollbar-color:rgba(255,255,255,0.22) transparent;",pi=(...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(""),Yt=()=>` :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;}#${x.TOOLBAR}{position:fixed;bottom:20px;left:50%;transform:translateX(-50%);z-index:${M.TOOLBAR};}.${n.TOOLBAR_ACTION_WRAPPER}{position:relative;}.${n.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;}.${n.TOOLBAR_ACTION_WRAPPER}:hover .${n.TOOLBAR_ACTION_TOOLTIP}{opacity:1;pointer-events:auto;transform:translateX(-50%) translateY(0);}.${n.TOOLBAR_TEXT}{font-size:13px;font-weight:500;letter-spacing:-0.01em;}.${n.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;}.${n.TOOLBAR_ACTIONS},.${n.TOOLBAR_VISIBILITY}{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);}.${n.TOOLBAR_VISIBILITY}{position:absolute;left:calc(100% + 5px);top:0;}.${n.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;}.${n.TOOLBAR_ACTION_WRAPPER}:first-child .${n.TOOLBAR_ACTION_BTN}{border-radius:12px 0 0 12px;}.${n.TOOLBAR_ACTION_WRAPPER}:last-child .${n.TOOLBAR_ACTION_BTN}{border-radius:0 12px 12px 0;}.${n.TOOLBAR_ACTION_WRAPPER}:only-child .${n.TOOLBAR_ACTION_BTN}{border-radius:12px;}.${n.TOOLBAR_ACTION_BTN}:hover{background:rgba(255,255,255,0.08);color:white;}.${n.TOOLBAR_COMMENT_BTN}.${n.ACTIVE}{color:#2E90FA;background:rgba(46,144,250,0.1);}#${x.COMMENT_BOX}{position:fixed;background:#1C1C1E;border-radius:12px;box-shadow:0 4px 20px rgba(0,0,0,0.4);padding:16px;z-index:${M.COMMENT_BOX};width:min(400px,calc(100vw - 24px));display:none;box-sizing:border-box;}#${x.COMMENT_BOX} .${n.COMMENT_INPUT_AREA}{display:flex;flex-direction:column;gap:0;}.${n.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);}.${n.CLASSIFY_ROW} .${n.INBOX_ACTION_BTN}{height:26px;border:1px solid rgba(255,255,255,0.12);border-radius:8px;}.${n.CLASSIFY_ROW} .${n.INBOX_ACTION_BTN}:hover{border-color:rgba(255,255,255,0.28);}#${x.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;}#${x.COMMENT_INPUT}::placeholder{color:rgba(255,255,255,0.5);}#${x.COMMENT_INPUT}:focus{outline:none;box-shadow:none;}.${n.COMMENT_ACTIONS_BAR}{display:flex;align-items:center;justify-content:space-between;padding-top:12px;}.${n.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;}.${n.ATTACH_IMAGE_BTN}:hover{background:rgba(255,255,255,0.1);color:rgba(255,255,255,0.8);}.${n.CIRCLE}{position:absolute;width:${P}px;height:${P}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:${M.CIRCLE};transform:translate(-50%,-50%);}.${n.CIRCLE}:hover{transform:translate(-50%,-50%) scale(1.2) !important;background:rgb(0,123,255);}.${n.CIRCLE}.${n.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);}.${n.CIRCLE}.${n.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);}.${n.MARKERS_HIDDEN} .${n.CIRCLE}{display:none !important;}.${n.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;${ye} z-index:${M.TOOLTIP};color:white;font-size:14px;line-height:1.5;box-sizing:border-box;}.${n.TOOLTIP} .${n.THREAD_BODY}{padding:8px 0;}.${n.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:${M.TOOLTIP};color:white;font-size:14px;line-height:1.5;box-sizing:border-box;}.${n.THREAD_POPOVER}>.${n.THREAD_HEADER},.${n.THREAD_POPOVER}>.${n.THREAD_ACTIONS_ROW},.${n.THREAD_POPOVER}>.${n.THREAD_INPUT_AREA}{flex:none;}.${n.THREAD_SCROLL}{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;${ye}}${pi(`.${n.THREAD_SCROLL}`,`.${n.TOOLTIP}`,`.${n.INBOX_LIST}`,`.${n.INBOX_DETAIL}`,`.${n.EDITOR_INPUT}`)} .${n.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:${M.COMMENT_BOX};color:white;font-size:14px;line-height:1.5;box-sizing:border-box;overflow:hidden;}.${n.INBOX_PANEL}:focus,.${n.INBOX_PANEL}:focus-visible{outline:none;}@media (max-width:480px){.${n.INBOX_PANEL}{left:16px;width:auto;}}.${n.INBOX_HEADER},.${n.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;}.${n.INBOX_FILTER}-wrapper{position:relative;}.${n.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;}.${n.INBOX_FILTER}:hover{background:rgba(255,255,255,0.08);}.${n.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);}.${n.INBOX_FILTER_MENU_HEADER}{display:flex;align-items:baseline;justify-content:space-between;gap:12px;font-size:13px;font-weight:600;margin-bottom:12px;}.${n.INBOX_FILTER_CLEAR}{background:transparent;border:none;color:rgba(255,255,255,0.55);font-size:12px;font-weight:500;cursor:pointer;padding:0;}.${n.INBOX_FILTER_CLEAR}:hover:not(:disabled){color:white;}.${n.INBOX_FILTER_CLEAR}:disabled{opacity:0.35;cursor:default;}.${n.INBOX_FILTER_GROUP} + .${n.INBOX_FILTER_GROUP}{margin-top:14px;}.${n.INBOX_FILTER_SECTION}{font-size:11px;font-weight:600;color:rgba(255,255,255,0.45);margin-bottom:8px;}.${n.INBOX_FILTER_CHIPS}{display:flex;flex-wrap:wrap;gap:6px;}.${n.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;}.${n.INBOX_FILTER_CHIP}:hover{border-color:rgba(255,255,255,0.4);color:white;}.${n.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;}.${n.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;}.${n.INBOX_MENU_ITEM}:hover{background:rgba(255,255,255,0.08);}.${n.INBOX_CLOSE},.${n.INBOX_NAV_BTN},.${n.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;}.${n.INBOX_CLOSE}{font-size:20px;line-height:1;}.${n.INBOX_CLOSE}:hover,.${n.INBOX_NAV_BTN}:not(:disabled):hover,.${n.INBOX_BACK}:hover{background:rgba(255,255,255,0.08);color:white;}.${n.INBOX_NAV_BTN}:disabled{opacity:0.35;cursor:default;}.${n.INBOX_LIST},.${n.INBOX_DETAIL}{flex:1;overflow-y:auto;${ye} padding:12px;display:flex;flex-direction:column;gap:12px;}.${n.INBOX_CARD}{border:1px solid rgba(255,255,255,0.1);border-radius:10px;padding:12px;display:flex;flex-direction:column;gap:8px;}.${n.INBOX_LIST} .${n.INBOX_CARD}{cursor:pointer;}.${n.INBOX_LIST} .${n.INBOX_CARD}:hover{border-color:rgba(255,255,255,0.22);}.${n.INBOX_CARD}--resolved{border-color:rgba(48,209,88,0.4);opacity:0.75;}.${n.INBOX_LIST} .${n.INBOX_CARD}--resolved:hover{border-color:rgba(48,209,88,0.7);opacity:1;}.${n.INBOX_CARD}--resolved:has([aria-expanded="true"]){opacity:1;}.${n.INBOX_CARD_HEADER}{display:flex;align-items:center;justify-content:space-between;gap:8px;}.${n.INBOX_CARD_ACTIONS}{display:flex;align-items:center;justify-content:space-between;width:100%;gap:8px;}.${n.INBOX_DETAIL_HEADER} .${n.INBOX_CARD_ACTIONS}{justify-content:flex-end;gap:2px;}.${n.ACTIONS_GROUP}{display:flex;align-items:center;flex-wrap:wrap;gap:5px;}.${n.ACTIONS_GROUP_END}{flex-wrap:nowrap;gap:2px;}.${n.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;}.${n.INBOX_ACTION_BTN}:hover{background:rgba(255,255,255,0.08);color:white;}.${n.INBOX_ACTION_BTN_LABELED}{width:auto;padding:0 8px 0 6px;gap:5px;justify-content:flex-start;flex:none;}.${n.INBOX_ACTION_LABEL}{font-size:11px;line-height:1;white-space:nowrap;}.${n.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;}.${n.INBOX_MENU_ITEM} .${n.INBOX_STATUS_DOT}{width:9px;height:9px;border:none;margin-right:8px;vertical-align:baseline;}.${n.INBOX_MENU_ITEM}[aria-checked="true"]{background:rgba(255,255,255,0.08);}.${n.THREAD_ACTIONS_ROW}{display:flex;justify-content:flex-end;}.${n.THREAD_POPOVER}>.${n.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;}.${n.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);}.${n.INBOX_MENU}.${n.INBOX_MENU_UP}{top:auto;bottom:calc(100% + 4px);}.${n.INBOX_MENU}.${n.INBOX_MENU_START}{right:auto;left:0;}.${n.INBOX_CARD_TEXT}{white-space:pre-wrap;word-break:break-word;}.${n.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;}.${n.INBOX_BADGES}{display:flex;flex-wrap:wrap;gap:4px;}.${n.INBOX_CARD} .${n.INBOX_BADGES}{margin-top:6px;}.${n.TOOLTIP} .${n.INBOX_BADGES}{margin-bottom:4px;}.${n.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;}.${n.BADGE_STATUS},.${n.BADGE_TYPE},.${n.BADGE_PRIORITY}{font-weight:600;}.${n.BADGE_TAG}{opacity:0.75;}.${n.BADGE_DURATION}{opacity:0.75;border-style:dashed;}.${n.REACTION_BAR}{display:flex;align-items:center;flex-wrap:wrap;gap:6px;margin-top:2px;margin-bottom:12px;}.${n.REACTION_BAR}[hidden]{display:none;}.${n.REACTION_TRIGGER}{position:relative;display:inline-flex;}.${n.REACTION_PILL}{display:inline-flex;align-items:center;gap:5px;height:24px;padding:0 8px;border:1px solid rgba(255,255,255,0.18);border-radius:8px;background:transparent;color:#F2F2F7;font-family:inherit;font-size:12px;line-height:1;cursor:pointer;transition:background 0.12s ease,border-color 0.12s ease;}.${n.REACTION_PILL}:hover{background:rgba(255,255,255,0.08);}.${n.REACTION_PILL_MINE}{border-color:#2E90FA;background:rgba(46,144,250,0.16);}.${n.REACTION_PILL_MINE}:hover{background:rgba(46,144,250,0.24);}.${n.REACTION_PILL_EMOJI}{font-family:"Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif;font-size:13px;}.${n.REACTION_PILL_COUNT}{font-variant-numeric:tabular-nums;}.${n.REACTION_ADD}{display:inline-flex;align-items:center;justify-content:center;width:28px;height:24px;padding:0;border:1px solid rgba(255,255,255,0.18);border-radius:8px;background:transparent;color:#8E8E93;cursor:pointer;}.${n.REACTION_ADD}:hover{color:#F2F2F7;border-color:rgba(255,255,255,0.35);}.${n.REACTION_PALETTE}{position:absolute;top:calc(100% + 4px);left:0;white-space:nowrap;background:#2C2C2E;border:1px solid rgba(255,255,255,0.1);border-radius:10px;padding:4px;z-index:1;box-shadow:0 4px 16px rgba(0,0,0,0.4);}.${n.ACTIONS_GROUP_END} .${n.REACTION_PALETTE},.${n.THREAD_REPLY_ACTIONS} .${n.REACTION_PALETTE}{left:auto;right:0;}.${n.REACTION_PALETTE}.${n.INBOX_MENU_UP}{top:auto;bottom:calc(100% + 4px);}.${n.REACTION_PALETTE_ITEM}{display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;padding:0;border:0;border-radius:6px;background:transparent;font-family:"Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif;font-size:15px;cursor:pointer;}.${n.REACTION_PALETTE_ITEM}:hover{background:rgba(255,255,255,0.12);}.${n.CONTEXT_BLOCK}{display:flex;flex-direction:column;padding:10px 12px;border-top:1px solid rgba(255,255,255,0.08);font-size:11px;}.${n.CONTEXT_BODY}{display:flex;flex-direction:column;gap:4px;}.${n.CONTEXT_TITLE}{font-size:11px;font-weight:600;color:rgba(255,255,255,0.45);padding-bottom:4px;}.${n.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;}.${n.CONTEXT_TOGGLE}:hover{color:rgba(255,255,255,0.75);}.${n.CONTEXT_TOGGLE} svg{flex:none;transition:transform 0.15s ease;}.${n.CONTEXT_TOGGLE}[aria-expanded="true"] svg{transform:rotate(180deg);}.${n.CONTEXT_TOGGLE}[aria-expanded="true"] + .${n.CONTEXT_BODY}{padding-top:8px;}.${n.CONTEXT_BLOCK} img{width:100%;border-radius:6px;margin-bottom:6px;cursor:zoom-in;}.${n.CONTEXT_SCREENSHOT_CAPTION}{opacity:0.75;}.${n.CONTEXT_ROW}{display:flex;justify-content:space-between;gap:12px;opacity:0.75;}.${n.CONTEXT_ROW} span:last-child{text-align:right;word-break:break-all;}.${n.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;}.${n.INBOX_CARD_REPLY_LINK}:hover{color:white;}.${n.INBOX_REPLIES}{display:flex;flex-direction:column;gap:10px;padding:0 4px;}.${n.INBOX_REPLIES}:empty{display:none;}.${n.TOOLTIP_REPLY_COUNT}{font-size:12px;color:rgba(255,255,255,0.45);padding-top:4px;}.${n.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;}.${n.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;}.${n.INBOX_EMPTY_TITLE}{color:white;font-size:14px;font-weight:600;}.${n.INBOX_EMPTY_TEXT}{font-size:13px;line-height:1.5;max-width:30ch;}.${n.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;}.${n.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;}.${n.INBOX_EMPTY_ACTION}:hover{background:rgba(255,255,255,0.08);border-color:rgba(255,255,255,0.35);}.${n.THREAD_HEADER}{display:flex;justify-content:space-between;align-items:center;padding:0;}.${n.THREAD_META}{display:flex;align-items:center;gap:6px;flex:1;min-width:0;}.${n.THREAD_AUTHOR}{font-weight:600;font-size:13px;display:flex;min-width:0;max-width:280px;}.${n.THREAD_AUTHOR_NAME}{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.${n.THREAD_AUTHOR}[data-hd-tooltip]::after{white-space:normal;max-width:240px;width:max-content;text-align:center;}.${n.THREAD_TIME}{font-size:12px;color:rgba(255,255,255,0.5);cursor:default;position:relative;flex:none;}.${n.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;}.${n.THREAD_TIME}:hover::after{opacity:1;}.${n.THREAD_BODY}{padding:8px 0;white-space:pre-wrap;word-break:break-word;}.${n.THREAD_REPLIES}{padding:0;}.${n.THREAD_REPLIES}:empty{display:none;}.${n.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:14px;color:rgba(255,255,255,0.85);}.${n.THREAD_REPLY} .${n.THREAD_META}{margin-bottom:2px;}.${n.THREAD_REPLY_ACTIONS}{margin-left:auto;flex:none;}.${n.THREAD_REPLY} .${n.SCREENSHOT_IMG}{width:144px;height:100px;object-fit:cover;border-radius:8px;margin-top:4px;cursor:pointer;display:block;}.${n.THREAD_INPUT_AREA}{display:flex;flex-direction:column;gap:0;padding:12px 0 0;border-top:1px solid rgba(255,255,255,0.1);}.${n.THREAD_INPUT}{width:100%;background:transparent;border:none;padding:0;color:white;font-size:14px;font-family:inherit;outline:none;box-sizing:border-box;}.${n.THREAD_INPUT}::placeholder{color:rgba(255,255,255,0.5);}.${n.THREAD_INPUT}:focus{outline:none;box-shadow:none;}.${n.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;}.${n.THREAD_SUBMIT}:hover{background:rgba(46,144,250,0.15);color:#1570D6;}.${n.CLOSE_TOOLTIP}{background:none;border:none;font-size:18px;cursor:pointer;color:rgba(255,255,255,0.5);line-height:1;}.${n.CLOSE_TOOLTIP}:hover{color:white;}.${n.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);}}.${n.COMMENT_OVERLAY}{position:fixed;top:0;left:0;right:0;bottom:0;background:transparent;pointer-events:none;z-index:${M.TOOLBAR-1};}.${n.COMMENT_OVERLAY}.${n.ACTIVE}{pointer-events:auto;background:rgba(0,0,0,0.1);}.${n.SELECTION_RECT}{position:fixed;border:2px solid #2E90FA;background:rgba(46,144,250,0.1);pointer-events:none;z-index:${M.TOOLTIP};box-sizing:border-box;}.${n.SCREENSHOTS_CONTAINER}{display:none;overflow-x:auto;gap:8px;margin-top:4px;padding:4px;margin-inline:-4px;scrollbar-width:none;-ms-overflow-style:none;margin-bottom:8px;}.${n.SCREENSHOTS_CONTAINER}::-webkit-scrollbar{display:none;}.${n.SCREENSHOTS_CONTAINER}.${n.ACTIVE}{display:flex;}.${n.SCREENSHOT_ITEM}{position:relative;flex-shrink:0;}.${n.SCREENSHOT_PENDING}{min-width:50px;height:50px;padding:0 8px;box-sizing:border-box;display:flex;align-items:center;justify-content:center;text-align:center;border:1px dashed rgba(255,255,255,0.35);border-radius:8px;font-size:10px;line-height:1.2;color:rgba(255,255,255,0.7);white-space:nowrap;}.${n.SCREENSHOT_ITEM} .${n.SCREENSHOT_IMG}{width:50px;height:50px;object-fit:cover;border-radius:8px;cursor:pointer;display:block;margin:0;}.${n.SCREENSHOT_ITEM} .${n.SCREENSHOT_IMG}:hover{opacity:0.85;}.${n.SCREENSHOT_ITEM} .${n.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;}.${n.SCREENSHOT_ITEM}:hover .${n.SCREENSHOT_REMOVE}{display:flex;}.${n.SCREENSHOT_ITEM} .${n.SCREENSHOT_REMOVE}:hover{background:rgba(0,0,0,0.9);}.${n.TOOLTIP}>.${n.SCREENSHOTS_CONTAINER} .${n.SCREENSHOT_ITEM} .${n.SCREENSHOT_IMG},.${n.THREAD_SCROLL}>.${n.SCREENSHOTS_CONTAINER} .${n.SCREENSHOT_ITEM} .${n.SCREENSHOT_IMG},.${n.THREAD_REPLY} .${n.SCREENSHOT_ITEM} .${n.SCREENSHOT_IMG}{width:144px;height:100px;}.${n.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;}.${n.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;}.${n.CONFIRM_TITLE}{margin:0 0 8px;font-size:15px;font-weight:600;}.${n.CONFIRM_MESSAGE}{margin:0 0 20px;font-size:13px;color:rgba(255,255,255,0.65);}.${n.CONFIRM_ACTIONS}{display:flex;justify-content:flex-end;gap:8px;}.${n.CONFIRM_CANCEL},.${n.CONFIRM_ACCEPT}{padding:7px 14px;border:1px solid transparent;border-radius:8px;font-size:13px;font-weight:600;cursor:pointer;}.${n.CONFIRM_CANCEL}:focus-visible,.${n.CONFIRM_ACCEPT}:focus-visible{outline:2px solid #2E90FA;outline-offset:2px;}.${n.CONFIRM_CANCEL}{background:rgba(255,255,255,0.08);border-color:rgba(255,255,255,0.12);color:white;}.${n.CONFIRM_CANCEL}:hover{background:rgba(255,255,255,0.14);}.${n.CONFIRM_ACCEPT}{background:#FF453A;color:white;}.${n.CONFIRM_ACCEPT}:hover{background:#FF6961;}.${n.LIGHTBOX}{position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,0.92);z-index:${M.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;}}.${n.LIGHTBOX_IMG}{max-width:90vw;max-height:90vh;object-fit:contain;border-radius:8px;}.${n.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;}.${n.LIGHTBOX_CLOSE}:hover{background:rgba(255,255,255,0.3);}.${n.EDITOR}{display:flex;flex-direction:column;gap:8px;margin:4px 0 2px;}.${n.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;${ye}}.${n.EDITOR_INPUT}:focus{border-color:rgba(46,144,250,0.7);}.${n.EDITOR_ACTIONS}{display:flex;justify-content:flex-end;gap:8px;}.${n.EDITOR_CANCEL},.${n.EDITOR_SAVE}{padding:5px 12px;border:1px solid transparent;border-radius:7px;font-size:13px;font-weight:600;font-family:inherit;cursor:pointer;}.${n.EDITOR_CANCEL}{background:rgba(255,255,255,0.08);border-color:rgba(255,255,255,0.12);color:white;}.${n.EDITOR_CANCEL}:hover{background:rgba(255,255,255,0.14);}.${n.EDITOR_SAVE}{background:#2E90FA;color:white;}.${n.EDITOR_SAVE}:hover:not(:disabled){background:#57A6FB;}.${n.EDITOR_SAVE}:disabled{background:rgba(255,255,255,0.10);color:rgba(255,255,255,0.4);cursor:not-allowed;}.${n.THREAD_EDITED}{font-size:12px;color:rgba(255,255,255,0.4);cursor:default;position:relative;flex:none;}.${n.THREAD_EDITED}::before{content:"\xB7";margin-right:4px;}.${n.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;}.${n.THREAD_EDITED}:hover::after{opacity:1;}.${n.AUDIT_BLOCK}{margin-top:10px;border-top:1px solid rgba(255,255,255,0.08);padding-top:8px;}.${n.AUDIT_TOGGLE}{display:flex;align-items:center;gap:6px;width:100%;padding:4px 0;border:0;background:none;color:rgba(255,255,255,0.55);font-family:inherit;font-size:12px;text-align:left;cursor:pointer;}.${n.AUDIT_TOGGLE}:hover{color:rgba(255,255,255,0.85);}.${n.AUDIT_TOGGLE}::before{content:"";width:0;height:0;border-left:4px solid currentColor;border-top:4px solid transparent;border-bottom:4px solid transparent;transition:transform 0.15s ease;}.${n.AUDIT_TOGGLE}[aria-expanded="true"]::before{transform:rotate(90deg);}.${n.AUDIT_BODY}{padding:4px 0 2px;}.${n.AUDIT_LIST}{margin:0;padding:0;list-style:none;display:flex;flex-direction:column;gap:7px;}.${n.AUDIT_ROW}{display:grid;grid-template-columns:1fr auto;align-items:baseline;column-gap:8px;font-size:12px;line-height:1.4;}.${n.AUDIT_ACTION}{grid-column:1;color:rgba(255,255,255,0.78);}.${n.AUDIT_ACTOR}{grid-column:1;color:rgba(255,255,255,0.48);font-size:11px;}.${n.AUDIT_TIME}{grid-row:1;grid-column:2;color:rgba(255,255,255,0.42);font-size:11px;white-space:nowrap;}.${n.AUDIT_HEADING}{margin:0 0 6px;color:rgba(255,255,255,0.5);font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:0.05em;}.${n.AUDIT_RESOLUTIONS}{margin-top:10px;padding-top:8px;border-top:1px solid rgba(255,255,255,0.06);}.${n.INBOX_HEADER_ACTIONS}{display:flex;align-items:center;gap:12px;}.${n.INBOX_METRICS_BTN}{padding:5px 10px;border-radius:7px;border:1px solid rgba(255,255,255,0.12);background:rgba(255,255,255,0.06);color:rgba(255,255,255,0.75);font-family:inherit;font-size:12px;white-space:nowrap;cursor:pointer;}.${n.INBOX_METRICS_BTN}:hover{background:rgba(255,255,255,0.11);color:#fff;}.${n.METRICS_VIEW}{flex:1;overflow-y:auto;padding:14px 16px;display:flex;flex-direction:column;gap:16px;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,0.22) transparent;}.${n.METRICS_VIEW}::-webkit-scrollbar{width:8px;}.${n.METRICS_VIEW}::-webkit-scrollbar-track{background:transparent;}.${n.METRICS_VIEW}::-webkit-scrollbar-thumb{background:rgba(255,255,255,0.22);border-radius:4px;}.${n.METRICS_TILES}{display:grid;grid-template-columns:repeat(auto-fit,minmax(96px,1fr));gap:8px;}.${n.METRICS_TILE}{display:flex;flex-direction:column;gap:2px;padding:10px;border-radius:9px;background:rgba(255,255,255,0.05);border:1px solid rgba(255,255,255,0.08);}.${n.METRICS_TILE_VALUE}{color:#fff;font-size:18px;font-weight:600;line-height:1.1;}.${n.METRICS_TILE_LABEL}{color:rgba(255,255,255,0.5);font-size:11px;line-height:1.3;}.${n.METRICS_GROUP}{display:flex;flex-direction:column;gap:7px;}.${n.METRICS_HEADING}{margin:0;color:rgba(255,255,255,0.5);font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:0.05em;}.${n.METRICS_ROW}{display:grid;grid-template-columns:76px 1fr 26px;align-items:center;gap:8px;font-size:12px;}.${n.METRICS_ROW_LABEL}{color:rgba(255,255,255,0.72);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.${n.METRICS_TRACK}{height:8px;border-radius:4px;background:rgba(255,255,255,0.07);overflow:hidden;}.${n.METRICS_BAR}{height:100%;border-radius:4px;background:rgba(255,255,255,0.42);min-width:2px;}.${n.METRICS_ROW_COUNT}{color:rgba(255,255,255,0.85);font-variant-numeric:tabular-nums;text-align:right;}.${n.METRICS_CHART}{width:100%;height:96px;display:block;fill:rgba(255,255,255,0.42);}.${n.METRICS_AXIS}{display:flex;justify-content:space-between;color:rgba(255,255,255,0.42);font-size:10px;font-variant-numeric:tabular-nums;}.${n.METRICS_EXPORTS}{display:flex;flex-wrap:wrap;gap:6px;padding-top:4px;border-top:1px solid rgba(255,255,255,0.08);}.${n.METRICS_EXPORT_BTN}{padding:6px 10px;border-radius:7px;border:1px solid rgba(255,255,255,0.12);background:rgba(255,255,255,0.06);color:rgba(255,255,255,0.78);font-family:inherit;font-size:12px;cursor:pointer;}.${n.METRICS_EXPORT_BTN}:hover{background:rgba(255,255,255,0.12);color:#fff;}.${n.METRICS_EMPTY}{margin:0;padding:24px 0;color:rgba(255,255,255,0.5);font-size:13px;text-align:center;}.${n.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;}/* WCAG 2.1 AA,2.4.7 Focus Visible. Bound to :focus-visible,never :focus \u2014 that is what lets the rings exist again after being reverted for visual parity,since :focus fired on a mouse click too. Full reasoning in DECISIONS.md. Three things are load-bearing:- This block stays LAST. :focus-visible is a subset of :focus,so both match at once and the suppressors above are equally specific. - [tabindex="0"],not [tabindex]:the inbox panel is -1 and its ring is suppressed on purpose. Selecting by element type rather than by class is what keeps the next control covered without an edit. - Text fields take the underline,not the ring:browsers match :focus-visible on them even on a click. .${n.EDITOR_INPUT} is left out,already carrying a blue border on focus. */ button:focus-visible,[tabindex="0"]:focus-visible{outline:2px solid #2E90FA;outline-offset:2px;}#${x.COMMENT_INPUT}:focus-visible,.${n.THREAD_INPUT}:focus-visible{box-shadow:inset 0 -2px 0 #2E90FA;}`,jt=()=>` .${n.COMMENT_CURSOR},.${n.COMMENT_CURSOR} *{cursor:url('${Ft}') ${Gt},auto !important;}`,Wt=()=>' .report{margin:0;padding:24px;background:#fff;color:#111;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;font-size:12px;line-height:1.45;}.report-title{margin:0 0 4px;font-size:20px;}.report-meta{margin:0 0 2px;color:#555;font-size:11px;}.report-table{width:100%;margin-top:18px;border-collapse:collapse;break-inside:avoid;}.report-table caption{margin-bottom:4px;font-size:12px;font-weight:600;text-align:left;}.report-table th,.report-table td{padding:5px 8px;border:1px solid #d5d5d5;text-align:left;font-weight:400;}.report-table thead th{background:#f2f2f2;font-weight:600;}.report-table td{text-align:right;font-variant-numeric:tabular-nums;}@page{margin:14mm;}';function de(o,e,t){let i=hi(e,o);if(i)return o.adoptedStyleSheets=[...o.adoptedStyleSheets??[],i],()=>{o.adoptedStyleSheets=(o.adoptedStyleSheets??[]).filter(a=>a!==i)};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 hi(o,e){let i=(e.defaultView??e.ownerDocument?.defaultView??globalThis).CSSStyleSheet;if(typeof i!="function"||!("adoptedStyleSheets"in e))return null;try{let s=new i;return s.replaceSync(o),s}catch{return null}}var H={metricsTitle:"Metrics",metricsOpen:"Metrics",metricsTotal:"Total comments",metricsAverageResolution:"Average resolution",metricsMedianResolution:"Median resolution",metricsReopened:"Reopened",metricsByStatus:"By status",metricsByType:"By type",metricsByPriority:"By priority",metricsOverTime:"Comments per day",metricsEmpty:"No comments to measure yet",metricsCategory:"Category",metricsCount:"Count",metricsDate:"Date",metricsExportComments:"Comments (CSV)",metricsExportMetrics:"Metrics (CSV)",metricsPrint:"Print / Save as PDF",metricsExportLabel:"Export",metricsGeneratedTemplate:"Generated {n}",metricsScope:"Scope",auditToggleTemplate:"History ({n})",auditTrailLabel:"Activity history",auditCreated:"Created the comment",auditEdited:"Edited the text",auditTagsChanged:"Updated the tags",auditPreviousResolutions:"Previous resolutions",auditResolvedInTemplate:"Resolved in {n}",commentAriaLabelPrefix:"Comment: ",anonymous:"Anonymous",justNow:"Just now",minutesAgoTemplate:"{n}m",hoursAgoTemplate:"{n}h",daysAgoTemplate:"{n}d",toolbarComment:"Comment",toolbarInbox:"Inbox",toolbarHideComments:"Hide comments",toolbarShowComments:"Show comments",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",capturingScreenshot:"Capturing\u2026",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",statusInReview:"In review",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",reactionsLabel:"Reactions",addReaction:"Add reaction",reactionToggleOn:"Add your reaction",reactionToggleOff:"Remove your reaction",reactionPickerLabel:"Choose a reaction"};var Kt={metricsTitle:"M\xE9tricas",metricsOpen:"M\xE9tricas",metricsTotal:"Comentarios totales",metricsAverageResolution:"Resoluci\xF3n media",metricsMedianResolution:"Resoluci\xF3n mediana",metricsReopened:"Reabiertos",metricsByStatus:"Por estado",metricsByType:"Por tipo",metricsByPriority:"Por prioridad",metricsOverTime:"Comentarios por d\xEDa",metricsEmpty:"A\xFAn no hay comentarios que medir",metricsCategory:"Categor\xEDa",metricsCount:"Cantidad",metricsDate:"Fecha",metricsExportComments:"Comentarios (CSV)",metricsExportMetrics:"M\xE9tricas (CSV)",metricsPrint:"Imprimir / Guardar como PDF",metricsExportLabel:"Exportar",metricsGeneratedTemplate:"Generado {n}",metricsScope:"Alcance",auditToggleTemplate:"Historial ({n})",auditTrailLabel:"Historial de actividad",auditCreated:"Cre\xF3 el comentario",auditEdited:"Edit\xF3 el texto",auditTagsChanged:"Actualiz\xF3 las etiquetas",auditPreviousResolutions:"Resoluciones anteriores",auditResolvedInTemplate:"Resuelto en {n}",commentAriaLabelPrefix:"Comentario: ",anonymous:"An\xF3nimo",justNow:"Justo ahora",minutesAgoTemplate:"{n}m",hoursAgoTemplate:"{n}h",daysAgoTemplate:"{n}d",toolbarComment:"Comentar",toolbarInbox:"Bandeja",toolbarHideComments:"Ocultar comentarios",toolbarShowComments:"Mostrar comentarios",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",capturingScreenshot:"Capturando\u2026",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",statusInReview:"En revisi\xF3n",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",reactionsLabel:"Reacciones",addReaction:"A\xF1adir reacci\xF3n",reactionToggleOn:"A\xF1adir tu reacci\xF3n",reactionToggleOff:"Quitar tu reacci\xF3n",reactionPickerLabel:"Elegir una reacci\xF3n"};var Oe={en:H,es:Kt},pe="en";function qt(){let o=(navigator.language||pe).slice(0,2).toLowerCase();return o in Oe?o:pe}function Zt(o){let e=Oe[o];return!e||o===pe?Oe[pe]:{...Oe[pe],...e}}function R(o,e){return o.replace("{n}",String(e))}var ui=6e4;function X(o,e){if(!Number.isFinite(o)||o<0)return"";let t=Math.floor(o/ui);if(t<1)return e.durationLessThanMinute;if(t<60)return R(e.minutesAgoTemplate,t);let i=Math.floor(t/60);if(i<24){let l=t%60,c=R(e.hoursAgoTemplate,i);return l?`${c} ${R(e.minutesAgoTemplate,l)}`:c}let s=Math.floor(i/24),r=i%24,a=R(e.daysAgoTemplate,s);return r?`${a} ${R(e.hoursAgoTemplate,r)}`:a}var Je=64,mi=3,fi=5,gi=.6,Ei=.7,bi=/^(css|sc|jsx|emotion)-/i,_i=/^data-(reactid|react-|v-|svelte-)/,Ci=["id","name","role","aria-label"],Ti=["data-testid","name","aria-label"],Qe=o=>typeof CSS<"u"&&CSS.escape?CSS.escape(o):String(o).replace(/[^a-zA-Z0-9_-]/g,"\\$&"),xi=o=>String(o).replace(/["\\]/g,"\\$&"),he=(o,e)=>{try{return e.querySelectorAll(o).length===1}catch{return!1}},eo=o=>(o||"").replace(/\s+/g," ").trim().slice(0,Je),yi=o=>Xt.includes(o)||bi.test(o)?!1:!o.split(/[-_]/).some(e=>e.length>=5&&/\d/.test(e)),Oi=o=>[...o.classList].filter(yi),Ii=o=>{let e={};for(let{name:t,value:i}of o.attributes)(Ci.includes(t)||t.startsWith("data-")&&!_i.test(t))&&i&&(e[t]=i.slice(0,Je));return e},et=o=>{let e=o.parentElement;if(!e)return{index:0,count:1};let t=[...e.children].filter(i=>i.tagName===o.tagName);return{index:t.indexOf(o),count:t.length}},Ri=(o,e)=>{if(!o.id)return null;let t=`#${Qe(o.id)}`;return he(t,e)?t:null},Ai=(o,e)=>{let t=o.tagName.toLowerCase();for(let i of Ti){let s=o.getAttribute(i);if(!s)continue;let r=`${t}[${i}="${xi(s)}"]`;if(he(r,e))return r}return null},Si=(o,e)=>{let t=[],i=o;for(let s=0;s<mi&&i;s++){let r=Oi(i),a=i.tagName.toLowerCase();if(t.unshift(r.length?`${a}.${r.map(Qe).join(".")}`:a),s===0&&!r.length)return null;let l=t.join(" > ");if(he(l,e))return l;i=i.parentElement}return null},Ni=(o,e)=>{if(o===e.body)return"body";let t=[],i=o;for(let r=0;r<fi&&i;r++){if(i===e.body){t.unshift("body");break}if(i.id){let l=[`#${Qe(i.id)}`,...t].join(" > ");if(he(l,e))return l}let{index:a}=et(i);t.unshift(`${i.tagName.toLowerCase()}:nth-of-type(${a+1})`),i=i.parentElement}let s=t.join(" > ");return he(s,e)?s:null},to=(o,e)=>Ri(o,e)||Ai(o,e)||Si(o,e)||Ni(o,e);function oo(o){return to(o,o.ownerDocument)}function io(o,e,t){let i=o.ownerDocument,{index:s,count:r}=et(o);return{version:1,selector:to(o,i),fingerprint:{tagName:o.tagName,textSnippet:eo(o.textContent),attributes:Ii(o),siblingIndex:s,siblingCount:r},relativeX:e,relativeY:t}}var vi=(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(" ")),i=new Set(e.split(" ")),s=0;for(let r of t)i.has(r)&&s++;return 2*s/(t.size+i.size)},wi=(o,e)=>{let t=Object.keys(e);if(!t.length)return 1;let i=0;for(let s of t)(o.getAttribute(s)||"").slice(0,Je)===e[s]&&i++;return i/t.length},Jt=(o,e)=>{let{index:t,count:i}=et(o),s=Math.abs(t-e.siblingIndex),r=Math.max(e.siblingCount,i,1);return Math.max(0,1-s/r)},Li=(o,e)=>{if(o.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?Jt(o,e):s*vi(eo(o.textContent),e.textSnippet)+r*wi(o,e.attributes||{})+a*Jt(o,e)},Qt=(o,e)=>{let t=null;for(let i of o){let s=Li(i,e);(!t||s>t.confidence||s===t.confidence&&t.element.contains(i))&&(t={element:i,confidence:s})}return t};function tt(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=Qt(a,t);if(l&&l.confidence>=gi)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=Qt(s,t);return r&&r.confidence>=Ei?r:null}var Ie="helldots-comments",Re="helldots-pending-detail";function ot(){try{let o=localStorage.getItem(Ie);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 no(o){try{return localStorage.setItem(Ie,JSON.stringify(o)),!0}catch{return!1}}function Ae(o){if(no(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],i=0;for(let{index:s}of e)if(t[s]={...t[s],contextScreenshot:null},i++,no(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 it(o,e,t){let i=new Set(e.map(r=>String(r.id)));return[...o.filter(r=>!i.has(String(r.id))&&r.page!==t),...e]}var ro="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var so=(o=21)=>{let e="",t=crypto.getRandomValues(new Uint8Array(o|=0));for(;o--;)e+=ro[t[o]&63];return e};var nt=()=>so(),B=o=>typeof o=="string"?o.trim():"",O=(o,e)=>String(o)===String(e);var Z=new Set,J=null,Se=null,Mi=o=>[...o.querySelectorAll('[role="menuitem"], [role="menuitemradio"]')],ao=4,Bi=o=>{for(let e=o.parentElement;e;e=e.parentElement){let{overflowX:t,overflowY:i}=getComputedStyle(e);if(t!=="visible"||i!=="visible")return e.getBoundingClientRect()}return null},Di=(o,e)=>{e.classList.remove(n.INBOX_MENU_UP),e.classList.remove(n.INBOX_MENU_START);let t=Bi(e),i=Math.min(t?.bottom??1/0,window.innerHeight),s=Math.max(t?.top??0,0),r=Math.max(t?.left??0,0),a=Math.min(t?.right??1/0,window.innerWidth),{height:l,width:c,left:d}=e.getBoundingClientRect(),p=o.getBoundingClientRect(),h=p.bottom+ao+l,u=p.top-ao-l;h>i&&u>=s&&e.classList.add(n.INBOX_MENU_UP),d<r&&p.left+c<=a&&e.classList.add(n.INBOX_MENU_START)},lo=(o,e)=>(typeof e.composedPath=="function"?e.composedPath():[]).includes(o)||o.contains(e.target),ki=()=>{J||(J=o=>{for(let e of[...Z])lo(e.menu,o)||lo(e.button,o)||e.close()},document.addEventListener("mousedown",J,!0),Se=o=>{let e=[...Z].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=Mi(e.menu);if(t.length===0)return;o.preventDefault(),o.stopPropagation();let i=e.menu.getRootNode(),s=t.indexOf(i.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",Se,!0))},Pi=()=>{J&&(document.removeEventListener("mousedown",J,!0),J=null,document.removeEventListener("keydown",Se,!0),Se=null)},Ne=()=>{for(let o of[...Z])o.close()},V=(o,e)=>{let t={button:o,menu:e,close:()=>{e.style.display="none",o.setAttribute("aria-expanded","false"),Z.delete(t),Z.size===0&&Pi()}},i=()=>{Ne(),e.style.display="block",Di(o,e),o.setAttribute("aria-expanded","true"),Z.add(t),ki()},s=()=>e.style.display!=="none";return e.style.display="none",o.setAttribute("aria-expanded","false"),o.addEventListener("click",r=>{r.stopPropagation();let a=s();Ne(),a||i()}),{open:i,close:t.close,isOpen:s}};var ve=(o,e)=>B(o?.id)||o?.name||e.anonymous,rt=o=>{let e=o?.reactions;return!e||typeof e!="object"?[]:ce.filter(t=>e[t]?.length>0).map(t=>({emoji:t,authors:[...e[t]]}))},st=o=>{if(!o||typeof o!="object")return null;let e={};for(let t of ce){let i=o[t];if(!Array.isArray(i))continue;let s=[];for(let r of i){if(typeof r!="string")continue;let a=r.trim();a&&!s.includes(a)&&s.push(a)}s.length>0&&(e[t]=s)}return Object.keys(e).length>0?e:null},at=(o,e,t)=>{if(!ce.includes(e)||!t)return!1;o.reactions||(o.reactions={});let i=o.reactions[e]||[],s=i.indexOf(t);return s>=0?i.splice(s,1):i.push(t),i.length>0?o.reactions[e]=i:delete o.reactions[e],!0},lt=o=>{let e=Object.entries(o||{}).filter(([,t])=>t?.length>0);return e.length>0?Object.fromEntries(e.map(([t,i])=>[t,[...i]])):null},$i='<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M20.94 11.08A9 9 0 1 1 12.92 3.06"/><path d="M8.5 14.2a4.6 4.6 0 0 0 7 0"/><path d="M9 9.5h.01M15 9.5h.01"/><path d="M19 2.6v4M17 4.6h4"/></svg>',we=({actorKey:o,strings:e,onToggle:t})=>{let i=new WeakMap,s=c=>{let d=i.get(c);if(d)for(let p of d)p.el.isConnected?p.repaint():d.delete(p)},r=(c,d)=>{t(c,d),s(c)},a=(c,{className:d,tooltip:p=!0})=>{let h=document.createElement("div");h.className=n.REACTION_TRIGGER;let u=document.createElement("button");u.type="button",u.className=d,u.dataset.action="react",p&&(u.dataset.hdTooltip=e.addReaction),u.setAttribute("aria-label",e.addReaction),u.innerHTML=$i;let f=document.createElement("div");f.className=n.REACTION_PALETTE,f.setAttribute("role","menu"),f.setAttribute("aria-label",e.reactionPickerLabel);let m=V(u,f);for(let g of ce){let E=document.createElement("button");E.type="button",E.className=n.REACTION_PALETTE_ITEM,E.setAttribute("role","menuitem"),E.dataset.reactionEmoji=g,E.textContent=g,E.setAttribute("aria-label",g),E.addEventListener("click",_=>{_.stopPropagation(),m.close(),r(c,g)}),f.appendChild(E)}return h.appendChild(u),h.appendChild(f),h};return{bar:c=>{let d=document.createElement("div");d.className=n.REACTION_BAR,d.setAttribute("role","group"),d.setAttribute("aria-label",e.reactionsLabel);let p=()=>{d.replaceChildren();let u=rt(c),f=o();if(d.hidden=u.length===0,!d.hidden){for(let{emoji:m,authors:g}of u){let E=g.includes(f),_=document.createElement("button");_.type="button",_.className=n.REACTION_PILL,E&&_.classList.add(n.REACTION_PILL_MINE),_.dataset.reactionEmoji=m;let C=E?e.reactionToggleOff:e.reactionToggleOn;_.setAttribute("aria-pressed",String(E)),_.setAttribute("aria-label",`${C}: ${m} (${g.length})`),_.addEventListener("click",q=>{q.stopPropagation(),r(c,m)});let T=document.createElement("span");T.className=n.REACTION_PILL_EMOJI,T.textContent=m,T.setAttribute("aria-hidden","true");let v=document.createElement("span");v.className=n.REACTION_PILL_COUNT,v.textContent=String(g.length),_.appendChild(T),_.appendChild(v),d.appendChild(_)}d.appendChild(a(c,{className:n.REACTION_ADD}))}},h=i.get(c);return h||i.set(c,h=new Set),h.add({el:d,repaint:p}),p(),d},trigger:a,refresh:s}};var Hi=(o,e)=>B(o?.authorId)||(typeof o?.author=="string"?o.author.trim():"")||e.anonymous,Xi=(o,e,t)=>Hi(o,t)===ve(e,t),co=({can:o,action:e,target:t,user:i,strings:s})=>{if(typeof o!="function")return Xi(t,i,s);try{return o(e,t)===!0}catch(r){return console.warn("HellDots: can() threw, denying",e,r),!1}},ue=o=>({id:o.id,author:o.author,authorId:o.authorId||null}),me=(o,e)=>({id:o.id,author:o.author,authorId:o.authorId||null,commentId:e});var fe="helldotsComment",Q=(o,e=fe,t=location.href)=>{let i=new URL(t),s=o.page||i.pathname,r=s===i.pathname?i:new URL(s,i);return r.searchParams.set(e,String(o.id)),r.href},ct=(o=fe,e=location.href)=>{try{return new URL(e).searchParams.get(o)}catch{return null}};var po=["created","edited","status","classified"],ho=["type","priority","tags"],Ui=64,Le=o=>typeof o=="string"?o.trim().slice(0,Ui):"",Me=o=>o===null?{present:!0,value:null}:typeof o=="string"?{present:!0,value:Le(o)}:{present:!1,value:void 0};function uo(o,e){let t=Le(o?.name)||e.anonymous,i=B(o?.id);return i?{id:i,name:t}:{name:t}}function Y(o,e,t,i){if(!po.includes(e))return null;let s={type:e,at:new Date().toISOString(),actor:t};i?.field&&ho.includes(i.field)&&(s.field=i.field);let r=Me(i?.from);r.present&&(s.from=r.value);let a=Me(i?.to);return a.present&&(s.to=a.value),Array.isArray(o.history)||(o.history=[]),o.history.push(s),s}function mo(o){if(!Array.isArray(o))return null;let e=[];for(let t of o){if(!t||typeof t!="object"||!po.includes(t.type))continue;let i=Le(t.at);if(!Number.isFinite(Date.parse(i)))continue;let s=Le(t.actor?.name),r=B(t.actor?.id),a={type:t.type,at:i,actor:r?{id:r,name:s}:{name:s}};ho.includes(t.field)&&(a.field=t.field);let l=Me(t.from);l.present&&(a.from=l.value);let c=Me(t.to);c.present&&(a.to=c.value),e.push(a)}return e.length===0?null:(e.sort((t,i)=>Date.parse(t.at)-Date.parse(i.at)),e)}function fo(o){return!Array.isArray(o)||o.length===0?null:o.map(e=>({...e,actor:{...e.actor}}))}function j(o){if(!Array.isArray(o?.history))return[];let e=[],t=null;for(let s of o.history)s.type==="status"&&(s.to==="resolved"?t=s.at:t&&(e.push({resolvedAt:t,reopenedAt:s.at,ms:0}),t=null));t&&e.push({resolvedAt:t,reopenedAt:null,ms:0});let i=Date.parse(o.createdAt);for(let s of e){let r=Date.parse(s.resolvedAt);s.ms=Number.isFinite(i)&&Number.isFinite(r)?Math.max(0,r-i):0}return e}function ee(o){if(o?.status!=="resolved")return null;let e=j(o),t=e[e.length-1];if(t&&!t.reopenedAt)return t.ms;let i=Date.parse(o.resolvedAt),s=Date.parse(o.createdAt);return!Number.isFinite(i)||!Number.isFinite(s)?null:Math.max(0,i-s)}var dt=new Set,go=()=>{for(let o of[...dt])o(!1)},Be=(o,{title:e,message:t,confirmLabel:i,cancelLabel:s})=>new Promise(r=>{let a=document.createElement("div");a.className=n.CONFIRM,a.style.zIndex=String(M.CONFIRM);let l=document.createElement("div");l.className=n.CONFIRM_PANEL,l.setAttribute("role","alertdialog"),l.setAttribute("aria-modal","true");let c=document.createElement("h2");c.className=n.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=n.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=n.CONFIRM_ACTIONS;let h=document.createElement("button");h.type="button",h.className=n.CONFIRM_CANCEL,h.textContent=s;let u=document.createElement("button");u.type="button",u.className=n.CONFIRM_ACCEPT,u.textContent=i,p.appendChild(h),p.appendChild(u),l.appendChild(c),l.appendChild(d),l.appendChild(p),a.appendChild(l);let f=o.activeElement||document.activeElement,m=!1,g=T=>{m||(m=!0,dt.delete(g),document.removeEventListener("keydown",E,!0),a.remove(),f?.focus?.(),r(T))},E=T=>{if(T.key==="Escape"){T.stopPropagation(),T.preventDefault(),g(!1);return}if(T.key!=="Tab")return;let v=[h,u],q=o.activeElement||document.activeElement,b=v.indexOf(q);T.preventDefault(),(T.shiftKey?v[(b<=0?v.length:b)-1]:v[(b+1)%v.length]).focus()};h.addEventListener("click",()=>g(!1)),u.addEventListener("click",()=>g(!0));let _=!1;a.addEventListener("mousedown",T=>{_=T.target===a,T.stopPropagation()}),a.addEventListener("click",T=>{T.target===a&&_&&g(!1),_=!1}),dt.add(g),document.addEventListener("keydown",E,!0),(o.body||o).appendChild(a),h.focus()});var Eo='<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>',Fi='<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>',Gi='<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>',oe=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()},D=(o,e)=>({open:e.statusOpen,in_progress:e.statusInProgress,in_review:e.statusInReview,resolved:e.statusResolved})[o]||e.statusOpen,w=(o,e)=>({bug:e.typeBug,suggestion:e.typeSuggestion,question:e.typeQuestion,improvement:e.typeImprovement})[o]||e.unset,L=(o,e)=>({high:e.priorityHigh,medium:e.priorityMedium,low:e.priorityLow})[o]||e.unset,te=({action:o,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 d=document.createElement("button");d.type="button",d.className=n.INBOX_ACTION_BTN,l&&d.classList.add(n.INBOX_ACTION_BTN_LABELED),d.dataset.action=o,d.setAttribute("aria-haspopup","true");let p=document.createElement("span");p.className=n.INBOX_STATUS_DOT,d.appendChild(p);let h=null;l&&(h=document.createElement("span"),h.className=n.INBOX_ACTION_LABEL,d.appendChild(h));let u=document.createElement("div");u.className=n.INBOX_MENU,u.setAttribute("role","menu");let f=V(d,u),m=t,g=()=>{let E=`${r}: ${s(m)}`;p.style.backgroundColor=i(m),d.dataset.hdTooltip=E,d.setAttribute("aria-label",E),h&&(h.textContent=s(m)),u.querySelectorAll("[data-picker-option]").forEach(_=>{let C=_.dataset.pickerOption,T=C===""?null:C;_.setAttribute("aria-checked",String(T===m))})};for(let E of e){let _=document.createElement("button");_.type="button",_.className=n.INBOX_MENU_ITEM,_.dataset.pickerOption=E===null?"":E,_.setAttribute("role","menuitemradio");let C=document.createElement("span");C.className=n.INBOX_STATUS_DOT,C.style.backgroundColor=i(E),_.appendChild(C),_.appendChild(document.createTextNode(s(E))),_.addEventListener("click",T=>{T.stopPropagation(),f.close(),E!==m&&(m=E,a(E),g())}),u.appendChild(_)}return c.appendChild(d),c.appendChild(u),g(),c},pt=({label:o,tooltip:e,items:t})=>{let i=document.createElement("div");i.style.position="relative";let s=document.createElement("button");s.type="button",s.className=n.INBOX_ACTION_BTN,s.dataset.action="menu",e&&(s.dataset.hdTooltip=e),s.setAttribute("aria-label",o),s.innerHTML=Gi;let r=document.createElement("div");r.className=n.INBOX_MENU,r.setAttribute("role","menu");let a=V(s,r);for(let l of t){let c=document.createElement("button");c.type="button",c.className=n.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 Be(p,l.confirm()))return}l.onSelect()}),r.appendChild(c)}return i.appendChild(s),i.appendChild(r),i},De=(o,{strings:e,reactions:t,can:i,onCopy:s,onCopyLink:r,onEdit:a,onSetStatus:l,onSetType:c,onSetPriority:d,onDelete:p})=>{let h=document.createElement("div");h.className=n.INBOX_CARD_ACTIONS;let u=document.createElement("div");u.className=n.ACTIONS_GROUP;let f=document.createElement("div");f.className=`${n.ACTIONS_GROUP} ${n.ACTIONS_GROUP_END}`,h.appendChild(u),h.appendChild(f),t&&f.appendChild(t.trigger(o,{className:n.INBOX_ACTION_BTN}));let m=document.createElement("button");m.type="button",m.className=n.INBOX_ACTION_BTN,m.dataset.action="copy",m.dataset.hdTooltip=e.copyAgentContext,m.setAttribute("aria-label",e.copyAgentContext),m.innerHTML=Eo,m.addEventListener("click",C=>{C.stopPropagation(),s(o),m.innerHTML=Fi,m.dataset.hdTooltip=e.copied,setTimeout(()=>{m.innerHTML=Eo,m.dataset.hdTooltip=e.copyAgentContext},1500)}),f.appendChild(m),u.appendChild(te({action:"status",options:N,value:o.status||"open",colorOf:C=>F[C]||F.open,labelOf:C=>D(C,e),tooltipLabel:e.statusLabel,onSelect:C=>l(o,C),showLabel:!0})),u.appendChild(te({action:"type",options:[null,...A],value:o.type||null,colorOf:C=>G[C]||"transparent",labelOf:C=>w(C,e),tooltipLabel:e.typeLabel,onSelect:C=>c?.(o,C),showLabel:!0})),u.appendChild(te({action:"priority",options:[null,...S],value:o.priority||null,colorOf:C=>z[C]||"transparent",labelOf:C=>L(C,e),tooltipLabel:e.priorityLabel,onSelect:C=>d?.(o,C),showLabel:!0}));let g=ue(o),E=C=>i?i(C,g):!0,_=[{label:e.copyLink,feedbackLabel:e.linkCopied,onSelect:()=>r?.(o)}];return E("edit:comment")&&_.push({label:e.editComment,onSelect:()=>a?.(o)}),E("delete:comment")&&_.push({label:e.deleteComment,onSelect:()=>p(o),confirm:()=>({title:e.confirmDeleteCommentTitle,message:o.replies?.length?e.confirmDeleteThreadMessage:e.confirmDeleteCommentMessage,confirmLabel:e.confirmDelete,cancelLabel:e.confirmCancel})}),f.appendChild(pt({label:e.commentOptions,tooltip:e.moreOptions,items:_})),h};var ie=({value:o,strings:e,onInput:t,onSave:i,onCancel:s})=>{let r=document.createElement("div");r.className=n.EDITOR;let a=document.createElement("textarea");a.className=n.EDITOR_INPUT,a.value=o,a.rows=3,a.setAttribute("aria-label",e.editorAriaLabel);let l=document.createElement("div");l.className=n.EDITOR_ACTIONS;let c=document.createElement("button");c.type="button",c.className=n.EDITOR_CANCEL,c.textContent=e.editCancel;let d=document.createElement("button");d.type="button",d.className=n.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(),i(a.value))}),c.addEventListener("click",h=>{h.stopPropagation(),s()}),d.addEventListener("click",h=>{h.stopPropagation(),d.disabled||i(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},ke=(o,e)=>Be(o,{title:e.confirmDiscardTitle,message:e.confirmDiscardMessage,confirmLabel:e.confirmDiscard,cancelLabel:e.confirmKeepEditing});var zi=(o,e)=>{let t=Date.now()-new Date(o).getTime(),i=Math.floor(t/6e4),s=Math.floor(t/36e5),r=Math.floor(t/864e5);return i<1?e.justNow:i<60?R(e.minutesAgoTemplate,i):s<24?R(e.hoursAgoTemplate,s):R(e.daysAgoTemplate,r)},bo=(o,e)=>new Intl.DateTimeFormat(e,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}).format(new Date(o)),Vi=o=>{let e=document.createElement("span");e.className=n.THREAD_AUTHOR;let t=document.createElement("span");return t.className=n.THREAD_AUTHOR_NAME,t.textContent=o,e.appendChild(t),e.addEventListener("mouseenter",()=>{t.scrollWidth>t.clientWidth?e.dataset.hdTooltip=o:delete e.dataset.hdTooltip}),e},ge=(o,e,t,i,s=null)=>{let r=document.createElement("div");r.className=n.THREAD_META;let a=Vi(o||t.anonymous),l=document.createElement("span");return l.className=n.THREAD_TIME,l.textContent=zi(e,t),l.dataset.fullDate=bo(e,i),r.appendChild(a),r.appendChild(l),s&&r.appendChild(ut(s,t,i)),r},ut=(o,e,t)=>{let i=document.createElement("span");return i.className=n.THREAD_EDITED,i.textContent=e.editedMark,i.dataset.fullDate=e.editedAtPrefix+bo(o,t),i},mt=()=>/Mac|iPod|iPhone|iPad/.test(navigator.userAgent),ft=(o,e)=>{let t=mt(),i={alt:t?"\u2325":e.modifierAlt,ctrl:t?"\u2318":e.modifierCtrl,shift:t?"\u21E7":e.modifierShift},s=i[o.shortcutModifier]||i.alt,r=o.shortcutKey?.toUpperCase()||"C";return`${s} + ${r}`},Pe='<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>',Yi='<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>',ji='<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>',Wi='<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>',Ki='<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>',gt='<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/><circle cx="12" cy="12" r="3"/></svg>',_o='<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"/><line x1="1" y1="1" x2="23" y2="23"/></svg>',$e=({areaClassName:o,inputTag:e="textarea",inputClassName:t,inputId:i,inputPlaceholder:s,submitBtnId:r,fileInputId:a},l)=>{let c=document.createElement("div");c.className=o;let d=document.createElement(e);i&&(d.id=i),t&&(d.className=t),d.placeholder=s,d.setAttribute("aria-label",s),e==="input"&&(d.type="text");let p=document.createElement("div");p.className=n.SCREENSHOTS_CONTAINER;let h=document.createElement("div");h.className=n.COMMENT_ACTIONS_BAR;let u=document.createElement("button");u.className=n.ATTACH_IMAGE_BTN,u.type="button",u.setAttribute("aria-label",l.attachImage),u.innerHTML=Yi;let f=document.createElement("input");f.type="file",a&&(f.id=a),f.accept="image/*",f.style.display="none";let m=document.createElement("button");return r&&(m.id=r),m.className=n.THREAD_SUBMIT,m.type="button",m.setAttribute("aria-label",l.send),m.innerHTML=ji,h.appendChild(u),h.appendChild(f),h.appendChild(m),c.appendChild(d),c.appendChild(p),c.appendChild(h),{container:c,inputEl:d,screenshotsContainer:p,attachBtn:u,fileInput:f,submitBtn:m}},ht=(o,e,t,i)=>{let s=document.createElement("div");s.className=n.TOOLBAR_ACTION_WRAPPER;let r=document.createElement("div");r.className=n.TOOLBAR_ACTION_TOOLTIP,t.forEach(l=>r.appendChild(l));let a=document.createElement("button");return a.type="button",a.className=`${n.TOOLBAR_ACTION_BTN} ${o}`,a.setAttribute("aria-label",i),a.innerHTML=e,s.appendChild(r),s.appendChild(a),s},Co=(o={},e=H)=>{let t=document.createElement("div");t.id=x.TOOLBAR;let i=document.createElement("div");i.className=n.TOOLBAR_ACTIONS;let s=document.createElement("span");s.className=n.TOOLBAR_TEXT,s.textContent=e.toolbarComment;let r=document.createElement("span");r.className=n.SHORTCUT_HINT,r.textContent=ft(o,e);let a=ht(n.TOOLBAR_COMMENT_BTN,Wi,[s,r],e.toolbarComment);a.querySelector(`.${n.TOOLBAR_COMMENT_BTN}`)?.setAttribute("aria-pressed","false");let l=document.createElement("span");l.className=n.TOOLBAR_TEXT,l.textContent=e.toolbarInbox;let c=ht(n.TOOLBAR_MENU_BTN,Ki,[l],e.toolbarInbox);i.appendChild(a),i.appendChild(c),t.appendChild(i);let d=document.createElement("span");d.className=n.TOOLBAR_TEXT,d.textContent=e.toolbarHideComments;let p=ht(n.TOOLBAR_EYE_BTN,gt,[d],e.toolbarHideComments),h=document.createElement("div");return h.className=n.TOOLBAR_VISIBILITY,h.appendChild(p),t.appendChild(h),t},Et=(o,e,{includeStatus:t=!1,includeClassification:i=!0}={})=>{let s=document.createElement("div");s.className=n.INBOX_BADGES;let r=(a,l,c)=>{let d=document.createElement("span");d.className=`${n.BADGE} ${l}`,d.textContent=a,c&&(d.style.borderColor=c),s.appendChild(d)};if(t){let a=o.status||"open";r(D(a,e),n.BADGE_STATUS,F[a])}i&&o.type&&r(w(o.type,e),n.BADGE_TYPE,G[o.type]),i&&o.priority&&r(L(o.priority,e),n.BADGE_PRIORITY,z[o.priority]);for(let a of o.tags||[])r(a,n.BADGE_TAG,null);if(o.status==="resolved"){let a=ee(o),l=a===null?"":X(a,e);r(R(e.resolvedInTemplate,l||"\u2014"),n.BADGE_DURATION,null)}return s.children.length?s:null},qi=o=>{let e=document.createElement("div");e.className=n.CLASSIFY_ROW;let t=null,i=null,s=()=>{e.replaceChildren(),e.appendChild(te({action:"type",options:[null,...A],value:null,colorOf:r=>G[r]||"transparent",labelOf:r=>w(r,o),tooltipLabel:o.typeLabel,onSelect:r=>t=r,showLabel:!0})),e.appendChild(te({action:"priority",options:[null,...S],value:null,colorOf:r=>z[r]||"transparent",labelOf:r=>L(r,o),tooltipLabel:o.priorityLabel,onSelect:r=>i=r,showLabel:!0}))};return s(),{container:e,getType:()=>t,getPriority:()=>i,reset:()=>{t=null,i=null,s()}}},To=(o=H)=>{let e=document.createElement("div");e.id=x.COMMENT_BOX,e.setAttribute("role","dialog"),e.setAttribute("aria-label",o.commentBoxAriaLabel);let{container:t}=$e({areaClassName:n.COMMENT_INPUT_AREA,inputTag:"textarea",inputId:x.COMMENT_INPUT,inputPlaceholder:o.commentPlaceholder,submitBtnId:x.SUBMIT_COMMENT,fileInputId:x.ATTACH_IMAGE_INPUT},o),i=qi(o);return e.appendChild(i.container),e.appendChild(t),e.style.display="none",e.classify=i,e},W=o=>String(o).replace(/[\\"]/g,"\\$&"),xo=o=>`[data-comment-id="${W(o)}"]`,bt=o=>o.screenshots||(o.screenshot?[o.screenshot]:[]),ne=(o,e,{strings:t,onShow:i,rerender:s,pending:r=0})=>{o.innerHTML="",o.classList.toggle(n.ACTIVE,e.length>0||r>0),e.forEach((a,l)=>{let c=document.createElement("div");c.className=n.SCREENSHOT_ITEM;let d=document.createElement("img");d.className=n.SCREENSHOT_IMG,d.src=a,d.alt=t.attachedScreenshot,yo(d,()=>i(a));let p=document.createElement("button");p.type="button",p.className=n.SCREENSHOT_REMOVE,p.setAttribute("aria-label",t.removeScreenshot),p.innerHTML="&times;",p.onclick=h=>{h.stopPropagation(),e.splice(l,1),s()},c.appendChild(d),c.appendChild(p),o.appendChild(c)});for(let a=0;a<r;a++){let l=document.createElement("div");l.className=`${n.SCREENSHOT_ITEM} ${n.SCREENSHOT_PENDING}`,l.setAttribute("role","status"),l.setAttribute("aria-live","polite"),l.textContent=t.capturingScreenshot,o.appendChild(l)}},Zi=o=>new Promise(e=>{let t=new FileReader;t.onload=i=>e(i.target.result),t.onerror=()=>e(null),t.readAsDataURL(o)}),re=(o,e,t,i)=>{o.addEventListener("change",async s=>{let r=s.target.files[0];if(!r||r.type&&!r.type.startsWith("image/")||e().length>=le)return;let a=Zi(r);o.value="";let l=await a;if(!l)return;let c=e();if(c.length>=le||(c.push(l),t(),!i))return;let d=await i(l),p=c.indexOf(l);p!==-1&&(c[p]=d,t())})},$=(o,e)=>{o.querySelectorAll(`.${n.SCREENSHOT_IMG}`).forEach(t=>{yo(t,()=>e(t.src))})},yo=(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())})},Oo=(o,e=H)=>{let t=document.createElement("div");return t.className=n.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=`
5
5
  position: absolute;
6
6
  pointer-events: auto;
7
- `,t},fe=(i,e)=>{let t=document.createElement("div");return t.className=n.SCREENSHOTS_CONTAINER,t.classList.add(n.ACTIVE),i.forEach(o=>{let s=document.createElement("div");s.className=n.SCREENSHOT_ITEM;let r=document.createElement("img");r.className=n.SCREENSHOT_IMG,r.src=o,r.alt=e.attachedScreenshot,s.appendChild(r),t.appendChild(s)}),t},xo=(i,e=H,t)=>{let o=document.createElement("div");o.className=n.TOOLTIP,o.dataset.for=i.id,o.setAttribute("role","dialog"),o.setAttribute("aria-label",e.tooltipAriaLabel);let s=document.createElement("div");s.className=n.THREAD_HEADER;let r=me(i.author,i.createdAt,e,t,i.editedAt),a=document.createElement("button");a.type="button",a.className=n.CLOSE_TOOLTIP,a.setAttribute("aria-label",e.close),a.innerHTML="&times;",s.appendChild(r),s.appendChild(a);let l=document.createElement("div");l.className=n.THREAD_BODY,l.textContent=i.text,o.appendChild(s),o.appendChild(l);let c=mt(i,e,{includeStatus:!0});c&&o.appendChild(c);let d=ft(i);d.length>0&&o.appendChild(fe(d,e));let p=i.replies?.length||0;if(p>0){let h=document.createElement("div");h.className=n.TOOLTIP_REPLY_COUNT,h.textContent=p===1?e.replyCountOne:I(e.replyCountTemplate,p),o.appendChild(h)}return o},ge=(i,e=H,t,{onDelete:o,onEdit:s,editing:r=null,reactions:a=null}={})=>{let l=document.createElement("div");l.className=n.THREAD_REPLY,l.dataset.replyId=String(i.id);let c=me(i.author,i.timestamp,e,t,i.editedAt),d=[];s&&d.push({label:e.editReply,onSelect:()=>s(i)}),o&&d.push({label:e.deleteReply,onSelect:()=>o(i,l),confirm:()=>({title:e.confirmDeleteReplyTitle,message:e.confirmDeleteReplyMessage,confirmLabel:e.confirmDelete,cancelLabel:e.confirmCancel})});let p=document.createElement("div");p.className=`${n.ACTIONS_GROUP} ${n.THREAD_REPLY_ACTIONS}`,a&&p.appendChild(a.trigger(i,{className:n.INBOX_ACTION_BTN})),d.length>0&&p.appendChild(lt({label:e.replyOptions,items:d})),p.children.length>0&&c.appendChild(p);let h;r?h=ie({value:r.draft,strings:e,onInput:r.onInput,onSave:r.onSave,onCancel:r.onCancel}):(h=document.createElement("div"),h.className=n.THREAD_BODY,h.textContent=i.text),l.appendChild(c),l.appendChild(h);let u=ft(i);return u.length>0&&l.appendChild(fe(u,e)),a&&l.appendChild(a.bar(i)),l},yo=(i,e=H,t,{onDeleteReply:o,onEditReply:s,reactions:r=null}={})=>{let a=document.createElement("div");a.className=n.THREAD_POPOVER,a.dataset.for=i.id,a.setAttribute("role","dialog"),a.setAttribute("aria-label",e.popoverAriaLabel);let l=document.createElement("div");l.className=n.THREAD_HEADER;let c=me(i.author,i.createdAt,e,t,i.editedAt),d=document.createElement("button");d.type="button",d.className=n.CLOSE_TOOLTIP,d.setAttribute("aria-label",e.close),d.innerHTML="&times;",l.appendChild(c),l.appendChild(d);let p=document.createElement("div");p.className=n.THREAD_BODY,p.textContent=i.text;let h=document.createElement("div");h.className=n.THREAD_REPLIES,i.replies&&i.replies.forEach(g=>{h.appendChild(ge(g,e,t,{onDelete:o,onEdit:s,reactions:r}))});let{container:u}=De({areaClassName:n.THREAD_INPUT_AREA,inputTag:"input",inputClassName:n.THREAD_INPUT,inputPlaceholder:e.replyPlaceholder},e),m=document.createElement("div");m.className=n.THREAD_SCROLL,a.appendChild(l),m.appendChild(p);let f=ft(i);return f.length>0&&m.appendChild(fe(f,e)),r&&m.appendChild(r.bar(i)),m.appendChild(h),a.appendChild(m),a.appendChild(u),a};var ke=(i,{strings:e,onShowLightbox:t,collapsible:o=!1,expanded:s=!1,onToggle:r})=>{let{context:a,contextScreenshot:l}=i;if(!a&&!l)return null;let c=document.createElement("div");c.className=n.CONTEXT_BLOCK;let d=document.createElement("div");if(d.className=n.CONTEXT_BODY,o){let p=document.createElement("button");p.type="button",p.className=n.CONTEXT_TOGGLE,p.setAttribute("aria-expanded",String(s)),p.innerHTML=`<span>${e.contextSection}</span>${Be}`,d.style.display=s?"":"none",p.addEventListener("click",h=>{h.stopPropagation();let u=p.getAttribute("aria-expanded")==="true";p.setAttribute("aria-expanded",String(!u)),d.style.display=u?"none":"",r?.(!u)}),c.appendChild(p)}else{let p=document.createElement("div");p.className=n.CONTEXT_TITLE,p.textContent=e.contextSection,c.appendChild(p)}if(l){let p=document.createElement("div");p.className=n.CONTEXT_SCREENSHOT_CAPTION,p.textContent=e.autoScreenshotLabel,d.appendChild(p);let h=document.createElement("img");h.className=n.SCREENSHOT_IMG,h.src=l,h.alt=e.autoScreenshotLabel,d.appendChild(h),$(d,t)}if(a){let p=(m,f)=>{if(!f)return;let g=document.createElement("div");g.className=n.CONTEXT_ROW;let _=document.createElement("span");_.textContent=m;let b=document.createElement("span");b.textContent=f,g.appendChild(_),g.appendChild(b),d.appendChild(g)},h=m=>m?`${m.width}\xD7${m.height}`:"",u=m=>m?.name?`${m.name} ${m.version||""}`.trim():"";p(e.contextUrl,a.url),p(e.contextViewport,h(a.viewport)),p(e.contextScreen,h(a.screen)),p(e.contextBrowser,u(a.browser)),p(e.contextOs,u(a.os))}return c.appendChild(d),c};var ji=i=>{let e=[...i.attributes].map(({name:t,value:o})=>`${t}="${o}"`).join(" ");return`<${i.tagName.toLowerCase()}${e?` ${e}`:""}>`},Wi=i=>{if(!i?.tagName)return"(unknown)";let e=Object.entries(i.attributes||{}).map(([t,o])=>`${t}="${o}"`).join(" ");return`<${i.tagName.toLowerCase()}${e?` ${e}`:""}>`},Ki=i=>{let e=[],t=i;for(;t&&t!==document.documentElement;){let o=t.tagName.toLowerCase(),s=t.id?`#${t.id}`:"",r=[...t.classList].slice(0,2).map(a=>`.${a}`).join("");if(e.unshift(`${o}${s}${r}`),t===document.body)break;t=t.parentElement}return e.join(" > ")};function Pe(i,{viewportWidth:e,viewportHeight:t,strings:o}){let s=i.anchor,r=s?.fingerprint,a=i.container?.isConnected?i.container:null,l=i.hidden?"hidden":i.anchorState,c=a?ji(a):Wi(r),d=a?Ki(a):"(unavailable)",p=i.context?.viewport,h=p?.width??e,u=p?.height??t,m=[`Page: ${i.page}`,`Viewport: ${h}x${u}`,`Anchor state: ${l}`,`Status: ${i.status||"open"}`,`Selector: ${s?.selector||"(none)"}`,`Element: ${c}`,`DOM path: ${d}`,`Nearby text: "${r?.textSnippet??""}"`,`Comment by ${i.author} (${i.createdAt}):`,`"${i.text}"`];i.type&&m.push(`Type: ${i.type}`),i.priority&&m.push(`Priority: ${i.priority}`),i.tags?.length&&m.push(`Tags: ${i.tags.join(", ")}`);let f=i.context;if(f&&(f.url&&m.push(`URL: ${f.url}`),f.screen&&m.push(`Screen: ${f.screen.width}x${f.screen.height}`),f.browser?.name&&m.push(`Browser: ${`${f.browser.name} ${f.browser.version||""}`.trim()}`),f.os?.name&&m.push(`OS: ${`${f.os.name} ${f.os.version||""}`.trim()}`)),o&&i.status==="resolved"&&i.resolvedAt){let _=X(new Date(i.resolvedAt).getTime()-new Date(i.createdAt).getTime(),o);_&&m.push(`Resolution time: ${_}`)}let g=i.replies||[];if(g.length>0){m.push(`Replies (${g.length}):`);for(let _ of g)m.push(`- ${_.author}: "${_.text}"`)}return m.join(`
8
- `)}var Ee=(i,e)=>{let t=e.getBoundingClientRect(),o=t.left+t.width/2,s=t.top+t.height/2,r=k,a=r/2+10,l=i.getBoundingClientRect(),c=l.width||400,d=o+a;d+c>window.innerWidth&&(d=o-a-c),d=Math.min(d,window.innerWidth-c-10),d=Math.max(10,d),i.style.left=`${d}px`;let p=10,h=s-r/2,u=window.innerHeight-p-h;l.height>u?(i.style.top="auto",i.style.bottom=`${p}px`):(i.style.bottom="auto",i.style.top=`${Math.max(p,h)}px`)},Oo=i=>{let e=i.getBoundingClientRect(),t=Math.max(10,(window.innerWidth-(e.width||400))/2),o=Math.max(10,(window.innerHeight-e.height)/2);i.style.left=`${t}px`,i.style.bottom="auto",i.style.top=`${o}px`},$e=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(`.${n.THREAD_SCROLL} > .${n.THREAD_BODY}, .${n.THREAD_SCROLL} > .${n.EDITOR}`):t.querySelector(`.${n.THREAD_REPLY}[data-reply-id="${W(e)}"]`)?.querySelector(`.${n.THREAD_BODY}, .${n.EDITOR}`)||null:null}refreshCommentViews(e,t=null){if(this.active?.dataset.for!==String(e))return;let o=this.deps.findComment(e);if(!o)return;let s=t==null?o:(o.replies||[]).find(l=>y(l.id,t));if(!s)return;let r=document.createElement("div");r.className=n.THREAD_BODY,r.textContent=s.text,this._bodyEl(t)?.replaceWith(r);let a=t==null?this.active.querySelector(`.${n.THREAD_META}`):this.active.querySelector(`.${n.THREAD_REPLY}[data-reply-id="${W(t)}"]`)?.querySelector(`.${n.THREAD_META}`);if(a&&s.editedAt&&!a.querySelector(`.${n.THREAD_EDITED}`)){let l=dt(s.editedAt,this.deps.strings,this.deps.locale),c=a.querySelector(`.${n.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:o}=this.editing,s=this.deps.findComment(e),r=t==null?s:(s?.replies||[]).find(a=>y(a.id,t));return o.trim()!==String(r?.text||"").trim()}async releaseEditor(){if(!this.editing)return!0;if(this.editorDirty()){let t=this.deps.shadowRoot;if(!await Me(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 o=e==null?t:(t.replies||[]).find(r=>y(r.id,e));if(!o)return;let s=document.createElement("div");s.className=n.THREAD_BODY,s.textContent=o.text,this._bodyEl(e)?.replaceWith(s)}async startEditing(e,t=null){if(!await this.releaseEditor())return;let o=this.deps.findComment(e),s=t==null?o:(o?.replies||[]).find(a=>y(a.id,t));if(!s)return;this.editing={commentId:e,replyId:t,draft:s.text};let r=ie({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:o,locale:s}=this.deps;this.deps.removeTooltip(t.id),e?.classList.add(n.CIRCLE_ACTIVE),this._activeCircle=e||null;let r=(E,O)=>{this.deps.actions.deleteReply(t.id,E.id)&&(O.remove(),this.deps.refreshInbox())},a=E=>this.startEditing(t.id,E.id),l=Se({actorKey:this.deps.actorKey,strings:o,onToggle:(E,O)=>E===t?this.deps.actions.toggleCommentReaction(t.id,O):this.deps.actions.toggleReplyReaction(t.id,E.id,O)}),c=yo(t,o,s,{onDeleteReply:r,onEditReply:a,reactions:l});this.deps.shadowRoot.appendChild(c);let d=c.querySelector(`.${n.THREAD_HEADER}`),p=Le(t,{strings:o,reactions:l,onCopy:E=>oe(Pe(E,{viewportWidth:window.innerWidth,viewportHeight:window.innerHeight,strings:o})),onCopyLink:E=>oe(Q(E,this.deps.linkParam())),onEdit:E=>this.startEditing(E.id),onSetStatus:(E,O)=>this.deps.actions.setStatus(E.id,O),onSetType:(E,O)=>this.deps.actions.setType(E.id,O),onSetPriority:(E,O)=>this.deps.actions.setPriority(E.id,O),onDelete:E=>{this.close(),this.deps.actions.deleteComment(E.id),this.deps.refreshInbox()}}),h=document.createElement("div");h.className=n.THREAD_ACTIONS_ROW,h.appendChild(p),d.insertAdjacentElement("afterend",h);let u=c.querySelector(`.${n.THREAD_SCROLL} > .${n.SCREENSHOTS_CONTAINER}`);u&&$(u,E=>this.deps.onShowLightbox(E));let m=ke(t,{strings:o,onShowLightbox:E=>this.deps.onShowLightbox(E),collapsible:!0});m&&c.querySelector(`.${n.THREAD_REPLIES}`).before(m),setTimeout(()=>{e?Ee(c,e):Oo(c)},10),c.querySelector(`.${n.CLOSE_TOOLTIP}`).addEventListener("click",async E=>{E.stopPropagation(),!(this.editing&&!await this.releaseEditor())&&this.close()});let f=c.querySelector(`.${n.THREAD_INPUT}`),g=c.querySelector(`.${n.THREAD_SUBMIT}`),_=c.querySelector(`.${n.THREAD_INPUT_AREA} .${n.ATTACH_IMAGE_BTN}`),b=c.querySelector(`.${n.THREAD_INPUT_AREA} input[type="file"]`),B=c.querySelector(`.${n.THREAD_INPUT_AREA} .${n.SCREENSHOTS_CONTAINER}`),C=[],N=()=>{ne(B,C,{strings:o,onShow:E=>this.deps.onShowLightbox(E),rerender:()=>N()})};_.addEventListener("click",()=>{b.click()}),re(b,()=>C,N,E=>this.deps.transformScreenshot(E,t.id));let q=()=>{let E=f.value.trim();if(!E&&C.length===0)return;let O=this.deps.actions.addReply(t,E,C.length>0?[...C]:[]),Go=c.querySelector(`.${n.THREAD_REPLIES}`),Rt=ge(O,o,s,{onDelete:r,onEdit:a,reactions:l});Go.appendChild(Rt),$(Rt,zo=>this.deps.onShowLightbox(zo));let Ue=c.querySelector(`.${n.THREAD_SCROLL}`);Ue&&(Ue.scrollTop=Ue.scrollHeight),f.value="",C=[],N(),f.focus()};g.addEventListener("click",q),f.addEventListener("keydown",E=>{E.key==="Enter"&&!E.shiftKey&&(E.preventDefault(),q())}),this.active=c,typeof ResizeObserver<"u"&&(this._resizeObserver=new ResizeObserver(()=>this.reposition()),this._resizeObserver.observe(c)),setTimeout(()=>f.focus(),50),this._armClickTimer=setTimeout(()=>{this._armClickTimer=null,this._clickHandler=E=>{let O=E.composedPath()[0]||E.target;if(!c.contains(O)&&!e?.contains(O)&&!this.deps.isInsideLightbox(O)){if(this.editorDirty())return;this.close()}},document.addEventListener("mousedown",this._clickHandler)},0)}close(){this.deps.shadowRoot?.querySelectorAll(`.${n.CIRCLE_ACTIVE}`).forEach(e=>e.classList.remove(n.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?Ee(e,this._activeCircle):Oo(e))}syncToMarker(){let e=this.active,t=this._activeCircle;if(!e||!t)return;let o=t.getBoundingClientRect();if(!(t.isConnected&&t.style.display!=="none"&&o.bottom>0&&o.right>0&&o.top<window.innerHeight&&o.left<window.innerWidth)){e.style.display="none";return}e.style.display="",Ee(e,t)}};var Io=150,gt=(i,e)=>Math.max(0,Math.min(i,e)),He=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=To(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 o=e.container.getBoundingClientRect(),s=o.width,r=o.height;if(s<=0||r<=0)return null;let a=e.relativeX*s,l=e.relativeY*r,c=gt(a,s),d=gt(l,r),p=c/s,h=d/r;return{absoluteX:c,absoluteY:d,relativeX:p,relativeY:h,containerWidth:s,containerHeight:r,containerLeft:o.left,containerTop:o.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 o=t.getBoundingClientRect();return o.width>0&&o.height>0}_isMarkerOccluded(e,t,o){if(typeof document.elementsFromPoint!="function"||t<0||o<0||t>=window.innerWidth||o>=window.innerHeight)return!1;let r=document.elementsFromPoint(t,o).find(c=>c.tagName.toLowerCase()!==D.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 o=e.getBoundingClientRect();return o.width>=window.innerWidth*.5&&o.height>=window.innerHeight*.5}_computeMarkerState(e,t,{checkOcclusion:o=!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=k/2,a=s.containerLeft+s.absoluteX+r,l=s.containerTop+s.absoluteY+r;return o&&(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,o){if(o.kind==="resolved")return t&&(t.style.display="none"),!1;if(o.kind==="noop")return!1;let s=e.hidden===!0;return o.kind==="hidden"?(e.hidden=!0,t.style.display="none",this.deps.onMarkerHidden(e),!s):(e.hidden=!1,t.style.display="",t.style.left=`${o.viewportX}px`,t.style.top=`${o.viewportY}px`,t.style.transform="translate(-50%, -50%)",t.style.position="absolute",e.relativeX=o.relativeX,e.relativeY=o.relativeY,s)}updatePosition(e,t=this.circles.get(String(e.id))){if(!t)return;let o=this._computeMarkerState(e,t);this._applyMarkerState(e,t,o)&&this.deps.onVisibilityFlip()}_updateAllPositions(){let e=Date.now(),t=e-this._lastOcclusionPass>=Io;t?this._lastOcclusionPass=e:this._armOcclusionTrailingPass();let o=[];for(let r of this.deps.getComments()){let a=this.circles.get(String(r.id));a&&o.push([r,a,this._computeMarkerState(r,a,{checkOcclusion:t})])}let s=!1;for(let[r,a,l]of o)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()},Io)}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 o=new ResizeObserver(s=>{if(this.enabled)for(let r of s)r.target===e.container&&this.updatePosition(e,t)});o.observe(e.container),this.resizeObservers.set(String(e.id),{circle:t,observer:o,container:e.container})}cleanupResizeObserver(e){let t=String(e);if(this.resizeObservers.has(t)){let{circle:o,observer:s}=this.resizeObservers.get(t);s&&s.disconnect(),o&&o.parentNode&&o.parentNode.removeChild(o),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 o=t.getBoundingClientRect();if(o.height<=0)return null;let s=gt(e.relativeY*o.height,o.height);return o.top+s+k/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 Ao=(i,e)=>new Intl.DateTimeFormat(e,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}).format(new Date(i)),qi={status:i=>[i.statusLabel,e=>M(e,i)],type:i=>[i.typeLabel,e=>v(e,i)],priority:i=>[i.priorityLabel,e=>w(e,i)]},Ro=(i,e,t)=>{let o=qi[i];if(!o)return"";let[s,r]=o(t);return`${s}: ${r(e.from??null)} \u2192 ${r(e.to??null)}`},Zi=(i,e)=>{switch(i.type){case"created":return e.auditCreated;case"edited":return e.auditEdited;case"status":return Ro("status",i,e);case"classified":return i.field==="tags"?e.auditTagsChanged:Ro(i.field,i,e);default:return""}},Ji=(i,e,t)=>{let o=document.createElement("li");o.className=n.AUDIT_ROW;let s=document.createElement("span");s.className=n.AUDIT_ACTION,s.textContent=Zi(i,e);let r=document.createElement("span");r.className=n.AUDIT_ACTOR,r.textContent=i.actor?.name||e.anonymous;let a=document.createElement("time");return a.className=n.AUDIT_TIME,a.dateTime=i.at,a.textContent=Ao(i.at,t),o.append(s,r,a),o},Qi=(i,e,t)=>{let o=j(i).filter(l=>l.reopenedAt);if(o.length===0)return null;let s=document.createElement("div");s.className=n.AUDIT_RESOLUTIONS,s.dataset.auditResolutions="";let r=document.createElement("h4");r.className=n.AUDIT_HEADING,r.textContent=e.auditPreviousResolutions,s.appendChild(r);let a=document.createElement("ul");a.className=n.AUDIT_LIST;for(let l of o){let c=document.createElement("li");c.className=n.AUDIT_ROW;let d=document.createElement("span");d.className=n.AUDIT_ACTION,d.textContent=I(e.auditResolvedInTemplate,X(l.ms,e)||"\u2014");let p=document.createElement("time");p.className=n.AUDIT_TIME,p.dateTime=l.resolvedAt,p.textContent=Ao(l.resolvedAt,t),c.append(d,p),a.appendChild(c)}return s.appendChild(a),s};function So(i,{strings:e,locale:t,open:o,onToggle:s}){let r=i?.history;if(!Array.isArray(r)||r.length===0)return null;let a=document.createElement("div");a.className=n.AUDIT_BLOCK;let l=document.createElement("button");l.type="button",l.className=n.AUDIT_TOGGLE,l.setAttribute("aria-expanded",String(o)),l.textContent=I(e.auditToggleTemplate,r.length);let c=document.createElement("div");c.className=n.AUDIT_BODY,c.hidden=!o;let d=document.createElement("ul");d.className=n.AUDIT_LIST,d.setAttribute("aria-label",e.auditTrailLabel);for(let h of[...r].reverse())d.appendChild(Ji(h,e,t));c.appendChild(d);let p=Qi(i,e,t);return p&&c.appendChild(p),l.addEventListener("click",()=>{let h=l.getAttribute("aria-expanded")!=="true";l.setAttribute("aria-expanded",String(h)),c.hidden=!h,s?.(h)}),a.append(l,c),a}var K="unset",en=36e5,Et=(i,e)=>{let t={};for(let o of i)t[o]=0;return e&&(t[e]=0),t},tn=i=>{if(i.length===0)return null;let e=Math.floor(i.length/2);return i.length%2?i[e]:(i[e-1]+i[e])/2};function se(i){let e=Array.isArray(i)?i:[],t=Et(S),o=Et(R,K),s=Et(A,K),r=new Map,a=[],l=0;for(let d of e){let p=S.includes(d.status)?d.status:"open";t[p]++,o[R.includes(d.type)?d.type:K]++,s[A.includes(d.priority)?d.priority:K]++;let h=String(d.createdAt||"").slice(0,10);h&&r.set(h,(r.get(h)||0)+1);let u=ee(d);u!==null&&a.push(u),j(d).length>1&&l++}a.sort((d,p)=>d-p);let c=a.reduce((d,p)=>d+p,0);return{total:e.length,byStatus:t,byType:o,byPriority:s,overTime:[...r.entries()].sort(([d],[p])=>d<p?-1:1).map(([d,p])=>({date:d,count:p})),resolution:{resolvedCount:a.length,averageMs:a.length?c/a.length:null,medianMs:tn(a),reopenedCount:l}}}var ae=i=>i==null?null:Math.round(i/en*10)/10;var No="rgba(255,255,255,0.42)",vo=300,_t=96,on="http://www.w3.org/2000/svg",T=(i,e,t)=>{let o=document.createElement(i);return e&&(o.className=e),t!==void 0&&(o.textContent=String(t)),o},bt=(i,e={})=>{let t=document.createElementNS(on,i);for(let[o,s]of Object.entries(e))t.setAttribute(o,String(s));return t},_e=(i,e)=>{let t=T("div",n.METRICS_TILE);return t.appendChild(T("span",n.METRICS_TILE_VALUE,e)),t.appendChild(T("span",n.METRICS_TILE_LABEL,i)),t},Ct=(i,e,t)=>{let o=T("div",n.METRICS_GROUP);o.dataset.metricsGroup=i,o.appendChild(T("h4",n.METRICS_HEADING,e));let s=Math.max(1,...t.map(r=>r.count));for(let{label:r,count:a,color:l}of t){let c=T("div",n.METRICS_ROW);c.dataset.metricsRow="",c.appendChild(T("span",n.METRICS_ROW_LABEL,r));let d=T("div",n.METRICS_TRACK),p=T("div",n.METRICS_BAR);p.dataset.metricsBar="",p.style.width=`${Math.round(a/s*100)}%`,p.style.background=l,d.appendChild(p),c.appendChild(d),c.appendChild(T("span",n.METRICS_ROW_COUNT,a)),o.appendChild(c)}return o},nn=(i,e)=>{let t=T("div",n.METRICS_GROUP);t.dataset.metricsGroup="overTime",t.appendChild(T("h4",n.METRICS_HEADING,e.metricsOverTime));let o=Math.max(1,...i.map(({count:c})=>c)),s=bt("svg",{class:n.METRICS_CHART,viewBox:`0 0 ${vo} ${_t}`,preserveAspectRatio:"none",role:"img","aria-label":`${e.metricsOverTime}: ${i.map(({date:c,count:d})=>`${c} ${d}`).join(", ")}`}),r=vo/i.length,a=Math.max(2,Math.min(r-3,28));i.forEach(({date:c,count:d},p)=>{let h=Math.max(2,d/o*(_t-6)),u=bt("rect",{x:p*r+(r-a)/2,y:_t-h,width:a,height:h,rx:2});u.appendChild(Object.assign(bt("title"),{textContent:`${c}: ${d}`})),s.appendChild(u)}),t.appendChild(s);let l=T("div",n.METRICS_AXIS);return l.appendChild(T("span",null,i[0].date)),i.length>1&&l.appendChild(T("span",null,i[i.length-1].date)),t.appendChild(l),t},rn=(i,e)=>{let t=T("div",n.METRICS_EXPORTS);t.setAttribute("aria-label",i.metricsExportLabel);let o=(s,r,a)=>{let l=T("button",n.METRICS_EXPORT_BTN,r);return l.type="button",l.dataset.export=s,l.addEventListener("click",a),l};return t.appendChild(o("comments",i.metricsExportComments,e.onExportComments)),t.appendChild(o("metrics",i.metricsExportMetrics,e.onExportMetrics)),t.appendChild(o("print",i.metricsPrint,e.onPrint)),t};function wo(i,e){let{strings:t}=e,o=T("div",n.METRICS_VIEW);if(i.total===0)return o.appendChild(T("p",n.METRICS_EMPTY,t.metricsEmpty)),o;let s=a=>a===null?"\u2014":X(a,t),r=T("div",n.METRICS_TILES);return r.appendChild(_e(t.metricsTotal,i.total)),r.appendChild(_e(t.statusResolved,i.resolution.resolvedCount)),r.appendChild(_e(t.metricsReopened,i.resolution.reopenedCount)),r.appendChild(_e(t.metricsAverageResolution,s(i.resolution.averageMs))),r.appendChild(_e(t.metricsMedianResolution,s(i.resolution.medianMs))),o.appendChild(r),o.appendChild(Ct("status",t.metricsByStatus,S.map(a=>({label:M(a,t),count:i.byStatus[a],color:F[a]})))),o.appendChild(Ct("type",t.metricsByType,[...R.map(a=>({label:v(a,t),count:i.byType[a],color:G[a]})),{label:t.unset,count:i.byType[K],color:No}])),o.appendChild(Ct("priority",t.metricsByPriority,[...A.map(a=>({label:w(a,t),count:i.byPriority[a],color:z[a]})),{label:t.unset,count:i.byPriority[K],color:No}])),i.overTime.length&&o.appendChild(nn(i.overTime,t)),o.appendChild(rn(t,e)),o}var Lo='<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>',sn='<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>',an='<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>',Xe=class{constructor({shadowRoot:e,strings:t,locale:o,currentPage:s,getComments:r,callbacks:a,options:l={}}){this.shadowRoot=e,this.strings=t,this.locale=o,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.auditExpanded=!1,this.showMetrics=!1,this.editing=null,this.notice=null,this._cardBindings=new Map,this.el=null,this._highlightedEl=null,this._activeMarkerEl=null,this._reactions=null}isOpen(){return!!this.el}open(){this.el||(this.el=document.createElement("div"),this.el.className=n.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(o=>y(o.id,this.editing.commentId));return e?this.editing.replyId==null?e.text||"":(e.replies||[]).find(o=>y(o.id,this.editing.replyId))?.text||"":""}async releaseEditor(){if(!this.editing)return!0;if(this.isDirty()){let e=this.el||this.shadowRoot;if(!await Me(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:o}=this.editing;o==null?this.callbacks.onEditComment(t,e):this.callbacks.onEditReply(t,o,e),this.editing=null,this.render()},onCancel:async()=>{await this.releaseEditor()&&this.render()}}}_buildEditor(){let e=this._editorHandlers();return ie({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(bo(e.id))}_highlight(e){this._clearHighlight();let t=this._markerFor(e);t&&(t.classList.add(n.HIGHLIGHT),this._highlightedEl=t)}_clearHighlight(){this._highlightedEl?.classList.remove(n.HIGHLIGHT),this._highlightedEl=null}_setActiveMarker(e){if(this._activeMarkerEl?.classList.remove(n.CIRCLE_ACTIVE),this._activeMarkerEl=null,!e)return;let t=this._markerFor(e);t&&(t.classList.add(n.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(o=>y(o.id,this.detailId)):null;if(this._setActiveMarker(t),this.showMetrics){this._cardBindings.clear(),this.el.innerHTML="",this._renderMetrics(e);return}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(o=>y(o.id,e));t&&this._openDetail(t)}_openDetail(e){this.detailId=e.id,e.anchorState==="anchored"&&!e.hidden&&this.callbacks.onOpenDetailScroll(e),this.render(),this.callbacks.onOpenDetail?.(e)}_closeButton(){let e=document.createElement("button");return e.type="button",e.className=n.INBOX_CLOSE,e.setAttribute("aria-label",this.strings.close),e.innerHTML="&times;",e.addEventListener("click",async()=>{this.editing&&!await this.releaseEditor()||this.callbacks.onClose()}),e}_metricsButton(){let e=document.createElement("button");return e.type="button",e.className=n.INBOX_METRICS_BTN,e.textContent=this.strings.metricsOpen,e.setAttribute("aria-label",this.strings.metricsTitle),e.addEventListener("click",async()=>{this.editing&&!await this.releaseEditor()||(this.showMetrics=!0,this.detailId=null,this.render())}),e}_renderMetrics(e){let t=document.createElement("div");t.className=n.INBOX_DETAIL_HEADER;let o=document.createElement("button");o.type="button",o.className=n.INBOX_BACK,o.innerHTML=`${Lo}<span>${this.strings.back}</span>`,o.addEventListener("click",()=>{this.showMetrics=!1,this.render()}),t.appendChild(o);let s=document.createElement("div");s.className=n.INBOX_CARD_ACTIONS,s.appendChild(this._closeButton()),t.appendChild(s),this.el.appendChild(t);let r=this._filterSummaryLabel();this.el.appendChild(wo(se(e),{strings:this.strings,locale:this.locale,onExportComments:()=>this.callbacks.onExportComments(e),onExportMetrics:()=>this.callbacks.onExportMetrics(e),onPrint:()=>this.callbacks.onPrintReport(e,r)}))}_renderList(e){let t=[...this.el.children].find(r=>r.classList.contains(n.INBOX_LIST));if(!t){this.el.innerHTML="",this._cardBindings.clear();let r=document.createElement("div");r.className=n.INBOX_HEADER,this.el.appendChild(r),t=document.createElement("div"),t.className=n.INBOX_LIST,this.el.appendChild(t)}let o=[...this.el.children].find(r=>r.classList.contains(n.INBOX_HEADER)),s=document.createElement("div");s.className=n.INBOX_HEADER_ACTIONS,s.append(this._metricsButton(),this._closeButton()),o.replaceChildren(this._buildFilter(),s),this._reconcileCards(t,e)}_reactionsUi(){return this._reactions||(this._reactions=Se({actorKey:()=>this.callbacks.actorKey(),strings:this.strings,onToggle:(e,t)=>{let o=this.getComments().find(s=>(s.replies||[]).includes(e));o?this.callbacks.onToggleReplyReaction(o.id,e.id,t):this.callbacks.onToggleCommentReaction(e.id,t)}})),this._reactions}_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.history?.length??0,e.history?.at(-1)?.at??null,e.anchorState,e.hidden===!0,e.page,e.screenshots?.length??0,ot(e).map(({emoji:t,authors:o})=>[t,o.length])])}_reconcileCards(e,t){for(let r of[...e.children])(r.classList.contains(n.INBOX_NOTICE)||r.classList.contains(n.INBOX_EMPTY))&&r.remove();let o=[];if(this.notice){let r=document.createElement("div");r.className=n.INBOX_NOTICE,r.setAttribute("role","status"),r.textContent=this.notice,o.push(r)}let s=new Set;if(t.length===0)o.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),o.push(d)}for(let r of[...this._cardBindings.keys()])s.has(r)||this._cardBindings.delete(r);for(o.forEach((r,a)=>{e.children[a]!==r&&e.insertBefore(r,e.children[a]??null)});e.children.length>o.length;)e.lastElementChild.remove()}_buildEmptyState(){let e=document.createElement("div");e.className=n.INBOX_EMPTY;let t=document.createElement("div");t.className=n.INBOX_EMPTY_ICON,t.setAttribute("aria-hidden","true"),e.appendChild(t);let o=this.getComments().length>0,s=document.createElement("div");if(s.className=n.INBOX_EMPTY_TITLE,s.textContent=o?this.strings.inboxNoMatches:this.strings.inboxEmptyTitle,e.appendChild(s),o){let p=document.createElement("button");return p.type="button",p.className=n.INBOX_EMPTY_ACTION,p.textContent=this.strings.filterClear,p.addEventListener("click",()=>{this._resetFilters()}),e.appendChild(p),e}let r=document.createElement("div");r.className=n.INBOX_EMPTY_TEXT;let[a,l]=String(this.strings.inboxEmptyHintTemplate).split("{n}"),c=document.createElement("kbd");c.className=n.INBOX_EMPTY_KBD,c.textContent=ht(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=n.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(M(this.statusFilter,this.strings)),this.typeFilter!=="all"&&e.push(v(this.typeFilter,this.strings)),this.priorityFilter!=="all"&&e.push(w(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:o,labelOf:s,selected:r,toggles:a=!0,onSelect:l}){let c=document.createElement("div");c.className=n.INBOX_FILTER_GROUP;let d=document.createElement("div");d.className=n.INBOX_FILTER_SECTION,d.textContent=e,c.appendChild(d);let p=document.createElement("div");p.className=n.INBOX_FILTER_CHIPS,p.setAttribute("role",a?"group":"radiogroup"),p.setAttribute("aria-label",e);for(let h of o){let u=r===h,m=document.createElement("button");m.type="button",m.className=n.INBOX_FILTER_CHIP,m.dataset[t]=h,m.setAttribute("role",a?"switch":"radio"),m.setAttribute("aria-checked",String(u)),m.textContent=s(h),m.addEventListener("click",f=>{f.stopPropagation(),l(a&&u?"all":h),this.render()}),p.appendChild(m)}return c.appendChild(p),c}_buildFilter(){let e=document.createElement("div");e.className=n.INBOX_FILTER+"-wrapper";let t=document.createElement("button");t.type="button",t.className=n.INBOX_FILTER,t.setAttribute("aria-haspopup","true"),t.setAttribute("aria-expanded","false"),t.innerHTML=`<span>${this._filterSummaryLabel()}</span>${Be}`;let o=document.createElement("div");o.className=n.INBOX_FILTER_MENU,o.setAttribute("role","group"),o.setAttribute("aria-label",this.strings.filterTitle),V(t,o);let s=document.createElement("div");s.className=n.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=n.INBOX_FILTER_CLEAR,a.textContent=this.strings.filterClear,a.disabled=!this._isFilterActive(),a.addEventListener("click",l=>{l.stopPropagation(),this._resetFilters()}),s.appendChild(a),o.appendChild(s),o.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})),o.appendChild(this._buildFilterGroup({title:this.strings.filterByStatus,dataAttr:"filterStatus",values:[...S],labelOf:l=>M(l,this.strings),selected:this.statusFilter,onSelect:l=>this.statusFilter=l})),o.appendChild(this._buildFilterGroup({title:this.strings.filterByType,dataAttr:"filterType",values:[...R],labelOf:l=>v(l,this.strings),selected:this.typeFilter,onSelect:l=>this.typeFilter=l})),o.appendChild(this._buildFilterGroup({title:this.strings.filterByPriority,dataAttr:"filterPriority",values:[...A],labelOf:l=>w(l,this.strings),selected:this.priorityFilter,onSelect:l=>this.priorityFilter=l})),e.appendChild(t),e.appendChild(o),e}_buildCard(e,{interactive:t}){let o=document.createElement("div");o.className=n.INBOX_CARD,e.status==="resolved"&&o.classList.add(`${n.INBOX_CARD}--resolved`),o.dataset.commentId=e.id;let s=document.createElement("div");s.className=n.INBOX_CARD_HEADER,s.appendChild(me(e.author,e.createdAt,this.strings,this.locale,e.editedAt)),o.appendChild(s);let r=document.createElement("div");if(r.className=n.THREAD_ACTIONS_ROW,r.appendChild(this._buildCardActions(e)),o.appendChild(r),!t&&this.editing&&this.editing.replyId==null&&String(this.editing.commentId)===String(e.id))o.appendChild(this._buildEditor());else{let d=document.createElement("div");d.className=n.INBOX_CARD_TEXT,d.textContent=e.text,o.appendChild(d)}if(e.screenshots?.length){let d=fe(e.screenshots,this.strings);$(d,p=>this.callbacks.onShowLightbox(p)),o.appendChild(d)}let l=mt(e,this.strings,{includeClassification:!1});l&&o.appendChild(l),o.appendChild(this._reactionsUi().bar(e));let c=this._buildTag(e);if(c&&o.appendChild(c),t){o.setAttribute("role","button"),o.setAttribute("tabindex","0");let d=()=>e.anchorState==="inactive"?this.callbacks.onNavigateToPage(e):this._openDetail(e),p=document.createElement("button");p.type="button",p.className=n.INBOX_CARD_REPLY_LINK,p.textContent=this.strings.replyLink,p.addEventListener("click",h=>{h.stopPropagation(),d()}),o.appendChild(p),o.addEventListener("click",d),o.addEventListener("keydown",h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),d())}),o.addEventListener("mouseenter",()=>this._highlight(e)),o.addEventListener("mouseleave",()=>this._clearHighlight())}return o}_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 o=document.createElement("span");return o.className=n.INBOX_CARD_TAG,o.textContent=t,o}_buildCardActions(e){return Le(e,{strings:this.strings,reactions:this._reactionsUi(),onCopy:t=>oe(Pe(t,{viewportWidth:window.innerWidth,viewportHeight:window.innerHeight,strings:this.strings})),onCopyLink:t=>oe(Q(t,this.options.linkParam)),onEdit:t=>this.startEditing(t.id),onSetStatus:(t,o)=>this.callbacks.onSetStatus(t.id,o),onSetType:(t,o)=>this.callbacks.onSetType(t.id,o),onSetPriority:(t,o)=>this.callbacks.onSetPriority(t.id,o),onDelete:t=>{this.detailId!=null&&y(this.detailId,t.id)&&(this.detailId=null),this.callbacks.onDelete(t.id),this.render()}})}_renderDetail(e,t){let o=t.indexOf(e),s=document.createElement("div");s.className=n.INBOX_DETAIL_HEADER;let r=document.createElement("button");r.type="button",r.className=n.INBOX_BACK,r.innerHTML=`${Lo}<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=n.INBOX_CARD_ACTIONS;let l=(u,m,f)=>{let g=document.createElement("button");g.type="button",g.className=n.INBOX_NAV_BTN,g.setAttribute("aria-label",m),g.title=m,g.innerHTML=u;let _=t[f];return g.disabled=!_,_&&g.addEventListener("click",async()=>{this.editing&&!await this.releaseEditor()||this._openDetail(_)}),g};a.appendChild(l(sn,this.strings.prevComment,o-1)),a.appendChild(l(an,this.strings.nextComment,o+1)),a.appendChild(this._closeButton()),s.appendChild(a),this.el.appendChild(s);let c=document.createElement("div");c.className=n.INBOX_DETAIL,c.appendChild(this._buildCard(e,{interactive:!1}));let d=ke(e,{strings:this.strings,onShowLightbox:u=>this.callbacks.onShowLightbox(u),collapsible:!0,expanded:this.contextExpanded,onToggle:u=>{this.contextExpanded=u}});d&&c.appendChild(d);let p=So(e,{strings:this.strings,locale:this.locale,open:this.auditExpanded,onToggle:u=>{this.auditExpanded=u}});p&&c.appendChild(p);let h=document.createElement("div");h.className=n.INBOX_REPLIES;for(let u of e.replies||[]){let m=this.editing&&String(this.editing.commentId)===String(e.id)&&String(this.editing.replyId)===String(u.id),f=ge(u,this.strings,this.locale,{onDelete:(g,_)=>{this.callbacks.onDeleteReply(e.id,g.id)&&_.remove()},onEdit:g=>this.startEditing(e.id,g.id),editing:m?this._editorHandlers():null,reactions:this._reactionsUi()});$(f,g=>this.callbacks.onShowLightbox(g)),h.appendChild(f)}c.appendChild(h),c.appendChild(this._buildReplyInput(e)),this.el.appendChild(c)}_buildReplyInput(e){let{container:t,inputEl:o,screenshotsContainer:s,attachBtn:r,fileInput:a,submitBtn:l}=De({areaClassName:n.THREAD_INPUT_AREA,inputTag:"input",inputClassName:n.THREAD_INPUT,inputPlaceholder:this.strings.replyPlaceholder},this.strings),c=[],d=()=>{ne(s,c,{strings:this.strings,onShow:h=>this.callbacks.onShowLightbox(h),rerender:()=>d()})};r.addEventListener("click",()=>a.click()),re(a,()=>c,d,h=>this.callbacks.onTransformScreenshot(h,e.id));let p=()=>{let h=o.value.trim();!h&&c.length===0||(this.callbacks.onReply(e,h,[...c]),c=[],this.render())};return l.addEventListener("click",p),o.addEventListener("keydown",h=>{h.key==="Enter"&&!h.shiftKey&&(h.preventDefault(),p())}),t}};var Mo=",",ln=`\r
9
- `,cn=/^[=+\-@\t\r]/,Bo=i=>{if(i==null)return"";let e=String(i),t=cn.test(e)?`'${e}`:e;return/["\n\r,]/.test(t)?`"${t.replace(/"/g,'""')}"`:t};function Tt(i,e){let t=e.map(s=>Bo(s.label)).join(Mo),o=i.map(s=>e.map(r=>Bo(s[r.key])).join(Mo));return[t,...o].join(ln)}var Do=["id","page","author","authorId","text","status","type","priority","tags","createdAt","resolvedAt","resolutionHours","reopened","replies"],xt=i=>i.map(e=>({key:e,label:e})),ko=["section","key","value"];function Po(i){return(i||[]).map(e=>({id:String(e.id),page:e.page||"",author:e.author||"",authorId:e.authorId||"",text:e.text||"",status:e.status||"open",type:e.type||"",priority:e.priority||"",tags:(e.tags||[]).join(" "),createdAt:e.createdAt||"",resolvedAt:e.resolvedAt||"",resolutionHours:ae(ee(e)),reopened:j(e).length>1?"yes":"no",replies:(e.replies||[]).length}))}function $o(i){let e=[{section:"total",key:"",value:i.total}],t=(o,s)=>{for(let[r,a]of Object.entries(s))e.push({section:o,key:r,value:a})};t("status",i.byStatus),t("type",i.byType),t("priority",i.byPriority);for(let{date:o,count:s}of i.overTime)e.push({section:"perDay",key:o,value:s});return e.push({section:"resolution",key:"resolvedCount",value:i.resolution.resolvedCount},{section:"resolution",key:"reopenedCount",value:i.resolution.reopenedCount},{section:"resolution",key:"averageHours",value:ae(i.resolution.averageMs)},{section:"resolution",key:"medianHours",value:ae(i.resolution.medianMs)}),e}function yt(i,e){let t=new Blob(["\uFEFF",e],{type:"text/csv;charset=utf-8"}),o=URL.createObjectURL(t),s=document.createElement("a");s.href=o,s.download=i,s.click(),URL.revokeObjectURL(o)}var dn="helldots-report-styles",U=(i,e,t,o)=>{let s=i.createElement(e);return t&&(s.className=t),o!==void 0&&(s.textContent=String(o)),s},Ot=(i,e,t,o)=>{let s=U(i,"table","report-table");s.appendChild(U(i,"caption",null,e));let r=i.createElement("thead"),a=i.createElement("tr");for(let c of o)a.appendChild(U(i,"th",null,c));r.appendChild(a),s.appendChild(r);let l=i.createElement("tbody");for(let[c,d]of t){let p=i.createElement("tr");p.appendChild(U(i,"th",null,c)),p.appendChild(U(i,"td",null,d)),l.appendChild(p)}return s.appendChild(l),s},Ho=i=>i===null?"\u2014":I("{n} h",ae(i)),pn=(i,e,{strings:t,locale:o,scope:s})=>{let r=i.body;r.className="report",r.appendChild(U(i,"h1","report-title",t.metricsTitle));let a=U(i,"p","report-meta");if(a.textContent=I(t.metricsGeneratedTemplate,new Intl.DateTimeFormat(o,{dateStyle:"long",timeStyle:"short"}).format(new Date)),r.appendChild(a),s){let c=U(i,"p","report-meta");c.textContent=`${t.metricsScope}: ${s}`,r.appendChild(c)}r.appendChild(Ot(i,t.metricsTitle,[[t.metricsTotal,e.total],[t.statusResolved,e.resolution.resolvedCount],[t.metricsReopened,e.resolution.reopenedCount],[t.metricsAverageResolution,Ho(e.resolution.averageMs)],[t.metricsMedianResolution,Ho(e.resolution.medianMs)]],[t.metricsCategory,t.metricsCount]));let l=(c,d,p,h)=>Ot(i,c,d.map(u=>[h(u),p[u]??0]),[t.metricsCategory,t.metricsCount]);r.appendChild(l(t.metricsByStatus,S,e.byStatus,c=>M(c,t))),r.appendChild(l(t.metricsByType,[...R,"unset"],e.byType,c=>c==="unset"?t.unset:v(c,t))),r.appendChild(l(t.metricsByPriority,[...A,"unset"],e.byPriority,c=>c==="unset"?t.unset:w(c,t))),e.overTime.length&&r.appendChild(Ot(i,t.metricsOverTime,e.overTime.map(({date:c,count:d})=>[c,d]),[t.metricsDate,t.metricsCount]))};function Xo(i,{strings:e,locale:t,css:o,scope:s}){let r=document.createElement("iframe");r.setAttribute("aria-hidden","true"),r.setAttribute("title",e.metricsTitle),r.style.position="absolute",r.style.width="0",r.style.height="0",r.style.border="0",r.style.left="-9999px",document.body.appendChild(r);let a=r.contentDocument,l=r.contentWindow;a.title=e.metricsTitle,de(a,o,dn),pn(a,i,{strings:e,locale:t,scope:s});let c=()=>r.remove();return l.addEventListener("afterprint",c,{once:!0}),setTimeout(()=>l.print?.(),0),r}var hn=i=>{let e=new Set;for(let t of i){let o=String(t).trim().toLowerCase();o&&e.add(o)}return[...e]},Uo=i=>i.filter(e=>typeof e=="string"),un=.6,mn={"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","reaction:toggled":"onReactionToggled"},It=class{constructor(e={}){this.comments=[],this.commentMode=!1,this.isMac=pt(),this.options={shortcutKey:e.shortcutKey||(this.isMac?"c":"C"),shortcutModifier:e.shortcutModifier||"alt",autoScreenshot:e.autoScreenshot!==!1,embedCrossOriginFonts:e.embedCrossOriginFonts===!0,fastCapture:e.fastCapture===!0,skipIframeContent:e.skipIframeContent===!0,...e},this.locale=this.options.locale||jt(),this.strings=Wt(this.locale),this.markers=null,this._captureFlow=null,this._regionCapturePending=!1,this._storedCache=null,this._popover=null,this._pendingDetailId=null,this._requestedDetailId=null,this._origin="host",this._deferredLoad=null,document.readyState==="loading"?(this._onDomReady=()=>this.initOverlay(),document.addEventListener("DOMContentLoaded",this._onDomReady)):this.initOverlay()}initOverlay(){this.shadowRoot=At(),this.toolbar=Eo(this.options,this.strings),this.commentBox=_o(this.strings),this.overlay=document.createElement("div"),this.overlay.className=n.COMMENT_OVERLAY,this.shadowRoot.appendChild(this.overlay),this.shadowRoot.appendChild(this.toolbar),this.shadowRoot.appendChild(this.commentBox),this.commentBtn=this.toolbar.querySelector(`.${n.TOOLBAR_COMMENT_BTN}`),this.inboxBtn=this.toolbar.querySelector(`.${n.TOOLBAR_MENU_BTN}`),this.eyeBtn=this.toolbar.querySelector(`.${n.TOOLBAR_EYE_BTN}`),this.markersHidden=!1,this.submitButton=this.shadowRoot.getElementById(x.SUBMIT_COMMENT),this.commentInput=this.shadowRoot.getElementById(x.COMMENT_INPUT),this.attachImageBtn=this.commentBox.querySelector(`.${n.ATTACH_IMAGE_BTN}`),this.attachImageInput=this.shadowRoot.getElementById(x.ATTACH_IMAGE_INPUT),this._captureFlow=new Ce({host:this.shadowRoot,autoScreenshot:this.options.autoScreenshot,embedCrossOriginFonts:this.options.embedCrossOriginFonts,fastCapture:this.options.fastCapture,skipIframeContent:this.options.skipIframeContent,captureTimeout:this.options.captureTimeout,onRegionCaptured:e=>{this._pendingScreenshots||(this._pendingScreenshots=[]),this._pendingScreenshots.length<le&&this._pendingScreenshots.push(e)},onRegionPending:e=>{this._regionCapturePending=e,this._updateScreenshotsPreview()},onPlace:(e,t,o)=>this._placeCommentAtPoint(e,t,o),onError:e=>this._reportError(e,"capture")}),this._popover=new $e({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()},actorKey:()=>this._actorKey(),transformScreenshot:(e,t)=>this._transformScreenshot(e,"attachment",t),actions:this._userActions({addReply:(e,t,o)=>this.addReply(e,t,o),deleteReply:(e,t)=>this.deleteReply(e,t),editComment:(e,t)=>this.editComment(e,t),editReply:(e,t,o)=>this.editReply(e,t,o),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),toggleCommentReaction:(e,t)=>this.toggleCommentReaction(e,t),toggleReplyReaction:(e,t,o)=>this.toggleReplyReaction(e,t,o)})}),this.markers=new He({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();try{localStorage.getItem(We)==="true"&&this._setMarkersHidden(!0)}catch{}if(this.bindEventListeners(),this.setupKeyboardShortcut(),this.injectStyles(),this._pendingDetailId=this._readPendingDetailId(),this.options.persistence==="localStorage"&&(this._storedCache=Qe(),this.loadComments(this._storedCache),this._storageHandler=e=>{(e.key===ye||e.key===null)&&(this._storedCache=null)},window.addEventListener("storage",this._storageHandler)),this._deferredLoad){let e=this._deferredLoad;this._deferredLoad=null,this.loadComments(e)}this._openPendingDetail(),this.options.autoDetectNavigation&&(this._popstateHandler=()=>this.notifyNavigation(),window.addEventListener("popstate",this._popstateHandler)),this._notifyReady()}_navigateTo(e){if(typeof this.options.navigate=="function"){this.options.navigate(e);return}location.assign(e)}_readPendingDetailId(){let e=st(this._linkParam()),t=null;try{t=sessionStorage.getItem(Oe),t!=null&&sessionStorage.removeItem(Oe)}catch{}return e??t}_linkParam(){return this.options.linkParam||ue}_openPendingDetail(){let e=this._pendingDetailId;if(!e)return;let t=this._findComment(e);if(!t){this.showInbox(),this.inboxView?.showNotice(this.strings.commentNotFound),this._requestPendingDetail(e);return}this._pendingDetailId=null,this._requestedDetailId=null,this.showInbox(),this.inboxView.clearNotice(),this.inboxView.openDetail(t.id)}_requestPendingDetail(e){let t=this.options.onCommentRequested;if(typeof t!="function"||this._requestedDetailId!==null&&y(this._requestedDetailId,e))return;this._requestedDetailId=e;let o;try{o=t(e)}catch(s){this._reportError(s,"link");return}!o||typeof o.then!="function"||o.then(()=>this._openPendingDetail(),s=>{this._reportError(s,"link"),this._openPendingDetail()})}_notifyReady(){let e=this.options.onReady;if(typeof e=="function")try{e(this)}catch(t){console.warn("HellDots: onReady handler threw",t)}}_asUser(e){let t=this._origin;this._origin="user";try{return e()}finally{this._origin=t}}_userActions(e){let t={};for(let[o,s]of Object.entries(e))t[o]=typeof s=="function"?(...r)=>this._asUser(()=>s(...r)):s;return t}_reportError(e,t){let o=this.options.onError;if(typeof o=="function")try{o(e,t)}catch(s){console.warn("HellDots: onError handler threw",s)}}async _transformScreenshot(e,t,o){let s=this.options.transformScreenshot;if(typeof s!="function"||!e)return e;try{let r=await s(e,{kind:t,commentId:o});if(typeof r!="string"||!r)throw new Error("HellDots: transformScreenshot resolved to no usable string");return r}catch(r){return this._reportError(r,"transform"),e}}_emit(e,t,o,s){let r={origin:this._origin,...s},a=mn[e],l=this.options[a];if(typeof l=="function")try{l(...t,r)}catch(c){console.warn(`HellDots: ${a} handler threw`,c)}if(typeof this.options.onChange=="function")try{this.options.onChange({type:e,...o,...r})}catch(c){console.warn("HellDots: onChange handler threw",c)}}commentLink(e){let t=this._findComment(e);return t?Q(t,this._linkParam()):null}_readStoredCached(){return this._storedCache||(this._storedCache=Qe()),this._storedCache}_syncStorage(){if(this.options.persistence!=="localStorage")return;let e=et(this._readStoredCached(),this.serializeComments(),location.pathname);Ie(e)||this._reportError(new Error("HellDots: comments could not be persisted to localStorage"),"storage"),this._storedCache=e}bindEventListeners(){this.commentBtn.addEventListener("click",()=>this.toggleCommentMode()),this.inboxBtn.addEventListener("click",()=>this.toggleInbox()),this.eyeBtn?.addEventListener("click",()=>this._setMarkersHidden(!this.markersHidden)),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()}),re(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(),o=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;o&&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?.(`.${n.CIRCLE}`)||t?.closest?.(`.${n.TOOLTIP}`)||t?.closest?.(`.${n.THREAD_POPOVER}`)||t?.closest?.(`.${n.INBOX_PANEL}`)||t?.closest?.(`.${n.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))}}_regionTarget(e,t,o){if(typeof document.elementsFromPoint!="function")return null;let s=e.width*e.height;if(!(s>0))return null;for(let r of document.elementsFromPoint(t,o)){if(r.tagName.toLowerCase()===D.toLowerCase())continue;let a=r.getBoundingClientRect(),l=Math.min(a.right,e.left+e.width)-Math.max(a.left,e.left),c=Math.min(a.bottom,e.top+e.height)-Math.max(a.top,e.top);if(!(l<=0||c<=0)&&l*c/s>=un)return r}return null}async _placeCommentAtPoint(e,t,o){this._captureFlow.armClickCapture();let s=this.overlay.style.pointerEvents;this.overlay.style.pointerEvents="none";let r=(o?this._regionTarget(o,e,t):null)||document.elementFromPoint(e,t);this.overlay.style.pointerEvents=s||"";let a=r?.closest?.($t.CONTAINER)||document.body,l=a.getBoundingClientRect(),c=l.width>0?(e-l.left)/l.width:0,d=l.height>0?(t-l.top)/l.height:0,p=eo(a,c,d);p.targetSelector=r&&r!==a?Qt(r):null,this.currentPosition={container:a,relativeX:c,relativeY:d,anchor:p,target:r||a},this.createPreviewCircle(e,t),document.body.classList.remove(n.COMMENT_CURSOR),(this._pendingScreenshots?.length>0||this._regionCapturePending)&&this._updateScreenshotsPreview(),this.showCommentBox(e,t)}_updateScreenshotsPreview(){let e=this.commentBox.querySelector(`.${n.SCREENSHOTS_CONTAINER}`);e&&ne(e,this._pendingScreenshots||[],{strings:this.strings,onShow:t=>this.showLightbox(t),rerender:()=>this._updateScreenshotsPreview(),pending:this._regionCapturePending?1:0})}_clearScreenshotPreview(){this._pendingScreenshots=[],this._regionCapturePending=!1;let e=this.commentBox.querySelector(`.${n.SCREENSHOTS_CONTAINER}`);e&&(e.innerHTML="",e.classList.remove(n.ACTIVE))}showCommentBox(e,t){this.commentBox.style.display="block";let s=k/2,r=s+10,a=window.innerWidth,l=window.innerHeight,c=this.commentBox.getBoundingClientRect(),d=c.width||400,p=e+s,h=t+s,u=p+r,m=h-s;u+d>a&&(u=p-r-d),u=Math.min(u,a-d-10),u=Math.max(10,u),m+c.height>l&&(m=l-c.height-10),m=Math.max(10,m),this.commentBox.style.left=`${u}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._captureFlow?.clearPending(),this.commentBox.classify?.reset(),this.commentMode&&document.body.classList.add(n.COMMENT_CURSOR)}_setMarkersHidden(e){if(this.markersHidden=e,this.overlay.classList.toggle(n.MARKERS_HIDDEN,e),e&&(this.closeThreadPopover(),this.shadowRoot.querySelectorAll(`.${n.TOOLTIP}`).forEach(t=>t.remove())),this.eyeBtn){let t=e?this.strings.toolbarShowComments:this.strings.toolbarHideComments;this.eyeBtn.setAttribute("aria-label",t),this.eyeBtn.innerHTML=e?go:ut;let o=this.eyeBtn.closest(`.${n.TOOLBAR_ACTION_WRAPPER}`)?.querySelector(`.${n.TOOLBAR_TEXT}`);o&&(o.textContent=t)}try{localStorage.setItem(We,String(e))}catch{}}toggleCommentMode(){this.commentMode=!this.commentMode,this.commentMode&&this.closeInbox(),this.commentMode&&this.markersHidden&&this._setMarkersHidden(!1),this.commentBtn?.classList.toggle(n.ACTIVE,this.commentMode),this.commentBtn?.setAttribute("aria-pressed",String(this.commentMode)),this.overlay.classList.toggle(n.ACTIVE,this.commentMode),document.body.classList.toggle(n.COMMENT_CURSOR,this.commentMode),this.commentMode||this.hideCommentBox(),this._notify("onCommentModeChanged",[this.commentMode])}async saveComment(){if(!this._saving&&!(!this.commentInput.value.trim()||!this.currentPosition)){this._saving=!0,this.submitButton&&(this.submitButton.disabled=!0);try{await this._saveCommentNow()}finally{this._saving=!1,this.submitButton&&(this.submitButton.disabled=!1)}}}async _saveCommentNow(){let e=this.currentPosition,t=this.commentInput.value,o=await this._captureFlow.consumePending();if(this.currentPosition!==e)return;let s=tt(),r=this._pendingScreenshots?[...this._pendingScreenshots]:[],[a,l]=await Promise.all([this._transformScreenshot(o,"context",s),Promise.all(r.map(h=>this._transformScreenshot(h,"attachment",s)))]);if(this.currentPosition!==e)return;let c={text:t,container:e.container,relativeX:e.relativeX,relativeY:e.relativeY,anchor:e.anchor,anchorState:"anchored",target:e.target,hidden:!1,status:"open",page:location.pathname,id:s,replies:[],author:this.options.user?.name||this.strings.anonymous,authorId:P(this.options.user?.id)||null,createdAt:new Date().toISOString(),screenshots:l,type:this.commentBox.classify?.getType()??null,priority:this.commentBox.classify?.getPriority()??null,tags:[],resolvedAt:null,context:Ft(),contextScreenshot:a};Y(c,"created",this._actor()),this.comments.push(c),this._syncStorage();let d=this._serializeComment(c);this._asUser(()=>this._emit("comment:created",[d],{comment:d})),this.renderCommentCircle(c),this.hideCommentBox(),this.toggleCommentMode();let p=this._circles.get(String(c.id));p&&this.showThreadPopover(p,c)}renderCommentCircle(e){this.markers.render(e)}_wireMarker(e,t){e.addEventListener("mouseenter",()=>this.showCommentTooltip(e,t)),e.addEventListener("mouseleave",()=>{setTimeout(()=>{let o=this._tooltipEl(t.id);o&&!o.matches(":hover")&&o.remove()},250)}),e.addEventListener("click",o=>{if(o.stopPropagation(),this._tooltipEl(t.id)?.remove(),this.activeThreadPopover?.dataset.for===String(t.id)){this.closeThreadPopover();return}this.showThreadPopover(e,t)}),e.addEventListener("keydown",o=>{(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),e.click())})}showCommentTooltip(e,t){if(this.shadowRoot.querySelector(`.${n.THREAD_POPOVER}[data-for="${W(t.id)}"]`)||this._tooltipEl(t.id))return;let s=xo(t,this.strings,this.locale);this.shadowRoot.appendChild(s),$(s,r=>this.showLightbox(r)),setTimeout(()=>{Ee(s,e)},10),s.querySelector(`.${n.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 Xe({shadowRoot:this.shadowRoot,strings:this.strings,locale:this.locale,currentPage:location.pathname,getComments:()=>this.comments,options:this.options,callbacks:this._userActions({onActivateCommentMode:()=>{this.closeInbox(),this.commentMode||this.toggleCommentMode()},onOpenDetailScroll:e=>this.scrollMarkerIntoView(e),onOpenDetail:e=>this._notifyCommentOpened(e),onTransformScreenshot:(e,t)=>this._transformScreenshot(e,"attachment",t),onReply:(e,t,o)=>this.addReply(e,t,o),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,o)=>{this.editReply(e,t,o)&&this._popover.refreshCommentViews(e)},actorKey:()=>this._actorKey(),onToggleCommentReaction:(e,t)=>this.toggleCommentReaction(e,t),onToggleReplyReaction:(e,t,o)=>this.toggleReplyReaction(e,t,o),onExportComments:e=>this.exportCommentsCsv(e),onExportMetrics:e=>this.exportMetricsCsv(e),onPrintReport:(e,t)=>this.printMetricsReport(e,t),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(Oe,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),this._notifyCommentOpened(t)}_notifyCommentOpened(e){e&&this._notify("onCommentOpened",[this._serializeComment(e)])}_notify(e,t){let o=this.options[e];if(typeof o=="function")try{o(...t)}catch(s){console.warn(`HellDots: ${e} handler threw`,s)}}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=n.LIGHTBOX,t.setAttribute("role","dialog"),t.setAttribute("aria-modal","true"),t.setAttribute("aria-label",this.strings.screenshotPreview);let o=document.createElement("img");o.className=n.LIGHTBOX_IMG,o.src=e,o.alt=this.strings.screenshotPreview;let s=document.createElement("button");s.type="button",s.className=n.LIGHTBOX_CLOSE,s.setAttribute("aria-label",this.strings.close),s.innerHTML="&times;",s.addEventListener("click",()=>this.closeLightbox()),t.appendChild(o),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?.(`.${n.LIGHTBOX}`)}_findComment(e){return this.comments.find(t=>y(t.id,e))}_tooltipEl(e){return this.shadowRoot?.querySelector(`.${n.TOOLTIP}[data-for="${W(e)}"]`)??null}addReply(e,t,o=[]){let s=typeof e=="object"&&e!==null?e:this._findComment(e);if(!s)return null;s.replies||(s.replies=[]);let r={id:tt(),editedAt:null,text:t,author:this.options.user?.name||this.strings.anonymous,authorId:P(this.options.user?.id)||null,timestamp:new Date().toISOString(),screenshots:o};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 o=this._findComment(e),s=o?.replies?.findIndex(c=>y(c.id,t))??-1;if(s<0)return!1;let[r]=o.replies.splice(s,1);this._syncStorage();let a=this._serializeComment(o),l=this._serializeReply(r);return this._emit("reply:deleted",[a,l],{comment:a,reply:l}),!0}editComment(e,t){let o=this._findComment(e),s=String(t??"").trim();if(!o||!s||s===o.text)return!1;o.text=s,o.editedAt=new Date().toISOString(),Y(o,"edited",this._actor()),this._circles.get(String(o.id))?.setAttribute("aria-label",`${this.strings.commentAriaLabelPrefix}${o.text}`),this._syncStorage();let r=this._serializeComment(o);return this._emit("comment:edited",[r],{comment:r}),!0}editReply(e,t,o){let s=this._findComment(e),r=s?.replies?.find(d=>y(d.id,t)),a=String(o??"").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:o,authorId:s,timestamp:r,screenshots:a,editedAt:l,reactions:c=null}){return{id:e,text:t,author:o,authorId:s||null,timestamp:r,screenshots:a||[],editedAt:l||null,reactions:rt(c)}}_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,authorId:e.authorId||null,history:ho(e.history),createdAt:e.createdAt,screenshots:e.screenshots||[],status:e.status||"open",type:e.type||null,priority:e.priority||null,tags:e.tags?[...e.tags]:[],reactions:rt(e.reactions),resolvedAt:e.resolvedAt||null,context:e.context?{...e.context}:null,contextScreenshot:e.contextScreenshot||null}}setCommentStatus(e,t){if(!S.includes(t))return!1;let o=this._findComment(e);if(!o)return!1;if(o.status===t)return!0;let s=o.status;o.status=t,o.resolvedAt=t==="resolved"?new Date().toISOString():null,Y(o,"status",this._actor(),{from:s,to:t});let r=this._circles.get(String(o.id));r&&this.updateCommentPosition(o,r),this._syncStorage(),this.inboxView?.isOpen()&&this.inboxView.refresh();let a=this._serializeComment(o);return this._emit("comment:status-changed",[a],{comment:a},{from:s,to:t}),!0}setUser(e){return e!=null&&(typeof e!="object"||typeof e.name!="string"||!e.name.trim())?!1:(this.options.user=e??void 0,this._popover?.close(),this.inboxView?.isOpen()&&this.inboxView.refresh(),!0)}_actor(){return co(this.options.user,this.strings)}_actorKey(){return so(this.options.user,this.strings)}_commitReaction(e,t){this._syncStorage(),this.inboxView?.isOpen()&&this.inboxView.refresh();let o=this._serializeComment(e),s=t?this._serializeReply(t):null;return this._emit("reaction:toggled",[o,s],{comment:o,reply:s}),!0}toggleCommentReaction(e,t){let o=this._findComment(e);return!o||!nt(o,t,this._actorKey())?!1:this._commitReaction(o,null)}toggleReplyReaction(e,t,o){let s=this._findComment(e),r=s?.replies?.find(a=>y(a.id,t));return!r||!nt(r,o,this._actorKey())?!1:this._commitReaction(s,r)}_commitUpdate(e,t){this._syncStorage(),this.inboxView?.isOpen()&&this.inboxView.refresh();let o=this._serializeComment(e);return this._emit("comment:updated",[o],{comment:o},t),!0}setCommentType(e,t){if(t!==null&&!R.includes(t))return!1;let o=this._findComment(e);if(!o)return!1;let s=o.type??null;return s===t?!0:(o.type=t,Y(o,"classified",this._actor(),{field:"type",from:s,to:t}),this._commitUpdate(o,{field:"type",from:s,to:t}))}setCommentPriority(e,t){if(t!==null&&!A.includes(t))return!1;let o=this._findComment(e);if(!o)return!1;let s=o.priority??null;return s===t?!0:(o.priority=t,Y(o,"classified",this._actor(),{field:"priority",from:s,to:t}),this._commitUpdate(o,{field:"priority",from:s,to:t}))}setCommentTags(e,t){if(!Array.isArray(t))return!1;let o=this._findComment(e);if(!o)return!1;let s=[...o.tags||[]],r=s.join("\0"),a=hn(t);return a.join("\0")===r?!0:(o.tags=a,Y(o,"classified",this._actor(),{field:"tags"}),this._commitUpdate(o,{field:"tags",from:s,to:[...a]}))}getMetrics(){return se(this.serializeComments())}exportCommentsCsv(e){let t=Po(e||this.serializeComments()),o=Tt(t,xt(Do));return yt("helldots-comments.csv",o),o}exportMetricsCsv(e){let t=se(e||this.serializeComments()),o=Tt($o(t),xt(ko));return yt("helldots-metrics.csv",o),o}printMetricsReport(e,t){let o=se(e||this.serializeComments());Xo(o,{strings:this.strings,locale:this.locale,css:Vt(),scope:t})}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=et(this._readStoredCached().filter(o=>!y(o.id,e)),this.serializeComments(),location.pathname);Ie(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=>!y(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))),o=this._readStoredCached().filter(s=>!t.has(String(s.id)));Ie(o),this._storedCache=o}this.inboxView?.isOpen()&&this.inboxView.refresh()}loadComments(e){let t=0,o=0,s=0;if(!Array.isArray(e))return{anchored:t,orphaned:o,inactive:s};if(!this.markers)return this._deferredLoad=[...this._deferredLoad||[],...e],{anchored:t,orphaned:o,inactive:s};for(let r of e){if(!r||r.id==null||typeof r.text!="string"){console.warn("HellDots: skipping malformed serialized comment",r),this._reportError(new Error("HellDots: skipping malformed serialized comment"),"load");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=>({...c,authorId:P(c.authorId)||null,...Array.isArray(c.screenshots)?{screenshots:Uo(c.screenshots)}:{},reactions:it(c.reactions)})):[],author:r.author||this.strings.anonymous,authorId:P(r.authorId)||null,history:po(r.history),createdAt:r.createdAt||new Date().toISOString(),screenshots:Array.isArray(r.screenshots)?Uo(r.screenshots):[],status:r.status==="closed"?"resolved":S.includes(r.status)?r.status:"open",type:R.includes(r.type)?r.type:null,priority:A.includes(r.priority)?r.priority:null,tags:Array.isArray(r.tags)?[...r.tags]:[],resolvedAt:r.resolvedAt||null,reactions:it(r.reactions),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;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),o++;let c=this._serializeComment(a);this._emit("comment:anchor-lost",[c],{comment:c})}}return this._openPendingDetail(),{anchored:t,orphaned:o,inactive:s}}notifyNavigation(){let e=location.pathname,t=0,o=0,s=0;if(!this.markers)return{anchored:t,orphaned:o,inactive:s};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?Je(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",o++;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:o,inactive:s}}scrollMarkerIntoView(e){this.markersHidden&&this._setMarkersHidden(!1),this.markers.scrollMarkerIntoView(e)}createPreviewCircle(e,t){this.removePreviewCircle();let o=document.createElement("div");o.className=`${n.CIRCLE} ${n.PREVIEW_CIRCLE}`,o.style.position="absolute";let s=k/2;o.style.left=`${e+s}px`,o.style.top=`${t+s}px`,o.style.transform="translate(-50%, -50%)",o.style.pointerEvents="none",this.overlay.appendChild(o),this.previewCircle=o}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,this._deferredLoad=null,Ae(),uo(),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(n.COMMENT_CURSOR),this._detachStyles(),document.querySelector(D)?.remove()}injectStyles(){this._detachStyles(),this._styleDetachers=[de(this.shadowRoot,Gt(),x.STYLES),de(document,zt(),x.GLOBAL_STYLES)]}_detachStyles(){for(let e of this._styleDetachers??[])e();this._styleDetachers=[]}},Fo=It;function fn(i={}){let{autoInit:e=!0,...t}=i,o=()=>new Fo(t);return e?o():o}var Vs=fn;export{Fo as CommentOverlay,ue as DEFAULT_LINK_PARAM,fn as createCommentOverlay,Vs as default,st as readCommentLinkParam};
7
+ `,t},Ee=(o,e)=>{let t=document.createElement("div");return t.className=n.SCREENSHOTS_CONTAINER,t.classList.add(n.ACTIVE),o.forEach(i=>{let s=document.createElement("div");s.className=n.SCREENSHOT_ITEM;let r=document.createElement("img");r.className=n.SCREENSHOT_IMG,r.src=i,r.alt=e.attachedScreenshot,s.appendChild(r),t.appendChild(s)}),t},Io=(o,e=H,t)=>{let i=document.createElement("div");i.className=n.TOOLTIP,i.dataset.for=o.id,i.setAttribute("role","dialog"),i.setAttribute("aria-label",e.tooltipAriaLabel);let s=document.createElement("div");s.className=n.THREAD_HEADER;let r=ge(o.author,o.createdAt,e,t,o.editedAt),a=document.createElement("button");a.type="button",a.className=n.CLOSE_TOOLTIP,a.setAttribute("aria-label",e.close),a.innerHTML="&times;",s.appendChild(r),s.appendChild(a);let l=document.createElement("div");l.className=n.THREAD_BODY,l.textContent=o.text,i.appendChild(s),i.appendChild(l);let c=Et(o,e,{includeStatus:!0});c&&i.appendChild(c);let d=bt(o);d.length>0&&i.appendChild(Ee(d,e));let p=o.replies?.length||0;if(p>0){let h=document.createElement("div");h.className=n.TOOLTIP_REPLY_COUNT,h.textContent=p===1?e.replyCountOne:R(e.replyCountTemplate,p),i.appendChild(h)}return i},be=(o,e=H,t,{onDelete:i,onEdit:s,commentId:r,can:a,editing:l=null,reactions:c=null}={})=>{let d=document.createElement("div");d.className=n.THREAD_REPLY,d.dataset.replyId=String(o.id);let p=ge(o.author,o.timestamp,e,t,o.editedAt),h=[],u=me(o,r),f=_=>a?a(_,u):!0;s&&f("edit:reply")&&h.push({label:e.editReply,onSelect:()=>s(o)}),i&&f("delete:reply")&&h.push({label:e.deleteReply,onSelect:()=>i(o,d),confirm:()=>({title:e.confirmDeleteReplyTitle,message:e.confirmDeleteReplyMessage,confirmLabel:e.confirmDelete,cancelLabel:e.confirmCancel})});let m=document.createElement("div");m.className=`${n.ACTIONS_GROUP} ${n.THREAD_REPLY_ACTIONS}`,c&&m.appendChild(c.trigger(o,{className:n.INBOX_ACTION_BTN})),h.length>0&&m.appendChild(pt({label:e.replyOptions,items:h})),m.children.length>0&&p.appendChild(m);let g;l?g=ie({value:l.draft,strings:e,onInput:l.onInput,onSave:l.onSave,onCancel:l.onCancel}):(g=document.createElement("div"),g.className=n.THREAD_BODY,g.textContent=o.text),d.appendChild(p),d.appendChild(g);let E=bt(o);return E.length>0&&d.appendChild(Ee(E,e)),c&&d.appendChild(c.bar(o)),d},Ro=(o,e=H,t,{onDeleteReply:i,onEditReply:s,can:r,reactions:a=null}={})=>{let l=document.createElement("div");l.className=n.THREAD_POPOVER,l.dataset.for=o.id,l.setAttribute("role","dialog"),l.setAttribute("aria-label",e.popoverAriaLabel);let c=document.createElement("div");c.className=n.THREAD_HEADER;let d=ge(o.author,o.createdAt,e,t,o.editedAt),p=document.createElement("button");p.type="button",p.className=n.CLOSE_TOOLTIP,p.setAttribute("aria-label",e.close),p.innerHTML="&times;",c.appendChild(d),c.appendChild(p);let h=document.createElement("div");h.className=n.THREAD_BODY,h.textContent=o.text;let u=document.createElement("div");u.className=n.THREAD_REPLIES,o.replies&&o.replies.forEach(E=>{u.appendChild(be(E,e,t,{onDelete:i,onEdit:s,commentId:o.id,can:r,reactions:a}))});let{container:f}=$e({areaClassName:n.THREAD_INPUT_AREA,inputTag:"input",inputClassName:n.THREAD_INPUT,inputPlaceholder:e.replyPlaceholder},e),m=document.createElement("div");m.className=n.THREAD_SCROLL,l.appendChild(c),m.appendChild(h);let g=bt(o);return g.length>0&&m.appendChild(Ee(g,e)),a&&m.appendChild(a.bar(o)),m.appendChild(u),l.appendChild(m),l.appendChild(f),l};var He=(o,{strings:e,onShowLightbox:t,collapsible:i=!1,expanded:s=!1,onToggle:r})=>{let{context:a,contextScreenshot:l}=o;if(!a&&!l)return null;let c=document.createElement("div");c.className=n.CONTEXT_BLOCK;let d=document.createElement("div");if(d.className=n.CONTEXT_BODY,i){let p=document.createElement("button");p.type="button",p.className=n.CONTEXT_TOGGLE,p.setAttribute("aria-expanded",String(s)),p.innerHTML=`<span>${e.contextSection}</span>${Pe}`,d.style.display=s?"":"none",p.addEventListener("click",h=>{h.stopPropagation();let u=p.getAttribute("aria-expanded")==="true";p.setAttribute("aria-expanded",String(!u)),d.style.display=u?"none":"",r?.(!u)}),c.appendChild(p)}else{let p=document.createElement("div");p.className=n.CONTEXT_TITLE,p.textContent=e.contextSection,c.appendChild(p)}if(l){let p=document.createElement("div");p.className=n.CONTEXT_SCREENSHOT_CAPTION,p.textContent=e.autoScreenshotLabel,d.appendChild(p);let h=document.createElement("img");h.className=n.SCREENSHOT_IMG,h.src=l,h.alt=e.autoScreenshotLabel,d.appendChild(h),$(d,t)}if(a){let p=(f,m)=>{if(!m)return;let g=document.createElement("div");g.className=n.CONTEXT_ROW;let E=document.createElement("span");E.textContent=f;let _=document.createElement("span");_.textContent=m,g.appendChild(E),g.appendChild(_),d.appendChild(g)},h=f=>f?`${f.width}\xD7${f.height}`:"",u=f=>f?.name?`${f.name} ${f.version||""}`.trim():"";p(e.contextUrl,a.url),p(e.contextViewport,h(a.viewport)),p(e.contextScreen,h(a.screen)),p(e.contextBrowser,u(a.browser)),p(e.contextOs,u(a.os))}return c.appendChild(d),c};var Ji=o=>{let e=[...o.attributes].map(({name:t,value:i})=>`${t}="${i}"`).join(" ");return`<${o.tagName.toLowerCase()}${e?` ${e}`:""}>`},Qi=o=>{if(!o?.tagName)return"(unknown)";let e=Object.entries(o.attributes||{}).map(([t,i])=>`${t}="${i}"`).join(" ");return`<${o.tagName.toLowerCase()}${e?` ${e}`:""}>`},en=o=>{let e=[],t=o;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 Xe(o,{viewportWidth:e,viewportHeight:t,strings:i}){let s=o.anchor,r=s?.fingerprint,a=o.container?.isConnected?o.container:null,l=o.hidden?"hidden":o.anchorState,c=a?Ji(a):Qi(r),d=a?en(a):"(unavailable)",p=o.context?.viewport,h=p?.width??e,u=p?.height??t,f=[`Page: ${o.page}`,`Viewport: ${h}x${u}`,`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&&f.push(`Type: ${o.type}`),o.priority&&f.push(`Priority: ${o.priority}`),o.tags?.length&&f.push(`Tags: ${o.tags.join(", ")}`);let m=o.context;if(m&&(m.url&&f.push(`URL: ${m.url}`),m.screen&&f.push(`Screen: ${m.screen.width}x${m.screen.height}`),m.browser?.name&&f.push(`Browser: ${`${m.browser.name} ${m.browser.version||""}`.trim()}`),m.os?.name&&f.push(`OS: ${`${m.os.name} ${m.os.version||""}`.trim()}`)),i&&o.status==="resolved"&&o.resolvedAt){let E=X(new Date(o.resolvedAt).getTime()-new Date(o.createdAt).getTime(),i);E&&f.push(`Resolution time: ${E}`)}let g=o.replies||[];if(g.length>0){f.push(`Replies (${g.length}):`);for(let E of g)f.push(`- ${E.author}: "${E.text}"`)}return f.join(`
8
+ `)}var _e=(o,e)=>{let t=e.getBoundingClientRect(),i=t.left+t.width/2,s=t.top+t.height/2,r=P,a=r/2+10,l=o.getBoundingClientRect(),c=l.width||400,d=i+a;d+c>window.innerWidth&&(d=i-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,u=window.innerHeight-p-h;l.height>u?(o.style.top="auto",o.style.bottom=`${p}px`):(o.style.bottom="auto",o.style.top=`${Math.max(p,h)}px`)},Ao=o=>{let e=o.getBoundingClientRect(),t=Math.max(10,(window.innerWidth-(e.width||400))/2),i=Math.max(10,(window.innerHeight-e.height)/2);o.style.left=`${t}px`,o.style.bottom="auto",o.style.top=`${i}px`},Ue=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(`.${n.THREAD_SCROLL} > .${n.THREAD_BODY}, .${n.THREAD_SCROLL} > .${n.EDITOR}`):t.querySelector(`.${n.THREAD_REPLY}[data-reply-id="${W(e)}"]`)?.querySelector(`.${n.THREAD_BODY}, .${n.EDITOR}`)||null:null}refreshCommentViews(e,t=null){if(this.active?.dataset.for!==String(e))return;let i=this.deps.findComment(e);if(!i)return;let s=t==null?i:(i.replies||[]).find(l=>O(l.id,t));if(!s)return;let r=document.createElement("div");r.className=n.THREAD_BODY,r.textContent=s.text,this._bodyEl(t)?.replaceWith(r);let a=t==null?this.active.querySelector(`.${n.THREAD_META}`):this.active.querySelector(`.${n.THREAD_REPLY}[data-reply-id="${W(t)}"]`)?.querySelector(`.${n.THREAD_META}`);if(a&&s.editedAt&&!a.querySelector(`.${n.THREAD_EDITED}`)){let l=ut(s.editedAt,this.deps.strings,this.deps.locale),c=a.querySelector(`.${n.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:i}=this.editing,s=this.deps.findComment(e),r=t==null?s:(s?.replies||[]).find(a=>O(a.id,t));return i.trim()!==String(r?.text||"").trim()}async releaseEditor(){if(!this.editing)return!0;if(this.editorDirty()){let t=this.deps.shadowRoot;if(!await ke(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 i=e==null?t:(t.replies||[]).find(r=>O(r.id,e));if(!i)return;let s=document.createElement("div");s.className=n.THREAD_BODY,s.textContent=i.text,this._bodyEl(e)?.replaceWith(s)}async startEditing(e,t=null){if(!await this.releaseEditor())return;let i=this.deps.findComment(e),s=t==null?i:(i?.replies||[]).find(a=>O(a.id,t));if(!s)return;this.editing={commentId:e,replyId:t,draft:s.text};let r=ie({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:i,locale:s}=this.deps;this.deps.removeTooltip(t.id),e?.classList.add(n.CIRCLE_ACTIVE),this._activeCircle=e||null;let r=(b,I)=>{this.deps.actions.deleteReply(t.id,b.id)&&(I.remove(),this.deps.refreshInbox())},a=b=>this.startEditing(t.id,b.id),l=we({actorKey:this.deps.actorKey,strings:i,onToggle:(b,I)=>b===t?this.deps.actions.toggleCommentReaction(t.id,I):this.deps.actions.toggleReplyReaction(t.id,b.id,I)}),c=Ro(t,i,s,{can:this.deps.can,onDeleteReply:r,onEditReply:a,reactions:l});this.deps.shadowRoot.appendChild(c);let d=c.querySelector(`.${n.THREAD_HEADER}`),p=De(t,{can:this.deps.can,strings:i,reactions:l,onCopy:b=>oe(Xe(b,{viewportWidth:window.innerWidth,viewportHeight:window.innerHeight,strings:i})),onCopyLink:b=>oe(Q(b,this.deps.linkParam())),onEdit:b=>this.startEditing(b.id),onSetStatus:(b,I)=>this.deps.actions.setStatus(b.id,I),onSetType:(b,I)=>this.deps.actions.setType(b.id,I),onSetPriority:(b,I)=>this.deps.actions.setPriority(b.id,I),onDelete:b=>{this.close(),this.deps.actions.deleteComment(b.id),this.deps.refreshInbox()}}),h=document.createElement("div");h.className=n.THREAD_ACTIONS_ROW,h.appendChild(p),d.insertAdjacentElement("afterend",h);let u=c.querySelector(`.${n.THREAD_SCROLL} > .${n.SCREENSHOTS_CONTAINER}`);u&&$(u,b=>this.deps.onShowLightbox(b));let f=He(t,{strings:i,onShowLightbox:b=>this.deps.onShowLightbox(b),collapsible:!0});f&&c.querySelector(`.${n.THREAD_REPLIES}`).before(f),setTimeout(()=>{e?_e(c,e):Ao(c)},10),c.querySelector(`.${n.CLOSE_TOOLTIP}`).addEventListener("click",async b=>{b.stopPropagation(),!(this.editing&&!await this.releaseEditor())&&this.close()});let m=c.querySelector(`.${n.THREAD_INPUT}`),g=c.querySelector(`.${n.THREAD_SUBMIT}`),E=c.querySelector(`.${n.THREAD_INPUT_AREA} .${n.ATTACH_IMAGE_BTN}`),_=c.querySelector(`.${n.THREAD_INPUT_AREA} input[type="file"]`),C=c.querySelector(`.${n.THREAD_INPUT_AREA} .${n.SCREENSHOTS_CONTAINER}`),T=[],v=()=>{ne(C,T,{strings:i,onShow:b=>this.deps.onShowLightbox(b),rerender:()=>v()})};E.addEventListener("click",()=>{_.click()}),re(_,()=>T,v,b=>this.deps.transformScreenshot(b,t.id));let q=()=>{let b=m.value.trim();if(!b&&T.length===0)return;let I=this.deps.actions.addReply(t,b,T.length>0?[...T]:[]),Yo=c.querySelector(`.${n.THREAD_REPLIES}`),Nt=be(I,i,s,{onDelete:r,onEdit:a,commentId:t.id,can:this.deps.can,reactions:l});Yo.appendChild(Nt),$(Nt,jo=>this.deps.onShowLightbox(jo));let ze=c.querySelector(`.${n.THREAD_SCROLL}`);ze&&(ze.scrollTop=ze.scrollHeight),m.value="",T=[],v(),m.focus()};g.addEventListener("click",q),m.addEventListener("keydown",b=>{b.key==="Enter"&&!b.shiftKey&&(b.preventDefault(),q())}),this.active=c,typeof ResizeObserver<"u"&&(this._resizeObserver=new ResizeObserver(()=>this.reposition()),this._resizeObserver.observe(c)),setTimeout(()=>m.focus(),50),this._armClickTimer=setTimeout(()=>{this._armClickTimer=null,this._clickHandler=b=>{let I=b.composedPath()[0]||b.target;if(!c.contains(I)&&!e?.contains(I)&&!this.deps.isInsideLightbox(I)){if(this.editorDirty())return;this.close()}},document.addEventListener("mousedown",this._clickHandler)},0)}close(){this.deps.shadowRoot?.querySelectorAll(`.${n.CIRCLE_ACTIVE}`).forEach(e=>e.classList.remove(n.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?_e(e,this._activeCircle):Ao(e))}syncToMarker(){let e=this.active,t=this._activeCircle;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="",_e(e,t)}};var So=150,_t=(o,e)=>Math.max(0,Math.min(o,e)),Fe=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=Oo(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 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=_t(a,s),d=_t(l,r),p=c/s,h=d/r;return{absoluteX:c,absoluteY:d,relativeX:p,relativeY:h,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()!==k.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}_computeMarkerState(e,t,{checkOcclusion:i=!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=P/2,a=s.containerLeft+s.absoluteX+r,l=s.containerTop+s.absoluteY+r;return i&&(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,i){if(i.kind==="resolved")return t&&(t.style.display="none"),!1;if(i.kind==="noop")return!1;let s=e.hidden===!0;return i.kind==="hidden"?(e.hidden=!0,t.style.display="none",this.deps.onMarkerHidden(e),!s):(e.hidden=!1,t.style.display="",t.style.left=`${i.viewportX}px`,t.style.top=`${i.viewportY}px`,t.style.transform="translate(-50%, -50%)",t.style.position="absolute",e.relativeX=i.relativeX,e.relativeY=i.relativeY,s)}updatePosition(e,t=this.circles.get(String(e.id))){if(!t)return;let i=this._computeMarkerState(e,t);this._applyMarkerState(e,t,i)&&this.deps.onVisibilityFlip()}_updateAllPositions(){let e=Date.now(),t=e-this._lastOcclusionPass>=So;t?this._lastOcclusionPass=e:this._armOcclusionTrailingPass();let i=[];for(let r of this.deps.getComments()){let a=this.circles.get(String(r.id));a&&i.push([r,a,this._computeMarkerState(r,a,{checkOcclusion:t})])}let s=!1;for(let[r,a,l]of i)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()},So)}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 i=new ResizeObserver(s=>{if(this.enabled)for(let r of s)r.target===e.container&&this.updatePosition(e,t)});i.observe(e.container),this.resizeObservers.set(String(e.id),{circle:t,observer:i,container:e.container})}cleanupResizeObserver(e){let t=String(e);if(this.resizeObservers.has(t)){let{circle:i,observer:s}=this.resizeObservers.get(t);s&&s.disconnect(),i&&i.parentNode&&i.parentNode.removeChild(i),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 i=t.getBoundingClientRect();if(i.height<=0)return null;let s=_t(e.relativeY*i.height,i.height);return i.top+s+P/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 vo=(o,e)=>new Intl.DateTimeFormat(e,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}).format(new Date(o)),tn={status:o=>[o.statusLabel,e=>D(e,o)],type:o=>[o.typeLabel,e=>w(e,o)],priority:o=>[o.priorityLabel,e=>L(e,o)]},No=(o,e,t)=>{let i=tn[o];if(!i)return"";let[s,r]=i(t);return`${s}: ${r(e.from??null)} \u2192 ${r(e.to??null)}`},on=(o,e)=>{switch(o.type){case"created":return e.auditCreated;case"edited":return e.auditEdited;case"status":return No("status",o,e);case"classified":return o.field==="tags"?e.auditTagsChanged:No(o.field,o,e);default:return""}},nn=(o,e,t)=>{let i=document.createElement("li");i.className=n.AUDIT_ROW;let s=document.createElement("span");s.className=n.AUDIT_ACTION,s.textContent=on(o,e);let r=document.createElement("span");r.className=n.AUDIT_ACTOR,r.textContent=o.actor?.name||e.anonymous;let a=document.createElement("time");return a.className=n.AUDIT_TIME,a.dateTime=o.at,a.textContent=vo(o.at,t),i.append(s,r,a),i},rn=(o,e,t)=>{let i=j(o).filter(l=>l.reopenedAt);if(i.length===0)return null;let s=document.createElement("div");s.className=n.AUDIT_RESOLUTIONS,s.dataset.auditResolutions="";let r=document.createElement("h4");r.className=n.AUDIT_HEADING,r.textContent=e.auditPreviousResolutions,s.appendChild(r);let a=document.createElement("ul");a.className=n.AUDIT_LIST;for(let l of i){let c=document.createElement("li");c.className=n.AUDIT_ROW;let d=document.createElement("span");d.className=n.AUDIT_ACTION,d.textContent=R(e.auditResolvedInTemplate,X(l.ms,e)||"\u2014");let p=document.createElement("time");p.className=n.AUDIT_TIME,p.dateTime=l.resolvedAt,p.textContent=vo(l.resolvedAt,t),c.append(d,p),a.appendChild(c)}return s.appendChild(a),s};function wo(o,{strings:e,locale:t,open:i,onToggle:s}){let r=o?.history;if(!Array.isArray(r)||r.length===0)return null;let a=document.createElement("div");a.className=n.AUDIT_BLOCK;let l=document.createElement("button");l.type="button",l.className=n.AUDIT_TOGGLE,l.setAttribute("aria-expanded",String(i)),l.textContent=R(e.auditToggleTemplate,r.length);let c=document.createElement("div");c.className=n.AUDIT_BODY,c.hidden=!i;let d=document.createElement("ul");d.className=n.AUDIT_LIST,d.setAttribute("aria-label",e.auditTrailLabel);for(let h of[...r].reverse())d.appendChild(nn(h,e,t));c.appendChild(d);let p=rn(o,e,t);return p&&c.appendChild(p),l.addEventListener("click",()=>{let h=l.getAttribute("aria-expanded")!=="true";l.setAttribute("aria-expanded",String(h)),c.hidden=!h,s?.(h)}),a.append(l,c),a}var K="unset",sn=36e5,Ct=(o,e)=>{let t={};for(let i of o)t[i]=0;return e&&(t[e]=0),t},an=o=>{if(o.length===0)return null;let e=Math.floor(o.length/2);return o.length%2?o[e]:(o[e-1]+o[e])/2};function se(o){let e=Array.isArray(o)?o:[],t=Ct(N),i=Ct(A,K),s=Ct(S,K),r=new Map,a=[],l=0;for(let d of e){let p=N.includes(d.status)?d.status:"open";t[p]++,i[A.includes(d.type)?d.type:K]++,s[S.includes(d.priority)?d.priority:K]++;let h=String(d.createdAt||"").slice(0,10);h&&r.set(h,(r.get(h)||0)+1);let u=ee(d);u!==null&&a.push(u),j(d).length>1&&l++}a.sort((d,p)=>d-p);let c=a.reduce((d,p)=>d+p,0);return{total:e.length,byStatus:t,byType:i,byPriority:s,overTime:[...r.entries()].sort(([d],[p])=>d<p?-1:1).map(([d,p])=>({date:d,count:p})),resolution:{resolvedCount:a.length,averageMs:a.length?c/a.length:null,medianMs:an(a),reopenedCount:l}}}var ae=o=>o==null?null:Math.round(o/sn*10)/10;var Lo="rgba(255,255,255,0.42)",Mo=300,Tt=96,ln="http://www.w3.org/2000/svg",y=(o,e,t)=>{let i=document.createElement(o);return e&&(i.className=e),t!==void 0&&(i.textContent=String(t)),i},xt=(o,e={})=>{let t=document.createElementNS(ln,o);for(let[i,s]of Object.entries(e))t.setAttribute(i,String(s));return t},Ce=(o,e)=>{let t=y("div",n.METRICS_TILE);return t.appendChild(y("span",n.METRICS_TILE_VALUE,e)),t.appendChild(y("span",n.METRICS_TILE_LABEL,o)),t},yt=(o,e,t)=>{let i=y("div",n.METRICS_GROUP);i.dataset.metricsGroup=o,i.appendChild(y("h4",n.METRICS_HEADING,e));let s=Math.max(1,...t.map(r=>r.count));for(let{label:r,count:a,color:l}of t){let c=y("div",n.METRICS_ROW);c.dataset.metricsRow="",c.appendChild(y("span",n.METRICS_ROW_LABEL,r));let d=y("div",n.METRICS_TRACK),p=y("div",n.METRICS_BAR);p.dataset.metricsBar="",p.style.width=`${Math.round(a/s*100)}%`,p.style.background=l,d.appendChild(p),c.appendChild(d),c.appendChild(y("span",n.METRICS_ROW_COUNT,a)),i.appendChild(c)}return i},cn=(o,e)=>{let t=y("div",n.METRICS_GROUP);t.dataset.metricsGroup="overTime",t.appendChild(y("h4",n.METRICS_HEADING,e.metricsOverTime));let i=Math.max(1,...o.map(({count:c})=>c)),s=xt("svg",{class:n.METRICS_CHART,viewBox:`0 0 ${Mo} ${Tt}`,preserveAspectRatio:"none",role:"img","aria-label":`${e.metricsOverTime}: ${o.map(({date:c,count:d})=>`${c} ${d}`).join(", ")}`}),r=Mo/o.length,a=Math.max(2,Math.min(r-3,28));o.forEach(({date:c,count:d},p)=>{let h=Math.max(2,d/i*(Tt-6)),u=xt("rect",{x:p*r+(r-a)/2,y:Tt-h,width:a,height:h,rx:2});u.appendChild(Object.assign(xt("title"),{textContent:`${c}: ${d}`})),s.appendChild(u)}),t.appendChild(s);let l=y("div",n.METRICS_AXIS);return l.appendChild(y("span",null,o[0].date)),o.length>1&&l.appendChild(y("span",null,o[o.length-1].date)),t.appendChild(l),t},dn=(o,e)=>{let t=y("div",n.METRICS_EXPORTS);t.setAttribute("aria-label",o.metricsExportLabel);let i=(s,r,a)=>{let l=y("button",n.METRICS_EXPORT_BTN,r);return l.type="button",l.dataset.export=s,l.addEventListener("click",a),l};return t.appendChild(i("comments",o.metricsExportComments,e.onExportComments)),t.appendChild(i("metrics",o.metricsExportMetrics,e.onExportMetrics)),t.appendChild(i("print",o.metricsPrint,e.onPrint)),t};function Bo(o,e){let{strings:t}=e,i=y("div",n.METRICS_VIEW);if(o.total===0)return i.appendChild(y("p",n.METRICS_EMPTY,t.metricsEmpty)),i;let s=a=>a===null?"\u2014":X(a,t),r=y("div",n.METRICS_TILES);return r.appendChild(Ce(t.metricsTotal,o.total)),r.appendChild(Ce(t.statusResolved,o.resolution.resolvedCount)),r.appendChild(Ce(t.metricsReopened,o.resolution.reopenedCount)),r.appendChild(Ce(t.metricsAverageResolution,s(o.resolution.averageMs))),r.appendChild(Ce(t.metricsMedianResolution,s(o.resolution.medianMs))),i.appendChild(r),i.appendChild(yt("status",t.metricsByStatus,N.map(a=>({label:D(a,t),count:o.byStatus[a],color:F[a]})))),i.appendChild(yt("type",t.metricsByType,[...A.map(a=>({label:w(a,t),count:o.byType[a],color:G[a]})),{label:t.unset,count:o.byType[K],color:Lo}])),i.appendChild(yt("priority",t.metricsByPriority,[...S.map(a=>({label:L(a,t),count:o.byPriority[a],color:z[a]})),{label:t.unset,count:o.byPriority[K],color:Lo}])),o.overTime.length&&i.appendChild(cn(o.overTime,t)),i.appendChild(dn(t,e)),i}var Do='<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>',pn='<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>',hn='<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>',Ge=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.contextExpanded=!0,this.auditExpanded=!1,this.showMetrics=!1,this.editing=null,this.notice=null,this._cardBindings=new Map,this.el=null,this._highlightedEl=null,this._activeMarkerEl=null,this._reactions=null}isOpen(){return!!this.el}open(){this.el||(this.el=document.createElement("div"),this.el.className=n.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(i=>O(i.id,this.editing.commentId));return e?this.editing.replyId==null?e.text||"":(e.replies||[]).find(i=>O(i.id,this.editing.replyId))?.text||"":""}async releaseEditor(){if(!this.editing)return!0;if(this.isDirty()){let e=this.el||this.shadowRoot;if(!await ke(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 ie({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(xo(e.id))}_highlight(e){this._clearHighlight();let t=this._markerFor(e);t&&(t.classList.add(n.HIGHLIGHT),this._highlightedEl=t)}_clearHighlight(){this._highlightedEl?.classList.remove(n.HIGHLIGHT),this._highlightedEl=null}_setActiveMarker(e){if(this._activeMarkerEl?.classList.remove(n.CIRCLE_ACTIVE),this._activeMarkerEl=null,!e)return;let t=this._markerFor(e);t&&(t.classList.add(n.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(i=>O(i.id,this.detailId)):null;if(this._setActiveMarker(t),this.showMetrics){this._cardBindings.clear(),this.el.innerHTML="",this._renderMetrics(e);return}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(i=>O(i.id,e));t&&this._openDetail(t)}_openDetail(e){this.detailId=e.id,e.anchorState==="anchored"&&!e.hidden&&this.callbacks.onOpenDetailScroll(e),this.render(),this.callbacks.onOpenDetail?.(e)}_closeButton(){let e=document.createElement("button");return e.type="button",e.className=n.INBOX_CLOSE,e.setAttribute("aria-label",this.strings.close),e.innerHTML="&times;",e.addEventListener("click",async()=>{this.editing&&!await this.releaseEditor()||this.callbacks.onClose()}),e}_metricsButton(){let e=document.createElement("button");return e.type="button",e.className=n.INBOX_METRICS_BTN,e.textContent=this.strings.metricsOpen,e.setAttribute("aria-label",this.strings.metricsTitle),e.addEventListener("click",async()=>{this.editing&&!await this.releaseEditor()||(this.showMetrics=!0,this.detailId=null,this.render())}),e}_renderMetrics(e){let t=document.createElement("div");t.className=n.INBOX_DETAIL_HEADER;let i=document.createElement("button");i.type="button",i.className=n.INBOX_BACK,i.innerHTML=`${Do}<span>${this.strings.back}</span>`,i.addEventListener("click",()=>{this.showMetrics=!1,this.render()}),t.appendChild(i);let s=document.createElement("div");s.className=n.INBOX_CARD_ACTIONS,s.appendChild(this._closeButton()),t.appendChild(s),this.el.appendChild(t);let r=this._filterSummaryLabel();this.el.appendChild(Bo(se(e),{strings:this.strings,locale:this.locale,onExportComments:()=>this.callbacks.onExportComments(e),onExportMetrics:()=>this.callbacks.onExportMetrics(e),onPrint:()=>this.callbacks.onPrintReport(e,r)}))}_renderList(e){let t=[...this.el.children].find(r=>r.classList.contains(n.INBOX_LIST));if(!t){this.el.innerHTML="",this._cardBindings.clear();let r=document.createElement("div");r.className=n.INBOX_HEADER,this.el.appendChild(r),t=document.createElement("div"),t.className=n.INBOX_LIST,this.el.appendChild(t)}let i=[...this.el.children].find(r=>r.classList.contains(n.INBOX_HEADER)),s=document.createElement("div");s.className=n.INBOX_HEADER_ACTIONS,s.append(this._metricsButton(),this._closeButton()),i.replaceChildren(this._buildFilter(),s),this._reconcileCards(t,e)}_reactionsUi(){return this._reactions||(this._reactions=we({actorKey:()=>this.callbacks.actorKey(),strings:this.strings,onToggle:(e,t)=>{let i=this.getComments().find(s=>(s.replies||[]).includes(e));i?this.callbacks.onToggleReplyReaction(i.id,e.id,t):this.callbacks.onToggleCommentReaction(e.id,t)}})),this._reactions}_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.history?.length??0,e.history?.at(-1)?.at??null,e.anchorState,e.hidden===!0,e.page,e.screenshots?.length??0,rt(e).map(({emoji:t,authors:i})=>[t,i.length])])}_reconcileCards(e,t){for(let r of[...e.children])(r.classList.contains(n.INBOX_NOTICE)||r.classList.contains(n.INBOX_EMPTY))&&r.remove();let i=[];if(this.notice){let r=document.createElement("div");r.className=n.INBOX_NOTICE,r.setAttribute("role","status"),r.textContent=this.notice,i.push(r)}let s=new Set;if(t.length===0)i.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),i.push(d)}for(let r of[...this._cardBindings.keys()])s.has(r)||this._cardBindings.delete(r);for(i.forEach((r,a)=>{e.children[a]!==r&&e.insertBefore(r,e.children[a]??null)});e.children.length>i.length;)e.lastElementChild.remove()}_buildEmptyState(){let e=document.createElement("div");e.className=n.INBOX_EMPTY;let t=document.createElement("div");t.className=n.INBOX_EMPTY_ICON,t.setAttribute("aria-hidden","true"),e.appendChild(t);let i=this.getComments().length>0,s=document.createElement("div");if(s.className=n.INBOX_EMPTY_TITLE,s.textContent=i?this.strings.inboxNoMatches:this.strings.inboxEmptyTitle,e.appendChild(s),i){let p=document.createElement("button");return p.type="button",p.className=n.INBOX_EMPTY_ACTION,p.textContent=this.strings.filterClear,p.addEventListener("click",()=>{this._resetFilters()}),e.appendChild(p),e}let r=document.createElement("div");r.className=n.INBOX_EMPTY_TEXT;let[a,l]=String(this.strings.inboxEmptyHintTemplate).split("{n}"),c=document.createElement("kbd");c.className=n.INBOX_EMPTY_KBD,c.textContent=ft(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=n.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(D(this.statusFilter,this.strings)),this.typeFilter!=="all"&&e.push(w(this.typeFilter,this.strings)),this.priorityFilter!=="all"&&e.push(L(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=n.INBOX_FILTER_GROUP;let d=document.createElement("div");d.className=n.INBOX_FILTER_SECTION,d.textContent=e,c.appendChild(d);let p=document.createElement("div");p.className=n.INBOX_FILTER_CHIPS,p.setAttribute("role",a?"group":"radiogroup"),p.setAttribute("aria-label",e);for(let h of i){let u=r===h,f=document.createElement("button");f.type="button",f.className=n.INBOX_FILTER_CHIP,f.dataset[t]=h,f.setAttribute("role",a?"switch":"radio"),f.setAttribute("aria-checked",String(u)),f.textContent=s(h),f.addEventListener("click",m=>{m.stopPropagation(),l(a&&u?"all":h),this.render()}),p.appendChild(f)}return c.appendChild(p),c}_buildFilter(){let e=document.createElement("div");e.className=n.INBOX_FILTER+"-wrapper";let t=document.createElement("button");t.type="button",t.className=n.INBOX_FILTER,t.setAttribute("aria-haspopup","true"),t.setAttribute("aria-expanded","false"),t.innerHTML=`<span>${this._filterSummaryLabel()}</span>${Pe}`;let i=document.createElement("div");i.className=n.INBOX_FILTER_MENU,i.setAttribute("role","group"),i.setAttribute("aria-label",this.strings.filterTitle),V(t,i);let s=document.createElement("div");s.className=n.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=n.INBOX_FILTER_CLEAR,a.textContent=this.strings.filterClear,a.disabled=!this._isFilterActive(),a.addEventListener("click",l=>{l.stopPropagation(),this._resetFilters()}),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:[...N],labelOf:l=>D(l,this.strings),selected:this.statusFilter,onSelect:l=>this.statusFilter=l})),i.appendChild(this._buildFilterGroup({title:this.strings.filterByType,dataAttr:"filterType",values:[...A],labelOf:l=>w(l,this.strings),selected:this.typeFilter,onSelect:l=>this.typeFilter=l})),i.appendChild(this._buildFilterGroup({title:this.strings.filterByPriority,dataAttr:"filterPriority",values:[...S],labelOf:l=>L(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=n.INBOX_CARD,e.status==="resolved"&&i.classList.add(`${n.INBOX_CARD}--resolved`),i.dataset.commentId=e.id;let s=document.createElement("div");s.className=n.INBOX_CARD_HEADER,s.appendChild(ge(e.author,e.createdAt,this.strings,this.locale,e.editedAt)),i.appendChild(s);let r=document.createElement("div");if(r.className=n.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 d=document.createElement("div");d.className=n.INBOX_CARD_TEXT,d.textContent=e.text,i.appendChild(d)}if(e.screenshots?.length){let d=Ee(e.screenshots,this.strings);$(d,p=>this.callbacks.onShowLightbox(p)),i.appendChild(d)}let l=Et(e,this.strings,{includeClassification:!1});l&&i.appendChild(l),i.appendChild(this._reactionsUi().bar(e));let c=this._buildTag(e);if(c&&i.appendChild(c),t){i.setAttribute("role","button"),i.setAttribute("tabindex","0");let d=()=>e.anchorState==="inactive"?this.callbacks.onNavigateToPage(e):this._openDetail(e),p=document.createElement("button");p.type="button",p.className=n.INBOX_CARD_REPLY_LINK,p.textContent=this.strings.replyLink,p.addEventListener("click",h=>{h.stopPropagation(),d()}),i.appendChild(p),i.addEventListener("click",d),i.addEventListener("keydown",h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),d())}),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=n.INBOX_CARD_TAG,i.textContent=t,i}_buildCardActions(e){return De(e,{strings:this.strings,can:this.callbacks.can,reactions:this._reactionsUi(),onCopy:t=>oe(Xe(t,{viewportWidth:window.innerWidth,viewportHeight:window.innerHeight,strings:this.strings})),onCopyLink:t=>oe(Q(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!=null&&O(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=n.INBOX_DETAIL_HEADER;let r=document.createElement("button");r.type="button",r.className=n.INBOX_BACK,r.innerHTML=`${Do}<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=n.INBOX_CARD_ACTIONS;let l=(u,f,m)=>{let g=document.createElement("button");g.type="button",g.className=n.INBOX_NAV_BTN,g.setAttribute("aria-label",f),g.title=f,g.innerHTML=u;let E=t[m];return g.disabled=!E,E&&g.addEventListener("click",async()=>{this.editing&&!await this.releaseEditor()||this._openDetail(E)}),g};a.appendChild(l(pn,this.strings.prevComment,i-1)),a.appendChild(l(hn,this.strings.nextComment,i+1)),a.appendChild(this._closeButton()),s.appendChild(a),this.el.appendChild(s);let c=document.createElement("div");c.className=n.INBOX_DETAIL,c.appendChild(this._buildCard(e,{interactive:!1}));let d=He(e,{strings:this.strings,onShowLightbox:u=>this.callbacks.onShowLightbox(u),collapsible:!0,expanded:this.contextExpanded,onToggle:u=>{this.contextExpanded=u}});d&&c.appendChild(d);let p=wo(e,{strings:this.strings,locale:this.locale,open:this.auditExpanded,onToggle:u=>{this.auditExpanded=u}});p&&c.appendChild(p);let h=document.createElement("div");h.className=n.INBOX_REPLIES;for(let u of e.replies||[]){let f=this.editing&&String(this.editing.commentId)===String(e.id)&&String(this.editing.replyId)===String(u.id),m=be(u,this.strings,this.locale,{commentId:e.id,can:this.callbacks.can,onDelete:(g,E)=>{this.callbacks.onDeleteReply(e.id,g.id)&&E.remove()},onEdit:g=>this.startEditing(e.id,g.id),editing:f?this._editorHandlers():null,reactions:this._reactionsUi()});$(m,g=>this.callbacks.onShowLightbox(g)),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}=$e({areaClassName:n.THREAD_INPUT_AREA,inputTag:"input",inputClassName:n.THREAD_INPUT,inputPlaceholder:this.strings.replyPlaceholder},this.strings),c=[],d=()=>{ne(s,c,{strings:this.strings,onShow:h=>this.callbacks.onShowLightbox(h),rerender:()=>d()})};r.addEventListener("click",()=>a.click()),re(a,()=>c,d,h=>this.callbacks.onTransformScreenshot(h,e.id));let p=()=>{let h=i.value.trim();!h&&c.length===0||(this.callbacks.onReply(e,h,[...c]),c=[],this.render())};return l.addEventListener("click",p),i.addEventListener("keydown",h=>{h.key==="Enter"&&!h.shiftKey&&(h.preventDefault(),p())}),t}};var ko=",",un=`\r
9
+ `,mn=/^[=+\-@\t\r]/,Po=o=>{if(o==null)return"";let e=String(o),t=mn.test(e)?`'${e}`:e;return/["\n\r,]/.test(t)?`"${t.replace(/"/g,'""')}"`:t};function Ot(o,e){let t=e.map(s=>Po(s.label)).join(ko),i=o.map(s=>e.map(r=>Po(s[r.key])).join(ko));return[t,...i].join(un)}var $o=["id","page","author","authorId","text","status","type","priority","tags","createdAt","resolvedAt","resolutionHours","reopened","replies"],It=o=>o.map(e=>({key:e,label:e})),Ho=["section","key","value"];function Xo(o){return(o||[]).map(e=>({id:String(e.id),page:e.page||"",author:e.author||"",authorId:e.authorId||"",text:e.text||"",status:e.status||"open",type:e.type||"",priority:e.priority||"",tags:(e.tags||[]).join(" "),createdAt:e.createdAt||"",resolvedAt:e.resolvedAt||"",resolutionHours:ae(ee(e)),reopened:j(e).length>1?"yes":"no",replies:(e.replies||[]).length}))}function Uo(o){let e=[{section:"total",key:"",value:o.total}],t=(i,s)=>{for(let[r,a]of Object.entries(s))e.push({section:i,key:r,value:a})};t("status",o.byStatus),t("type",o.byType),t("priority",o.byPriority);for(let{date:i,count:s}of o.overTime)e.push({section:"perDay",key:i,value:s});return e.push({section:"resolution",key:"resolvedCount",value:o.resolution.resolvedCount},{section:"resolution",key:"reopenedCount",value:o.resolution.reopenedCount},{section:"resolution",key:"averageHours",value:ae(o.resolution.averageMs)},{section:"resolution",key:"medianHours",value:ae(o.resolution.medianMs)}),e}function Rt(o,e){let t=new Blob(["\uFEFF",e],{type:"text/csv;charset=utf-8"}),i=URL.createObjectURL(t),s=document.createElement("a");s.href=i,s.download=o,s.click(),URL.revokeObjectURL(i)}var fn="helldots-report-styles",U=(o,e,t,i)=>{let s=o.createElement(e);return t&&(s.className=t),i!==void 0&&(s.textContent=String(i)),s},At=(o,e,t,i)=>{let s=U(o,"table","report-table");s.appendChild(U(o,"caption",null,e));let r=o.createElement("thead"),a=o.createElement("tr");for(let c of i)a.appendChild(U(o,"th",null,c));r.appendChild(a),s.appendChild(r);let l=o.createElement("tbody");for(let[c,d]of t){let p=o.createElement("tr");p.appendChild(U(o,"th",null,c)),p.appendChild(U(o,"td",null,d)),l.appendChild(p)}return s.appendChild(l),s},Fo=o=>o===null?"\u2014":R("{n} h",ae(o)),gn=(o,e,{strings:t,locale:i,scope:s})=>{let r=o.body;r.className="report",r.appendChild(U(o,"h1","report-title",t.metricsTitle));let a=U(o,"p","report-meta");if(a.textContent=R(t.metricsGeneratedTemplate,new Intl.DateTimeFormat(i,{dateStyle:"long",timeStyle:"short"}).format(new Date)),r.appendChild(a),s){let c=U(o,"p","report-meta");c.textContent=`${t.metricsScope}: ${s}`,r.appendChild(c)}r.appendChild(At(o,t.metricsTitle,[[t.metricsTotal,e.total],[t.statusResolved,e.resolution.resolvedCount],[t.metricsReopened,e.resolution.reopenedCount],[t.metricsAverageResolution,Fo(e.resolution.averageMs)],[t.metricsMedianResolution,Fo(e.resolution.medianMs)]],[t.metricsCategory,t.metricsCount]));let l=(c,d,p,h)=>At(o,c,d.map(u=>[h(u),p[u]??0]),[t.metricsCategory,t.metricsCount]);r.appendChild(l(t.metricsByStatus,N,e.byStatus,c=>D(c,t))),r.appendChild(l(t.metricsByType,[...A,"unset"],e.byType,c=>c==="unset"?t.unset:w(c,t))),r.appendChild(l(t.metricsByPriority,[...S,"unset"],e.byPriority,c=>c==="unset"?t.unset:L(c,t))),e.overTime.length&&r.appendChild(At(o,t.metricsOverTime,e.overTime.map(({date:c,count:d})=>[c,d]),[t.metricsDate,t.metricsCount]))};function Go(o,{strings:e,locale:t,css:i,scope:s}){let r=document.createElement("iframe");r.setAttribute("aria-hidden","true"),r.setAttribute("title",e.metricsTitle),r.style.position="absolute",r.style.width="0",r.style.height="0",r.style.border="0",r.style.left="-9999px",document.body.appendChild(r);let a=r.contentDocument,l=r.contentWindow;a.title=e.metricsTitle,de(a,i,fn),gn(a,o,{strings:e,locale:t,scope:s});let c=()=>r.remove();return l.addEventListener("afterprint",c,{once:!0}),setTimeout(()=>l.print?.(),0),r}var En=o=>{let e=new Set;for(let t of o){let i=String(t).trim().toLowerCase();i&&e.add(i)}return[...e]},zo=o=>o.filter(e=>typeof e=="string"),bn=.6,_n={"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","reaction:toggled":"onReactionToggled"},St=class{constructor(e={}){this.comments=[],this.commentMode=!1,this.isMac=mt(),this.options={shortcutKey:e.shortcutKey||(this.isMac?"c":"C"),shortcutModifier:e.shortcutModifier||"alt",autoScreenshot:e.autoScreenshot!==!1,embedCrossOriginFonts:e.embedCrossOriginFonts===!0,fastCapture:e.fastCapture===!0,skipIframeContent:e.skipIframeContent===!0,...e},this.locale=this.options.locale||qt(),this.strings=Zt(this.locale),this.markers=null,this._captureFlow=null,this._regionCapturePending=!1,this._storedCache=null,this._popover=null,this._pendingDetailId=null,this._requestedDetailId=null,this._origin="host",this._deferredLoad=null,document.readyState==="loading"?(this._onDomReady=()=>this.initOverlay(),document.addEventListener("DOMContentLoaded",this._onDomReady)):this.initOverlay()}initOverlay(){this.shadowRoot=vt(),this.toolbar=Co(this.options,this.strings),this.commentBox=To(this.strings),this.overlay=document.createElement("div"),this.overlay.className=n.COMMENT_OVERLAY,this.shadowRoot.appendChild(this.overlay),this.shadowRoot.appendChild(this.toolbar),this.shadowRoot.appendChild(this.commentBox),this.commentBtn=this.toolbar.querySelector(`.${n.TOOLBAR_COMMENT_BTN}`),this.inboxBtn=this.toolbar.querySelector(`.${n.TOOLBAR_MENU_BTN}`),this.eyeBtn=this.toolbar.querySelector(`.${n.TOOLBAR_EYE_BTN}`),this.markersHidden=!1,this.submitButton=this.shadowRoot.getElementById(x.SUBMIT_COMMENT),this.commentInput=this.shadowRoot.getElementById(x.COMMENT_INPUT),this.attachImageBtn=this.commentBox.querySelector(`.${n.ATTACH_IMAGE_BTN}`),this.attachImageInput=this.shadowRoot.getElementById(x.ATTACH_IMAGE_INPUT),this._captureFlow=new xe({host:this.shadowRoot,autoScreenshot:this.options.autoScreenshot,embedCrossOriginFonts:this.options.embedCrossOriginFonts,fastCapture:this.options.fastCapture,skipIframeContent:this.options.skipIframeContent,captureTimeout:this.options.captureTimeout,onRegionCaptured:e=>{this._pendingScreenshots||(this._pendingScreenshots=[]),this._pendingScreenshots.length<le&&this._pendingScreenshots.push(e)},onRegionPending:e=>{this._regionCapturePending=e,this._updateScreenshotsPreview()},onPlace:(e,t,i)=>this._placeCommentAtPoint(e,t,i),onError:e=>this._reportError(e,"capture")}),this._popover=new Ue({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()},actorKey:()=>this._actorKey(),can:(e,t)=>this.can(e,t),transformScreenshot:(e,t)=>this._transformScreenshot(e,"attachment",t),actions:this._userActions({addReply:(e,t,i)=>this.addReply(e,t,i),deleteReply:(e,t)=>this.deleteReply(e,t),editComment:(e,t)=>this.editComment(e,t),editReply:(e,t,i)=>this.editReply(e,t,i),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),toggleCommentReaction:(e,t)=>this.toggleCommentReaction(e,t),toggleReplyReaction:(e,t,i)=>this.toggleReplyReaction(e,t,i)})}),this.markers=new Fe({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();try{localStorage.getItem(Ze)==="true"&&this._setMarkersHidden(!0)}catch{}if(this.bindEventListeners(),this.setupKeyboardShortcut(),this.injectStyles(),this._pendingDetailId=this._readPendingDetailId(),this.options.persistence==="localStorage"&&(this._storedCache=ot(),this.loadComments(this._storedCache),this._storageHandler=e=>{(e.key===Ie||e.key===null)&&(this._storedCache=null)},window.addEventListener("storage",this._storageHandler)),this._deferredLoad){let e=this._deferredLoad;this._deferredLoad=null,this.loadComments(e)}this._openPendingDetail(),this.options.autoDetectNavigation&&(this._popstateHandler=()=>this.notifyNavigation(),window.addEventListener("popstate",this._popstateHandler)),this._notifyReady()}_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(Re),t!=null&&sessionStorage.removeItem(Re)}catch{}return e??t}_linkParam(){return this.options.linkParam||fe}_openPendingDetail(){let e=this._pendingDetailId;if(!e)return;let t=this._findComment(e);if(!t){this.showInbox(),this.inboxView?.showNotice(this.strings.commentNotFound),this._requestPendingDetail(e);return}this._pendingDetailId=null,this._requestedDetailId=null,this.showInbox(),this.inboxView.clearNotice(),this.inboxView.openDetail(t.id)}_requestPendingDetail(e){let t=this.options.onCommentRequested;if(typeof t!="function"||this._requestedDetailId!==null&&O(this._requestedDetailId,e))return;this._requestedDetailId=e;let i;try{i=t(e)}catch(s){this._reportError(s,"link");return}!i||typeof i.then!="function"||i.then(()=>this._openPendingDetail(),s=>{this._reportError(s,"link"),this._openPendingDetail()})}_notifyReady(){let e=this.options.onReady;if(typeof e=="function")try{e(this)}catch(t){console.warn("HellDots: onReady handler threw",t)}}_asUser(e){let t=this._origin;this._origin="user";try{return e()}finally{this._origin=t}}_userActions(e){let t={};for(let[i,s]of Object.entries(e))t[i]=typeof s=="function"?(...r)=>this._asUser(()=>s(...r)):s;return t}_reportError(e,t){let i=this.options.onError;if(typeof i=="function")try{i(e,t)}catch(s){console.warn("HellDots: onError handler threw",s)}}async _transformScreenshot(e,t,i){let s=this.options.transformScreenshot;if(typeof s!="function"||!e)return e;try{let r=await s(e,{kind:t,commentId:i});if(typeof r!="string"||!r)throw new Error("HellDots: transformScreenshot resolved to no usable string");return r}catch(r){return this._reportError(r,"transform"),e}}_emit(e,t,i,s){let r={origin:this._origin,...s},a=_n[e],l=this.options[a];if(typeof l=="function")try{l(...t,r)}catch(c){console.warn(`HellDots: ${a} handler threw`,c)}if(typeof this.options.onChange=="function")try{this.options.onChange({type:e,...i,...r})}catch(c){console.warn("HellDots: onChange handler threw",c)}}commentLink(e){let t=this._findComment(e);return t?Q(t,this._linkParam()):null}_readStoredCached(){return this._storedCache||(this._storedCache=ot()),this._storedCache}_syncStorage(){if(this.options.persistence!=="localStorage")return;let e=it(this._readStoredCached(),this.serializeComments(),location.pathname);Ae(e)||this._reportError(new Error("HellDots: comments could not be persisted to localStorage"),"storage"),this._storedCache=e}bindEventListeners(){this.commentBtn.addEventListener("click",()=>this.toggleCommentMode()),this.inboxBtn.addEventListener("click",()=>this.toggleInbox()),this.eyeBtn?.addEventListener("click",()=>this._setMarkersHidden(!this.markersHidden)),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()}),re(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(),i=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;i&&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?.(`.${n.CIRCLE}`)||t?.closest?.(`.${n.TOOLTIP}`)||t?.closest?.(`.${n.THREAD_POPOVER}`)||t?.closest?.(`.${n.INBOX_PANEL}`)||t?.closest?.(`.${n.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))}}_regionTarget(e,t,i){if(typeof document.elementsFromPoint!="function")return null;let s=e.width*e.height;if(!(s>0))return null;for(let r of document.elementsFromPoint(t,i)){if(r.tagName.toLowerCase()===k.toLowerCase())continue;let a=r.getBoundingClientRect(),l=Math.min(a.right,e.left+e.width)-Math.max(a.left,e.left),c=Math.min(a.bottom,e.top+e.height)-Math.max(a.top,e.top);if(!(l<=0||c<=0)&&l*c/s>=bn)return r}return null}async _placeCommentAtPoint(e,t,i){this._captureFlow.armClickCapture();let s=this.overlay.style.pointerEvents;this.overlay.style.pointerEvents="none";let r=(i?this._regionTarget(i,e,t):null)||document.elementFromPoint(e,t);this.overlay.style.pointerEvents=s||"";let a=r?.closest?.(Ut.CONTAINER)||document.body,l=a.getBoundingClientRect(),c=l.width>0?(e-l.left)/l.width:0,d=l.height>0?(t-l.top)/l.height:0,p=io(a,c,d);p.targetSelector=r&&r!==a?oo(r):null,this.currentPosition={container:a,relativeX:c,relativeY:d,anchor:p,target:r||a},this.createPreviewCircle(e,t),document.body.classList.remove(n.COMMENT_CURSOR),(this._pendingScreenshots?.length>0||this._regionCapturePending)&&this._updateScreenshotsPreview(),this.showCommentBox(e,t)}_updateScreenshotsPreview(){let e=this.commentBox.querySelector(`.${n.SCREENSHOTS_CONTAINER}`);e&&ne(e,this._pendingScreenshots||[],{strings:this.strings,onShow:t=>this.showLightbox(t),rerender:()=>this._updateScreenshotsPreview(),pending:this._regionCapturePending?1:0})}_clearScreenshotPreview(){this._pendingScreenshots=[],this._regionCapturePending=!1;let e=this.commentBox.querySelector(`.${n.SCREENSHOTS_CONTAINER}`);e&&(e.innerHTML="",e.classList.remove(n.ACTIVE))}showCommentBox(e,t){this.commentBox.style.display="block";let s=P/2,r=s+10,a=window.innerWidth,l=window.innerHeight,c=this.commentBox.getBoundingClientRect(),d=c.width||400,p=e+s,h=t+s,u=p+r,f=h-s;u+d>a&&(u=p-r-d),u=Math.min(u,a-d-10),u=Math.max(10,u),f+c.height>l&&(f=l-c.height-10),f=Math.max(10,f),this.commentBox.style.left=`${u}px`,this.commentBox.style.top=`${f}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(n.COMMENT_CURSOR)}_setMarkersHidden(e){if(this.markersHidden=e,this.overlay.classList.toggle(n.MARKERS_HIDDEN,e),e&&(this.closeThreadPopover(),this.shadowRoot.querySelectorAll(`.${n.TOOLTIP}`).forEach(t=>t.remove())),this.eyeBtn){let t=e?this.strings.toolbarShowComments:this.strings.toolbarHideComments;this.eyeBtn.setAttribute("aria-label",t),this.eyeBtn.innerHTML=e?_o:gt;let i=this.eyeBtn.closest(`.${n.TOOLBAR_ACTION_WRAPPER}`)?.querySelector(`.${n.TOOLBAR_TEXT}`);i&&(i.textContent=t)}try{localStorage.setItem(Ze,String(e))}catch{}}toggleCommentMode(){this.commentMode=!this.commentMode,this.commentMode&&this.closeInbox(),this.commentMode&&this.markersHidden&&this._setMarkersHidden(!1),this.commentBtn?.classList.toggle(n.ACTIVE,this.commentMode),this.commentBtn?.setAttribute("aria-pressed",String(this.commentMode)),this.overlay.classList.toggle(n.ACTIVE,this.commentMode),document.body.classList.toggle(n.COMMENT_CURSOR,this.commentMode),this.commentMode||this.hideCommentBox(),this._notify("onCommentModeChanged",[this.commentMode])}async saveComment(){if(!this._saving&&!(!this.commentInput.value.trim()||!this.currentPosition)){this._saving=!0,this.submitButton&&(this.submitButton.disabled=!0);try{await this._saveCommentNow()}finally{this._saving=!1,this.submitButton&&(this.submitButton.disabled=!1)}}}async _saveCommentNow(){let e=this.currentPosition,t=this.commentInput.value,i=await this._captureFlow.consumePending();if(this.currentPosition!==e)return;let s=nt(),r=this._pendingScreenshots?[...this._pendingScreenshots]:[],[a,l]=await Promise.all([this._transformScreenshot(i,"context",s),Promise.all(r.map(h=>this._transformScreenshot(h,"attachment",s)))]);if(this.currentPosition!==e)return;let c={text:t,container:e.container,relativeX:e.relativeX,relativeY:e.relativeY,anchor:e.anchor,anchorState:"anchored",target:e.target,hidden:!1,status:"open",page:location.pathname,id:s,replies:[],author:this.options.user?.name||this.strings.anonymous,authorId:B(this.options.user?.id)||null,createdAt:new Date().toISOString(),screenshots:l,type:this.commentBox.classify?.getType()??null,priority:this.commentBox.classify?.getPriority()??null,tags:[],resolvedAt:null,context:Vt(),contextScreenshot:a};Y(c,"created",this._actor()),this.comments.push(c),this._syncStorage();let d=this._serializeComment(c);this._asUser(()=>this._emit("comment:created",[d],{comment:d})),this.renderCommentCircle(c),this.hideCommentBox(),this.toggleCommentMode();let p=this._circles.get(String(c.id));p&&this.showThreadPopover(p,c)}renderCommentCircle(e){this.markers.render(e)}_wireMarker(e,t){e.addEventListener("mouseenter",()=>this.showCommentTooltip(e,t)),e.addEventListener("mouseleave",()=>{setTimeout(()=>{let i=this._tooltipEl(t.id);i&&!i.matches(":hover")&&i.remove()},250)}),e.addEventListener("click",i=>{if(i.stopPropagation(),this._tooltipEl(t.id)?.remove(),this.activeThreadPopover?.dataset.for===String(t.id)){this.closeThreadPopover();return}this.showThreadPopover(e,t)}),e.addEventListener("keydown",i=>{(i.key==="Enter"||i.key===" ")&&(i.preventDefault(),e.click())})}showCommentTooltip(e,t){if(this.shadowRoot.querySelector(`.${n.THREAD_POPOVER}[data-for="${W(t.id)}"]`)||this._tooltipEl(t.id))return;let s=Io(t,this.strings,this.locale);this.shadowRoot.appendChild(s),$(s,r=>this.showLightbox(r)),setTimeout(()=>{_e(s,e)},10),s.querySelector(`.${n.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 Ge({shadowRoot:this.shadowRoot,strings:this.strings,locale:this.locale,currentPage:location.pathname,getComments:()=>this.comments,options:this.options,callbacks:this._userActions({onActivateCommentMode:()=>{this.closeInbox(),this.commentMode||this.toggleCommentMode()},onOpenDetailScroll:e=>this.scrollMarkerIntoView(e),onOpenDetail:e=>this._notifyCommentOpened(e),onTransformScreenshot:(e,t)=>this._transformScreenshot(e,"attachment",t),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._popover.refreshCommentViews(e)},onEditReply:(e,t,i)=>{this.editReply(e,t,i)&&this._popover.refreshCommentViews(e)},actorKey:()=>this._actorKey(),can:(e,t)=>this.can(e,t),onToggleCommentReaction:(e,t)=>this.toggleCommentReaction(e,t),onToggleReplyReaction:(e,t,i)=>this.toggleReplyReaction(e,t,i),onExportComments:e=>this.exportCommentsCsv(e),onExportMetrics:e=>this.exportMetricsCsv(e),onPrintReport:(e,t)=>this.printMetricsReport(e,t),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(Re,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),this._notifyCommentOpened(t)}_notifyCommentOpened(e){e&&this._notify("onCommentOpened",[this._serializeComment(e)])}_notify(e,t){let i=this.options[e];if(typeof i=="function")try{i(...t)}catch(s){console.warn(`HellDots: ${e} handler threw`,s)}}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=n.LIGHTBOX,t.setAttribute("role","dialog"),t.setAttribute("aria-modal","true"),t.setAttribute("aria-label",this.strings.screenshotPreview);let i=document.createElement("img");i.className=n.LIGHTBOX_IMG,i.src=e,i.alt=this.strings.screenshotPreview;let s=document.createElement("button");s.type="button",s.className=n.LIGHTBOX_CLOSE,s.setAttribute("aria-label",this.strings.close),s.innerHTML="&times;",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,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?.(`.${n.LIGHTBOX}`)}_findComment(e){return this.comments.find(t=>O(t.id,e))}_tooltipEl(e){return this.shadowRoot?.querySelector(`.${n.TOOLTIP}[data-for="${W(e)}"]`)??null}addReply(e,t,i=[]){let s=typeof e=="object"&&e!==null?e:this._findComment(e);if(!s)return null;s.replies||(s.replies=[]);let r={id:nt(),editedAt:null,text:t,author:this.options.user?.name||this.strings.anonymous,authorId:B(this.options.user?.id)||null,timestamp:new Date().toISOString(),screenshots:i};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 i=this._findComment(e),s=i?.replies?.findIndex(d=>O(d.id,t))??-1;if(s<0)return!1;let r=me(i.replies[s],i.id);if(!this._permits("delete:reply",r))return!1;let[a]=i.replies.splice(s,1);this._syncStorage();let l=this._serializeComment(i),c=this._serializeReply(a);return this._emit("reply:deleted",[l,c],{comment:l,reply:c}),!0}editComment(e,t){let i=this._findComment(e),s=String(t??"").trim();if(!i||!s||s===i.text||!this._permits("edit:comment",ue(i)))return!1;i.text=s,i.editedAt=new Date().toISOString(),Y(i,"edited",this._actor()),this._circles.get(String(i.id))?.setAttribute("aria-label",`${this.strings.commentAriaLabelPrefix}${i.text}`),this._syncStorage();let r=this._serializeComment(i);return this._emit("comment:edited",[r],{comment:r}),!0}editReply(e,t,i){let s=this._findComment(e),r=s?.replies?.find(d=>O(d.id,t)),a=String(i??"").trim();if(!r||!a||a===r.text||!this._permits("edit:reply",me(r,s.id)))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:i,authorId:s,timestamp:r,screenshots:a,editedAt:l,reactions:c=null}){return{id:e,text:t,author:i,authorId:s||null,timestamp:r,screenshots:a||[],editedAt:l||null,reactions:lt(c)}}_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,authorId:e.authorId||null,history:fo(e.history),createdAt:e.createdAt,screenshots:e.screenshots||[],status:e.status||"open",type:e.type||null,priority:e.priority||null,tags:e.tags?[...e.tags]:[],reactions:lt(e.reactions),resolvedAt:e.resolvedAt||null,context:e.context?{...e.context}:null,contextScreenshot:e.contextScreenshot||null}}setCommentStatus(e,t){if(!N.includes(t))return!1;let i=this._findComment(e);if(!i)return!1;if(i.status===t)return!0;let s=i.status;i.status=t,i.resolvedAt=t==="resolved"?new Date().toISOString():null,Y(i,"status",this._actor(),{from:s,to:t});let r=this._circles.get(String(i.id));r&&this.updateCommentPosition(i,r),this._syncStorage(),this.inboxView?.isOpen()&&this.inboxView.refresh();let a=this._serializeComment(i);return this._emit("comment:status-changed",[a],{comment:a},{from:s,to:t}),!0}setUser(e){return e!=null&&(typeof e!="object"||typeof e.name!="string"||!e.name.trim())?!1:(this.options.user=e??void 0,this._popover?.close(),this.inboxView?.isOpen()&&this.inboxView.refresh(),!0)}_actor(){return uo(this.options.user,this.strings)}_actorKey(){return ve(this.options.user,this.strings)}can(e,t){return co({can:this.options.can,action:e,target:t,user:this.options.user,strings:this.strings})}_permits(e,t){return this._origin!=="user"||this.can(e,t)}_commitReaction(e,t){this._syncStorage(),this.inboxView?.isOpen()&&this.inboxView.refresh();let i=this._serializeComment(e),s=t?this._serializeReply(t):null;return this._emit("reaction:toggled",[i,s],{comment:i,reply:s}),!0}toggleCommentReaction(e,t){let i=this._findComment(e);return!i||!at(i,t,this._actorKey())?!1:this._commitReaction(i,null)}toggleReplyReaction(e,t,i){let s=this._findComment(e),r=s?.replies?.find(a=>O(a.id,t));return!r||!at(r,i,this._actorKey())?!1:this._commitReaction(s,r)}_commitUpdate(e,t){this._syncStorage(),this.inboxView?.isOpen()&&this.inboxView.refresh();let i=this._serializeComment(e);return this._emit("comment:updated",[i],{comment:i},t),!0}setCommentType(e,t){if(t!==null&&!A.includes(t))return!1;let i=this._findComment(e);if(!i)return!1;let s=i.type??null;return s===t?!0:(i.type=t,Y(i,"classified",this._actor(),{field:"type",from:s,to:t}),this._commitUpdate(i,{field:"type",from:s,to:t}))}setCommentPriority(e,t){if(t!==null&&!S.includes(t))return!1;let i=this._findComment(e);if(!i)return!1;let s=i.priority??null;return s===t?!0:(i.priority=t,Y(i,"classified",this._actor(),{field:"priority",from:s,to:t}),this._commitUpdate(i,{field:"priority",from:s,to:t}))}setCommentTags(e,t){if(!Array.isArray(t))return!1;let i=this._findComment(e);if(!i)return!1;let s=[...i.tags||[]],r=s.join("\0"),a=En(t);return a.join("\0")===r?!0:(i.tags=a,Y(i,"classified",this._actor(),{field:"tags"}),this._commitUpdate(i,{field:"tags",from:s,to:[...a]}))}getMetrics(){return se(this.serializeComments())}exportCommentsCsv(e){let t=Xo(e||this.serializeComments()),i=Ot(t,It($o));return Rt("helldots-comments.csv",i),i}exportMetricsCsv(e){let t=se(e||this.serializeComments()),i=Ot(Uo(t),It(Ho));return Rt("helldots-metrics.csv",i),i}printMetricsReport(e,t){let i=se(e||this.serializeComments());Go(i,{strings:this.strings,locale:this.locale,css:Wt(),scope:t})}serializeComments(){return this.comments.map(e=>this._serializeComment(e))}deleteComment(e){let t=this._findComment(e);if(!t||!this._permits("delete:comment",ue(t)))return!1;if(this._removeComment(e),this.options.persistence==="localStorage"){let i=it(this._readStoredCached().filter(s=>!O(s.id,e)),this.serializeComments(),location.pathname);Ae(i),this._storedCache=i}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))),i=this._readStoredCached().filter(s=>!t.has(String(s.id)));Ae(i),this._storedCache=i}this.inboxView?.isOpen()&&this.inboxView.refresh()}loadComments(e){let t=0,i=0,s=0;if(!Array.isArray(e))return{anchored:t,orphaned:i,inactive:s};if(!this.markers)return this._deferredLoad=[...this._deferredLoad||[],...e],{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),this._reportError(new Error("HellDots: skipping malformed serialized comment"),"load");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=>({...c,authorId:B(c.authorId)||null,...Array.isArray(c.screenshots)?{screenshots:zo(c.screenshots)}:{},reactions:st(c.reactions)})):[],author:r.author||this.strings.anonymous,authorId:B(r.authorId)||null,history:mo(r.history),createdAt:r.createdAt||new Date().toISOString(),screenshots:Array.isArray(r.screenshots)?zo(r.screenshots):[],status:r.status==="closed"?"resolved":N.includes(r.status)?r.status:"open",type:A.includes(r.type)?r.type:null,priority:S.includes(r.priority)?r.priority:null,tags:Array.isArray(r.tags)?[...r.tags]:[],resolvedAt:r.resolvedAt||null,reactions:st(r.reactions),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?tt(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),i++;let c=this._serializeComment(a);this._emit("comment:anchor-lost",[c],{comment:c})}}return this._openPendingDetail(),{anchored:t,orphaned:i,inactive:s}}notifyNavigation(){let e=location.pathname,t=0,i=0,s=0;if(!this.markers)return{anchored:t,orphaned:i,inactive:s};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?tt(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",i++;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:i,inactive:s}}scrollMarkerIntoView(e){this.markersHidden&&this._setMarkersHidden(!1),this.markers.scrollMarkerIntoView(e)}createPreviewCircle(e,t){this.removePreviewCircle();let i=document.createElement("div");i.className=`${n.CIRCLE} ${n.PREVIEW_CIRCLE}`,i.style.position="absolute";let s=P/2;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){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,this._deferredLoad=null,Ne(),go(),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(n.COMMENT_CURSOR),this._detachStyles(),document.querySelector(k)?.remove()}injectStyles(){this._detachStyles(),this._styleDetachers=[de(this.shadowRoot,Yt(),x.STYLES),de(document,jt(),x.GLOBAL_STYLES)]}_detachStyles(){for(let e of this._styleDetachers??[])e();this._styleDetachers=[]}},Vo=St;function Cn(o={}){let{autoInit:e=!0,...t}=o,i=()=>new Vo(t);return e?i():i}var oa=Cn;export{Vo as CommentOverlay,fe as DEFAULT_LINK_PARAM,Cn as createCommentOverlay,oa as default,ct as readCommentLinkParam};
10
10
  //# sourceMappingURL=helldots.esm.js.map